@moonshot-ai/kimi-code 0.24.2 → 0.26.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 +7651 -3201
- package/dist-web/assets/{CodeBlockNode-Df9vE1bZ.js → CodeBlockNode-JigiL_d4.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-BiluoKas.js → CodeBlockShell.vue_vue_type_style_index_0_lang-CZB03k-a.js} +1 -1
- package/dist-web/assets/DesignSystemView-B-05E4V9.js +13 -0
- package/dist-web/assets/DesignSystemView-B9X_Wri_.css +1 -0
- package/dist-web/assets/{Tooltip-5xFjGt0g.js → Tooltip-Cw3lx-z8.js} +1 -1
- package/dist-web/assets/{arc-Dnx59qWR.js → arc-D2vJFF6c.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-DBpWrZ57.js → architectureDiagram-3BPJPVTR-Df1UeK5E.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-DkT6M00_.js → blockDiagram-GPEHLZMM-Dgdf-zAM.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-Cg7BlfZP.js → c4Diagram-AAUBKEIU-CVS7v_bq.js} +1 -1
- package/dist-web/assets/channel-CkGndlmZ.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-DG3GkhIs.js → chunk-2J33WTMH-DhINJh7R.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-mFuL4qyD.js → chunk-4BX2VUAB-CR40QGad.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-C0MGLKjj.js → chunk-55IACEB6-DPUxa6z0.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-Baip9cBY.js → chunk-727SXJPM-BWvX468K.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-B_MICX9C.js → chunk-AQP2D5EJ-DyFilYHM.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-P6Nt3H0u.js → chunk-FMBD7UC4-Bg8gv0kQ.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-vM3LTmKp.js → chunk-ND2GUHAM-CgyBSWHA.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-hUKMa2zX.js → chunk-QZHKN3VN-DvzUq1dT.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DknrTxU7.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DknrTxU7.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-CoHANoHI.js → cose-bilkent-S5V4N54A-LU19ShHC.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-DZ3-tpA0.js → dagre-BM42HDAG-DiilOzYU.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-sVVmisSp.js → diagram-2AECGRRQ-Dq4mZYTA.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-WCU7ClNI.js → diagram-5GNKFQAL-BMxBErB7.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-p-iMIdgG.js → diagram-KO2AKTUF-Dl1uwLTa.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-BvhDYPBc.js → diagram-LMA3HP47-BLV66BdW.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-C3UcJGVW.js → diagram-OG6HWLK6-BDaRMm08.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-CcWR77tk.js → erDiagram-TEJ5UH35-De2es75Z.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-B84AEAo5.js → flowDiagram-I6XJVG4X-DclyVvkE.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-HzyM30-H.js → ganttDiagram-6RSMTGT7-D0Q-Ia-a.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DJzaqTlt.js → gitGraphDiagram-PVQCEYII-4e9vXj8W.js} +1 -1
- package/dist-web/assets/{index-C71HJFAU.js → index-BBWUkRCO.js} +1 -1
- package/dist-web/assets/index-CMhewTFA.js +325 -0
- package/dist-web/assets/{index-BaDw7JC5.js → index-CR1e9nsD.js} +2 -2
- package/dist-web/assets/index-I7R1SQsL.css +1 -0
- package/dist-web/assets/{index10-CZB6i7OT.js → index10--9NgV5KO.js} +1 -1
- package/dist-web/assets/{index11-D4J7mrqX.js → index11-vhJM9Zd7.js} +1 -1
- package/dist-web/assets/{index5-lb-zFPOO.js → index5-BwxQZskx.js} +1 -1
- package/dist-web/assets/{index6-XVcJQJvG.js → index6-CCep5k45.js} +1 -1
- package/dist-web/assets/{index7-zYh5L7gm.js → index7-BpvJXlrz.js} +1 -1
- package/dist-web/assets/{index8-BBnkw3W9.js → index8-DcnUd6X7.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-Cb4CgzWD.js → infoDiagram-5YYISTIA-DHRABO78.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BiGyvml5.js → ishikawaDiagram-YF4QCWOH-CQvQ04o4.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-D9e-zPlz.js → journeyDiagram-JHISSGLW-BPUe0bJA.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-DRlzV1V8.js → kanban-definition-UN3LZRKU-B4fkPD56.js} +1 -1
- package/dist-web/assets/{linear-BDV37mWq.js → linear-BBpz4kpy.js} +1 -1
- package/dist-web/assets/{mermaid.core-CuWz3x7I.js → mermaid.core-WG0zjqjP.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-BTtrckv5.js → mindmap-definition-RKZ34NQL-6QrrPC-x.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-DbDWMeWy.js → pieDiagram-4H26LBE5-Cbk8F7HI.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CrOQQAIE.js → quadrantDiagram-W4KKPZXB-UCR6ity-.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-BcavKuxq.js → requirementDiagram-4Y6WPE33-P2r_Lr3t.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-ald5-wcg.js → sankeyDiagram-5OEKKPKP-BZztGDG9.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BgRvBCDj.js → sequenceDiagram-3UESZ5HK-Cf4C7Z1l.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-Di3BDQCW.js → stateDiagram-AJRCARHV-3dcgw49E.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU--68MzT1N.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-B4uD09jJ.js → timeline-definition-PNZ67QCA-D8Wuxi_e.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-DnL5fgpC.js → vennDiagram-CIIHVFJN-CJZRHa6X.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-DzIUJ9SW.js → vue.runtime.esm-bundler-ChfQpT4C.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-Dqk9cHYZ.js → wardley-L42UT6IY-eT9HyLJX.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-Hgwz5FgA.js → wardleyDiagram-YWT4CUSO-DDQwL97M.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-TMOow26O.js → xychartDiagram-2RQKCTM6-BGPSWjRq.js} +1 -1
- package/dist-web/boot.js +10 -0
- package/dist-web/index.html +6 -15
- package/package.json +6 -6
- package/dist-web/assets/DesignSystemView-Dyj5tvMI.css +0 -1
- package/dist-web/assets/DesignSystemView-nRvuUAQ4.js +0 -13
- package/dist-web/assets/channel-Dm0wArMZ.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-CZ2lYDqs.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CZ2lYDqs.js +0 -1
- package/dist-web/assets/index-BKjLOXXE.js +0 -325
- package/dist-web/assets/index-DF8geVzs.css +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-3yJrfNOJ.js +0 -1
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-nRvuUAQ4.js","assets/DesignSystemView-Dyj5tvMI.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-Df9vE1bZ.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-BiluoKas.js","assets/index8-BBnkw3W9.js","assets/index11-D4J7mrqX.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function qp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Xt={},Cc=[],xi=()=>{},i4=()=>!1,Rd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jp=e=>e.startsWith("onUpdate:"),bn=Object.assign,iy=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},aE=Object.prototype.hasOwnProperty,un=(e,t)=>aE.call(e,t),xt=Array.isArray,Ac=e=>Xc(e)==="[object Map]",Na=e=>Xc(e)==="[object Set]",Eb=e=>Xc(e)==="[object Date]",cE=e=>Xc(e)==="[object RegExp]",$t=e=>typeof e=="function",Mn=e=>typeof e=="string",ni=e=>typeof e=="symbol",dn=e=>e!==null&&typeof e=="object",ry=e=>(dn(e)||$t(e))&&$t(e.then)&&$t(e.catch),r4=Object.prototype.toString,Xc=e=>r4.call(e),uE=e=>Xc(e).slice(8,-1),Vp=e=>Xc(e)==="[object Object]",Kp=e=>Mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,va=qp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},dE=/-\w/g,$s=Gp(e=>e.replace(dE,t=>t.slice(1).toUpperCase())),fE=/\B([A-Z])/g,Fo=Gp(e=>e.replace(fE,"-$1").toLowerCase()),Yp=Gp(e=>e.charAt(0).toUpperCase()+e.slice(1)),ah=Gp(e=>e?`on${Yp(e)}`:""),Vs=(e,t)=>!Object.is(e,t),Mc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},l4=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Zp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ih=e=>{const t=Mn(e)?Number(e):NaN;return isNaN(t)?e:t};let Tb;const Qp=()=>Tb||(Tb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),hE="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",pE=qp(hE);function Gt(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Mn(s)?yE(s):Gt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Mn(e)||dn(e))return e}const mE=/;(?![^(]*\))/g,gE=/:([^]+)/,vE=/\/\*[^]*?\*\//g;function yE(e){const t={};return e.replace(vE,"").split(mE).forEach(n=>{if(n){const s=n.split(gE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Pe(e){let t="";if(Mn(e))t=e;else if(xt(e))for(let n=0;n<e.length;n++){const s=Pe(e[n]);s&&(t+=s+" ")}else if(dn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function wxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Mn(t)&&(e.class=Pe(t)),n&&(e.style=Gt(n)),e}const kE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",bE=qp(kE);function a4(e){return!!e||e===""}function xE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Fr(e[s],t[s]);return n}function Fr(e,t){if(e===t)return!0;let n=Eb(e),s=Eb(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ni(e),s=ni(t),n||s)return e===t;if(n=xt(e),s=xt(t),n||s)return n&&s?xE(e,t):!1;if(n=dn(e),s=dn(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Fr(e[r],t[r]))return!1}}return String(e)===String(t)}function Xp(e,t){return e.findIndex(n=>Fr(n,t))}const c4=e=>!!(e&&e.__v_isRef===!0),O=e=>Mn(e)?e:e==null?"":xt(e)||dn(e)&&(e.toString===r4||!$t(e.toString))?c4(e)?O(e.value):JSON.stringify(e,u4,2):String(e),u4=(e,t)=>c4(t)?u4(e,t.value):Ac(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[q1(s,i)+" =>"]=o,n),{})}:Na(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>q1(n))}:ni(t)?q1(t):dn(t)&&!xt(t)&&!Vp(t)?String(t):t,q1=(e,t="")=>{var n;return ni(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function wE(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 Is;class d4{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&&Is&&(Is.active?(this.parent=Is,this.index=(Is.scopes||(Is.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=Is;try{return Is=this,t()}finally{Is=n}}}on(){++this._on===1&&(this.prevScope=Is,Is=this)}off(){if(this._on>0&&--this._on===0){if(Is===this)Is=this.prevScope;else{let t=Is;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function _E(e){return new d4(e)}function ly(){return Is}function ay(e,t=!1){Is&&Is.cleanups.push(e)}let Un;const j1=new WeakSet;class $h{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Is&&(Is.active?Is.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,j1.has(this)&&(j1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||h4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Nb(this),p4(this);const t=Un,n=Li;Un=this,Li=!0;try{return this.fn()}finally{m4(this),Un=t,Li=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)dy(t);this.deps=this.depsTail=void 0,Nb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?j1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Sg(this)&&this.run()}get dirty(){return Sg(this)}}let f4=0,qu,ju;function h4(e,t=!1){if(e.flags|=8,t){e.next=ju,ju=e;return}e.next=qu,qu=e}function cy(){f4++}function uy(){if(--f4>0)return;if(ju){let t=ju;for(ju=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;qu;){let t=qu;for(qu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function p4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function m4(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),dy(s),SE(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Sg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(g4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function g4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===cd)||(e.globalVersion=cd,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Sg(e))))return;e.flags|=2;const t=e.dep,n=Un,s=Li;Un=e,Li=!0;try{p4(e);const o=e.fn(e._value);(t.version===0||Vs(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Un=n,Li=s,m4(e),e.flags&=-3}}function dy(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)dy(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function SE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function _xe(e,t){e.effect instanceof $h&&(e=e.effect.fn);const n=new $h(e);t&&bn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function Sxe(e){e.effect.stop()}let Li=!0;const v4=[];function Or(){v4.push(Li),Li=!1}function Rr(){const e=v4.pop();Li=e===void 0?!0:e}function Nb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Un;Un=void 0;try{t()}finally{Un=n}}}let cd=0;class CE{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 Jp{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(!Un||!Li||Un===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Un)n=this.activeLink=new CE(Un,this),Un.deps?(n.prevDep=Un.depsTail,Un.depsTail.nextDep=n,Un.depsTail=n):Un.deps=Un.depsTail=n,y4(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Un.depsTail,n.nextDep=void 0,Un.depsTail.nextDep=n,Un.depsTail=n,Un.deps===n&&(Un.deps=s)}return n}trigger(t){this.version++,cd++,this.notify(t)}notify(t){cy();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{uy()}}}function y4(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)y4(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Lh=new WeakMap,ya=Symbol(""),Cg=Symbol(""),ud=Symbol("");function no(e,t,n){if(Li&&Un){let s=Lh.get(e);s||Lh.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Jp),o.map=s,o.key=n),o.track()}}function Ar(e,t,n,s,o,i){const r=Lh.get(e);if(!r){cd++;return}const l=a=>{a&&a.trigger()};if(cy(),t==="clear")r.forEach(l);else{const a=xt(e),c=a&&Kp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===ud||!ni(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(ud)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ya)),Ac(e)&&l(r.get(Cg)));break;case"delete":a||(l(r.get(ya)),Ac(e)&&l(r.get(Cg)));break;case"set":Ac(e)&&l(r.get(ya));break}}uy()}function AE(e,t){const n=Lh.get(e);return n&&n.get(t)}function Qa(e){const t=nn(e);return t===e?t:(no(t,"iterate",ud),Zo(e)?t:t.map(Oi))}function em(e){return no(e=nn(e),"iterate",ud),e}function Qi(e,t){return Br(e)?zc(xl(e)?Oi(t):t):Oi(t)}const ME={__proto__:null,[Symbol.iterator](){return V1(this,Symbol.iterator,e=>Qi(this,e))},concat(...e){return Qa(this).concat(...e.map(t=>xt(t)?Qa(t):t))},entries(){return V1(this,"entries",e=>(e[1]=Qi(this,e[1]),e))},every(e,t){return hr(this,"every",e,t,void 0,arguments)},filter(e,t){return hr(this,"filter",e,t,n=>n.map(s=>Qi(this,s)),arguments)},find(e,t){return hr(this,"find",e,t,n=>Qi(this,n),arguments)},findIndex(e,t){return hr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return hr(this,"findLast",e,t,n=>Qi(this,n),arguments)},findLastIndex(e,t){return hr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return hr(this,"forEach",e,t,void 0,arguments)},includes(...e){return K1(this,"includes",e)},indexOf(...e){return K1(this,"indexOf",e)},join(e){return Qa(this).join(e)},lastIndexOf(...e){return K1(this,"lastIndexOf",e)},map(e,t){return hr(this,"map",e,t,void 0,arguments)},pop(){return Su(this,"pop")},push(...e){return Su(this,"push",e)},reduce(e,...t){return Ib(this,"reduce",e,t)},reduceRight(e,...t){return Ib(this,"reduceRight",e,t)},shift(){return Su(this,"shift")},some(e,t){return hr(this,"some",e,t,void 0,arguments)},splice(...e){return Su(this,"splice",e)},toReversed(){return Qa(this).toReversed()},toSorted(e){return Qa(this).toSorted(e)},toSpliced(...e){return Qa(this).toSpliced(...e)},unshift(...e){return Su(this,"unshift",e)},values(){return V1(this,"values",e=>Qi(this,e))}};function V1(e,t,n){const s=em(e),o=s[t]();return s!==e&&!Zo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const EE=Array.prototype;function hr(e,t,n,s,o,i){const r=em(e),l=r!==e&&!Zo(e),a=r[t];if(a!==EE[t]){const d=a.apply(e,i);return l?Oi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Qi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function Ib(e,t,n,s){const o=em(e),i=o!==e&&!Zo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Qi(e,c)),n.call(this,c,Qi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Qi(e,a):a}function K1(e,t,n){const s=nn(e);no(s,"iterate",ud);const o=s[t](...n);return(o===-1||o===!1)&&sm(n[0])?(n[0]=nn(n[0]),s[t](...n)):o}function Su(e,t,n=[]){Or(),cy();const s=nn(e)[t].apply(e,n);return uy(),Rr(),s}const TE=qp("__proto__,__v_isRef,__isVue"),k4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ni));function NE(e){ni(e)||(e=String(e));const t=nn(this);return no(t,"has",e),t.hasOwnProperty(e)}class b4{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?A4:C4:i?S4:_4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=xt(t);if(!o){let a;if(r&&(a=ME[n]))return a;if(n==="hasOwnProperty")return NE}const l=Reflect.get(t,n,hs(t)?t:s);if((ni(n)?k4.has(n):TE(n))||(o||no(t,"get",n),i))return l;if(hs(l)){const a=r&&Kp(n)?l:l.value;return o&&dn(a)?Fh(a):a}return dn(l)?o?Fh(l):Ps(l):l}}class x4 extends b4{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=xt(t)&&Kp(n);if(!this._isShallow){const c=Br(i);if(!Zo(s)&&!Br(s)&&(i=nn(i),s=nn(s)),!r&&hs(i)&&!hs(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:un(t,n),a=Reflect.set(t,n,s,hs(t)?t:o);return t===nn(o)&&(l?Vs(s,i)&&Ar(t,"set",n,s):Ar(t,"add",n,s)),a}deleteProperty(t,n){const s=un(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Ar(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!ni(n)||!k4.has(n))&&no(t,"has",n),s}ownKeys(t){return no(t,"iterate",xt(t)?"length":ya),Reflect.ownKeys(t)}}class w4 extends b4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const IE=new x4,$E=new w4,LE=new x4(!0),FE=new w4(!0),Ag=e=>e,wf=e=>Reflect.getPrototypeOf(e);function OE(e,t,n){return function(...s){const o=this.__v_raw,i=nn(o),r=Ac(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Ag:t?zc:Oi;return!t&&no(i,"iterate",a?Cg:ya),bn(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 _f(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function RE(e,t){const n={get(o){const i=this.__v_raw,r=nn(i),l=nn(o);e||(Vs(o,l)&&no(r,"get",o),no(r,"get",l));const{has:a}=wf(r),c=t?Ag:e?zc:Oi;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&no(nn(o),"iterate",ya),o.size},has(o){const i=this.__v_raw,r=nn(i),l=nn(o);return e||(Vs(o,l)&&no(r,"has",o),no(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=nn(l),c=t?Ag:e?zc:Oi;return!e&&no(a,"iterate",ya),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return bn(n,e?{add:_f("add"),set:_f("set"),delete:_f("delete"),clear:_f("clear")}:{add(o){const i=nn(this),r=wf(i),l=nn(o),a=!t&&!Zo(o)&&!Br(o)?l:o;return r.has.call(i,a)||Vs(o,a)&&r.has.call(i,o)||Vs(l,a)&&r.has.call(i,l)||(i.add(a),Ar(i,"add",a,a)),this},set(o,i){!t&&!Zo(i)&&!Br(i)&&(i=nn(i));const r=nn(this),{has:l,get:a}=wf(r);let c=l.call(r,o);c||(o=nn(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Vs(i,u)&&Ar(r,"set",o,i):Ar(r,"add",o,i),this},delete(o){const i=nn(this),{has:r,get:l}=wf(i);let a=r.call(i,o);a||(o=nn(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Ar(i,"delete",o,void 0),c},clear(){const o=nn(this),i=o.size!==0,r=o.clear();return i&&Ar(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=OE(o,e,t)}),n}function tm(e,t){const n=RE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(un(n,o)&&o in s?n:s,o,i)}const BE={get:tm(!1,!1)},DE={get:tm(!1,!0)},PE={get:tm(!0,!1)},HE={get:tm(!0,!0)},_4=new WeakMap,S4=new WeakMap,C4=new WeakMap,A4=new WeakMap;function WE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ps(e){return Br(e)?e:nm(e,!1,IE,BE,_4)}function zE(e){return nm(e,!1,LE,DE,S4)}function Fh(e){return nm(e,!0,$E,PE,C4)}function Cxe(e){return nm(e,!0,FE,HE,A4)}function nm(e,t,n,s,o){if(!dn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=WE(uE(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function xl(e){return Br(e)?xl(e.__v_raw):!!(e&&e.__v_isReactive)}function Br(e){return!!(e&&e.__v_isReadonly)}function Zo(e){return!!(e&&e.__v_isShallow)}function sm(e){return e?!!e.__v_raw:!1}function nn(e){const t=e&&e.__v_raw;return t?nn(t):e}function ht(e){return!un(e,"__v_skip")&&Object.isExtensible(e)&&l4(e,"__v_skip",!0),e}const Oi=e=>dn(e)?Ps(e):e,zc=e=>dn(e)?Fh(e):e;function hs(e){return e?e.__v_isRef===!0:!1}function X(e){return M4(e,!1)}function Ia(e){return M4(e,!0)}function M4(e,t){return hs(e)?e:new UE(e,t)}class UE{constructor(t,n){this.dep=new Jp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nn(t),this._value=n?t:Oi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Zo(t)||Br(t);t=s?t:nn(t),Vs(t,n)&&(this._rawValue=t,this._value=s?t:Oi(t),this.dep.trigger())}}function Axe(e){e.dep&&e.dep.trigger()}function C(e){return hs(e)?e.value:e}function E4(e){return $t(e)?e():C(e)}const qE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return hs(o)&&!hs(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function T4(e){return xl(e)?e:new Proxy(e,qE)}class jE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Jp,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function VE(e){return new jE(e)}function Mxe(e){const t=xt(e)?new Array(e.length):{};for(const n in e)t[n]=N4(e,n);return t}class KE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=ni(n)?n:String(n),this._raw=nn(t);let o=!0,i=t;if(!xt(t)||ni(this._key)||!Kp(this._key))do o=!sm(i)||Zo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&hs(this._raw[this._key])){const n=this._object[this._key];if(hs(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return AE(this._raw,this._key)}}class GE{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 Exe(e,t,n){return hs(e)?e:$t(e)?new GE(e):dn(e)&&arguments.length>1?N4(e,t,n):X(e)}function N4(e,t,n){return new KE(e,t,n)}class YE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Jp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Un!==this)return h4(this,!0),!0}get value(){const t=this.dep.track();return g4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ZE(e,t,n=!1){let s,o;return $t(e)?s=e:(s=e.get,o=e.set),new YE(s,o,n)}const Txe={GET:"get",HAS:"has",ITERATE:"iterate"},Nxe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Sf={},Oh=new WeakMap;let dl;function Ixe(){return dl}function QE(e,t=!1,n=dl){if(n){let s=Oh.get(n);s||Oh.set(n,s=[]),s.push(e)}}function XE(e,t,n=Xt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>o?k:Zo(k)||o===!1||o===0?Mr(k,1):Mr(k);let u,d,f,h,p=!1,m=!1;if(hs(e)?(d=()=>e.value,p=Zo(e)):xl(e)?(d=()=>c(e),p=!0):xt(e)?(m=!0,p=e.some(k=>xl(k)||Zo(k)),d=()=>e.map(k=>{if(hs(k))return k.value;if(xl(k))return c(k);if($t(k))return a?a(k,2):k()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Or();try{f()}finally{Rr()}}const k=dl;dl=u;try{return a?a(e,3,[h]):e(h)}finally{dl=k}}:d=xi,t&&o){const k=d,E=o===!0?1/0:o;d=()=>Mr(k(),E)}const b=ly(),v=()=>{u.stop(),b&&b.active&&iy(b.effects,u)};if(i&&t){const k=t;t=(...E)=>{k(...E),v()}}let g=m?new Array(e.length).fill(Sf):Sf;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const E=u.run();if(o||p||(m?E.some((L,$)=>Vs(L,g[$])):Vs(E,g))){f&&f();const L=dl;dl=u;try{const $=[E,g===Sf?void 0:m&&g[0]===Sf?[]:g,h];g=E,a?a(t,3,$):t(...$)}finally{dl=L}}}else u.run()};return l&&l(y),u=new $h(d),u.scheduler=r?()=>r(y,!1):y,h=k=>QE(k,!1,u),f=u.onStop=()=>{const k=Oh.get(u);if(k){if(a)a(k,4);else for(const E of k)E();Oh.delete(u)}},t?s?y(!0):g=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Mr(e,t=1/0,n){if(t<=0||!dn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,hs(e))Mr(e.value,t,n);else if(xt(e))for(let s=0;s<e.length;s++)Mr(e[s],t,n);else if(Na(e)||Ac(e))e.forEach(s=>{Mr(s,t,n)});else if(Vp(e)){for(const s in e)Mr(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Mr(e[s],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const I4=[];function JE(e){I4.push(e)}function eT(){I4.pop()}function $xe(e,t){}const Lxe={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"},tT={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Bd(e,t,n,s){try{return s?e(...s):e()}catch(o){Jc(o,t,n)}}function Si(e,t,n,s){if($t(e)){const o=Bd(e,t,n,s);return o&&ry(o)&&o.catch(i=>{Jc(i,t,n)}),o}if(xt(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Si(e[i],t,n,s));return o}}function Jc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Xt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Or(),Bd(i,null,10,[e,a,c]),Rr();return}}nT(e,n,o,s,r)}function nT(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const mo=[];let Gi=-1;const Ec=[];let fl=null,ac=0;const $4=Promise.resolve();let Rh=null;function pt(e){const t=Rh||$4;return e?t.then(this?e.bind(this):e):t}function sT(e){let t=Gi+1,n=mo.length;for(;t<n;){const s=t+n>>>1,o=mo[s],i=dd(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function fy(e){if(!(e.flags&1)){const t=dd(e),n=mo[mo.length-1];!n||!(e.flags&2)&&t>=dd(n)?mo.push(e):mo.splice(sT(t),0,e),e.flags|=1,L4()}}function L4(){Rh||(Rh=$4.then(F4))}function Bh(e){xt(e)?Ec.push(...e):fl&&e.id===-1?fl.splice(ac+1,0,e):e.flags&1||(Ec.push(e),e.flags|=1),L4()}function $b(e,t,n=Gi+1){for(;n<mo.length;n++){const s=mo[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;mo.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Dh(e){if(Ec.length){const t=[...new Set(Ec)].sort((n,s)=>dd(n)-dd(s));if(Ec.length=0,fl){fl.push(...t);return}for(fl=t,ac=0;ac<fl.length;ac++){const n=fl[ac];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}fl=null,ac=0}}const dd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function F4(e){try{for(Gi=0;Gi<mo.length;Gi++){const t=mo[Gi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Bd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Gi<mo.length;Gi++){const t=mo[Gi];t&&(t.flags&=-2)}Gi=-1,mo.length=0,Dh(),Rh=null,(mo.length||Ec.length)&&F4()}}let cc,Cf=[];function O4(e,t){var n,s;cc=e,cc?(cc.enabled=!0,Cf.forEach(({event:o,args:i})=>cc.emit(o,...i)),Cf=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{O4(i,t)}),setTimeout(()=>{cc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Cf=[])},3e3)):Cf=[]}let Ys=null,om=null;function fd(e){const t=Ys;return Ys=e,om=e&&e.type.__scopeId||null,t}function Fxe(e){om=e}function Oxe(){om=null}const Rxe=e=>Ee;function Ee(e,t=Ys,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Uh(-1);const i=fd(t);let r;try{r=e(...o)}finally{fd(i),s._d&&Uh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function On(e,t){if(Ys===null)return e;const n=Wd(Ys),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Xt]=t[o];i&&($t(i)&&(i={mounted:i,updated:i}),i.deep&&Mr(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Yi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Or(),Si(a,n,8,[e.el,l,e,t]),Rr())}}function Ln(e,t){if(Gs){let n=Gs.provides;const s=Gs.parent&&Gs.parent.provides;s===n&&(n=Gs.provides=Object.create(s)),n[e]=t}}function Vt(e,t,n=!1){const s=Qs();if(s||ka){let o=ka?ka._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&$t(t)?t.call(s&&s.proxy):t}}function Bxe(){return!!(Qs()||ka)}const oT=Symbol.for("v-scx"),iT=()=>Vt(oT);function rT(e,t){return Dd(e,null,t)}function Dxe(e,t){return Dd(e,null,{flush:"post"})}function lT(e,t){return Dd(e,null,{flush:"sync"})}function Ze(e,t,n){return Dd(e,t,n)}function Dd(e,t,n=Xt){const{immediate:s,deep:o,flush:i,once:r}=n,l=bn({},n),a=t&&s||!t&&i!=="post";let c;if(Sa){if(i==="sync"){const h=iT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=xi,h.resume=xi,h.pause=xi,h}}const u=Gs;l.call=(h,p,m)=>Si(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{bs(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():fy(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=XE(e,t,l);return Sa&&(c?c.push(f):a&&f()),f}function aT(e,t,n){const s=this.proxy,o=Mn(e)?e.includes(".")?R4(s,e):()=>s[e]:e.bind(s,s);let i;$t(t)?i=t:(i=t.handler,n=t);const r=eu(this),l=Dd(o,i.bind(s),n);return r(),l}function R4(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const al=new WeakMap,B4=Symbol("_vte"),D4=e=>e.__isTeleport,aa=e=>e&&(e.disabled||e.disabled===""),cT=e=>e&&(e.defer||e.defer===""),Lb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Fb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Mg=(e,t)=>{const n=e&&e.to;return Mn(n)?t?t(n):null:n},uT={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:b,parentNode:v}}=c,g=aa(t.props);let{dynamicChildren:y}=t;const k=($,w,M)=>{$.shapeFlag&16&&u($.children,w,M,o,i,r,l,a)},E=($=t)=>{const w=aa($.props),M=$.target=Mg($.props,p),N=Eg(M,$,m,h);M&&(r!=="svg"&&Lb(M)?r="svg":r!=="mathml"&&Fb(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),w||(k($,M,N),Fu($,!1)))},L=$=>{const w=()=>{if(al.get($)===w){if(al.delete($),aa($.props)){const M=v($.el)||n;k($,M,$.anchor),Fu($,!0)}E($)}};al.set($,w),bs(w,i)};if(e==null){const $=t.el=m(""),w=t.anchor=m("");if(h($,n,s),h(w,n,s),cT(t.props)||i&&i.pendingBranch){L(t);return}g&&(k(t,n,w),Fu(t,!0)),E()}else{t.el=e.el;const $=t.anchor=e.anchor,w=al.get(e);if(w){w.flags|=8,al.delete(e),L(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=aa(e.props),S=F?n:M,I=F?$:N;if(r==="svg"||Lb(M)?r="svg":(r==="mathml"||Fb(M))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,o,i,r,l),wy(e,t,!0)):a||d(e,t,S,I,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Af(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const B=t.target=Mg(t.props,p);B&&Af(t,B,null,c,0)}else F&&Af(t,M,N,c,1);Fu(t,g)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!aa(f),p=al.get(e);if(p&&(p.flags|=8,al.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const b=l[m];s(b,t,n,h,!!b.dynamicChildren)}},move:Af,hydrate:dT};function Af(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!al.has(e)&&(!d||aa(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function dT(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,v){let g=v;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(b,v){v.anchor=d(r(b),v,l(b),n,s,o,i)}const p=t.target=Mg(t.props,a),m=aa(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,b),t.targetAnchor||Eg(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||Eg(p,t,u,c),d(b&&r(b),t,p,n,s,o,i))),Fu(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const im=uT;function Fu(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Eg(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[B4]=r,e&&(s(i,e,o),s(r,e,o)),r}const mi=Symbol("_leaveCb"),Cu=Symbol("_enterCb");function P4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return fn(()=>{e.isMounted=!0}),ps(()=>{e.isUnmounting=!0}),e}const ci=[Function,Array],H4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ci,onEnter:ci,onAfterEnter:ci,onEnterCancelled:ci,onBeforeLeave:ci,onLeave:ci,onAfterLeave:ci,onLeaveCancelled:ci,onBeforeAppear:ci,onAppear:ci,onAfterAppear:ci,onAppearCancelled:ci},W4=e=>{const t=e.subTree;return t.component?W4(t.component):t},fT={name:"BaseTransition",props:H4,setup(e,{slots:t}){const n=Qs(),s=P4();return()=>{const o=t.default&&hy(t.default(),!0),i=o&&o.length?z4(o):n.subTree?le():void 0;if(!i)return;const r=nn(e),{mode:l}=r;if(s.isLeaving)return G1(i);const a=Ob(i);if(!a)return G1(i);let c=hd(a,r,s,n,d=>c=d);a.type!==_s&&Ml(a,c);let u=n.subTree&&Ob(n.subTree);if(u&&u.type!==_s&&!Ni(u,a)&&W4(n).type!==_s){let d=hd(u,r,s,n);if(Ml(u,d),l==="out-in"&&a.type!==_s)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},G1(i);l==="in-out"&&a.type!==_s?d.delayLeave=(f,h,p)=>{const m=U4(s,u);m[String(u.key)]=u,f[mi]=()=>{h(),f[mi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function z4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==_s){t=n;break}}return t}const hT=fT;function U4(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function hd(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:b,onAppear:v,onAfterAppear:g,onAppearCancelled:y}=t,k=String(e.key),E=U4(n,e),L=(M,N)=>{M&&Si(M,s,9,N)},$=(M,N)=>{const F=N[1];L(M,N),xt(M)?M.every(S=>S.length<=1)&&F():M.length<=1&&F()},w={mode:r,persisted:l,beforeEnter(M){let N=a;if(!n.isMounted)if(i)N=b||a;else return;M[mi]&&M[mi](!0);const F=E[k];F&&Ni(e,F)&&F.el[mi]&&F.el[mi](),L(N,[M])},enter(M){if(E[k]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=v||c,F=g||u,S=y||d;else return;let I=!1;M[Cu]=R=>{I||(I=!0,R?L(S,[M]):L(F,[M]),w.delayedLeave&&w.delayedLeave(),M[Cu]=void 0)};const B=M[Cu].bind(null,!1);N?$(N,[M,B]):B()},leave(M,N){const F=String(e.key);if(M[Cu]&&M[Cu](!0),n.isUnmounting)return N();L(f,[M]);let S=!1;M[mi]=B=>{S||(S=!0,N(),B?L(m,[M]):L(p,[M]),M[mi]=void 0,E[F]===e&&delete E[F])};const I=M[mi].bind(null,!1);E[F]=e,h?$(h,[M,I]):I()},clone(M){const N=hd(M,t,n,s,o);return o&&o(N),N}};return w}function G1(e){if(Pd(e))return e=Dr(e),e.children=null,e}function Ob(e){if(!Pd(e))return D4(e.type)&&e.children?z4(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&&$t(n.default))return n.default()}}function Ml(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ml(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 hy(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Be?(r.patchFlag&128&&o++,s=s.concat(hy(r.children,t,l))):(t||r.type!==_s)&&s.push(l!=null?Dr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ge(e,t){return $t(e)?bn({name:e.name},t,{setup:e}):e}function Pxe(){const e=Qs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function py(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Hxe(e){const t=Qs(),n=Ia(null);if(t){const o=t.refs===Xt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Rb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ph=new WeakMap;function Tc(e,t,n,s,o=!1){if(xt(e)){e.forEach((m,b)=>Tc(m,t&&(xt(t)?t[b]:t),n,s,o));return}if($r(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Tc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Wd(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Xt?l.refs={}:l.refs,d=l.setupState,f=nn(d),h=d===Xt?i4:m=>Rb(u,m)?!1:un(f,m),p=(m,b)=>!(b&&Rb(u,b));if(c!=null&&c!==a){if(Bb(t),Mn(c))u[c]=null,h(c)&&(d[c]=null);else if(hs(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if($t(a))Bd(a,l,12,[r,u]);else{const m=Mn(a),b=hs(a);if(m||b){const v=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)xt(g)&&iy(g,i);else if(xt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else m?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{v(),Ph.delete(e)};g.id=-1,Ph.set(e,g),bs(g,n)}else Bb(e),v()}}}function Bb(e){const t=Ph.get(e);t&&(t.flags|=8,Ph.delete(e))}let Db=!1;const Xa=()=>{Db||(console.error("Hydration completed but contains mismatches."),Db=!0)},pT=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",mT=e=>e.namespaceURI.includes("MathML"),Mf=e=>{if(e.nodeType===1){if(pT(e))return"svg";if(mT(e))return"mathml"}},gc=e=>e.nodeType===8;function gT(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),Dh(),k._vnode=y;return}d(k.firstChild,y,null,null,null),Dh(),k._vnode=y},d=(y,k,E,L,$,w=!1)=>{w=w||!!k.dynamicChildren;const M=gc(y)&&y.data==="[",N=()=>m(y,k,E,L,$,M),{type:F,ref:S,shapeFlag:I,patchFlag:B}=k;let R=y.nodeType;k.el=y,B===-2&&(w=!1,k.dynamicChildren=null);let P=null;switch(F){case wl:R!==3?k.children===""?(a(k.el=o(""),r(y),y),P=y):P=N():(y.data!==k.children&&(Xa(),y.data=k.children),P=i(y));break;case _s:g(y)?(P=i(y),v(k.el=y.content.firstChild,y,E)):R!==8||M?P=N():P=i(y);break;case Ic:if(M&&(y=i(y),R=y.nodeType),R===1||R===3){P=y;const z=!k.children.length;for(let W=0;W<k.staticCount;W++)z&&(k.children+=P.nodeType===1?P.outerHTML:P.data),W===k.staticCount-1&&(k.anchor=P),P=i(P);return M?i(P):P}else N();break;case Be:M?P=p(y,k,E,L,$,w):P=N();break;default:if(I&1)(R!==1||k.type.toLowerCase()!==y.tagName.toLowerCase())&&!g(y)?P=N():P=f(y,k,E,L,$,w);else if(I&6){k.slotScopeIds=$;const z=r(y);if(M?P=b(y):gc(y)&&y.data==="teleport start"?P=b(y,y.data,"teleport end"):P=i(y),t(k,z,null,E,L,Mf(z),w),$r(k)&&!k.type.__asyncResolved){let W;M?(W=re(Be),W.anchor=P?P.previousSibling:z.lastChild):W=y.nodeType===3?Qe(""):re("div"),W.el=y,k.component.subTree=W}}else I&64?R!==8?P=N():P=k.type.hydrate(y,k,E,L,$,w,e,h):I&128&&(P=k.type.hydrate(y,k,E,L,Mf(r(y)),$,w,e,d))}return S!=null&&Tc(S,null,L,k),P},f=(y,k,E,L,$,w)=>{w=w||!!k.dynamicChildren;const{type:M,props:N,patchFlag:F,shapeFlag:S,dirs:I,transition:B}=k,R=M==="input"||M==="option";if(R||F!==-1){I&&Yi(k,null,E,"created");let P=!1;if(g(y)){P=c3(null,B)&&E&&E.vnode.props&&E.vnode.props.appear;const W=y.content.firstChild;if(P){const ee=W.getAttribute("class");ee&&(W.$cls=ee),B.beforeEnter(W)}v(W,y,E),k.el=y=W}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let W=h(y.firstChild,k,y,E,L,$,w);for(W&&!Ef(y,1)&&Xa();W;){const ee=W;W=W.nextSibling,l(ee)}}else if(S&8){let W=k.children;W[0]===`
|
|
15
|
-
`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(W=W.slice(1));const{textContent:ee}=y;ee!==W&&ee!==W.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Ef(y,0)||Xa(),y.textContent=k.children)}if(N){if(R||!w||F&48){const W=y.tagName.includes("-");for(const ee in N)(R&&(ee.endsWith("value")||ee==="indeterminate")||Rd(ee)&&!va(ee)||ee[0]==="."||W&&!va(ee))&&s(y,ee,null,N[ee],void 0,E)}else if(N.onClick)s(y,"onClick",null,N.onClick,void 0,E);else if(F&4&&xl(N.style))for(const W in N.style)N.style[W]}let z;(z=N&&N.onVnodeBeforeMount)&&Io(z,E,k),I&&Yi(k,null,E,"beforeMount"),((z=N&&N.onVnodeMounted)||I||P)&&h3(()=>{z&&Io(z,E,k),P&&B.enter(y),I&&Yi(k,null,E,"mounted")},L)}return y.nextSibling},h=(y,k,E,L,$,w,M)=>{M=M||!!k.dynamicChildren;const N=k.children,F=N.length;let S=!1;for(let I=0;I<F;I++){const B=M?N[I]:N[I]=Lo(N[I]),R=B.type===wl;y?(R&&!M&&I+1<F&&Lo(N[I+1]).type===wl&&(a(o(y.data.slice(B.children.length)),E,i(y)),y.data=B.children),y=d(y,B,L,$,w,M)):R&&!B.children?a(B.el=o(""),E):(S||(S=!0,Ef(E,1)||Xa()),n(null,B,E,null,L,$,Mf(E),w))}return y},p=(y,k,E,L,$,w)=>{const{slotScopeIds:M}=k;M&&($=$?$.concat(M):M);const N=r(y),F=h(i(y),k,N,E,L,$,w);return F&&gc(F)&&F.data==="]"?i(k.anchor=F):(Xa(),a(k.anchor=c("]"),N,F),F)},m=(y,k,E,L,$,w)=>{if(Ef(y.parentElement,1)||Xa(),k.el=null,w){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const M=i(y),N=r(y);return l(y),n(null,k,N,M,E,L,Mf(N),$),E&&(E.vnode.el=k.el,am(E,k.el)),M},b=(y,k="[",E="]")=>{let L=0;for(;y;)if(y=i(y),y&&gc(y)&&(y.data===k&&L++,y.data===E)){if(L===0)return i(y);L--}return y},v=(y,k,E)=>{const L=k.parentNode;L&&L.replaceChild(y,k);let $=E;for(;$;)$.vnode.el===k&&($.vnode.el=$.subTree.el=y),$=$.parent},g=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Pb="data-allow-mismatch",vT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Ef(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Pb);)e=e.parentElement;const n=e&&e.getAttribute(Pb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(vT[t])}}const yT=Qp().requestIdleCallback||(e=>setTimeout(e,1)),kT=Qp().cancelIdleCallback||(e=>clearTimeout(e)),Wxe=(e=1e4)=>t=>{const n=yT(t,{timeout:e});return()=>kT(n)};function bT(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const zxe=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(bT(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Uxe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},qxe=(e=[])=>(t,n)=>{Mn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function xT(e,t){if(gc(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(gc(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const $r=e=>!!e.type.__asyncLoader;function Ii(e){$t(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((b,v)=>{a(m,()=>b(f()),()=>v(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,b){let v=!1;(m.bu||(m.bu=[])).push(()=>v=!0);const g=()=>{v||b()},y=i?()=>{const k=i(g,E=>xT(p,E));k&&(m.bum||(m.bum=[])).push(k)}:g;u?y():h().then(()=>!m.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=Gs;if(py(p),u)return()=>Tf(u,p);const m=y=>{c=null,Jc(y,p,13,!s)};if(l&&p.suspense||Sa)return h().then(y=>()=>Tf(y,p)).catch(y=>(m(y),()=>s?re(s,{error:y}):null));const b=X(!1),v=X(),g=X(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);m(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&Pd(p.parent.vnode)&&p.parent.update()}).catch(y=>{m(y),v.value=y}),()=>{if(b.value&&u)return Tf(u,p);if(v.value&&s)return re(s,{error:v.value});if(n&&!g.value)return Tf(n,p)}}})}function Tf(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=re(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Pd=e=>e.type.__isKeepAlive,wT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Qs(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,y,k,E,L)=>{const $=g.component;c(g,y,k,0,l),a($.vnode,g,y,k,$,l,E,g.slotScopeIds,L),bs(()=>{$.isDeactivated=!1,$.a&&Mc($.a);const w=g.props&&g.props.onVnodeMounted;w&&Io(w,$.parent,g)},l)},s.deactivate=g=>{const y=g.component;Wh(y.m),Wh(y.a),c(g,f,null,1,l),bs(()=>{y.da&&Mc(y.da);const k=g.props&&g.props.onVnodeUnmounted;k&&Io(k,y.parent,g),y.isDeactivated=!0},l)};function h(g){Y1(g),u(g,n,l,!0)}function p(g){o.forEach((y,k)=>{const E=Bg($r(y)?y.type.__asyncResolved||{}:y.type);E&&!g(E)&&m(k)})}function m(g){const y=o.get(g);y&&(!r||!Ni(y,r))?h(y):r&&Y1(r),o.delete(g),i.delete(g)}Ze(()=>[e.include,e.exclude],([g,y])=>{g&&p(k=>Ou(g,k)),y&&p(k=>!Ou(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(zh(n.subTree.type)?bs(()=>{o.set(b,Nf(n.subTree))},n.subTree.suspense):o.set(b,Nf(n.subTree)))};return fn(v),my(v),ps(()=>{o.forEach(g=>{const{subTree:y,suspense:k}=n,E=Nf(y);if(g.type===E.type&&g.key===E.key){Y1(E);const L=E.component.da;L&&bs(L,k);return}h(g)})}),()=>{if(b=null,!t.default)return r=null;const g=t.default(),y=g[0];if(g.length>1)return r=null,g;if(!El(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=Nf(y);if(k.type===_s)return r=null,k;const E=k.type,L=Bg($r(k)?k.type.__asyncResolved||{}:E),{include:$,exclude:w,max:M}=e;if($&&(!L||!Ou($,L))||w&&L&&Ou(w,L))return k.shapeFlag&=-257,r=k,y;const N=k.key==null?E:k.key,F=o.get(N);return k.el&&(k=Dr(k),y.shapeFlag&128&&(y.ssContent=k)),b=N,F?(k.el=F.el,k.component=F.component,k.transition&&Ml(k,k.transition),k.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),k.shapeFlag|=256,r=k,zh(y.type)?y:k}}},jxe=wT;function Ou(e,t){return xt(e)?e.some(n=>Ou(n,t)):Mn(e)?e.split(",").includes(t):cE(e)?(e.lastIndex=0,e.test(t)):!1}function _T(e,t){q4(e,"a",t)}function ST(e,t){q4(e,"da",t)}function q4(e,t,n=Gs){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(rm(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Pd(o.parent.vnode)&&CT(s,t,n,o),o=o.parent}}function CT(e,t,n,s){const o=rm(t,e,s,!0);xn(()=>{iy(s[t],o)},n)}function Y1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Nf(e){return e.shapeFlag&128?e.ssContent:e}function rm(e,t,n=Gs,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Or();const l=eu(n),a=Si(t,n,e,r);return l(),Rr(),a});return s?o.unshift(i):o.push(i),i}}const Hr=e=>(t,n=Gs)=>{(!Sa||e==="sp")&&rm(e,(...s)=>t(...s),n)},AT=Hr("bm"),fn=Hr("m"),j4=Hr("bu"),my=Hr("u"),ps=Hr("bum"),xn=Hr("um"),MT=Hr("sp"),ET=Hr("rtg"),TT=Hr("rtc");function NT(e,t=Gs){rm("ec",e,t)}const gy="components",IT="directives";function $T(e,t){return vy(gy,e,!0,t)||e}const V4=Symbol.for("v-ndc");function Ks(e){return Mn(e)?vy(gy,e,!1)||e:e||V4}function Vxe(e){return vy(IT,e)}function vy(e,t,n=!0,s=!1){const o=Ys||Gs;if(o){const i=o.type;if(e===gy){const l=Bg(i,!1);if(l&&(l===t||l===$s(t)||l===Yp($s(t))))return i}const r=Hb(o[e]||i[e],t)||Hb(o.appContext[e],t);return!r&&s?i:r}}function Hb(e,t){return e&&(e[t]||e[$s(t)]||e[Yp($s(t))])}function nt(e,t,n,s){let o;const i=n&&n[s],r=xt(e);if(r||Mn(e)){const l=r&&xl(e);let a=!1,c=!1;l&&(a=!Zo(e),c=Br(e),e=em(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?zc(Oi(e[u])):Oi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(dn(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function K4(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(xt(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Rn(e,t,n={},s,o){if(Ys.ce||Ys.parent&&$r(Ys.parent)&&Ys.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),xe(Be,null,[re("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&yy(i(n)),l=n.key||r&&r.key,a=xe(Be,{key:(l&&!ni(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function yy(e){return e.some(t=>El(t)?!(t.type===_s||t.type===Be&&!yy(t.children)):!0)?e:null}function Kxe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:ah(s)]=e[s];return n}const Tg=e=>e?y3(e)?Wd(e):Tg(e.parent):null,Vu=bn(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=>Tg(e.parent),$root:e=>Tg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ky(e),$forceUpdate:e=>e.f||(e.f=()=>{fy(e.update)}),$nextTick:e=>e.n||(e.n=pt.bind(e.proxy)),$watch:e=>aT.bind(e)}),Z1=(e,t)=>e!==Xt&&!e.__isScriptSetup&&un(e,t),Ng={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Z1(s,t))return r[t]=1,s[t];if(o!==Xt&&un(o,t))return r[t]=2,o[t];if(un(i,t))return r[t]=3,i[t];if(n!==Xt&&un(n,t))return r[t]=4,n[t];Ig&&(r[t]=0)}}const c=Vu[t];let u,d;if(c)return t==="$attrs"&&no(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Xt&&un(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,un(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Z1(o,t)?(o[t]=n,!0):s!==Xt&&un(s,t)?(s[t]=n,!0):un(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Xt&&l[0]!=="$"&&un(e,l)||Z1(t,l)||un(i,l)||un(s,l)||un(Vu,l)||un(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:un(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},LT=bn({},Ng,{get(e,t){if(t!==Symbol.unscopables)return Ng.get(e,t,e)},has(e,t){return t[0]!=="_"&&!pE(t)}});function Gxe(){return null}function Yxe(){return null}function Zxe(e){}function Qxe(e){}function Xxe(){return null}function Jxe(){}function ewe(e,t){return null}function twe(){return G4().slots}function Hd(){return G4().attrs}function G4(e){const t=Qs();return t.setupContext||(t.setupContext=x3(t))}function pd(e){return xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function nwe(e,t){const n=pd(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?xt(o)||$t(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function swe(e,t){return!e||!t?e||t:xt(e)&&xt(t)?e.concat(t):bn({},pd(e),pd(t))}function owe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function iwe(e){const t=Qs(),n=Sa;let s=e();gd(),n&&$c(!1);const o=()=>{eu(t),n&&$c(!0)},i=()=>{Qs()!==t&&t.scope.off(),gd(),n&&$c(!1)};return ry(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let Ig=!0;function FT(e){const t=ky(e),n=e.proxy,s=e.ctx;Ig=!1,t.beforeCreate&&Wb(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:b,beforeDestroy:v,beforeUnmount:g,destroyed:y,unmounted:k,render:E,renderTracked:L,renderTriggered:$,errorCaptured:w,serverPrefetch:M,expose:N,inheritAttrs:F,components:S,directives:I,filters:B}=t;if(c&&OT(c,s,null),r)for(const z in r){const W=r[z];$t(W)&&(s[z]=W.bind(n))}if(o){const z=o.call(n,n);dn(z)&&(e.data=Ps(z))}if(Ig=!0,i)for(const z in i){const W=i[z],ee=$t(W)?W.bind(n,n):$t(W.get)?W.get.bind(n,n):xi,U=!$t(W)&&$t(W.set)?W.set.bind(n):xi,Y=D({get:ee,set:U});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>Y.value,set:ue=>Y.value=ue})}if(l)for(const z in l)Y4(l[z],s,n,z);if(a){const z=$t(a)?a.call(n):a;Reflect.ownKeys(z).forEach(W=>{Ln(W,z[W])})}u&&Wb(u,e,"c");function P(z,W){xt(W)?W.forEach(ee=>z(ee.bind(n))):W&&z(W.bind(n))}if(P(AT,d),P(fn,f),P(j4,h),P(my,p),P(_T,m),P(ST,b),P(NT,w),P(TT,L),P(ET,$),P(ps,g),P(xn,k),P(MT,M),xt(N))if(N.length){const z=e.exposed||(e.exposed={});N.forEach(W=>{Object.defineProperty(z,W,{get:()=>n[W],set:ee=>n[W]=ee,enumerable:!0})})}else e.exposed||(e.exposed={});E&&e.render===xi&&(e.render=E),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),I&&(e.directives=I),M&&py(e)}function OT(e,t,n=xi){xt(e)&&(e=$g(e));for(const s in e){const o=e[s];let i;dn(o)?"default"in o?i=Vt(o.from||s,o.default,!0):i=Vt(o.from||s):i=Vt(o),hs(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Wb(e,t,n){Si(xt(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Y4(e,t,n,s){let o=s.includes(".")?R4(n,s):()=>n[s];if(Mn(e)){const i=t[e];$t(i)&&Ze(o,i)}else if($t(e))Ze(o,e.bind(n));else if(dn(e))if(xt(e))e.forEach(i=>Y4(i,t,n,s));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Ze(o,i,e)}}function ky(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Hh(a,c,r,!0)),Hh(a,t,r)),dn(t)&&i.set(t,a),a}function Hh(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Hh(e,i,n,!0),o&&o.forEach(r=>Hh(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=RT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const RT={data:zb,props:Ub,emits:Ub,methods:Ru,computed:Ru,beforeCreate:uo,created:uo,beforeMount:uo,mounted:uo,beforeUpdate:uo,updated:uo,beforeDestroy:uo,beforeUnmount:uo,destroyed:uo,unmounted:uo,activated:uo,deactivated:uo,errorCaptured:uo,serverPrefetch:uo,components:Ru,directives:Ru,watch:DT,provide:zb,inject:BT};function zb(e,t){return t?e?function(){return bn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function BT(e,t){return Ru($g(e),$g(t))}function $g(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function uo(e,t){return e?[...new Set([].concat(e,t))]:t}function Ru(e,t){return e?bn(Object.create(null),e,t):t}function Ub(e,t){return e?xt(e)&&xt(t)?[...new Set([...e,...t])]:bn(Object.create(null),pd(e),pd(t??{})):t}function DT(e,t){if(!e)return t;if(!t)return e;const n=bn(Object.create(null),e);for(const s in t)n[s]=uo(e[s],t[s]);return n}function Z4(){return{app:null,config:{isNativeTag:i4,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 PT=0;function HT(e,t){return function(s,o=null){$t(s)||(s=bn({},s)),o!=null&&!dn(o)&&(o=null);const i=Z4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:PT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:g9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&$t(u.install)?(r.add(u),u.install(c,...d)):$t(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||re(s,o);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Wd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Si(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=ka;ka=c;try{return u()}finally{ka=d}}};return c}}let ka=null;function rwe(e,t,n=Xt){const s=Qs(),o=$s(t),i=Fo(t),r=Q4(e,o),l=VE((a,c)=>{let u,d=Xt,f;return lT(()=>{const h=e[o];Vs(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Vs(p,u)&&!(d!==Xt&&Vs(h,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=h,c()),s.emit(`update:${t}`,p),Vs(h,p)&&Vs(h,d)&&!Vs(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Xt:l,done:!1}:{done:!0}}}},l}const Q4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${$s(t)}Modifiers`]||e[`${Fo(t)}Modifiers`];function WT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Xt;let o=n;const i=t.startsWith("update:"),r=i&&Q4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Mn(u)?u.trim():u)),r.number&&(o=n.map(Zp)));let l,a=s[l=ah(t)]||s[l=ah($s(t))];!a&&i&&(a=s[l=ah(Fo(t))]),a&&Si(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Si(c,e,6,o)}}const zT=new WeakMap;function X4(e,t,n=!1){const s=n?zT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=X4(c,t,!0);u&&(l=!0,bn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(dn(e)&&s.set(e,null),null):(xt(i)?i.forEach(a=>r[a]=null):bn(r,i),dn(e)&&s.set(e,r),r)}function lm(e,t){return!e||!Rd(t)?!1:(t=t.slice(2).replace(/Once$/,""),un(e,t[0].toLowerCase()+t.slice(1))||un(e,Fo(t))||un(e,t))}function ch(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,b=fd(e);let v,g;try{if(n.shapeFlag&4){const k=o||s,E=k;v=Lo(c.call(E,k,u,d,h,f,p)),g=l}else{const k=t;v=Lo(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),g=t.props?l:qT(l)}}catch(k){Ku.length=0,Jc(k,e,1),v=re(_s)}let y=v;if(g&&m!==!1){const k=Object.keys(g),{shapeFlag:E}=y;k.length&&E&7&&(i&&k.some(jp)&&(g=jT(g,i)),y=Dr(y,g,!1,!0))}return n.dirs&&(y=Dr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Ml(y,n.transition),v=y,fd(b),v}function UT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(El(o)){if(o.type!==_s||o.children==="v-if"){if(n)return;n=o}}else return}return n}const qT=e=>{let t;for(const n in e)(n==="class"||n==="style"||Rd(n))&&((t||(t={}))[n]=e[n]);return t},jT=(e,t)=>{const n={};for(const s in e)(!jp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function VT(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?qb(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(J4(r,s,f)&&!lm(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?qb(s,r,c):!0:!!r;return!1}function qb(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(J4(t,e,i)&&!lm(n,i))return!0}return!1}function J4(e,t,n){const s=e[n],o=t[n];return n==="style"&&dn(s)&&dn(o)?!Fr(s,o):s!==o}function am({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const e3={},t3=()=>Object.create(e3),n3=e=>Object.getPrototypeOf(e)===e3;function KT(e,t,n,s=!1){const o={},i=t3();e.propsDefaults=Object.create(null),s3(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:zE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function GT(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=nn(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(lm(e.emitsOptions,f))continue;const h=t[f];if(a)if(un(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=$s(f);o[p]=Lg(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{s3(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!un(t,d)&&((u=Fo(d))===d||!un(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Lg(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!un(t,d))&&(delete i[d],c=!0)}c&&Ar(e.attrs,"set","")}function s3(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(va(a))continue;const c=t[a];let u;o&&un(o,u=$s(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:lm(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=nn(n),c=l||Xt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Lg(o,a,d,c[d],e,!un(c,d))}}return r}function Lg(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=un(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&$t(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=eu(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===Fo(n))&&(s=!0))}return s}const YT=new WeakMap;function o3(e,t,n=!1){const s=n?YT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!$t(e)){const u=d=>{a=!0;const[f,h]=o3(d,t,!0);bn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return dn(e)&&s.set(e,Cc),Cc;if(xt(i))for(let u=0;u<i.length;u++){const d=$s(i[u]);jb(d)&&(r[d]=Xt)}else if(i)for(const u in i){const d=$s(u);if(jb(d)){const f=i[u],h=r[d]=xt(f)||$t(f)?{type:f}:bn({},f),p=h.type;let m=!1,b=!0;if(xt(p))for(let v=0;v<p.length;++v){const g=p[v],y=$t(g)&&g.name;if(y==="Boolean"){m=!0;break}else y==="String"&&(b=!1)}else m=$t(p)&&p.name==="Boolean";h[0]=m,h[1]=b,(m||un(h,"default"))&&l.push(d)}}const c=[r,l];return dn(e)&&s.set(e,c),c}function jb(e){return e[0]!=="$"&&!va(e)}const by=e=>e==="_"||e==="_ctx"||e==="$stable",xy=e=>xt(e)?e.map(Lo):[Lo(e)],ZT=(e,t,n)=>{if(t._n)return t;const s=Ee((...o)=>xy(t(...o)),n);return s._c=!1,s},i3=(e,t,n)=>{const s=e._ctx;for(const o in e){if(by(o))continue;const i=e[o];if($t(i))t[o]=ZT(o,i,s);else if(i!=null){const r=xy(i);t[o]=()=>r}}},r3=(e,t)=>{const n=xy(t);e.slots.default=()=>n},l3=(e,t,n)=>{for(const s in t)(n||!by(s))&&(e[s]=t[s])},QT=(e,t,n)=>{const s=e.slots=t3();if(e.vnode.shapeFlag&32){const o=t._;o?(l3(s,t,n),n&&l4(s,"_",o,!0)):i3(t,s)}else t&&r3(e,t)},XT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Xt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:l3(o,t,n):(i=!t.$stable,i3(t,o)),r=t}else t&&(r3(e,t),r={default:1});if(i)for(const l in o)!by(l)&&r[l]==null&&delete o[l]},bs=h3;function JT(e){return a3(e)}function e9(e){return a3(e,gT)}function a3(e,t){const n=Qp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=xi,insertStaticContent:p}=e,m=(q,se,ye,de=null,ke=null,j=null,ne=void 0,ve=null,Ae=!!se.dynamicChildren)=>{if(q===se)return;q&&!Ni(q,se)&&(de=ae(q),ue(q,ke,j,!0),q=null),se.patchFlag===-2&&(Ae=!1,se.dynamicChildren=null);const{type:$e,ref:Oe,shapeFlag:pe}=se;switch($e){case wl:b(q,se,ye,de);break;case _s:v(q,se,ye,de);break;case Ic:q==null&&g(se,ye,de,ne);break;case Be:S(q,se,ye,de,ke,j,ne,ve,Ae);break;default:pe&1?E(q,se,ye,de,ke,j,ne,ve,Ae):pe&6?I(q,se,ye,de,ke,j,ne,ve,Ae):(pe&64||pe&128)&&$e.process(q,se,ye,de,ke,j,ne,ve,Ae,K)}Oe!=null&&ke?Tc(Oe,q&&q.ref,j,se||q,!se):Oe==null&&q&&q.ref!=null&&Tc(q.ref,null,j,q,!0)},b=(q,se,ye,de)=>{if(q==null)s(se.el=l(se.children),ye,de);else{const ke=se.el=q.el;se.children!==q.children&&c(ke,se.children)}},v=(q,se,ye,de)=>{q==null?s(se.el=a(se.children||""),ye,de):se.el=q.el},g=(q,se,ye,de)=>{[q.el,q.anchor]=p(q.children,se,ye,de,q.el,q.anchor)},y=({el:q,anchor:se},ye,de)=>{let ke;for(;q&&q!==se;)ke=f(q),s(q,ye,de),q=ke;s(se,ye,de)},k=({el:q,anchor:se})=>{let ye;for(;q&&q!==se;)ye=f(q),o(q),q=ye;o(se)},E=(q,se,ye,de,ke,j,ne,ve,Ae)=>{if(se.type==="svg"?ne="svg":se.type==="math"&&(ne="mathml"),q==null)L(se,ye,de,ke,j,ne,ve,Ae);else{const $e=q.el&&q.el._isVueCE?q.el:null;try{$e&&$e._beginPatch(),M(q,se,ke,j,ne,ve,Ae)}finally{$e&&$e._endPatch()}}},L=(q,se,ye,de,ke,j,ne,ve)=>{let Ae,$e;const{props:Oe,shapeFlag:pe,transition:Ie,dirs:Xe}=q;if(Ae=q.el=r(q.type,j,Oe&&Oe.is,Oe),pe&8?u(Ae,q.children):pe&16&&w(q.children,Ae,null,de,ke,Q1(q,j),ne,ve),Xe&&Yi(q,null,de,"created"),$(Ae,q,q.scopeId,ne,de),Oe){for(const At in Oe)At!=="value"&&!va(At)&&i(Ae,At,null,Oe[At],j,de);"value"in Oe&&i(Ae,"value",null,Oe.value,j),($e=Oe.onVnodeBeforeMount)&&Io($e,de,q)}Xe&&Yi(q,null,de,"beforeMount");const it=c3(ke,Ie);it&&Ie.beforeEnter(Ae),s(Ae,se,ye),(($e=Oe&&Oe.onVnodeMounted)||it||Xe)&&bs(()=>{try{$e&&Io($e,de,q),it&&Ie.enter(Ae),Xe&&Yi(q,null,de,"mounted")}finally{}},ke)},$=(q,se,ye,de,ke)=>{if(ye&&h(q,ye),de)for(let j=0;j<de.length;j++)h(q,de[j]);if(ke){let j=ke.subTree;if(se===j||zh(j.type)&&(j.ssContent===se||j.ssFallback===se)){const ne=ke.vnode;$(q,ne,ne.scopeId,ne.slotScopeIds,ke.parent)}}},w=(q,se,ye,de,ke,j,ne,ve,Ae=0)=>{for(let $e=Ae;$e<q.length;$e++){const Oe=q[$e]=ve?Sr(q[$e]):Lo(q[$e]);m(null,Oe,se,ye,de,ke,j,ne,ve)}},M=(q,se,ye,de,ke,j,ne)=>{const ve=se.el=q.el;let{patchFlag:Ae,dynamicChildren:$e,dirs:Oe}=se;Ae|=q.patchFlag&16;const pe=q.props||Xt,Ie=se.props||Xt;let Xe;if(ye&&Jl(ye,!1),(Xe=Ie.onVnodeBeforeUpdate)&&Io(Xe,ye,se,q),Oe&&Yi(se,q,ye,"beforeUpdate"),ye&&Jl(ye,!0),(pe.innerHTML&&Ie.innerHTML==null||pe.textContent&&Ie.textContent==null)&&u(ve,""),$e?N(q.dynamicChildren,$e,ve,ye,de,Q1(se,ke),j):ne||W(q,se,ve,null,ye,de,Q1(se,ke),j,!1),Ae>0){if(Ae&16)F(ve,pe,Ie,ye,ke);else if(Ae&2&&pe.class!==Ie.class&&i(ve,"class",null,Ie.class,ke),Ae&4&&i(ve,"style",pe.style,Ie.style,ke),Ae&8){const it=se.dynamicProps;for(let At=0;At<it.length;At++){const bt=it[At],wt=pe[bt],qt=Ie[bt];(qt!==wt||bt==="value")&&i(ve,bt,wt,qt,ke,ye)}}Ae&1&&q.children!==se.children&&u(ve,se.children)}else!ne&&$e==null&&F(ve,pe,Ie,ye,ke);((Xe=Ie.onVnodeUpdated)||Oe)&&bs(()=>{Xe&&Io(Xe,ye,se,q),Oe&&Yi(se,q,ye,"updated")},de)},N=(q,se,ye,de,ke,j,ne)=>{for(let ve=0;ve<se.length;ve++){const Ae=q[ve],$e=se[ve],Oe=Ae.el&&(Ae.type===Be||!Ni(Ae,$e)||Ae.shapeFlag&198)?d(Ae.el):ye;m(Ae,$e,Oe,null,de,ke,j,ne,!0)}},F=(q,se,ye,de,ke)=>{if(se!==ye){if(se!==Xt)for(const j in se)!va(j)&&!(j in ye)&&i(q,j,se[j],null,ke,de);for(const j in ye){if(va(j))continue;const ne=ye[j],ve=se[j];ne!==ve&&j!=="value"&&i(q,j,ve,ne,ke,de)}"value"in ye&&i(q,"value",se.value,ye.value,ke)}},S=(q,se,ye,de,ke,j,ne,ve,Ae)=>{const $e=se.el=q?q.el:l(""),Oe=se.anchor=q?q.anchor:l("");let{patchFlag:pe,dynamicChildren:Ie,slotScopeIds:Xe}=se;Xe&&(ve=ve?ve.concat(Xe):Xe),q==null?(s($e,ye,de),s(Oe,ye,de),w(se.children||[],ye,Oe,ke,j,ne,ve,Ae)):pe>0&&pe&64&&Ie&&q.dynamicChildren&&q.dynamicChildren.length===Ie.length?(N(q.dynamicChildren,Ie,ye,ke,j,ne,ve),(se.key!=null||ke&&se===ke.subTree)&&wy(q,se,!0)):W(q,se,ye,Oe,ke,j,ne,ve,Ae)},I=(q,se,ye,de,ke,j,ne,ve,Ae)=>{se.slotScopeIds=ve,q==null?se.shapeFlag&512?ke.ctx.activate(se,ye,de,ne,Ae):B(se,ye,de,ke,j,ne,Ae):R(q,se,Ae)},B=(q,se,ye,de,ke,j,ne)=>{const ve=q.component=v3(q,de,ke);if(Pd(q)&&(ve.ctx.renderer=K),k3(ve,!1,ne),ve.asyncDep){if(ke&&ke.registerDep(ve,P,ne),!q.el){const Ae=ve.subTree=re(_s);v(null,Ae,se,ye),q.placeholder=Ae.el}}else P(ve,q,se,ye,ke,j,ne)},R=(q,se,ye)=>{const de=se.component=q.component;if(VT(q,se,ye))if(de.asyncDep&&!de.asyncResolved){z(de,se,ye);return}else de.next=se,de.update();else se.el=q.el,de.vnode=se},P=(q,se,ye,de,ke,j,ne)=>{const ve=()=>{if(q.isMounted){let{next:pe,bu:Ie,u:Xe,parent:it,vnode:At}=q;{const Kt=u3(q);if(Kt){pe&&(pe.el=At.el,z(q,pe,ne)),Kt.asyncDep.then(()=>{bs(()=>{q.isUnmounted||$e()},ke)});return}}let bt=pe,wt;Jl(q,!1),pe?(pe.el=At.el,z(q,pe,ne)):pe=At,Ie&&Mc(Ie),(wt=pe.props&&pe.props.onVnodeBeforeUpdate)&&Io(wt,it,pe,At),Jl(q,!0);const qt=ch(q),yt=q.subTree;q.subTree=qt,m(yt,qt,d(yt.el),ae(yt),q,ke,j),pe.el=qt.el,bt===null&&am(q,qt.el),Xe&&bs(Xe,ke),(wt=pe.props&&pe.props.onVnodeUpdated)&&bs(()=>Io(wt,it,pe,At),ke)}else{let pe;const{el:Ie,props:Xe}=se,{bm:it,m:At,parent:bt,root:wt,type:qt}=q,yt=$r(se);if(Jl(q,!1),it&&Mc(it),!yt&&(pe=Xe&&Xe.onVnodeBeforeMount)&&Io(pe,bt,se),Jl(q,!0),Ie&&ge){const Kt=()=>{q.subTree=ch(q),ge(Ie,q.subTree,q,ke,null)};yt&&qt.__asyncHydrate?qt.__asyncHydrate(Ie,q,Kt):Kt()}else{wt.ce&&wt.ce._hasShadowRoot()&&wt.ce._injectChildStyle(qt,q.parent?q.parent.type:void 0);const Kt=q.subTree=ch(q);m(null,Kt,ye,de,q,ke,j),se.el=Kt.el}if(At&&bs(At,ke),!yt&&(pe=Xe&&Xe.onVnodeMounted)){const Kt=se;bs(()=>Io(pe,bt,Kt),ke)}(se.shapeFlag&256||bt&&$r(bt.vnode)&&bt.vnode.shapeFlag&256)&&q.a&&bs(q.a,ke),q.isMounted=!0,se=ye=de=null}};q.scope.on();const Ae=q.effect=new $h(ve);q.scope.off();const $e=q.update=Ae.run.bind(Ae),Oe=q.job=Ae.runIfDirty.bind(Ae);Oe.i=q,Oe.id=q.uid,Ae.scheduler=()=>fy(Oe),Jl(q,!0),$e()},z=(q,se,ye)=>{se.component=q;const de=q.vnode.props;q.vnode=se,q.next=null,GT(q,se.props,de,ye),XT(q,se.children,ye),Or(),$b(q),Rr()},W=(q,se,ye,de,ke,j,ne,ve,Ae=!1)=>{const $e=q&&q.children,Oe=q?q.shapeFlag:0,pe=se.children,{patchFlag:Ie,shapeFlag:Xe}=se;if(Ie>0){if(Ie&128){U($e,pe,ye,de,ke,j,ne,ve,Ae);return}else if(Ie&256){ee($e,pe,ye,de,ke,j,ne,ve,Ae);return}}Xe&8?(Oe&16&&te($e,ke,j),pe!==$e&&u(ye,pe)):Oe&16?Xe&16?U($e,pe,ye,de,ke,j,ne,ve,Ae):te($e,ke,j,!0):(Oe&8&&u(ye,""),Xe&16&&w(pe,ye,de,ke,j,ne,ve,Ae))},ee=(q,se,ye,de,ke,j,ne,ve,Ae)=>{q=q||Cc,se=se||Cc;const $e=q.length,Oe=se.length,pe=Math.min($e,Oe);let Ie;for(Ie=0;Ie<pe;Ie++){const Xe=se[Ie]=Ae?Sr(se[Ie]):Lo(se[Ie]);m(q[Ie],Xe,ye,null,ke,j,ne,ve,Ae)}$e>Oe?te(q,ke,j,!0,!1,pe):w(se,ye,de,ke,j,ne,ve,Ae,pe)},U=(q,se,ye,de,ke,j,ne,ve,Ae)=>{let $e=0;const Oe=se.length;let pe=q.length-1,Ie=Oe-1;for(;$e<=pe&&$e<=Ie;){const Xe=q[$e],it=se[$e]=Ae?Sr(se[$e]):Lo(se[$e]);if(Ni(Xe,it))m(Xe,it,ye,null,ke,j,ne,ve,Ae);else break;$e++}for(;$e<=pe&&$e<=Ie;){const Xe=q[pe],it=se[Ie]=Ae?Sr(se[Ie]):Lo(se[Ie]);if(Ni(Xe,it))m(Xe,it,ye,null,ke,j,ne,ve,Ae);else break;pe--,Ie--}if($e>pe){if($e<=Ie){const Xe=Ie+1,it=Xe<Oe?se[Xe].el:de;for(;$e<=Ie;)m(null,se[$e]=Ae?Sr(se[$e]):Lo(se[$e]),ye,it,ke,j,ne,ve,Ae),$e++}}else if($e>Ie)for(;$e<=pe;)ue(q[$e],ke,j,!0),$e++;else{const Xe=$e,it=$e,At=new Map;for($e=it;$e<=Ie;$e++){const Jt=se[$e]=Ae?Sr(se[$e]):Lo(se[$e]);Jt.key!=null&&At.set(Jt.key,$e)}let bt,wt=0;const qt=Ie-it+1;let yt=!1,Kt=0;const gs=new Array(qt);for($e=0;$e<qt;$e++)gs[$e]=0;for($e=Xe;$e<=pe;$e++){const Jt=q[$e];if(wt>=qt){ue(Jt,ke,j,!0);continue}let wn;if(Jt.key!=null)wn=At.get(Jt.key);else for(bt=it;bt<=Ie;bt++)if(gs[bt-it]===0&&Ni(Jt,se[bt])){wn=bt;break}wn===void 0?ue(Jt,ke,j,!0):(gs[wn-it]=$e+1,wn>=Kt?Kt=wn:yt=!0,m(Jt,se[wn],ye,null,ke,j,ne,ve,Ae),wt++)}const En=yt?t9(gs):Cc;for(bt=En.length-1,$e=qt-1;$e>=0;$e--){const Jt=it+$e,wn=se[Jt],vs=se[Jt+1],st=Jt+1<Oe?vs.el||d3(vs):de;gs[$e]===0?m(null,wn,ye,st,ke,j,ne,ve,Ae):yt&&(bt<0||$e!==En[bt]?Y(wn,ye,st,2):bt--)}}},Y=(q,se,ye,de,ke=null)=>{const{el:j,type:ne,transition:ve,children:Ae,shapeFlag:$e}=q;if($e&6){Y(q.component.subTree,se,ye,de);return}if($e&128){q.suspense.move(se,ye,de);return}if($e&64){ne.move(q,se,ye,K);return}if(ne===Be){s(j,se,ye);for(let pe=0;pe<Ae.length;pe++)Y(Ae[pe],se,ye,de);s(q.anchor,se,ye);return}if(ne===Ic){y(q,se,ye);return}if(de!==2&&$e&1&&ve)if(de===0)ve.persisted&&!j[mi]?s(j,se,ye):(ve.beforeEnter(j),s(j,se,ye),bs(()=>ve.enter(j),ke));else{const{leave:pe,delayLeave:Ie,afterLeave:Xe}=ve,it=()=>{q.ctx.isUnmounted?o(j):s(j,se,ye)},At=()=>{const bt=j._isLeaving||!!j[mi];j._isLeaving&&j[mi](!0),ve.persisted&&!bt?it():pe(j,()=>{it(),Xe&&Xe()})};Ie?Ie(j,it,At):At()}else s(j,se,ye)},ue=(q,se,ye,de=!1,ke=!1)=>{const{type:j,props:ne,ref:ve,children:Ae,dynamicChildren:$e,shapeFlag:Oe,patchFlag:pe,dirs:Ie,cacheIndex:Xe,memo:it}=q;if(pe===-2&&(ke=!1),ve!=null&&(Or(),Tc(ve,null,ye,q,!0),Rr()),Xe!=null&&(se.renderCache[Xe]=void 0),Oe&256){se.ctx.deactivate(q);return}const At=Oe&1&&Ie,bt=!$r(q);let wt;if(bt&&(wt=ne&&ne.onVnodeBeforeUnmount)&&Io(wt,se,q),Oe&6)Z(q.component,ye,de);else{if(Oe&128){q.suspense.unmount(ye,de);return}At&&Yi(q,null,se,"beforeUnmount"),Oe&64?q.type.remove(q,se,ye,K,de):$e&&!$e.hasOnce&&(j!==Be||pe>0&&pe&64)?te($e,se,ye,!1,!0):(j===Be&&pe&384||!ke&&Oe&16)&&te(Ae,se,ye),de&&fe(q)}const qt=it!=null&&Xe==null;(bt&&(wt=ne&&ne.onVnodeUnmounted)||At||qt)&&bs(()=>{wt&&Io(wt,se,q),At&&Yi(q,null,se,"unmounted"),qt&&(q.el=null)},ye)},fe=q=>{const{type:se,el:ye,anchor:de,transition:ke}=q;if(se===Be){oe(ye,de);return}if(se===Ic){k(q);return}const j=()=>{o(ye),ke&&!ke.persisted&&ke.afterLeave&&ke.afterLeave()};if(q.shapeFlag&1&&ke&&!ke.persisted){const{leave:ne,delayLeave:ve}=ke,Ae=()=>ne(ye,j);ve?ve(q.el,j,Ae):Ae()}else j()},oe=(q,se)=>{let ye;for(;q!==se;)ye=f(q),o(q),q=ye;o(se)},Z=(q,se,ye)=>{const{bum:de,scope:ke,job:j,subTree:ne,um:ve,m:Ae,a:$e}=q;Wh(Ae),Wh($e),de&&Mc(de),ke.stop(),j&&(j.flags|=8,ue(ne,q,se,ye)),ve&&bs(ve,se),bs(()=>{q.isUnmounted=!0},se)},te=(q,se,ye,de=!1,ke=!1,j=0)=>{for(let ne=j;ne<q.length;ne++)ue(q[ne],se,ye,de,ke)},ae=q=>{if(q.shapeFlag&6)return ae(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const se=f(q.anchor||q.el),ye=se&&se[B4];return ye?f(ye):se};let He=!1;const he=(q,se,ye)=>{let de;q==null?se._vnode&&(ue(se._vnode,null,null,!0),de=se._vnode.component):m(se._vnode||null,q,se,null,null,null,ye),se._vnode=q,He||(He=!0,$b(de),Dh(),He=!1)},K={p:m,um:ue,m:Y,r:fe,mt:B,mc:w,pc:W,pbc:N,n:ae,o:e};let ce,ge;return t&&([ce,ge]=t(K)),{render:he,hydrate:ce,createApp:HT(he,ce)}}function Q1({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 Jl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function c3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function wy(e,t,n=!1){const s=e.children,o=t.children;if(xt(s)&&xt(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=Sr(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&wy(r,l)),l.type===wl&&(l.patchFlag===-1&&(l=o[i]=Sr(l)),l.el=r.el),l.type===_s&&!l.el&&(l.el=r.el)}}function t9(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function u3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:u3(t)}function Wh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function d3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?d3(t.subTree):null}const zh=e=>e.__isSuspense;let Fg=0;const n9={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)s9(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}o9(e,t,n,s,o,r,l,a,c)}},hydrate:i9,normalize:r9},lwe=n9;function md(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function s9(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=f3(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(md(e,"onPending"),md(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Nc(f,e.ssFallback)):f.resolve(!1,!0)}function o9(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:b,isHydrating:v}=d;if(m)d.pendingBranch=f,Ni(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,s,o,null,i,r,l),Nc(d,h)))):(d.pendingId=Fg++,v?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,s,o,null,i,r,l),Nc(d,h))):p&&Ni(p,f)?(a(p,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Ni(p,f))a(p,f,n,s,o,d,i,r,l),Nc(d,f);else if(md(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Fg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:y}=d;g>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},g):g===0&&d.fallback(h)}}function f3(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:b}}=c;let v;const g=l9(e);g&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?Ih(e.props.timeout):void 0,k=i,E={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Fg++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:w,activeBranch:M,pendingBranch:N,pendingId:F,effects:S,parentComponent:I,container:B,isInFallback:R}=E;let P=!1;if(E.isHydrating)E.isHydrating=!1;else if(!L){P=M&&N.transition&&N.transition.mode==="out-in";let ee=!1;P&&(M.transition.afterLeave=()=>{F===E.pendingId&&(f(N,B,i===k&&!ee?p(M):i,0),Bh(S),R&&w.ssFallback&&(w.ssFallback.el=null))}),M&&!E.isFallbackMountPending&&(m(M.el)===B&&(i=p(M),ee=!0),h(M,I,E,!0),!P&&R&&w.ssFallback&&bs(()=>w.ssFallback.el=null,E)),P||f(N,B,i,0)}E.isFallbackMountPending=!1,Nc(E,N),E.pendingBranch=null,E.isInFallback=!1;let z=E.parent,W=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),W=!0;break}z=z.parent}!W&&!P&&Bh(S),E.effects=[],g&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),md(w,"onResolve")},fallback(L){if(!E.pendingBranch)return;const{vnode:$,activeBranch:w,parentComponent:M,container:N,namespace:F}=E;md($,"onFallback");const S=p(w),I=()=>{E.isFallbackMountPending=!1,E.isInFallback&&(d(null,L,N,S,M,null,F,l,a),Nc(E,L))},B=L.transition&&L.transition.mode==="out-in";B&&(E.isFallbackMountPending=!0,w.transition.afterLeave=I),E.isInFallback=!0,h(w,M,null,!0),B||I()},move(L,$,w){E.activeBranch&&f(E.activeBranch,L,$,w),E.container=L},next(){return E.activeBranch&&p(E.activeBranch)},registerDep(L,$,w){const M=!!E.pendingBranch;M&&E.deps++;const N=L.vnode.el;L.asyncDep.catch(F=>{Jc(F,L,0)}).then(F=>{if(L.isUnmounted||E.isUnmounted||E.pendingId!==L.suspenseId)return;gd(),L.asyncResolved=!0;const{vnode:S}=L;Og(L,F,!1),N&&(S.el=N);const I=!N&&L.subTree.el;$(L,S,m(N||L.subTree.el),N?null:p(L.subTree),E,r,w),I&&(S.placeholder=null,b(I)),am(L,S.el),M&&--E.deps===0&&E.resolve()})},unmount(L,$){E.isUnmounted=!0,E.activeBranch&&h(E.activeBranch,n,L,$),E.pendingBranch&&h(E.pendingBranch,n,L,$)}};return E}function i9(e,t,n,s,o,i,r,l,a){const c=t.suspense=f3(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function r9(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Vb(s?n.default:n),e.ssFallback=s?Vb(n.fallback):re(_s)}function Vb(e){let t;if($t(e)){const n=_a&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=so,p3())}return xt(e)&&(e=UT(e)),e=Lo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function h3(e,t){t&&t.pendingBranch?xt(e)?t.effects.push(...e):t.effects.push(e):Bh(e)}function Nc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,am(s,o))}function l9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),wl=Symbol.for("v-txt"),_s=Symbol.for("v-cmt"),Ic=Symbol.for("v-stc"),Ku=[];let so=null;function x(e=!1){Ku.push(so=e?null:[])}function p3(){Ku.pop(),so=Ku[Ku.length-1]||null}let _a=1;function Uh(e,t=!1){_a+=e,e<0&&so&&t&&(so.hasOnce=!0)}function m3(e){return e.dynamicChildren=_a>0?so||Cc:null,p3(),_a>0&&so&&so.push(e),e}function T(e,t,n,s,o,i){return m3(_(e,t,n,s,o,i,!0))}function xe(e,t,n,s,o){return m3(re(e,t,n,s,o,!0))}function El(e){return e?e.__v_isVNode===!0:!1}function Ni(e,t){return e.type===t.type&&e.key===t.key}function awe(e){}const g3=({key:e})=>e??null,uh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Mn(e)||hs(e)||$t(e)?{i:Ys,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,s=0,o=null,i=e===Be?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&g3(t),ref:t&&uh(t),scopeId:om,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ys};return l?(Sy(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Mn(n)?8:16),_a>0&&!r&&so&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&so.push(a),a}const re=a9;function a9(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===V4)&&(e=_s),El(e)){const l=Dr(e,t,!0);return n&&Sy(l,n),_a>0&&!i&&so&&(l.shapeFlag&6?so[so.indexOf(e)]=l:so.push(l)),l.patchFlag=-2,l}if(p9(e)&&(e=e.__vccOpts),t){t=c9(t);let{class:l,style:a}=t;l&&!Mn(l)&&(t.class=Pe(l)),dn(a)&&(sm(a)&&!xt(a)&&(a=bn({},a)),t.style=Gt(a))}const r=Mn(e)?1:zh(e)?128:D4(e)?64:dn(e)?4:$t(e)?2:0;return _(e,t,n,s,o,r,i,!0)}function c9(e){return e?sm(e)||n3(e)?bn({},e):e:null}function Dr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?kn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&g3(c),ref:t&&t.ref?n&&i?xt(i)?i.concat(uh(t)):[i,uh(t)]:uh(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!==Be?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Dr(e.ssContent),ssFallback:e.ssFallback&&Dr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Ml(u,a.clone(u)),u}function Qe(e=" ",t=0){return re(wl,null,e,t)}function _y(e,t){const n=re(Ic,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(x(),xe(_s,null,e)):re(_s,null,e)}function Lo(e){return e==null||typeof e=="boolean"?re(_s):xt(e)?re(Be,null,e.slice()):El(e)?Sr(e):re(wl,null,String(e))}function Sr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Dr(e)}function Sy(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(xt(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Sy(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!n3(t)?t._ctx=Ys:o===3&&Ys&&(Ys.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Ys},n=32):(t=String(t),s&64?(n=16,t=[Qe(t)]):n=8);e.children=t,e.shapeFlag|=n}function kn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Pe([t.class,s.class]));else if(o==="style")t.style=Gt([t.style,s.style]);else if(Rd(o)){const i=t[o],r=s[o];r&&i!==r&&!(xt(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!jp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function Io(e,t,n,s=null){Si(e,t,7,[n,s])}const u9=Z4();let d9=0;function v3(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||u9,i={uid:d9++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new d4(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:o3(s,o),emitsOptions:X4(s,o),emit:null,emitted:null,propsDefaults:Xt,inheritAttrs:s.inheritAttrs,ctx:Xt,data:Xt,props:Xt,attrs:Xt,slots:Xt,refs:Xt,setupState:Xt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=WT.bind(null,i),e.ce&&e.ce(i),i}let Gs=null;const Qs=()=>Gs||Ys;let qh,$c;{const e=Qp(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};qh=t("__VUE_INSTANCE_SETTERS__",n=>Gs=n),$c=t("__VUE_SSR_SETTERS__",n=>Sa=n)}const eu=e=>{const t=Gs;return qh(e),e.scope.on(),()=>{e.scope.off(),qh(t)}},gd=()=>{Gs&&Gs.scope.off(),qh(null)};function y3(e){return e.vnode.shapeFlag&4}let Sa=!1;function k3(e,t=!1,n=!1){t&&$c(t);const{props:s,children:o}=e.vnode,i=y3(e);KT(e,s,i,t),QT(e,o,n||t);const r=i?f9(e,t):void 0;return t&&$c(!1),r}function f9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ng);const{setup:s}=n;if(s){Or();const o=e.setupContext=s.length>1?x3(e):null,i=eu(e),r=Bd(s,e,0,[e.props,o]),l=ry(r);if(Rr(),i(),(l||e.sp)&&!$r(e)&&py(e),l){if(r.then(gd,gd),t)return r.then(a=>{Og(e,a,t)}).catch(a=>{Jc(a,e,0)});e.asyncDep=r}else Og(e,r,t)}else b3(e,t)}function Og(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:dn(t)&&(e.setupState=T4(t)),b3(e,n)}let jh,Rg;function cwe(e){jh=e,Rg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,LT))}}const uwe=()=>!jh;function b3(e,t,n){const s=e.type;if(!e.render){if(!t&&jh&&!s.render){const o=s.template||ky(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=bn(bn({isCustomElement:i,delimiters:l},r),a);s.render=jh(o,c)}}e.render=s.render||xi,Rg&&Rg(e)}{const o=eu(e);Or();try{FT(e)}finally{Rr(),o()}}}const h9={get(e,t){return no(e,"get",""),e[t]}};function x3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,h9),slots:e.slots,emit:e.emit,expose:t}}function Wd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(T4(ht(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Vu)return Vu[n](e)},has(t,n){return n in t||n in Vu}})):e.proxy}function Bg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function p9(e){return $t(e)&&"__vccOpts"in e}const D=(e,t)=>ZE(e,t,Sa);function gn(e,t,n){try{Uh(-1);const s=arguments.length;return s===2?dn(t)&&!xt(t)?El(t)?re(e,null,[t]):re(e,t):re(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&El(n)&&(n=[n]),re(e,t,n))}finally{Uh(1)}}function dwe(){}function fwe(e,t,n,s){const o=n[s];if(o&&m9(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function m9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Vs(n[s],t[s]))return!1;return _a>0&&so&&so.push(e),!0}const g9="3.5.35",hwe=xi,pwe=tT,mwe=cc,gwe=O4,v9={createComponentInstance:v3,setupComponent:k3,renderComponentRoot:ch,setCurrentRenderingInstance:fd,isVNode:El,normalizeVNode:Lo,getComponentPublicInstance:Wd,ensureValidVNode:yy,pushWarningContext:JE,popWarningContext:eT},vwe=v9,ywe=null,kwe=null,bwe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Dg;const Kb=typeof window<"u"&&window.trustedTypes;if(Kb)try{Dg=Kb.createPolicy("vue",{createHTML:e=>e})}catch{}const w3=Dg?e=>Dg.createHTML(e):e=>e,y9="http://www.w3.org/2000/svg",k9="http://www.w3.org/1998/Math/MathML",kr=typeof document<"u"?document:null,Gb=kr&&kr.createElement("template"),b9={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?kr.createElementNS(y9,e):t==="mathml"?kr.createElementNS(k9,e):n?kr.createElement(e,{is:n}):kr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>kr.createTextNode(e),createComment:e=>kr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>kr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Gb.innerHTML=w3(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Gb.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Jr="transition",Au="animation",Uc=Symbol("_vtc"),_3={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},S3=bn({},H4,_3),x9=e=>(e.displayName="Transition",e.props=S3,e),Tl=x9((e,{slots:t})=>gn(hT,C3(e),t)),ea=(e,t=[])=>{xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Yb=e=>e?xt(e)?e.some(t=>t.length>1):e.length>1:!1;function C3(e){const t={};for(const S in e)S in _3||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=w9(o),m=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:g,onEnterCancelled:y,onLeave:k,onLeaveCancelled:E,onBeforeAppear:L=v,onAppear:$=g,onAppearCancelled:w=y}=t,M=(S,I,B,R)=>{S._enterCancelled=R,cl(S,I?u:l),cl(S,I?c:r),B&&B()},N=(S,I)=>{S._isLeaving=!1,cl(S,d),cl(S,h),cl(S,f),I&&I()},F=S=>(I,B)=>{const R=S?$:g,P=()=>M(I,S,B);ea(R,[I,P]),Zb(()=>{cl(I,S?a:i),Ki(I,S?u:l),Yb(R)||Qb(I,s,m,P)})};return bn(t,{onBeforeEnter(S){ea(v,[S]),Ki(S,i),Ki(S,r)},onBeforeAppear(S){ea(L,[S]),Ki(S,a),Ki(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,I){S._isLeaving=!0;const B=()=>N(S,I);Ki(S,d),S._enterCancelled?(Ki(S,f),Pg(S)):(Pg(S),Ki(S,f)),Zb(()=>{S._isLeaving&&(cl(S,d),Ki(S,h),Yb(k)||Qb(S,s,b,B))}),ea(k,[S,B])},onEnterCancelled(S){M(S,!1,void 0,!0),ea(y,[S])},onAppearCancelled(S){M(S,!0,void 0,!0),ea(w,[S])},onLeaveCancelled(S){N(S),ea(E,[S])}})}function w9(e){if(e==null)return null;if(dn(e))return[X1(e.enter),X1(e.leave)];{const t=X1(e);return[t,t]}}function X1(e){return Ih(e)}function Ki(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Uc]||(e[Uc]=new Set)).add(t)}function cl(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Uc];n&&(n.delete(t),n.size||(e[Uc]=void 0))}function Zb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let _9=0;function Qb(e,t,n,s){const o=e._endId=++_9,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=A3(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function A3(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${Jr}Delay`),i=s(`${Jr}Duration`),r=Xb(o,i),l=s(`${Au}Delay`),a=s(`${Au}Duration`),c=Xb(l,a);let u=null,d=0,f=0;t===Jr?r>0&&(u=Jr,d=r,f=i.length):t===Au?c>0&&(u=Au,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Jr:Au:null,f=u?u===Jr?i.length:a.length:0);const h=u===Jr&&/\b(?:transform|all)(?:,|$)/.test(s(`${Jr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Xb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Jb(n)+Jb(e[s])))}function Jb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Pg(e){return(e?e.ownerDocument:document).body.offsetHeight}function S9(e,t,n){const s=e[Uc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Vh=Symbol("_vod"),M3=Symbol("_vsh"),yi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Vh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Mu(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Mu(e,!0),s.enter(e)):s.leave(e,()=>{Mu(e,!1)}):Mu(e,t))},beforeUnmount(e,{value:t}){Mu(e,t)}};function Mu(e,t){e.style.display=t?e[Vh]:"none",e[M3]=!t}function C9(){yi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const E3=Symbol("");function xwe(e){const t=Qs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Kh(i,o))},s=()=>{const o=e(t.proxy);t.ce?Kh(t.ce,o):Hg(t.subTree,o),n(o)};j4(()=>{Bh(s)}),fn(()=>{Ze(s,xi,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),xn(()=>o.disconnect())})}function Hg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Hg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Kh(e.el,t);else if(e.type===Be)e.children.forEach(n=>Hg(n,t));else if(e.type===Ic){let{el:n,anchor:s}=e;for(;n&&(Kh(n,t),n!==s);)n=n.nextSibling}}function Kh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=wE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[E3]=s}}const A9=/(?:^|;)\s*display\s*:/;function M9(e,t,n){const s=e.style,o=Mn(n);let i=!1;if(n&&!o){if(t)if(Mn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Bu(s,l,"")}else for(const r in t)n[r]==null&&Bu(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?T9(e,r,!Mn(t)&&t?t[r]:void 0,l)||Bu(s,r,l):Bu(s,r,"")}}else if(o){if(t!==n){const r=s[E3];r&&(n+=";"+r),s.cssText=n,i=A9.test(n)}}else t&&e.removeAttribute("style");Vh in e&&(e[Vh]=i?s.display:"",e[M3]&&(s.display="none"))}const ex=/\s*!important$/;function Bu(e,t,n){if(xt(n))n.forEach(s=>Bu(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=E9(e,t);ex.test(n)?e.setProperty(Fo(s),n.replace(ex,""),"important"):e[s]=n}}const tx=["Webkit","Moz","ms"],J1={};function E9(e,t){const n=J1[t];if(n)return n;let s=$s(t);if(s!=="filter"&&s in e)return J1[t]=s;s=Yp(s);for(let o=0;o<tx.length;o++){const i=tx[o]+s;if(i in e)return J1[t]=i}return t}function T9(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Mn(s)&&n===s}const nx="http://www.w3.org/1999/xlink";function sx(e,t,n,s,o,i=bE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(nx,t.slice(6,t.length)):e.setAttributeNS(nx,t,n):n==null||i&&!a4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ni(n)?String(n):n)}function ox(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?w3(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=a4(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function Er(e,t,n,s){e.addEventListener(t,n,s)}function N9(e,t,n,s){e.removeEventListener(t,n,s)}const ix=Symbol("_vei");function I9(e,t,n,s,o=null){const i=e[ix]||(e[ix]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=$9(t);if(s){const c=i[t]=O9(s,o);Er(e,l,c,a)}else r&&(N9(e,l,r,a),i[t]=void 0)}}const rx=/(?:Once|Passive|Capture)$/;function $9(e){let t;if(rx.test(e)){t={};let s;for(;s=e.match(rx);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Fo(e.slice(2)),t]}let e0=0;const L9=Promise.resolve(),F9=()=>e0||(L9.then(()=>e0=0),e0=Date.now());function O9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(xt(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&Si(c,t,5,l)}}else Si(o,t,5,[s])};return n.value=e,n.attached=F9(),n}const lx=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,R9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?S9(e,s,r):t==="style"?M9(e,n,s):Rd(t)?jp(t)||I9(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):B9(e,t,s,r))?(ox(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sx(e,t,s,r,i,t!=="value")):e._isVueCE&&(D9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Mn(s)))?ox(e,$s(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),sx(e,t,s,r))};function B9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&lx(t)&&$t(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return lx(t)&&Mn(n)?!1:t in e}function D9(e,t){const n=e._def.props;if(!n)return!1;const s=$s(t);return Array.isArray(n)?n.some(o=>$s(o)===s):Object.keys(n).some(o=>$s(o)===s)}const ax={};function P9(e,t,n){let s=Ge(e,t);Vp(s)&&(s=bn({},s,t));class o extends Cy{constructor(r){super(s,r,n)}}return o.def=s,o}const wwe=((e,t)=>P9(e,t,n7)),H9=typeof HTMLElement<"u"?HTMLElement:class{};class Cy extends H9{constructor(t,n={},s=Zh){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==Zh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(bn({},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 Cy){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,pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!xt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Ih(this._props[a])),(l||(l=Object.create(null)))[$s(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)un(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=xt(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map($s))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):ax;const o=$s(t);n&&this._numberProps&&this._numberProps[o]&&(s=Ih(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===ax?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Fo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Fo(t),n+""):n||this.removeAttribute(Fo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),t7(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=re(this._def,bn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Vp(r[0])?bn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Fo(i)!==i&&o(Fo(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function W9(e){const t=Qs(),n=t&&t.ce;return n||null}function _we(){const e=W9();return e&&e.shadowRoot}function Swe(e="$style"){{const t=Qs();if(!t)return Xt;const n=t.type.__cssModules;if(!n)return Xt;const s=n[e];return s||Xt}}const T3=new WeakMap,N3=new WeakMap,Gh=Symbol("_moveCb"),cx=Symbol("_enterCb"),z9=e=>(delete e.props.mode,e),U9=z9({name:"TransitionGroup",props:bn({},S3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Qs(),s=P4();let o,i;return my(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!G9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(j9),o.forEach(V9);const l=o.filter(K9);Pg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ki(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Gh]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Gh]=null,cl(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=nn(e),l=C3(r);let a=r.tag||Be;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),Ml(u,hd(u,l,s,n)),T3.set(u,I3(u.el)))}i=t.default?hy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Ml(u,hd(u,l,s,n))}return re(a,null,i)}}}),q9=U9;function j9(e){const t=e.el;t[Gh]&&t[Gh](),t[cx]&&t[cx]()}function V9(e){N3.set(e,I3(e.el))}function K9(e){const t=T3.get(e),n=N3.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function I3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function G9(e,t,n){const s=e.cloneNode(),o=e[Uc];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=A3(s);return i.removeChild(s),r}const Nl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xt(t)?n=>Mc(t,n):t};function Y9(e){e.target.composing=!0}function ux(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const wi=Symbol("_assign");function dx(e,t,n){return t&&(e=e.trim()),n&&(e=Zp(e)),e}const So={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[wi]=Nl(o);const i=s||o.props&&o.props.type==="number";Er(e,t?"change":"input",r=>{r.target.composing||e[wi](dx(e.value,n,i))}),(n||i)&&Er(e,"change",()=>{e.value=dx(e.value,n,i)}),t||(Er(e,"compositionstart",Y9),Er(e,"compositionend",ux),Er(e,"change",ux))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[wi]=Nl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Zp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},Yh={deep:!0,created(e,t,n){e[wi]=Nl(n),Er(e,"change",()=>{const s=e._modelValue,o=qc(e),i=e.checked,r=e[wi];if(xt(s)){const l=Xp(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(Na(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(L3(e,i))})},mounted:fx,beforeUpdate(e,t,n){e[wi]=Nl(n),fx(e,t,n)}};function fx(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(xt(t))o=Xp(t,s.props.value)>-1;else if(Na(t))o=t.has(s.props.value);else{if(t===n)return;o=Fr(t,L3(e,!0))}e.checked!==o&&(e.checked=o)}const $3={created(e,{value:t},n){e.checked=Fr(t,n.props.value),e[wi]=Nl(n),Er(e,"change",()=>{e[wi](qc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[wi]=Nl(s),t!==n&&(e.checked=Fr(t,s.props.value))}},Wg={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Na(t);Er(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Zp(qc(r)):qc(r));e[wi](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,pt(()=>{e._assigning=!1})}),e[wi]=Nl(s)},mounted(e,{value:t}){hx(e,t)},beforeUpdate(e,t,n){e[wi]=Nl(n)},updated(e,{value:t}){e._assigning||hx(e,t)}};function hx(e,t){const n=e.multiple,s=xt(t);if(!(n&&!s&&!Na(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=qc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Xp(t,l)>-1}else r.selected=t.has(l);else if(Fr(qc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function qc(e){return"_value"in e?e._value:e.value}function L3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Z9={created(e,t,n){If(e,t,n,null,"created")},mounted(e,t,n){If(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){If(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){If(e,t,n,s,"updated")}};function F3(e,t){switch(e){case"SELECT":return Wg;case"TEXTAREA":return So;default:switch(t){case"checkbox":return Yh;case"radio":return $3;default:return So}}}function If(e,t,n,s,o){const r=F3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function Q9(){So.getSSRProps=({value:e})=>({value:e}),$3.getSSRProps=({value:e},t)=>{if(t.props&&Fr(t.props.value,e))return{checked:!0}},Yh.getSSRProps=({value:e},t)=>{if(xt(e)){if(t.props&&Xp(e,t.props.value)>-1)return{checked:!0}}else if(Na(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Z9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=F3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const X9=["ctrl","shift","alt","meta"],J9={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)=>X9.some(n=>e[`${n}Key`]&&!t.includes(n))},kt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=J9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},e7={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Fo(o.key);if(t.some(r=>r===i||e7[r]===i))return e(o)}))},O3=bn({patchProp:R9},b9);let Gu,px=!1;function R3(){return Gu||(Gu=JT(O3))}function B3(){return Gu=px?Gu:e9(O3),px=!0,Gu}const t7=((...e)=>{R3().render(...e)}),Cwe=((...e)=>{B3().hydrate(...e)}),Zh=((...e)=>{const t=R3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=P3(s);if(!o)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,D3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),n7=((...e)=>{const t=B3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=P3(s);if(o)return n(o,!0,D3(o))},t});function D3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function P3(e){return Mn(e)?document.querySelector(e):e}let mx=!1;const Awe=()=>{mx||(mx=!0,Q9(),C9())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function s7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Qh=typeof window<"u",Ol=(e,t=!1)=>t?Symbol.for(e):Symbol(e),o7=(e,t,n)=>i7({l:e,k:t,s:n}),i7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Cs=e=>typeof e=="number"&&isFinite(e),H3=e=>My(e)==="[object Date]",jc=e=>My(e)==="[object RegExp]",cm=e=>en(e)&&Object.keys(e).length===0,As=Object.assign,r7=Object.create,An=(e=null)=>r7(e);let gx;const ha=()=>gx||(gx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:An());function vx(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function l7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const a7=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,c7=/^(?:href|src|action|formaction)$/i;function Ay(e){return a7.test(e)}function u7(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const 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(s,i),n+=Ay(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function yx(e,t){if(c7.test(e)&&Ay(t))return"about:blank";const n=e.toLowerCase()==="style"?u7(t):t;return l7(n)}function d7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${yx(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${yx(s,o)}'`),/\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,s,o)=>Ay(o)?`${s}about:blank`:n),e}const f7=Object.prototype.hasOwnProperty;function bi(e,t){return f7.call(e,t)}const as=Array.isArray,Zn=e=>typeof e=="function",gt=e=>typeof e=="string",ln=e=>typeof e=="boolean",an=e=>e!==null&&typeof e=="object",h7=e=>an(e)&&Zn(e.then)&&Zn(e.catch),W3=Object.prototype.toString,My=e=>W3.call(e),en=e=>My(e)==="[object Object]",p7=e=>e==null?"":as(e)||en(e)&&e.toString===W3?JSON.stringify(e,null,2):String(e);function Ey(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const $f=e=>!an(e)||as(e);function dh(e,t){if($f(e)||$f(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(an(s[i])&&!an(o[i])&&(o[i]=Array.isArray(s[i])?[]:An()),$f(o[i])||$f(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function m7(e,t,n){return{line:e,column:t,offset:n}}function zg(e,t,n){return{start:e,end:t}}const pn={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},g7=17;function um(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function v7(e){throw e}const qi=" ",y7="\r",Js=`
|
|
29
|
-
`,k7="\u2028",b7="\u2029";function x7(e){const t=e;let n=0,s=1,o=1,i=0;const r=$=>t[$]===y7&&t[$+1]===Js,l=$=>t[$]===Js,a=$=>t[$]===b7,c=$=>t[$]===k7,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=$=>r($)||a($)||c($)?Js:t[$],b=()=>m(n),v=()=>m(n+i);function g(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,s=1,o=1,i=0}function E($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:b,currentPeek:v,next:g,peek:y,reset:k,resetPeek:E,skipToPeek:L}}const pr=void 0,w7=".",kx="'",_7="tokenizer";function S7(e,t={}){const n=t.location!==!1,s=x7(e),o=()=>s.index(),i=()=>m7(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(j,ne,ve,...Ae){const $e=c();if(ne.column+=ve,ne.offset+=ve,u){const Oe=n?zg($e.startLoc,ne):null,pe=um(j,Oe,{domain:_7,args:Ae});u(pe)}}function f(j,ne,ve){j.endLoc=i(),j.currentType=ne;const Ae={type:ne};return n&&(Ae.loc=zg(j.startLoc,j.endLoc)),ve!=null&&(Ae.value=ve),Ae}const h=j=>f(j,13);function p(j,ne){return j.currentChar()===ne?(j.next(),ne):(d(pn.EXPECTED_TOKEN,i(),0,ne),"")}function m(j){let ne="";for(;j.currentPeek()===qi||j.currentPeek()===Js;)ne+=j.currentPeek(),j.peek();return ne}function b(j){const ne=m(j);return j.skipToPeek(),ne}function v(j){if(j===pr)return!1;const ne=j.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne===95}function g(j){if(j===pr)return!1;const ne=j.charCodeAt(0);return ne>=48&&ne<=57}function y(j,ne){const{currentType:ve}=ne;if(ve!==2)return!1;m(j);const Ae=v(j.currentPeek());return j.resetPeek(),Ae}function k(j,ne){const{currentType:ve}=ne;if(ve!==2)return!1;m(j);const Ae=j.currentPeek()==="-"?j.peek():j.currentPeek(),$e=g(Ae);return j.resetPeek(),$e}function E(j,ne){const{currentType:ve}=ne;if(ve!==2)return!1;m(j);const Ae=j.currentPeek()===kx;return j.resetPeek(),Ae}function L(j,ne){const{currentType:ve}=ne;if(ve!==7)return!1;m(j);const Ae=j.currentPeek()===".";return j.resetPeek(),Ae}function $(j,ne){const{currentType:ve}=ne;if(ve!==8)return!1;m(j);const Ae=v(j.currentPeek());return j.resetPeek(),Ae}function w(j,ne){const{currentType:ve}=ne;if(!(ve===7||ve===11))return!1;m(j);const Ae=j.currentPeek()===":";return j.resetPeek(),Ae}function M(j,ne){const{currentType:ve}=ne;if(ve!==9)return!1;const Ae=()=>{const Oe=j.currentPeek();return Oe==="{"?v(j.peek()):Oe==="@"||Oe==="|"||Oe===":"||Oe==="."||Oe===qi||!Oe?!1:Oe===Js?(j.peek(),Ae()):F(j,!1)},$e=Ae();return j.resetPeek(),$e}function N(j){m(j);const ne=j.currentPeek()==="|";return j.resetPeek(),ne}function F(j,ne=!0){const ve=($e=!1,Oe="")=>{const pe=j.currentPeek();return pe==="{"||pe==="@"||!pe?$e:pe==="|"?!(Oe===qi||Oe===Js):pe===qi?(j.peek(),ve(!0,qi)):pe===Js?(j.peek(),ve(!0,Js)):!0},Ae=ve();return ne&&j.resetPeek(),Ae}function S(j,ne){const ve=j.currentChar();return ve===pr?pr:ne(ve)?(j.next(),ve):null}function I(j){const ne=j.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne>=48&&ne<=57||ne===95||ne===36}function B(j){return S(j,I)}function R(j){const ne=j.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne>=48&&ne<=57||ne===95||ne===36||ne===45}function P(j){return S(j,R)}function z(j){const ne=j.charCodeAt(0);return ne>=48&&ne<=57}function W(j){return S(j,z)}function ee(j){const ne=j.charCodeAt(0);return ne>=48&&ne<=57||ne>=65&&ne<=70||ne>=97&&ne<=102}function U(j){return S(j,ee)}function Y(j){let ne="",ve="";for(;ne=W(j);)ve+=ne;return ve}function ue(j){let ne="";for(;;){const ve=j.currentChar();if(ve==="\\"){const Ae=j.peek();Ae==="{"||Ae==="}"||Ae==="@"||Ae==="|"||Ae==="\\"?(ne+=ve+Ae,j.next(),j.next()):(j.resetPeek(),ne+=ve,j.next())}else{if(ve==="{"||ve==="}"||ve==="@"||ve==="|"||!ve)break;if(ve===qi||ve===Js)if(F(j))ne+=ve,j.next();else{if(N(j))break;ne+=ve,j.next()}else ne+=ve,j.next()}}return ne}function fe(j){b(j);let ne="",ve="";for(;ne=P(j);)ve+=ne;const Ae=j.currentChar();if(Ae&&Ae!=="}"&&Ae!==pr&&Ae!==qi&&Ae!==Js&&Ae!==" "){const $e=K(j);return d(pn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ve+$e),ve+$e}return j.currentChar()===pr&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ve}function oe(j){b(j);let ne="";return j.currentChar()==="-"?(j.next(),ne+=`-${Y(j)}`):ne+=Y(j),j.currentChar()===pr&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ne}function Z(j){return j!==kx&&j!==Js}function te(j){b(j),p(j,"'");let ne="",ve="";for(;ne=S(j,Z);)ne==="\\"?ve+=ae(j):ve+=ne;const Ae=j.currentChar();return Ae===Js||Ae===pr?(d(pn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ae===Js&&(j.next(),p(j,"'")),ve):(p(j,"'"),ve)}function ae(j){const ne=j.currentChar();switch(ne){case"\\":case"'":return j.next(),`\\${ne}`;case"u":return He(j,ne,4);case"U":return He(j,ne,6);default:return d(pn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,ne),""}}function He(j,ne,ve){p(j,ne);let Ae="";for(let $e=0;$e<ve;$e++){const Oe=U(j);if(!Oe){d(pn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${ne}${Ae}${j.currentChar()}`);break}Ae+=Oe}return`\\${ne}${Ae}`}function he(j){return j!=="{"&&j!=="}"&&j!==qi&&j!==Js}function K(j){b(j);let ne="",ve="";for(;ne=S(j,he);)ve+=ne;return ve}function ce(j){let ne="",ve="";for(;ne=B(j);)ve+=ne;return ve}function ge(j){const ne=ve=>{const Ae=j.currentChar();return Ae==="{"||Ae==="@"||Ae==="|"||Ae==="("||Ae===")"||!Ae||Ae===qi?ve:(ve+=Ae,j.next(),ne(ve))};return ne("")}function q(j){b(j);const ne=p(j,"|");return b(j),ne}function se(j,ne){let ve=null;switch(j.currentChar()){case"{":return ne.braceNest>=1&&d(pn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),ve=f(ne,2,"{"),b(j),ne.braceNest++,ve;case"}":return ne.braceNest>0&&ne.currentType===2&&d(pn.EMPTY_PLACEHOLDER,i(),0),j.next(),ve=f(ne,3,"}"),ne.braceNest--,ne.braceNest>0&&b(j),ne.inLinked&&ne.braceNest===0&&(ne.inLinked=!1),ve;case"@":return ne.braceNest>0&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ve=ye(j,ne)||h(ne),ne.braceNest=0,ve;default:{let $e=!0,Oe=!0,pe=!0;if(N(j))return ne.braceNest>0&&d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ve=f(ne,1,q(j)),ne.braceNest=0,ne.inLinked=!1,ve;if(ne.braceNest>0&&(ne.currentType===4||ne.currentType===5||ne.currentType===6))return d(pn.UNTERMINATED_CLOSING_BRACE,i(),0),ne.braceNest=0,de(j,ne);if($e=y(j,ne))return ve=f(ne,4,fe(j)),b(j),ve;if(Oe=k(j,ne))return ve=f(ne,5,oe(j)),b(j),ve;if(pe=E(j,ne))return ve=f(ne,6,te(j)),b(j),ve;if(!$e&&!Oe&&!pe)return ve=f(ne,12,K(j)),d(pn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ve.value),b(j),ve;break}}return ve}function ye(j,ne){const{currentType:ve}=ne;let Ae=null;const $e=j.currentChar();switch((ve===7||ve===8||ve===11||ve===9)&&($e===Js||$e===qi)&&d(pn.INVALID_LINKED_FORMAT,i(),0),$e){case"@":return j.next(),Ae=f(ne,7,"@"),ne.inLinked=!0,Ae;case".":return b(j),j.next(),f(ne,8,".");case":":return b(j),j.next(),f(ne,9,":");default:return N(j)?(Ae=f(ne,1,q(j)),ne.braceNest=0,ne.inLinked=!1,Ae):L(j,ne)||w(j,ne)?(b(j),ye(j,ne)):$(j,ne)?(b(j),f(ne,11,ce(j))):M(j,ne)?(b(j),$e==="{"?se(j,ne)||Ae:f(ne,10,ge(j))):(ve===7&&d(pn.INVALID_LINKED_FORMAT,i(),0),ne.braceNest=0,ne.inLinked=!1,de(j,ne))}}function de(j,ne){let ve={type:13};if(ne.braceNest>0)return se(j,ne)||h(ne);if(ne.inLinked)return ye(j,ne)||h(ne);switch(j.currentChar()){case"{":return se(j,ne)||h(ne);case"}":return d(pn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(ne,3,"}");case"@":return ye(j,ne)||h(ne);default:{if(N(j))return ve=f(ne,1,q(j)),ne.braceNest=0,ne.inLinked=!1,ve;if(F(j))return f(ne,0,ue(j));break}}return ve}function ke(){const{currentType:j,offset:ne,startLoc:ve,endLoc:Ae}=a;return a.lastType=j,a.lastOffset=ne,a.lastStartLoc=ve,a.lastEndLoc=Ae,a.offset=o(),a.startLoc=i(),s.currentChar()===pr?f(a,13):de(s,a)}return{nextToken:ke,currentOffset:o,currentPosition:i,context:c}}const C7="parser",A7=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,M7=/\\([\\@{}|])/g;function E7(e,t){return t}function T7(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function N7(e={}){const t=e.location!==!1,{onError:n}=e;function s(v,g,y,k,...E){const L=v.currentPosition();if(L.offset+=k,L.column+=k,n){const $=t?zg(y,L):null,w=um(g,$,{domain:C7,args:E});n(w)}}function o(v,g,y){const k={type:v};return t&&(k.start=g,k.end=g,k.loc={start:y,end:y}),k}function i(v,g,y,k){t&&(v.end=g,v.loc&&(v.loc.end=y))}function r(v,g){const y=v.context(),k=o(3,y.offset,y.startLoc);return k.value=g.replace(M7,E7),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,g){const y=v.context(),{lastOffset:k,lastStartLoc:E}=y,L=o(5,k,E);return L.index=parseInt(g,10),v.nextToken(),i(L,v.currentOffset(),v.currentPosition()),L}function a(v,g){const y=v.context(),{lastOffset:k,lastStartLoc:E}=y,L=o(4,k,E);return L.key=g,v.nextToken(),i(L,v.currentOffset(),v.currentPosition()),L}function c(v,g){const y=v.context(),{lastOffset:k,lastStartLoc:E}=y,L=o(9,k,E);return L.value=g.replace(A7,T7),v.nextToken(),i(L,v.currentOffset(),v.currentPosition()),L}function u(v){const g=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:E}=y,L=o(8,k,E);return g.type!==11?(s(v,pn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),L.value="",i(L,k,E),{nextConsumeToken:g,node:L}):(g.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ji(g)),L.value=g.value||"",i(L,v.currentOffset(),v.currentPosition()),{node:L})}function d(v,g){const y=v.context(),k=o(7,y.offset,y.startLoc);return k.value=g,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const g=v.context(),y=o(6,g.offset,g.startLoc);let k=v.nextToken();if(k.type===8){const E=u(v);y.modifier=E.node,k=E.nextConsumeToken||v.nextToken()}switch(k.type!==9&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(k)),y.key=c(v,k.value||"");break;default:{s(v,pn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const E=v.context(),L=o(7,E.offset,E.startLoc);return L.value="",i(L,E.offset,E.startLoc),y.key=L,i(y,E.offset,E.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const g=v.context(),y=g.currentType===1?v.currentOffset():g.offset,k=g.currentType===1?g.endLoc:g.startLoc,E=o(2,y,k);E.items=[];let L=null;do{const M=L||v.nextToken();switch(L=null,M.type){case 0:M.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(M)),E.items.push(r(v,M.value||""));break;case 5:M.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(M)),E.items.push(l(v,M.value||""));break;case 4:M.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(M)),E.items.push(a(v,M.value||""));break;case 6:M.value==null&&s(v,pn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(M)),E.items.push(c(v,M.value||""));break;case 7:{const N=f(v);E.items.push(N.node),L=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:v.currentOffset(),w=g.currentType===1?g.lastEndLoc:v.currentPosition();return i(E,$,w),E}function p(v,g,y,k){const E=v.context();let L=k.items.length===0;const $=o(1,g,y);$.cases=[],$.cases.push(k);do{const w=h(v);L||(L=w.items.length===0),$.cases.push(w)}while(E.currentType!==13);return L&&s(v,pn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i($,v.currentOffset(),v.currentPosition()),$}function m(v){const g=v.context(),{offset:y,startLoc:k}=g,E=h(v);return g.currentType===13?E:p(v,y,k,E)}function b(v){const g=S7(v,As({},e)),y=g.context(),k=o(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=m(g),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&s(g,pn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,g.currentOffset(),g.currentPosition()),k}return{parse:b}}function ji(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function I7(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function bx(e,t){for(let n=0;n<e.length;n++)Ty(e[n],t)}function Ty(e,t){switch(e.type){case 1:bx(e.cases,t),t.helper("plural");break;case 2:bx(e.items,t);break;case 6:{Ty(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 $7(e,t={}){const n=I7(e);n.helper("normalize"),e.body&&Ty(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function L7(e){const t=e.body;return t.type===2?xx(t):t.cases.forEach(n=>xx(n)),e}function xx(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=Ey(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function uc(e){switch(e.t=e.type,e.type){case 0:{const t=e;uc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)uc(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)uc(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;uc(t.key),t.k=t.key,delete t.key,t.modifier&&(uc(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function F7(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,b){r.code+=m}function c(m,b=!0){const v=b?s:"";a(o?v+" ".repeat(m):v)}function u(m=!0){const b=++r.indentLevel;m&&c(b)}function d(m=!0){const b=--r.indentLevel;m&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function O7(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Vc(e,t.key),t.modifier?(e.push(", "),Vc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function R7(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(Vc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function B7(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(Vc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function D7(e,t){t.body?Vc(e,t.body):e.push("null")}function Vc(e,t){const{helper:n}=e;switch(t.type){case 0:D7(e,t);break;case 1:B7(e,t);break;case 2:R7(e,t);break;case 6:O7(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 P7=(e,t={})=>{const n=gt(t.mode)?t.mode:"normal",s=gt(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=F7(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Ey(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Vc(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function H7(e,t={}){const n=As({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=N7(n).parse(e);return s?(i&&L7(l),o&&uc(l),{ast:l,code:""}):($7(l,n),P7(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function W7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ha().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ha().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function er(e){return an(e)&&Ny(e)===0&&(bi(e,"b")||bi(e,"body"))}const z3=["b","body"];function z7(e){return Rl(e,z3)}const U3=["c","cases"];function U7(e){return Rl(e,U3,[])}const q3=["s","static"];function q7(e){return Rl(e,q3)}const j3=["i","items"];function j7(e){return Rl(e,j3,[])}const V3=["t","type"];function Ny(e){return Rl(e,V3)}const K3=["v","value"];function Lf(e,t){const n=Rl(e,K3);if(n!=null)return n;throw vd(t)}const G3=["m","modifier"];function V7(e){return Rl(e,G3)}const Y3=["k","key"];function K7(e){const t=Rl(e,Y3);if(t)return t;throw vd(6)}function Rl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(bi(e,o)&&e[o]!=null)return e[o]}return n}const Z3=[...z3,...U3,...q3,...j3,...Y3,...G3,...K3,...V3];function vd(e){return new Error(`unhandled node type: ${e}`)}function t0(e){return n=>G7(n,e)}function G7(e,t){const n=z7(t);if(n==null)throw vd(0);if(Ny(n)===1){const i=U7(n);return e.plural(i.reduce((r,l)=>[...r,wx(e,l)],[]))}else return wx(e,n)}function wx(e,t){const n=q7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=j7(t).reduce((o,i)=>[...o,Ug(e,i)],[]);return e.normalize(s)}}function Ug(e,t){const n=Ny(t);switch(n){case 3:return Lf(t,n);case 9:return Lf(t,n);case 4:{const s=t;if(bi(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(bi(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw vd(n)}case 5:{const s=t;if(bi(s,"i")&&Cs(s.i))return e.interpolate(e.list(s.i));if(bi(s,"index")&&Cs(s.index))return e.interpolate(e.list(s.index));throw vd(n)}case 6:{const s=t,o=V7(s),i=K7(s);return e.linked(Ug(e,i),o?Ug(e,o):void 0,e.type)}case 7:return Lf(t,n);case 8:return Lf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Y7=e=>e;let Ff=An();function Z7(e,t={}){let n=!1;const s=t.onError||v7;return t.onError=o=>{n=!0,s(o)},{...H7(e,t),detectError:n}}function Q7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&>(e)){ln(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||Y7)(e),o=Ff[s];if(o)return o;const{ast:i,detectError:r}=Z7(e,{...t,location:!1,jit:!0}),l=t0(i);return r?l:Ff[s]=l}else{const n=e.cacheKey;if(n){const s=Ff[n];return s||(Ff[n]=t0(e))}else return t0(e)}}let yd=null;function X7(e){yd=e}function J7(e,t,n){yd&&yd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const eN=tN("function:translate");function tN(e){return t=>yd&&yd.emit(e,t)}const Tr={INVALID_ARGUMENT:g7,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},nN=24;function Nr(e){return um(e,null,void 0)}function Iy(e,t){return t.locale!=null?_x(t.locale):_x(e.locale)}let n0;function _x(e){if(gt(e))return e;if(Zn(e)){if(e.resolvedOnce&&n0!=null)return n0;if(e.constructor.name==="Function"){const t=e();if(h7(t))throw Nr(Tr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return n0=t}else throw Nr(Tr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Nr(Tr.NOT_SUPPORT_LOCALE_TYPE)}function sN(e,t,n){return[...new Set([n,...as(t)?t:an(t)?Object.keys(t):gt(t)?[t]:[n]])]}function qg(e,t,n){const s=gt(n)?n:kd,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;as(r);)r=Sx(i,r,t);const l=as(t)||!en(t)?t:t.default?t.default:null;r=gt(l)?[l]:l,as(r)&&Sx(i,r,!1),o.__localeChainCache.set(s,i)}return i}function Sx(e,t,n){let s=!0;for(let o=0;o<t.length&&ln(s);o++){const i=t[o];gt(i)&&(s=oN(e,t[o],n))}return s}function oN(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=iN(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function iN(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(as(n)||en(n))&&n[o]&&(s=n[o])}return s}const Bl=[];Bl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Bl[1]={w:[1],".":[2],"[":[4],o:[7]};Bl[2]={w:[2],i:[3,0],0:[3,0]};Bl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Bl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Bl[5]={"'":[4,0],o:8,l:[5,0]};Bl[6]={'"':[4,0],o:8,l:[6,0]};const rN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function lN(e){return rN.test(e)}function aN(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 cN(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 uN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:lN(t)?aN(t):"*"+t}function dN(e){const t=[];let n=-1,s=0,o=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](),o++},f[3]=()=>{if(o>0)o--,s=4,f[0]();else{if(o=0,r===void 0||(r=uN(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(s===5&&p==="'"||s===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=cN(i),d=Bl[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const Cx=new Map;function fN(e,t){return an(e)?e[t]:null}function hN(e,t){if(!an(e))return null;let n=Cx.get(t);if(n||(n=dN(t),n&&Cx.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(Z3.includes(r)&&er(o)||!an(o)||!bi(o,r))return null;const l=o[r];if(l===void 0||Zn(o))return null;o=l,i++}return o}const pN="11.4.5",dm=-1,kd="en-US",Xh="",Ax=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function mN(){return{upper:(e,t)=>t==="text"&>(e)?e.toUpperCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&>(e)?e.toLowerCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&>(e)?Ax(e):t==="vnode"&&an(e)&&"__v_isVNode"in e?Ax(e.children):e}}let Q3;function gN(e){Q3=e}let X3;function vN(e){X3=e}let J3;function yN(e){J3=e}let eA=null;const kN=e=>{eA=e},bN=()=>eA;let tA=null;const Mx=e=>{tA=e},xN=()=>tA;let Ex=0;function wN(e={}){const t=Zn(e.onWarn)?e.onWarn:s7,n=gt(e.version)?e.version:pN,s=gt(e.locale)||Zn(e.locale)?e.locale:kd,o=Zn(s)?kd:s,i=as(e.fallbackLocale)||en(e.fallbackLocale)||gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=en(e.messages)?e.messages:s0(o),l=en(e.datetimeFormats)?e.datetimeFormats:s0(o),a=en(e.numberFormats)?e.numberFormats:s0(o),c=As(An(),e.modifiers,mN()),u=e.pluralRules||An(),d=Zn(e.missing)?e.missing:null,f=ln(e.missingWarn)||jc(e.missingWarn)?e.missingWarn:!0,h=ln(e.fallbackWarn)||jc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,b=Zn(e.postTranslation)?e.postTranslation:null,v=en(e.processor)?e.processor:null,g=ln(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Zn(e.messageCompiler)?e.messageCompiler:Q3,E=Zn(e.messageResolver)?e.messageResolver:X3||fN,L=Zn(e.localeFallbacker)?e.localeFallbacker:J3||sN,$=an(e.fallbackContext)?e.fallbackContext:void 0,w=e,M=an(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,N=an(w.__numberFormatters)?w.__numberFormatters:new Map,F=an(w.__meta)?w.__meta:{};Ex++;const S={version:n,cid:Ex,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:b,processor:v,warnHtmlMessage:g,escapeParameter:y,messageCompiler:k,messageResolver:E,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=M,S.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&J7(S,n,F),S}const s0=e=>({[e]:An()});function $y(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return gt(l)?l:t}else return t}function Eu(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function _N(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function SN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(_N(e,t[s]))return!0;return!1}function Tx(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!gt(t[0])&&!H3(t[0])&&!Cs(t[0]))return Xh;const[a,c,u,d]=jg(...t),f=ln(u.missingWarn)?u.missingWarn:e.missingWarn;ln(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Iy(e,u),m=r(e,o,p);if(!gt(a)||a===""){const L=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let b={},v,g=null;const y="datetime format";for(let L=0;L<m.length&&(v=m[L],b=n[v]||{},g=b[a],!en(g));L++)$y(e,a,v,f,y);if(!en(g)||!gt(v))return s?dm:a;let k=`${v}__${a}`;cm(d)||(k=`${k}__${JSON.stringify(d)}`);let E=l.get(k);return E||(E=new Intl.DateTimeFormat(v,As({},g,d)),l.set(k,E)),h?E.formatToParts(c):E.format(c)}const nA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function jg(...e){const[t,n,s,o]=e,i=An();let r=An(),l;if(gt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Nr(Tr.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Nr(Tr.INVALID_ISO_DATE_ARGUMENT)}}else if(H3(t)){if(isNaN(t.getTime()))throw Nr(Tr.INVALID_DATE_ARGUMENT);l=t}else if(Cs(t))l=t;else throw Nr(Tr.INVALID_ARGUMENT);return gt(n)?i.key=n:en(n)&&Object.keys(n).forEach(a=>{nA.includes(a)?r[a]=n[a]:i[a]=n[a]}),gt(s)?i.locale=s:en(s)&&(r=s),en(o)&&(r=o),[i.key||"",l,i,r]}function Nx(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Ix(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Cs(t[0]))return Xh;const[a,c,u,d]=Vg(...t),f=ln(u.missingWarn)?u.missingWarn:e.missingWarn;ln(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Iy(e,u),m=r(e,o,p);if(!gt(a)||a===""){const L=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let b={},v,g=null;const y="number format";for(let L=0;L<m.length&&(v=m[L],b=n[v]||{},g=b[a],!en(g));L++)$y(e,a,v,f,y);if(!en(g)||!gt(v))return s?dm:a;let k=`${v}__${a}`;cm(d)||(k=`${k}__${JSON.stringify(d)}`);let E=l.get(k);return E||(E=new Intl.NumberFormat(v,As({},g,d)),l.set(k,E)),h?E.formatToParts(c):E.format(c)}const sA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Vg(...e){const[t,n,s,o]=e,i=An();let r=An();if(!Cs(t))throw Nr(Tr.INVALID_ARGUMENT);const l=t;return gt(n)?i.key=n:en(n)&&Object.keys(n).forEach(a=>{sA.includes(a)?r[a]=n[a]:i[a]=n[a]}),gt(s)?i.locale=s:en(s)&&(r=s),en(o)&&(r=o),[i.key||"",l,i,r]}function $x(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const CN=e=>e,AN=e=>"",MN="text",EN=e=>e.length===0?"":Ey(e),TN=p7;function o0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function NN(e){const t=Cs(e.pluralIndex)?e.pluralIndex:-1;return Cs(e.named?.count)?e.named.count:Cs(e.named?.n)?e.named.n:t}function IN(e={}){const t=e.locale,n=NN(e),s=gt(t)&&Zn(e.pluralRules?.[t])?e.pluralRules[t]:o0,o=s===o0?void 0:o0,i=v=>v[s(n,v.length,o)],r=e.list||[],l=v=>r[v],a=e.named||An();Cs(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,g){const y=Zn(e.messages)?e.messages(v,!!g):an(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):AN)}const d=v=>e.modifiers?e.modifiers[v]:CN,f=Zn(e.processor?.normalize)?e.processor.normalize:EN,h=Zn(e.processor?.interpolate)?e.processor.interpolate:TN,p=gt(e.processor?.type)?e.processor.type:MN,b={list:l,named:c,plural:i,linked:(v,...g)=>{const[y,k]=g;let E="text",L="";g.length===1?an(y)?(L=y.modifier||L,E=y.type||E):gt(y)&&(L=y||L):g.length===2&&(gt(y)&&(L=y||L),gt(k)&&(E=k||E));const $=u(v,!0)(b),w=$===""||$===void 0?v:$,M=E==="vnode"&&as(w)&&L?w[0]:w;return L?d(L)(M,E):M},message:u,type:p,interpolate:h,normalize:f,values:As(An(),r,a)};return b}const Lx=()=>"",gi=e=>Zn(e);function Fx(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Kg(...t),u=ln(c.missingWarn)?c.missingWarn:e.missingWarn,d=ln(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=ln(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=gt(c.default)||ln(c.default)?ln(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(gt(p)||Zn(p)),b=Iy(e,c);f&&$N(c);let[v,g,y]=h?[a,b,l[b]||An()]:oA(e,a,b,r,d,u),k=v,E=a;if(!h&&!(gt(k)||er(k)||gi(k))&&m&&(k=p,E=k),!h&&(!(gt(k)||er(k)||gi(k))||!gt(g)))return o?dm:a;let L=!1;const $=()=>{L=!0},w=gi(k)?k:iA(e,a,g,k,E,$);if(L)return k;const M=ON(e,g,y,c),N=IN(M),F=LN(e,w,N);let S=s?s(F,a):F;if(f&>(S)&&(S=d7(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:gt(a)?a:gi(k)?k.key:"",locale:g||(gi(k)?k.locale:""),format:gt(k)?k:gi(k)?k.source:"",message:S};I.meta=As({},e.__meta,bN()||{}),eN(I)}return S}function $N(e){as(e.list)?e.list=e.list.map(t=>gt(t)?vx(t):t):an(e.named)&&Object.keys(e.named).forEach(t=>{gt(e.named[t])&&(e.named[t]=vx(e.named[t]))})}function oA(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=An(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||An(),(h=a(d,t))===null&&(h=d[t]),!(gt(h)||er(h)||gi(h)));m++)if(!SN(f,u)){const b=$y(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function iA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(gi(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,FN(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function LN(e,t,n){return t(n)}function Kg(...e){const[t,n,s]=e,o=An();if(!gt(t)&&!Cs(t)&&!gi(t)&&!er(t))throw Nr(Tr.INVALID_ARGUMENT);const i=Cs(t)?String(t):(gi(t),t);return Cs(n)?o.plural=n:gt(n)?o.default=n:en(n)&&!cm(n)?o.named=n:as(n)&&(o.list=n),Cs(s)?o.plural=s:gt(s)?o.default=s:en(s)&&As(o,s),[i,o]}function FN(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>o7(t,n,r)}}function ON(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:o,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[b,,v]=oA(u||e,h,t,l,a,c);m=b??r(v,h)}if(gt(m)||er(m)){let b=!1;const g=iA(e,h,t,m,h,()=>{b=!0});return b?Lx:g}else return gi(m)?m:Lx}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),Cs(s.plural)&&(f.pluralIndex=s.plural),f}W7();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const RN="11.4.5";function BN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ha().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ha().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ha().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ha().__INTLIFY_PROD_DEVTOOLS__=!1)}const yo={UNEXPECTED_RETURN_TYPE:nN,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 Oo(e,...t){return um(e,null,void 0)}const Gg=Ol("__translateVNode"),Yg=Ol("__datetimeParts"),Zg=Ol("__numberParts"),rA=Ol("__setPluralRules"),lA=Ol("__injectWithOption"),vc=Ol("__dispose");function bd(e){if(!an(e)||er(e))return e;for(const t in e)if(bi(e,t))if(!t.includes("."))an(e[t])&&bd(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=An()),!an(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(er(o)?Z3.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!er(o)){const r=o[n[s]];an(r)&&bd(r)}}return e}function Ly(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=en(n)?n:as(s)?An():{[e]:An()};if(as(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||An(),dh(c,r[a])):dh(c,r)}else gt(l)&&dh(JSON.parse(l),r)}),o==null&&i)for(const l in r)bi(r,l)&&bd(r[l]);return r}function aA(e){return e.type}function cA(e,t,n){let s=an(t.messages)?t.messages:An();"__i18nGlobal"in n&&(s=Ly(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(an(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(an(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Ox(e){return re(wl,null,e,0)}function xd(){return Qs()}const Rx="__INTLIFY_META__",Bx=()=>[],DN=()=>!1;let Dx=0;function Px(e){return((t,n,s,o)=>e(n,s,xd()||void 0,o))}const PN=()=>{const e=xd();let t=null;return e&&(t=aA(e)[Rx])?{[Rx]:t}:null};function Jh(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Qh?X:Ia;let r=ln(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:gt(e.locale)?e.locale:kd),a=i(t&&r?t.fallbackLocale.value:gt(e.fallbackLocale)||as(e.fallbackLocale)||en(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ly(l.value,e)),u=i(en(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(en(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:ln(e.missingWarn)||jc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:ln(e.fallbackWarn)||jc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:ln(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,b=Zn(e.missing)?e.missing:null,v=Zn(e.missing)?Px(e.missing):null,g=Zn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:ln(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const E=t?t.modifiers:en(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&Mx(null);const pe={version:RN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:E,pluralRules:L,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};pe.datetimeFormats=u.value,pe.numberFormats=d.value,pe.__datetimeFormatters=en($)?$.__datetimeFormatters:void 0,pe.__numberFormatters=en($)?$.__numberFormatters:void 0;const Ie=wN(pe);return s&&Mx(Ie),Ie})(),Eu($,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const N=D({get:()=>l.value,set:pe=>{$.locale=pe,l.value=pe}}),F=D({get:()=>a.value,set:pe=>{$.fallbackLocale=pe,a.value=pe,Eu($,l.value,pe)}}),S=D(()=>c.value),I=D(()=>u.value),B=D(()=>d.value);function R(){return Zn(g)?g:null}function P(pe){g=pe,$.postTranslation=pe}function z(){return b}function W(pe){pe!==null&&(v=Px(pe)),b=pe,$.missing=v}const ee=(pe,Ie,Xe,it,At,bt)=>{M();let wt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?xN():void 0),wt=pe($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Xe!=="translate exists"&&Cs(wt)&&wt===dm||Xe==="translate exists"&&!wt){const[qt,yt]=Ie();return t&&p?it(t):At(qt)}else{if(bt(wt))return wt;throw Oo(yo.UNEXPECTED_RETURN_TYPE)}};function U(...pe){return ee(Ie=>Reflect.apply(Fx,null,[Ie,...pe]),()=>Kg(...pe),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...pe]),Ie=>Ie,Ie=>gt(Ie))}function Y(...pe){const[Ie,Xe,it]=pe;if(it&&!an(it))throw Oo(yo.INVALID_ARGUMENT);return U(Ie,Xe,As({resolvedMessage:!0},it||{}))}function ue(...pe){return ee(Ie=>Reflect.apply(Tx,null,[Ie,...pe]),()=>jg(...pe),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...pe]),()=>Xh,Ie=>gt(Ie)||as(Ie))}function fe(...pe){return ee(Ie=>Reflect.apply(Ix,null,[Ie,...pe]),()=>Vg(...pe),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...pe]),()=>Xh,Ie=>gt(Ie)||as(Ie))}function oe(pe){return pe.map(Ie=>gt(Ie)||Cs(Ie)||ln(Ie)?Ox(String(Ie)):Ie)}const te={normalize:oe,interpolate:pe=>pe,type:"vnode"};function ae(...pe){return ee(Ie=>{let Xe;const it=Ie;try{it.processor=te,Xe=Reflect.apply(Fx,null,[it,...pe])}finally{it.processor=null}return Xe},()=>Kg(...pe),"translate",Ie=>Ie[Gg](...pe),Ie=>[Ox(Ie)],Ie=>as(Ie))}function He(...pe){return ee(Ie=>Reflect.apply(Ix,null,[Ie,...pe]),()=>Vg(...pe),"number format",Ie=>Ie[Zg](...pe),Bx,Ie=>gt(Ie)||as(Ie))}function he(...pe){return ee(Ie=>Reflect.apply(Tx,null,[Ie,...pe]),()=>jg(...pe),"datetime format",Ie=>Ie[Yg](...pe),Bx,Ie=>gt(Ie)||as(Ie))}function K(pe){L=pe,$.pluralRules=L}function ce(pe,Ie){return ee(()=>{if(!pe)return!1;const Xe=gt(Ie)?Ie:l.value,it=gt(Ie)?[Xe]:qg($,a.value,Xe);for(let At=0;At<it.length;At++){const bt=se(it[At]);let wt=$.messageResolver(bt,pe);if(wt===null&&(wt=bt[pe]),er(wt)||gi(wt)||gt(wt))return!0}return!1},()=>[pe],"translate exists",Xe=>Reflect.apply(Xe.te,Xe,[pe,Ie]),DN,Xe=>ln(Xe))}function ge(pe){let Ie=null;const Xe=qg($,a.value,l.value);for(let it=0;it<Xe.length;it++){const At=c.value[Xe[it]]||{},bt=$.messageResolver(At,pe);if(bt!=null){Ie=bt;break}}return Ie}function q(pe){const Ie=ge(pe);return Ie??(t?t.tm(pe)||{}:{})}function se(pe){return c.value[pe]||{}}function ye(pe,Ie){if(o){const Xe={[pe]:Ie};for(const it in Xe)bi(Xe,it)&&bd(Xe[it]);Ie=Xe[pe]}c.value[pe]=Ie,$.messages=c.value}function de(pe,Ie){c.value[pe]=c.value[pe]||{};const Xe={[pe]:Ie};if(o)for(const it in Xe)bi(Xe,it)&&bd(Xe[it]);Ie=Xe[pe],dh(Ie,c.value[pe]),$.messages=c.value}function ke(pe){return u.value[pe]||{}}function j(pe,Ie){u.value[pe]=Ie,$.datetimeFormats=u.value,Nx($,pe,Ie)}function ne(pe,Ie){u.value[pe]=As(u.value[pe]||{},Ie),$.datetimeFormats=u.value,Nx($,pe,Ie)}function ve(pe){return d.value[pe]||{}}function Ae(pe,Ie){d.value[pe]=Ie,$.numberFormats=d.value,$x($,pe,Ie)}function $e(pe,Ie){d.value[pe]=As(d.value[pe]||{},Ie),$.numberFormats=d.value,$x($,pe,Ie)}Dx++,t&&Qh&&(Ze(t.locale,pe=>{r&&(l.value=pe,$.locale=pe,Eu($,l.value,a.value))}),Ze(t.fallbackLocale,pe=>{r&&(a.value=pe,$.fallbackLocale=pe,Eu($,l.value,a.value))}));const Oe={id:Dx,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(pe){r=pe,pe&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Eu($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return E},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(pe){f=pe,$.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(pe){h=pe,$.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(pe){p=pe},get fallbackFormat(){return m},set fallbackFormat(pe){m=pe,$.fallbackFormat=m},get warnHtmlMessage(){return y},set warnHtmlMessage(pe){y=pe,$.warnHtmlMessage=pe},get escapeParameter(){return k},set escapeParameter(pe){k=pe,$.escapeParameter=pe},t:U,getLocaleMessage:se,setLocaleMessage:ye,mergeLocaleMessage:de,getPostTranslationHandler:R,setPostTranslationHandler:P,getMissingHandler:z,setMissingHandler:W,[rA]:K};return Oe.datetimeFormats=I,Oe.numberFormats=B,Oe.rt=Y,Oe.te=ce,Oe.tm=q,Oe.d=ue,Oe.n=fe,Oe.getDateTimeFormat=ke,Oe.setDateTimeFormat=j,Oe.mergeDateTimeFormat=ne,Oe.getNumberFormat=ve,Oe.setNumberFormat=Ae,Oe.mergeNumberFormat=$e,Oe[lA]=n,Oe[Gg]=ae,Oe[Yg]=he,Oe[Zg]=He,Oe}function HN(e){const t=gt(e.locale)?e.locale:kd,n=gt(e.fallbackLocale)||as(e.fallbackLocale)||en(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Zn(e.missing)?e.missing:void 0,o=ln(e.silentTranslationWarn)||jc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=ln(e.silentFallbackWarn)||jc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=ln(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=en(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Zn(e.postTranslation)?e.postTranslation:void 0,d=gt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=ln(e.sync)?e.sync:!0;let p=e.messages;if(en(e.sharedMessages)){const E=e.sharedMessages;p=Object.keys(E).reduce(($,w)=>{const M=$[w]||($[w]={});return As(M,E[w]),$},p||{})}const{__i18n:m,__root:b,__injectWithOption:v}=e,g=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:g,numberFormats:y,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:b,__injectWithOption:v}}function Qg(e={}){const t=Jh(HN(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return ln(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=ln(o)?!o:o},get silentFallbackWarn(){return ln(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=ln(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function WN(e,t,n){return{beforeCreate(){const s=xd();if(!s)throw Oo(yo.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Hx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Qg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Hx(e,o);else{this.$i18n=Qg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&cA(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=xd();if(!s)throw Oo(yo.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Hx(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[rA](t.pluralizationRules||e.pluralizationRules);const n=Ly(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const Fy={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function zN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Be?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},An())}function uA(){return Be}const UN=Ge({name:"i18n-t",props:As({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Cs(e)||!isNaN(e)}},Fy),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=An();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=gt(e.plural)?+e.plural:e.plural);const u=zN(t,a);return o[Gg](e.keypath,u,c)},r=As(An(),s),l=gt(e.tag)||an(e.tag)?e.tag:uA();return an(l)?gn(l,r,{default:i}):gn(l,r,i())}}}),Wx=UN;function qN(e){return as(e)&&!gt(e[0])}function dA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=An();e.locale&&(c.locale=e.locale),gt(e.format)?c.key=e.format:an(e.format)&&(gt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?As(An(),h,{[p]:e.format[p]}):h,An()));const d=s(e.value,c,u);let f=[c.key];return as(d)?f=d.map((h,p)=>{const m=o[h.type],b=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return qN(b)&&(b[0].key=`${h.type}-${p}`),b}):gt(d)&&(f=[d]),f},l=As(An(),i),a=gt(e.tag)||an(e.tag)?e.tag:uA();return an(a)?gn(a,l,{default:r}):gn(a,l,r())}}const jN=Ge({name:"i18n-n",props:As({value:{type:Number,required:!0},format:{type:[String,Object]}},Fy),setup(e,t){const n=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return dA(e,t,sA,(...s)=>n[Zg](...s))}}),zx=jN;function VN(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function KN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Oo(yo.UNEXPECTED_ERROR);const c=VN(e,l.$),u=Ux(a);return[Reflect.apply(c.t,c,[...qx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Qh&&(r.__i18nWatcher=Ze(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Qh&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Ux(l);r.textContent=Reflect.apply(a.t,a,[...qx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Ux(e){if(gt(e))return{path:e};if(en(e)){if(!("path"in e))throw Oo(yo.REQUIRED_VALUE,"path");return e}else throw Oo(yo.INVALID_VALUE)}function qx(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return gt(n)&&(r.locale=n),Cs(o)&&(r.plural=o),Cs(i)&&(r.plural=i),[t,l,r]}function GN(e,t,...n){const s=en(n[0])?n[0]:{};(ln(s.globalInstall)?s.globalInstall:!0)&&([Wx.name,"I18nT"].forEach(i=>e.component(i,Wx)),[zx.name,"I18nN"].forEach(i=>e.component(i,zx)),[Kx.name,"I18nD"].forEach(i=>e.component(i,Kx))),e.directive("t",KN(t))}const YN=Ol("global-vue-i18n");function ZN(e={}){const t=__VUE_I18N_LEGACY_API__&&ln(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=ln(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=QN(e,t),r=Ol("");function l(d){return s.get(d)||null}function a(d,f){s.set(d,f)}function c(d){s.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),en(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=oI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&GN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(WN(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Mt(e={}){const t=xd();if(t==null)throw Oo(yo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Oo(yo.NOT_INSTALLED);const n=XN(t),s=eI(n),o=aA(t),i=JN(e,o);if(i==="global")return cA(s,e,o),s;if(i==="parent"){let a=jx(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Oo(yo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=As({},e),u=jx(n,t);c.__root=u||s;const d=Jh(c);return a.__composerExtend&&(d[vc]=a.__composerExtend(d)),ly()&&ay(()=>{const h=d[vc];h&&(h(),delete d[vc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=As({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=Jh(a),r.__composerExtend&&(l[vc]=r.__composerExtend(l)),nI(r,t,l),r.__setInstance(t,l)}return l}function QN(e,t){const n=_E(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Qg(e)):n.run(()=>Jh(e));if(s==null)throw Oo(yo.UNEXPECTED_ERROR);return[n,s]}function XN(e){const t=Vt(e.isCE?YN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Oo(e.isCE?yo.NOT_INSTALLED_WITH_PROVIDE:yo.UNEXPECTED_ERROR);return t}function JN(e,t){return cm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function eI(e){return e.mode==="composition"?e.global:e.global.__composer}function jx(e,t,n=!1){let s=null;const o=t.root;let i=tI(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[lA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function tI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function nI(e,t,n){fn(()=>{},t),xn(()=>{const s=n;e.__deleteInstance(t);const o=s[vc];o&&(o(),delete s[vc])},t)}const sI=["locale","fallbackLocale","availableLocales"],Vx=["t","rt","d","n","tm","te"];function oI(e,t){const n=Object.create(null);return sI.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Oo(yo.UNEXPECTED_ERROR);const r=hs(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Vx.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Oo(yo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Vx.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const iI=Ge({name:"i18n-d",props:As({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Fy),setup(e,t){const n=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return dA(e,t,nA,(...s)=>n[Yg](...s))}}),Kx=iI;BN();gN(Q7);vN(hN);yN(qg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ha();e.__INTLIFY__=!0,X7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const rI="modulepreload",lI=function(e){return"/"+e},Gx={},go=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=lI(c),c in Gx)return;Gx[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":rI,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Ft={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function Yx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function us(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ms(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Kc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function fm(e){const t=us(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function zd(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Oy(){const e=us(Ft.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function Ry(e){const n={...Oy()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ms(Ft.unread,JSON.stringify(n))}function aI(){const e=fm(Ft.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function i0(e){zd(Ft.collapsedWorkspaces,Array.from(e))}function cI(){const e=fm(Ft.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function fA(e){zd(Ft.workspaceOrder,Array.from(e))}function Of(){const e=fm(Ft.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,s]of Object.entries(e))typeof s=="string"&&(t[n]=s);return t}function Zx(e){zd(Ft.workspaceNameOverrides,e)}function uI(){return us(Ft.workspaceSort)}function hA(e){ms(Ft.workspaceSort,e)}const Qx=Ft.clientId,dI="kimi-code-web",fI="web";function hI(){return{serverHttpUrl:mI(),clientId:kI(),clientName:dI,clientVersion:bI(),clientUiMode:fI}}function pI(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function mI(e){const t=pI(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function gI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function vI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return gI(e)}function yc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function yI(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 kI(){const e=us(Qx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ms(Qx,t),t}function bI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function xI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function wI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Zs(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 _I(e)}function _I(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 SI(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function CI(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function AI(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}function MI(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const EI={"&":"&","<":"<",">":">",'"':""","'":"'"};function Xx(e){return e.replace(/[&<>"']/g,t=>EI[t]??t)}function TI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function NI(e,t,n=40){const s=e.replace(/\s+/g," ").trim();if(s.length===0)return"";const o=t.trim();if(o.length===0)return Jx(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return Jx(s,n*2);const r=Math.max(0,i-n),l=Math.min(s.length,i+o.length+n),a=r>0,c=l<s.length;return`${a?"…":""}${s.slice(r,l)}${c?"…":""}`}function Jx(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function r0(e,t){const n=Xx(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(TI(Xx(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const dc=X(0),II=["type","disabled","aria-label"],$I=Ge({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=X();return t({el:n}),(s,o)=>(x(),T("button",{ref_key:"el",ref:n,class:Pe(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Rn(s.$slots,"default",{},void 0,!0)],10,II))}}),ct=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},qn=ct($I,[["__scopeId","data-v-c9e67023"]]),LI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FI(e,t){return x(),T("svg",LI,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const OI=ht({name:"kimi-add-conversation",render:FI}),RI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function BI(e,t){return x(),T("svg",RI,[...t[0]||(t[0]=[_("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const DI=ht({name:"kimi-folder",render:BI}),PI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HI=["clip-path"],WI=["id"];function zI(e,t){return x(),T("svg",PI,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,HI),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,WI)])])}const UI=ht({name:"kimi-folder-open",render:zI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),qI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function jI(e,t){return x(),T("svg",qI,[...t[0]||(t[0]=[_("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),_("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),_("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const VI=ht({name:"kimi-more",render:jI}),KI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GI(e,t){return x(),T("svg",KI,[...t[0]||(t[0]=[_("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const YI=ht({name:"kimi-search",render:GI}),ZI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function QI(e,t){return x(),T("svg",ZI,[...t[0]||(t[0]=[_("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),_("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const XI=ht({name:"kimi-setting",render:QI}),JI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e$(e,t){return x(),T("svg",JI,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const t$=ht({name:"tabler-layout-sidebar-left-collapse",render:e$}),n$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s$(e,t){return x(),T("svg",n$,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const o$=ht({name:"tabler-layout-sidebar-left-expand",render:s$}),i$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r$(e,t){return x(),T("svg",i$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const l$=ht({name:"ri-add-line",render:r$}),a$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c$(e,t){return x(),T("svg",a$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const u$=ht({name:"ri-alert-line",render:c$}),d$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f$(e,t){return x(),T("svg",d$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const h$=ht({name:"ri-archive-line",render:f$}),p$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m$(e,t){return x(),T("svg",p$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const g$=ht({name:"ri-arrow-down-line",render:m$}),v$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y$(e,t){return x(),T("svg",v$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const k$=ht({name:"ri-arrow-down-s-line",render:y$}),b$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x$(e,t){return x(),T("svg",b$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const w$=ht({name:"ri-arrow-go-back-line",render:x$}),_$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S$(e,t){return x(),T("svg",_$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const C$=ht({name:"ri-arrow-right-line",render:S$}),A$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M$(e,t){return x(),T("svg",A$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const E$=ht({name:"ri-arrow-right-s-line",render:M$}),T$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N$(e,t){return x(),T("svg",T$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const ew=ht({name:"ri-arrow-up-line",render:N$}),I$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $$(e,t){return x(),T("svg",I$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const L$=ht({name:"ri-arrow-up-s-line",render:$$}),F$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O$(e,t){return x(),T("svg",F$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const R$=ht({name:"ri-braces-line",render:O$}),B$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D$(e,t){return x(),T("svg",B$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const P$=ht({name:"ri-calendar-close-line",render:D$}),H$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W$(e,t){return x(),T("svg",H$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const z$=ht({name:"ri-calendar-schedule-line",render:W$}),U$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q$(e,t){return x(),T("svg",U$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const j$=ht({name:"ri-calendar-todo-line",render:q$}),V$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K$(e,t){return x(),T("svg",V$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const G$=ht({name:"ri-check-line",render:K$}),Y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z$(e,t){return x(),T("svg",Y$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const Q$=ht({name:"ri-close-line",render:Z$}),X$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J$(e,t){return x(),T("svg",X$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const eL=ht({name:"ri-code-line",render:J$}),tL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nL(e,t){return x(),T("svg",tL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const sL=ht({name:"ri-collapse-diagonal-line",render:nL}),oL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iL(e,t){return x(),T("svg",oL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const rL=ht({name:"ri-download-line",render:iL}),lL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aL(e,t){return x(),T("svg",lL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const cL=ht({name:"ri-draggable",render:aL}),uL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dL(e,t){return x(),T("svg",uL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const fL=ht({name:"ri-equalizer-line",render:dL}),hL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pL(e,t){return x(),T("svg",hL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const mL=ht({name:"ri-expand-diagonal-line",render:pL}),gL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vL(e,t){return x(),T("svg",gL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const yL=ht({name:"ri-external-link-line",render:vL}),kL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bL(e,t){return x(),T("svg",kL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const xL=ht({name:"ri-file-add-line",render:bL}),wL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _L(e,t){return x(),T("svg",wL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const SL=ht({name:"ri-file-copy-line",render:_L}),CL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AL(e,t){return x(),T("svg",CL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const ML=ht({name:"ri-file-edit-line",render:AL}),EL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TL(e,t){return x(),T("svg",EL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const tw=ht({name:"ri-file-line",render:TL}),NL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IL(e,t){return x(),T("svg",NL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const $L=ht({name:"ri-file-text-line",render:IL}),LL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FL(e,t){return x(),T("svg",LL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const OL=ht({name:"ri-flashlight-line",render:FL}),RL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BL(e,t){return x(),T("svg",RL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const DL=ht({name:"ri-folder-add-line",render:BL}),PL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HL(e,t){return x(),T("svg",PL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const WL=ht({name:"ri-folder-fill",render:HL}),zL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UL(e,t){return x(),T("svg",zL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const qL=ht({name:"ri-git-fork-line",render:UL}),jL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VL(e,t){return x(),T("svg",jL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const KL=ht({name:"ri-git-pull-request-line",render:VL}),GL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YL(e,t){return x(),T("svg",GL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const ZL=ht({name:"ri-global-line",render:YL}),QL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XL(e,t){return x(),T("svg",QL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const nw=ht({name:"ri-image-line",render:XL}),JL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eF(e,t){return x(),T("svg",JL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const tF=ht({name:"ri-information-line",render:eF}),nF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sF(e,t){return x(),T("svg",nF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const oF=ht({name:"ri-links-line",render:sF}),iF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rF(e,t){return x(),T("svg",iF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const lF=ht({name:"ri-list-check",render:rF}),aF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cF(e,t){return x(),T("svg",aF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const uF=ht({name:"ri-list-unordered",render:cF}),dF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fF(e,t){return x(),T("svg",dF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const hF=ht({name:"ri-login-box-line",render:fF}),pF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mF(e,t){return x(),T("svg",pF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const gF=ht({name:"ri-mail-line",render:mF}),vF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yF(e,t){return x(),T("svg",vF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const kF=ht({name:"ri-message-line",render:yF}),bF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xF(e,t){return x(),T("svg",bF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const wF=ht({name:"ri-pause-fill",render:xF}),_F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SF(e,t){return x(),T("svg",_F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const CF=ht({name:"ri-pencil-line",render:SF}),AF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MF(e,t){return x(),T("svg",AF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const EF=ht({name:"ri-play-fill",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return x(),T("svg",TF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const IF=ht({name:"ri-question-line",render:NF}),$F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LF(e,t){return x(),T("svg",$F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const FF=ht({name:"ri-sort-desc",render:LF}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return x(),T("svg",OF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const BF=ht({name:"ri-sparkling-line",render:RF}),DF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PF(e,t){return x(),T("svg",DF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const HF=ht({name:"ri-star-fill",render:PF}),WF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zF(e,t){return x(),T("svg",WF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const UF=ht({name:"ri-star-line",render:zF}),qF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jF(e,t){return x(),T("svg",qF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const VF=ht({name:"ri-stop-fill",render:jF}),KF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GF(e,t){return x(),T("svg",KF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const YF=ht({name:"ri-subtract-line",render:GF}),ZF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QF(e,t){return x(),T("svg",ZF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const XF=ht({name:"ri-target-line",render:QF}),JF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eO(e,t){return x(),T("svg",JF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const tO=ht({name:"ri-terminal-box-line",render:eO}),nO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sO(e,t){return x(),T("svg",nO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const oO=ht({name:"ri-time-line",render:sO}),iO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rO(e,t){return x(),T("svg",iO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const lO=ht({name:"ri-tools-line",render:rO}),aO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cO(e,t){return x(),T("svg",aO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const uO=ht({name:"ri-user-line",render:cO}),dO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
-
<path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
|
|
40
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
|
|
41
|
-
</svg>
|
|
42
|
-
`,fO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
-
<path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
|
|
44
|
-
</svg>
|
|
45
|
-
`,hO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
-
<g clip-path="url(#clip0_4626_2033)">
|
|
47
|
-
<path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
|
|
48
|
-
</g>
|
|
49
|
-
<defs>
|
|
50
|
-
<clipPath id="clip0_4626_2033">
|
|
51
|
-
<rect width="24" height="24" fill="white"/>
|
|
52
|
-
</clipPath>
|
|
53
|
-
</defs>
|
|
54
|
-
</svg>
|
|
55
|
-
`,pO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
|
|
57
|
-
<path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
|
|
58
|
-
<path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
|
|
59
|
-
</svg>
|
|
60
|
-
`,mO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
-
<path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
|
|
62
|
-
</svg>
|
|
63
|
-
`,gO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
64
|
-
<path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
|
|
65
|
-
<path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
|
|
66
|
-
</svg>
|
|
67
|
-
`,vO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',yO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',kO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',bO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',xO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',wO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',_O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',SO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',CO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',AO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',sw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',MO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',EO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',TO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',NO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',IO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',$O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',LO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',FO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',OO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',RO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',BO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',DO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',PO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',HO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',WO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',zO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',UO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',ow='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',qO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',jO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',VO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',KO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',GO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',YO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',ZO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',iw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',QO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',XO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',JO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',eR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',tR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',nR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',sR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',oR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',iR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',rR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',lR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',aR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',cR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',uR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',dR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',fR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',hR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',pR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',mR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',gR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',vR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',yR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',pA={sm:14,md:16,lg:20};function vt(e,t){return{component:e,svg:t}}const mA={plus:vt(l$,kO),"chat-new":vt(OI,dO),"calendar-close":vt(P$,TO),"calendar-schedule":vt(z$,NO),"calendar-todo":vt(j$,IO),close:vt(Q$,LO),check:vt(G$,$O),archive:vt(h$,xO),search:vt(YI,mO),copy:vt(SL,zO),link:vt(oF,XO),"external-link":vt(yL,HO),download:vt(rL,RO),undo:vt(w$,SO),send:vt(ew,sw),image:vt(nw,iw),settings:vt(XI,gO),sliders:vt(fL,DO),"log-in":vt(hF,tR),"chevron-down":vt(k$,_O),"chevron-right":vt(E$,AO),"chevron-up":vt(L$,MO),"arrow-up":vt(ew,sw),"arrow-down":vt(g$,wO),"arrow-right":vt(C$,CO),minus:vt(YF,hR),"panel-collapse":vt(t$,vO),"panel-expand":vt(o$,yO),expand:vt(mL,PO),collapse:vt(sL,OO),list:vt(uF,eR),sort:vt(FF,aR),grip:vt(cL,BO),folder:vt(UI,hO),"folder-closed":vt(DI,fO),"folder-plus":vt(DL,VO),"folder-solid":vt(WL,KO),file:vt(tw,ow),"file-text":vt($L,qO),"file-edit":vt(ML,UO),"file-plus":vt(xL,WO),"file-off":vt(tw,ow),"image-off":vt(nw,iw),code:vt(eL,FO),terminal:vt(tO,mR),pencil:vt(CF,iR),tool:vt(lO,vR),glob:vt(R$,EO),globe:vt(ZL,ZO),"check-list":vt(lF,JO),bolt:vt(OL,jO),"git-fork":vt(qL,GO),"git-pull-request":vt(KL,YO),message:vt(kF,sR),mail:vt(gF,nR),user:vt(uO,yR),info:vt(tF,QO),"help-circle":vt(IF,lR),"alert-triangle":vt(u$,bO),clock:vt(oO,gR),sparkles:vt(BF,cR),target:vt(XF,pR),pause:vt(wF,oR),play:vt(EF,rR),stop:vt(VF,fR),star:vt(HF,uR),"star-outline":vt(UF,dR),"dots-horizontal":vt(VI,pO)};function kR(e){return mA[e]}function bR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function fc(e,t="md"){const n=mA[e];return n?bR(n.svg,pA[t]):""}const Mwe=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],je=Ge({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>kR(t.name)),s=D(()=>pA[t.size]);return(o,i)=>n.value?(x(),xe(Ks(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):le("",!0)}}),xR={key:0,class:"ui-dialog__head"},wR={class:"ui-dialog__titles"},_R={key:0,class:"ui-dialog__title"},SR={key:1,class:"ui-dialog__desc"},CR={class:"ui-dialog__body"},AR={key:1,class:"ui-dialog__foot"},MR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',ER=Ge({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=X(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(MR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ze(()=>n.open,async d=>{if(d){dc.value+=1,i=document.activeElement,await pt();const f=a(),h=l();(f??h[0]??o.value)?.focus()}else dc.value=Math.max(0,dc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ps(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(dc.value=Math.max(0,dc.value-1))}),(d,f)=>(x(),xe(im,{to:"body"},[e.open?(x(),T("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:o,class:Pe(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),T("div",xR,[Rn(d.$slots,"head",{},()=>[_("div",wR,[e.title?(x(),T("div",_R,O(e.title),1)):le("",!0),e.description?(x(),T("div",SR,O(e.description),1)):le("",!0)])],!0),re(qn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[re(je,{name:"close",size:"md"})]),_:1})])):le("",!0),_("div",CR,[Rn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),T("div",AR,[Rn(d.$slots,"foot",{},void 0,!0)])):le("",!0)],2)],32)):le("",!0)]))}}),Wr=ct(ER,[["__scopeId","data-v-3dce23a4"]]),TR={class:"sd-head"},NR=["placeholder","aria-label"],IR=["aria-selected","onClick","onMousemove"],$R={class:"sd-meta"},LR=["innerHTML"],FR={class:"sd-time"},OR=["innerHTML"],RR=["innerHTML"],BR={key:1,class:"sd-empty"},DR={class:"sd-hint"},PR=200,HR=Ge({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=X(!0),r=X(""),l=X(null),a=X(null),c=D(()=>{const v=r.value.trim().toLowerCase(),g=[];for(const y of s.sessions){const k=y.title??"",E=y.lastPrompt??"",L=y.workspaceName??"",$=v.length>0&&k.toLowerCase().includes(v),w=v.length>0&&E.toLowerCase().includes(v),M=v.length>0&&L.toLowerCase().includes(v);if(!(v.length>0&&!$&&!w&&!M)&&(g.push({session:y,inTitle:$,inWorkspace:M,snippetText:E?NI(E,r.value):""}),g.length>=PR))break}return g}),u=X(0);Ze(r,()=>{u.value=0});function d(v){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,v))}async function f(){await pt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(v){u.value=d(u.value+v),f()}function p(v){o("select",v),o("close")}function m(){const v=c.value[u.value];v&&p(v.session.id)}function b(v){v.key==="ArrowDown"?(v.preventDefault(),h(1)):v.key==="ArrowUp"?(v.preventDefault(),h(-1)):v.key==="Enter"&&(v.preventDefault(),m())}return fn(()=>{l.value?.focus()}),(v,g)=>(x(),xe(Wr,{open:i.value,"onUpdate:open":g[1]||(g[1]=y=>i.value=y),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=y=>o("close"))},{head:Ee(()=>[_("div",TR,[re(je,{class:"sd-search-icon",name:"search",size:"md"}),On(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=y=>r.value=y),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,NR),[[So,r.value]])])]),foot:Ee(()=>[_("span",DR,O(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),T(Be,{key:0},nt(c.value,(y,k)=>(x(),T("button",{key:y.session.id,class:Pe(["sd-row",{on:k===u.value,active:y.session.id===e.activeId}]),role:"option","aria-selected":k===u.value,onClick:E=>p(y.session.id),onMousemove:E=>u.value=k},[_("span",$R,[re(je,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(r0)(y.session.workspaceName??y.session.workspaceId??"",y.inWorkspace?r.value:"")},null,8,LR),_("span",FR,O(y.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(r0)(y.session.title,y.inTitle?r.value:"")},null,8,OR),y.snippetText?(x(),T("span",{key:0,class:"sd-snippet",innerHTML:C(r0)(y.snippetText,r.value)},null,8,RR)):le("",!0)],42,IR))),128)):(x(),T("div",BR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),WR=ct(HR,[["__scopeId","data-v-a678f802"]]),zR=["aria-label"],UR=Ge({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),T("span",{class:Pe(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,zR))}}),zo=ct(UR,[["__scopeId","data-v-e5c5b17d"]]),qR={key:0,class:"ui-badge__dot","aria-hidden":"true"},jR=Ge({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),T("span",{class:Pe(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),T("span",qR)):le("",!0),Rn(t.$slots,"default",{},void 0,!0)],2))}}),Ro=ct(jR,[["__scopeId","data-v-5bc5cd6d"]]),wd=X(null);function gA(e){const t=wd.value;t&&(wd.value=null,t.resolve(e))}function VR(e){return wd.value&&gA(!1),new Promise(t=>{wd.value={...e,resolve:t}})}function zr(){return{current:wd,confirm:VR,settle:gA}}const KR=Ge({__name:"Menu",setup(e,{expose:t}){const n=X();return t({el:n}),(s,o)=>(x(),T("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Rn(s.$slots,"default",{},void 0,!0)],512))}}),vl=ct(KR,[["__scopeId","data-v-60e6cd8d"]]),GR={key:0,class:"ui-menu-sep",role:"separator"},YR=["disabled"],ZR=Ge({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),T("div",GR)):(x(),T("button",{key:1,class:Pe(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Rn(t.$slots,"default",{},void 0,!0)],10,YR))}}),mn=ct(ZR,[["__scopeId","data-v-f940771a"]]),el=6,tl=8,QR=150,XR=Ge({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=X(),s=X(),o=X(!1),i=X(!1),r=X({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const b=a.getBoundingClientRect(),v=m.offsetWidth,g=m.offsetHeight,y=window.innerWidth,k=window.innerHeight;let E=t.placement;E==="top"&&b.top-el-g<tl?E="bottom":E==="bottom"&&b.bottom+el+g>k-tl?E="top":E==="left"&&b.left-el-v<tl?E="right":E==="right"&&b.right+el+v>y-tl&&(E="left");let L=0,$=0;E==="top"?(L=b.top-el-g,$=b.left+b.width/2-v/2):E==="bottom"?(L=b.bottom+el,$=b.left+b.width/2-v/2):E==="left"?(L=b.top+b.height/2-g/2,$=b.left-el-v):(L=b.top+b.height/2-g/2,$=b.right+el),$=Math.min(Math.max($,tl),y-tl-v),L=Math.min(Math.max(L,tl),k-tl-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,pt(()=>{u(),i.value=!0})},QR))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function h(){o.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return fn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const b=m.firstElementChild??null;b!==a&&(f(),p(b??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ps(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,b)=>(x(),T(Be,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Rn(m.$slots,"default",{},void 0,!0)],512),(x(),xe(im,{to:"body"},[On(_("div",{ref_key:"bubble",ref:s,class:Pe(["ui-tip__bubble",{positioned:i.value}]),style:Gt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[yi,o.value]])]))],64))}}),Yt=ct(XR,[["__scopeId","data-v-4c261eb6"]]),JR={class:"row"},eB={class:"lead","aria-hidden":"true"},tB={key:1,class:"unread-dot"},nB={class:"left"},sB=["onKeydown"],oB={class:"act"},iB={class:"ts"},rB={class:"menu-time"},lB=Ge({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:s}=Mt(),{confirm:o}=zr(),i=e,r=n;function l(I){const B=new Date(I);if(Number.isNaN(B.getTime()))return I;const R=P=>String(P).padStart(2,"0");return`${B.getFullYear()}-${R(B.getMonth()+1)}-${R(B.getDate())} ${R(B.getHours())}:${R(B.getMinutes())}`}const a=D(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=X(!1),u=X(null),d=X(null),f=X({});function h(I){const B=I.target;d.value?.el?.contains(B)||u.value?.el?.contains(B)||b()}function p(){const I=u.value?.el;if(!I)return;const B=d.value?.el,R=I.getBoundingClientRect(),P=4,z=8,W=B?.offsetHeight??0,ee=B?.offsetWidth??0;let U=R.bottom+P;U+W>window.innerHeight-z&&(U=Math.max(z,R.top-W-P));let Y=R.right-ee;Y<z&&(Y=z),f.value={top:`${Math.round(U)}px`,left:`${Math.round(Y)}px`}}async function m(I){if(I.stopPropagation(),c.value){b();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",b),await pt(),p()}function b(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)}xn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)});const v=X(!1),g=X(""),y=X(null);async function k(){b(),v.value=!0,g.value=i.session.title,await pt();try{y.value?.focus(),y.value?.select()}catch{}}function E(){const I=g.value.trim();I&&r("rename",i.session.id,I),v.value=!1}function L(){v.value=!1}const $=X(!1),w=X(!1);async function M(){const I=await Zs(i.session.id);$.value=I,w.value=!I,setTimeout(()=>{$.value=!1,w.value=!1,b()},1500)}function N(){b(),r("fork",i.session.id)}function F(){b(),r("export",i.session.id)}async function S(){b(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:b}),(I,B)=>(x(),T("div",{class:Pe(["se",{on:e.active}]),onClick:B[4]||(B[4]=R=>r("select",e.session.id))},[_("div",JR,[_("span",eB,[e.session.busy?(x(),xe(zo,{key:0,size:"sm"})):e.unread?(x(),T("span",tB)):le("",!0)]),_("div",nB,[v.value?On((x(),T("input",{key:0,ref_key:"renameInputRef",ref:y,"onUpdate:modelValue":B[0]||(B[0]=R=>g.value=R),class:"rename-input",onClick:B[1]||(B[1]=kt(()=>{},["stop"])),onKeydown:[Xi(kt(E,["stop"]),["enter"]),Xi(kt(L,["stop"]),["esc"])],onBlur:E},null,40,sB)),[[So,g.value]]):(x(),T("span",{key:1,class:"t",onDblclick:kt(k,["stop"])},O(e.session.title),33))]),re(Yt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!v.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(x(),xe(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Qe(O(C(s)("workspace.awaitingAnswer")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),re(Yt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!v.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(x(),xe(Ro,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Qe(O(C(s)("workspace.awaitingPermission")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),re(Yt,{text:C(s)("workspace.abortedTitle")},{default:Ee(()=>[!v.value&&e.session.status==="aborted"?(x(),xe(Ro,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Qe(O(C(s)("workspace.aborted")),1)]),_:1})):le("",!0)]),_:1},8,["text"]),_("span",oB,[_("span",iB,O(e.session.time),1),v.value?le("",!0):(x(),xe(qn,{key:0,ref_key:"kebabRef",ref:u,class:Pe(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:B[2]||(B[2]=kt(R=>m(R),["stop"]))},{default:Ee(()=>[re(je,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),xe(im,{to:"body"},[c.value?(x(),xe(vl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Gt(f.value),onClick:B[3]||(B[3]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{danger:w.value,onClick:M},{default:Ee(()=>[re(je,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Qe(" "+O(w.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),re(mn,{separator:""}),re(mn,{onClick:k},{default:Ee(()=>[re(je,{name:"pencil",size:"sm"}),Qe(" "+O(C(s)("sidebar.rename")),1)]),_:1}),re(mn,{onClick:N},{default:Ee(()=>[re(je,{name:"git-fork",size:"sm"}),Qe(" "+O(C(s)("sidebar.fork")),1)]),_:1}),re(mn,{onClick:F},{default:Ee(()=>[re(je,{name:"download",size:"sm"}),Qe(" "+O(C(s)("sidebar.export")),1)]),_:1}),re(mn,{danger:"",onClick:S},{default:Ee(()=>[re(je,{name:"archive",size:"sm"}),Qe(" "+O(C(s)("sidebar.archive")),1)]),_:1}),re(mn,{separator:""}),_("div",rB,O(a.value),1)]),_:1},8,["style"])):le("",!0)]))],2))}}),aB=ct(lB,[["__scopeId","data-v-f34e9e88"]]),cB={class:"gh-top"},uB={class:"gh-name"},dB=["inert"],fB=["disabled"],hB={class:"show-more-label"},pB={class:"show-more-label"},mB={key:2,class:"group-empty"},gB=Ge({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=D({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=D(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(h=>h.id===s.activeId)){const h=s.group.sessions.find(p=>p.id===s.activeId);if(h)return[...f,h]}return f}),l=D(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,h)=>(x(),T("div",{class:Pe(["group",{dragging:e.dragging}])},[_("div",{class:Pe(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=kt(p=>o("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>o("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>o("wsDragend"))},[_("div",cB,[e.isCollapsed(e.group.workspace.id)?(x(),xe(je,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),xe(je,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),xe(Yt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[_("span",uB,O(e.group.workspace.name),1)]),_:1},8,["text"])):On((x(),T("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=Xi(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=Xi(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=kt(()=>{},["stop"]))},null,544)),[[So,i.value]]),e.renamingId!==e.group.workspace.id?(x(),T("div",{key:4,class:Pe(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[re(qn,{class:Pe(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=kt(p=>o("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ee(()=>[re(je,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),re(qn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=kt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[re(je,{name:"chat-new"})]),_:1},8,["label"])],2)):le("",!0)])],34),_("div",{class:Pe(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),T(Be,null,nt(r.value,p=>(x(),xe(aB,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=m=>o("selectSession",m)),onRename:h[11]||(h[11]=(m,b)=>o("renameSession",m,b)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m)),onExport:h[14]||(h[14]=m=>o("exportSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),T("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=kt(p=>o("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",hB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,fB)):le("",!0),l.value?(x(),T("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=kt(p=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",pB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):le("",!0),e.group.sessions.length===0?(x(),T("div",mB,O(C(n)("sidebar.noSessions")),1)):le("",!0)],10,dB)],2))}}),vB=ct(gB,[["__scopeId","data-v-cdac739a"]]),yB="kimi_desktop",kB="platform",rw="kimi-desktop",lw="kimi-desktop-platform";function bB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(yB)?(sessionStorage.setItem(rw,"1"),e=!0):e=e||sessionStorage.getItem(rw)==="1";const s=n.get(kB);s?(sessionStorage.setItem(lw,s),t=s):t=sessionStorage.getItem(lw)}catch{}return{isDesktop:e,platform:t}}const Xg=bB(),xB=Xg.isDesktop,Lc=Xg.isDesktop&&Xg.platform==="darwin",wB={class:"ui-kbd"},_B=Ge({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),T("span",wB,[(x(!0),T(Be,null,nt(e.keys,s=>(x(),T("kbd",{key:s,class:"ui-kbd__key"},O(s),1))),128))]))}}),gr=ct(_B,[["__scopeId","data-v-32292ed8"]]),SB=["disabled","aria-pressed"],CB=Ge({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),T("button",{key:0,class:Pe(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Rn(t.$slots,"default",{},void 0,!0)],10,SB)):(x(),T("span",{key:1,class:Pe(["ui-pill",{"is-active":e.active}])},[Rn(t.$slots,"default",{},void 0,!0)],2))}}),fh=ct(CB,[["__scopeId","data-v-317ace1a"]]),AB={class:"ch"},MB={class:"ch-brand"},EB={class:"ch-backend-ep"},TB={class:"btn-wrap"},NB={class:"search-input"},IB={key:0,class:"empty"},$B={class:"side-section-label"},LB={class:"side-section-title"},FB={class:"side-section-actions"},OB=["onDragover","onDrop"],RB={class:"side-footer"},BB={class:"section-menu-check"},DB={class:"section-menu-check"},PB={class:"section-menu-check"},HB={class:"backend-menu-name"},WB={class:"backend-menu-url"},zB=1e3,UB=Ge({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Mt(),{confirm:s}=zr(),o=!1,i=X(null),r=D(()=>""),l=["default","multi"];function a(Ye){const qe=i.value?.presets[Ye]??"";return qe?wI(qe):""}function c(Ye){const qe=i.value;return qe!==null&&qe.current===qe.presets[Ye]}const u=e,d=t,f=X(!1),h=b()?["⌘","K"]:["Ctrl","K"];function p(){d("loadAllSessions"),f.value=!0}function m(Ye){(Ye.metaKey||Ye.ctrlKey)&&Ye.key.toLowerCase()==="k"&&(Ye.preventDefault(),p())}fn(()=>window.addEventListener("keydown",m)),ps(()=>window.removeEventListener("keydown",m));function b(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Ye=navigator.userAgentData;return Ye?.platform==="macOS"||Ye?.platform==="iOS"}const v=X(!1);function g(Ye){v.value=Ye.target.scrollTop>0}const y=X(new Set(aI()));function k(Ye){return y.value.has(Ye)}function E(Ye){const qe=new Set(y.value);qe.has(Ye)?qe.delete(Ye):qe.add(Ye),y.value=qe,i0(qe)}function L(){const Ye=new Set(u.groups.map(qe=>qe.workspace.id));y.value=Ye,i0(Ye)}function $(){const Ye=new Set;y.value=Ye,i0(Ye)}const w=D(()=>u.groups.length>0&&u.groups.every(Ye=>y.value.has(Ye.workspace.id))),M=X(new Set);function N(Ye){return M.value.has(Ye)}function F(Ye){const qe=new Set(M.value);qe.has(Ye)?qe.delete(Ye):qe.add(Ye),M.value=qe}function S(Ye){if(!M.value.has(Ye)){const qe=new Set(M.value);qe.add(Ye),M.value=qe}d("loadMoreSessions",Ye)}const I=X(null),B=X(null);function R(Ye){I.value=Ye}function P(){I.value=null,B.value=null}function z(Ye){const qe=Ye.currentTarget.getBoundingClientRect();return Ye.clientY<qe.top+qe.height/2?"before":"after"}function W(Ye,qe){I.value===null||I.value===qe||(Ye.preventDefault(),Ye.dataTransfer&&(Ye.dataTransfer.dropEffect="move"),B.value={id:qe,position:z(Ye)})}function ee(Ye){const qe=I.value,Lt=B.value?.id===Ye?B.value.position:"before";if(B.value=null,I.value=null,!qe||qe===Ye)return;const Ht=AI(u.groups.map(sn=>sn.workspace.id),qe,Ye,Lt);d("reorderWorkspaces",Ht)}function U(Ye,qe){qe.target.closest(".gh-more, .gh-add")||E(Ye)}function Y(Ye){d("select",Ye)}const ue=X(null),fe=X(""),oe=X(null);function Z(){return oe}function te(Ye,qe){ue.value=Ye,fe.value=qe,pt().then(()=>oe.value?.focus())}function ae(){const Ye=ue.value,qe=fe.value.trim();Ye&&qe&&d("renameWorkspace",Ye,qe),ue.value=null}function He(){ue.value=null}function he(Ye){fe.value=Ye}const K=X(!1),ce=X(null),ge=X({}),q=X(null);function se(Ye){q.value?.el&&!q.value.el.contains(Ye.target)&&de()}function ye(Ye,qe){qe.preventDefault(),qe.stopPropagation(),ce.value=Ye,ge.value={top:`${qe.clientY}px`,left:`${qe.clientX}px`},K.value=!0,document.addEventListener("mousedown",se,!0)}function de(){K.value=!1,document.removeEventListener("mousedown",se,!0),ce.value=null}function ke(){ce.value&&Zs(ce.value.root),de()}function j(){ce.value&&te(ce.value.id,ce.value.name),de()}async function ne(){const Ye=ce.value;Ye&&(de(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ye.name}),variant:"danger"})&&d("deleteWorkspace",Ye.id))}const ve=X(null),Ae=X(null),$e=X({}),Oe=X(null);function pe(Ye){const qe=Ye.target;qe.closest(".gh-more")||qe.closest(".ws-menu")||Xe()}async function Ie(Ye,qe){if(ve.value===Ye.id){Xe();return}const Lt=qe.currentTarget;Ae.value=Ye,ve.value=Ye.id,document.addEventListener("mousedown",pe),window.addEventListener("resize",Xe),await pt();const Ht=Oe.value?.el,sn=Lt.getBoundingClientRect(),Zt=4,_n=8,on=Ht?.offsetHeight??0,Et=Ht?.offsetWidth??0;let ns=sn.bottom+Zt;ns+on>window.innerHeight-_n&&(ns=Math.max(_n,sn.top-on-Zt));let ss=sn.right-Et;ss<_n&&(ss=_n),$e.value={top:`${Math.round(ns)}px`,left:`${Math.round(ss)}px`}}function Xe(){ve.value=null,Ae.value=null,document.removeEventListener("mousedown",pe),window.removeEventListener("resize",Xe)}function it(Ye){Zs(Ye.root),Xe()}function At(Ye){te(Ye.id,Ye.name),Xe()}async function bt(Ye){Xe(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ye.name}),variant:"danger"})&&d("deleteWorkspace",Ye.id)}const wt=X(!1),qt=X({}),yt=X(null);function Kt(Ye){const qe=Ye.target;qe.closest(".side-section-kebab")||qe.closest(".section-menu")||En()}async function gs(Ye){if(wt.value){En();return}const qe=Ye.currentTarget;wt.value=!0,document.addEventListener("mousedown",Kt),window.addEventListener("resize",En),await pt();const Lt=yt.value?.el,Ht=qe.getBoundingClientRect(),sn=4,Zt=8,_n=Lt?.offsetHeight??0,on=Lt?.offsetWidth??0;let Et=Ht.bottom+sn;Et+_n>window.innerHeight-Zt&&(Et=Math.max(Zt,Ht.top-_n-sn));let ns=Ht.right-on;ns<Zt&&(ns=Zt),qt.value={top:`${Math.round(Et)}px`,left:`${Math.round(ns)}px`}}function En(){wt.value=!1,document.removeEventListener("mousedown",Kt),window.removeEventListener("resize",En)}function Jt(Ye){d("setWorkspaceSortMode",Ye),En()}const wn=X(!1),vs=X({}),st=X(null);function Bn(Ye){const qe=Ye.target;qe.closest(".ch-backend")||qe.closest(".backend-menu")||Dn()}async function Es(Ye){if(i.value===null)return;if(wn.value){Dn();return}const qe=Ye.currentTarget;wn.value=!0,document.addEventListener("mousedown",Bn),window.addEventListener("resize",Dn),await pt();const Lt=st.value?.el,Ht=qe.getBoundingClientRect(),sn=4,Zt=8,_n=Lt?.offsetHeight??0;let on=Ht.bottom+sn;on+_n>window.innerHeight-Zt&&(on=Math.max(Zt,Ht.top-_n-sn)),vs.value={top:`${Math.round(on)}px`,left:`${Math.round(Math.max(Zt,Ht.left))}px`}}function Dn(){wn.value=!1,document.removeEventListener("mousedown",Bn),window.removeEventListener("resize",Dn)}async function Hs(Ye){if(c(Ye)){Dn();return}if(await xI(Ye)===null){console.warn("[kimi-web] dev backend switch failed:",Ye),Dn();return}window.location.reload()}ps(()=>{document.removeEventListener("mousedown",se,!0),document.removeEventListener("mousedown",pe),document.removeEventListener("mousedown",Kt),document.removeEventListener("mousedown",Bn),window.removeEventListener("resize",Xe),window.removeEventListener("resize",En),window.removeEventListener("resize",Dn)});const Ws=X(null);let Qn;function Tn(){const Ye=Ws.value;Ye&&(Ye.classList.remove("blink-now"),Ye.getBoundingClientRect(),Ye.classList.add("blink-now"),clearTimeout(Qn),Qn=setTimeout(()=>Ye.classList.remove("blink-now"),300))}const yn=Ii(()=>go(()=>import("./DesignSystemView-nRvuUAQ4.js"),__vite__mapDeps([0,1]))),jn=X(!1);let ds,Gn=!1;function Nn(Ye){Gn=!1,clearTimeout(ds),Ye.currentTarget.setPointerCapture?.(Ye.pointerId),ds=setTimeout(()=>{Gn=!0,jn.value=!0},zB)}function Pn(Ye){clearTimeout(ds);const qe=Ye.currentTarget;qe.hasPointerCapture?.(Ye.pointerId)&&qe.releasePointerCapture(Ye.pointerId)}function Pt(){if(Gn){Gn=!1;return}Tn()}return ps(()=>{clearTimeout(ds)}),(Ye,qe)=>(x(),T("aside",{class:Pe(["side",{"macos-desktop":C(Lc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Gt({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:Gt({width:e.colWidth+"px"})},[_("div",AB,[_("div",MB,[C(Lc)?le("",!0):(x(),T(Be,{key:0},[(x(),T("svg",{ref_key:"logoRef",ref:Ws,class:Pe(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Pt,onPointerdown:Nn,onPointerup:Pn,onPointercancel:Pn},[...qe[22]||(qe[22]=[_y('<defs data-v-05afd885><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-05afd885><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-05afd885></rect><g class="ch-eyes" fill="#000" data-v-05afd885><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-05afd885></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-05afd885></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-05afd885></rect>',2)])],34)),qe[23]||(qe[23]=_("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(x(),xe(fh,{key:0,class:"ch-backend",clickable:i.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:r.value}),onClick:Es},{default:Ee(()=>[_("span",{class:Pe(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),_("span",EB," · "+O(r.value),1),i.value!==null?(x(),xe(je,{key:0,name:"chevron-down",size:"sm"})):le("",!0)]),_:1},8,["clickable","title"])):le("",!0)],64))]),C(Lc)?le("",!0):(x(),xe(qn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:qe[0]||(qe[0]=kt(Lt=>d("collapse"),["stop"]))},{default:Ee(()=>[re(je,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",TB,[_("button",{class:"btn-new-chat",type:"button",onClick:qe[1]||(qe[1]=kt(Lt=>d("create"),["stop"]))},[re(je,{name:"chat-new"}),_("span",null,O(C(n)("sidebar.newChat")),1)]),le("",!0)]),_("div",{class:Pe(["search-wrap",{"search-wrap--scrolled":v.value}])},[_("button",{class:"search",type:"button",onClick:p},[re(je,{class:"search-icon",name:"search"}),_("span",NB,O(C(n)("sidebar.search")),1),re(gr,{keys:C(h)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:g},[e.groups.length===0?(x(),T("div",IB,O(C(n)("workspace.noWorkspace")),1)):(x(),T(Be,{key:1},[_("div",$B,[_("span",LB,O(C(n)("sidebar.workspaces")),1),_("div",FB,[re(qn,{class:"side-section-toggle",size:"sm",label:w.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:qe[3]||(qe[3]=kt(Lt=>w.value?$():L(),["stop"]))},{default:Ee(()=>[w.value?(x(),xe(je,{key:0,name:"expand"})):(x(),xe(je,{key:1,name:"collapse"}))]),_:1},8,["label"]),re(qn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":wt.value,onClick:qe[4]||(qe[4]=kt(Lt=>gs(Lt),["stop"]))},{default:Ee(()=>[re(je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),T(Be,null,nt(e.groups,Lt=>(x(),T("div",{key:Lt.workspace.id,class:Pe(["ws-drop-target",{"drop-before":B.value?.id===Lt.workspace.id&&B.value.position==="before","drop-after":B.value?.id===Lt.workspace.id&&B.value.position==="after"}]),onDragover:Ht=>W(Ht,Lt.workspace.id),onDrop:Ht=>ee(Lt.workspace.id)},[re(vB,{group:Lt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":ue.value,"rename-value":fe.value,"rename-input-ref":Z(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ve.value,dragging:I.value===Lt.workspace.id,"is-collapsed":k,"is-expanded":N,onGroupClick:U,onGroupContextmenu:ye,onToggleWsMenu:Ie,onCreateInWorkspace:qe[5]||(qe[5]=Ht=>d("createInWorkspace",Ht)),onSelectSession:Y,onRenameSession:qe[6]||(qe[6]=(Ht,sn)=>d("rename",Ht,sn)),onArchiveSession:qe[7]||(qe[7]=Ht=>d("archive",Ht)),onForkSession:qe[8]||(qe[8]=Ht=>d("fork",Ht)),onExportSession:qe[9]||(qe[9]=Ht=>d("export",Ht)),onLoadMore:S,onToggleExpand:F,onConfirmRename:ae,onCancelRename:He,onUpdateRenameValue:he,onWsDragstart:R,onWsDragend:P},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,OB))),128))],64))],32),_("div",RB,[_("button",{class:"btn-settings",type:"button",onClick:qe[10]||(qe[10]=kt(Lt=>d("openSettings"),["stop"]))},[re(je,{name:"settings"}),_("span",null,O(C(n)("settings.title")),1)])])],4),K.value?(x(),xe(vl,{key:0,ref_key:"ghMenuRef",ref:q,class:"gh-menu",style:Gt(ge.value),onClick:qe[11]||(qe[11]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{onClick:ke},{default:Ee(()=>[Qe(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(mn,{onClick:j},{default:Ee(()=>[Qe(O(C(n)("sidebar.rename")),1)]),_:1}),re(mn,{danger:"",onClick:ne},{default:Ee(()=>[Qe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),ve.value!==null&&Ae.value?(x(),xe(vl,{key:1,ref_key:"wsMenuRef",ref:Oe,class:"ws-menu",style:Gt($e.value),onClick:qe[15]||(qe[15]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{onClick:qe[12]||(qe[12]=Lt=>it(Ae.value))},{default:Ee(()=>[Qe(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(mn,{separator:""}),re(mn,{onClick:qe[13]||(qe[13]=Lt=>At(Ae.value))},{default:Ee(()=>[Qe(O(C(n)("sidebar.rename")),1)]),_:1}),re(mn,{separator:""}),re(mn,{danger:"",onClick:qe[14]||(qe[14]=Lt=>bt(Ae.value))},{default:Ee(()=>[Qe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):le("",!0),wt.value?(x(),xe(vl,{key:2,ref_key:"sectionMenuRef",ref:yt,class:"section-menu",style:Gt(qt.value),onClick:qe[18]||(qe[18]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{onClick:qe[16]||(qe[16]=Lt=>Jt("manual"))},{default:Ee(()=>[_("span",BB,[e.workspaceSortMode==="manual"?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),Qe(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),re(mn,{onClick:qe[17]||(qe[17]=Lt=>Jt("recent"))},{default:Ee(()=>[_("span",DB,[e.workspaceSortMode==="recent"?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),Qe(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):le("",!0),wn.value?(x(),xe(vl,{key:3,ref_key:"backendMenuRef",ref:st,class:"backend-menu",style:Gt(vs.value),onClick:qe[19]||(qe[19]=kt(()=>{},["stop"]))},{default:Ee(()=>[(x(),T(Be,null,nt(l,Lt=>re(mn,{key:Lt,onClick:Ht=>Hs(Lt)},{default:Ee(()=>[_("span",PB,[c(Lt)?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",HB,O(Lt),1),_("span",WB,O(a(Lt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):le("",!0),f.value?(x(),xe(WR,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:Y,onClose:qe[20]||(qe[20]=Lt=>f.value=!1)},null,8,["sessions","active-id"])):le("",!0),(x(),xe(im,{to:"body"},[jn.value?(x(),xe(C(yn),{key:0,onClose:qe[21]||(qe[21]=Lt=>jn.value=!1)})):le("",!0)]))],6))}}),qB=ct(UB,[["__scopeId","data-v-05afd885"]]);function jB(e){try{const t=us(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function VB(e,t){try{ms(e,String(t))}catch{}}function KB(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(v){return Number.isFinite(v)?Math.min(E4(o),Math.max(s,Math.round(v))):n}const l=X(r(jB(t)??n)),a=X(!1);function c(v){const g=r(v);l.value=g,VB(t,g)}let u=0,d=0,f=null,h=-1;function p(v){if(!a.value)return;const g=v.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function b(v){v.preventDefault(),a.value=!0,u=v.clientX,d=r(l.value),f=v.currentTarget,h=v.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return ps(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const GB=["aria-label"],YB=Ge({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),{width:i,dragging:r,onPointerDown:l}=KB({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ze(i,a=>s("update:width",a)),Ze(r,a=>s("update:dragging",a)),(a,c)=>(x(),T("div",{class:Pe(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,GB))}}),aw=ct(YB,[["__scopeId","data-v-ad762f1c"]]),ZB={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},QB={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},XB={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},JB={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},eD={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},tD={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},nD={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},sD={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},oD={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},iD={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"},rD={justNow:"just now"},lD={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"},aD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},cD={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},uD={panelTitle:"Thinking",close:"Close"},dD={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"},fD={},hD={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},pD={searching:"Searching…",noMatch:"No matches"},mD={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},gD={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},vD={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},yD={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},kD={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},bD={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},xD={preview:"预览",confirm:"确认",cancel:"取消"},wD={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},_D={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},SD={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},CD={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},AD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},MD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},ED={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},TD={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},ND={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},ID={justNow:"刚刚"},$D={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},LD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},FD={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},OD={panelTitle:"思考过程",close:"关闭"},RD={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},BD={},DD={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},PD={searching:"搜索中…",noMatch:"无匹配"},HD={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},WD={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},zD={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},UD={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},qD={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},jD={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},VD={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},KD={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},GD={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},YD={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},ZD={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},QD={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},XD={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"},JD={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},eP={en:{common:ZB,app:QB,sidebar:XB,workspace:JB,conversation:eD,status:tD,composer:nD,login:sD,providers:oD,model:iD,sessions:rD,approval:lD,question:aD,tasks:cD,thinking:uD,diff:dD,fileTree:fD,filePreview:hD,mention:pD,warnings:mD,commands:gD,tools:vD,layout:yD,mobile:kD,theme:bD,onboarding:VD,settings:GD,header:ZD,sideChat:XD},zh:{common:xD,app:wD,sidebar:_D,workspace:SD,conversation:CD,status:AD,composer:MD,login:ED,providers:TD,model:ND,sessions:ID,approval:$D,question:LD,tasks:FD,thinking:OD,diff:RD,fileTree:BD,filePreview:DD,mention:PD,warnings:HD,commands:WD,tools:zD,layout:UD,mobile:qD,theme:jD,onboarding:KD,settings:YD,header:QD,sideChat:JD}},vA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function tP(){const e=us(Ft.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Cn=ZN({legacy:!1,locale:tP(),fallbackLocale:"en",messages:eP});function yA(e){Cn.global.locale.value=e,ms(Ft.locale,e)}const to=Cn.global.t,nP={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},sP={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function $a(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return sP[t]??t}function La(e){const t=nP[$a(e)];return t?to(t):e}const oP={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function hm(e){const t=$a(e);let n=oP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),fc(n,"sm")}const kA=80;function iP(e,t=kA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function rP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function lP(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 Qt(e){return typeof e=="string"&&e.length>0?e:void 0}function ul(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function aP(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function l0(e){return Qt(e.path)??Qt(e.file_path)??Qt(e.filePath)??Qt(e.filename)}const cP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function uP(e){const t=Qt(e);if(!t)return;const n=cP[t];return n?to(n):t}function dP(e){const t=ul(e.value),n=Qt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return to("tools.goal.turns",{value:t});case"tokens":return to("tools.goal.tokens",{value:t});case"milliseconds":return to("tools.goal.milliseconds",{value:t});case"seconds":return to("tools.goal.seconds",{value:t});case"minutes":return to("tools.goal.minutes",{value:t});case"hours":return to("tools.goal.hours",{value:t});default:return to("tools.goal.budget",{value:t,unit:n})}}const fP=64;function _d(e,t,n=!1){const s=(o,i=kA)=>n?o.trim():iP(o,i);try{const o=lP(t);if(!n&&rP(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch($a(e)){case"read":{const r=l0(o);if(!r)return i();const l=ul(o.offset)??ul(o.line_start)??ul(o.start_line),a=ul(o.limit)??ul(o.length),c=ul(o.line_end)??ul(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=l0(o);return r?s(`${r} ${to("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=l0(o);return r?s(r):i()}case"bash":{const r=Qt(o.command)??Qt(o.cmd)??Qt(o.script);return r?s(r,fP):i()}case"grep":case"search":{const r=Qt(o.pattern)??Qt(o.query)??Qt(o.regex),l=Qt(o.path)??Qt(o.glob)??Qt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Qt(o.pattern)??Qt(o.glob)??Qt(o.query),l=Qt(o.path)??Qt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Qt(o.path)?s(Qt(o.path)):i()}case"ls":{const r=Qt(o.path)??Qt(o.dir)??Qt(o.directory)??Qt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Qt(o.url)??Qt(o.uri);return r?s(aP(r)):i()}case"todo":case"task":{const r=Qt(o.description)??Qt(o.title)??Qt(o.prompt)??Qt(o.name)??Qt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(to("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Qt(o.objective),l=Qt(o.completionCriterion);return r&&l?s(to("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?s(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=dP(o);return r?s(r):i()}case"updategoal":{if(n)return i();const r=uP(o.status);return r?s(to("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function hP(e){try{switch($a(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return to("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return to("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?to("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const pP=Ge({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=D(()=>n(t.status));return(o,i)=>(x(),T("span",{class:Pe(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),Sd=ct(pP,[["__scopeId","data-v-e36198e5"]]),mP=["innerHTML"],gP={class:"bh-text"},vP={class:"a"},yP={key:0,class:"p"},kP={class:"rt"},bP=["aria-label"],xP={key:0,class:"tm"},wP=["inert"],_P={class:"bb-pad"},SP=Ge({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,s=Vt("pinScroll",()=>{}),o=X(null);function i(){n("toggle");const r=o.value;r&&pt(()=>s(r))}return(r,l)=>(x(),T("div",{class:Pe(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(x(),T("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,mP)):le("",!0),_("span",gP,[_("span",vP,O(e.name),1),re(Yt,{text:e.arg},{default:Ee(()=>[e.arg?(x(),T("span",yP,O(e.arg),1)):le("",!0)]),_:1},8,["text"])]),_("span",kP,[_("span",{class:Pe(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),xe(je,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),xe(je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),xe(Sd,{key:2,status:"suspended"})):(x(),xe(Sd,{key:3,status:"running"}))],10,bP),Rn(r.$slots,"trailing"),e.time?(x(),T("span",xP,O(e.time),1)):le("",!0)]),e.expandable?(x(),xe(je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):le("",!0)],512),_("div",{class:Pe(["bb",{open:e.open}]),inert:!e.open},[_("div",_P,[Rn(r.$slots,"default")])],10,wP)],2))}}),pm=ct(SP,[["__scopeId","data-v-fef8aad2"]]),CP={key:0,class:"at-type"},AP={key:1,class:"at-task"},MP={key:2,class:"bb-code"},EP=Ge({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t;function i(v){if(!v)return{};try{const g=JSON.parse(v);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=D(()=>i(s.tool.arg)),l=D(()=>!!s.tool.output&&s.tool.output.length>0),a=D(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=X(s.tool.defaultExpanded===!0&&a.value),u=D(()=>s.tool.status),d=D(()=>La(s.tool.name)),f=D(()=>hm(s.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=Vt("resolveAgentTaskId"),m=D(()=>p?p(s.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Ze(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(v,g)=>(x(),xe(pm,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:Ee(()=>[m.value?(x(),T("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=kt(y=>o("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):le("",!0)]),default:Ee(()=>[r.value.subagentType?(x(),T("div",CP,O(r.value.subagentType),1)):le("",!0),r.value.prompt?(x(),T("div",AP,O(r.value.prompt),1)):le("",!0),l.value?(x(),T("div",MP,[(x(!0),T(Be,null,nt(e.tool.output??[],(y,k)=>(x(),T("div",{key:k},O(y),1))),128))])):le("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),TP=ct(EP,[["__scopeId","data-v-14ef8750"]]);function NP(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const s=[];for(const o of n){if(!o||typeof o!="object")continue;const i=o,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];s.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return s}catch{return[]}}const Rf={recognized:!1,answers:{},note:""};function IP(e){const t=e?.[0];if(!t)return Rf;let n;try{n=JSON.parse(t)}catch{return Rf}if(!n||typeof n!="object"||Array.isArray(n))return Rf;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return Rf;const o={};for(const[i,r]of Object.entries(s))typeof r=="string"?o[i]=r:r===!0&&(o[i]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function $P(e,t,n){return e[t]??e[`q_${n}`]}const LP=/^opt_\d+_(\d+)$/;function FP(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const s=n.get(e);if(s!==void 0)return{selected:new Set([s]),otherText:"",indeterminate:!1};const o=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const c=LP.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const OP={key:0,class:"chip"},RP={key:0,class:"au-dismissed"},BP={key:1,class:"au-list"},DP={class:"au-q"},PP={key:0,class:"au-hdr"},HP={class:"au-qtext"},WP={class:"au-opts"},zP={class:"au-glyph"},UP={class:"au-label"},qP={key:0,class:"au-desc"},jP={key:0,class:"au-opt sel"},VP={class:"au-glyph"},KP={class:"au-label"},GP={key:1,class:"au-opt sel"},YP={class:"au-label"},ZP={key:2,class:"au-raw"},QP=80,XP=Ge({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Mt();function s($,w=QP){const M=$.trim();return M.length>w?M.slice(0,w-1)+"…":M}const o=D(()=>NP(t.tool.arg)),i=D(()=>IP(t.tool.output)),r=D(()=>i.value.recognized),l=D(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=D(()=>o.value.map(($,w)=>FP($P(i.value.answers,$.question,w),$.options))),c=D(()=>Object.keys(i.value.answers).length);function u($,w){return a.value[$]?.selected.has(w)??!1}function d($){return a.value[$]?.otherText??""}function f($){return a.value[$]?.indeterminate??!1}function h($,w){return $?w?"■":"□":w?"●":"○"}const p=D(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const $=o.value[0]?.question??"",w=s($);return o.value.length<=1?w:`${w} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=D(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),b=D(()=>!!t.tool.output&&t.tool.output.length>0),v=D(()=>r.value&&(o.value.length>0||l.value)||b.value),g=X(t.tool.defaultExpanded===!0&&v.value),y=D(()=>t.tool.status),k=D(()=>La(t.tool.name)),E=D(()=>hm(t.tool.name));function L(){v.value&&(g.value=!g.value)}return Ze(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(g.value=!0)}),($,w)=>(x(),xe(pm,{status:y.value,icon:E.value,name:k.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:v.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:L},{trailing:Ee(()=>[m.value?(x(),T("span",OP,O(m.value),1)):le("",!0)]),default:Ee(()=>[l.value?(x(),T("div",RP,O(i.value.note),1)):r.value?(x(),T("div",BP,[(x(!0),T(Be,null,nt(o.value,(M,N)=>(x(),T("div",{key:N,class:"au-block"},[_("div",DP,[M.header?(x(),T("span",PP,O(M.header),1)):le("",!0),_("span",HP,O(M.question),1)]),_("div",WP,[(x(!0),T(Be,null,nt(M.options,(F,S)=>(x(),T("div",{key:S,class:Pe(["au-opt",{sel:u(N,S)}])},[_("span",zP,O(h(M.multiSelect,u(N,S))),1),_("span",UP,O(F.label),1),F.description?(x(),T("span",qP,O(F.description),1)):le("",!0)],2))),128)),d(N)?(x(),T("div",jP,[_("span",VP,O(h(M.multiSelect,!0)),1),_("span",KP,O(d(N)),1)])):le("",!0),f(N)?(x(),T("div",GP,[w[0]||(w[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",YP,O(C(n)("tools.ask.answered")),1)])):le("",!0)])]))),128))])):(x(),T("div",ZP,[(x(!0),T(Be,null,nt(e.tool.output??[],(M,N)=>(x(),T("div",{key:N},O(M),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),JP=ct(XP,[["__scopeId","data-v-a9a0f259"]]),eH=1e6,cw=5e3;function uw(e){if(e==="")return[];const t=e.split(`
|
|
68
|
-
`);return t.at(-1)===""&&t.pop(),t}function tH(e,t){const n=uw(e),s=uw(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>cw||i>cw||(o+1)*(i+1)>eH)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=o;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===s[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=o,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===s[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:s[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function nH(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}function bA(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 xA(e){const t=$a(e.name);if(t!=="edit"&&t!=="write")return null;const n=bA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const s=typeof n.old_string=="string"?n.old_string:void 0,o=typeof n.new_string=="string"?n.new_string:void 0;return s===void 0||o===void 0?null:tH(s,o)}return null}function sH(e){const t=bA(e);return t&&typeof t.path=="string"?t.path:void 0}function oH(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const iH={key:0,class:"bb-empty"},dw=50,rH=Ge({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),s=D(()=>n.value.length>dw),o={"--tool-output-visible-lines":String(dw)};return(i,r)=>(x(),T("div",{class:Pe(["bb-code tool-output-block",{scroll:s.value}]),style:o},[n.value.length===0&&e.emptyText?(x(),T("div",iH,O(e.emptyText),1)):le("",!0),(x(!0),T(Be,null,nt(n.value,(l,a)=>(x(),T("div",{key:a},O(l),1))),128))],2))}}),wA=ct(rH,[["__scopeId","data-v-262bbea0"]]),lH={key:0,class:"chip"},aH={key:0,class:"bb-summary"},cH=Ge({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status),i=D(()=>La(n.tool.name)),r=D(()=>hm(n.tool.name)),l=D(()=>_d(n.tool.name,n.tool.arg)),a=D(()=>_d(n.tool.name,n.tool.arg,!0)),c=D(()=>xA(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:b,removed:v}=nH(m);if(b||v)return`+${b} −${v}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=X(!1),h=D(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,b)=>(x(),xe(pm,{status:o.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ee(()=>[u.value?(x(),T("span",lH,O(u.value),1)):le("",!0)]),default:Ee(()=>[a.value?(x(),T("div",aH,O(a.value),1)):le("",!0),re(wA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),uH=ct(cH,[["__scopeId","data-v-74e1da99"]]),dH={key:0,class:"chip"},fH={key:0,class:"bb-summary"},hH=Ge({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=D(()=>!!t.tool.output&&t.tool.output.length>0),o=D(()=>s.value||n.value),i=X(t.tool.defaultExpanded===!0&&o.value),r=D(()=>t.tool.status),l=D(()=>La(t.tool.name)),a=D(()=>hm(t.tool.name)),c=D(()=>_d(t.tool.name,t.tool.arg)),u=D(()=>_d(t.tool.name,t.tool.arg,!0)),d=D(()=>hP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){o.value&&(i.value=!i.value)}return Ze(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(x(),xe(pm,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:o.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ee(()=>[d.value?(x(),T("span",dH,O(d.value),1)):le("",!0)]),default:Ee(()=>[u.value?(x(),T("div",fH,O(u.value),1)):le("",!0),re(wA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),pH=ct(hH,[["__scopeId","data-v-aa4edcb0"]]),mH={class:"media-title"},gH=["src","alt"],vH=["src"],yH=["src"],kH=Ge({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=o.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=o.value;c?.kind==="image"&&s("openMedia",c)}return(c,u)=>o.value?(x(),T("div",{key:0,class:Pe(["media-tool",{mob:e.mobile}])},[re(Yt,{text:o.value.path||l.value},{default:Ee(()=>[_("div",mH,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(x(),xe(Yt,{key:0,text:o.value.path||l.value},{default:Ee(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,gH)])]),_:1},8,["text"])):o.value.kind==="video"?(x(),T("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,vH)):(x(),T("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,yH))],2)):le("",!0)}}),bH=ct(kH,[["__scopeId","data-v-bec13b73"]]),xH=/<summary>([\s\S]*?)<\/summary>/,wH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,a0=/<subagent\b([^>]*)>|<\/subagent>/g,_H="</subagent>",fw=/(completed|failed|aborted):\s*(\d+)/g,hw=/([a-z_]+)="([^"]*)"/g;function SH(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function CH(e){const t={};hw.lastIndex=0;let n;for(;(n=hw.exec(e))!==null;)t[n[1]]=SH(n[2]);return t}function AH(e){const t={completed:0,failed:0,aborted:0};fw.lastIndex=0;let n;for(;(n=fw.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function MH(e,t){const n=CH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function EH(e){const t=[],n=[];a0.lastIndex=0;let s;for(;(s=a0.exec(e))!==null;)if(s[0]===_H){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(MH(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:a0.lastIndex}):n.push(null);return t}function TH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
69
|
-
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=xH.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=AH(n),r=wH.exec(t)?.[1]?.trim(),l=EH(t),a=s+o+i;return{summary:n,completed:s,failed:o,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function pw(e){return e?e.split(`
|
|
70
|
-
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function NH(e){return e.suspendedReason||pw(e.text)||pw(e.outputLines?.join(`
|
|
71
|
-
`))||e.summary||""}function IH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
72
|
-
`):e.summary??""}function $H(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function mw(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
73
|
-
`)[0]??"",phase:$H(e.outcome),body:e.body}}function LH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function FH(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:NH(o),phase:o.phase,body:IH(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>LH(i,o))).map((o,i)=>mw(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>mw(o,i))}const OH=["aria-expanded"],RH={class:"title"},BH={key:0,class:"meta"},DH={key:1,class:"sum-txt"},PH={class:"rt"},HH={class:"status"},WH={key:0,class:"chip"},zH={key:1,class:"tm"},UH={class:"body"},qH={class:"overview"},jH={class:"overview-line"},VH={class:"big"},KH={key:0,class:"lbl"},GH={key:1,class:"lbl"},YH={key:2,class:"lbl"},ZH={key:0,class:"seg","aria-hidden":"true"},QH={key:1,class:"legend"},XH=["aria-expanded","onClick"],JH={class:"mname"},eW={class:"mact"},tW={class:"mphase"},nW={key:1,class:"fallback-output"},sW={key:2,class:"waiting"},oW=Ge({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Mt(),n=e;function s(N){if(!N)return{};try{const F=JSON.parse(N),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const o=Vt("resolveSwarmMembers"),i=D(()=>s(n.tool.arg)),r=D(()=>La(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>o?.(n.tool.id)??[]),c=D(()=>TH(n.tool.output)),u=D(()=>n.tool.status),d=D(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=D(()=>FH(a.value,c.value)),h=D(()=>{const N={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)N[F.phase]++;return N}),p=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>h.value.completed+h.value.failed),b=D(()=>h.value.working+h.value.suspended+h.value.queued),v=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=D(()=>v.map(({phase:N,cls:F})=>({phase:N,count:h.value[N],cls:F})).filter(N=>N.count>0)),y=X(u.value==="running"||b.value>0);function k(){y.value=!y.value}const E=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
74
|
-
`).trim()),L=X(new Set);function $(N){const F=new Set(L.value);F.has(N)?F.delete(N):F.add(N),L.value=F}function w(N){return L.value.has(N)}function M(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(x(),T("div",{class:Pe(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[re(je,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",RH,O(r.value),1),l.value?(x(),T("span",BH,"·")):le("",!0),l.value?(x(),T("span",DH,O(l.value),1)):le("",!0),_("span",PH,[_("span",HH,[d.value==="ok"?(x(),xe(je,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),xe(je,{key:1,name:"close",size:"sm"})):(x(),xe(Sd,{key:2,status:"running"}))]),m.value>0||p.value>0?(x(),T("span",WH,O(m.value)+" / "+O(p.value),1)):le("",!0),e.tool.timing?(x(),T("span",zH,O(e.tool.timing),1)):le("",!0)]),re(je,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,OH),On(_("div",UH,[_("div",qH,[_("div",jH,[_("span",VH,O(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),T("span",KH,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(x(),T("span",GH,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),T("span",YH,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(x(),T("div",ZH,[(x(!0),T(Be,null,nt(g.value,S=>(x(),T("span",{key:S.phase,class:Pe(S.cls),style:Gt({flex:S.count})},null,6))),128))])):le("",!0),g.value.length>1?(x(),T("div",QH,[(x(!0),T(Be,null,nt(g.value,S=>(x(),T("span",{key:S.phase},[_("i",{class:Pe(["lg-dot",S.cls])},null,2),Qe(O(M(S.phase))+" "+O(S.count),1)]))),128))])):le("",!0)]),f.value.length>0?(x(!0),T(Be,{key:0},nt(f.value,S=>(x(),T("div",{key:S.id,class:Pe(["member",[`phase-${S.phase}`,{open:w(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":w(S.id),onClick:I=>$(S.id)},[re(Sd,{class:"row-dot",status:S.phase},null,8,["status"]),re(Yt,{text:S.name},{default:Ee(()=>[_("span",JH,O(S.name),1)]),_:2},1032,["text"]),S.activity?(x(),xe(Yt,{key:0,text:S.activity},{default:Ee(()=>[_("span",eW,O(S.activity),1)]),_:2},1032,["text"])):le("",!0),_("span",tW,O(M(S.phase)),1),re(je,{class:"mcar",name:w(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,XH),On(_("div",{class:"member-body"},O(S.body),513),[[yi,w(S.id)]])],2))),128)):E.value?(x(),T("div",nW,O(E.value),1)):(x(),T("div",sW,O(C(t)("tools.swarm.waiting")),1))],512),[[yi,y.value]])],2))}}),iW=ct(oW,[["__scopeId","data-v-4b58e128"]]);function rW(e){if(e.media&&e.status==="ok")return bH;const t=$a(e.name);return t==="edit"||t==="write"||t==="multi_edit"?uH:t==="task"?TP:t==="agentswarm"?iW:t==="askuserquestion"?JP:pH}const _A=Ge({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>rW(n.tool));return(i,r)=>(x(),xe(Ks(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>s("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>s("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>s("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>s("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function gw(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function lW(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 mm(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 aW(e){return!(e.tool.status==="ok"&&e.tool.media)}function cW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function uW(e){const t=mm(e),n=[];let s=[];const o=()=>{if(s.length===1){const[i]=s;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else s.length>1&&n.push({kind:"tool-stack",tools:s});s=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(aW(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),o(),n}function dW(e){return mm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
75
|
-
|
|
76
|
-
`)}function fW(e){const t=[];for(const n of mm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
77
|
-
> ${n.thinking.split(`
|
|
78
|
-
`).join(`
|
|
79
|
-
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const s=n.tool.output.join(`
|
|
80
|
-
`);t.push(`\`\`\`
|
|
81
|
-
[${n.tool.name}]
|
|
82
|
-
${s}
|
|
83
|
-
\`\`\``)}return t.join(`
|
|
84
|
-
|
|
85
|
-
`)}function SA(e){return e.tool.id||`tool-${e.sourceIndex}`}function hW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?SA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const pW=["aria-expanded"],mW={class:"tg-title"},gW={class:"tg-meta"},vW=["inert"],yW={class:"tool-group-body-inner"},kW=Ge({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=X(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Mt(),a=D(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){o.value=!o.value}const u=Vt("pinScroll",()=>{}),d=X(null);function f(){c();const h=d.value;h&&pt(()=>u(h))}return(h,p)=>(x(),T("div",{class:Pe(["tool-group",{open:o.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[re(Sd,{status:r.value},null,8,["status"]),re(je,{class:"tg-ic",name:"list",size:"sm"}),_("span",mW,O(C(l)("tools.group.title",i.value)),1),_("span",gW,"· "+O(a.value),1),re(je,{class:"tg-car",name:"chevron-right",size:"sm"})],8,pW),_("div",{class:Pe(["tool-group-body",{open:o.value}]),inert:!o.value},[_("div",yW,[(x(!0),T(Be,null,nt(e.tools,(m,b)=>(x(),xe(_A,{key:C(SA)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(cW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>s("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>s("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>s("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>s("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,vW)],2))}}),bW=ct(kW,[["__scopeId","data-v-37eb334f"]]);var xW=Object.create,By=Object.defineProperty,wW=Object.getOwnPropertyDescriptor,CA=Object.getOwnPropertyNames,_W=Object.getPrototypeOf,SW=Object.prototype.hasOwnProperty,AA=(e,t)=>function(){return t||(0,e[CA(e)[0]])((t={exports:{}}).exports,t),t.exports},MA=e=>{let t={};for(var n in e)By(t,n,{get:e[n],enumerable:!0});return t},CW=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=CA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!SW.call(e,l)&&l!==n&&By(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=wW(t,l))||s.enumerable});return e},EA=(e,t,n)=>(n=e!=null?xW(_W(e)):{},CW(By(n,"default",{value:e,enumerable:!0}),e));function AW(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function MW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function EW(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function TW(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
86
|
-
`:`<hr class="footnotes-sep">
|
|
87
|
-
`)+`<section class="footnotes">
|
|
88
|
-
<ol class="footnotes-list">
|
|
89
|
-
`}function NW(){return`</ol>
|
|
90
|
-
</section>
|
|
91
|
-
`}function IW(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function $W(){return`</li>
|
|
92
|
-
`}function LW(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function FW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=EW,e.renderer.rules.footnote_block_open=TW,e.renderer.rules.footnote_block_close=NW,e.renderer.rules.footnote_open=IW,e.renderer.rules.footnote_close=$W,e.renderer.rules.footnote_anchor=LW,e.renderer.rules.footnote_caption=MW,e.renderer.rules.footnote_anchor_name=AW;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const b=l.bMarks[a],v=l.tShift[a],g=l.sCount[a],y=l.parentType,k=h,E=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=E;for(;h<f;){const w=l.src.charCodeAt(h);if(n(w))w===9?L+=4-L%4:L++;else break;h++}l.tShift[a]=h-k,l.sCount[a]=L-E,l.bMarks[a]=k,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=y,l.blkIndent-=4,l.tShift[a]=v,l.sCount[a]=g,l.bMarks[a]=b;const $=new l.Token("footnote_reference_close","",-1);return $.level=--l.level,l.tokens.push($),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const y=new l.Token("paragraph_open","p",1);y.block=!0,a.push(y);const k=new l.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,a.push(k);const E=new l.Token("paragraph_close","p",-1);E.block=!0,a.push(E)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let v;l.tokens[l.tokens.length-1].type==="paragraph_close"?v=l.tokens.pop():v=null;const g=h[p].count>0?h[p].count:1;for(let y=0;y<g;y++){const k=new l.Token("footnote_anchor","",0);k.meta={id:p,subId:y,label:h[p].label},l.tokens.push(k)}v&&l.tokens.push(v),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function OW(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function RW(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const BW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function DW(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(BW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function PW(e){e.inline.ruler.after("emphasis","sub",DW)}const HW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function WW(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(HW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function zW(e){e.inline.ruler.after("emphasis","sup",WW)}var UW=AA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),m.core.ruler.after("inline","github-task-lists",function(v){for(var g=v.tokens,y=0,k=2;k<g.length;k++)o(g,k)&&(i(g[k],y,b,v.Token),y+=1,n(g[k-2],"class",b.liClass),n(g[s(g,k-2)],"class",b.ulClass))})};function n(m,b,v){var g=m.attrIndex(b),y=[b,v];g<0?m.attrPush(y):m.attrs[g]=y}function s(m,b){for(var v=m[b].level-1,g=b-1;g>=0;g--)if(m[g].level===v)return g;return-1}function o(m,b){return d(m[b])&&f(m[b-1])&&h(m[b-2])&&p(m[b])}function i(m,b,v,g){var y=v.idPrefix+b;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(y,g)),m.children.push(a(g)),m.children.unshift(r(m,y,v,g)),v.divWrap&&(m.children.unshift(c(v,g)),m.children.push(u(g)))}function r(m,b,v,g){var y=new g("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(m,b){var v=new b("label_open","label",1);return v.attrs=[["for",m]],v}function a(m){return new m("label_close","label",-1)}function c(m,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",m.divClass]],v}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 h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),qW=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Ā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))),jW=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),c0;const VW=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]]),KW=(c0=String.fromCodePoint)!==null&&c0!==void 0?c0:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function GW(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=VW.get(e))!==null&&t!==void 0?t:e}var Ds;(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"})(Ds||(Ds={}));const YW=32;var yl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yl||(yl={}));function Jg(e){return e>=Ds.ZERO&&e<=Ds.NINE}function ZW(e){return e>=Ds.UPPER_A&&e<=Ds.UPPER_F||e>=Ds.LOWER_A&&e<=Ds.LOWER_F}function QW(e){return e>=Ds.UPPER_A&&e<=Ds.UPPER_Z||e>=Ds.LOWER_A&&e<=Ds.LOWER_Z||Jg(e)}function XW(e){return e===Ds.EQUALS||QW(e)}var Bs;(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"})(Bs||(Bs={}));var ml;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ml||(ml={}));var JW=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Bs.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ml.Strict}startEntity(e){this.decodeMode=e,this.state=Bs.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Bs.EntityStart:return e.charCodeAt(t)===Ds.NUM?(this.state=Bs.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Bs.NamedEntity,this.stateNamedEntity(e,t));case Bs.NumericStart:return this.stateNumericStart(e,t);case Bs.NumericDecimal:return this.stateNumericDecimal(e,t);case Bs.NumericHex:return this.stateNumericHex(e,t);case Bs.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|YW)===Ds.LOWER_X?(this.state=Bs.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Bs.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Jg(s)||ZW(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Jg(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ds.SEMI)this.consumed+=1;else if(this.decodeMode===ml.Strict)return 0;return this.emitCodePoint(GW(this.result),this.consumed),this.errors&&(e!==Ds.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&yl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=ez(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===ml.Attribute&&(o===0||XW(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&yl.VALUE_LENGTH)>>14,o!==0){if(i===Ds.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ml.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&yl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~yl.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Bs.NamedEntity:return this.result!==0&&(this.decodeMode!==ml.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Bs.NumericDecimal:return this.emitNumericEntity(0,2);case Bs.NumericHex:return this.emitNumericEntity(0,3);case Bs.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Bs.EntityStart:return 0}}};function TA(e){let t="";const n=new JW(e,s=>t+=KW(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function ez(e,t,n,s){const o=(t&yl.BRANCH_LENGTH)>>7,i=t&yl.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const tz=TA(qW);TA(jW);function Dy(e,t=ml.Legacy){return tz(e,t)}var nz=EA(UW());const vw={};function sz(e){let t=vw[e];if(t)return t;t=vw[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function gm(e,t){typeof t!="string"&&(t=gm.defaultChars);const n=sz(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}gm.defaultChars=";/?:@&=+$,#";gm.componentChars="";var ev=gm;const yw={};function oz(e){let t=yw[e];if(t)return t;t=yw[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function vm(e,t,n){typeof t!="string"&&(n=t,t=vm.defaultChars),typeof n>"u"&&(n=!0);const s=oz(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}vm.defaultChars=";/?:@&=+$,-_.!~*'()#";vm.componentChars="-_.!~*'()";var NA=vm;function Py(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 ep(){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 iz=/^([a-z0-9.+-]+:)/i,rz=/:[0-9]*$/,lz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,az=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
93
|
-
`," "]),cz=["'"].concat(az),kw=["%","/","?",";","#"].concat(cz),bw=["/","?","#"],uz=255,xw=/^[+a-z0-9A-Z_-]{0,63}$/,dz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ww={javascript:!0,"javascript:":!0},_w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function fz(e,t){if(e&&e instanceof ep)return e;const n=new ep;return n.parse(e,t),n}ep.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=lz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=iz.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&ww[r])&&(i=i.substr(2),this.slashes=!0)),!ww[r]&&(o||r&&!_w[r])){let c=-1;for(let p=0;p<bw.length;p++)s=i.indexOf(bw[p]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<kw.length;p++)s=i.indexOf(kw[p]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,b=p.length;m<b;m++){const v=p[m];if(v&&!v.match(xw)){let g="";for(let y=0,k=v.length;y<k;y++)v.charCodeAt(y)>127?g+="x":g+=v[y];if(!g.match(xw)){const y=p.slice(0,m),k=p.slice(m+1),E=v.match(dz);E&&(y.push(E[1]),k.unshift(E[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>uz&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),_w[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ep.prototype.parseHost=function(e){let t=rz.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 Hy=fz,IA=MA({decode:()=>ev,encode:()=>NA,format:()=>Py,parse:()=>Hy}),$A=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,LA=/[\0-\x1F\x7F-\x9F]/,hz=/[\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]/,FA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,pz=/[\$\+<->\^`\|~\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]/,OA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,mz=MA({Any:()=>$A,Cc:()=>LA,Cf:()=>hz,P:()=>FA,S:()=>pz,Z:()=>OA}),gz=Object.defineProperty,RA=e=>{let t={};for(var n in e)gz(t,n,{get:e[n],enumerable:!0});return t},Ss=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},vz=RA({arrayReplaceAt:()=>Sz,assign:()=>wz,countLines:()=>ls,escapeHtml:()=>Lz,escapeRE:()=>Oz,fromCodePoint:()=>Ad,has:()=>xz,isMdAsciiPunct:()=>sp,isPunctChar:()=>np,isPunctCode:()=>tv,isSpace:()=>_z,isString:()=>kz,isValidEntityCode:()=>km,isWhiteSpace:()=>Cd,lib:()=>Rz,mdurl:()=>IA,normalizeReference:()=>ym,ucmicro:()=>tp,unescapeAll:()=>Md,unescapeMd:()=>Ez});const tp=mz;function yz(e){return Object.prototype.toString.call(e)}function kz(e){return yz(e)==="[object String]"}const bz=Object.prototype.hasOwnProperty;function xz(e,t){return bz.call(e,t)}function wz(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function _z(e){return e===9||e===32}function Cd(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function np(e){return tp.P.test(e)||tp.S.test(e)}const Sw=new Map;function tv(e){if(sp(e))return!0;const t=Sw.get(e);if(t!==void 0)return t;const n=np(String.fromCharCode(e));return Sw.set(e,n),n}function sp(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ym(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Sz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function km(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Ad(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const BA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Cz=new RegExp(`${BA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Az=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Mz(e,t){if(t.charCodeAt(0)===35&&Az.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return km(s)?Ad(s):e}const n=Dy(e);return n!==e?n:e}function Ez(e){return e.includes("\\")?e.replace(BA,"$1"):e}function Md(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Cz,(t,n,s)=>n||Mz(t,s))}const Tz=/[&<>"]/,Nz=/[&<>"]/g,Iz={"&":"&","<":"<",">":">",'"':"""};function $z(e){return Iz[e]}function Lz(e){return Tz.test(e)?e.replace(Nz,$z):e}const Fz=/[.?*+^$[\]\\(){}|-]/g;function Oz(e){return e.replace(Fz,"\\$&")}const Rz={mdurl:IA,ucmicro:tp};function ls(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
94
|
-
`,n+1))!==-1;)t++;return t}const Bz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Dz=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Pz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Wy=["references","footnotes","abbreviations","abbr","abbrs"],zy=Symbol.for("markdown-it-ts.global-state"),Uy=Object.prototype.hasOwnProperty;function Cw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _l(e){if(Array.isArray(e))return e.map(t=>_l(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=_l(e[n]);return t}return e}function op(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function nv(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(!nv(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!Uy.call(t,o)||!nv(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function DA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function Hz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=_l(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Uy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=_l(t[n]);return e}return _l(t)}function Wz(e,t,n){const s=n.ownedKeys??[],o=e[t];if($i(o)||Array.isArray(o)){const i=new Set(op(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=_l(DA(n.value,r)):delete o[r];!n.existed&&op(o).length===0&&delete e[t];return}n.existed?e[t]=_l(n.value):delete e[t]}function qy(e){const t=e[zy];return Cw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Cw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function zz(e,t){Object.defineProperty(e,zy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function $o(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Bz.test(e)?"footnote-definition":Dz.test(e)?"abbreviation-definition":Pz.test(e)?"reference-definition":null}function Ud(e){return qy(e)?.reason??null}function Fc(e,t,n){if(Ud(e)&&Pr(e),!t)return n();jy(e,t);try{const s=n();return Vy(e),s}catch(s){throw Pr(e),s}}function jy(e,t){try{Pr(e);const n={};for(const s of Wy)n[s]=Uy.call(e,s)?{existed:!0,value:_l(e[s])}:{existed:!1};zz(e,{reason:t,snapshot:n})}catch{}}function Vy(e){const t=qy(e);if(t)for(const n of Wy){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!$i(o)&&!Array.isArray(o))continue;const i=new Set(op(s.existed?s.value:void 0));s.ownedKeys=op(o).filter(r=>i.has(r)?!nv(o[r],DA(s.value,r)):!0)}}function Pr(e){const t=qy(e);if(t){for(const n of Wy){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){Wz(e,n,s);continue}s.existed?e[n]=Hz(e[n],s.value):delete e[n]}delete e[zy]}}const sv=Symbol.for("markdown-it-ts.diagnostics");function bm(e,t){if(e)try{const n=e[sv];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[sv]=s,s}catch{return}}function br(e){return bm(e,!1)}function Uz(e){if(e)try{const t=e[sv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function fo(e){Uz(e)}function xs(e,t){const n=bm(e,!0);n&&(n.strategy=t)}function u0(e,t){const n=bm(e,!0);n&&(n.chunk=t)}function PA(e,t){const n=bm(e,!0);n&&(n.unbounded=t)}function qz(e){const t={};e=e||{},t.src_Any=$A.source,t.src_Cc=LA.source,t.src_Z=OA.source,t.src_P=FA.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 ov(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function xm(e){return Object.prototype.toString.call(e)}function jz(e){return xm(e)==="[object String]"}function Vz(e){return xm(e)==="[object Object]"}function Kz(e){return xm(e)==="[object RegExp]"}function Aw(e){return xm(e)==="[object Function]"}function Gz(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const HA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Yz(e){return Object.keys(e||{}).reduce(function(t,n){return t||HA.hasOwnProperty(n)},!1)}const Zz={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},Qz="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]",Xz="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Jz(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function Mw(){return function(e,t){t.normalize(e)}}function ip(e){const t=e.re=qz(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Qz),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(s(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(s(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(s(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,Vz(a)){Kz(a.validate)?c.validate=Jz(a.validate):Aw(a.validate)?c.validate=a.validate:i(l,a),Aw(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Mw();return}if(jz(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Mw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(Gz).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 WA(e,t,n,s){const o=e.slice(n,s);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=s,this.raw=o,this.text=o,this.url=o}function si(e,t){if(!(this instanceof si))return new si(e,t);t||Yz(e)&&(t=e,e={}),this.__opts__=ov({},HA,t),this.__schemas__=ov({},Zz,e),this.__compiled__={},this.__tlds__=Xz,this.__tlds_replaced__=!1,this.re={},ip(this)}si.prototype.add=function(t,n){return this.__schemas__[t]=n,ip(this),this};si.prototype.set=function(t){return this.__opts__=ov(this.__opts__,t),this};si.prototype.test=function(t){if(!t.length)return!1;let n,s;if(this.re.schema_test.test(t)){for(s=this.re.schema_search,s.lastIndex=0;(n=s.exec(t))!==null;)if(this.testSchemaAt(t,n[2],s.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)};si.prototype.pretest=function(t){return this.re.pretest.test(t)};si.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};si.prototype.match=function(t){const n=[],s=[],o=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&s.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;)o.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=[s[u[0]],i[u[1]],o[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new WA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};si.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);if(!s)return null;const o=new WA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};si.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),ip(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,ip(this),this)};si.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};si.prototype.onCompile=function(){};var zA=si,eU=AA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,b=Math.floor,v=String.fromCharCode;function g(R){throw new RangeError(p[R])}function y(R,P){const z=[];let W=R.length;for(;W--;)z[W]=P(R[W]);return z}function k(R,P){const z=R.split("@");let W="";z.length>1&&(W=z[0]+"@",R=z[1]),R=R.replace(h,".");const ee=y(R.split("."),P).join(".");return W+ee}function E(R){const P=[];let z=0;const W=R.length;for(;z<W;){const ee=R.charCodeAt(z++);if(ee>=55296&&ee<=56319&&z<W){const U=R.charCodeAt(z++);(U&64512)==56320?P.push(((ee&1023)<<10)+(U&1023)+65536):(P.push(ee),z--)}else P.push(ee)}return P}const L=R=>String.fromCodePoint(...R),$=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},w=function(R,P){return R+22+75*(R<26)-((P!=0)<<5)},M=function(R,P,z){let W=0;for(R=z?b(R/700):R>>1,R+=b(R/P);R>m*26>>1;W+=36)R=b(R/m);return b(W+(m+1)*R/(R+38))},N=function(R){const P=[],z=R.length;let W=0,ee=128,U=72,Y=R.lastIndexOf("-");Y<0&&(Y=0);for(let ue=0;ue<Y;++ue)R.charCodeAt(ue)>=128&&g("not-basic"),P.push(R.charCodeAt(ue));for(let ue=Y>0?Y+1:0;ue<z;){const fe=W;for(let Z=1,te=36;;te+=36){ue>=z&&g("invalid-input");const ae=$(R.charCodeAt(ue++));ae>=36&&g("invalid-input"),ae>b((2147483647-W)/Z)&&g("overflow"),W+=ae*Z;const He=te<=U?1:te>=U+26?26:te-U;if(ae<He)break;const he=36-He;Z>b(2147483647/he)&&g("overflow"),Z*=he}const oe=P.length+1;U=M(W-fe,oe,fe==0),b(W/oe)>2147483647-ee&&g("overflow"),ee+=b(W/oe),W%=oe,P.splice(W++,0,ee)}return String.fromCodePoint(...P)},F=function(R){const P=[];R=E(R);const z=R.length;let W=128,ee=0,U=72;for(const fe of R)fe<128&&P.push(v(fe));const Y=P.length;let ue=Y;for(Y&&P.push("-");ue<z;){let fe=2147483647;for(const Z of R)Z>=W&&Z<fe&&(fe=Z);const oe=ue+1;fe-W>b((2147483647-ee)/oe)&&g("overflow"),ee+=(fe-W)*oe,W=fe;for(const Z of R)if(Z<W&&++ee>2147483647&&g("overflow"),Z===W){let te=ee;for(let ae=36;;ae+=36){const He=ae<=U?1:ae>=U+26?26:ae-U;if(te<He)break;const he=te-He,K=36-He;P.push(v(w(He+he%K,0))),te=b(he/K)}P.push(v(w(te,0))),U=M(ee,oe,ue===Y),ee=0,++ue}++ee,++W}return P.join("")},B={version:"2.3.1",ucs2:{decode:E,encode:L},decode:N,encode:F,toASCII:function(R){return k(R,function(P){return f.test(P)?"xn--"+F(P):P})},toUnicode:function(R){return k(R,function(P){return d.test(P)?N(P.slice(4).toLowerCase()):P})}};t.exports=B})}),UA=EA(eU());function Ky(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Md(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Md(e.slice(t,o)),i.pos=o,i.ok=!0),i}var qA=Ky;const hh=-2;function tU(e,t,n,s){let o=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(o--,o===0)return i;if(s){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return hh}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return hh;if(r===91){o++,i++;continue}i++}return-1}function Gy(e,t,n){let s=1,o=!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=tU(l,t,a,n);if(f!==hh)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let h=-1;return o&&(h=e.pos),e.pos=c,h}var rp=Gy;function Yy(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Md(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Md(e.slice(t,i)),r}var jA=Yy;function wm(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 Zy(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function nU(e,t,n){const s=wm(e,t),o=[t,n];s<0?Zy(e,o):e.attrs[s]=o}function sU(e,t){const n=wm(e,t);return n>=0?e.attrs[n][1]:null}function oU(e,t,n){const s=wm(e,t);s<0?Zy(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var iU=RA({attrGet:()=>sU,attrIndex:()=>wm,attrJoin:()=>oU,attrPush:()=>Zy,attrSet:()=>nU,parseLinkDestination:()=>Ky,parseLinkLabel:()=>Gy,parseLinkTitle:()=>Yy});function rU(e){return e.includes("\r")||e.includes("\0")}function VA(e){return typeof e=="string"?e:e.toString()}function lU(e){if(e.inlineMode){const t=new Ss("inline","",0);t.content=VA(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 aU=/^([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])?)*)$/,cU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function uU(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(cU.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(aU.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 dU=uU;function fU(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(s,c);f.includes(`
|
|
95
|
-
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var hU=fU;function Ew(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function pU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Ew(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Ew(t[s].delimiters)}var mU=pU;function gU(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Tw(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function vU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Tw(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Tw(e,t[s].delimiters)}const Nw={tokenize:gU,postProcess:vU};function KA(e){return Dy(e)}function Qy(e){return e>=48&&e<=57}function yU(e){const t=e|32;return Qy(e)||t>=97&&t<=102}function GA(e){const t=e|32;return t>=97&&t<=122}function kU(e){return GA(e)||Qy(e)}function bU(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?yU(l):Qy(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function xU(e,t,n){let s=t+1;if(s>=n||!GA(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&kU(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return KA(o)!==o?o:null}function wU(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=bU(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=km(i)?Ad(i):Ad(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=xU(e.src,n,s);if(o){const i=KA(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var _U=wU;const YA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),iv=new Array(128),ZA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);iv[e]=`\\${t}`,ZA[e]=YA[e]?t:iv[e]}function Iw(e,t,n){e.pending&&e.pushPending();const s=new Ss("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function SU(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Iw(e,ZA[i],iv[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return Iw(e,i<256&&YA[i]?r:l,l),e.pos=n+1,!0}var CU=SU;function AU(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var MU=AU;const QA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,XA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",EU=new RegExp(`^(?:${QA}|${XA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),TU=new RegExp(`^(?:${QA}|${XA})`);function JA(e){return e===32||e===9||e===10||e===12||e===13}function NU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||JA(t)}function IU(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(!JA(n))return!1}return!1}function $U(e){const t=e|32;return t>=97&&t<=122}function LU(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!$U(i))return!1;const r=o.slice(s).match(EU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,NU(l)&&e.linkLevel++,IU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var FU=LU;function OU(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=rp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=qA(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=jA(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=rp(e,i),i>=0?o=e.src.slice(c,i++):i=p+1):i=p+1,o||(o=e.src.slice(h,p)),r=e.env.references[ym(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(h,p);const m=[];e.md.inline.parse(s,e.md,e.env,m);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=m,b.content=s,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var RU=OU;function BU(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=rp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(o=qA(e.src,p,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?p=o.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(o=jA(e.src,p,e.posMax),p<d&&a!==p&&o.ok)for(l=o.str,p=o.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=rp(e,p),p>=0?s=e.src.slice(a,p++):p=h+1):p=h+1,s||(s=e.src.slice(f,h)),i=e.env.references[ym(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),b=[["href",r]];m.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var DU=BU;function e6(e){const t=e|32;return t>=97&&t<=122}function PU(e){return e>=48&&e<=57}function HU(e){return e6(e)||PU(e)||e===43||e===45||e===46}function WU(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&HU(e.charCodeAt(t));)t--;return t++,t>=e.length||!e6(e.charCodeAt(t))?null:e.slice(t)}function zU(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function UU(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=WU(e.pending);if(!o)return!1;const i=zU(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function qU(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var jU=qU;function VU(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function $w(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function KU(e){const t=e.delimiters;$w(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&$w(e,n[s].delimiters)}const Lw={tokenize:VU,postProcess:KU};function Fw(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 GU(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||Fw(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!Fw(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var YU=GU;function Xy(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function ZU(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function QU(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 t6(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Xy(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function Oc(e,t,n,s,o,i){const r=t6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=QU(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=Xy()}function XU(e){const t=t6(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=ZU(o.samples)}return t.completedAt=Xy(),t}var Ow=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},n6=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,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ss("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 Ss(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new Ss(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=Cd(l),u=Cd(a),d=tv(l),f=tv(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};n6.prototype.Token=Ss;const JU=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function s6(e){return!JU.test(e)}var eq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Ow,this.ruler2=new Ow,this.ruler.push("text",YU),this.ruler.push("linkify",UU),this.ruler.push("newline",jU),this.ruler.push("escape",CU),this.ruler.push("backticks",hU),this.ruler.push("strikethrough",Lw.tokenize),this.ruler.push("emphasis",Nw.tokenize),this.ruler.push("link",DU),this.ruler.push("image",RU),this.ruler.push("autolink",dU),this.ruler.push("html_inline",FU),this.ruler.push("entity",_U),this.ruler2.push("balance_pairs",mU),this.ruler2.push("strikethrough",Lw.postProcess),this.ruler2.push("emphasis",Nw.postProcess),this.ruler2.push("fragments_join",MU),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Oc(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Oc(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&s6(e)){const a=new Ss("text","",0);a.content=e,s.push(a);return}const o=new n6(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Oc(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function tq(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&s6(i.content)){const r=new Ss("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const nq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,sq=/[0-9a-z]/i;function oq(e){return/^<a[>\s]/i.test(e)}function iq(e){return/^<\/a\s*>/i.test(e)}function rq(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!nq.test(s)||!sq.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function lq(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(oq(l.content)&&i>0&&i--,iq(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>rq(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const v=p.index;if(v>f){const E=new Ss("text","",0);E.content=a.slice(f,v),E.level=d,u.push(E)}const g=new Ss("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const y=new Ss("text","",0);y.content=b,y.level=d,u.push(y);const k=new Ss("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new Ss("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const aq=/\r\n?|\n/g,cq=/\0/g;function uq(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(aq,`
|
|
96
|
-
`)),s&&(o=o.replace(cq,"�")),e.src=o}const o6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,dq=/\((?:c|tm|r)\)/i,fq=/\((c|tm|r)\)/gi,hq={c:"©",r:"®",tm:"™"};function pq(e,t){return hq[t.toLowerCase()]}function mq(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(fq,pq)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function gq(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&o6.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function vq(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");dq.test(s)&&mq(n.children||[]),o6.test(s)&&gq(n.children||[])}}var yq=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const kq=/['"]/,Rw=/['"]/g,Bw="’";function Bf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function bq(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){Rw.lastIndex=c;const d=Rw.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=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 b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=sp(m)||np(String.fromCharCode(m)),g=sp(b)||np(String.fromCharCode(b)),y=Cd(m),k=Cd(b);if(k?f=!1:g&&(y||v||(f=!1)),y?h=!1:v&&(k||g||(h=!1)),b===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=v,h=g),!f&&!h){p&&(r.content=Bf(r.content,d.index,Bw));continue}if(h)for(n=s.length-1;n>=0;n--){let E=s[n];if(s[n].level<l)break;if(E.single===p&&s[n].level===l){E=s[n];let L,$;p?(L=o[2]||"‘",$=o[3]||"’"):(L=o[0]||"“",$=o[1]||"”"),r.content=Bf(r.content,d.index,$),e[E.token].content=Bf(e[E.token].content,E.pos,L),c+=$.length-1,E.token===i&&(c+=L.length-1),a=r.content,u=a.length,s.length=n;continue e}}f?s.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Bf(r.content,d.index,Bw))}}}function xq(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!kq.test(s)||!n.children||bq(n.children,e)}}function wq(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const _q=/^(?:vbscript|javascript|file|data):/,Sq=/^data:image\/(?:gif|png|jpeg|webp);/,i6=["http:","https:","mailto:"];function r6(e){const t=e.trim().toLowerCase();return _q.test(t)?Sq.test(t):!0}function l6(e){const t=Hy(e,!0);if(t.hostname&&(!t.protocol||i6.includes(t.protocol)))try{t.hostname=UA.default.toASCII(t.hostname)}catch{}return NA(Py(t))}function a6(e){const t=Hy(e,!0);if(t.hostname&&(!t.protocol||i6.includes(t.protocol)))try{t.hostname=UA.default.toUnicode(t.hostname)}catch{}return ev(Py(t),`${ev.defaultChars}%`)}function Cq(e){switch(e){case 9:case 32:return!0}return!1}function Aq(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const h=[],p=[],m=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k<n;k++){const M=a[k]<e.blkIndent;if(u=i[k]+l[k],d=r[k],u>=d)break;if(o.charCodeAt(u++)===62&&!M){let F=a[k]+1,S,I;o.charCodeAt(u)===32?(u++,F++,I=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,I=!1):I=!0):S=!1;let B=F;for(h.push(i[k]),i[k]=u;u<d;){const R=o.charCodeAt(u);if(Cq(R))R===9?B+=4-(B+c[k]+(I?1:0))%4:B++;else break;u++}y=u>=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),m.push(a[k]),a[k]=B-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let N=!1;for(let F=0,S=v.length;F<S;F++)if(v[F](e,k,n,!0)){N=!0;break}if(N){e.lineMax=k,e.blkIndent!==0&&(h.push(i[k]),p.push(c[k]),b.push(l[k]),m.push(a[k]),a[k]-=e.blkIndent);break}h.push(i[k]),p.push(c[k]),b.push(l[k]),m.push(a[k]),a[k]=-1}const E=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const $=[t,0];L.map=$,e.md.block.tokenize(e,t,k);const w=e.push("blockquote_close","blockquote",-1);w.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let M=0;M<b.length;M++)i[M+t]=h[M],l[M+t]=b[M],a[M+t]=m[M],c[M+t]=p[M];return e.blkIndent=E,!0}function Mq(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
97
|
-
`,i.map=[t,e.line],!0}function Eq(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const Dw=["","h1","h2","h3","h4","h5","h6"],Pw=["","#","##","###","####","#####","######"];function Hw(e){switch(e){case 9:case 32:return!0}return!1}function Tq(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!Hw(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&Hw(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",Dw[d],1);h.markup=Pw[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=o.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",Dw[d],-1);return m.markup=Pw[d],!0}function Nq(e){switch(e){case 9:case 32:return!0}return!1}function Iq(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!Nq(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Ja=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${TU.source}\\s*$`),/^$/,!1]];function $q(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<Ja.length&&!Ja[l][0].test(r);l++);if(l===Ja.length)return!1;if(s)return Ja[l][2];let a=t+1;if(!Ja[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),Ja[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function Ww(e){switch(e){case 9:case 32:return!0}return!1}const Yu={Pipe:1,ParagraphTerminator:2};function Lq(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 c6=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,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=o.length;u<d;u++){const f=o.charCodeAt(u);if(f===124&&(c|=Yu.Pipe|Yu.ParagraphTerminator),!a)if(Ww(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Lq(f)&&(c|=Yu.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(o.length),this.eMarks.push(o.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 o=new Ss(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new Ss(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=s?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,b=this.bsCount,v=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+b[u])%4:p++;else if(f-d<v[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,m;for(d+1<t||s?m=l[d]+1:m=l[d];p<m&&f<n;){const b=i.charCodeAt(p);if(Ww(b))b===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?o[u]=new Array(f-n+1).join(" ")+i.slice(p,m):o[u]=i.slice(p,m)}return o.join("")}};c6.prototype.Token=Ss;function Fq(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function u6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function d6(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&Yu.ParagraphTerminator)===0||s>=o)return!1;const i=n.charCodeAt(s);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:Fq(n,s,o)}const zw=["","h1","h2"];function Oq(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=u6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const k=i[p]+r[p],E=l[p];if(k>=E)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(k),h===45||h===61)){let $=k+1,w=$;for(;$<E&&o.charCodeAt($)===h;)$++;for(w=$;$<E;){const M=o.charCodeAt($);if(M!==9&&M!==32)break;$++}if($>=E){f=h===61?1:2;break}if(w-k>1)continue}if(a[p]<0||u&&!d6(e,p,o,k,E))continue;let L=!1;for(let $=0,w=s.length;$<w;$++)if(s[$](e,p,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(p===t+1){const k=i[t]+r[t];let E=l[t];for(;E>k;){const L=o.charCodeAt(E-1);if(L!==9&&L!==32)break;E--}m=o.slice(k,E)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",zw[f],1);v.markup=b,v.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const y=e.push("heading_close",zw[f],-1);return y.markup=b,e.parentType=d,!0}function f6(e){switch(e){case 9:case 32:return!0}return!1}function Uw(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!f6(i.charCodeAt(l))?-1:l}function qw(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!f6(c))?-1:a}function Rq(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const Bq=["0","1","2","3","4","5","6","7","8","9"];function Dq(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function Pq(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,b=e.eMarks,v=e.sCount,g=e.bsCount,y=p[l]+m[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=qw(e,l),f<0||(u=!0,r=y,d=Rq(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=Uw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(s)return!0;const E=h.charCodeAt(f-1),L=String.fromCharCode(E);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let w=!1;const M=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,o=b[l];const S=v[l]+f-(p[l]+m[l]);let I=S;for(;i<o;){const oe=h.charCodeAt(i);if(oe===9)I+=4-(I+g[l])%4;else if(oe===32)I++;else break;i++}const B=i;let R;B>=o?R=1:R=I-S,R>4&&(R=1);const P=S+R,z=e.push("list_item_open","li",1);z.markup=L;const W=[l,0];z.map=W,u&&(z.info=f-r-1===1?Bq[h.charCodeAt(r)-48]:h.slice(r,f-1));const ee=e.tight,U=e.tShift[l],Y=e.sCount[l],ue=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=P,e.tight=!0,e.tShift[l]=B-p[l],e.sCount[l]=I,B>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||w)&&(a=!1),w=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ue,e.tShift[l]=U,e.sCount[l]=Y,e.tight=ee,e.push("list_item_close","li",-1).markup=L,l=e.line,W[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let fe=!1;for(let oe=0,Z=N.length;oe<Z;oe++)if(N[oe](e,l,n,!0)){fe=!0;break}if(fe)break;if(u){if(f=qw(e,l),f<0)break;r=p[l]+m[l]}else if(f=Uw(e,l),f<0)break;if(E!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,$[1]=l,e.line=l,e.parentType=F,a&&Dq(e,M),!0}function jw(e){return e===9||e===32}function Hq(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=u6(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(o==="list"&&c[f]>=u){const y=r[f]+l[f],k=a[f];if(y<k){const E=i.charCodeAt(y);if(E===42||E===45||E===43){if(y+1>=k||jw(i.charCodeAt(y+1)))break}else if(E>=48&&E<=57&&y+1<k){let L=y+1;for(;;){if(L>=k){L=-1;break}const $=i.charCodeAt(L++);if($>=48&&$<=57){if(L-y>=10){L=-1;break}continue}if(($===41||$===46)&&(L>=k||jw(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!d6(e,f,i,b,v))continue;let g=!1;for(let y=0,k=s.length;y<k;y++)if(s[y](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function Df(e){switch(e){case 9:case 32:return!0}return!1}function Wq(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let E=!1;if(e.sCount[y]-e.blkIndent>3&&(E=!0),e.sCount[y]<0&&(E=!0),!E){const w=e.parentType;e.parentType="reference";let M=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,y,k,!0)){M=!0;break}if(e.parentType=w,M)return null}const L=e.bMarks[y]+e.tShift[y],$=e.eMarks[y];return e.src.slice(L,$+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const y=c.charCodeAt(o);if(y===91)return!1;if(y===93){u=o;break}else if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(y===92&&(o++,o<i&&c.charCodeAt(o)===10)){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const y=c.charCodeAt(o);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Df(y))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;o=d.pos;const h=o,p=r,m=o;for(;o<i;o++){const y=c.charCodeAt(o);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!Df(y))break}let b=e.md.helpers.parseLinkTitle(c,o,i);for(;b.can_continue;){const y=a(r);if(y===null)break;c+=y,o=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,o,i,b)}let v;for(o<i&&m!==o&&b.ok?(v=b.str,o=b.pos):(v="",o=h,r=p);o<i&&Df(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&v)for(v="",o=h,r=p;o<i&&Df(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=ym(c.slice(1,u));return g?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:v,href:f}),e.line=r),!0):!1}function d0(e){switch(e){case 9:case 32:return!0}return!1}const zq=65536;function f0(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function Uq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Yu.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Vw(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function qq(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!d0(l)||r===45&&d0(l)||!Uq(e,t))return!1;for(;i<e.eMarks[o];){const k=e.src.charCodeAt(i);if(k!==124&&k!==45&&k!==58&&!d0(k))return!1;i++}let a=f0(e,t+1),c=a.split("|");const u=[];for(let k=0;k<c.length;k++){const E=c[k].trim();if(!E){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(E))return!1;E.charCodeAt(E.length-1)===58?u.push(E.charCodeAt(0)===58?"center":"right"):E.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=f0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Vw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k<c.length;k++){const E=e.push("th_open","th",1);u[k]&&(E.attrs=[["style",`text-align:${u[k]}`]]);const L=e.push("inline","",0);L.content=c[k].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let k=!1;for(let L=0,$=h.length;L<$;L++)if(h[L](e,o,n,!0)){k=!0;break}if(k||(a=f0(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=Vw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>zq))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const E=e.push("tr_open","tr",1);E.map=[o,o+1];for(let L=0;L<d;L++){const $=e.push("td_open","td",1);u[L]&&($.attrs=[["style",`text-align:${u[L]}`]]);const w=e.push("inline","",0);w.content=c[L]?c[L].trim():"",w.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=f,e.line=o,!0}var jq=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Oc(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};const Pf=[["table",qq,["paragraph","reference"]],["code",Mq],["fence",Eq,["paragraph","reference","blockquote","list"]],["blockquote",Aq,["paragraph","reference","blockquote","list"]],["hr",Iq,["paragraph","reference","blockquote","list"]],["list",Pq,["paragraph","reference","blockquote"]],["reference",Wq],["html_block",$q,["paragraph","reference","blockquote"]],["heading",Tq,["paragraph","reference","blockquote"]],["lheading",Oq],["paragraph",Hq]];var Vq=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new jq;for(let e=0;e<Pf.length;e++)this.ruler.push(Pf[e][0],Pf[e][1],{alt:(Pf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let m=0;m<o;m++)if(p=s[m](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let m=0;m<o;m++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Oc(e.env,"block",f[m].name,v-b,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,s){if(!e||e.length===0)return;const o=new c6(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},h6=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}};h6.prototype.Token=Ss;const Kw=[["normalize",uq],["block",lU],["inline",tq],["linkify",lq],["replacements",vq],["smartquotes",xq],["text_join",wq]],Kq={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Gq={parseLinkLabel:Gy,parseLinkDestination:Ky,parseLinkTitle:Yy};function Yq(){return{...Kq}}function Zq(){return{...Gq}}var Qq=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Vq,this.inline=new eq,this.ruler=new yq;for(let e=0;e<Kw.length;e++){const[t,n]=Kw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:Yq(),helpers:Zq(),normalizeLink:l6,normalizeLinkText:a6,validateLink:r6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new zA),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 h6(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Oc(e.env,"core",t[n].name,o-s,!0,!1)}XU(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&rU(e))return this.parse(VA(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const Xq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function lp(e){return!Xq.test(e)}function Du(e,t){const n=e.indexOf(`
|
|
98
|
-
`,t);return n===-1?e.length:n}function ph(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9)return!1}return!0}function Gw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function h0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Jq(e){if(e.length>3)return lp(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 ej=["","h1","h2","h3","h4","h5","h6"],tj=["","#","##","###","####","#####","######"],Yw=0,p0=1,m0=2;function Yo(e,t,n,s){const o=new Ss(e,t,n);return o.level=s,o.block=!0,o}function p6(e,t,n){const s=Yo("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new Ss("text","",0);return o.content=e,s.children=[o],s}function nj(e,t,n,s,o){let i=0,r=n;for(;r<s&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=s||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<s&&t.charCodeAt(l)===32;)l++;let a=s;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(!lp(u))return!1;const d=ej[i],f=tj[i],h=Yo("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(p6(u,o,1));const p=Yo("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function sj(e,t,n){const s=Yo("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(p6(t,n,1)),e.push(Yo("paragraph_close","p",-1,0))}function oj(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function g0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function ij(e,t){const n=Yo("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function rj(e,t,n){const s=Yo("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Yo("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Yo("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new Ss("text","",0);r.content=t,i.children=[r],e.push(i);const l=Yo("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Yo("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function lj(e){const t=Yo("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function aj(e,t,n,s){if(!Gw(e,t,n))return null;const o=e.slice(t+3,n);if(o.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=s+1;for(;l<e.length;){const c=Du(e,l);if(Gw(e,l,c)&&ph(e,l+3,c)){const u=Yo("fence","code",0,0);return u.map=[s,a+1],u.markup="```",u.info=o,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 cj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Yw:m0,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Du(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(!ph(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!nj(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=g0(e,h),l+=1+r-h;continue}if(c===45){if(!h0(e,r,a))return null;const h=l;let p=r,m=l,b=null,v=null;for(;p<e.length;){const k=Du(e,p);if(!h0(e,p,k))break;const E=p+2,L=k===E+1?e[E]:e.slice(E,k);if(!Jq(L))return null;b===null&&(b=ij(t,h)),v=rj(t,L,m),p=k<e.length?k+1:k,m++}if(b===null||v===null)return null;let g=p,y=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,y++;continue}const k=Du(e,g);if(!ph(e,g,k)){if(h0(e,g,k))return null;break}g=k<e.length?k+1:k,y++}b.map[1]=y,v.map[1]=y,lj(t),r=g,l=y;continue}if(c===96){const h=aj(e,r,a,l);if(!h)return null;t.push(h.token),r=g0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=oj(e,r,a);let d;if(n===m0?d=lp(u):n===p0&&u===s?d=o:(d=lp(u),n===Yw?(i&&(n=u===s?p0:m0),s=u,o=d,i=!0):n===p0&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!ph(e,f,Du(e,f)))return null;sj(t,u,l),r=g0(e,f),l+=1+r-f}return t}const uj=/[&<>"]/,Zw=/[&<>"]/g,dj=/&/g,fj=/[<>"]/g,hj={"&":"&","<":"<",">":">",'"':"""};function v0(e){return hj[e]||e}function Fn(e){if(e.length===0)return"";if(e.length<32)return uj.test(e)?e.replace(Zw,v0):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(dj,"&"):t?e.replace(Zw,v0):e.replace(fj,v0)}const pj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),mj=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function m6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(pj,(t,n,s)=>{if(n)return n;if(mj.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return km(i)?Ad(i):"�"}const o=Dy(t);return o!==t?o:t})}const gj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,vj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,yj=/"/g;function kc(e,t){const n=e.indexOf(`
|
|
99
|
-
`,t);return n===-1?e.length:n}function ap(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9)return!1}return!0}function Hf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function kj(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!ap(e,t,kc(e,t))}function Qw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function bj(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function Jy(e){return vj.test(e)?gj.test(e)?null:e.replace(yj,"""):e}function xj(e,t,n){let s=0,o=t;for(;o<n&&e.charCodeAt(o)===35&&s<6;)o++,s++;if(s===0||o>=n||e.charCodeAt(o)!==32)return null;let i=o+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=Jy(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
|
|
100
|
-
`}function Xw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function wj(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
101
|
-
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
102
|
-
`}function _j(e,t,n){const s=t+2;if(n===s+1)return wj(e,s);const o=Jy(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
|
|
103
|
-
`}function Sj(e,t,n){for(;t<n;){const o=e.charCodeAt(t);if(o!==32&&o!==9)break;t++}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let s=n;for(let o=t;o<n;o++){const i=e.charCodeAt(o);if(i===96)return null;if(i===32||i===9){s=o;break}}return e.slice(t,s)}function Cj(e,t,n,s){if(!Qw(e,t,n))return null;const o=Sj(e,t+3,n);if(o===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=kc(e,l);if(Qw(e,l,a)&&ap(e,l+3,a)){const c=e.slice(i,r);let u;return o===s.lang?u=s.open:(u=o?`<pre><code class="language-${Fn(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${Fn(c)}</code></pre>
|
|
104
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function Jw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const s=e.length>=25e4,o=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=kc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!ap(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=xj(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=Hf(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const y=kc(e,m);if(!Xw(e,m,y))break;m=y<e.length?y+1:y}if(m===t)return null;const b=e.slice(t,m);let v;if(b===r)v=l;else{let y=t;for(v=`<ul>
|
|
105
|
-
`;y<m;){const k=kc(e,y),E=_j(e,y,k);if(E===null)return null;v+=E,y=k<e.length?k+1:k}v+=`</ul>
|
|
106
|
-
`,r=b,l=v}let g=Hf(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const y=kc(e,g);if(!ap(e,g,y)){if(Xw(e,g,y))return null;break}g=y<e.length?y+1:y}s?o.push(v):n+=v,t=g;continue}if(d===96){const m=Cj(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=Hf(e,m.nextPos);continue}const f=bj(e,t,u);let h;if(f===a)h=c;else{const m=Jy(f);if(m===null)return null;h=`<p>${m}</p>
|
|
107
|
-
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&kj(e,p))return null;s?o.push(h):n+=h,t=Hf(e,p)}return s?o.join(""):n}const Aj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function cp(e,t,n={},s){fo(n);const o={...Aj,...s||{}},i=$o(t);if(o.fallbackOnGlobalState!==!1&&i)return u0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Fc(n,i,()=>e.core.parse(t,n,e).tokens);let r=mh(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Nj(r,o.maxChunks)),gh(t,r))return u0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Fc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return u0(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Fc(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&&Ej(f,l),Tj(a,f),l+=u.lineCount}return a})}function mh(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(s.push({start:r,end:f,lineCount:l}),r=f,o=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
108
|
-
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=Ij(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const k=e.charCodeAt(g);if(k===32||k===9)g++;else break}const y=e[g];if(y==="`"||y==="~"){let k=g;for(;k<h&&e[k]===y;)k++;const E=k-g;E>=3&&(u?u.marker===y&&E>=u.length&&(u=null):u={marker:y,length:E})}}const b=p-f;o+=b,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=b);const v=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=g||c>=y)&&d(p)}f=p}return n&&d(e.length),s}function gh(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!Mj(e,t[o].end))return!0;return!1}function Mj(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function Ej(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function Tj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Nj(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function Ij(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const g6=4e6,v6=8e4,$j=1e4,Lj=200,Fj=1e4,Oj=200;function y6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Rj(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function nl(e){return e.length===0?0:ls(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Bj(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function Dj(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
109
|
-
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function Pj(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 Bj(e,n+1,e.length-1)?!Dj(e,t):!1}function Hj(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??Fj:e.options.fullChunkSizeChars??$j),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Oj:e.options.fullChunkSizeLines??Lj);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var qd=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=nl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=mh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(gh(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,nl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Pj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,nl(this.pending)),null;const n=mh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,nl(this.pending)),null;const s=gh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:nl(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=mh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=gh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:nl(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:nl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+nl(this.pending);return Hj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Ud(e)&&Pr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=$o(t);n&&(jy(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&Rj(r,a),this.options.retainTokens!==!1&&y6(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&Vy(t),n}catch(s){throw this.markedGlobalStateReason&&(Pr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){PA(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 Wj(e,t,n={},s={}){fo(n);const o=new qd(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function zj(e,t,n={},s={}){fo(n);const o=new qd(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function Uj(e,t,n,s={},o={}){fo(s);const i=new qd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function qj(e,t,n,s={},o={}){fo(s);const i=new qd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function k6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??g6,o=e.options.autoUnboundedThresholdLines??v6;return t>=s||n>=o}function b6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??g6))return"yes";const s=e.options.autoUnboundedThresholdLines??v6;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Zu(e,t,n={},s={}){fo(n);const o=$o(t);if(Ud(n)&&Pr(n),s.fallbackOnGlobalState!==!1&&o)return PA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:ls(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Fc(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new qd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){y6(i,l)}});if(o&&jy(n,o),r.feed(t),r.flushForce(n),o&&(Vy(n),s.fallbackOnGlobalState===!1)){const l=br(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Rc=(e,t,n)=>e<t?t:e>n?n:e;function x6(e){return e.experimental?{...e,...e.experimental}:e}const e_=[{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"}],t_=[{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 w6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function jj(e,t=Math.max(0,e/40|0),n={}){const s=x6(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<e_.length;l++){const a=e_[l];if(e<=a.max){if(a.strategy!=="adaptive")return w6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Rc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Rc(Math.ceil(t/i),150,700),maxChunks:Rc(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function n_(e,t=Math.max(0,e/40|0),n={}){const s=x6(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<t_.length;l++){const a=t_[l];if(e<=a.max){if(a.strategy!=="adaptive")return w6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Rc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Rc(Math.ceil(t/i),150,700),maxChunks:Rc(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var Vj={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"]}}},Kj={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Gj={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 _m(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function vh(e,t){if(_m(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const s_=e=>_m(e)?e:Promise.resolve(e);function Qu(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Fn(e)}}function Il(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Qu(t[0])}="${Fn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Qu(o[0])}="${Fn(o[1])}"`}return n}function _6(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Xu(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
110
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Fn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
111
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Il(r)}>${t}</code></pre>
|
|
112
|
-
`}return`<pre><code${Il(e.attrs)}>${t}</code></pre>
|
|
113
|
-
`}function up(e){return!e.attrs||e.attrs.length===0?`<code>${Fn(e.content)}</code>`:`<code${Il(e.attrs)}>${Fn(e.content)}</code>`}function rv(e){const t=Fn(e.content);return e.attrs?`<pre${Il(e.attrs)}><code>${t}</code></pre>
|
|
114
|
-
`:`<pre><code>${t}</code></pre>
|
|
115
|
-
`}function Yj(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="${Fn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Fn(n[0][1])}">`}return null}function o_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Qu(t[0][0])}="${Fn(t[0][1])}">`:t.length===2?`<a ${Qu(t[0][0])}="${Fn(t[0][1])}" ${Qu(t[1][0])}="${Fn(t[1][1])}">`:`<a${Il(t)}>`}function Zj(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 i_(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 dp(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+Il(n);return s===0&&t&&(i+=" /"),`${i}>`}const Qj={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Wf=Object.prototype.hasOwnProperty,In={code_inline(e,t){return up(e[t])},code_block(e,t){return rv(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?m6(i.info).trim():"",{langName:l,langAttrs:a}=_6(r),c=n.highlight,u=Fn(i.content);if(!c)return Xu(i,u,r,l,n);const d=c(i.content,l,a);return _m(d)?d.then(f=>Xu(i,f||u,r,l,n)):Xu(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],dp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
116
|
-
`:`<br>
|
|
117
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
118
|
-
`:`<br>
|
|
119
|
-
`:`
|
|
120
|
-
`},text(e,t){return Fn(e[t].content)},text_special(e,t){return Fn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function r_(e,t,n){const s=e.info?m6(e.info).trim():"",{langName:o,langAttrs:i}=_6(s),r=t.highlight,l=Fn(e.content);if(!r)return Xu(e,l,s,o,t);const a=r(e.content,o,i);if(_m(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Xu(e,a||l,s,o,t)}function zf(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===In.text)return l.content.length===0?"":Fn(l.content);break;case"text_special":if(o.text_special===In.text_special)return l.content.length===0?"":Fn(l.content);break;case"softbreak":if(o.softbreak===In.softbreak)return r;break;case"hardbreak":if(o.hardbreak===In.hardbreak)return i;break;case"html_inline":if(o.html_inline===In.html_inline)return l.content;break;case"code_inline":if(o.code_inline===In.code_inline)return up(l);break}const a=o[l.type];if(!a)return dp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:vh(c,l.type)}var Xj=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...In}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,b="";for(let v=0;v<e.length;v++){const g=e[v],y=g.type,k=v>0&&e[v-1].hidden?`
|
|
121
|
-
`:"";if(y==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&v+3<e.length){const $=e[v+1],w=e[v+2],M=e[v+3];if($.type==="paragraph_open"&&$.hidden&&w.type==="inline"&&M.type==="paragraph_close"&&M.hidden){b+=`${k}<li>${this.renderInlineTokens(w.children||[],s,o)}`,v+=3;continue}}if(v+2<e.length){const $=e[v+1],w=e[v+2];if($.type==="inline"&&w.nesting===-1&&w.tag===g.tag&&!w.hidden){const M=Yj(g,k);if(M!==null){b+=`${M+this.renderInlineTokens($.children||[],s,o)}</${g.tag}>
|
|
122
|
-
`,v+=2;continue}}}if(y==="inline"){const $=g.children||[];if($.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
123
|
-
`:`<br>
|
|
124
|
-
`,p=s.breaks?h:`
|
|
125
|
-
`,m=!0);const w=$[0];switch(w.type){case"text":if(l===In.text){b+=Fn(w.content);continue}break;case"text_special":if(a===In.text_special){b+=Fn(w.content);continue}break;case"softbreak":if(c===In.softbreak){b+=p;continue}break;case"hardbreak":if(u===In.hardbreak){b+=h;continue}break;case"html_inline":if(d===In.html_inline){b+=w.content;continue}break;case"code_inline":if(f===In.code_inline){b+=up(w);continue}break}}b+=this.renderInlineTokens($,s,o);continue}const E=i[y];if(!E){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(y){case"hr":b+=r?`<hr />
|
|
126
|
-
`:`<hr>
|
|
127
|
-
`;continue;case"heading_open":b+=`<${g.tag}>`;continue;case"heading_close":b+=`</${g.tag}>
|
|
128
|
-
`;continue;case"paragraph_open":b+=`${k}<p>`;continue;case"paragraph_close":b+=`</p>
|
|
129
|
-
`;continue;case"list_item_open":{const w=e[v+1];b+=k+(w&&(w.type==="inline"||w.hidden||w.nesting===-1&&w.tag==="li")?"<li>":`<li>
|
|
130
|
-
`);continue}case"list_item_close":b+=`</li>
|
|
131
|
-
`;continue;case"bullet_list_open":b+=`${k}<ul>
|
|
132
|
-
`;continue;case"bullet_list_close":b+=`</ul>
|
|
133
|
-
`;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
134
|
-
`);continue;case"blockquote_close":b+=`</blockquote>
|
|
135
|
-
`;continue;case"ordered_list_open":b+=`${k}<ol>
|
|
136
|
-
`;continue;case"ordered_list_close":b+=`</ol>
|
|
137
|
-
`;continue;case"table_open":b+=`${k}<table>
|
|
138
|
-
`;continue;case"table_close":b+=`</table>
|
|
139
|
-
`;continue;case"thead_open":b+=`${k}<thead>
|
|
140
|
-
`;continue;case"thead_close":b+=`</thead>
|
|
141
|
-
`;continue;case"tbody_open":b+=`${k}<tbody>
|
|
142
|
-
`;continue;case"tbody_close":b+=`</tbody>
|
|
143
|
-
`;continue;case"tr_open":b+=`${k}<tr>
|
|
144
|
-
`;continue;case"tr_close":b+=`</tr>
|
|
145
|
-
`;continue;case"td_open":b+=`${k}<td>`;continue;case"td_close":b+=`</td>
|
|
146
|
-
`;continue;case"th_open":b+=`${k}<th>`;continue;case"th_close":b+=`</th>
|
|
147
|
-
`;continue}else if($.length===1){const w=$[0];if(y==="ordered_list_open"&&w[0]==="start"){b+=`${k}<ol start="${Fn(w[1])}">
|
|
148
|
-
`;continue}if(y==="td_open"&&w[0]==="style"){b+=`${k}<td style="${Fn(w[1])}">`;continue}if(y==="th_open"&&w[0]==="style"){b+=`${k}<th style="${Fn(w[1])}">`;continue}}}b+=this.renderToken(e,v,s);continue}if(y==="code_block"&&E===In.code_block){b+=rv(g);continue}if(y==="fence"&&E===In.fence){b+=r_(g,s);continue}if(y==="html_block"&&E===In.html_block){b+=g.content;continue}const L=E(e,v,s,o,this);typeof L=="string"?b+=L:b+=vh(L,g.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await s_(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return Il(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
149
|
-
`:"",u=a?`>
|
|
150
|
-
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+Il(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(Wf.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),Wf.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(Wf.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(Wf.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Qj,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===In.code_block)return rv(t);if(i==="html_block"&&o.html_block===In.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):dp(t,r.xhtmlOut===!0);if(i==="fence"&&a===In.fence)return r_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:vh(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,f=s.em_open,h=s.em_close,p=s.strong_open,m=s.strong_close,b=t.xhtmlOut===!0,v=b?`<br />
|
|
151
|
-
`:`<br>
|
|
152
|
-
`,g=t.breaks?v:`
|
|
153
|
-
`;if(e.length===1)return zf(e,t,n,this,s,v,g);let y="";for(let k=0;k<e.length;k++){const E=e[k];if(E.type==="link_open"&&!u&&!d&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="link_close"&&Zj(w)){const M=`${o_(E)+zf([w],t,n,this,s,v,g)}</a>`;if(r===In.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){y+=M+g,k+=3;continue}y+=M,k+=2;continue}}if(E.type==="link_open"&&!u&&!d&&k+1<e.length&&e[k+1].type==="link_close"){y+=`${o_(E)}</a>`,k+=1;continue}if(E.type==="em_open"&&!f&&!h&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="em_close"&&i_(w)){y+=`<em>${zf([w],t,n,this,s,v,g)}</em>`,k+=2;continue}}if(E.type==="strong_open"&&!p&&!m&&k+2<e.length){const w=e[k+1];if(e[k+2].type==="strong_close"&&i_(w)){y+=`<strong>${zf([w],t,n,this,s,v,g)}</strong>`,k+=2;continue}}switch(E.type){case"text":if(o===In.text){const w=E.content.length===0?"":Fn(E.content);if(a===In.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(y+=w+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}y+=w;continue}break;case"text_special":if(i===In.text_special){E.content.length!==0&&(y+=Fn(E.content));continue}break;case"softbreak":if(r===In.softbreak){y+=g;continue}break;case"hardbreak":if(l===In.hardbreak){y+=v;continue}break;case"html_inline":if(a===In.html_inline){for(y+=E.content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}break;case"code_inline":if(c===In.code_inline){y+=up(E);continue}break}const L=s[E.type];if(!L){y+=E.block?this.renderToken(e,k,t):dp(E,b);continue}const $=L(e,k,t,n,this);typeof $=="string"?y+=$:y+=vh($,E.type)}return y}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await s_(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
154
|
-
`;break}}return s}},Jj=Xj;const eV=[],y0=4096;function tV(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
|
|
155
|
-
`,n);s===-1&&(s=t);const o=s<t;let i=n,r=0;for(;i<s;){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<s){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<s&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<s){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===s&&o)return!0}break}case 62:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 96:case 126:{let a=i;for(;a<s&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<s;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<s&&e.charCodeAt(a)===46){const c=a+1;if(c<s){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===s&&o)return!0}}break}}if(s===t)break;n=s+1}return!1}function nV(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 sV(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(!S6(e[n],t[n]))return!1;return!0}function S6(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,s=t.map;return!!n!=!!s||n&&s&&(n[0]!==s[0]||n[1]!==s[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||!nV(e.attrs,t.attrs)||!sV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function l_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var oV=class{core;cache=null;stats=l_();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=l_(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(fo(s??o?.env),!o||s&&s!==o.env){const I=s??{},B=!!n.__explicitStreamChunkFallbackSetting,R=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,P=!!n.options?.streamChunkedFallback,z=!B&&R,W=P||z,ee=n.options?.streamChunkAdaptive!==!1,U=n.options?.streamChunkTargetChunks??8,Y=n.options?.streamChunkSizeChars,ue=n.options?.streamChunkSizeLines,fe=n.options?.streamChunkMaxChunks,oe=!!n.__explicitStreamChunkConfig,Z=n.options?.autoTuneChunks!==!1,te=n.options?.streamChunkFenceAware??!0,ae=n.options?.streamLargeCachePolicy??"retain",He=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,he=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let K,ce=!1;if(ae==="skip"&&(ce=e.length>=He,!ce&&he!==void 0&&(K=ls(e),ce=K>=he)),ce){const q=this.parseFullDocument(e,I,n,K,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",xs(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!br(I)?.unbounded}),q.tokens}else if(W){const q=(ve,Ae,$e)=>ve<Ae?Ae:ve>$e?$e:ve;K===void 0&&(K=ls(e));const se=Z&&!oe?n_(e.length,K,n.options):null,ye=se?.maxChunkChars??(ee?q(Math.ceil(e.length/U),8e3,64e3):Y??1e4),de=se?.maxChunkLines??(ee?q(Math.ceil(K/U),150,700):ue??200),ke=se?.maxChunks??(ee?q(Math.ceil(e.length/64e3),U,32):fe),j=e.length>0&&e.charCodeAt(e.length-1)===10,ne=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&se?.strategy!=="plain";if((P||ne)&&(e.length>=ye*2||K>=de*2)&&j){const ve=cp(n,e,I,{maxChunkChars:ye,maxChunkLines:de,fenceAware:se?.fenceAware??te,maxChunks:ke});return this.cache={src:e,tokens:ve,env:I,lineCount:K,lastSegment:void 0,globalStateReason:$o(e)},this.updateCacheLineCount(this.cache,K),this.recordChunkedParseResult(I,P?"explicit-initial-large-doc":"default-initial-large-doc"),ve}}const ge=this.parseFullDocument(e,I,n,K);return K=ge.lineCount,this.cache={src:e,tokens:ge.tokens,env:I,lineCount:K,lastSegment:void 0,globalStateReason:$o(e)},this.updateCacheLineCount(this.cache,K),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",xs(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!br(I)?.unbounded}),ge.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",xs(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const i=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=$o(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):$o(e),a=r||l;if(a){const I=s??o.env;Pr(I);const B=$o(e),R=this.parseFullDocument(e,I,n),P=R.tokens,z=R.lineCount;return this.cache={src:e,tokens:P,env:I,lineCount:z,lastSegment:void 0,globalStateReason:B},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",xs(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!br(I)?.unbounded}),P}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<c&&e.length<c*1.5&&!e.startsWith(o.src)){const I=s??o.env,B=this.parseFullDocument(e,I,n),R=B.tokens,P=B.lineCount;return this.cache={src:e,tokens:R,env:I,lineCount:P,lastSegment:void 0,globalStateReason:$o(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",xs(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!br(I)?.unbounded}),R}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const I=o.lineCount??ls(o.src);let B=3;u.length>5e3?B=8:u.length>1e3?B=6:u.length>200&&(B=4),B=Math.min(B,I);let R=null;const P=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,W=n.options?.streamContextParseMinLines??2;let ee;const U=()=>(ee===void 0&&(ee=ls(u)),ee),Y=this.canDirectlyParseAppend(o),ue=Y&&this.shouldUseUnboundedAppend(e,o,u);let fe=!1;if(!Y)switch(P){case"lines":fe=U()>=W;break;case"constructs":if(u.length>=z){fe=!0;break}if(tV(u)){fe=!0;break}fe=U()>=W;break;case"chars":default:fe=u.length>=z}if(B>0&&fe){const te=this.getTailLines(o.src,B)+u;try{const ae=this.core.parse(te,o.env,n).tokens,He=ae.findIndex(he=>he.map&&typeof he.map[1]=="number"&&he.map[1]>B);if(He!==-1){const he=ae.slice(He),K=I-B;K!==0&&this.shiftTokenLines(he,K),R={tokens:he}}}catch{R=null}}else R=null;if(!R){const te=I;if(ue)R={tokens:Zu(n,u,o.env,{mode:"stream"})},te>0&&this.shiftTokenLines(R.tokens,te);else{const ae=this.core.parse(u,o.env,n);te>0&&this.shiftTokenLines(ae.tokens,te),R=ae}}let oe=0;if(o.tokens.length>0&&R.tokens.length>0){const te=o.tokens[o.tokens.length-1],ae=R.tokens[0];try{te.type==="inline"&&ae.type==="inline"&&(ae.children&&ae.children.length>0&&(te.children||(te.children=[]),this.appendTokens(te.children,ae.children)),te.content=(te.content||"")+(ae.content||""),oe=1)}catch{oe=0}}const Z=o.tokens.length;if(R.tokens.length>oe){const te=o.tokens,ae=R.tokens,He=Math.min(te.length,ae.length-oe);let he=0;for(let K=He;K>0;K--){let ce=!0;for(let ge=0;ge<K;ge++){const q=te[te.length-K+ge],se=ae[oe+ge];if(!S6(q,se)){ce=!1;break}}if(ce){he=K;break}}he>0&&(oe+=he),ae.length>oe&&this.appendTokens(o.tokens,ae,oe)}if(o.src=e,o.globalStateReason=null,o.lineCount=I+(ee??U()),o.tokens.length>Z){const te=this.getLastSegment(o.tokens,e,Z,o.tokens.length,e.length-u.length,I);te?o.lastSegment=te:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ue&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",xs(o.env,{area:"stream",path:ue?"stream-unbounded-append":"stream-append",reason:ue?"large-delta":"safe-append",unbounded:ue}),o.tokens}const d=s??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",xs(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=m||b,g=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,E=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,w=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let N=u&&o.lineCount!==void 0?o.lineCount+ls(u):void 0;if(v){N===void 0&&(N=ls(e));const I=(U,Y,ue)=>U<Y?Y:U>ue?ue:U,B=w&&!$?n_(e.length,N,n.options):null,R=B?.maxChunkChars??(g?I(Math.ceil(e.length/y),8e3,64e3):k??1e4),P=B?.maxChunkLines??(g?I(Math.ceil(N/y),150,700):E??200),z=B?.maxChunks??(g?I(Math.ceil(e.length/64e3),y,32):L),W=e.length>0&&e.charCodeAt(e.length-1)===10,ee=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&B?.strategy!=="plain";if((m||ee)&&(e.length>=R*2||N>=P*2)&&W){const U=cp(n,e,d,{maxChunkChars:R,maxChunkLines:P,fenceAware:B?.fenceAware??M,maxChunks:z});return this.cache={src:e,tokens:U,env:d,lineCount:N,lastSegment:void 0,globalStateReason:$o(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),U}}const F=this.parseFullDocument(e,d,n,N),S=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:N,lastSegment:void 0,globalStateReason:$o(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",xs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!br(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=br(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",xs(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!br(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",xs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=$o(e);Ud(t)&&Pr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?b6(n,e.length,s):"no";if(r==="yes"){const a=Zu(n,e,t);return xs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?ls(e):0)}}let l=s;if(r==="need-lines"&&(l=ls(e),k6(n,e.length,l))){const a=Zu(n,e,t);return xs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?ls(e):0),{tokens:Fc(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:ls(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
156
|
-
`))return null;const s=n??t.slice(e.length);if(!s)return null;const o=s.length;if(s.charCodeAt(o-1)!==10)return null;let i=0,r=-1;for(let a=0;a<o&&!(s.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?s:s.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
157
|
-
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(s)?null:s}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=o.lineStart+ls(l),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
158
|
-
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??eV}getStats(){return{...this.stats}}appendTokens(e,t,n=0,s=t.length){for(let o=n;o<s;o++)e.push(t[o])}updateCacheLineCount(e,t){e.lineCount=t??ls(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-y0))+t,s=$o(n);return e.globalStateCarry=n.length>y0?n.slice(n.length-y0):n,s&&(e.globalStateReason=s),s}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,s=e.length,o,i){if(s<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=s-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:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,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:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}}return null}getLineStartOffset(e,t,n,s){if(n!==void 0&&s!==void 0&&t>=s)return this.getLineStartOffsetFrom(e,n,t-s);if(t<=0)return 0;let o=t,i=-1;for(;o>0;){if(i=e.indexOf(`
|
|
159
|
-
`,i+1),i===-1)return e.length;o--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let s=n,o=t-1;for(;s>0;){if(o=e.indexOf(`
|
|
160
|
-
`,o+1),o===-1)return e.length;s--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??ls(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+ls(i);t.lineCount=m;const b=this.getDocLineCount(e,m);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:b,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const m=o.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??ls(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=v+ls(i);t.lineCount=g;const y=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
161
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
162
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e,t=ls(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 s=0;s<e.length;s++){const o=e[s];if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children){n??=[];for(let i=o.children.length-1;i>=0;i--)n.push(o.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 a_={default:Kj,zero:Gj,commonmark:Vj};function iV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function rV(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 c_(e){return e.experimental?{...e,...e.experimental}:e}function hi(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 u_(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(hi(t,o)||hi(e,o))return!0}return!1}function d_(e,t,n){return hi(t,n)||hi(e,n)}function f_(e,t){const n=br(e)?.chunk;if(n?.fallback){xs(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}xs(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function lV(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},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=a_[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=c_(n),typeof n.quotes=="string"){const w=n.quotes;w.length>=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=u_(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=u_(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=d_(i?.options,o,"fullChunkedFallback"),c=d_(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new Qq;let p=null;const m=()=>(p||(p=new Jj(n)),p);let b=null;const v=()=>(b||(b=new oV(h)),b);let g=null;const y=()=>(g||(g=new zA),g),k=w=>!u&&!!d&&!rV(w,d),E=(w,M)=>s==="default"&&!u&&p===null&&f!==null&&w.parse===f&&k(w)&&!w.stream.enabled&&M<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.xhtmlOut===!1&&w.options.breaks===!1&&w.options.langPrefix==="language-"&&w.options.linkify===!1&&w.options.typographer===!1&&w.options.highlight===null,L=(w,M)=>s==="default"&&!u&&k(w)&&!w.stream.enabled&&!w.options.fullChunkedFallback&&M<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.linkify===!1&&w.options.typographer===!1,$={core:h,block:h.block,inline:h.inline,get linkify(){const w=y();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=m();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(w){const M=c_(w);return this.options={...this.options,...M},(hi(w,"fullChunkSizeChars")||hi(w,"fullChunkSizeLines")||hi(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(hi(w,"streamChunkSizeChars")||hi(w,"streamChunkSizeLines")||hi(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),hi(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),hi(w,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,b&&(b.reset(),b.resetStats())),this},configure(w){const M=typeof w=="string"?a_[w]:w;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const N=M.components;N.core?.rules&&this.core.ruler.enableOnly(N.core.rules),N.block?.rules&&this.block.ruler.enableOnly(N.block.rules),N.inline?.rules&&this.inline.ruler.enableOnly(N.inline.rules),N.inline2?.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(w,M){const N=Array.isArray(w)?w:[w],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const B=I.enable(N,!0);for(let R=0;R<B.length;R++)S.add(B[R])}if(!M){const I=N.filter(B=>!S.has(B));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(w,M){const N=Array.isArray(w)?w:[w],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const B=I.disable(N,!0);for(let R=0;R<B.length;R++)S.add(B[R])}if(!M){const I=N.filter(B=>!S.has(B));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(w,...M){const N=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...M],S=w;return u=!0,N.apply(S,F),this},render(w,M){if(E(this,w.length)){M!==void 0&&fo(M);const S=Jw(w);if(S!==null)return M!==void 0&&xs(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=M??{},F=this.parse(w,N);return m().render(F,this.options,N)},async renderAsync(w,M){if(E(this,w.length)){M!==void 0&&fo(M);const S=Jw(w);if(S!==null)return M!==void 0&&xs(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=M??{},F=this.parse(w,N);return m().renderAsync(F,this.options,N)},renderIterable(w,M={}){const N=this.parseIterable(w,M);return m().render(N,this.options,M)},async renderAsyncIterable(w,M={}){const N=await this.parseAsyncIterable(w,M);return m().renderAsync(N,this.options,M)},renderInline(w,M={}){const N=this.parseInline(w,M);return m().render(N,this.options,M)},validateLink:r6,normalizeLink:l6,normalizeLinkText:a6,utils:vz,helpers:{...iU},parse(w,M){if(typeof w!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&fo(M),L(this,w.length)){const I=cj(w);if(I!==null)return M!==void 0&&xs(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const N=M??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const I=b6(this,w.length);if(I==="yes"){const B=Zu(this,w,N);return xs(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),B}I==="need-lines"&&(F=ls(w))}if(!this.stream.enabled){const I=w.length,B=this.options.autoTuneChunks!==!1,R=r,P=!a&&k(this),z=!!this.options.fullChunkedFallback,W=P&&I>=2e5;let ee;(z||W||F!==void 0)&&(ee=F??ls(w));const U=(z||W)&&B&&!R?jj(I,ee,this.options):null;if(z||W){const Y=ee??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||Y>=(this.options.fullChunkThresholdLines??400):W){if(U&&U.strategy!=="plain"){const ue=cp(this,w,N,{maxChunkChars:U.maxChunkChars,maxChunkLines:U.maxChunkLines,fenceAware:U.fenceAware,maxChunks:U.maxChunks});return M&&f_(M,z?"explicit-full-chunk":"default-large-string"),ue}if(z){const ue=(ce,ge,q)=>ce<ge?ge:ce>q?q:ce,fe=this.options.fullChunkAdaptive!==!1,oe=this.options.fullChunkTargetChunks??8,Z=ue(Math.ceil(I/oe),8e3,64e3),te=ue(Math.ceil(Y/oe),150,700),ae=fe?Z:this.options.fullChunkSizeChars??1e4,He=fe?te:this.options.fullChunkSizeLines??200,he=fe?ue(Math.ceil(I/64e3),oe,32):this.options.fullChunkMaxChunks,K=cp(this,w,N,{maxChunkChars:ae,maxChunkLines:He,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:he});return M&&f_(M,"explicit-full-chunk"),K}}}if(F!==void 0&&k(this)&&k6(this,I,ee??F)){const Y=Zu(this,w,N);return xs(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Y}}const S=$o(w);return xs(M,{area:"parse",path:"plain",reason:"default-plain"}),Fc(N,S,()=>h.parse(w,N,this).tokens)},parseIterable(w,M={}){return fo(M),Wj(this,w,M)},parseAsyncIterable(w,M={}){return fo(M),zj(this,w,M)},parseIterableToSink(w,M,N={}){return fo(N),Uj(this,w,M,N)},parseAsyncIterableToSink(w,M,N={}){return fo(N),qj(this,w,M,N)},parseInline(w,M={}){if(typeof w!="string")throw new TypeError("Input data should be a String");fo(M),Ud(M)&&Pr(M);const N=h.createState(w,M,this);return N.inlineMode=!0,h.process(N),N.tokens}};if($.stream={enabled:!!n.stream,parse(w,M){return $.stream.enabled?v().parse(w,M,$):$.parse(w,M??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const w=i.components;w.core?.rules&&$.core.ruler.enableOnly(w.core.rules),w.block?.rules&&$.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&$.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&$.inline.ruler2.enableOnly(w.inline2.rules)}return d=iV($),f=$.parse,$}var aV=lV;const C6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],cV=["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"],A6=["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"],uV=["svg","g","path"],dV=["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"],fV=["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"],hV=["action","data","href","src","srcset","poster","xlink:href","formaction"],pV=["script"],mV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Fa=new Set(C6),gV=new Set(A6),Ed=new Set([...C6,...cV,...A6,...uV]),M6=new Set([...Ed,...dV]),vV=new Set(fV),yV=new Set(hV),jd=new Set(pV),E6=new Set(mV);function T6(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const kV={amp:"&",bsol:"\\",colon:":",newline:`
|
|
163
|
-
`,sol:"/",tab:" "};function N6(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return kV[String(o??"").toLowerCase()]??t})}const Uf=new Set(["http","https","mailto","tel"]),bV=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),ta=new Set(["http","https"]);function I6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function xV(e,t,n){if(!Ju(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function Ju(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function wV(e,t){return t==="href"||t==="xlink:href"?Ju(e,t)?Uf:ta:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ta:(Ju(e,t),Uf)}function ba(e,t={}){const n=T6(N6(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=I6(n);return i?i==="file"?!xV(n,s,o):Ju(s,o)?bV.has(i):!wV(s,o).has(i):!1}function _V(e){const t=N6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=I6(T6(t).toLowerCase());return n==="http"||n==="https"}function SV(e,t={}){const n=String(e??"").trim();return n?ba(n,t)?"":n:""}function h_(e){return SV(e,{tagName:"img",attrName:"src"})}function CV(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,m,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,h,p,m){let b,v=!1,g=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(b=g+1;b<=y&&r[(b-g)%a]===f.src[b];b++);const k=Math.floor((b-g)/a);if(k<i)return!1;b-=(b-g)%a;const E=f.src.slice(g,b),L=f.src.slice(b,y);if(!c(L,E))return!1;if(m)return!0;let $=h;for(;$++,!($>=p||(g=f.bMarks[$]+f.tShift[$],y=f.eMarks[$],g<y&&f.sCount[$]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[$]-f.blkIndent>=4)){for(b=g+1;b<=y&&r[(b-g)%a]===f.src[b];b++);if(!(Math.floor((b-g)/a)<k)&&(b-=(b-g)%a,b=f.skipSpaces(b),!(b<y))){v=!0;break}}const w=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=$;const N=f.push("container_"+t+"_open","div",1);N.markup=E,N.block=!0,N.info=L,N.map=[h,$],f.md.block.tokenize(f,h+1,$);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,b),F.block=!0,f.parentType=w,f.lineMax=M,f.line=$+(v?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function AV(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const v=a[b];if(v==="\\"){b++;continue}if(!u&&v==="'"){c=!c;continue}if(!c&&v==='"'){u=!u;continue}if(!c&&!u&&v===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function MV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(CV,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
164
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let E=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?E++:m[$]==="}"&&E--,E===0){L=$+1;break}L>0&&(h=m.slice(0,L))}h||(f=d||void 0)}if(o)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,g=!1;for(;v<=s;){const E=i.bMarks[v]+i.tShift[v],L=i.eMarks[v];if(i.src.slice(E,L).trim()===":::"){g=!0;break}v++}g||(v=s);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!g&&!b},f&&y.attrSet("data-args",f),h)try{const E=JSON.parse(h);for(const[L,$]of Object.entries(E)){const w=$!=null&&typeof $=="object";y.attrSet(`data-${L}`,w?JSON.stringify($):String($))}}catch{const E=AV(h);if(E)for(const[L,$]of Object.entries(E)){const w=$!=null&&typeof $=="object";y.attrSet(`data-${L}`,w?JSON.stringify($):String($))}else y.attrSet("data-attrs",h)}const k=[];for(let E=n+1;E<v;E++){const L=i.bMarks[E]+i.tShift[E],$=i.eMarks[E];k.push(i.src.slice(L,$))}if(k.some(E=>E.trim().length>0)){let E=k.join(`
|
|
165
|
-
`);E.endsWith(`
|
|
166
|
-
`)||(E+=`
|
|
167
|
-
`),E.endsWith(`
|
|
168
|
-
|
|
169
|
-
`)||(E+=`
|
|
170
|
-
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=E);const $=[];i.md.block.parse(E,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Qo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function es(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function Sm(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const EV=/^[a-z][a-z0-9_-]*$/;function p_(e){return EV.test(String(e??"").trim().toLowerCase())}function Ci(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return p_(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":p_(o)?o:""}function tu(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Ci(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function TV(...e){const t=new Set,n=[];for(const s of e)for(const o of tu(s))t.has(o)||(t.add(o),n.push(o));return n}function NV(e){const t=tu(e);return{key:t.join(","),tags:t}}function $6(e){return Ci(e)}function IV(e,t){const n=String(e??""),s=Ci(t);if(!s)return!1;const o=Qo(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function L6(e,t){const n=Ci(t);return!!n&&!Ed.has(n)&&!IV(e,n)}function $V(e,t){const n=String(e??""),s=Ci(t);if(!s)return n;const o=Qo(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const F6=Fa,LV=Ed,O6=new Set(gV);O6.delete("details");const FV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,OV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,lv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,RV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function fp(e){return(e.match(lv)?.[1]??"").toLowerCase()}function ek(e){return/^\s*<\s*\//.test(e)}function tk(e,t){return F6.has(t)||/\/\s*>\s*$/.test(e)}function BV(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=fp(i);if(r===t){if(ek(i)){if(n===0)return s;n--;continue}tk(i,r)||n++}}return-1}function DV(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=fp(o);if(i===t){if(ek(o)){n>0&&n--;continue}tk(o,i)||n++}}return n}function m_(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Qo(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function PV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Qo(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function hp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function HV(e){const t=e;return t.meta||(t.meta={}),t.meta}function k0(e,t,n){const s=HV(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function WV(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Qo(h)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!s.length))for(const p of s)p.raw+=h,p.inner+=h},l=()=>{!s.length||!o||(r(`
|
|
171
|
-
`),o=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<s.length;m++)s[m].raw+=h,m<s.length-1&&(s[m].inner+=h);const p=s.pop();k0(p.token,p.raw,p.inner)},u=h=>{const p=s[s.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Qo(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const b=m??(h.type==="html_inline"?fp(p):"");if(!(b&&t.has(b))){r(p);return}const v=ek(p),g=!v&&tk(p,b);if(v){if(!s.length||s[s.length-1].tag!==b){r(p);return}c(p);return}if(r(p),g){k0(h,p,"");return}s.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?o=!1:l(),!s.length&&!i(p)){o=!1;continue}let m=0,b=!0;for(const v of h.children){const g=hp(v),y=v.type==="html_inline"?fp(g):"",k=y&&t.has(y);let E=g;if(b&&p&&g&&(s.length||k)){const L=p.indexOf(g,m);if(L!==-1)a(p.slice(m,L)),E=p.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!k)continue;b=!1}}f(v,E,y)}b&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=hp(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
|
|
172
|
-
`:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)k0(h.token,h.raw,h.inner)}function zV(e){return/^\s*<\s*[!?]/.test(e)}function UV(e){const t=new Set(LV);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function g_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function qV(e,t){let n=null;for(const i of e.matchAll(FV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();g_(l,t)&&es(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(OV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();g_(l,t)&&es(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function jV(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function VV(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(jV(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(lv);if(!h){i("<",c),u=d+1;continue}const p=es(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?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=qV(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=hp(a),o=s.buffer;const c=es(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=hp(a),u=(c.match(lv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&es(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const KV=["a","span","strong","em","b","i","u"];function GV(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Ci(f);h&&n.add(h)}const s=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of m){const k=Ci(String(y??""));k&&p.add(k)}const b=UV(Array.from(p)),v=new Set(KV);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||O6.has(y)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const b={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=s(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const g=String(v.content??""),y=v.children.length?v.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(y)try{const k=VV(y,p);if(v.children=k.children,k.pendingBuffer){const E=g.lastIndexOf(k.pendingBuffer);if(E!==-1){const L=g.slice(0,E);v.content=L,typeof v.raw=="string"&&(v.raw=L)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}WV(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:b}=s(f),v=[];for(let g=0;g<h.length;g++){const y=h[g];if(v.length>0){const[E,L]=v[v.length-1];if(g!==L){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(g,1),g--;continue}const $=String(y.content??y.raw??"");if($){const w=h[L],M=`${String(w.content||"")}
|
|
173
|
-
${$}`,N=es(M),F=N===-1?null:m_(M,E,N+1);if(F){const S=M.slice(0,F.end),I=M.slice(F.end);w.content=S,w.loading=!1,h.splice(g,1),v.pop();const B=d(w,I)?[]:c(I,u(h,g,"paragraph"));B.length&&h.splice(g,0,...B),g--;continue}w.content=M,w.loading!==!1&&(w.loading=!0)}h.splice(g,1),g--;continue}}const k=o(y);if(k){if(zV(k))continue;const E=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(k);if(!E||!b(E))continue;if(i(y,k),!L)E&&!new RegExp(`^\\s*<\\s*${E}\\b[^>]*\\/\\s*>`,"i").test(k)&&PV(k,E)>0&&v.push([E,g]);else if(v.length>0&&E&&v[v.length-1][0]===E){const[,$]=v[v.length-1],w=h[$];w.content=`${String(w.content||"")}
|
|
174
|
-
${k}`,w.loading=!1,v.pop(),h.splice(g,1),g--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(g,1),g--;continue}const E=y.content||"",L=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(E);if(E){const[,$]=v[v.length-1],w=h[$];w.content=`${w.content||""}
|
|
175
|
-
${E}`,w.loading!==!1&&(w.loading=!L)}L&&v.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,y=new Map,k=$=>{let w=g.get($);return w||(w=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,w)),w},E=$=>{let w=y.get($);return w||(w=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),y.set($,w)),w},L=[];for(let $=0;$<h.length;$++){const w=h[$],M=String(w.content??"");if(L.length>0){const F=L[L.length-1],S=h[F.index],I=w.type==="html_block"?E(F.tag).exec(M):null;if(I){const P=I.index+I[0].length,z=M.slice(0,P),W=M.slice(P);S.content=`${String(S.content??"")}
|
|
176
|
-
${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),L.pop();const ee=d(S,W)?[]:c(W,u(h,$,"paragraph"));ee.length?h.splice($,1,...ee):(h.splice($,1),$--);continue}if(w.type!=="inline")continue;const B=Array.isArray(w.children)?w.children:[],R=BV(B,F.tag);if(R!==-1){const P=B.slice(0,R+1),z=B.slice(R+1),W=P.map(ee=>String(ee?.content??ee?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
177
|
-
${W}`,Array.isArray(S.children)&&S.children.push(...P),z.length){const ee=z.map(U=>String(U.content??U.raw??"")).join("");if(ee.trim()){const U=ee.replace(/^\s+/,"");if(d(S,ee))h.splice($,1),$--;else if(U.startsWith("<"))h.splice($,1,{type:"html_block",content:U});else{const Y=c(ee,u(h,$,"paragraph"));h.splice($,1,...Y)}}else h.splice($,1),$--}else h.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
|
|
178
|
-
${M}`,Array.isArray(S.children)&&S.children.push(...B),h.splice($,1),$--;continue}if(w.type!=="inline")continue;const N=Array.isArray(w.children)?w.children:[];for(const F of m)if((N.length?DV(N,F):k(F).test(M)&&!E(F).test(M)?1:0)>0){L.push({tag:F,index:$});break}}}{let g=0;for(let y=0;y<h.length;y++){const k=h[y];if(k.type==="paragraph_open"){g++;continue}k.type==="paragraph_close"&&(g>0?g--:(h.splice(y,1),y--))}}for(let g=0;g<h.length;g++){const y=h[g];if(y.type==="html_block"){const w=(y.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(w.startsWith("!")||w.startsWith("?")){y.loading=!1;continue}if(m.has(w)){const R=String(y.content??""),P=es(R),z=P===-1?null:m_(R,w,P+1);y.loading=z?!1:y.loading!==void 0?y.loading:!0;const W=z?.start??-1,ee=z?z.end-z.start:0;if(W!==-1){const U=R.slice(0,W+ee);let Y="";P!==-1&&P<W&&(Y=R.slice(P+1,W)),y.children=[{type:w,content:Y,raw:U,attrs:[],tag:w,loading:!1}],y.content=U,y.raw=U;const ue=c(R.slice(W+ee)||"","text");ue.length&&h.splice(g+1,0,...ue)}else y.children=[{type:w,content:"",raw:R,attrs:[],tag:w,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(w))continue;y.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=M.exec(y.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${w}\\s*>`,"i").exec(F),I=S?S.index:-1,B=S?S[0].length:0;if(I!==-1){const R=F.slice(0,I+B),P=(F.slice(I+B)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:R,tag:w,loading:!1}],y.content=R,y.raw=R,P&&h.splice(g+1,0,P.startsWith("<")?{type:"html_block",content:P}:{type:"text",content:P,raw:P})}else y.children=[{type:"html_block",content:y.content,tag:w,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const w=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=y.children[1],N=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&N===w)continue;p.has(w)?(y.children[0].loading=!0,y.children[0].tag=w,y.children.push({type:"html_inline",tag:w,loading:!0,content:`</${w}>`})):y.children=[{type:"html_block",loading:!0,tag:w,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const w=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(w))continue;y.children=[{type:"html_block",loading:!1,tag:w,content:y.children.map(M=>M.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),E=y,L=E.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(E.children.length=0);continue}const $=String(L.content??k).match(RV)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(k)||F6.has($)){E.children=[{type:"html_inline",content:k}];continue}E.children.length=0}}})}function YV(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 ZV(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!YV(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const R6=/\.([a-z0-9]{1,15})$/i,QV=/[_()[\]{}<>]/u,XV=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,JV=/[?#@]/u,eK=/[\\/]/u,tK=/^[\p{L}\p{N}./\\-]+$/u,nK=/^[A-Za-z0-9-]{1,63}$/u,sK=/^xn--[a-z0-9-]{2,59}$/i,oK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,iK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,rK=/文件名\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,lK=/文件名\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,aK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,cK=new Set(["ai","md","py","rs","sh","zip"]),B6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),uK=new Set([...B6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),dK=new Set(["com","dev","io","page","site"]),fK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),hK=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Td(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function b0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Td(n)?n:void 0}function v_(e,t){if(!Td(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function y_(e){const t=Vd(e);return Td(t)?t:void 0}function pK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function k_(e,t){if(!Td(t))return;const n=String(e??"").trim().split(/\s+/u).map(pK).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>pp(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>pp(o,{marketTicker:!0}))&&(s.marketTicker=!0),Td(s)?s:void 0}function Dl(e,t=!1){let n;return{options(s){return t||s==null?v_(e,n):v_(e,b0(y_(s),k_(s,n)))},remember(s){const o=y_(s);n=t?b0(n,o):b0(o,k_(s,n))},reset(){n=void 0}}}function b_(e){return nK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function mK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return b_(n)||sK.test(n)?t.every(b_):!1}function D6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function gK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function vK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function P6(e,t,n){const s=gK(t);return D6(e)&&vK(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function Vd(e){const t=String(e??"");return{explicitFilename:rK.test(t),filename:lK.test(t),marketTicker:aK.test(t)}}function yK(e){return mK(e.split(/[\\/]/)[0]??"")}function kK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function bK(e){if(QV.test(e)||!tK.test(e))return!0;if(eK.test(e))return!yK(e);const t=e.replace(R6,"");return D6(t)?!0:t.split(".").filter(Boolean).some(kK)}function xK(e,t,n){if(!(n?uK:B6).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?iK:oK).test(s)}function pp(e,t={}){if(!e||XV.test(e)||JV.test(e))return!1;const n=e.match(R6);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return xK(e,s,t.marketTicker===!0)?!0:hK.has(s)?!cK.has(s)||t.filename?!0:bK(e):!!(t.explicitFilename&&dK.has(s)||t.filename&&fK.has(s))}const x_=["!"];function No(e){return{type:"text",content:e,raw:e}}function na(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 sa(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 sl(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function wK(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(No(t))}}function w_(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function _K(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function SK(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function CK(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function AK(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=MK(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function MK(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=Vd(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=CK(e,s,i),l=_K(o);if(o.markup==="linkify"&&r&&!P6(r,l,t)&&pp(r,n)){e.splice(s,i-s+1,No(r));continue}const a=w_(l,x_);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=w_(u.content,x_);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let v=c+1;v<i;v++){const g=e[v];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const g=f?encodeURI(f):"",y=g?l.indexOf(g):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&SK(o,b),p&&e.splice(i+1,0,No(p));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(No(r));const c=i[1],u=l[1].length;na(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(sl(c,d,!e[s+4]?.content?.startsWith(")"))),sa(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(No(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(No(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(h+=e[s+4]?.content||"",e[s+4].content=""),na(a,f),a.push(sl(c,h,!e[s+4]?.content?.startsWith(")"))),sa(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(No(p)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(sl(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(No(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(sl(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(No(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;na(f,p)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let p=s+1;p<e.length;p++){const m=d?d[1].length:e[s-3].markup.length,b=e[p];if(m===1&&b.type==="em_close")break;if(m===2&&b.type==="strong_close")break;if(m===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;sa(f,p)}e.splice(s-u,c,...f),s-=f.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(No(l)),na(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(sl(a,c,u)),sa(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(No(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(No(r)),na(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(sl(l,a,c)),sa(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(No(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(No(r)),na(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const f=e[s+2].attrs?.find(h=>h[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(f||c)+e[s+5].content,e[s+5].content=""):c=f||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const f=(e[s+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[s+2]?.content?.slice(0,f)||"",e[s+2].content="")}i.push(sl(a,c,d)),sa(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];na(a,2),a.push(sl(r,l,!1)),sa(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;wK(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function EK(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=TK(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function TK(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 NK(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=IK(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function IK(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="__"&&(m?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){o++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="_"&&(m?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,s.add(o))}else f==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=$K(l),l}function $K(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(s),t.push(o),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=LK(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function LK(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function FK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=HK(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function __(){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 S_(){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 C_(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 H6(e,t){if(!e.startsWith("|")||e.includes(`
|
|
179
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function x0(e){return H6(e)!==null}function W6(e){return/^:?-+:?$/.test(e.trim())}function OK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(W6)}function RK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function BK(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(W6)&&RK(n)}function DK(e){return e==="|"||e==="|:"}function PK(e){const t=H6(e);return t!==null&&t.every(n=>!n.includes(":"))}function HK(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
180
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
181
|
-
`),d=!t&&!r.includes(`
|
|
182
|
-
`)&&/\r?\n$/.test(n)&&x0(r);if(!t&&(r.includes(`
|
|
183
|
-
`)&&u.length===0&&x0(a)&&BK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>C_(p)),h=[...__(),...f,...S_()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
184
|
-
`)&&u.length===0&&x0(a)&&OK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>C_(p)),h=[...__(),...f,...S_()];s.splice(o-1,3,...h)}else r.includes(`
|
|
185
|
-
`)&&u.length===0&&PK(a)&&DK(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function WK(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var zK=WK;const UK=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],mp=UK.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),qK=/\\[a-z]+/i,z6="(?:\\\\|\\u0008)",jK=new RegExp(String.raw`${z6}(?:${mp})\s*\{[^}]+\}`,"i"),VK=new RegExp(String.raw`(?:${z6})?(?:${mp})\s*\{`,"i"),KK=/\\(?:text|frac|left|right|times)/,GK=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,YK=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,ZK=/[A-Z]+\s*\([^)]+\)/i,QK=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,XK=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,JK=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,eG={"\b":"\\b","\v":"\\v","\f":"\\f"};function tG(e){let t="";for(const n of e)t+=eG[n]??n;return t}function bc(e){if(!e)return!1;const t=tG(e),n=t.trim();if(JK.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=qK.test(t),o=jK.test(t),i=VK.test(t),r=KK.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=GK.test(t)&&!YK.test(t),c=ZK.test(t),u=QK.test(n),d=XK.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||f||h}const U6="__markstreamMathPluginApplied",av=80,q6=2e4,A_=q6+4096;function j6(e){return!!e[U6]}function nG(e){e[U6]=!0}const V6=["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"],sG=["cdot","mathbf{","partial","mu_{"],K6=V6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),G6="[ \r\b\f\v]",oG=new RegExp(`([^\\\\])(${sG.map(e=>e).join("|")})+`,"g"),iG=/span\{([^}]+)\}/,rG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,lG=/(^|[^\\])\\\r?\n/g,aG=/(^|[^\\])\\$/g,cG=new RegExp(`(${G6})|(${K6})\\b`,"g"),M_=new Map,E_=new Map;function uG(e){if(!e)return cG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=M_.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${G6})|(${o})\\b`,"g");return M_.set(n,i),i}function dG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=E_.get(s);if(o)return o;const i=e?[mp,K6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),mp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return E_.set(s,r),r}const T_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function N_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function I_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function ol(e,t){const n=t?.commands??V6,s=t?.escapeExclamation??!0,o=t?.commands==null,i=uG(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&T_[u]!==void 0)return`\\${T_[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=dG(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(iG,"span\\{$1\\}").replace(rG,"\\operatorname{span}\\{$1\\}"),l=l.replace(lG,`$1\\\\
|
|
186
|
-
`),l=l.replace(aG,"$1\\\\"),l=l.replace(oG,"$1\\$2"),l}function $_(e){const t=e.trim();return!(!bc(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function Y6(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function gp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function fG(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function Kd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function cv(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Kd(e,s)){n=s+1;continue}return s}return-1}function w0(e,t){let n=t;for(;n<e.length;){const s=cv(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function Pu(e,t,n=0){let s=Math.max(0,n);for(;s<e.length;){const o=e.indexOf(t,s);if(o===-1)return-1;if(!Kd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function L_(e,t,n=0,s=e.length,o=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,s));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=gp(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Kd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function nk(e,t,n){const s=Id(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!Id(s.slice(0,o)).trim()||Kd(s,o))return-1;const i=Y6(s);if(gp(i,o))return-1;const r=L_(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>L_(s,n,0,o,i))return-1;return o}function Nd(e){return e===" "||e===" "}function Id(e){let t=e.length;for(;t>0&&Nd(e[t-1]);)t--;return e.slice(0,t)}function F_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
187
|
-
`&&t++;return t}function O_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function hG(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(o===t){n++;continue}if(!Nd(o))return!1}return n>=3}function pG(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let s=0;for(;t[n]==="-";)s++,n++;return s<3?!1:(t[n]===":"&&n++,n===t.length)}function mG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(pG)}function gG(e){let t=0;if(!O_(e[t]))return!1;for(;O_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Nd(e[t+1])}function Z6(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Nd(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Nd(t[1])||gG(t)||hG(t)||mG(t))}function R_(e,t){return e?t?`${e}
|
|
188
|
-
${t}`:e:t}function uv(e){const t=String(e??"").trim();return t?bc(t):!1}function B_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function Q6(e){if(e.length<=A_)return{source:e,lineOffset:0};let t=e.length-A_;const n=e.indexOf(`
|
|
189
|
-
`,t);return n===-1?{source:"",lineOffset:F_(e)}:(t=n+1,{source:e.slice(t),lineOffset:F_(e.slice(0,t))})}function X6(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=Q6(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-av-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=Id(s[r]);if(l&&!Z6(l)){for(const[a,c]of i)if(nk(l,a,c)!==-1)return!0}}return!1}function vG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=Q6(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-av-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=Id(o[l]);for(const[c,u]of r){const d=nk(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>av){h=!0;break}const m=o[p],b=Pu(m,u);if(b!==-1){const v=R_(f,m.slice(0,b));if(!uv(v)){h=!0;break}const g=m.slice(b+u.length),y=g.trim()?`suffix:${B_(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,b,B_(v),y].join(":")}if(Z6(m)){h=!0;break}if(f=R_(f,m),f.length>q6){h=!0;break}}if(!h&&uv(f))return["pending",c,s+l,d].join(":")}}return null}function _0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function yG(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function S0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function kG(e,t){nG(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)},s=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,y)=>{let k=y;for(;k<g.length&&(g[k]===" "||g[k]===" ");)k++;if(k===y||!(g[k]===`
|
|
190
|
-
`||g[k]==="\r"&&g[k+1]===`
|
|
191
|
-
`))return y;const E=g.slice(y,k),L=a.push("text","",0);return L.content=E,k};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const y=g-a.pos,k=a.src[g];if(y>=3&&(!k||/\s/.test(k))){const E=a.push("text","",0);return E.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,b=p;const v=p;for(const[g,y]of f){const k=a.src,E=Y6(k),L=fG(k,u);let $=!1;g==="$$"&&m!==v&&(m=v);let w=-1,M=-1,N=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const R=a.push("text_special","",0);R.content=S==="\\)"?")":"(",R.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let R=0;for(;R<S.length;){const P=cv(S,R);if(P===-1){const te=S.slice(R);if(te){const ae=a.push("text","",0);ae.content=te,a.pos=a.pos+te.length,m=a.pos}break}if(P>0&&S[P-1]==="$"||P+1<S.length&&S[P+1]==="$"){const te=S.slice(R,P+1);if(te){const ae=a.push("text","",0);ae.content=te,a.pos=a.pos+te.length,m=a.pos}R=P+1;continue}const z=S.slice(R,P);if(z){const te=a.push("text","",0);te.content=z,a.pos=a.pos+z.length,m=a.pos}const W=w0(S,P+1);if(W===-1){const te=S.slice(P),ae=a.push("text","",0);ae.content=te,a.pos=a.pos+te.length,m=a.pos;break}const ee=S.slice(P+1,W),U=ee.includes("`"),Y=!ee||!ee.trim(),ue=S[W+1],fe=_0(ee,ue),oe=S0(ee);if(!U&&!Y&&!fe&&!oe){const te=a.push("math_inline","math",0);te.content=ol(ee,t),te.markup="$",te.raw=`$${ee}$`,te.loading=!1,a.pos=a.pos+(W-P+1),m=a.pos,R=W+1;continue}const Z=a.push("text","",0);Z.content="$",a.pos=a.pos+1,m=a.pos,R=P+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),W=a.push("text","",0);W.content=z,a.pos=a.pos+z.length,m=a.pos}const R=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,z,W]=R,ee=W.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),U=ee?ee[1]:W,Y=ee&&ee[2]?ee[2]:null,ue=a.push("image","img",0);ue.attrs=[["src",U],["alt",z]],Y&&ue.attrs.push(["title",Y]),ue.content=z,ue.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+R[0].length,m=a.pos;const fe=S.slice(I+R[0].length);fe&&F(fe);return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos;return}const B=a.push("text","",0);B.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=k.length);){const S=k.indexOf(g,m);if(S===-1)break;if(Kd(k,S)){m=S+Math.max(1,g.length);continue}const I=gp(E,S);if(I){m=I[1];continue}const B=gp(L,S);if(B){m=B[1];continue}if(S===w&&m===M){if(N++,N>2){m=S+Math.max(1,g.length);continue}}else N=0,w=S,M=m;if(g==="("&&S>0){let fe=S-1;for(;fe>=0&&k[fe]===" ";)fe--;if(fe>=0&&k[fe]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&k[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<k.length-1&&k[S+1]==="$"){m=S+2;continue}const R=g==="$"?w0(k,S+g.length):zK(k,S+g.length,g,y);if(R===-1){const fe=k.slice(S+g.length);if(fe.includes(g)){m=k.indexOf(g,S+g.length);continue}if(R===-1){const oe=g==="$"&&yG(fe);if(u&&!c&&!oe&&bc(fe)&&!fe.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const Z=b?k.slice(b,m):k.slice(0,m),te=N_(Z)%2===1;if(b)F(k.slice(b,m));else{let ae=k.slice(0,m);ae.endsWith(g)&&(ae=ae.slice(0,ae.length-g.length)),F(ae)}if(te){const ae=I_(Z)?.marker??"**",He=a.push("strong_open","",0);He.markup=ae;const he=a.push("math_inline","math",0);he.content=ol(fe,t),he.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",he.raw=`${g}${fe}${y}`,he.loading=!0,He.content=fe,a.push("strong_close","",0)}else{const ae=a.push("math_inline","math",0);ae.content=ol(fe,t),ae.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ae.raw=`${g}${fe}${y}`,ae.loading=!0}a.pos=k.length}m=k.length,b=m}break}}const P=k.slice(S+g.length,R),z=P.includes("`"),W=!P||!P.trim(),ee=g==="$",U=k[R+y.length],Y=ee&&_0(P,U),ue=ee&&S0(P);if(c?z||W||Y||ue:z||W||Y||ue||!ee&&!bc(P)){m=R+y.length;const fe=k.slice(a.pos,m);a.pending||(F(fe),b=m);continue}if($=!0,!l){const fe=k.slice(a.pos-(a.pending??"").length,S);let oe=k.slice(0,m)?k.slice(b,S):fe;const Z=N_(oe)%2===1;S!==a.pos&&Z&&(oe=a.pending+k.slice(a.pos,S));const te=Z?I_(oe):null,ae=te?.marker??"**";if(a.pending!==oe)if(a.pending="",Z)if(te){const He=oe.slice(te.index+ae.length);F(oe.slice(0,te.index));const he=a.push("strong_open","",0);he.markup=ae;const K=a.push("text","",0);K.content=He,a.push("strong_close","",0)}else F(oe);else F(oe);if(Z){const He=a.push("strong_open","",0);He.markup=ae;const he=a.push("math_inline","math",0);he.content=ol(P,t),he.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",he.raw=`${g}${P}${y}`,he.loading=!1;const K=k.slice(R+y.length).startsWith(ae);return K&&a.push("strong_close","",0),a.pos=d(k,R+y.length),m=a.pos,b=m,K||a.push("strong_close","",0),!0}else{const He=a.push("math_inline","math",0);He.content=ol(P,t),He.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",He.raw=`${g}${P}${y}`,He.loading=!1}}return m=d(k,R+y.length),b=m,a.pos=m,!0}if($){if(l)a.pos=m;else{if(g==="$$"&&m<k.length&&k.slice(m).includes("$")){let S=m;for(;!(S>=k.length);){const I=cv(k,S);if(I===-1)break;if(I+1<k.length&&k[I+1]==="$"){S=I+2;continue}if(I>0&&k[I-1]==="$"){S=I+1;continue}const B=w0(k,I+1);if(B===-1)break;const R=k.slice(I+1,B),P=R.includes("`"),z=!R||!R.trim(),W=k[B+1],ee=_0(R,W),U=S0(R);if(!P&&!z&&!ee&&!U){const Y=k.slice(m,I);Y&&F(Y);const ue=a.push("math_inline","math",0);ue.content=ol(R,t),ue.markup="$",ue.raw=`$${R}$`,ue.loading=!1,m=B+1,S=B+1}else F("$"),S=I+1}S<k.length&&F(k.slice(S))}else m<k.length&&F(k.slice(m));a.pos=k.length}return!0}}return!1},o=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",g="",y=!1,k="",E=!1;for(const[Y,ue]of h)if(m.startsWith(Y))if(Y.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){b=!0,v=Y,g=ue;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){b=!0,v=Y,g=ue;break}continue}else{const fe=u.tokens[u.tokens.length-1];if(fe&&fe.type==="list_item_open"&&fe.mark==="-"&&m.slice(Y.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const oe=m.indexOf("]");if(m.slice(oe).trim()!=="]")continue;const Z=m.slice(Y.length,oe);if(Y==="["?$_(Z):bc(Z)){b=!0,v=Y,g=ue;break}continue}}else{b=!0,v=Y,g=ue;break}else if((Y==="$$"||Y==="\\[")&&m.endsWith(Y)&&l+1<a){const fe=nk(m,Y,ue);if(fe===-1)continue;k=Id(m.slice(0,fe)),E=!0;const oe=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(oe,u.eMarks[l+1]).trim(),y=!0,b=!0,v=Y,g=ue;break}if(!b)return!1;if(c&&!E)return!0;const L=m.indexOf(v),$=L+v.length,w=!f&&v==="["?m.indexOf("\\]",$):-1,M=w>=0?"\\]":g,N=w>=0?w:Pu(m,g,$);if(!y&&N>v.length){const Y=m.slice(L+v.length,N),ue=u.push("math_block","math",0);ue.content=ol(Y),ue.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",ue.map=[l,l+1],ue.raw=`${v}${Y}${M}`,ue.block=!0,ue.loading=!1,u.line=l+1;const fe=m.slice(N+M.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",I=!1,B="",R=l;const P=y?m:m===v?"":m.slice(v.length),z=!f&&v==="\\["?"]":"",W=Pu(P,g);if(W!==-1){const Y=W;S=P.slice(0,Y),B=P.slice(Y+g.length),R=y?l+1:l,I=!0,F=R}else for(P&&!y&&(S=P),F=l+1;F<a;F++){const Y=u.bMarks[F]+u.tShift[F],ue=u.eMarks[F],fe=u.src.slice(Y,ue),oe=fe.trim();if(!f&&v==="["&&oe==="\\]"){g="\\]",I=!0;break}if(z&&fe.trim()===z){g=z,I=!0;break}if(oe===g){I=!0;break}else if(!f&&v==="["&&fe.includes("\\]")){I=!0;const Z=fe.indexOf("\\]");g="\\]";const te=fe.slice(0,Z);te&&(S+=(S?`
|
|
192
|
-
`:"")+te),B=fe.slice(Z+g.length),R=F;break}else if(Pu(fe,g)!==-1){I=!0;const Z=Pu(fe,g),te=fe.slice(0,Z);te&&(S+=(S?`
|
|
193
|
-
`:"")+te),B=fe.slice(Z+g.length),R=F;break}S+=(S?`
|
|
194
|
-
`:"")+fe}if((!d||f)&&!I)return!1;const ee=/^\s*!\[/.test(S);if(!(E?!ee&&uv(S):v==="$$"?!ee:v==="["?$_(S):bc(S)))return!1;if(c)return!0;k&&n(u,k,l);const U=u.push("math_block","math",0);return U.content=ol(S),U.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",U.raw=`${v}${S}${S.startsWith(`
|
|
195
|
-
`)?`
|
|
196
|
-
`:""}${g}`,U.map=[l,F+1],U.block=!0,U.loading=!I,u.line=F+1,B.trim()&&n(u,B,R),!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:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function bG(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function xG(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new aV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!ba(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&kG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&MV(i),e.enableFixIndentedCodeBlock!==!1&&ZV(i),AK(i),NK(i),EK(i),FK(i),bG(i),GV(i,{customHtmlTags:e.customHtmlTags}),i}function xa(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>xa(n))),t}function wG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function _G(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function SG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function qf(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...ts(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const D_=/\r?\n[ \t]*`+\s*$/,J6=["diff ","index ","--- ","+++ ","@@ "],CG=/\r?\n/;function AG(e){const t=String(e??"");return t?J6.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function P_(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function MG(e,t){const n=[],s=[],o=[],i=[],r=e.split(CG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!J6.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);o.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(p.startsWith("+")){const m=p.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{P_(n,s,o,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),s.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&AG(p)||c(p)}(t||o.length>0||i.length>0)&&P_(n,s,o,i);const d=n.join(`
|
|
197
|
-
`),f=s.join(`
|
|
198
|
-
`);return{original:t&&l&&d?`${d}
|
|
199
|
-
`:d,updated:t&&l&&f?`${f}
|
|
200
|
-
`:f}}function sk(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(D_.test(a)&&(a=a.replace(D_,"")),r){const{original:c,updated:u}=MG(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function EG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function TG(){return{type:"hardbreak",raw:`\\
|
|
201
|
-
`}}function NG(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...ts(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let C0=null;const A0=new WeakMap;function H_(){return C0||(C0={customTagSet:null,allowedTagSet:Mm()}),C0}function eM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function tM(e){return/^<\s*\//.test(e)}function nM(e,t){return/\/\s*>\s*$/.test(t)||Fa.has(e)}function IG(e){if(!e||e.length===0)return H_();const t=A0.get(e);if(t)return t;const n=e.map(Ci).filter(Boolean);if(!n.length){const o=H_();return A0.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Mm({customHtmlTags:e})};return A0.set(e,s),s}function sM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function $G(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function vp(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function LG(e,t,n){const s=e.slice();return vp(s,"href")||s.push(["href",t]),n!=null&&!vp(s,"title")&&s.push(["title",n]),s}function dv(e){return e.map(sM).join("")}function yh(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:yh(s.children)});continue}t.push(s)}return t}function FG(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=eM(r),a=tM(r),c=nM(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function M0(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?FG(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:dv(s),innerTokens:o,nextIndex:i}}function OG(e,t,n,s,o,i,r){const l=String(e.content??""),a=eM(l),{customTagSet:c,allowedTagSet:u}=IG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!M0(t,n,a).closed){const E=sM(e);return[{type:"text",content:E,raw:E},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=tM(l),f=nM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const E=M0(t,n,a),L=Sm(l),$=E.innerTokens,w=String(vp(L,"href")??""),M=vp(L,"title"),N=M==null?null:String(M),F=LG(L,w,N),S=yh($.length?s($,o,i,r):[]),I=$.length?dv($):w||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:w,title:N,text:I,attrs:F,children:S,loading:!E.closed,raw:E.html||l},E.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=M0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:yh(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=yh(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,b=!h.closed,v=!1;if(!h.closed){const E=`</${a}>`;m.toLowerCase().includes(E.toLowerCase())||(m+=E),v=!0,b=!0}const g=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const E=k[1],L=k[2]||k[3]||k[4]||"";g.push([E,L])}if(c?.has(a)){const E=$G(e);return[{type:a,tag:a,attrs:g,content:E?E.inner:h.innerTokens.length?dv(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:E?.raw??m,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:b,autoClosed:v},h.nextIndex]}function oM(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=>oM(t)).join(""):String(e.content??"")}function RG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>oM(t)).join("")}function W_(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=RG(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function BG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function DG(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...ts(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function PG(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function yp(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function HG(e,t,n){const s=e.slice();return yp(s,"href")||s.push(["href",t]),n!=null&&!yp(s,"title")&&s.push(["title",n]),s}function jf(e,t,n){const s=e[t],o=PG(s.attrs),i=String(yp(o,"href")??""),r=yp(o,"title"),l=r==null?null:String(r),a=HG(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),g=xa(h);g.content=b.slice(0,-2),g.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=ts(f,void 0,void 0,n),m=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function z_(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 WG(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function U_(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...ts(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const zG=/\\([\\()[\]`$|*_\-!])/g;function UG(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(zG,"$1")===t))return n}function Tu(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...ts(l,UG(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function qG(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...ts(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function jG(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...ts(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function VG(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const KG=/[^~]*~{2,}[^~]+/,GG=/\*\*/,YG=/[[_*^~]/,ZG=/\\([\\()[\]`$|*_\-!])/g,ok=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),QG=/\s/u,XG=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,JG=/\p{P}/u,eY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,tY=/:\/\//;function nY(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 iM(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&ok.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function $l(e){return!!e&&QG.test(e)}function Ll(e){return!!e&&(XG.test(e)||JG.test(e))}function sY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||$l(s)?!1:!(Ll(s)&&n&&!$l(n)&&!Ll(n))}function oY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||$l(n)?!1:!(Ll(n)&&s&&!$l(s)&&!Ll(s))}function iY(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?iM(e,s):t.indexOf("*",s);if(i===-1)break;if(oY(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function rY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||$l(s)?!1:!(Ll(s)&&n&&!$l(n)&&!Ll(n))}function lY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||$l(n)?!1:!(Ll(n)&&s&&!$l(s)&&!Ll(s))}function aY(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(lY(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function cY(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&ok.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function uY(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&ok.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function dY(e,t,n){const s=uY(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const fY=/[\p{L}\p{N}]/u,hY=/^[\p{L}\p{N}]+$/u;function fv(e){return e?fY.test(e):!1}function rM(e){return e?hY.test(e):!1}function ed(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:fv(s)&&fv(o)}}function pY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=ed(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!rM(e.slice(s.end,o.start)))return o.end}return-1}function mY(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function gY(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=ed(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function vY(e){return e?eY.test(e)||tY.test(e):!1}function yY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function ts(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=Vd(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(K,ce){const ge=e.length===1?t:String(ce.content??""),q=[],se=pY(K);if(se!==-1){E(K.slice(0,se),K.slice(0,se));const de=K.slice(se);return de&&(N({type:"text",content:de,raw:de}),u--),u++,!0}if(KG.test(K)){const de=K.indexOf("~~");de!==-1&&q.push({type:"strikethrough",index:de})}if(GG.test(K)){const de=K.indexOf("**");de!==-1&&q.push({type:"strong",index:de})}if(/[^*]*\*[^*]+/.test(K)){const de=ge?iM(ge,0):K.indexOf("*");if(ge&&de===-1)return!1;de!==-1&&q.push({type:"emphasis",index:de})}q.sort((de,ke)=>de.index!==ke.index?de.index-ke.index:de.type===ke.type?0:de.type==="strong"?-1:ke.type==="strong"?1:0);const ye=q[0];if(!ye)return!1;if(ye.type==="strikethrough"){const de=ye.index,ke=de>-1?K.slice(0,de):"";if(ke&&E(ke,ke),de===-1)return u++,!0;const j=K.indexOf("~~",de+2),ne=j===-1?K.slice(de+2):K.slice(de+2,j),ve=j===-1?"":K.slice(j+2),{node:Ae}=U_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ne,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),k(Ae),ve&&(N({type:"text",content:ve,raw:ve}),u--),u++,!0}if(ye.type==="strong"){const de=ye.index,ke=de>-1?K.slice(0,de):"";if(ke&&E(ke,ke),de===-1)return u++,!0;if(t&&de===0){let Oe=!1,pe=0;for(;pe<K.length&&K[pe]==="*";)pe++;if(t.startsWith("\\*")&&(Oe=!0),Oe){let Ie=0,Xe=0;for(;Xe<t.length&&Ie<pe;)if(t[Xe]==="\\"&&Xe+1<t.length&&t[Xe+1]==="*")Ie+=1,Xe+=2;else{if(t[Xe]==="*")break;Xe++}if(Ie>=2)return E(K,K),u++,!0}}if(t&&(K.match(/\*/g)||[]).length>nY(t))return E(K.slice(ke.length),K.slice(ke.length)),u++,!0;const j=ed(K,de);if(j.len>=3){const Oe=gY(K,de+j.len);if(Oe!==-1){const pe=K.slice(de+j.len,Oe);if(mY(pe)){const{node:Ie}=Tu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);p(),k(Ie);const Xe=K.slice(Oe+3);return Xe&&(N({type:"text",content:Xe,raw:Xe}),u--),u++,!0}}}if(!rY(K,de)){const Oe=K.slice(de,de+j.len);E(Oe,Oe);const pe=K.slice(de+j.len);return pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}const ne=aY(K,de+2);let ve="",Ae="";if(ne.index!==-1){ve=K.slice(de+2,ne.index),Ae=K.slice(ne.index+2);const Oe=ne.index,pe=ed(K,Oe);if(j.intraword&&pe.intraword&&!rM(ve)||!ve&&j.len>=4&&j.intraword)return E(K.slice(ke.length),K.slice(ke.length)),u++,!0}else{if(d||ne.sawInvalidClose||j.intraword)return E(K.slice(ke.length),K.slice(ke.length)),u++,!0;ve=K.slice(de+2),Ae=""}if(!ve&&/^\*+$/.test(Ae))return E(K,K),u++,!0;const{node:$e}=Tu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ve,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),k($e),Ae&&(N({type:"text",content:Ae,raw:Ae}),u--),u++,!0}if(ye.type==="emphasis"){let de=ye.index;de===-1&&(de=0);const ke=K.slice(0,de);if(ke&&E(ke,ke),!sY(K,de)){E(K[de],K[de]);const Oe=K.slice(de+1);return Oe&&(N({type:"text",content:Oe,raw:Oe}),u--),u++,!0}const j=ed(K,de),ne=iY(ge,K,de+1),ve=ne.index,Ae=e[u+1];if(s?.final&&Ae?.type==="em_open"&&ve!==-1&&K.slice(de+1,ve).trim()!==K.slice(de+1,ve)||ve===-1&&(ne.sawInvalidClose||s?.final||j.intraword||!fv(K[de+1])))return E(K.slice(de),K.slice(de)),u++,!0;const{node:$e}=qf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ve>-1?K.slice(de+1,ve):K.slice(de+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),k($e),ve!==-1&&ve<K.length-1){const Oe=K.slice(ve+1);Oe&&(N({type:"text",content:Oe,raw:Oe}),u--)}return u++,!0}return!1}function b(K,ce){if(!K.includes("`"))return!1;const q=(Ae=>{for(let $e=0;$e<Ae.length;$e++){if(Ae[$e]!=="`")continue;let Oe=0;for(let pe=$e-1;pe>=0&&Ae[pe]==="\\";pe--)Oe++;if(Oe%2===0)return $e}return-1})(K);if(q===-1)return!1;let se=1;for(let Ae=q+1;Ae<K.length&&K[Ae]==="`";Ae++)se++;const ye="`".repeat(se),de=q+se,ke=K.indexOf(ye,de);if(ke===-1){if(se===1){const $e=K.slice(0,q),Oe=K.slice(q+1);return $e&&(m($e,ce)?u--:E($e,$e)),g({type:"inline_code",code:Oe,raw:String(Oe)}),u++,!0}let Ae=K;for(let $e=u+1;$e<e.length;$e++)Ae+=String((e[$e].content??"")+(e[$e].markup??""));return u=e.length-1,E(Ae,Ae),u++,!0}p();const j=K.slice(0,q),ne=K.slice(q+se,ke),ve=K.slice(ke+se);return j&&(m(j,ce)?u--:E(j,j)),g({type:"inline_code",code:ne,raw:String(ne??"")}),ve&&(N({type:"text",content:ve,raw:ve}),u--),u++,!0}function v(K){const ce=l?.__markdownIt;if(!ce||e.length<=1||!e.some(ye=>ye?.type==="math_inline")||!YG.test(K))return null;const ge=ce.parseInline(K,{__markstreamFinal:!!s?.final});if(!Array.isArray(ge)||ge.length===0)return null;const q=(ge.find(ye=>ye?.type==="inline")?.children??[]).filter(ye=>!(ye?.type==="text"&&String(ye.content??"")===""));if(!q.length||!q.some(ye=>ye?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===K)return null;const se=ts(q,K,n,s);return se.length?se:null}function g(K){p(),a.push(K)}function y(K){p();const ce=xa(K);a.push(ce)}function k(K){g(K)}function E(K,ce){c?(c.content+=K,c.raw+=ce??K):(c={type:"text",content:String(K??""),raw:String(ce??K??"")},a.push(c))}function L(K,ce){if(!K)return;const ge=ts([{...ce,type:"text",content:K,raw:K}],K,n,s);if(ge.length===1&&ge[0]?.type==="text"){const q=ge[0];E(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ge)k(q)}function $(K,ce){return String(K.markup??"").startsWith(ce)}function w(K){return K.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(K,ce){let ge=K;const q=String(ce.content??"");return ge.endsWith("\\")&&!$(ce,"\\\\")&&!q.endsWith("\\\\")&&(ge=ge.slice(0,-1)),ge.endsWith("(")&&!$(ce,"\\(")&&!q.endsWith("\\(")&&(ge=ge.slice(0,-1)),/\*+$/.test(ge)&&!$(ce,"\\*")&&!q.endsWith("\\*")&&(ge=ge.replace(/\*+$/,"")),ge}for(;u<e.length;){const K=e[u];N(K)}function N(K){switch(K.type){case"text":S(K);break;case"softbreak":c?(c.content+=`
|
|
202
|
-
`,c.raw+=`
|
|
203
|
-
`):(c={type:"text",content:`
|
|
204
|
-
`,raw:`
|
|
205
|
-
`},a.push(c)),u++;break;case"code_inline":k(BG(K)),u++;break;case"html_inline":{const[ce,ge]=OG(K,e,u,ts,t,n,s);k(ce),u=ge;break}case"link_open":I(K);break;case"image":fe(K)||(p(),k(W_(K)),u++);break;case"strong_open":{p();const{node:ce,nextIndex:ge}=Tu(e,u,K.content,s);k(ce),u=ge;break}case"em_open":{p();const{node:ce,nextIndex:ge}=qf(e,u,s);k(ce),u=ge;break}case"s_open":{p();const{node:ce,nextIndex:ge}=U_(e,u,s);k(ce),u=ge;break}case"mark_open":{p();const{node:ce,nextIndex:ge}=NG(e,u,s);k(ce),u=ge;break}case"ins_open":{p();const{node:ce,nextIndex:ge}=DG(e,u,s);k(ce),u=ge;break}case"sub_open":{p();const{node:ce,nextIndex:ge}=qG(e,u,s);k(ce),u=ge;break}case"sup_open":{p();const{node:ce,nextIndex:ge}=jG(e,u,s);k(ce),u=ge;break}case"sub":p(),k({type:"subscript",children:[{type:"text",content:String(K.content??""),raw:String(K.content??"")}],raw:`~${String(K.content??"")}~`}),u++;break;case"sup":p(),k({type:"superscript",children:[{type:"text",content:String(K.content??""),raw:String(K.content??"")}],raw:`^${String(K.content??"")}^`}),u++;break;case"emoji":{p();const ce=e[u-1];ce?.type==="text"&&/\|:-+/.test(String(ce.content??""))?E("",""):k(SG(K)),u++;break}case"checkbox":p(),k(wG(K)),u++;break;case"checkbox_input":p(),k(_G(K)),u++;break;case"footnote_ref":p(),k(EG(K)),u++;break;case"footnote_anchor":{p();const ce=K.meta??{};g({type:"footnote_anchor",id:String(ce.label??K.content??""),raw:String(K.content??"")}),u++;break}case"hardbreak":p(),k(TG()),u++;break;case"fence":p(),k(sk(e[u])),u++;break;case"math_inline":p(),!K.content&&K.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(k(z_({...K,content:e[u+1].content})),u+=2):k(z_(K)),u++;break;case"reference":R(K);break;case"text_special":E(String(K.content??""),String(K.content??"")),u++;break;default:{const ce=K;if(K.type==="link"&&ce.href!=null&&s?.validateLink&&!s.validateLink(String(ce.href))){p();const ge=String(ce.text??"");E(ge,ge),u++}else oe(K)||z(K)||ee(K)||P(K)||y(K),u++;break}}}function F(K,ce,ge,q){const se=VG({...ce,content:K});if(c){c.content+=M(se.content,ce),c.raw+=se.raw;return}const ye=ge?.tag==="br"&&e[u-2]?.content==="[";q||(se.content=M(se.content,ce)),c=se,c.center=ye,a.push(c)}function S(K){const ce=String(K.content??""),ge=e.length===1&&ce.includes("\\")&&typeof t=="string"?String(t):"";let q=ge?cY(ge):ce.replace(ZG,"$1");if(K.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const se=q.indexOf("$");se!==-1&&se===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let ye=a.length,de="";for(let ve=a.length-1;ve>=0;ve--){const Ae=a[ve];if(Ae.type!=="text")break;ye=ve,de=String(Ae.content??"")+de}ye<a.length&&(q.startsWith(de)?(c=null,a.length=ye):c=a[a.length-1]);const ke=e[u+1];if((q==="`"||q==="|"||q==="$")&&!$(K,`\\${q}`)||/^\*+$/.test(q)&&!$(K,"\\*")){u++;return}if(!ke&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(ue(q)||Z(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){F(q,K,e[u-1],ke),u++;return}if(he(q))return;const j=e[u-1];if(q==="["&&!ke?.markup?.includes("*")&&!$(K,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!$(K,"\\]")){u++;return}if(b(ce,K)||He(q)||(e[u+1]?.type!=="link_open"||w(q))&&ae(q,K))return;const ne=v(ce);if(ne){p();for(const ve of ne)k(ve);u++;return}m(q,K)||(F(q,K,j,ke),u++)}function I(K){if(B(K))return;if(te()){const{node:ke,nextIndex:j}=jf(e,u,s),ne=String(ke.text||ke.href||"");E(ne,ne),u=j;return}p();const{node:ce,nextIndex:ge}=jf(e,u,s);u=ge;const q=ce.text||ce.href||"";if(K.markup==="linkify"&&!P6(q,ce.href,t)&&pp(q,l?.__linkifyDemotionContext)){E(q,q);return}const se=ce.children.length===1&&ce.children[0]?.type==="text";if(ce.loading&&t&&ce.text===ce.href&&se){const ke=yY(t,ce.href);ke&&(ce.text=ke,ce.children=[{type:"text",content:ke,raw:ke}],ce.raw=`[${ke}](${ce.href}${ce.title?` "${ce.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ce.href)){E(ce.text,ce.text);return}const ye=K.attrs?.find(([ke])=>ke==="href")?.[1],de=String(ye??"");if(t&&de){const ke=t.indexOf("](");if(ke!==-1){const j=t.indexOf(")",ke+2);j===-1?ce.loading=!0:ce.loading&&t.slice(ke+2,j).includes(de)&&(ce.loading=!1)}}P(ce)||g(ce)}function B(K){if(K.markup!=="linkify")return!1;const{node:ce,nextIndex:ge}=jf(e,u,s);return W(ce,ge)?(u=ge,!0):!1}function R(K){p(),k(WG(K)),u++}function P(K){if(K.type!=="link")return!1;const ce=a[a.length-1];if(!ce||ce.type!=="text")return!1;const ge=String(ce.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ge)return!1;const q=K,se=String(q.href??""),ye=String(q.text??""),de=String(ge[2]??""),ke=se.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!se||!(ye===se||ye===ke||vY(ye)))return!1;const j=String(ge[1]??"");return j?(ce.content=j,ce.raw=j):a.pop(),g({...K,text:de,children:[{type:"text",content:de,raw:de}],raw:`[${de}](${se}${q.title?` "${q.title}"`:""})`}),!0}function z(K){if(K.type!=="link")return!1;const ce=K,ge=String(ce.href??"");return ge?W({href:ge,title:ce.title==null||ce.title===""?null:String(ce.title),loading:!!ce.loading},u+1):!1}function W(K,ce){const ge=a[a.length-1];if(ge?.type!=="image"||ge.src||!ge.loading||!String(ge.raw??"").endsWith("]("))return!1;const q=e[ce],se=String(q?.content??"");if(q?.type!=="text"||!se.startsWith(")"))return!1;a.pop(),c=null;const ye=String(ge.alt??"");g({type:"image",src:K.href,alt:ye,title:K.title,raw:``,loading:!!K.loading});const de=se.slice(1),ke=xa(q);return ke.content=de,ke.raw=de,h()[ce]=ke,!0}function ee(K){if(K.type!=="link")return!1;const ce=a[a.length-1],ge=e[u-1];if(!ce||ce.type!=="text"||ge?.type!=="text")return!1;const q=String(ce.content??""),se=String(ge.content??"");if(!q.endsWith("!")||!se.endsWith("!")||$(ge,"\\!"))return!1;const ye=q.slice(0,-1);ye?(ce.content=ye,ce.raw=ye,c=ce):(a.pop(),c=null);const de=K,ke=String(de.text??de.children?.map(ve=>String(ve?.content??ve?.raw??"")).join("")??""),j=String(de.href??""),ne=de.title==null||de.title===""?null:String(de.title);return g({type:"image",src:j,alt:ke,title:ne,raw:``,loading:!!de.loading}),!0}function U(K,ce="",ge=null){const q=String(K.alt??K.raw??"");return{type:"link",href:ce,title:ge,text:q,children:[K],raw:`[${q}](${ce}${ge?` "${ge}"`:""})`,loading:!0}}function Y(K){const ce=K.startsWith(";return{type:"image",src:"",alt:q===-1?ge.replace(/\]$/,""):ge.slice(0,q),title:null,raw:ce,loading:!0}}function ue(K){const ce=K.indexOf("[![");if(ce===-1||typeof t=="string"&&e.length===1&&dY(t,ce,"["))return!1;const ge=K.slice(0,ce);return ge&&E(ge,ge),g(U(Y(K.slice(ce+1)))),u++,!0}function fe(K){if(s?.final)return!1;const ce=e[u-1];if(ce?.type!=="text"||!String(ce.content??"").endsWith("[")||$(ce,"\\["))return!1;const ge=a[a.length-1];if(ge?.type==="text"&&ge.content.endsWith("[")){const q=ge.content.slice(0,-1);q?(ge.content=q,ge.raw=q,c=ge):(a.pop(),c=null)}return g(U(W_(K))),u++,!0}function oe(K){if(K.type!=="link")return!1;const ce=K,ge=String(ce.raw??""),q=String(ce.text??"");if(!ge.startsWith("[![")&&!q.startsWith("!["))return!1;const se=ce.title==null||ce.title===""?null:String(ce.title);return g(U({type:"image",src:String(ce.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:se,raw:ge.startsWith("[)return!1;const ce=e[u-2];if(ce?.type==="text"&&String(ce.content??"").endsWith("[")&&$(ce,"\\["))return!1;const ge=a[a.length-1];if(ge?.type!=="image"&&ge?.type!=="link")return!1;const q=ge,se=ge?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ye=se?se.children[0]:a.pop();if(!ye||ye.type!=="image")return!1;const de=e[u+1];let ke=String(se?.href??""),j=se?.title==null?null:String(se.title),ne=!0;if(de?.type==="link_open"){const{node:Ae,nextIndex:$e}=jf(e,u+1,s);ke=Ae.href,j=Ae.title,ne=!0,u=$e}else{if(ke=K.slice(2),ke.includes('"')){const Ae=ke.split('"');ke=String(Ae[0]??"").trim(),j=Ae[1]==null?null:String(Ae[1]).trim()}u++}const ve=U(ye,ke,j);return ve.loading=ne,g(ve),!0}function te(){const K=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&K?.type==="text"&&String(K.content??"").endsWith("[")&&$(K,"\\[")}function ae(K,ce){const ge=K.indexOf("[");if(ge===-1)return!1;let q=K.slice(0,ge);const se=K.indexOf("](",ge);if(se!==-1){const ye=e[u+2];let de=K.slice(ge+1,se);if(de.includes("[")){const Oe=de.indexOf("[");q+=K.slice(0,ge+Oe+1);const pe=ge+Oe+1;de=K.slice(pe+1,se)}const ke=e[u+1];if(K.endsWith("](")&&ke?.type==="link_open"&&ye){const Oe=e[u+4];let pe=4,Ie=!0;if(Oe?.type==="text"){const it=String(Oe.content??"");if(it.startsWith(")")){Ie=!1;const At=it.slice(1);if(At){const bt=xa(Oe);bt.content=At,bt.raw=At,h()[u+4]=bt}else pe++}else it==="."&&pe++}L(q,ce);const Xe=String(ye.content??"");return s?.validateLink&&!s.validateLink(Xe)?E(de,de):g({type:"link",href:Xe,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:Ie}),u+=pe,!0}const j=K.indexOf(")",se),ne=j!==-1?K.slice(se+2,j):"",ve=j===-1;let Ae=q.match(/\*+$/);if(Ae&&(q=q.replace(/\*+$/,"")),L(q,ce),Ae||(Ae=de.match(/^\*+/)),!d&&Ae){const Oe=Ae[0].length;de=de.replace(/^\*+/,"").replace(/\*+$/,"");const pe=[];if(Oe===1?pe.push({type:"em_open",tag:"em",nesting:1}):Oe===2?pe.push({type:"strong_open",tag:"strong",nesting:1}):Oe===3&&(pe.push({type:"strong_open",tag:"strong",nesting:1}),pe.push({type:"em_open",tag:"em",nesting:1})),pe.push({type:"link",href:ne,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ve}),Oe===1){pe.push({type:"em_close",tag:"em",nesting:-1});const{node:Ie}=qf(pe,0,s);k(Ie)}else if(Oe===2){pe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Tu(pe,0,void 0,s);k(Ie)}else if(Oe===3){pe.push({type:"em_close",tag:"em",nesting:-1}),pe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Tu(pe,0,void 0,s);k(Ie)}else{const{node:Ie}=qf(pe,0,s);k(Ie)}}else s?.validateLink&&!s.validateLink(ne)?E(de,de):g({type:"link",href:ne,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ve});const $e=j!==-1?K.slice(j+1):"";return $e&&(N({type:"text",content:$e,raw:$e}),u--),u++,!0}return!1}function He(K){const ce=K.indexOf("![");if(ce===-1)return!1;const ge=K.slice(0,ce);return ge&&!c?c={type:"text",content:ge,raw:ge}:ge&&c&&(c.content+=ge),c&&(a.push(c),c=null),g(Y(K.slice(ce))),u++,!0}function he(K){if(!(K?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ce=K.slice(1).match(/[^\s\]]/);if(ce===null)return u++,!0;if(ce&&/x/i.test(ce[0])){const ge=ce[0]==="x"||ce[0]==="X";return g({type:"checkbox_input",checked:ge,raw:ge?"[x]":"[ ]"}),u++,!0}return!1}return a}function kY(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function bY(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function xY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function nu(e,t,n){const s=e[t],o=[],i=Dl(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=xY(c)?xa(c):c,d=e[a-1];u!==c&&(bY(u),kY(u));const f=String(u.content??"");l.push({type:"paragraph",children:ts(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=su(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=nu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=rk(e,a,i.options(),ik);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
206
|
-
`)},r+1]}function wY(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Dl(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:ts(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=nu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=su(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Cm(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
207
|
-
${r.map(c=>c.raw).join(`
|
|
208
|
-
`)}
|
|
209
|
-
:::`},a+1]}const _Y=new Set(["warning","info","note","tip","danger","caution"]);function SY(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return _Y.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function CY(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const f=d.slice(o.length).trim();f&&(i=f)}}else{const d=SY(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Dl(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const b=f[m];if(b.type==="text"&&/:+/.test(b.content)){h=m;break}}const p={type:"paragraph",children:ts((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=nu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=su(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Cm(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
210
|
-
${l.map(d=>d.raw).join(`
|
|
211
|
-
`)}
|
|
212
|
-
:::`},c+1]}const AY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function MY(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=AY.exec(String(s.info??""));return o?wY(e,t,o,n):null}const ik={parseContainer:(e,t,n)=>CY(e,t,n),matchAdmonition:MY};function su(e,t,n){const s=[],o=Dl(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:ts(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=nu(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=su(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=rk(e,i,o.options(),ik);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
213
|
-
`)},i+1]}function EY(e){if(e.info?.startsWith("diff"))return sk(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function TY(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Dl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=ts(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:ts(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
214
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
215
|
-
`)},o+1]}function NY(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Dl(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:ts(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
216
|
-
`)}`},l+1]}function IY(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:ts(a.children||[],c,void 0,n),raw:c}}function $Y(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=es(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=es(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 lM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=es(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=Fa.has(n),l=Sm(o),a=(s===-1?-1:$Y(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
217
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function LY(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 FY(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function aM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function cM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return aM(n)?n:void 0}function OY(e,t,n){const s=cM(Vd(t),n);if(!aM(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function RY(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),m=FY(e[c].attrs),b=a.length,v=!f&&!r,g=v?o?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:ts(h.children||[],p,void 0,OY(n,g,v?u:void 0)),raw:p,align:m}),v&&(u=cM(u,Vd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
218
|
-
`)},s+1]}function BY(){return{type:"thematic_break",raw:"---"}}let E0=null;const T0=new WeakMap;function q_(){return E0||(E0={allowedTagSet:Mm(),customTagSet:null}),E0}function DY(e){if(!e||e.length===0)return q_();const t=T0.get(e);if(t)return t;const n=e.map(Ci).filter(Boolean);if(!n.length){const o=q_();return T0.set(e,o),o}const s={allowedTagSet:Mm({customHtmlTags:e}),customTagSet:new Set(n)};return T0.set(e,s),s}function PY(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[h,p]of o)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=Dl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:ts(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=nu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=su(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Cm(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
219
|
-
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
220
|
-
`),f+=`
|
|
221
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function HY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function WY(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function zY(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Qo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Qo(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=es(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=es(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 UY(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=es(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const b=m+1;return{raw:e.slice(r,b),end:b}}d=m+1;continue}if(f(p)){const m=es(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function hv(e){return Number.isFinite(e)&&e>0?e:0}function qY(e,t){const n=hv(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
222
|
-
`&&(s++,s===n))return o+1;return e.length}function Cm(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[IY(e,t,n),t+3];case"code_block":return[EY(s),t+1];case"fence":return[sk(s),t+1];case"math_block":return[LY(s),t+1];case"html_block":{const o=lM(s),i=o.tag?DY(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?qY(l,Number(s.map?.[0]??0)):0,u=UY(l,r,Math.max(hv(a),hv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=es(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:zY(d,r,f+1),b=m?.start??-1;let v="";f!==-1&&(b!==-1&&f<b?v=d.slice(f+1,b):v=d.slice(f+1)),b===-1&&(v=WY(v,r));const g=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(h))!==null;){const L=k[1];if(!L||L.toLowerCase()===r)continue;const $=k[2]||k[3]||k[4]||"";g.push([L,$])}const E=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:HY(v),raw:String(u?.raw??o.raw??d),loading:E,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=RY(e,t,n);return[o,i]}case"dl_open":{const[o,i]=TY(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=NY(e,t,n);return[o,i]}case"hr":return[BY(),t+1]}return null}function rk(e,t,n,s){const o=Cm(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return PY(e,t,n)}return null}function jY(){return{type:"hardbreak",raw:`\\
|
|
223
|
-
`}}function VY(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:ts(s.children||[],o,void 0,n),raw:o}}const j_=new WeakMap,Am=new WeakMap,KY=["$$","\\["];function Gc(){return typeof performance<"u"?performance.now():Date.now()}function lk(e,t,n){e&&(e[t]=(e[t]??0)+n)}function uM(e){return e.__timing}function N0(e,t,n){return t&&lk(t,"parseMarkdownToStructureTotalMs",Gc()-n),e}function V_(e,t,n){if(!n)return eS(e,t);const s=Gc(),o=eS(e,t);return lk(n,"processTokensMs",Gc()-s),o}function GY(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=tu(t);return n.length?new Set(n):null}function YY(e,t){const n=e;let s=j_.get(n);s||(s=new Map,j_.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function ZY(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Vf(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=ca(o.value,n))}}function ca(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(ca(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(ca(l,t),ca(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(ca(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),Vf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Vf(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),Vf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!ZY(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Vf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=ca(i[r],t);return o}function dM(e,t=!0){if(!t)return xa(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>dM(a,t)):t&&r&&typeof r=="object"&&(l=ca(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function K_(e,t=!0){return e.map(n=>dM(n,t))}function fM(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function QY(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function XY(e){Am.delete(e)}function JY(e,t,n){Am.set(e,{source:t,key:n,pendingCandidate:n===null&&X6(t)})}function eZ(e){return e.endsWith("$")||e.endsWith("\\")}function tZ(e){const t=Math.max(e.lastIndexOf(`
|
|
224
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return KY.some(s=>n.endsWith(s))}function nZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||tZ(e)&&/[\r\n]/.test(t)):!1}function sZ(e,t){if(!j6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=Am.get(s);if(o?.source===t)return;if(o&&t.startsWith(o.source)){const l=t.slice(o.source.length);if(o.key===null&&o.pendingCandidate===!1&&!nZ(o.source,l)&&!eZ(t)){o.source=t;return}}const i=vG(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),JY(e,t,i)}function oZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function iZ(e,t){const n=e?.map,s=t?.map;return n===s?!0:!Array.isArray(n)||!Array.isArray(s)?!1:n.length===s.length&&n.every((o,i)=>o===s[i])}function I0(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&iZ(e,t)}function G_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function rZ(e){for(let t=0;t+5<e.length;t++)if(G_(e,t)&&G_(e,t+3)&&I0(e[t],e[t+3])&&I0(e[t+1],e[t+4])&&I0(e[t+2],e[t+5]))return!0;return!1}function lZ(e,t,n){return j6(e)&&X6(t)&&rZ(n)}function aZ(e){const t=Am.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Y_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!fM(e,s)||(sZ(e,t),aZ(e)))return e.parse(t,n);const o=e.stream.parse(t,YY(e,n));if(lZ(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!oZ(s))return o;const i=uM(s);if(!i)return K_(o,!0);const r=Gc(),l=K_(o,!0);return lk(i,"tokenCloneMs",Gc()-r),l}function Mm(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Ed;const n=new Set(Ed);for(const s of tu(t))s&&n.add(s);return n}function cZ(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 Z_(e){return{type:"paragraph",children:e,raw:e.map(cZ).join("")}}function Q_(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=GY(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const f=s.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(Z_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(Z_(c)),a}function uZ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function td(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function dZ(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*${Qo(t)}\s*>\s*$`,"i").test(n)}function ak(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Qo(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=es(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Fa.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${Qo(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Qo(s)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const m=es(e.slice(p));if(m===-1)return null;u--;const b=p+m+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const m=es(e.slice(p));if(m===-1)return null;const b=e.slice(p,p+m+1);/\/\s*>$/.test(b)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function fZ(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
225
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function hZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
226
|
-
</${t}>`}function X_(e){return e.replace(/\r\n/g,`
|
|
227
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function pZ(e,t,n){return n?e.includes(n,t)?!0:X_(e.slice(Math.max(0,t))).includes(X_(n)):!1}function mZ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
228
|
-
`&&n++,n):e[n]===`
|
|
229
|
-
`?n+1:t}function J_(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 gZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function ck(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Qo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function hM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const vZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),yZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function kZ(e){return/\n\s*\n/.test(e)||yZ.test(e)}function bZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>vZ.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!kZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function xZ(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||E6.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=es(l);if(a===-1)return o;const c=ck(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=nd(u,t,hM(n,s));return bZ(u,d)?{...o,children:d}:o})}function nd(e,t,n){return e.trim()?mM(e,t,{...n,__disableStreamParse:!0}):[]}function wZ(e,t,n){const s=nd(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function _Z(e,t,n){const s=lM({content:e}),o=es(e),i=ck(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=wZ(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function SZ(e,t,n){const s=es(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=ak(o,"summary",0);if(!i)return nd(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...nd(r,t,n),_Z(i.raw,t,n),...nd(l,t,n)]}function pM(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=td(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!J_(c)){r.push(c);continue}const f=String(c.raw??td(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let ee=a+1;ee<e.length;ee++){const U=e[ee];if(J_(U)){p++;continue}if(gZ(U)&&(p--,p===0)){m=ee;break}}const b=ak(t,"details",h),v=m===-1&&b?.closed===!0,g=v?(()=>{const ee=ck(f,"details");return ee!==-1?f.slice(0,ee):f})():f,[y]=pM(v?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),k=SZ(g,n,hM(s,o)),E=m===-1?"</details>":String(e[m].raw??td(e[m])??"</details>"),L=v||m!==-1&&b?.closed===!0,$=E.replace(/[\t\r\n ]+$/,""),w=L?(()=>{const ee=(b?.raw??"").lastIndexOf($);return ee===-1?t.length:h+ee})():t.length,M=es(f),N=v&&M!==-1?h+M+1:h+f.length,F=t.slice(N,w===-1?t.length:w),S=n.parse(F,{__markstreamFinal:o}),I=n.renderer.render(S,n.options,{__markstreamFinal:o}),B=w+$.length,R=L?Math.max(w+E.length,mZ(t,B)):t.length,P=L?t.slice(w,R):E,z=L?t.slice(h,R):t.slice(h),W=v&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:Sm(f.slice(0,M+1)),raw:z,content:`${W}${I}${P}`,children:[...k,...y],loading:!o&&!L}),l=L?R:t.length,m===-1&&!v)break;m!==-1&&(a=m)}return[r,l]}function CZ(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=td(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=ak(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=hZ(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,b=es(u.raw),v=b===-1?"":u.raw.slice(0,b+1),g=v?Sm(v):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let y=fZ(u.raw,f);y===-1&&(y=0);const k=i+1;for(;k<s.length;){if(u.closed&&dZ(s[k],c)){s.splice(k,1);continue}const E=td(s[k]);if(!E)break;const L=u.raw.indexOf(E,y);if(L===-1){if(pZ(n,u.end,E))break;s.splice(k,1);continue}y=L+E.length,s.splice(k,1)}}return s}function AZ(e){const t=l=>l===" "||l===" "||l===`
|
|
230
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const b=m.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=m=>{const b=m.charCodeAt(0);return b>=48&&b<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const 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 b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let y=0;for(;y<g.length&&f(g[y]);)y++;const k=g[y];if(k!=="`"&&k!=="~")return null;let E=y;for(;E<g.length&&g[E]===k;)E++;const L=E-y;return L<3?null:{markerChar:k,markerLen:L,rest:g.slice(E)}},p=g=>{let y=0;for(;y<g.length&&f(g[y]);)y++;let k=!1;for(;y<g.length&&g[y]===">";)for(k=!0,y++;y<g.length&&f(g[y]);)y++;return k?g.slice(y):null},m=g=>{const y=h(g);if(y)return y;const k=p(g);return k==null?null:h(k)};let b=0;const v=l.split(/\r?\n/);for(const g of v){const y=b,k=b+g.length;if(a<y)break;const E=m(g);if(E){const L=E.markerChar,$=E.markerLen;c?L===u&&$>=d&&/^\s*$/.test(E.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=k)break;b=k+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
231
|
-
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
232
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function MZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=p=>p===" "||p===" ",o=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let b=0;b<p.length;b++){const v=p[b];if(v===" "){if(m++,m>=4)return!0;continue}if(v===" ")return!0;break}return!1},r=p=>{let m=!1,b=!1;for(let v=0;v<p.length;v++){const g=p[v];if(g==="\\"){v++;continue}if(!b&&g==="'"){m=!m;continue}if(!m&&g==='"'){b=!b;continue}if(!m&&!b&&g===">")return v}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const b=p[m];if(b!=="`"&&b!=="~")return null;let v=m;for(;v<p.length&&p[v]===b;)v++;const g=v-m;return g<3?null:{markerChar:b,markerLen:g,rest:p.slice(v)}},a=(p,m)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let v=!1,g=0;for(;g<p.length;){const y=p[g];if(y!=="<"){s(y)||(v=!0),g++;continue}const k=r(p.slice(g));if(k===-1){v=!0,g++;continue}const E=p.slice(g,g+k+1);let L=1;for(;L<E.length&&s(E[L]);)L++;if(L>=E.length){v=!0,g++;continue}const $=E[L];if($==="!"||$==="?"){v=!0,g+=k+1;continue}if($==="/"){v=!0,g+=k+1;continue}const w=L;for(;L<E.length&&o(E[L]);)L++;if(L===w){v=!0,g++;continue}const M=E.slice(w,L).toLowerCase(),N=E[L];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){v=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),S=/\/\s*>$/.test(E),I=F.test(p.slice(g+k+1)),B=F.test(e.slice(m+g+k+1)),R=/[\r\n]/.test(e.slice(m+g+k+1));if(v&&n.has(M)&&!S&&!I&&(B||R))return g;v=!0,g+=k+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
233
|
-
`,h),m=p!==-1,b=m&&p>h&&e[p-1]==="\r",v=m?b?p-1:p:e.length,g=e.slice(h,v),y=m?b?`\r
|
|
234
|
-
`:`
|
|
235
|
-
`:"",k=l(g);let E=g;if(!c&&!k){const L=a(g,h);if(L!==-1){const $=y||`
|
|
236
|
-
`;E=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=E,f+=y,k&&(c?k.markerChar===u&&k.markerLen>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=k.markerChar,d=k.markerLen)),h=m?p+1:e.length}return f}function EZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const 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&&s(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let b=m+1;for(;b<d.length&&s(d[b]);)b++;if(b>=d.length||d[b]!=="/"){m=d.indexOf("<",m+1);continue}for(b++;b<d.length&&s(d[b]);)b++;if(b+p.length>d.length){m=d.indexOf("<",m+1);continue}let v=!0;for(let y=0;y<p.length;y++){const k=d[b+y];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[y]){v=!1;break}}if(!v){m=d.indexOf("<",m+1);continue}let g=b+p.length;if(g<d.length&&o(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&s(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&o(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const b=f+m;if(l(d,b+1,p))return d;const v=i(d.slice(b+1));return v?`${d.slice(0,b+1)}
|
|
237
|
-
${v}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
238
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
239
|
-
`:`
|
|
240
|
-
`,u=d+1}return c}function TZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&s(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&s(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&s(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const b=m-h;return b<3?null:{markerChar:p,markerLen:b,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(`
|
|
241
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,b=e.slice(d,m),v=h?p?`\r
|
|
242
|
-
`:`
|
|
243
|
-
`:"",g=o(b),y=g?.prefix??"",k=g?.content??b,E=i(k);E&&(l?E.markerChar===a&&E.markerLen>=c&&/^\s*$/.test(E.rest)&&(l=!1,a="",c=0):(l=!0,a=E.markerChar,c=E.markerLen));let L=k;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(w,M,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return w;const S=F.slice(0,N).replace(/^[\t ]+/,"");if(S.length>0){const I=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",B=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!B||I!==B)return w}return`${M}
|
|
244
|
-
|
|
245
|
-
`});if(y){const $=y+L.split(`
|
|
246
|
-
`).join(`
|
|
247
|
-
${y}`);u+=$}else u+=L;u+=v,d=h?f+1:e.length}return u}function NZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const s=S=>S===" "||S===" ",o=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let B=0;B<S.length;B++){const R=S[B];if(R===" "){if(I++,I>=4)return!0;continue}if(R===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,B=!1,R=0;for(;I<S.length;){for(;I<S.length&&s(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(B=!0,I++;I<S.length&&s(S[I]);)I++;R=I}if(!B)return null;const P=S.slice(0,R);return{prefix:P,key:P.replace(/[ \t]+$/,""),content:S.slice(R)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const B=S[I];if(B!==" "&&B!==" ")return!1}return!0},u=S=>{if(o(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let B=1;for(;B<I.length&&s(I[B]);)B++;if(B>=I.length||I[B]==="/"||I[B]==="!"||I[B]==="?")return"";const R=B;for(;B<I.length&&i(I[B]);)B++;if(B===R)return"";const P=I.slice(R,B).toLowerCase();if(!n.has(P))return"";const z=I[B];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":P},d=S=>{if(o(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let B=1;for(;B<I.length&&s(I[B]);)B++;if(B>=I.length)return null;const R=I[B]==="/";if(R)for(B++;B<I.length&&s(I[B]);)B++;const P=I[B];if(!P||P==="!"||P==="?")return null;const z=B;for(;B<I.length&&i(I[B]);)B++;if(B===z)return null;const W=I.slice(z,B).toLowerCase();if(!n.has(W))return null;const ee=I[B];if(ee&&ee!==" "&&ee!==" "&&ee!==">"&&ee!=="/")return null;if(R)return{type:"close",name:W};if(/\/\s*>\s*$/.test(I))return{type:"open",name:W,complete:!0};const U=I.indexOf(">",B);if(U!==-1){const Y=I.slice(U+1);if(new RegExp(`<\\s*\\/\\s*${W}\\s*>`,"i").test(Y))return{type:"open",name:W,complete:!0}}return{type:"open",name:W,complete:!1}},f=S=>{if(o(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const B=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(B?.[1])return B[1].toLowerCase();const R=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const P=R[1].toLowerCase();return P===R[2].toLowerCase()?P:null};let h=!1,p="",m=0;const b=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;const B=S[I];if(B!=="`"&&B!=="~")return null;let R=I;for(;R<S.length&&S[R]===B;)R++;const P=R-I;return P<3?null:{markerChar:B,markerLen:P,rest:S.slice(R)}},v=S=>b(S),g=S=>{const I=r(S);return I?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},y=(S,I,B)=>{let R=S,P=0;for(;R<e.length;){const z=e.indexOf(`
|
|
248
|
-
`,R),W=z!==-1,ee=W&&z>R&&e[z-1]==="\r",U=W?ee?z-1:z:e.length,Y=e.slice(R,U),ue=l(Y),fe=ue?.key??"";if(P>0&&I&&fe!==I)break;const oe=ue?.content??Y,Z=d(oe);if(Z?.name===B){if(Z.type==="open")Z.complete||P++;else if(P>0&&(P--,P===0))return!1}else if(P>0&&(c(oe)||g(oe)))return!0;if(W)R=z+1;else break}return!1};let k="",E=0,L=!0,$=!1,w=!1,M=`
|
|
249
|
-
`;const N=[];let F="";for(;E<e.length;){const S=e.indexOf(`
|
|
250
|
-
`,E),I=S!==-1,B=I&&S>E&&e[S-1]==="\r",R=I?B?S-1:S:e.length,P=e.slice(E,R),z=I?B?`\r
|
|
251
|
-
`:`
|
|
252
|
-
`:"",W=l(P),ee=W?.key??"",U=W?.content??P,Y=v(U);Y&&(h?Y.markerChar===p&&Y.markerLen>=m&&/^\s*$/.test(Y.rest)&&(h=!1,p="",m=0):(h=!0,p=Y.markerChar,m=Y.markerLen));const ue=N.length>0;if(!h&&!ue){const oe=u(U),Z=!!oe&&!L&&$&&w&&y(E,ee,oe);oe&&!L&&(!$||Z)&&(ee&&F&&ee===F?k+=`${ee}${M}`:ee||(k+=M))}if(k+=P,k+=z,z&&(M=z),!h){const oe=d(U);if(oe){if(oe.type==="open")oe.complete||N.push(oe.name);else for(let Z=N.length-1;Z>=0;Z--)if(N[Z]===oe.name){N.length=Z;break}}}const fe=c(U);L=fe,$=!fe&&a(U),w=!fe&&!!f(U),F=ee,E=I?S+1:e.length}return k}function mM(e,t,n={}){const s=uM(n),o=s?Gc():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(QY(t,n)&&(t.stream.reset(),XY(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
|
|
253
|
-
`)?`
|
|
254
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
|
|
255
|
-
`)?`
|
|
256
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
|
|
257
|
-
`)?`
|
|
258
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
259
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
|
|
260
|
-
`)?`
|
|
261
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,v,g)=>`${v}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
|
|
262
|
-
`)?`
|
|
263
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
264
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const b=tu(n.customHtmlTags);if(b.length&&(r=MZ(r,b),r=EZ(r,b),r=NZ(r,b),r=TZ(r,b),r.includes("</")))for(const v of b){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=AZ(r));const l=uZ(r);if(l){const b=n.preTransformTokens,v=n.postTransformTokens;if(fM(t,n)||typeof b=="function"||typeof v=="function"){const g=Y_(t,r,{__markstreamFinal:i},n),y=typeof b=="function"&&b(g)||g;typeof v=="function"&&v(y)}return N0(l,s,o)}const a=Y_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return N0([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=V_(d,p,s);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const v=b[0],g=v?.type;v&&typeof g=="string"?m=V_(b,void 0,s):m=b}}if(m=CZ(m,i,r),m=pM(m,r,t,n,i)[0],m=xZ(m,t,n,i),i){const b=new WeakSet,v=g=>{if(!g||typeof g!="object"||b.has(g))return;if(b.add(g),Array.isArray(g)){for(const k of g)v(k);return}const y=g;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const k of Object.values(y))v(k)};v(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),N0(m,s,o)}function eS(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Dl(t);let o=0;for(;o<e.length;){const i=rk(e,o,s.options(),ik);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=VY(e,o,s.options(l)),c=Q_(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=nu(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=su(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(jY()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=ts(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Q_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const IZ=new Set([...jd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),$Z=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"]),tS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function nS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LZ(e){return typeof e=="string"?e:e==null?"":String(e)}function gM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function gl(e){return LZ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function vM(e){return gl(e).replace(/`/g,"`")}function Em(e){return String(e??"").trim().toLowerCase()}function uk(e,t="safe"){const n=Em(e);return n?t==="escape"?!0:t==="trusted"?jd.has(n):!$Z.has(n):!1}function yM(e,t="safe"){const n=Em(e);return n?t==="escape"?!0:t==="trusted"?jd.has(n):IZ.has(n):!1}function sS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${vM(s)}"`).join("")}function FZ(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||ba(o,{tagName:t,attrName:"srcset"})})}function kM(e,t,n,s){return vV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?FZ(t,s):!!(yV.has(e)&&t&&ba(t,{tagName:s,attrName:e}))}function ua(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function bM(e,t,n,s=!1){if(t!=="safe"||Em(n)!=="a")return e;const o=ua(e,"href");if(s&&(!o||!e[o])){const a=ua(e,"target"),c=ua(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=ua(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=ua(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 oS(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!gM(r)||kM(l,i,t,n)||(s[r]=i)}return bM(s,t,n,!!ua(e,"href"))}function xM(e,t){const n=e.toLowerCase();return M6.has(n)?!1:nS(t,n)||nS(t,e)}function dk(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!gM(r)||kM(l,i,t,n)||(s[r]=i)}return bM(s,t,n,!!ua(e,"href"))}function kp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function pv(e,t="safe",n){const s=dk(kp(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function OZ(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function RZ(e){const t={};for(const[n,s]of Object.entries(e))t[n]=OZ(s,n);return t}function iS(e){return e.trim().length>0}function BZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);iS(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);iS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||Fa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function DZ(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 s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||Fa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function PZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${gl(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${gl(s)}`:` ${gl(s)}="${vM(o)}"`).join("");return e.type==="self_closing"?`<${gl(t)}${n} />`:`<${gl(t)}${n}>`}function HZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;tS.lastIndex=0;let n;for(;(n=tS.exec(e))!==null;)if(xM(n[1],t))return!0;return!1}function Bc(e,t="safe"){if(!e)return"";if(t==="escape")return gl(e);const n=DZ(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(gl(r.content??""));continue}const l=Em(r.tagName);if(!l)continue;if(yM(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"&&uk(l,t)){o.push(PZ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${sS(oS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${sS(oS(r.attrs??{},t,l))}>`),Fa.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const WZ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],rS="http://www.w3.org/2000/svg",zZ=new Set(["script","style","iframe","object","embed","link","meta"]),UZ=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),qZ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),jZ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),VZ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function KZ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function GZ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function YZ(e){const t=e.nodeName.toLowerCase();return t==="use"?KZ(e):t==="image"?GZ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():VZ.has(t)}function ZZ(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 QZ(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?ba(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ba(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ba(i,{tagName:s,attrName:o})?"":i:""}function XZ(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function wM(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function _M(e){const t=wM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=XZ(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function lS(e){const t=wM(e);return WZ.some(n=>n.test(t))||_M(t)}function JZ(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 Kf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function SM(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!zZ.has(s)){if(s==="br"){t.push(`
|
|
265
|
-
`);return}for(const o of Array.from(n.childNodes))SM(o,t)}}function eQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];SM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Kf(t.getAttribute("width")),i=Kf(t.getAttribute("height")),r=Kf(t.getAttribute("x")),l=Kf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(rS,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const h=e.ownerDocument.createElementNS(rS,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function tQ(e){eQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!UZ.has(s)){n.remove();continue}if(s==="style"&&lS(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&lS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(qZ.has(r)&&i.value){const l=QZ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(jZ.has(r)&&i.value&&_M(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=ZZ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}JZ(n)}}function Ewe(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 tQ(n),nQ(n)?null:n}catch{return null}}function nQ(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){YZ(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const aS=[];function $0(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function sQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function oQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function cS(e=`editor-${Date.now()}`,t={}){const n=xG(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=h=>f[h]??s[h]??h}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...m]=h;typeof p=="function"&&n.use(p,...m)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(aS.length)for(const f of aS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(PW),n.use(zW),n.use(RW);const i=nz,r=i.default??i;n.use(r),n.use(OW),n.use(FW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const g=v.map[0],y=v.map[1],k=v.markup,E=k[0],L=k.length,$=b[Math.max(0,y-1)]??"";let w=0;for(;w<$.length&&($[w]===" "||$[w]===" ");)w++;let M=0;for(;w+M<$.length&&$[w+M]===E;)M++;let N=w+M;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;const F=m?!0:y>g+1&&M>=L&&N===$.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const b=p.src[m-1],v=p.src[m+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const g=p.push("text","",0);g.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],m=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),g=sQ(m),y=$0(g),k=oQ(`editor-${e}-${h}-${g}`),E=$0(o("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${k}">
|
|
266
|
-
<div class="code-header">
|
|
267
|
-
<span class="code-lang">${$0(g.toUpperCase())}</span>
|
|
268
|
-
<button class="copy-button" data-code="${v}">${E}</button>
|
|
269
|
-
</div>
|
|
270
|
-
<div class="code-editor"></div>
|
|
271
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const m=a.exec(p.src.slice(p.pos));if(!m)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+m[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const g=m[1],y=p.push("reference","span",0);y.content=g,y.markup=m[0],y.raw=m[0]}return p.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const m=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function iQ({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 CM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:iQ({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const uS=new WeakMap;function rQ(e){let t=uS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},uS.set(e,t)),t}function dS(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function fk(e){return!!(e.themes?.length||e.langs?.length)}function AM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function lQ(e,t){return!t?.length||e.registeredAllLangs?!0:AM(e.registeredLangs,t)}function L0(e,t){return fk(t)&&AM(e.registeredThemes,t.themes)&&lQ(e,t.langs)}function aQ(e,t){if(!fk(t))return t;const n=dS(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:dS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const cQ={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 uQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function MM(e){const t=uQ(e);return cQ[t]??t}function EM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>MM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function TM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function dQ(e){return TM(e)?.join("\0")??""}function NM(e,t){const n=TM(e),s=EM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function bp(e,t){return`${dQ(e)}\0\0${EM(t)?.join("\0")??""}`}function Twe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=NM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:bp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Nwe(e,t={},n){if(!e)return"ready";const s=NM(t.themes,t.langs),o=bp(s.themes,s.langs),i=n&&n===o?n:o,r=rQ(e);if(r.completed.has(i))return"ready";if(L0(r,s))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)||L0(r,s))return r.completed.add(i),"ready";const c=aQ(r,s),u=bp(c.themes,c.langs);return r.completed.has(u)||L0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(fk(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function ec(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function fS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var fQ=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=hS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=hS();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=gQ(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=mQ(this.source.slice(this.visible.length),v,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=ec(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ec(s,1e3,1)),this.normalizedTargetLatencyMs=ec(o,900,1),this.normalizedCatchUpLatencyMs=ec(i,350,1),this.normalizedCatchUpThreshold=fS(r,600),this.normalizedStartDelayMs=fS(a,80),this.maxCommitFps=Math.trunc(ec(l,30,1)),this.maxCharsPerCommit=Math.trunc(ec(c,80,1)),this.flushOnFinish=u,this.segmenter=pQ(),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 hQ(e={},t){const n=new fQ(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 pQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function mQ(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function hS(){return typeof performance<"u"?performance.now():Date.now()}function gQ(e,t,n){return Math.min(n,Math.max(t,e))}var vQ=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const mv=Symbol.for("markstream-vue:node-lifecycle"),pS='<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>',mS='<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>',yQ={id:"material",core:{"":mS,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:mS,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:pS,csharp:pS,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:()=>go(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},gv=new Map;let gS="material";const xc=new Map,vS=new Map;let vv=null;function kQ(e){gv.set(e.id,e)}function bQ(e){return vQ(this,null,function*(){var t,n,s;if(xc.has(e.id))return(t=xc.get(e.id))!=null?t:null;let o=vS.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(xc.set(e.id,i),vv?.(),i)).catch(()=>(xc.set(e.id,null),null)),vS.set(e.id,o)),o})}const xQ=Ia(0);vv=()=>{xQ.value++},kQ(yQ);const wQ={"":"",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 hk(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=wQ[n])!=null?t:n}function Iwe(e){const t=hk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function $we(e){return(function(s){const o=gv.get(gS);if(!o)return;const i=o.core[s];if(i)return i;const r=xc.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!xc.has(o.id)&&bQ(o)})(hk(e))||((n=(t=gv.get(gS))==null?void 0:t.fallback)!=null?n:"");var t,n}const Lwe={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 IM=!1;function Fwe(){return IM}function Owe(){IM=!0}var Tm=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Go=null,kh=!1,Nm=mk;function Im(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function pk(){try{const e=globalThis;return Im(e?.katex)}catch{return null}}function mk(){return Tm(null,null,function*(){const e=pk();if(e)return e;const t=yield go(()=>import("./katex-DnlPpQZa.js"),[]);try{yield go(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Im(t)})}function _Q(e){Nm=e,Go=null,kh=!1}function SQ(e){_Q(mk)}function $M(){return typeof Nm=="function"}function Rwe(){var e;const t=Nm;if(!t||t===mk)return null;if(Go)return Go;const n=pk();if(n)return Go=n,Go;try{const s=t();return s&&typeof s?.then!="function"?(Go=(e=Im(s))!=null?e:s,Go):null}catch{return null}}function gk(){return Tm(this,null,function*(){var e;const t=pk();if(t)return Go=t,Go;if(Go)return Go;if(kh)return null;const n=Nm;if(!n)return kh=!0,null;try{const s=yield n();if(s)return Go=(e=Im(s))!=null?e:s,Go}catch{}return kh=!0,null})}function LM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let kl=null,hl=null;const vi=new Map,Ir=new Map;let xp=5;const pa=new Set;function $d(){if(vi.size<xp&&pa.size){const e=Array.from(pa);pa.clear();for(const t of e)try{t()}catch{}}}function CQ(e){kl=e,hl=null,kl.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=vi.get(n);if(i)if(vi.delete(n),clearTimeout(i.timeoutId),$d(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Ir.set(a,s),Ir.size>200){const c=Ir.keys().next().value;Ir.delete(c)}}i.resolve(s)}},kl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of vi.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));vi.clear(),$d()}}function AQ(){var e;kl&&((e=kl.terminate)==null||e.call(kl)),kl=null,hl=null}function MQ(e,t=!0,n=2e3,s){return Tm(this,null,function*(){performance.now();const o=LM(e);if(!$M()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(hl)return Promise.reject(hl);const i=`${t?"d":"i"}:${o}`,r=Ir.get(i);if(r)return Promise.resolve(r);const l=kl||(hl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),hl.name="WorkerInitError",hl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(hl);if(vi.size>=xp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=vi.size,a.max=xp,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{vi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),$d()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),vi.has(u)&&vi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),$d()},{once:!0});const f=a,h=c;vi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function Bwe(e,t=!0,n){const s=`${t?"d":"i"}:${LM(e)}`;if(Ir.set(s,n),Ir.size>200){const o=Ir.keys().next().value;Ir.delete(o)}}const EQ="WORKER_BUSY";function TQ(e=2e3,t){return vi.size<xp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),pa.delete(r),n())};if(pa.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,pa.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>$d()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),pa.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Nu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Dwe(e){return Tm(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!$M()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Nu.timeout,c=(i=s.waitTimeout)!=null?i:Nu.waitTimeout,u=(r=s.backoffMs)!=null?r:Nu.backoffMs,d=(l=s.maxRetries)!=null?l:Nu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Nu.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield MQ(t,n,a,h)}catch(m){if(m?.code!==EQ||p>=f)throw m;if(p++,yield TQ(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function wc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function NQ(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function yv(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=NQ(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function kv(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 FM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function bv(e,t=360,n=500){return FM(e,t,n)}function xv(e,t=360,n=500){return FM(e,t,n)}var IQ=Object.defineProperty,$Q=Object.defineProperties,LQ=Object.getOwnPropertyDescriptors,yS=Object.getOwnPropertySymbols,FQ=Object.prototype.hasOwnProperty,OQ=Object.prototype.propertyIsEnumerable,kS=(e,t,n)=>t in e?IQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OM=(e,t)=>{for(var n in t||(t={}))FQ.call(t,n)&&kS(e,n,t[n]);if(yS)for(var n of yS(t))OQ.call(t,n)&&kS(e,n,t[n]);return e},vk=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const yk=()=>go(()=>import("./mermaid.core-CuWz3x7I.js").then(e=>e.bn),[]);let vr=null,kk=yk;function RQ(e){kk=e,vr=null}function BQ(e){RQ(yk)}function DQ(){return typeof kk=="function"}function bS(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=OM({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},$Q(n,LQ(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function xS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=OM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function Pwe(){return vk(this,null,function*(){if(vr)return vr;const e=(function(){try{const s=globalThis;return bS(s?.mermaid)}catch{return null}})();if(e)return vr=e,xS(vr),vr;const t=kk;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===yk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(vr=bS(n),xS(vr),vr):null})}let po=null,pl=null;const js=new Map;let wS=5,_S=!1;const PQ="WORKER_BUSY",HQ="MERMAID_DISABLED";function WQ(e){po=e,pl=null;const t=e;po.onmessage=n=>{if(po!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=js.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},po.onerror=n=>{var s,o;if(po===t)if(js.size!==0){try{_S?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of js.entries())r.reject(new Error(`Worker error: ${n.message}`));js.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},po.onmessageerror=n=>{var s,o;if(po===t)if(js.size!==0){try{_S?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of js.entries())r.reject(new Error("Worker messageerror"));js.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function zQ(){var e;if(po)try{for(const[t,n]of js.entries())n.reject(new Error("Worker cleared"));js.clear(),(e=po.terminate)==null||e.call(po)}catch{}po=null,pl=null}function RM(e,t,n=1400){if(!DQ()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=HQ,Promise.reject(o)}if(pl)return Promise.reject(pl);const s=po||(pl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),pl.name="WorkerInitError",pl.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(pl);if(js.size>=wS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=PQ,o.inFlight=js.size,o.max=wS,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),js.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};js.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return js.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=js.get(r);f&&f.reject(d)},n)})}function Hwe(e,t,n=1400){return vk(this,null,function*(){try{return yield RM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Wwe(e,t,n=1400){return vk(this,null,function*(){try{return yield RM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function zwe(){if(po)try{for(const[e,t]of js.entries())t.reject(new Error("Worker terminated"));js.clear(),po.terminate()}finally{po=null}}var UQ=Object.defineProperty,qQ=Object.defineProperties,jQ=Object.getOwnPropertyDescriptors,SS=Object.getOwnPropertySymbols,VQ=Object.prototype.hasOwnProperty,KQ=Object.prototype.propertyIsEnumerable,CS=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))VQ.call(t,n)&&CS(e,n,t[n]);if(SS)for(var n of SS(t))KQ.call(t,n)&&CS(e,n,t[n]);return e},Dt=(e,t)=>qQ(e,jQ(t)),Jn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const GQ="__global__",F0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",wv=(()=>{const e=globalThis;if(e[F0])return e[F0];const t={scopedCustomComponents:{},revision:Ia(0)};return e[F0]=t,t})(),AS=wv.revision,YQ=Symbol("markstreamCustomComponents"),ZQ=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Gd(e){return ZQ.has(String(e).trim().toLowerCase())}function QQ(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function O0(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Ci(n),Ci(QQ(n))]))!o||Gd(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Ms(e){const t=Vt(YQ,null);return D(()=>{var n;return AS.value,(function(s,o={}){return AS.value,rt(rt(rt({},O0(wv.scopedCustomComponents[GQ]||{})),O0(o)),O0((function(i){return i&&wv.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const XQ=["aria-label"],JQ={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"},eX={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"},vn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Xo=vn(Ge({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),T("svg",eX,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),T("svg",JQ,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,XQ))}),[["__scopeId","data-v-be21ab83"]]);Xo.install=e=>{e.component(Xo.__name,Xo)};const tX={class:"emoji-node"},Bo=vn(Ge({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),T("span",tX,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Bo.install=e=>{e.component(Bo.__name,Bo)};const nX=["id"],sX=["title"],Jo=vn(Ge({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(x(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,sX)],8,nX))}}),[["__scopeId","data-v-c1463a29"]]);Jo.install=e=>{e.component(Jo.__name,Jo)};const BM=(()=>{try{return!1}catch{}return!1})();function R0(e){BM&&console.warn(e)}function MS(e,t="safe",n){return dk(e,t,n)}function DM(e){return RZ(e)}function B0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function bk(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=pv((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),B0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),B0(r.value)]):Object.entries(o).map(([r,l])=>[r,B0(l)]):null,t,n);var o;if(!s)return;const i=DM(kp(s));return Object.keys(i).length>0?i:void 0}function ES(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Iu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function D0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return xM(d,f)})(e,s);if(jd.has(e.toLowerCase())||!l&&yM(e,i))return null;if(!l&&uk(e,i))return r?[ES(e,t,!0)]:[ES(e,t),...n,`</${e}>`];const a=dk(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=DM(a);return gn(d,Dt(rt({},f),{key:u}),n.length>0?n:void 0)}return gn(e,Dt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function PM(e,t){return HZ(e,t)}function wp(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=D0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Iu(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=D0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Iu(c[c.length-1].children,m):Iu(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&R0(`Auto-closing unclosed tag: <${p.tagName}>`)}else R0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=D0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Iu(c[c.length-1].children,f):Iu(u,f),R0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(BZ(e),t,n)}catch(o){return s=o,BM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const oX=["innerHTML"],ei=vn(Ge({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Vt("markstreamHtmlPolicy",void 0),s=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Ms(()=>t.customId),i=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Bc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=wp(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!PM(l,o.value))return{mode:"html",content:Bc(l,s.value)};const a=wp(l,o.value,s.value);return a===null?{mode:"html",content:Bc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),T("span",{key:0,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[re(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),T("span",{key:1,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(x(),T("span",{key:2,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,oX))}}),[["__scopeId","data-v-d17f12b0"]]);ei.install=e=>{e.component(ei.__name,ei)};const iX={class:"inline-code"},rX={key:0},oo=vn(Ge({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Hd(),s=Vt("markstreamFade",void 0),o=Vt("markstreamTextStreamState",void 0),i=Vt("markstreamStreamVersion",void 0),r=D(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=D(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=D(()=>!l.value),u=D(()=>{var g;const y=(g=n["index-key"])!=null?g:n.indexKey;return y==null||y===""?"":String(y)}),d=X(t.node.code),f=X("");let h=i?.value;const p=X(0);function m(){return d.value+f.value}function b(){f.value&&(d.value=m(),f.value="")}Ze([()=>t.node.code,u,l,()=>i?.value],([g,y,k,E])=>{const L=String(g??""),$=u.value,w=E!==h;h=E;const M=CM({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:w});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(p.value+=1),$&&o?.set($,L)},{immediate:!0}),Ze(l,g=>{var y;g||(y=m(),d.value=y,f.value="")});const v=D(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,y)=>(x(),T("code",iX,[c.value?(x(),T(Be,{key:0},[Qe(O(a.value),1)],64)):(x(),T(Be,{key:1},[d.value?(x(),T("span",rX,O(d.value),1)):le("",!0),f.value?(x(),T("span",{key:1,class:Pe(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);oo.install=e=>{e.component(oo.__name,oo)};const _v=X(!1),TS=X(""),NS=X("top"),sd=X(null),od=X(null),Sv=X(null),Cv=X(null),IS=X(null);let bh=null,xh=null,Av=0;function HM(){bh&&(clearTimeout(bh),bh=null),xh&&(clearTimeout(xh),xh=null)}let Gf=!1,Yf=null,$S=!1;function lX(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Av;HM();const l=()=>Jn(null,null,function*(){var a,c;if(yield(function(){return Jn(this,null,function*(){if(!Gf&&!$S&&typeof document<"u"){Yf!=null||(Yf=Jn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([go(()=>import("./vue.runtime.esm-bundler-DzIUJ9SW.js"),[]),go(()=>import("./Tooltip-5xFjGt0g.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:_v.value,"anchor-el":sd.value,content:TS.value,placement:NS.value,id:od.value,originX:Sv.value,originY:Cv.value,isDark:(p=IS.value)!=null?p:void 0})}}).mount(h),Gf=!0}));try{yield Yf}catch(u){Gf=!1,Yf=null,$S=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Gf&&r===Av){od.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,sd.value=e,TS.value=t,NS.value=n,Sv.value=(a=o?.x)!=null?a:null,Cv.value=(c=o?.y)!=null?c:null,IS.value=typeof i=="boolean"?i:null,_v.value=!0;try{e.setAttribute("aria-describedby",od.value)}catch{}}});s?l():bh=setTimeout(l,80)}function aX(e=!1){Av+=1,HM();const t=()=>{if(sd.value&&od.value)try{sd.value.removeAttribute("aria-describedby")}catch{}_v.value=!1,sd.value=null,od.value=null,Sv.value=null,Cv.value=null};e?t():xh=setTimeout(t,120)}const Mv={"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..."},Ev=e=>{var t;return(t=Mv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function LS(e){return{t(t){if(e.te&&Mv[t]&&!e.te(t))return Ev(t);const n=e.t(t);return n===t&&Mv[t]?Ev(t):n}}}function cX(){const e=(function(){var t,n;try{const s=Qs(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return LS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return LS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Ev}}function uX(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const dX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],fX={key:1,class:"image-placeholder"},hX={key:1,class:"image-node__raw-text"},pX={key:0,class:"image-shimmer-overlay"},mX={key:1,class:"image-node__raw-text"},gX={key:2,class:"image-error"},Sl=vn(Ge({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=X(!1),i=X(!1),r=X(""),l=X("primary"),a=X(null),c=Hd(),u=Vt(mv,null);let d="",f=null;const h=D(()=>h_(n.node.src)),p=D(()=>h_(n.fallbackSrc)),m=D(()=>r.value),b=D(()=>!n.lazy),v=D(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=D(()=>l.value==="failed"),y=D(()=>!b.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=D(()=>uX(n,c));function E(B=k.value){B&&a.value&&u?.reportHeight(B,a.value.offsetHeight)}function L(B=k.value){B&&pt(()=>{E(B)})}function $(){f&&(clearTimeout(f),f=null)}function w(){const B=k.value;B&&d!==B&&(d&&u?.markSettled(d),$(),d=B,u?.markPending(B),typeof window<"u"&&(f=window.setTimeout(()=>{d===B&&(L(B),M())},8e3)))}function M(){return Jn(this,null,function*(){const B=d;B&&($(),d="",yield pt(),E(B),u?.markSettled(B))})}function N(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,o.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,s("error",r.value),L()}function F(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(B){B.preventDefault(),o.value&&!i.value&&s("click",[B,m.value])}const{t:I}=cX();return Ze([h,p,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ze([v,o,i,m,()=>n.lazy],([B,R,P,z,W])=>B&&z&&!P?R?(M(),void L()):W?(w(),void L()):void(R||P||w()):(M(),void L()),{flush:"post",immediate:!0}),ps(()=>{(function(){const B=d;B&&($(),d="",u?.markSettled(B))})()}),(B,R)=>{var P,z,W,ee,U;return x(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(x(),T("img",{key:0,src:m.value,alt:String((z=(P=n.node.alt)!=null?P:n.node.title)!=null?z:""),title:String((ee=(W=n.node.title)!=null?W:n.node.alt)!=null?ee:""),class:Pe(["image-node__img",{"is-loading":!b.value&&!o.value,"is-loaded":b.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(U=n.node.alt)!=null?U:C(I)("image.preview"),onError:N,onLoad:F,onClick:S},null,42,dX)):le("",!0),e.node.loading&&!i.value?(x(),T("span",fX,[n.usePlaceholder?Rn(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[0]||(R[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),T("span",hX,O(e.node.raw),1))])):le("",!0),re(Tl,{name:"shimmer-fade"},{default:Ee(()=>[y.value&&!e.node.loading?(x(),T("span",pX,[n.usePlaceholder?Rn(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[1]||(R[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),T("span",mX,O(e.node.raw),1))])):le("",!0)]),_:3}),g.value?(x(),T("span",gX,[Rn(B.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[2]||(R[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,O(C(I)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Sl.install=e=>{e.component(Sl.__name,Sl)};const vX={key:2},sr=Ge({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Ms(()=>t.customId),s=Vt("markstreamHtmlPolicy",void 0),o=Vt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const b=(p=o?.value)!=null?p:{};return Dt(rt({},b),{customId:(m=t.customId)!=null?m:b.customId,htmlPolicy:i.value})}),l=Ii({loader:()=>Promise.resolve().then(()=>Mk),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Gd(String(t.node.type)))),u=D(()=>c.value?bk(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=D(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(x(),xe(Ks(a.value),kn({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:Ee(()=>[d.value?(x(),xe(C(l),kn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(x(),xe(C(l),kn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),xe(Ks(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),T("span",vX,O(h.value),1)):le("",!0)}}),yX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],kX={key:0,translate:"no",class:"markstream-pre__diff-code"},bX={class:"markstream-pre__diff-number","aria-hidden":"true"},xX={class:"markstream-pre__diff-content"},wX={class:"markstream-pre__diff-content-inner"},_X={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},SX=["textContent"],Ko=Ge({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=D(()=>{var S,I,B;const R=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((B=String(R).split(/\s+/g)[0])!=null?B:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${n.value}`),o=D(()=>{var S,I,B,R,P;return((S=t.node)==null?void 0:S.diff)===!0?String((B=(I=t.node)==null?void 0:I.code)!=null?B:""):(function(z,W){const ee=String(z??"");return W?ee:ee.replace(/\r\n$|\n$|\r$/,"")})((R=t.node)==null?void 0:R.code,((P=t.node)==null?void 0:P.loading)===!0)}),i=D(()=>o.value.split(/\r\n|\n|\r/)),r=D(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=D(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=D(()=>l.value&&t.diffInline===!0),c=D(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",B={}){const R=u(S);return{code:S,kind:R&&I!=="hunk"&&!B.preserveBlankKind?"context":I,empty:R}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const B=f(S),R=f(I),P=(function(ue,fe){const oe=ue.length,Z=fe.length;if((oe+1)*(Z+1)>15e5)return null;const te=Z+1,ae=new Uint32Array((oe+1)*(Z+1));for(let ce=1;ce<=oe;ce++)for(let ge=1;ge<=Z;ge++){const q=ce*te+ge;if(ue[ce-1]===fe[ge-1])ae[q]=ae[(ce-1)*te+(ge-1)]+1;else{const se=ae[(ce-1)*te+ge],ye=ae[ce*te+(ge-1)];ae[q]=se>=ye?se:ye}}const He=[];let he=oe,K=Z;for(;he>0&&K>0;)ue[he-1]===fe[K-1]?(He.push({originalIndex:he-1,modifiedIndex:K-1}),he--,K--):ae[(he-1)*te+K]>=ae[he*te+(K-1)]?he--:K--;return He.reverse(),He})(B,R);if(P){const ue=[];let fe=0,oe=0;for(const Z of P){for(;fe<Z.originalIndex;)ue.push(Dt(rt({},d(B[fe],"removed",{preserveBlankKind:h(B,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;oe<Z.modifiedIndex;)ue.push(Dt(rt({},d(R[oe],"added",{preserveBlankKind:h(R,oe)})),{key:`inline-added-source-${oe}`,number:oe+1})),oe++;ue.push(Dt(rt({},d(R[Z.modifiedIndex])),{key:`inline-context-source-${Z.originalIndex}-${Z.modifiedIndex}`,number:Z.modifiedIndex+1})),fe=Z.originalIndex+1,oe=Z.modifiedIndex+1}for(;fe<B.length;)ue.push(Dt(rt({},d(B[fe],"removed",{preserveBlankKind:h(B,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;oe<R.length;)ue.push(Dt(rt({},d(R[oe],"added",{preserveBlankKind:h(R,oe)})),{key:`inline-added-source-${oe}`,number:oe+1})),oe++;return ue}const z=[];let W=0,ee=B.length-1,U=R.length-1;for(;W<=ee&&W<=U&&B[W]===R[W];)z.push(Dt(rt({},d(R[W])),{key:`inline-prefix-${W}`,number:W+1})),W++;const Y=[];for(;ee>=W&&U>=W&&B[ee]===R[U];)Y.unshift(Dt(rt({},d(R[U])),{key:`inline-suffix-${U}`,number:U+1})),ee--,U--;for(let ue=W;ue<=ee;ue++)z.push(Dt(rt({},d(B[ue],"removed",{preserveBlankKind:h(B,ue)})),{key:`inline-removed-source-${ue}`,number:""}));for(let ue=W;ue<=U;ue++)z.push(Dt(rt({},d(R[ue],"added",{preserveBlankKind:h(R,ue)})),{key:`inline-added-source-${ue}`,number:ue+1}));return z.concat(Y)}const v=D(()=>{var S,I,B,R;const P=(function(U){const Y=U.some(fe=>p(fe)),ue=U.some(fe=>m(fe));return Y&&ue||(function(){var fe,oe,Z,te;if(n.value==="diff")return!0;const ae=(te=(Z=String((oe=(fe=t.node)==null?void 0:fe.raw)!=null?oe:"").split(/\r?\n/,1)[0])==null?void 0:Z.trim())!=null?te:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ae)})()&&(Y||ue)})(i.value),z=(function(){var U,Y;return((U=t.node)==null?void 0:U.originalCode)!=null||((Y=t.node)==null?void 0:Y.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:P?(function(U){const Y=[];let ue=1;for(const[fe,oe]of U.entries())if(oe.startsWith("@@"))Y.push(Dt(rt({},d(oe,"hunk")),{key:`inline-hunk-${fe}`,number:""}));else if(p(oe))Y.push(Dt(rt({},d(oe.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${fe}`,number:""}));else if(m(oe))Y.push(Dt(rt({},d(oe.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${fe}`,number:ue++}));else{const Z=oe.startsWith(" ")?oe.slice(1):oe;Y.push(Dt(rt({},d(Z)),{key:`inline-context-${fe}`,number:ue})),ue++}return Y})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!P&&z){const U=f((B=t.node)==null?void 0:B.originalCode),Y=f((R=t.node)==null?void 0:R.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((ue,fe)=>{const oe=Y[fe]===ue?"context":"removed";return Dt(rt({},d(ue,oe,{preserveBlankKind:h(U,fe)})),{key:`original-${fe}`,number:fe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Y.map((ue,fe)=>{const oe=U[fe]===ue?"context":"added";return Dt(rt({},d(ue,oe,{preserveBlankKind:h(Y,fe)})),{key:`modified-${fe}`,number:fe+1})})}]}const W=[],ee=[];for(const U of i.value)if(U.startsWith("@@"))W.push(d(U,"hunk")),ee.push(d(U,"hunk"));else if(U.startsWith("-")&&!U.startsWith("---"))W.push(d(U.slice(1),"removed",{preserveBlankKind:!0}));else if(U.startsWith("+")&&!U.startsWith("+++"))ee.push(d(U.slice(1),"added",{preserveBlankKind:!0}));else{const Y=U.startsWith(" ")?U.slice(1):U;W.push(d(Y)),ee.push(d(Y))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:W.map((U,Y)=>Dt(rt({},U),{key:`original-${Y}`,number:Y+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ee.map((U,Y)=>Dt(rt({},U),{key:`modified-${Y}`,number:Y+1}))}]}),g=D(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=X(null),k=X([]);let E=null,L=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function w(S,I){var B;if(!S)return I;const R=S.querySelector(".markstream-pre__diff-content"),P=R?.getBoundingClientRect(),z=(B=P?.height)!=null?B:0;return Math.max(I,Math.ceil(z))}function M(){typeof window<"u"&&(E!=null&&window.cancelAnimationFrame(E),E=window.requestAnimationFrame(()=>{(function(){var S,I;E=null;const B=y.value;if(!B||!l.value)return void(k.value.length&&(k.value=[]));const R=(function(ue){const fe=window.getComputedStyle(ue),oe=$(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const Z=$(fe.lineHeight);return Z>0?Z:18})(B),P=Array.from(B.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(B.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),W=Math.max(P.length,z.length),ee=[];for(let ue=0;ue<W;ue++){const fe=w((S=P[ue])!=null?S:null,R),oe=w((I=z[ue])!=null?I:null,R),Z=Math.max(R,fe,oe);ee.push({rowHeight:Z,originalHeight:fe,modifiedHeight:oe})}var U,Y;U=k.value,Y=ee,U.length===Y.length&&U.every((ue,fe)=>{const oe=Y[fe];return oe&&Math.abs(ue.rowHeight-oe.rowHeight)<=.5&&Math.abs(ue.originalHeight-oe.originalHeight)<=.5&&Math.abs(ue.modifiedHeight-oe.modifiedHeight)<=.5})||(k.value=ee)})()}))}function N(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{M()}),L.observe(S))}function F(S,I){const B=k.value[S];if(!B)return;const R=I==="original"?B.originalHeight:B.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(B.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(R)}px`}}return Ze(y,S=>{N(S),pt(()=>M())},{flush:"post"}),Ze([l,v],()=>{N(y.value),pt(()=>M())},{flush:"post",immediate:!0}),ps(()=>{E!=null&&(window.cancelAnimationFrame(E),E=null),L?.disconnect(),L=null}),(S,I)=>(x(),T("pre",{ref_key:"preRef",ref:y,style:Gt(c.value),class:Pe([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(x(),T("code",kX,[(x(!0),T(Be,null,nt(v.value,B=>(x(),T("span",{key:B.key,class:Pe(["markstream-pre__diff-pane",B.className])},[(x(!0),T(Be,null,nt(B.lines,(R,P)=>(x(),T("span",{key:R.key,class:Pe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${R.kind}`,{"markstream-pre__diff-line--empty":R.empty}]]),style:Gt(F(P,B.key))},[I[0]||(I[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",bX,O(R.number),1),_("span",xX,[_("span",wX,O(R.code),1)])],6))),128))],2))),128))])):(x(),T(Be,{key:1},[t.showLineNumbers?(x(),T("span",_X,[(x(!0),T(Be,null,nt(r.value,B=>(x(),T("span",{key:B,class:"markstream-pre__line-number"},O(B),1))),128))])):le("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,SX)],64))],14,yX))}});Ko.install=e=>{e.component(Ko.__name,Ko)};const P0=Ia(!1);let FS=null;const CX={key:0},cs=vn(Ge({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(FS||(FS=gk().then(v=>{P0.value=!!v}).catch(()=>{P0.value=!1})),Fh(P0)),s=Hd(),o=Vt("markstreamFade",void 0),i=Vt("markstreamTextStreamState",void 0),r=Vt("markstreamStreamVersion",void 0),l=D(()=>{const v=s.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=D(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=D(()=>{var v;const g=(v=s["index-key"])!=null?v:s.indexKey;return g==null||g===""?"":String(g)}),u=X(t.node.content),d=X("");let f=r?.value;const h=X(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ze([()=>t.node.content,c,a,()=>r?.value],([v,g,y,k])=>{const E=String(v??""),L=c.value,$=k!==f;f=k;const w=CM({nextContent:E,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=w.settledContent,d.value=w.streamedDelta,w.appended&&(h.value+=1),L&&i?.set(L,E)},{immediate:!0}),Ze(a,v=>{var g;v||(g=p(),u.value=g,d.value="")});const b=D(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,g)=>(x(),T("span",{class:Pe([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(x(),T("span",CX,O(u.value),1)):le("",!0),d.value?(x(),T("span",{key:1,class:Pe(["text-node-stream-delta",[b.value]]),onAnimationend:m},O(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);cs.install=e=>{e.component(cs.__name,cs)};const WM=Ge({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return gn(Ko,Dt(rt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),H0=Ii({loader:()=>Jn(null,null,function*(){try{return(yield go(()=>import("./CodeBlockNode-Df9vE1bZ.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),Ko}}),loadingComponent:WM,delay:0,suspensible:!1}),Ri=Ii(()=>Jn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return gn(cs,Dt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield gk())return(yield go(()=>import("./index6-XVcJQJvG.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return gn(cs,Dt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),zM=Ii(()=>Jn(null,null,function*(){try{if(yield gk())return(yield go(()=>import("./index5-lb-zFPOO.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return gn(cs,Dt(rt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),ko=vn(Ge({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),T("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ko.install=e=>{e.component(ko.__name,ko)};const AX={class:"superscript-node"},Do=vn(Ge({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,strong:bo,emphasis:_o,footnote_reference:Jo,strikethrough:xo,highlight:ti,insert:Ho,subscript:Po,emoji:Bo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("sup",AX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Do.install=e=>{e.component(Do.__name,Do)};const MX={class:"subscript-node"},Po=vn(Ge({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,strong:bo,emphasis:_o,footnote_reference:Jo,strikethrough:xo,highlight:ti,insert:Ho,superscript:Do,emoji:Bo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("sub",MX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Po.install=e=>{e.component(Po.__name,Po)};const EX={class:"strong-node"},bo=vn(Ge({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,emphasis:_o,strikethrough:xo,highlight:ti,insert:Ho,subscript:Po,superscript:Do,emoji:Bo,footnote_reference:Jo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("strong",EX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);bo.install=e=>{e.component(bo.__name,bo)};const TX={class:"strikethrough-node"},xo=vn(Ge({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,strong:bo,emphasis:_o,highlight:ti,insert:Ho,subscript:Po,superscript:Do,emoji:Bo,footnote_reference:Jo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("del",TX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);xo.install=e=>{e.component(xo.__name,xo)};const NX=["href","title","aria-label","aria-hidden","target","rel"],IX=["aria-hidden"],$X={class:"link-text-wrapper relative inline-flex"},LX={class:"leading-[normal] link-text"},wo=vn(Ge({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Vt("markstreamShowTooltips",void 0),s=D(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),o=D(()=>{var v,g,y,k,E;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(v=t.animationOpacity)!=null?v:.35,w=Math.max(.12,Math.min(.5*$,$)),M={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(w),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(E=t.animationIteration)!=null?E:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=Ms(()=>t.customId),r=D(()=>rt({text:cs,strong:bo,strikethrough:xo,emphasis:_o,image:Sl,html_inline:ei,inline_code:oo},i.value)),l=Hd(),a=D(()=>{var v,g;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const E of y)Array.isArray(E)&&E[0]&&(k[String(E[0])]=String((g=E[1])!=null?g:""));else for(const[E,L]of Object.entries(y))E&&L!=null&&L!==!1&&(k[E]=L===!0?"":String(L));return MS(k,"safe","a")}),c=D(()=>rt(rt({},l),a.value)),u=D(()=>{var v,g;return MS({href:String((g=(v=t.node)==null?void 0:v.href)!=null?g:"")},"safe","a").href}),d=D(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(_V(u.value)?"_blank":void 0)}),f=D(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!u.value)return;const v=c.value.rel,g=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(g).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=D(()=>{const v=rt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function m(){s.value&&aX()}const b=D(()=>{var v,g;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((g=u.value)!=null?g:"")});return(v,g)=>{var y,k;return e.node.loading?(x(),T("span",kn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[_("span",$X,[_("span",LX,[re(C(cs),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,IX)):(x(),T("a",kn({key:0,class:"link-node",href:u.value,title:s.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=E=>(function(L){var $,w,M,N;if(!s.value)return;const F=L,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((w=u.value)!=null&&w.includes("xn--")&&((N=(M=t.node)==null?void 0:M.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";lX(L.currentTarget,I,"top",!1,S)})(E)),onMouseleave:m}),[(x(!0),T(Be,null,nt(e.node.children,(E,L)=>(x(),xe(C(sr),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:E,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,NX))}}}),[["__scopeId","data-v-367e6ca4"]]);wo.install=e=>{e.component(wo.__name,wo)};const FX={class:"insert-node"},Ho=vn(Ge({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,strong:bo,emphasis:_o,strikethrough:xo,highlight:ti,subscript:Po,superscript:Do,emoji:Bo,footnote_reference:Jo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("ins",FX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ho.install=e=>{e.component(Ho.__name,Ho)};const OX={class:"highlight-node"},ti=vn(Ge({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,strong:bo,emphasis:_o,strikethrough:xo,insert:Ho,subscript:Po,superscript:Do,emoji:Bo,footnote_reference:Jo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("mark",OX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ti.install=e=>{e.component(ti.__name,ti)};const RX={class:"emphasis-node"},_o=vn(Ge({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>rt({text:cs,inline_code:oo,link:wo,html_inline:ei,strong:bo,strikethrough:xo,highlight:ti,insert:Ho,subscript:Po,superscript:Do,emoji:Bo,footnote_reference:Jo,math_inline:Ri,reference:ko},n.value));return(o,i)=>(x(),T("em",RX,[(x(!0),T(Be,null,nt(e.node.children,(r,l)=>(x(),xe(C(sr),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);_o.install=e=>{e.component(_o.__name,_o)};const BX={class:"hard-break"},Cl=vn(Ge({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),T("br",BX))}),[["__scopeId","data-v-50c58f70"]]);Cl.install=e=>{e.component(Cl.__name,Cl)};const Ld=Ge({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=ht({checkbox:Xo,checkbox_input:Xo,emoji:Bo,emphasis:_o,hardbreak:Cl,highlight:ti,inline_code:oo,insert:Ho,link:wo,reference:ko,strikethrough:xo,strong:bo,subscript:Po,superscript:Do,text:cs}),s=Ms(()=>t.customId),o=D(()=>{const i=s.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(x(!0),T(Be,null,nt(e.nodes,(l,a)=>(x(),xe(C(sr),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Tv(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(Tv)}function _p(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Tv))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(Tv)?o:null}function Yc(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const DX=["cite"],PX={key:0,dir:"auto",class:"paragraph-node"},HX=["custom-id"],wh=vn(Ge({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Ms(()=>t.customId),s=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),i=D(()=>_p(t.node.children,!s.value)),r=D(()=>t.fade!==!1||o.value?null:Yc(i.value));return Ln("markstreamShowTooltips",D(()=>t.showTooltips)),Ln("markstreamFade",D(()=>t.fade)),(l,a)=>(x(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),T("p",PX,[r.value!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,HX)):(x(),xe(C(Ld),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),xe(C(Wo),{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,DX))}}),[["__scopeId","data-v-abfecebc"]]);wh.install=e=>{e.component(wh.__name,wh)};const WX={class:"definition-list"},zX={class:"definition-term"},UX={class:"definition-desc"},_h=vn(Ge({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),T("dl",WX,[(x(!0),T(Be,null,nt(t.node.items,(o,i)=>(x(),T(Be,{key:i},[_("dt",zX,[re(C(Wo),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",UX,[re(C(Wo),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);_h.install=e=>{e.component(_h.__name,_h)};const qX=["href","title"],id=vn(Ge({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(x(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,qX))}}),[["__scopeId","data-v-e1eb37b6"]]);id.install=e=>{e.component(id.__name,id)};const jX=["id"],VX={class:"flex-1"},Sh=Ge({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",VX,[re(C(Wo),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,jX))}});Sh.install=e=>{e.component(Sh.__name,Sh)};const KX=["custom-id"],Nv=vn(Ge({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),s=Vt("markstreamFade",void 0),o=D(()=>s?.value!==!1||n.value.text?null:Yc(t.node.children)),i=D(()=>rt({text:cs,inline_code:oo,link:wo,image:Sl,strong:bo,emphasis:_o,strikethrough:xo,highlight:ti,insert:Ho,subscript:Po,superscript:Do,emoji:Bo,checkbox:Xo,checkbox_input:Xo,footnote_reference:Jo,hardbreak:Cl,math_inline:Ri,reference:ko},n.value));return(r,l)=>(x(),xe(Ks(`h${e.node.level}`),kn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[o.value!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,KX)):(x(!0),T(Be,{key:1},nt(e.node.children,(a,c)=>(x(),xe(C(sr),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Sp=Nv;Sp.install=e=>{e.component(Nv.__name,Nv)};const GX={key:0,dir:"auto",class:"paragraph-node"},YX=["custom-id"],ZX={dir:"auto",class:"paragraph-node"},QX=["custom-id"],Dc=vn(Ge({__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=D(()=>{var h;return(h=t.node)!=null?h:t.item}),s=Ms(()=>t.customId),o=D(()=>!!s.value.paragraph),i=D(()=>!!s.value.text),r=D(()=>{var h;return _p((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const b=p.slice(1);if(!b.every(g=>g?.type==="list"))return null;const v=_p([m]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Yc(r.value):null),u=D(()=>{var h;return a()?Yc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",D(()=>t.showTooltips)),Ln("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,b;return x(),T("li",kn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),T("p",GX,[c.value!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,YX)):(x(),xe(C(Ld),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(x(),T(Be,{key:1},[_("p",ZX,[u.value!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,QX)):(x(),xe(C(Ld),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),T(Be,null,nt(l.value.nestedLists,(v,g)=>(x(),xe(C(Wo),{key:g,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),xe(C(Wo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(m=n.value)==null?void 0:m.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Dc.install=e=>{e.component(Dc.__name,Dc)};const Pc=vn(Ge({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Ms(()=>e.customId),n=D(()=>t.value.list_item||Dc);return(s,o)=>(x(),xe(Ks(e.node.ordered?"ol":"ul"),{class:Pe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(x(!0),T(Be,null,nt(e.node.items,(i,r)=>{var l;return x(),xe(Ks(n.value),kn({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:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Pc.install=e=>{e.component(Pc.__name,Pc)};const UM=Symbol("ViewportPriority");function XX(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?X(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function m(g){const y=u.get(g);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&b())},{timeout:1200}))}Ze(i,g=>{if(!g){for(const y of Array.from(u.keys()))m(y);h()}},{flush:"sync"});const v=(g,y)=>{const k=X(!1);let E,L=!1;const $=new Promise(N=>{E=()=>{L||(L=!0,N())}}),w=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return k.value=!0,E(),{isVisible:k,whenVisible:$,destroy:w};const M=(function(N,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(R,P){var z,W,ee;return{root:(z=e?.(R??null))!=null?z:null,rootMargin:(W=P?.rootMargin)!=null?W:"300px",threshold:(ee=P?.threshold)!=null?ee:0}})(N,F);if(a&&(B=S,(I=c)&&I.root===B.root&&I.rootMargin===B.rootMargin&&I.threshold===B.threshold))return a;var I,B;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(R=>{for(const P of R)(P.isIntersecting||P.intersectionRatio>0)&&m(P.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const R of u.keys())a.observe(R);return a})(g,y);return M?(u.set(g,{resolve:E,visible:k}),M.observe(g),d.add(g),b(),{isVisible:k,whenVisible:$,destroy:w}):(k.value=!0,E(),{isVisible:k,whenVisible:$,destroy:w})};return Ln(UM,v),v}function JX(){var e,t;const n=Vt(UM,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=s.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=X(!1);let p,m=!1;const b=new Promise(y=>{p=()=>{m||(m=!0,y())}}),v=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:p,visible:h}),g.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const eJ={key:2,class:"html-block-node__raw"},tJ=["innerHTML"],nJ={key:1,class:"html-block-node__placeholder"},rd=vn(Ge({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Vt("markstreamHtmlPolicy",void 0),s=Vt("markstreamNestedRendererProps",void 0),o=D(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=D(()=>{var L,$;const w=(L=s?.value)!=null?L:{};return Dt(rt({},w),{customId:($=t.customId)!=null?$:w.customId,htmlPolicy:o.value})}),r=Ii({loader:()=>Promise.resolve().then(()=>Mk),suspensible:!1}),l=D(()=>{const L=pv(t.node.attrs,o.value);if(!L)return;const $=kp(L);return Object.keys($).length>0?$:void 0}),a=D(()=>{const L=String(t.node.tag||"").trim(),$=pv(t.node.attrs,o.value,L);if(!$)return;const w=kp($);return Object.keys(w).length>0?w:void 0}),c=Ms(()=>t.customId),u=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=X(null),f=X(typeof window>"u"),h=X(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),b=D(()=>{const L=m.value.trim().toLowerCase();return E6.has(L)||uk(L,o.value)}),v=D(()=>p.value.length>0&&!!t.node.tag&&!b.value),g=D(()=>{var L,$,w;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=h.value)!=null?L:""};const M=($=h.value)!=null?$:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Bc(M,o.value)};if(t.node.loading){const F=wp(M,c.value,o.value);return F===null?{mode:"text",content:(w=t.node.raw)!=null?w:M}:{mode:"dynamic",nodes:F}}if(!PM(M,c.value))return{mode:"html",content:Bc(M,o.value)};const N=wp(M,c.value,o.value);return N===null?{mode:"html",content:Bc(M,o.value)}:{mode:"dynamic",nodes:N}}),y=JX(),k=X(null),E=!!t.node.loading;return typeof window<"u"?(Ze(d,L=>{var $,w;if((w=($=k.value)==null?void 0:$.destroy)==null||w.call($),k.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!L)return void(f.value=!1);const M=y(L,{rootMargin:"400px"});k.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ze(()=>t.node.content,L=>{E&&!f.value||(h.value=L)})):f.value=!0,ps(()=>{var L,$;($=(L=k.value)==null?void 0:L.destroy)==null||$.call(L),k.value=null}),(L,$)=>(x(),xe(Ks(v.value?m.value:"div"),kn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ee(()=>[f.value?(x(),T(Be,{key:0},[g.value.mode==="structured"?(x(),xe(C(r),kn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(x(),xe(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(x(),T("pre",eJ,O(g.value.content),1)):(x(),T("div",kn({key:3},l.value,{innerHTML:g.value.content}),null,16,tJ))],64)):(x(),T("div",nJ,[Rn(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);rd.install=e=>{e.component(rd.__name,rd)};const sJ={dir:"auto",class:"paragraph-node"},oJ=["custom-id"],wa=vn(Ge({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Ms(()=>t.customId),s=Vt("markstreamHtmlPolicy",void 0),o=Vt("markstreamFade",void 0),i=Vt("markstreamParseOptions",void 0),r=Vt("markstreamCustomMarkdownIt",void 0),l=Vt("markstreamNestedRendererProps",void 0),a=D(()=>{var w;return(w=s?.value)!=null?w:"safe"}),c=D(()=>{var w;return(w=t.parseOptions)!=null?w:i?.value}),u=D(()=>{var w;return(w=t.customMarkdownIt)!=null?w:r?.value}),d=D(()=>{var w,M;return(M=t.customHtmlTags)!=null?M:(w=l?.value)==null?void 0:w.customHtmlTags}),f=D(()=>{var w,M;const N=(w=l?.value)!=null?w:{};return Dt(rt({},N),{customId:(M=t.customId)!=null?M:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Ii({loader:()=>Promise.resolve().then(()=>Mk),suspensible:!1});function p(w){var M;return w.type==="text"&&String((M=w.content)!=null?M:"").trim()===""}const m=D(()=>t.node.children.filter(w=>!p(w))),b=D(()=>m.value.length>0&&m.value.every(w=>w.type==="image"||(function(M){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(M);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(w))),v=D(()=>new Set(tu(d.value))),g=D(()=>{if(!b.value||m.value.length<=1)return t.node.children;const w=[];for(let M=0;M<t.node.children.length;M++){const N=t.node.children[M];if(!p(N)){w.push(N);continue}const F=w.length>0,S=t.node.children.slice(M+1).some(I=>!p(I));F&&S&&w.push(Dt(rt({},N),{content:" ",raw:" "}))}return w}),y=D(()=>o?.value===!1&&!n.value.text),k=D(()=>y.value?Yc(g.value):null);function E(w,M){return{node:w,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>rt({inline_code:oo,image:Sl,link:wo,hardbreak:Cl,emphasis:_o,strong:bo,strikethrough:xo,highlight:ti,insert:Ho,subscript:Po,superscript:Do,html_inline:ei,html_block:rd,emoji:Bo,checkbox:Xo,math_inline:Ri,checkbox_input:Xo,reference:ko,footnote_anchor:id,footnote_reference:Jo,text:cs},n.value)),$=D(()=>g.value.map((w,M)=>{var N;const F=(function(S){var I,B,R,P;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||$6(S.content);if(z&&!v.value.has(z)&&L6((B=S.content)!=null?B:S.raw,z)){const W=String((P=(R=S.content)!=null?R:S.raw)!=null?P:"");return{child:{type:"text",content:W,raw:W},component:cs,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Gd(String(S.type)))}})(w);return Dt(rt({},F),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:F.isCustomComponent?bk(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:w})}));return(w,M)=>(x(),T("p",sJ,[k.value!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,oJ)):(x(!0),T(Be,{key:1},nt($.value,N=>{return x(),T(Be,{key:N.key},[b.value&&p(N.originalChild)?(x(),T(Be,{key:0},[Qe(O((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(x(),xe(Ks(N.component),kn({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[N.hasSlotChildren?(x(),xe(C(h),kn({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(x(),xe(C(h),kn({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),xe(Ks(N.component),kn({key:2,ref_for:!0},E(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);wa.install=e=>{e.component(wa.__name,wa)};const iJ={class:"table-node-wrapper"},rJ=["aria-busy"],lJ={key:0},aJ=["custom-id"],cJ=["aria-label","onPointerdown"],uJ=["custom-id"],dJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ld=vn(Ge({__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=D(()=>{var v;return(v=t.node.loading)!=null&&v}),s=D(()=>{var v;return(v=t.node.rows)!=null?v:[]}),o=X(null),i=X([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=D(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);Ln("markstreamShowTooltips",D(()=>t.showTooltips)),Ln("markstreamFade",D(()=>t.fade));const u=Ms(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const g=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===g&&k.paragraphFastPath===y)return k.info;const E=_p(v.children,y,!0),L={simpleChildren:E,plainText:E&&g?Yc(E):null};return h.set(v,{children:v.children,textFastPath:g,paragraphFastPath:y,info:L}),L}function m(v){if(!r)return;v.preventDefault();const g=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(g/2)),k=Math.max(y,Math.min(g-y,Math.round(r.startWidth+v.clientX-r.startX))),E=[...r.widths];E[r.index]=k,E[r.index+1]=g-k,i.value=E}function b(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Ze(l,()=>{b(),i.value=[]}),ps(b),(v,g)=>(x(),T("div",iJ,[_("table",{ref_key:"tableRef",ref:o,class:Pe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),T("colgroup",lJ,[(x(!0),T(Be,null,nt(e.node.header.cells,(y,k)=>(x(),T("col",{key:k,style:Gt(c.value[k])},null,4))),128))])):le("",!0),_("thead",null,[_("tr",null,[(x(!0),T(Be,null,nt(e.node.header.cells,(y,k)=>(x(),T("th",{key:k,dir:"auto",class:Pe([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,aJ)):p(y).simpleChildren?(x(),xe(C(Ld),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(x(),xe(C(Wo),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=E=>v.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k<e.node.header.cells.length-1?(x(),T("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${k+1} and ${k+2}`,onPointerdown:E=>(function(L,$){if($.button!==0)return;const w=(function(){var F;const S=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),M=w[L],N=w[L+1];M&&N&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:M,nextStartWidth:N,widths:w},i.value=w,window.addEventListener("pointermove",m),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,E)},null,40,cJ)):le("",!0)],2))),128))])]),_("tbody",null,[(x(!0),T(Be,null,nt(s.value,(y,k)=>(x(),T("tr",{key:k},[(x(!0),T(Be,null,nt(y.cells,(E,L)=>(x(),T("td",{key:L,class:Pe([E.align==="right"?"text-right":E.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(E).plainText!==null?(x(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(E).plainText),9,uJ)):p(E).simpleChildren?(x(),xe(C(Ld),{key:1,nodes:p(E).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${L}`},null,8,["nodes","custom-id","index-key"])):(x(),xe(C(Wo),{key:2,nodes:E.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>v.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,rJ),re(Tl,{name:"table-node-fade"},{default:Ee(()=>[n.value?(x(),T("div",dJ,[Rn(v.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ld.install=e=>{e.component(ld.__name,ld)};const fJ={class:"hr-node"},Ch=vn({},[["render",function(e,t){return x(),T("hr",fJ)}],["__scopeId","data-v-39b2349c"]]);Ch.install=e=>{e.component(Ch.__name,Ch)};const hJ={class:"unknown-node"},Iv=Ge({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),T("div",hJ,O(e.node.raw),1))}),Ah=vn(Ge({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),s=Ms(()=>t.customId),o=D(()=>rt({text:cs,paragraph:wa,heading:Sp,inline_code:oo,link:wo,image:Sl,strong:bo,emphasis:_o,strikethrough:xo,insert:Ho,subscript:Po,superscript:Do,checkbox:Xo,checkbox_input:Xo,hardbreak:Cl,math_inline:Ri,reference:ko,list:Pc,math_block:zM,table:ld},s.value));return(i,r)=>(x(),T("div",kn({class:n.value},e.node.attrs),[(x(!0),T(Be,null,nt(e.node.children,(l,a)=>{return x(),xe(Ks((c=l.type,o.value[c]||Iv)),{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"]]);Ah.install=e=>{e.component(Ah.__name,Ah)};const pJ=["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"],OS=[[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 mJ(e){if(e<=255)return pJ[e];let t=0,n=OS.length-1;for(;t<=n;){const s=t+n>>1,o=OS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const gJ=/[ \t\n\r\f]+/g,vJ=/[\t\n\r\f]| {2,}|^ | $/;let W0=null;const yJ=new RegExp("\\p{Script=Arabic}","u"),$m=new RegExp("\\p{M}","u"),qM=new RegExp("\\p{Nd}","u");function RS(e){return yJ.test(e)}function BS(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Lr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(BS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(BS(n))return!0}}return!1}const kJ=new Set([" "," ","","\uFEFF"]);function bJ(e){return Lr(e)}function $v(e){return!(function(t){const n=Cp(t);return n!==null&&(xk.has(n)||Ca.has(n))})(e)&&!(function(t){const n=Cp(t);return n!==null&&kJ.has(n)})(e)}const xk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Lm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),wk=new Set(["'","’"]),Ca=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),xJ=new Set([":",".","،","؛"]),wJ=new Set(["၏"]),_J=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function SJ(e){if(_k(e))return!0;let t=!1;for(const n of e)if(Ca.has(n))t=!0;else if(!t||!$m.test(n))return!1;return t}function CJ(e){for(const t of e)if(!xk.has(t)&&!Ca.has(t))return!1;return e.length>0}function AJ(e){if(_k(e))return!0;for(const t of e)if(!Lm.has(t)&&!wk.has(t)&&!$m.test(t))return!1;return e.length>0}function _k(e){let t=!1;for(const n of e)if(n!=="\\"&&!$m.test(n)){if(!(Lm.has(n)||Ca.has(n)||wk.has(n)))return!1;t=!0}return t}function jM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Cp(e){if(e.length===0)return null;const t=jM(e,e.length);return e.slice(t)}function MJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if($m.test(s))n--;else{if(!Lm.has(s)&&!wk.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function EJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function DS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function PS(e,t){return e&&t!==null&&xJ.has(t)}function TJ(e){const t=Cp(e);return t!==null&&wJ.has(t)}function NJ(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 Lv(e){let t=e.length;for(;t>0;){const n=jM(e,t),s=e.slice(n,t);if(_J.has(s))return!0;if(!Ca.has(s))return!1;t=n}return!1}function IJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
272
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const $J=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function pi(e){return e.length===1?e[0]:e.join("")}function LJ(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),pi(n)}function FJ(e,t,n,s){if(!$J.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=IJ(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:pi(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&&o.push({text:pi(r),isWordLike:a,kind:i,start:l}),o}function z0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const OJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function RJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||OJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function BJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const DJ=new Set([":","-","/","×",",",".","+","–","—"]),HS=/^[A-Za-z0-9_]+[,:;]*$/,WS=/[,:;]+$/;function zS(e){for(const t of e)if(qM.test(t))return!0;return!1}function Mh(e){if(e.length===0)return!1;for(const t of e)if(!qM.test(t)&&!DJ.has(t))return!1;return!0}function US(e,t,n){var s,o,i;const r=(W0===null&&(W0=new Intl.Segmenter(void 0,{granularity:"word"})),W0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],b=[],v=[],g=[],y=[];for(const w of r.segment(e))for(const M of FJ(w.segment,(s=w.isWordLike)!=null&&s,w.index,n)){let N=function(){h[W]!==null&&(c[W]=[DS(a,h,p,W)],h[W]=null),c[W].push(M.text),u[W]=u[W]||M.isWordLike,m[W]=m[W]||I,b[W]=b[W]||B,v[W]=P,g[W]=z,y[W]=PS(b[W],R)};const F=M.kind==="text",S=EJ(M.text,M.isWordLike,M.kind),I=Lr(M.text),B=RS(M.text),R=Cp(M.text),P=Lv(M.text),z=TJ(M.text),W=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[W]==="text"&&I&&m[W]&&v[W]||F&&l>0&&d[W]==="text"&&CJ(M.text)&&m[W]||F&&l>0&&d[W]==="text"&&g[W]?N():F&&l>0&&d[W]==="text"&&M.isWordLike&&B&&y[W]?(N(),u[W]=!0):S!==null&&l>0&&d[W]==="text"&&h[W]===S?p[W]=((o=p[W])!=null?o:1)+1:F&&!M.isWordLike&&l>0&&d[W]==="text"&&(SJ(M.text)||M.text==="-"&&u[W])?N():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,f[l]=M.start,h[l]=S,p[l]=S===null?0:1,m[l]=I,b[l]=B,v[l]=P,g[l]=z,y[l]=PS(B,R),l++)}for(let w=0;w<l;w++)h[w]===null?a[w]=pi(c[w]):a[w]=DS(a,h,p,w);for(let w=1;w<l;w++)d[w]==="text"&&!u[w]&&_k(a[w])&&d[w-1]==="text"&&(a[w-1]+=a[w],u[w-1]=u[w-1]||u[w],a[w]="");const k=Array.from({length:l},()=>null);let E=-1;for(let w=l-1;w>=0;w--){const M=a[w];if(M.length!==0){if(d[w]==="text"&&!u[w]&&AJ(M)&&E>=0&&d[E]==="text"){const N=(i=k[E])!=null?i:[];N.push(M),k[E]=N,f[E]=f[w],a[w]="";continue}E=w}}for(let w=0;w<l;w++){const M=k[w];M!=null&&(a[w]=LJ(M,a[w]))}let L=0;for(let w=0;w<l;w++){const M=a[w];M.length!==0&&(L!==w&&(a[L]=M,u[L]=u[w],d[L]=d[w],f[L]=f[w]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(w){const M=w.texts.slice(),N=w.isWordLike.slice(),F=w.kinds.slice(),S=w.starts.slice();for(let I=0;I<M.length-1;I++){if(F[I]!=="text"||F[I+1]!=="text"||!Lr(M[I])||!Lr(M[I+1]))continue;const B=MJ(M[I]);B!==null&&(M[I]=B.head,M[I+1]=B.tail+M[I+1],S[I+1]=S[I]+B.head.length)}return{len:M.length,texts:M,isWordLike:N,kinds:F,starts:S}})((function(w){const M=[],N=[],F=[],S=[];for(let I=0;I<w.len;I++){const B=w.texts[I],R=w.kinds[I],P=w.isWordLike[I];if(R==="text"&&P&&HS.test(B)){const z=[B];let W=WS.test(B),ee=I+1;for(;W&&ee<w.len&&w.kinds[ee]==="text"&&w.isWordLike[ee]&&HS.test(w.texts[ee]);){const U=w.texts[ee];z.push(U),W=WS.test(U),ee++}M.push(pi(z)),N.push(!0),F.push("text"),S.push(w.starts[I]),I=ee-1;continue}M.push(B),N.push(P),F.push(R),S.push(w.starts[I])}return{len:M.length,texts:M,isWordLike:N,kinds:F,starts:S}})((function(w){const M=[],N=[],F=[],S=[];for(let I=0;I<w.len;I++){const B=w.texts[I];if(w.kinds[I]==="text"&&B.includes("-")){const R=B.split("-");let P=R.length>1;for(let z=0;z<R.length;z++){const W=R[z];if(!P)break;W.length!==0&&zS(W)&&Mh(W)||(P=!1)}if(P){let z=0;for(let W=0;W<R.length;W++){const ee=R[W],U=W<R.length-1?`${ee}-`:ee;M.push(U),N.push(!0),F.push("text"),S.push(w.starts[I]+z),z+=U.length}continue}}M.push(B),N.push(w.isWordLike[I]),F.push(w.kinds[I]),S.push(w.starts[I])}return{len:M.length,texts:M,isWordLike:N,kinds:F,starts:S}})((function(w){const M=[],N=[],F=[],S=[];for(let I=0;I<w.len;I++){const B=w.texts[I],R=w.kinds[I];if(R==="text"&&Mh(B)&&zS(B)){const P=[B];let z=I+1;for(;z<w.len&&w.kinds[z]==="text"&&Mh(w.texts[z]);)P.push(w.texts[z]),z++;M.push(pi(P)),N.push(!0),F.push("text"),S.push(w.starts[I]),I=z-1;continue}M.push(B),N.push(w.isWordLike[I]),F.push(R),S.push(w.starts[I])}return{len:M.length,texts:M,isWordLike:N,kinds:F,starts:S}})((function(w){const M=[],N=[],F=[],S=[];for(let I=0;I<w.len;I++){const B=w.texts[I];if(M.push(B),N.push(w.isWordLike[I]),F.push(w.kinds[I]),S.push(w.starts[I]),!BJ(B))continue;const R=I+1;if(R>=w.len||z0(w.kinds[R]))continue;const P=[],z=w.starts[R];let W=R;for(;W<w.len&&!z0(w.kinds[W]);)P.push(w.texts[W]),W++;P.length>0&&(M.push(pi(P)),N.push(!0),F.push("text"),S.push(z),I=W-1)}return{len:M.length,texts:M,isWordLike:N,kinds:F,starts:S}})((function(w){const M=w.texts.slice(),N=w.isWordLike.slice(),F=w.kinds.slice(),S=w.starts.slice();for(let B=0;B<w.len;B++){if(F[B]!=="text"||!RJ(w,B))continue;const R=[M[B]];let P=B+1;for(;P<w.len&&!z0(F[P]);){R.push(M[P]),N[B]=!0;const z=M[P].includes("?");if(F[P]="text",M[P]="",P++,z)break}M[B]=pi(R)}let I=0;for(let B=0;B<M.length;B++){const R=M[B];R.length!==0&&(I!==B&&(M[I]=R,N[I]=N[B],F[I]=F[B],S[I]=S[B]),I++)}return M.length=I,N.length=I,F.length=I,S.length=I,{len:I,texts:M,isWordLike:N,kinds:F,starts:S}})((function(w){const M=[],N=[],F=[],S=[];let I=0;for(;I<w.len;){const B=[w.texts[I]];let R=w.isWordLike[I],P=w.kinds[I],z=w.starts[I];if(P==="glue"){const W=[B[0]],ee=z;for(I++;I<w.len&&w.kinds[I]==="glue";)W.push(w.texts[I]),I++;const U=pi(W);if(!(I<w.len&&w.kinds[I]==="text")){M.push(U),N.push(!1),F.push("glue"),S.push(ee);continue}B[0]=U,B.push(w.texts[I]),R=w.isWordLike[I],P="text",z=ee,I++}else I++;if(P==="text")for(;I<w.len&&w.kinds[I]==="glue";){const W=[];for(;I<w.len&&w.kinds[I]==="glue";)W.push(w.texts[I]),I++;const ee=pi(W);I<w.len&&w.kinds[I]==="text"?(B.push(ee,w.texts[I]),R=R||w.isWordLike[I],I++):B.push(ee)}M.push(pi(B)),N.push(R),F.push(P),S.push(z)}return{len:M.length,texts:M,isWordLike:N,kinds:F,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let w=0;w<$.len-1;w++){const M=NJ($.texts[w]);M!==null&&($.kinds[w]!=="space"&&$.kinds[w]!=="preserved-space"||$.kinds[w+1]!=="text"||!RS($.texts[w+1])||($.texts[w]=M.space,$.isWordLike[w]=!1,$.kinds[w]=$.kinds[w]==="preserved-space"?"preserved-space":"space",$.texts[w+1]=M.marks+$.texts[w+1],$.starts[w+1]=$.starts[w]+M.space.length))}return $}function PJ(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let tc=null;const qS=new Map;let nc=null;const HJ=new RegExp("\\p{Emoji_Presentation}","u"),WJ=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let U0=null;const jS=new Map;function Fv(){if(tc!==null)return tc;if(typeof OffscreenCanvas<"u")return tc=new OffscreenCanvas(1,1).getContext("2d"),tc;if(typeof document<"u")return tc=document.createElement("canvas").getContext("2d"),tc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function il(e,t){let n=t.get(e);return n===void 0&&(n={width:Fv().measureText(e).width,containsCJK:Lr(e)},t.set(e,n)),n}function Fm(){if(nc!==null)return nc;if(typeof navigator>"u")return nc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},nc;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return nc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},nc}function VM(){return U0===null&&(U0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),U0}function zJ(e){return HJ.test(e)||e.includes("️")}function oa(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=VM();for(const a of l.segment(i))zJ(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function UJ(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function qJ(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function VS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Fm().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(k=u,E=d,L=a){l++,a=0,c=!1,f=-1,h=0}function m(k,E){c=!0,u=k+1,d=0,a=E}function b(k,E,L){c=!0,u=k,d=E+1,a=L}function v(k,E){c?(a+=E,u=k+1,d=0):m(k,E)}function g(k,E){const L=i[k];for(let $=E;$<L.length;$++){const w=L[$];c?a+w>r?(p(),b(k,$,w)):(a+=w,u=k,d=$+1):b(k,$,w)}c&&u===k&&d===L.length&&(u=k+1,d=0)}let y=0;for(;y<s.length&&(c||(y=UJ(e,y),!(y>=s.length)));){const k=s[y],E=o[y],L=E==="space"||E==="preserved-space"||E==="tab"||E==="zero-width-break"||E==="soft-hyphen";if(c)if(a+k>r){if(L){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),g(y,0),y++;continue}p()}else v(y,k),L&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?g(y,0):m(y,k),L&&(f=y+1,h=a-k),y++}return c&&p(),l}let q0=null;function jJ(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=Lv(d),l=Lm.has(d)}function u(d,f){s.push(d),i=i||f;const h=Lv(d);r=d.length===1&&Ca.has(d)&&r||h,l=!1}for(const d of(q0===null&&(q0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),q0).segment(e)){const f=d.segment,h=Lr(f);s.length!==0?l||xk.has(f)||Ca.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function VJ(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Lr(e[0].text),i=$v(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Lr(a.text),u=$v(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function KJ(e,t,n,s){const o=Fm(),{cache:i,emojiCorrection:r}=(function($,w){Fv().font=$;const M=(function(S){let I=qS.get(S);return I||(I=new Map,qS.set(S,I)),I})($),N=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),F=w?(function(S,I){let B=jS.get(S);if(B!==void 0)return B;const R=Fv();R.font=S;const P=R.measureText("😀").width;if(B=0,P>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const W=z.getBoundingClientRect().width;document.body.removeChild(z),P-W>.5&&(B=P-W)}return jS.set(S,B),B})($,N):0;return{cache:M,fontSize:N,emojiCorrection:F}})(t,(l=e.normalized,WJ.test(l)));var l;const a=oa("-",il("-",i),r),c=8*oa(" ",il(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const m=null,b=[],v=n?[]:null,g=Array.from({length:e.len});function y($,w,M,N,F,S,I){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(w),d.push(M),f.push(N),h.push(F),b.push(I),v!==null&&v.push($)}function k($,w,M,N,F){const S=il($,i),I=oa($,S,r),B=w==="space"||w==="preserved-space"||w==="zero-width-break"?0:I,R=w==="space"||w==="zero-width-break"?0:I;if(F&&N&&$.length>1){let P="sum-graphemes";Mh($)?P="pair-context":o.preferPrefixWidthsForBreakableRuns&&(P="segment-prefixes");const z=(function(W,ee,U,Y,ue){if(ee.breakableFitAdvances!==void 0)return ee.breakableFitAdvances;const fe=VM(),oe=[];for(const He of fe.segment(W))oe.push(He.segment);if(oe.length<=1)return ee.breakableFitAdvances=null,ee.breakableFitAdvances;if(ue==="sum-graphemes"){const He=[];for(const he of oe){const K=il(he,U);He.push(oa(he,K,Y))}return ee.breakableFitAdvances=He,ee.breakableFitAdvances}if(ue==="pair-context"||oe.length>96){const He=[];let he=null,K=0;for(const ce of oe){const ge=oa(ce,il(ce,U),Y);if(he===null)He.push(ge);else{const q=he+ce,se=il(q,U);He.push(oa(q,se,Y)-K)}he=ce,K=ge}return ee.breakableFitAdvances=He,ee.breakableFitAdvances}const Z=[];let te="",ae=0;for(const He of oe){te+=He;const he=oa(te,il(te,U),Y);Z.push(he-ae),ae=he}return ee.breakableFitAdvances=Z,ee.breakableFitAdvances})($,S,i,r,P);return void y($,I,B,R,w,M,z)}y($,I,B,R,w,M,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const w=e.texts[$],M=e.isWordLike[$],N=e.kinds[$],F=e.starts[$];if(N==="soft-hyphen"){y(w,0,a,a,N,F,null);continue}if(N==="hard-break"){y(w,0,0,0,N,F,null);continue}if(N==="tab"){y(w,0,0,0,N,F,null);continue}const S=il(w,i);if(N==="text"&&S.containsCJK){const I=jJ(w,o),B=s==="keep-all"?VJ(I):I;for(let R=0;R<B.length;R++){const P=B[R];k(P.text,"text",F+P.start,M,s==="keep-all"||!Lr(P.text))}continue}k(w,N,F,M,!0)}const E=(function($,w,M){const N=[];for(let F=0;F<$.length;F++){const S=$[F],I=S.startSegmentIndex<w.length?w[S.startSegmentIndex]:M,B=S.endSegmentIndex<w.length?w[S.endSegmentIndex]:M,R=S.consumedEndSegmentIndex<w.length?w[S.consumedEndSegmentIndex]:M;N.push({startSegmentIndex:I,endSegmentIndex:B,consumedEndSegmentIndex:R})}return N})(e.chunks,g,u.length),L=m===null?null:(function($,w){const M=(function(F){const S=F.length;if(S===0)return null;const I=new Array(S);let B=!1;for(let U=0;U<S;){const Y=F.charCodeAt(U);let ue=Y,fe=1;if(Y>=55296&&Y<=56319&&U+1<S){const Z=F.charCodeAt(U+1);Z>=56320&&Z<=57343&&(ue=Z-56320+(Y-55296<<10)+65536,fe=2)}const oe=mJ(ue);oe!=="R"&&oe!=="AL"&&oe!=="AN"||(B=!0);for(let Z=0;Z<fe;Z++)I[U+Z]=oe;U+=fe}if(!B)return null;let R=0;for(let U=0;U<S;U++){const Y=I[U];if(Y==="L"){R=0;break}if(Y==="R"||Y==="AL"){R=1;break}}const P=new Int8Array(S);for(let U=0;U<S;U++)P[U]=R;const z=1&R?"R":"L",W=z;let ee=W;for(let U=0;U<S;U++)I[U]==="NSM"?I[U]=ee:ee=I[U];ee=W;for(let U=0;U<S;U++){const Y=I[U];Y==="EN"?I[U]=ee==="AL"?"AN":"EN":Y!=="R"&&Y!=="L"&&Y!=="AL"||(ee=Y)}for(let U=0;U<S;U++)I[U]==="AL"&&(I[U]="R");for(let U=1;U<S-1;U++)I[U]==="ES"&&I[U-1]==="EN"&&I[U+1]==="EN"&&(I[U]="EN"),I[U]!=="CS"||I[U-1]!=="EN"&&I[U-1]!=="AN"||I[U+1]!==I[U-1]||(I[U]=I[U-1]);for(let U=0;U<S;U++){if(I[U]!=="EN")continue;let Y;for(Y=U-1;Y>=0&&I[Y]==="ET";Y--)I[Y]="EN";for(Y=U+1;Y<S&&I[Y]==="ET";Y++)I[Y]="EN"}for(let U=0;U<S;U++){const Y=I[U];Y!=="WS"&&Y!=="ES"&&Y!=="ET"&&Y!=="CS"||(I[U]="ON")}ee=W;for(let U=0;U<S;U++){const Y=I[U];Y==="EN"?I[U]=ee==="L"?"L":"EN":Y!=="R"&&Y!=="L"||(ee=Y)}for(let U=0;U<S;U++){if(I[U]!=="ON")continue;let Y=U+1;for(;Y<S&&I[Y]==="ON";)Y++;const ue=(U>0?I[U-1]:W)!=="L"?"R":"L";if(ue===((Y<S?I[Y]:W)!=="L"?"R":"L"))for(let fe=U;fe<Y;fe++)I[fe]=ue;U=Y-1}for(let U=0;U<S;U++)I[U]==="ON"&&(I[U]=z);for(let U=0;U<S;U++){const Y=I[U];1&P[U]?Y!=="L"&&Y!=="AN"&&Y!=="EN"||P[U]++:Y==="R"?P[U]++:Y!=="AN"&&Y!=="EN"||(P[U]+=2)}return P})($);if(M===null)return null;const N=new Int8Array(w.length);for(let F=0;F<w.length;F++)N[F]=M[w[F]];return N})(e.normalized,m);return v!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:E,segments:v}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:E}}function GJ(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return KJ((function(c,u,d="normal",f="normal"){const h=(function(b){const v=b??"normal";return v==="pre-wrap"?{mode:v,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:v,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
|
|
273
|
-
`).replace(/[\r\f]/g,`
|
|
274
|
-
`):b.replace(/\r\n/g,`
|
|
275
|
-
`)})(c):(function(b){if(!vJ.test(b))return b;let v=b.replace(gJ," ");return v.charCodeAt(0)===32&&(v=v.slice(1)),v.length>0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],g=[],y=[],k=[];let E=null,L=!1,$=0,w=!1,M=!1;function N(){E!==null&&(v.push(pi(E)),g.push(L),y.push("text"),k.push($),E=null)}for(let F=0;F<b.len;F++){const S=b.texts[F],I=b.kinds[F],B=b.isWordLike[F],R=b.starts[F];if(I==="text"){const P=bJ(S),z=$v(S);if(E!==null&&w&&M){E.push(S),L=L||B,w=w||P,M=z;continue}N(),E=[S],L=B,$=R,w=P,M=z;continue}N(),v.push(S),g.push(B),y.push(I),k.push(R)}return N(),{len:v.length,texts:v,isWordLike:g,kinds:y,starts:k}})(US(p,u,h)):US(p,u,h);return rt({normalized:p,chunks:PJ(m,h)},m)})(s,Fm(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const j0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Ns=(()=>{const e=globalThis;if(e[j0])return e[j0];const t={configs:{},controllers:{},revision:Ia(0),preparedCache:new Map,blockEstimateCache:new Map};return e[j0]=t,t})();let $u=null;const KS=Ns.revision;function GS(e){var t;return e&&(t=Ns.configs[e])!=null?t:null}function YS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function YJ(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function V0(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!YJ(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
276
|
-
`)}return o.length>0?o:null}function K0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if($u!=null)return $u;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return $u=!!((i=r.getContext)!=null&&i.call(r,"2d")),$u}catch{return $u=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Ns.blockEstimateCache.get(r);if(l)return Ns.blockEstimateCache.delete(r),Ns.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(h,p,m){const b=`${m}\0${p}\0${h}`,v=Ns.preparedCache.get(b);if(v)return Ns.preparedCache.delete(b),Ns.preparedCache.set(b,v),v.prepared;const g=GJ(h,p,{whiteSpace:m});for(Ns.preparedCache.set(b,{prepared:g});Ns.preparedCache.size>240;){const y=Ns.preparedCache.keys().next().value;if(!y)break;Ns.preparedCache.delete(y)}return g})(e,n.font,a),u=(function(h,p,m){const b=(function(v,g){return v.simpleLineWalkFastPath?VS(v,g):(function(y,k){if(y.simpleLineWalkFastPath)return VS(y,k);const{widths:E,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:w,breakableFitAdvances:M,discretionaryHyphenWidth:N,tabStopAdvance:F,chunks:S}=y;if(E.length===0||S.length===0)return 0;const I=Fm(),B=I.lineFitEpsilon,R=k+B;let P=0,z=0,W=!1,ee=0,U=0,Y=-1,ue=0,fe=0,oe=null;function Z(){Y=-1,ue=0,fe=0,oe=null}function te(se=ee,ye=U,de=z){P++,z=0,W=!1,Z()}function ae(se,ye){W=!0,ee=se+1,U=0,z=ye}function He(se,ye,de){W=!0,ee=se,U=ye+1,z=de}function he(se,ye){W?(z+=ye,ee=se+1,U=0):ae(se,ye)}function K(se,ye,de,ke){if(!ye)return;const j=se==="tab"?0:L[de],ne=se==="tab"?ke:$[de];Y=de+1,ue=z-ke+j,fe=z-ke+ne,oe=se}function ce(se,ye){const de=M[se];for(let ke=ye;ke<de.length;ke++){const j=de[ke];W?z+j>R?(te(),He(se,ke,j)):(z+=j,ee=se,U=ke+1):He(se,ke,j)}W&&ee===se&&U===de.length&&(ee=se+1,U=0)}function ge(se){if(oe!=="soft-hyphen")return!1;const ye=M[se];if(ye==null)return!1;const{fitCount:de,fittedWidth:ke}=(function(j,ne,ve,Ae,$e){let Oe=0,pe=ne;for(;Oe<j.length;){const Ie=pe+j[Oe];if((Oe+1<j.length?Ie+$e:Ie)>ve+Ae)break;pe=Ie,Oe++}return{fitCount:Oe,fittedWidth:pe}})(ye,z,k,B,N);return de!==0&&(z=ke,ee=se,U=de,Z(),de===ye.length?(ee=se+1,U=0,!0):(te(se,de,ke+N),ce(se,de),!0))}function q(se){P++,Z()}for(let se=0;se<S.length;se++){const ye=S[se];if(ye.startSegmentIndex===ye.endSegmentIndex){q();continue}W=!1,z=0,ye.startSegmentIndex,ee=ye.startSegmentIndex,U=0,Z();let de=ye.startSegmentIndex;for(;de<ye.endSegmentIndex;){const ke=w[de],j=ke==="space"||ke==="preserved-space"||ke==="tab"||ke==="zero-width-break"||ke==="soft-hyphen",ne=ke==="tab"?qJ(z,F):E[de];if(ke!=="soft-hyphen")if(W){if(z+ne>R){const ve=z+(ke==="tab"?0:L[de]),Ae=z+(ke==="tab"?ne:$[de]);if(oe==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&ue<=R){te(Y,0,fe);continue}if(oe==="soft-hyphen"&&ge(de)){de++;continue}if(j&&ve<=R){he(de,ne),te(de+1,0,Ae),de++;continue}if(Y>=0&&ue<=R){if(ee>Y||ee===Y&&U>0){te();continue}const $e=Y;te($e,0,fe),de=$e;continue}if(ne>k&&M[de]!==null){te(),ce(de,0),de++;continue}te();continue}he(de,ne),K(ke,j,de,ne),de++}else ne>k&&M[de]!==null?ce(de,0):ae(de,ne),K(ke,j,de,ne),de++;else W&&(ee=de+1,U=0,Y=de+1,ue=z+N,fe=z+N,oe=ke),de++}if(W){const ke=Y===ye.consumedEndSegmentIndex?fe:z;te(ye.consumedEndSegmentIndex,0,ke)}}return P})(v,g)})(h,p);return{lineCount:b,height:b*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(Ns.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Ns.blockEstimateCache.size>4e3;){const h=Ns.blockEstimateCache.keys().next().value;if(!h)break;Ns.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function KM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=V0(e.children);return i&&n.paragraph?K0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=V0(e.children),l=n.headings[i];return r&&l?K0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=V0((o=i[0])==null?void 0:o.children);return r?K0(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=KM(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 Zf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function ZJ(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(Zf(String((d=u.originalCode)!=null?d:"")),Zf(String((f=u.updatedCode)!=null?f:"")),Zf(String((h=u.code)!=null?h:""))):Zf((function(p,m){const b=String(p??"");return m?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const m=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*m)})(u,r),f=(function(h,p){var m,b;if(!p)return 0;const v=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else s==="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+(o?40:0)),contentHeight:c,rendererKind:s}}function QJ(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function G0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=YS(s.lineHeight,1.5*YS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:QJ(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const XJ=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function ZS(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))XJ.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const JJ=!1;function Uwe(){return JJ}function QS(e,t,n,s){var o;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=s.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const GM=Symbol("MarkstreamMathBlockMinHeightCache");function qwe(){return Vt(GM,null)}const eee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],tee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],nee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),YM=["raw","content","code","originalCode","updatedCode"],XS=new WeakMap,JS=new WeakMap;let see=1;function Ei(){return typeof performance<"u"?performance.now():Date.now()}function eC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ki(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=XS.get(t);return n||(n=see++,XS.set(t,n)),String(n)}function tC(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:ki(t),customMarkdownIt:ki(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ki(e.validateLink),preTransformTokens:ki(e.preTransformTokens),postTransformTokens:ki(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function nC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
277
|
-
`,t-1)+1;return e.slice(n,t).trim()}function sC(e){const t=ZM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function ZM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function QM(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Sk(e){const t=String(e??"");return`${t.length}:${QM(t)}`}function Ov(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?Sk(r):`${r.length}:${QM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ki(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${ki(s)}`;const i=ki(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Ov(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}:${Ov(r[c],t,n+1)}`).join(";")}`}return typeof e}function Ap(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function XM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Ap(s)?Fl(s,t,n+1):XM(s,t,n+1)).join(",")}`:Ap(e)?Fl(e,t,n):Ov(e,t,n)}function oee(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!YM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${Sk(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${ki(o)}`:nee.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${XM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${ki(o)}`:""}).filter(Boolean).join(";")}function iee(e){return YM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Sk(n)}`:""}).filter(Boolean).join(";")}function Fl(e,t=new WeakMap,n=0){const s=JS.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${ki(o)}`;const r=ki(o);t.set(o,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Fl(p,c,u+1)).join("|"):"";return[a.type,iee(d),oee(d,c,u),f.length,h].join(":")})(e,t,n);return JS.set(o,l),l}function JM(e,t){return Fl(e)===Fl(t)}function Ck(e,t,n){const s=Ei(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ei()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function oC(e,t,n){return Ck(t,n,()=>Fl(e))}function e5(e,t,n){return oC(e,n,"stabilizeSignatureMs")===oC(t,n,"stabilizeSignatureMs")}function Y0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function iC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function ree(e,t){return e.length===t.length&&e===t}function Ak(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=s[d],h=o[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!ree(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Ap(d)||!Ap(f))return null;const h=Ak(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function lee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Ak(e,t);return n??JM(e,t)}function aee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return Ck(n,"stabilizeSignatureMs",()=>{s=Ak(e,t)}),s??e5(e,t,n)}function cee(e,t){const n={};for(const s of eee){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function uee(e,t){var n;const s=cS(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=X(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ei();function m(){l&&(clearTimeout(l),l=void 0)}function b(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),p=Ei()}Ze([t.renderContent,t.effectiveFinal,i],([M,N,F])=>{r.value!==M&&(!F||N||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const B=I.slice(S.length);return!!B&&(!!sC(nC(I))||!(!B.includes(`
|
|
278
|
-
|
|
279
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(B))||B.endsWith(`
|
|
280
|
-
`)&&!(function(R){const P=nC(R);if(sC(P))return!1;const z=ZM(P);return z.length>=2&&z.some(W=>W.trim())})(I))})(r.value,M)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const B=I.parseCoalesceMs;return typeof B=="number"&&Number.isFinite(B)&&B>=0?B:80})(e)-(Ei()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),ay(m);const v=D(()=>{var M,N,F,S;return TV(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(S=(F=(N=t.customComponentsMap)==null?void 0:N.value)!=null?F:{},Object.entries(S).map(([I,B])=>{const R=Ci(I);return B==null||!R||Gd(R)||M6.has(R)||jd.has(R)?"":R}).filter(Boolean)))}),g=D(()=>{const{key:M,tags:N}=NV(v.value);if(!M)return s;const F=o.get(M);if(F)return F;const S=cS(t.instanceMsgId,{customHtmlTags:N});return o.set(M,S),S}),y=D(()=>{const M=g.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),k=D(()=>{var M,N;const F=(M=e.parseOptions)!=null?M:{},S=t.effectiveFinal.value,I=v.value,B=S!=null,R=I.length>0;return B||R||F.streamParse==null?rt(rt(Dt(rt({},F),{streamParse:(N=F.streamParse)==null||N}),B?{final:S}:{}),R?{customHtmlTags:I}:{}):F}),E=D(()=>{var M;return new Set(((M=k.value.customHtmlTags)!=null?M:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),L=D(()=>tC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),$=D(()=>tC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Ze([L,$],([M,N],[F,S])=>{F&&(M===F&&N===S||(b(),N!==S&&(a=[],d="")))},{flush:"sync"});const w=D(()=>{var M,N,F,S,I,B,R,P;if((M=e.nodes)!=null&&M.length)return a=[],d="",ht(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const W=t.debugPerformanceEnabled.value,ee=W?Ei():0,U=y.value,Y=L.value,ue=$.value;c&&Y!==c&&(function(ye){var de,ke;(ke=(de=ye.stream)==null?void 0:de.reset)==null||ke.call(de)})(U),u&&ue!==u&&(a=[],d="");const fe=a.length>0&&z.startsWith(d)&&ue===u,oe=W?eC(U):null,Z=W?{}:void 0,te=Z?Dt(rt({},k.value),{__timing:Z}):k.value,ae=mM(z,U,te),He=W?Ei():0,he=W?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let K,ce=W?Y0(ae.length):void 0,ge=0,q=0;if(fe){const ye=W?Ei():0;if(he){const de=(function(ke,j,ne){if(!j.length)return{nodes:ke,metrics:Y0(ke.length)};const ve=(function(Oe,pe,Ie){const Xe=Math.min(Oe.length,pe.length);for(let it=0;it<Xe;it++)if(!aee(pe[it],Oe[it],Ie))return it;return Oe.length===pe.length?-1:Xe})(ke,j,ne);if(ve<0)return{nodes:j,metrics:{reusedNodeCount:ke.length,dirtyStartIndex:ve,stablePrefixNodeCount:ke.length,dirtyTailNodeCount:0}};const Ae=ke.slice();let $e=ve;for(let Oe=0;Oe<ve;Oe++)Ae[Oe]=j[Oe];for(let Oe=ve;Oe<ke.length;Oe++){const pe=j[Oe],Ie=ke[Oe];pe&&e5(pe,Ie,ne)&&(Ae[Oe]=pe,$e+=1)}return{nodes:Ae,metrics:{reusedNodeCount:$e,dirtyStartIndex:ve,stablePrefixNodeCount:ve,dirtyTailNodeCount:iC(ve,ke,j)}}})(ae,a,he);K=de.nodes,ce=de.metrics}else{const de=(function(ke,j){if(!j.length)return{nodes:ke,metrics:Y0(ke.length)};const ne=(function($e,Oe){const pe=Math.min($e.length,Oe.length);for(let Ie=0;Ie<pe;Ie++)if(!lee(Oe[Ie],$e[Ie]))return Ie;return $e.length===Oe.length?-1:pe})(ke,j);if(ne<0)return{nodes:j,metrics:{reusedNodeCount:ke.length,dirtyStartIndex:ne,stablePrefixNodeCount:ke.length,dirtyTailNodeCount:0}};const ve=ke.slice();let Ae=ne;for(let $e=0;$e<ne;$e++)ve[$e]=j[$e];for(let $e=ne;$e<ke.length;$e++){const Oe=j[$e],pe=ke[$e];Oe&&JM(Oe,pe)&&(ve[$e]=Oe,Ae+=1)}return{nodes:ve,metrics:{reusedNodeCount:Ae,dirtyStartIndex:ne,stablePrefixNodeCount:ne,dirtyTailNodeCount:iC(ne,ke,j)}}})(ae,a);K=de.nodes,ce=de.metrics}ge=W?Ei()-ye:0,q=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?K.length:ce.dirtyStartIndex}else K=ae;he?(function(ye,de,ke=0){for(let j=Math.max(0,ke);j<ye.length;j++)Ck(de,"primeSignatureMs",()=>Fl(ye[j]))})(K,he,q):(function(ye,de=0){for(let ke=Math.max(0,de);ke<ye.length;ke++)Fl(ye[ke])})(K,q);const se=W?Ei()-He:0;if(f+=1,d=z,c=Y,u=ue,a=K,W){const ye=eC(U),de=typeof ye?.total=="number"&&ye.total>((N=oe?.total)!=null?N:0);t.logPerf(de?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(Ei()-ee),nodes:K.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:se,signatureMs:(F=he?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=he?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=he?.primeSignatureMs)!=null?I:0,signatureCallCount:(B=he?.signatureCallCount)!=null?B:0,stabilizeSignatureCallCount:(R=he?.stabilizeSignatureCallCount)!=null?R:0,primeSignatureCallCount:(P=he?.primeSignatureCallCount)!=null?P:0,stabilizeMs:ge},ce??{}),Z?Object.fromEntries(tee.map(ke=>{var j;return[ke,(j=Z[ke])!=null?j:0]})):{}),ye?{streamMode:ye.lastMode,streamDelta:cee(ye,oe),streamStats:ye}:{}))}return ht(K)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:E,mdBase:g,mdInstance:y,mergedParseOptions:k,parsedNodes:w}}function dee(e){const{isClient:t}=e,n=X(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const g=new Set(b);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f<c||(h(),o.delete(f));for(const[f,h]of s.entries())f<c||(h.destroy(),s.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 o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function fee(e={}){const t=X(""),n=X(""),s=X(!1),o=hQ(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),c=D(()=>s.value&&a.value);return ly()&&ay(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const rC=/auto|scroll|overlay/i;function hee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return rC.test(t)||rC.test(n)}function pee(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 mee=Ge({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return xv((s=wc(e.estimatedPreviewHeightPx))!=null?s:kv(String((n=e.node.code)!=null?n:"")))});return()=>gn("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?gn("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)"}},[gn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[gn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),gn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),gn("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},()=>gn("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,gn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[gn("div",{class:"absolute inset-0"},[gn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),gee=Ge({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return bv((s=wc(e.estimatedPreviewHeightPx))!=null?s:yv(String((n=e.node.code)!=null?n:"")))});return()=>gn("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?gn("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)"}},[gn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[gn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),gn("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},()=>gn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[gn("span",{class:"action-icon block"})])))]):null,gn("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)"}},[gn("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"}})])])}}),vee=["data-custom-id"],yee={class:"m-0 p-0"},kee=["data-probe"],bee=["data-node-index","data-node-type"],t5=vn(Ge(Dt(rt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Qs(),r=Vt("markstreamNestedRendererProps",void 0);function l(A){var H,V;const G=s[A];return(function(ie){const Se=i?.vnode.props;return!!Se&&(Object.prototype.hasOwnProperty.call(Se,ie)||Object.prototype.hasOwnProperty.call(Se,String(ie).replace(/[A-Z]/g,Te=>`-${Te.toLowerCase()}`)))})(A)?G:(V=(H=r?.value)==null?void 0:H[A])!=null?V:G}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=D(()=>{return(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=D(()=>{const A=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return A===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:A===!1||c.value==="docs"?"monaco":"pre"}),d=D(()=>a[c.value]),f=D(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),h=D(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),p=D(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=D(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),b=D(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),v=D(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),g=D(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),y=D(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),k=D(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),E=D(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),L=D(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),$=D(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),w={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.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 s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return E.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function M(A){o("height-change",A)}function N(A){o("virtual-state-change",A)}function F(A){o("anchor-change",A)}const S=X(),I=X(null),B=X(null),R=X(null),P=Ps({1:null,2:null,3:null,4:null,5:null,6:null}),z=X(!1),W=new Map,ee=X(0),U=X(0),Y=X({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ue(){var A,H;if(((A=s.virtualScroll)==null?void 0:A.enabled)!==!0)return null;const V=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return fe(typeof V=="function"?V():V)}function fe(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?fe(A.value):typeof A=="object"&&"$el"in A?fe(A.$el):null:null}const{isClient:oe,renderAsFragment:Z,debugPerformanceEnabled:te,resolvedShowTooltips:ae,resolvedHtmlPolicy:He,inheritedSmoothStreaming:he,ownsTypewriterCursor:K}=(function(A){const H=typeof window<"u",V=Hd(),G=Vt("markstreamHtmlPolicy",void 0),ie=Vt("markstreamTypewriterCursor",void 0),Se=Vt("markstreamSmoothStreaming",void 0),Te=D(()=>A.renderAsFragment===!0),Ne=D(()=>!!(A.debugPerformance&&H&&typeof console<"u")),We=D(()=>{var ze;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Re=(ze=V.showTooltips)!=null?ze:V["show-tooltips"];return Re===""||Re===!0||Re==="true"||Re!==!1&&Re!=="false"&&void 0}),Fe=D(()=>{var ze,Re;return(Re=(ze=A.htmlPolicy)!=null?ze:G?.value)!=null?Re:"safe"}),Ve=D(()=>ie?.value!==!0);return{isClient:H,renderAsFragment:Te,debugPerformanceEnabled:Ne,resolvedShowTooltips:We,resolvedHtmlPolicy:Fe,inheritedSmoothStreaming:Se,inheritedTypewriterCursor:ie,ownsTypewriterCursor:Ve}})(w),{resolveViewportRoot:ce,resolveScrollContainer:ge,isReverseFlexScrollRoot:q,getNormalizedScrollTop:se,getOffsetTopWithinRoot:ye}=(function(A,H){function V(){var Ne,We;return(We=(Ne=H.scrollRoot)==null?void 0:Ne.call(H))!=null?We:null}function G(Ne){if(typeof window>"u")return null;const We=V();if(We)return We;const Fe=Ne??A.value;if(!Fe)return null;const Ve=Fe.ownerDocument||document,ze=Ve.scrollingElement||Ve.documentElement;let Re=Fe;for(;Re&&Re!==Ve.body&&Re!==ze;){if(hee(window.getComputedStyle(Re))&&pee(Re))return Re;Re=Re.parentElement}return null}function ie(Ne){if(!H.isClient)return!1;try{const We=window.getComputedStyle(Ne);return!!(We.display||"").toLowerCase().includes("flex")&&(We.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Se(Ne,We,Fe){var Ve,ze;if(Fe)return Te(We);const Re=Ne.scrollTop;if(!ie(Ne))return Re;const Ue=Re<0?-Re:Re;return Math.max(0,((Ve=Ne.scrollHeight)!=null?Ve:0)-((ze=Ne.clientHeight)!=null?ze:0))-Ue}function Te(Ne){var We,Fe,Ve,ze,Re;const Ue=Number((We=Ne.scrollingElement)==null?void 0:We.scrollTop),et=Number((Ve=(Fe=Ne.documentElement)==null?void 0:Fe.scrollTop)!=null?Ve:0),tt=Number((Re=(ze=Ne.body)==null?void 0:ze.scrollTop)!=null?Re:0);return Math.max(0,Number.isFinite(Ue)?Ue:0,Number.isFinite(et)?et:0,Number.isFinite(tt)?tt:0)}return{resolveViewportRoot:G,resolveScrollContainer:function(Ne){var We,Fe,Ve,ze;const Re=V();if(Re)return Re;const Ue=G((We=Ne??A.value)!=null?We:null);if(Ue)return Ue;const et=(ze=(Ve=Ne?.ownerDocument)!=null?Ve:(Fe=A.value)==null?void 0:Fe.ownerDocument)!=null?ze:typeof document<"u"?document:null;return et?.scrollingElement||et?.documentElement||null},isReverseFlexScrollRoot:ie,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:function(Ne,We){const Fe=We.ownerDocument||Ne.ownerDocument||document;if((function(Ue,et){return Ue===et.documentElement||Ue===et.body||Ue===et.scrollingElement})(We,Fe))return Ne.getBoundingClientRect().top+Te(Fe);const Ve=We.getBoundingClientRect(),ze=Ne.getBoundingClientRect(),Re=Se(We,Fe,!1);return ze.top-Ve.top+Re}}})(S,{isClient:oe,scrollRoot:ue});Ln("markstreamShowTooltips",ae),Ln("markstreamHtmlPolicy",He),Ln("markstreamTypewriter",D(()=>w.typewriter!==!1)),Ln("markstreamFade",D(()=>w.fade!==!1)),Ln("markstreamTypewriterCursor",D(()=>!0)),Ln("markstreamTextStreamState",W),Ln("markstreamStreamVersion",ee),Ln("markstreamParseOptions",D(()=>w.parseOptions)),Ln("markstreamCustomMarkdownIt",D(()=>w.customMarkdownIt));const{smoothStreamingEnabled:de,renderContent:ke,effectiveFinal:j}=(function(A,H){const V=fee(A.smoothStreamingOptions),G=D(()=>{var Fe,Ve,ze;return A.smoothStreaming!==!1&&!((Fe=A.nodes)!=null&&Fe.length)&&(A.smoothStreaming===!0||!((Ve=H.inheritedSmoothStreaming)!=null&&Ve.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((ze=A.maxLiveNodes)!=null?ze:0)<=0)}),ie=X(!H.isClient||A.smoothStreaming===!0);fn(()=>{ie.value=!0});const Se=D(()=>ie.value&&G.value),Te=D(()=>{var Fe;return Se.value?V.visible.value:(Fe=A.content)!=null?Fe:""}),Ne=D(()=>{var Fe,Ve;const ze=(Fe=A.parseOptions)!=null?Fe:{};return(Ve=A.final)!=null?Ve:ze.final}),We=D(()=>{const Fe=Ne.value;return Se.value&&Fe!=null?!!Fe&&V.caughtUp.value:Fe});return Ze([()=>A.content,()=>A.nodes,Se,Ne],([Fe,Ve,ze,Re])=>{if(Ve?.length)return void V.reset("");const Ue=Fe??"";if(!ze)return V.reset(Ue),void(Re&&V.finish({flush:!0}));const et=V.source.value;Ue?Ue===et||(Ue.startsWith(et)?V.enqueue(Ue.slice(et.length)):V.reset(Ue)):V.reset(""),Re&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:G,smoothStreamingEnabled:Se,renderContent:Te,requestedFinal:Ne,effectiveFinal:We}})(w,{isClient:oe,inheritedSmoothStreaming:he});Ln("markstreamSmoothStreaming",de);const ne=X(!1);let ve="",Ae=!1,$e=null;function Oe(){oe&&$e!=null&&(window.clearTimeout($e),$e=null)}function pe(){ne.value=!1,Oe()}function Ie(A,H){if(!te.value)return;const V=(function(){if(!te.value)return null;const G=wt(Xe),ie=wt(it),Se=Math.max(bt,ie);if(G<=0&&Se<=0)return null;const Te={total:G,maxPerFrame:Se,byLabel:(Ne=Xe,Object.fromEntries(Array.from(Ne.entries()).sort((We,Fe)=>Fe[1]-We[1]||We[0].localeCompare(Fe[0]))))};var Ne;return Xe.clear(),it.clear(),bt=0,Te})();console.info(`[markstream-vue][perf] ${A}`,V?Dt(rt({},H),{layoutReads:V}):H)}Ze([ke,()=>s.nodes,j],([A,H,V])=>{const G=A??"";return H?.length||V===!0?(pe(),ve=G,void(Ae=!0)):Ae?(ve&&G.length>ve.length&&G.startsWith(ve)?(ne.value=!0,oe&&(Oe(),$e=window.setTimeout(()=>{var ie;$e=null,j.value===!0||(ie=s.nodes)!=null&&ie.length||(ja(),ne.value=!1,ar())},1200))):(G.length<ve.length||!G.startsWith(ve))&&pe(),void(ve=G)):(ve=G,void(Ae=!0))},{flush:"sync",immediate:!0});const Xe=new Map,it=new Map;let At=!1,bt=0;function wt(A){let H=0;for(const V of A.values())H+=V;return H}function qt(){bt=Math.max(bt,wt(it)),it.clear(),At=!1}function yt(A,H){return(function(V){var G,ie;te.value&&(Xe.set(V,((G=Xe.get(V))!=null?G:0)+1),it.set(V,((ie=it.get(V))!=null?ie:0)+1),At||(At=!0,oe&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(qt):typeof queueMicrotask!="function"?setTimeout(qt,0):queueMicrotask(qt)))})(A),H()}const Kt=w.customId?`renderer-${w.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,gs=(function(A){const H=new Map;return{scope:A,cache:H,clear:()=>H.clear()}})(Kt),En=D(()=>`${Kt}:${ee.value}`);Ln(GM,gs);const Jt=Ms(()=>w.customId),{effectiveCustomHtmlTagsSet:wn,mergedParseOptions:vs,parsedNodes:st}=uee(w,{instanceMsgId:Kt,renderContent:ke,effectiveFinal:j,smoothStreamingEnabled:de,debugPerformanceEnabled:te,customComponentsMap:Jt,logPerf:Ie});Ze(st,()=>{gs.clear(),ee.value+=1},{immediate:!0});const Bn=D(()=>({customId:w.customId,customHtmlTags:vs.value.customHtmlTags,parseOptions:w.parseOptions,customMarkdownIt:w.customMarkdownIt,htmlPolicy:He.value,viewportPriority:w.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:w.codeBlockStream,codeBlockDarkTheme:w.codeBlockDarkTheme,codeBlockLightTheme:w.codeBlockLightTheme,codeBlockMonacoOptions:w.codeBlockMonacoOptions,renderCodeBlocksAsPre:w.renderCodeBlocksAsPre,codeBlockMinWidth:w.codeBlockMinWidth,codeBlockMaxWidth:w.codeBlockMaxWidth,codeBlockProps:w.codeBlockProps,mermaidProps:w.mermaidProps,d2Props:w.d2Props,infographicProps:w.infographicProps,showTooltips:ae.value,themes:w.themes,langs:w.langs,isDark:w.isDark,typewriter:w.typewriter,smoothStreamingOptions:w.smoothStreamingOptions,parseCoalesceMs:w.parseCoalesceMs,fade:w.fade}));Ln("markstreamNestedRendererProps",Bn);const Es=D(()=>st.value),Dn=D(()=>st.value.length),Hs=X(null),Ws=X(null),Qn=X(null),Tn=X(null),yn=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),jn=!yn&&w.customId?GS(w.customId):null,ds=D(()=>jn?(KS.value,GS(w.customId)):null),Gn=D(()=>{var A;return!!(oe&&!Z.value&&w.customId&&!yn&&((A=ds.value)!=null&&A.enabled))}),Nn=D(()=>{var A;return!!(!Z.value&&((A=s.virtualScroll)!=null&&A.enabled))}),Pn=X(!1);fn(()=>{Pn.value=!0});const Pt=D(()=>!!(oe&&Nn.value));Ln("markstreamHostScrollManaged",Pt);const Ye=D(()=>!!(Pn.value&&Pt.value)),qe=D(()=>Gn.value||Pt.value),Lt=D(()=>Gn.value||Ye.value),Ht=D(()=>{var A;return qe.value&&((A=ds.value)==null?void 0:A.textEstimation)!==!1}),sn=D(()=>{var A;return qe.value&&((A=ds.value)==null?void 0:A.codeBlockEstimation)!==!1});function Zt(){const A=U.value||yt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const _n=D(()=>{const A=Zt();return A>0?Math.max(1,Math.round(A)):640}),on=D(()=>{var A;return Math.max(1,(A=w.maxLiveNodes)!=null?A:320)}),Et=D(()=>{var A;return!Z.value&&w.nodeVirtual!==!1&&!(((A=w.maxLiveNodes)!=null?A:0)<=0)&&(w.nodeVirtual===!0?st.value.length>0:st.value.length>on.value)}),ns=D(()=>Et.value||Gn.value||Pt.value),ss=D(()=>w.viewportPriority!==!1&&!z.value),io=XX(A=>{var H;return ce((H=A??S.value)!=null?H:null)},ss),{requestFrame:Hn,cancelFrame:os,hasIdleCallback:oi,isTestEnv:Ls}=(function(A){const H=A.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=A.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,G=A.isClient&&typeof window.requestIdleCallback=="function",ie=(function(){var Se;if(typeof globalThis>"u"||!("process"in globalThis))return;const Te=(Se=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Se.value;return Te?.env})();return{requestFrame:H,cancelFrame:V,hasIdleCallback:G,isTestEnv:ie?.NODE_ENV==="test"}})({isClient:oe}),{resolvedBatchSize:ii,resolvedInitialBatch:Co,batchingEnabled:Di,incrementalRenderingActive:ri,renderedCount:ys,previousRenderContext:Ao,adaptiveBatchSize:or,previousBatchConfig:Pi}=(function(A,H){var V;const G=D(()=>{var ze;const Re=Math.trunc((ze=A.renderBatchSize)!=null?ze:80);return Number.isFinite(Re)?Math.max(0,Re):0}),ie=D(()=>{var ze;const Re=Math.trunc((ze=A.initialRenderBatchSize)!=null?ze:G.value);return Number.isFinite(Re)?Math.max(0,Re):G.value}),Se=D(()=>!H.renderAsFragment.value&&A.batchRendering!==!1&&G.value>0&&H.isClient&&!H.isTestEnv),Te=X(0),Ne=X({key:A.indexKey,total:0}),We=X(Math.max(1,G.value||1)),Fe=D(()=>{var ze;return Se.value&&((ze=A.maxLiveNodes)!=null?ze:0)<=0}),Ve=X({batchSize:G.value,initial:ie.value,delay:(V=A.renderBatchDelay)!=null?V:16,enabled:Fe.value});return{resolvedBatchSize:G,resolvedInitialBatch:ie,batchingEnabled:Se,incrementalRenderingActive:Fe,renderedCount:Te,previousRenderContext:Ne,adaptiveBatchSize:We,previousBatchConfig:Ve}})(w,{isClient:oe,isTestEnv:Ls,renderAsFragment:Z}),fs=new Map,Fs=new Map,ro=new WeakMap;let Os=null;const Mo=new WeakMap,Vn=new Map,lt=X(0),Q=D(()=>(lt.value,Array.from(fs.entries()).sort((A,H)=>A[0]-H[0]))),me=X(null),Je=X(null);let It=null,lo=0,be=null;const{activeRestoreAnchor:Ce,getRelativeScrollTopWithinContainer:De,setRelativeScrollTopWithinContainer:Ot,resolveAnchorOffset:Bt,clearRestoreReconcile:cn,scheduleRestoreReconcile:Kn,captureRestoreAnchor:Eo,restoreAnchor:J,getAnchorDrift:_e}=(function(A){const{isClient:H,containerRef:V,parsedNodeCount:G,requestFrame:ie,cancelFrame:Se,resolveScrollContainer:Te,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:We,isReverseFlexScrollRoot:Fe,estimateIndexForOffset:Ve,estimateHeightRange:ze,getFallbackNodeHeight:Re,clamp:Ue}=A,et=X(null);let tt=null,_t=[];function at(){const Nt=Te(),Ut=V.value;if(!Nt||!Ut)return null;const Wt=Nt.ownerDocument||Ut.ownerDocument||document;if(Nt===Wt.documentElement||Nt===Wt.body||Nt===Wt.scrollingElement){const hn=Ut.getBoundingClientRect();return Math.max(0,-hn.top)}return Math.max(0,Ne(Nt,Wt,!1)-We(Ut,Nt))}function dt(Nt){var Ut;const Wt=Te(),hn=V.value;if(!Wt||!hn)return;const Vo=Math.max(0,Nt),co=Wt.ownerDocument||hn.ownerDocument||document,Ai=co.defaultView||(typeof window<"u"?window:null);if(Wt===co.documentElement||Wt===co.body||Wt===co.scrollingElement){const Yr=Ne(Wt,co,!0)+hn.getBoundingClientRect().top;return void((Ut=Ai?.scrollTo)==null||Ut.call(Ai,0,Math.max(0,Yr+Vo)))}QS(Wt,co,We(hn,Wt)+Vo,{isReverseFlexScrollRoot:Yr=>{var Zr;return(Zr=Fe?.(Yr))!=null&&Zr},getNormalizedScrollTop:Ne})}function Ct(Nt){const Ut=G.value,Wt=Ue(Nt.nodeIndex,0,Math.max(0,Ut-1));return ze(0,Wt)+Math.max(0,Nt.offsetWithinNodePx)}function St(){if(tt!=null&&(Se?.(tt),tt=null),H)for(const Nt of _t)window.clearTimeout(Nt);_t=[]}function rn(Nt){const Ut=Ct(Nt),Wt=at();Wt!=null&&Math.abs(Wt-Ut)<=.5||dt(Ut)}return{activeRestoreAnchor:et,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:dt,resolveAnchorOffset:Ct,clearRestoreReconcile:St,applyRestoreAnchor:rn,scheduleRestoreReconcile:function(){et.value&&H&&tt==null&&(tt=ie?ie(()=>{tt=null,et.value&&rn(et.value)}):null,tt==null&&et.value&&rn(et.value))},captureRestoreAnchor:function(){const Nt=at(),Ut=G.value;if(Nt==null||Ut<=0)return null;const Wt=Ue(Ve(Nt+1),0,Ut-1),hn=ze(0,Wt),Vo=Re(Wt);return{nodeIndex:Wt,offsetWithinNodePx:Ue(Nt-hn,0,Math.max(0,Vo-1))}},restoreAnchor:function(Nt){const Ut=G.value;if(et.value={nodeIndex:Ue(Nt.nodeIndex,0,Math.max(0,Ut-1)),offsetWithinNodePx:Math.max(0,Nt.offsetWithinNodePx)},St(),rn(et.value),H)for(const Wt of[0,120,280,480])_t.push(window.setTimeout(()=>{et.value&&rn(et.value)},Wt))},getAnchorDrift:function(Nt){const Ut=at();return Ut==null?null:Ut-Ct(Nt)}}})({isClient:oe,containerRef:S,parsedNodeCount:Dn,requestFrame:Hn,cancelFrame:os,resolveScrollContainer:()=>me.value||ge(),getNormalizedScrollTop:se,getOffsetTopWithinRoot:ye,isReverseFlexScrollRoot:q,estimateIndexForOffset:I1,estimateHeightRange:Gr,getFallbackNodeHeight:lf,clamp:Us}),{nodeHeights:we,heightStats:Le,heightTreeSize:Ke,heightSumTree:ot,heightKnownTree:Tt,averageNodeHeight:zt,resetHeightMeasurements:Wn,pruneHeightMeasurements:tn,rebuildHeightTrees:ks,recordNodeHeight:ao,removeNodeHeights:mt,exportHeightCache:jt,importHeightCache:Sn,fenwickRangeSum:is}=(function(A={}){const H=Ps({}),V=Ps({total:0,count:0}),G=X(0),ie=X([]),Se=X([]);function Te(){for(const Re of Object.keys(H))delete H[Number(Re)];V.total=0,V.count=0,G.value=0,ie.value=[],Se.value=[]}function Ne(Re,Ue,et){for(let tt=Ue+1;tt<Re.length;tt+=tt&-tt)Re[tt]+=et}function We(Re,Ue){let et=0;for(let tt=Ue+1;tt>0;tt-=tt&-tt)et+=Re[tt];return et}function Fe(Re){G.value=Re;const Ue=new Array(Re+1).fill(0),et=new Array(Re+1).fill(0);for(const[tt,_t]of Object.entries(H)){const at=Number(tt),dt=Number(_t);!Number.isFinite(at)||at<0||at>=Re||!Number.isFinite(dt)||dt<=0||(Ne(Ue,at,dt),Ne(et,at,1))}ie.value=Ue,Se.value=et}function Ve(Re){if(!Number.isInteger(Re)||Re<0)return!1;const Ue=H[Re];if(!Number.isFinite(Ue)||Ue<=0)return!1;if(delete H[Re],V.total=Math.max(0,V.total-Ue),V.count=Math.max(0,V.count-1),G.value>Re){const et=ie.value,tt=Se.value;et.length&&tt.length&&(Ne(et,Re,-Ue),Ne(tt,Re,-1))}return!0}const ze=D(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:H,heightStats:V,heightTreeSize:G,heightSumTree:ie,heightKnownTree:Se,averageNodeHeight:ze,resetHeightMeasurements:Te,pruneHeightMeasurements:function(Re){if(Re<=0)return void Te();let Ue=0,et=0;for(const[tt,_t]of Object.entries(H)){const at=Number(tt),dt=Number(_t);!Number.isFinite(at)||at<0||at>=Re||!Number.isFinite(dt)||dt<=0?delete H[at]:(Ue+=dt,et++)}V.total=Ue,V.count=et},rebuildHeightTrees:Fe,recordNodeHeight:function(Re,Ue,et={}){(function(tt,_t,at={}){var dt;if(!Number.isFinite(_t)||_t<=0)return!1;const Ct=H[tt];if(Ct&&(at.allowShrink===!1&&_t<Ct||Math.abs(_t-Ct)<=1))return!1;if(H[tt]=_t,Ct?V.total+=_t-Ct:(V.total+=_t,V.count++),G.value>tt){const St=ie.value,rn=Se.value;if(St.length&&rn.length)if(Ct){const Nt=_t-Ct;Nt!==0&&Ne(St,tt,Nt)}else Ne(St,tt,_t),Ne(rn,tt,1)}at.notify!==!1&&((dt=A.onHeightRecorded)==null||dt.call(A))})(Re,Ue,Dt(rt({},et),{notify:!0}))},removeNodeHeight:function(Re,Ue={}){var et;const tt=Ve(Re);return tt&&Ue.notify!==!1&&((et=A.onHeightRecorded)==null||et.call(A)),tt},removeNodeHeights:function(Re,Ue={}){var et;let tt=0;for(const _t of Re)Ve(Number(_t))&&tt++;return tt>0&&Ue.notify!==!1&&((et=A.onHeightRecorded)==null||et.call(A)),tt},exportHeightCache:function(){return Object.entries(H).map(([Re,Ue])=>({index:Number(Re),height:Number(Ue)})).filter(Re=>Number.isFinite(Re.index)&&Re.index>=0&&Number.isFinite(Re.height)&&Re.height>0).sort((Re,Ue)=>Re.index-Ue.index)},importHeightCache:function(Re,Ue={}){var et;if(!Array.isArray(Re))return;const tt=G.value;let _t=!1;if(Ue.mode!=="merge"){const at=Object.keys(H);if(at.length>0){for(const dt of at)delete H[Number(dt)];_t=!0}}for(const at of Re){const dt=Number(at.index),Ct=Number(at.height);if(!Number.isInteger(dt)||dt<0||tt>0&&dt>=tt||!Number.isFinite(Ct)||Ct<=0)continue;const St=H[dt];St&&Math.abs(St-Ct)<=1||(H[dt]=Ct,_t=!0)}_t&&((function(){let at=0,dt=0;const Ct=G.value;for(const[St,rn]of Object.entries(H)){const Nt=Number(St),Ut=Number(rn);!Number.isFinite(Nt)||Nt<0||Ct>0&&Nt>=Ct||!Number.isFinite(Ut)||Ut<=0?delete H[Nt]:(at+=Ut,dt++)}V.total=at,V.count=dt})(),tt>0&&Fe(tt),(et=A.onHeightRecorded)==null||et.call(A))},fenwickRangeSum:function(Re,Ue,et){if(et<=Ue)return 0;const tt=We(Re,et-1);return Ue<=0?tt:tt-We(Re,Ue-1)}}})({onHeightRecorded:()=>{ai(),Pt.value&&bu(),Ce.value&&Kn(),Je.value&&za(),zn("node-resize")}});function rs(){Wn(),Vn.clear()}function ir(A){!Number.isInteger(A)||A<0||A>=st.value.length||Vn.set(A,cu(A))}function Wl(A,H,V={}){const G=we[A];ao(A,H,V);const ie=we[A];ie&&ie>0?ir(A):G&&Vn.delete(A)}function Jd(A,H){const V=yt("getNodeLayoutHeight.slot.offsetHeight",()=>{var G,ie;return(ie=(G=fs.get(A))==null?void 0:G.offsetHeight)!=null?ie:0});return V>0?V:yt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function d2(A,H={}){Sn(A,H),w1()}const qr=D(()=>{var A;return!Z.value&&w.deferNodesUntilVisible!==!1&&!(((A=w.maxLiveNodes)!=null?A:0)<=0)&&!Et.value&&!(st.value.length>900)&&ss.value}),f2=D(()=>!!io&&(qr.value||Et.value)),h2=D(()=>Et.value||Pt.value),{liveNodeBufferResolved:iu,focusIndex:li,liveRange:zs,updateLiveRange:zl}=(function(A,H){const{parsedNodeCount:V,virtualizationEnabled:G,maxLiveNodesResolved:ie,clamp:Se}=H,Te=D(()=>{var Fe;return Math.max(0,(Fe=A.liveNodeBuffer)!=null?Fe:60)}),Ne=X(0),We=Ps({start:0,end:0});return{liveNodeBufferResolved:Te,focusIndex:Ne,liveRange:We,updateLiveRange:function(){const Fe=V.value;if(!G.value||Fe===0)return We.start=0,void(We.end=Fe);const Ve=Math.min(ie.value,Fe),ze=Te.value,Re=Se(Ne.value-ze,0,Math.max(0,Fe-Ve));We.start=Re,We.end=Math.min(Fe,Re+Ve)}}})(w,{parsedNodeCount:Dn,virtualizationEnabled:Et,maxLiveNodesResolved:on,clamp:Us}),Hi=new Map,Ul=new Map,jr=new Map,ef=[],rr=new Map,Vr=new Set,p2=X(0);let Ym=!1;const m2=D(()=>(p2.value,Vr.size)),Uo=new Map,Wi=new Map,g2=X(0),Zm=D(()=>{g2.value;let A=0;for(const H of Uo.values())A+=Math.max(0,H);return A});let qo=null,Qm=!0,v2=[0],y2="";function ai(){Qm=!0}const tf=D(()=>{if(!Et.value)return st.value.length;const A=iu.value,H=Math.max(zs.end+A,Co.value),V=Math.min(st.value.length,H);return Math.max(ys.value,V)});function nf(){Ym||(Ym=!0,queueMicrotask(()=>{Ym=!1,p2.value+=1}))}function k2(A,H,V="node-resize"){if(!oe||typeof window>"u")return null;const G=window.setTimeout(()=>{Vr.delete(G)&&nf();try{H()}finally{zn(V)}},Math.max(0,A));return Vr.add(G),nf(),G}function sf(A){oe&&A!=null&&(Vr.delete(A)&&nf(),window.clearTimeout(A))}function b2(){if(oe&&typeof window<"u")for(const A of Vr)window.clearTimeout(A);Vr.size&&(Vr.clear(),nf()),ef.length=0,jr.clear()}function C8(A){var H,V;return(V=(H=Tn.value)==null?void 0:H[A])!=null?V:null}const{cancelScheduledFocusSync:Xm,scheduleFocusSync:zi}=(function(A){const{isClient:H,containerRef:V,virtualizationEnabled:G,requestFrame:ie,cancelFrame:Se,syncFocusToScroll:Te}=A;let Ne=null;function We(){var Ve,ze,Re;return(Re=(ze=(Ve=V.value)==null?void 0:Ve.ownerDocument)==null?void 0:ze.defaultView)!=null?Re:typeof window<"u"?window:null}function Fe(){if(!Ne)return;const Ve=We();Ne.viaTimeout?Ve?Ve.clearTimeout(Ne.id):clearTimeout(Ne.id):Se?.(Ne.id),Ne=null}return{cancelScheduledFocusSync:Fe,scheduleFocusSync:function(Ve={}){if(!G.value)return;if(!H)return void Te(!0);if(Ve.immediate)return Fe(),void Te(!0);if(Ne)return;const ze=()=>{Ne=null,Te()};if(ie)return void(Ne={id:ie(ze),viaTimeout:!1});const Re=We();Ne={id:Re?Re.setTimeout(ze,16):setTimeout(ze,16),viaTimeout:!0}}}})({isClient:oe,containerRef:S,virtualizationEnabled:Et,requestFrame:Hn,cancelFrame:os,syncFocusToScroll:function(A=!1){var H;if(!Et.value)return;const V=me.value||ge();if(!V)return;const G=V.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,ie=G?.defaultView||(typeof window<"u"?window:null),Se=V===G?.documentElement||V===G?.body,Te=st.value.length;if(!Se&&Te>0&&q(V)){const et=yt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),tt=yt("syncFocusToScroll.scrollTop",()=>V.scrollTop),_t=tt<0?-tt:tt,at=(function(Ct){var St,rn;const Nt=st.value;if(!Nt.length)return 0;if(Ct<=0)return Math.max(0,Nt.length-1);if(qe.value){const Wt=(St=s1()[Nt.length])!=null?St:0;return E2(Math.max(0,Wt-Ct))}if(Ke.value===Nt.length){const Wt=Gr(0,Nt.length);return I1(Math.max(0,Wt-Ct))}let Ut=Ct;for(let Wt=Nt.length-1;Wt>=0;Wt--){const hn=(rn=we[Wt])!=null?rn:zt.value;if(Ut<=hn)return Wt;Ut-=hn}return 0})(Math.max(0,_t)+.5*Math.max(0,et)),dt=Us(at,0,Math.max(0,Te-1));return void((A||Math.abs(dt-li.value)>1)&&(li.value=dt,zl()))}const Ne=Se?null:yt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),We=Se?0:Ne.top,Fe=Se?yt("syncFocusToScroll.viewport.clientHeight",()=>{var et,tt;return(tt=(et=ie?.innerHeight)!=null?et:V.clientHeight)!=null?tt:0}):Ne.bottom,Ve=Q.value;let ze=null,Re=null;for(const[et,tt]of Ve){if(!tt)continue;const _t=yt("syncFocusToScroll.slot.getBoundingClientRect",()=>tt.getBoundingClientRect());_t.bottom<=We||_t.top>=Fe||(ze==null&&(ze=et),Re=et)}if(ze==null||Re==null){const et=S.value;if(!et)return;const tt=Se?{top:0}:yt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),_t=yt("syncFocusToScroll.fallback.scrollTop",()=>se(V,G,Se)),at=Se?(()=>{const St=yt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>et.getBoundingClientRect()),rn=(Se?0:tt.top)-St.top;return Math.max(0,rn)})():(()=>{const St=ye(et,V);return Math.max(0,_t-St)})(),dt=Se?yt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var St,rn,Nt,Ut;return(Ut=(Nt=(rn=ie?.innerHeight)!=null?rn:(St=G?.documentElement)==null?void 0:St.clientHeight)!=null?Nt:V.clientHeight)!=null?Ut:0}):yt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),Ct=I1(at+.5*Math.max(0,dt));return li.value=Us(Ct,0,Math.max(0,st.value.length-1)),void zl()}const Ue=Math.round((ze+Re)/2);!A&&Math.abs(Ue-li.value)<=1||(li.value=Us(Ue,0,Math.max(0,st.value.length-1)),zl())}}),{visibleNodeIndices:Jm,nodeVisibilityHandles:Oa,nodeVisibilityWatchStops:of,nodeVisibilityFallbackTimers:x2,clearVisibilityFallback:rf,markNodeVisible:Kr,cleanupNodeVisibility:A8,destroyNodeVisibilityState:e1}=dee({isClient:oe,shouldTrackVisibleNodeIndices:()=>qr.value,shouldCleanupNodeVisibility:()=>Et.value,onNodeMarkedVisible:A=>{Et.value?zi():li.value=Us(A,0,Math.max(0,st.value.length-1))},onNodeVisibilityCleaned:A=>{fs.delete(A)&&Z2()}}),{cleanupScrollListener:w2,setupScrollListener:M8}=(function(A){const{isClient:H,virtualizationEnabled:V,listenerEnabled:G,scrollRootElement:ie,resolveScrollContainer:Se,scheduleFocusSync:Te,onScroll:Ne}=A;let We=null,Fe=null;function Ve(){We&&(We(),We=null),Fe=null,ie.value=null}function ze(Re){const Ue=A.getScrollTop?A.getScrollTop(Re):Re.scrollTop;return Math.max(0,Number.isFinite(Ue)?Math.abs(Ue):0)}return{cleanupScrollListener:Ve,setupScrollListener:function(){if(!H)return;if(!((Re=G?.value)!=null?Re:V.value))return void Ve();var Re;const Ue=Se();if(!Ue)return void Ve();if(ie.value===Ue&&We)return;Ve(),Fe=ze(Ue);const et=()=>{if(Ne?.(),V.value){const tt=(function(_t){const at=ze(_t),dt=Fe;Fe=at;const Ct=Math.max(480,.75*(_t.clientHeight||0));return dt==null?at>Ct?{immediate:!0}:void 0:Math.abs(at-dt)>Ct?{immediate:!0}:void 0})(Ue);tt?Te(tt):Te()}};Ue.addEventListener("scroll",et,{passive:!0}),ie.value=Ue,We=()=>{Ue.removeEventListener("scroll",et)}}}})({isClient:oe,virtualizationEnabled:Et,listenerEnabled:h2,scrollRootElement:me,resolveScrollContainer:ge,scheduleFocusSync:zi,onScroll:function(){const A=Je.value;if(!A)return;const H=au();if(!H||(function(G){if(pu()>=lo)return be=null,!1;const ie=be;if(ie==null)return!0;const Se=Math.abs(G.scrollTop-ie)<=2;return Se||(be=null),Se})(H))return;const V=B2(H);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,A.distanceFromBottomPx))>32)&&Wa("restore"):Wa("restore")},getScrollTop:A=>{var H;const V=A.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,G=A===V.documentElement||A===V.body||A===V.scrollingElement;return yt("scrollListener.getScrollTop",()=>se(A,V,G))}});function Us(A,H,V){return Math.min(Math.max(A,H),V)}function t1(A){return A?.firstElementChild}function _2(A,H){var V;return A?(V=A.matches)!=null&&V.call(A,H)?A:A.querySelector(H):null}function S2(){if(!qe.value)return void(U.value=0);const A=yt("updateExperimentContainerWidth.clientWidth",()=>{var H,V;return(V=(H=S.value)==null?void 0:H.clientWidth)!=null?V:0});U.value=A>0?A:0}let ru=null;function n1(){ru?.disconnect(),ru=null}const C2=Ii({loader:()=>Jn(null,null,function*(){return(yield go(()=>import("./index8-BBnkw3W9.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:WM,delay:0,suspensible:!1});function A2(A){return A===C2}const M2=D(()=>u.value==="pre"?Ko:u.value==="shiki"?C2:H0),ql=D(()=>{const A=st.value;if(!A.length||!qe.value)return A.map(()=>null);const H=U.value||yt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(H)||H<=0?A.map(()=>null):A.map((V,G)=>{const ie=we[G],Se=typeof ie=="number"&&ie>0;if(Ht.value&&!Se){const Ne=KM(V,H,Y.value);if(Ne)return Ne}if(sn.value&&V.type==="code_block"){const Ne=(function(We){if(We.type!=="code_block")return null;const Fe=cb(We,pf(We));return A2(Fe)?"markdown":Fe===Ko?"pre":Fe===M2.value||Fe===H0?"monaco":null})(V);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return ZJ(V,{rendererKind:Ne,monacoOptions:w.codeBlockMonacoOptions,showHeader:((Te=w.codeBlockProps)==null?void 0:Te.showHeader)!==!1})}var Te;return null})});function lf(A){var H;const V=we[A];if(Number.isFinite(V)&&V>0)return V;const G=(H=ql.value[A])==null?void 0:H.height;return Number.isFinite(G)&&G>0?G:Math.max(zt.value,(function(ie){var Se,Te,Ne,We,Fe,Ve,ze,Re,Ue,et,tt,_t,at;const dt=st.value[ie];if(!dt||typeof dt!="object")return 32;const Ct=String((Se=dt.type)!=null?Se:""),St=Zt()||640;switch(Ct){case"heading":return 44;case"paragraph":return Ra(String((Ne=(Te=dt.raw)!=null?Te:dt.content)!=null?Ne:""),St,34);case"list":{const rn=Array.isArray(dt.items)?dt.items.length:1;return Math.max(48,30*rn+12)}case"list_item":return Ra(String((Fe=(We=dt.raw)!=null?We:dt.content)!=null?Fe:""),St,34);case"blockquote":return Ra(String((ze=(Ve=dt.raw)!=null?Ve:dt.content)!=null?ze:""),St,56);case"table":{const rn=Array.isArray(dt.rows)?dt.rows.length:Array.isArray(dt.children)?dt.children.length:3;return Math.max(120,38*rn+48)}case"code_block":return Ra(String((Ue=(Re=dt.code)!=null?Re:dt.raw)!=null?Ue:""),St,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Ra(String((tt=(et=dt.raw)!=null?et:dt.content)!=null?tt:""),St,96);case"thematic_break":return 24;default:return Ra(String((at=(_t=dt.raw)!=null?_t:dt.content)!=null?at:""),St,40)}})(A))}function Ra(A,H,V,G=22){const ie=String(A??"");if(!ie)return V;const Se=Math.max(18,Math.floor(Math.max(320,H)/8)),Te=ie.split(/\r?\n/).length,Ne=Math.ceil(ie.length/Se),We=Math.max(1,Te,Ne);return Math.max(V,Math.ceil(We*G+12))}function lu(A){const H=Number(A);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function s1(){var A,H;const V=st.value.length,G=lu(U.value||yt("getFallbackHeightPrefix.clientWidth",()=>{var Ne;return((Ne=S.value)==null?void 0:Ne.clientWidth)||0})),ie=((A=s.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(s.virtualScroll.measurementKey),Se=[V,Le.count,Math.round(Le.total),Math.round(100*zt.value),ie,G,qe.value?1:0,KS.value,ee.value].join(":");if(!Qm&&y2===Se)return v2;const Te=new Array(V+1);Te[0]=0;for(let Ne=0;Ne<V;Ne++)Te[Ne+1]=Te[Ne]+(qe.value?lf(Ne):(H=we[Ne])!=null?H:zt.value);return v2=Te,y2=Se,Qm=!1,Te}function E2(A){var H,V;const G=st.value.length;if(G<=0||A<=0)return 0;const ie=s1();if(A>=((H=ie[G])!=null?H:0))return G-1;let Se=0,Te=G-1,Ne=G-1;for(;Se<=Te;){const We=Se+Te>>1;((V=ie[We+1])!=null?V:0)>=A?(Ne=We,Te=We-1):Se=We+1}return Ne}function Gr(A,H){var V,G;if(A>=H)return 0;if(qe.value)return(function(Te,Ne){var We,Fe;const Ve=st.value.length,ze=Us(Math.trunc(Te),0,Ve),Re=Us(Math.trunc(Ne),ze,Ve);if(ze>=Re)return 0;const Ue=s1();return((We=Ue[Re])!=null?We:0)-((Fe=Ue[ze])!=null?Fe:0)})(A,H);if(Ke.value!==st.value.length){let Te=0;for(let Ne=A;Ne<H;Ne++)Te+=(V=we[Ne])!=null?V:zt.value;return Te}const ie=ot.value,Se=Tt.value;if(!ie.length||!Se.length){let Te=0;for(let Ne=A;Ne<H;Ne++)Te+=(G=we[Ne])!=null?G:zt.value;return Te}return is(ie,A,H)+(H-A-is(Se,A,H))*zt.value}Ze(()=>st.value.length,A=>{ai(),A<=0?rs():(A<Ke.value&&tn(A),A!==Ke.value&&ks(A))},{immediate:!0});const E8=D(()=>{if(!Et.value)return st.value.map((G,ie)=>({node:G,index:ie}));const A=st.value.length,H=Us(zs.start,0,A),V=Us(zs.end,H,A);return st.value.slice(H,V).map((G,ie)=>({node:G,index:H+ie}))}),o1=D(()=>Et.value?Gr(0,Math.min(zs.start,st.value.length)):0),i1=D(()=>{if(!Et.value)return 0;const A=st.value.length;return Gr(Math.min(zs.end,A),A)});function T2(){if(!qe.value)return 0;let A=0;const H=ql.value;for(let V=0;V<H.length;V++){if(!H[V])continue;const G=we[V];Number.isFinite(G)&&G>0||A++}return A}function N2(){const A=st.value.length;return{totalNodes:A,measuredCount:Le.count,estimatedCount:T2(),averageNodeHeight:zt.value,topSpacerHeight:o1.value,bottomSpacerHeight:i1.value,estimatedTotalHeight:Gr(0,A),width:jl()}}function T8(){const A=st.value,H=N2();return Dt(rt({},H),{probe:{paragraphReady:!!Y.value.paragraph,listItemReady:!!Y.value.listItem,listWrapperOverhead:Y.value.listWrapperOverhead,headingReadyLevels:Object.entries(Y.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:A.map((V,G)=>{var ie,Se,Te,Ne,We,Fe,Ve,ze,Re;return{index:G,type:V.type,estimateKind:(Se=(ie=ql.value[G])==null?void 0:ie.kind)!=null?Se:null,rendererKind:(Ne=(Te=ql.value[G])==null?void 0:Te.rendererKind)!=null?Ne:null,estimatedHeight:(Fe=(We=ql.value[G])==null?void 0:We.height)!=null?Fe:null,estimatedContentHeight:(ze=(Ve=ql.value[G])==null?void 0:Ve.contentHeight)!=null?ze:null,measuredHeight:(Re=we[G])!=null?Re:null}})})}function r1(){return s.indexKey!=null?String(s.indexKey):Nn.value?`virtual-${Yn()}`:"markdown-renderer"}function I2(A){const H=String(A),V=`${r1()}-`;if(!H.startsWith(V))return null;const G=H.slice(V.length).match(/^(\d+)(?:$|-)/);if(!G)return null;const ie=Number(G[1]);return!Number.isInteger(ie)||ie<0||ie>=st.value.length?null:ie}function Yn(){var A,H,V;const G=(A=s.virtualScroll)==null?void 0:A.sessionKey;return String(G!=null&&G!==""?G:(V=(H=s.indexKey)!=null?H:w.customId)!=null?V:Kt)}function Ts(){var A;const H=(A=s.virtualScroll)==null?void 0:A.threadKey;return H==null||H===""?void 0:String(H)}function l1(A){var H;return(A??"")===((H=Ts())!=null?H:"")}function N8(){var A;const H=(A=s.virtualScroll)==null?void 0:A.measurementKey;return H==null?"":String(H)}function I8(){var A,H;const V=u.value,G=V==="monaco"?w.codeBlockMonacoOptions:void 0,ie=w.codeBlockProps,Se=V==="shiki";return[w.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",w.codeBlockStream===!1?"code-static":"code-stream",Rs(w.codeBlockMinWidth),Rs(w.codeBlockMaxWidth),...Se?[bp((A=ie?.themes)!=null?A:w.themes,(H=ie?.langs)!=null?H:w.langs)]:[],Rs(G?.fontSize),Rs(G?.lineHeight),Rs(G?.fontFamily),Rs(G?.tabSize),Rs(G?.MAX_HEIGHT),Rs(G?.wordWrap),Rs(G?.wrappingIndent),Rs(G?.padding),Rs(ie?.showHeader),Rs(ie?.showCopyButton),Rs(ie?.showExpandButton),Rs(ie?.showPreviewButton),Rs(ie?.showCollapseButton),Rs(ie?.showFontSizeButtons)].join("\0")}function lr(){return[N8(),I8()].join("\0")}function jl(){return Zt()}const af=D(()=>lu(jl())),jo=D(()=>[lr(),af.value].join("\0")),$8=D(()=>{var A;return Nn.value?["virtual",(A=Ts())!=null?A:"",Yn(),jo.value].join("\0"):s.indexKey});function Ba(){g2.value+=1}function a1(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=st.value.length||A.sessionKey!==Yn()||A.threadKey!==Ts()||A.layoutEpochKey!==jo.value)}function $2(A){const H=String(A),V=Wi.get(H);return V?a1(V)?V.index:null:I2(H)}function L2(A="async-node"){(Uo.size||Wi.size)&&(Uo.clear(),Wi.clear(),Ba(),zn(A))}const Da=Vt(mv,null),c1={reportHeight(A,H){if(!Pt.value)return;const V=$2(A);if(V==null)return;const G=Hi.get(V);if(!G)return;const ie=Number(H),Se=Jd(V,G);Wl(V,Number.isFinite(ie)&&ie>0?Math.max(ie,Se||0):Se)},markPending(A){if(!Pt.value)return;const H=I2(A);H!=null&&(function(V,G){var ie;const Se=Wi.get(V);if(Se&&a1(Se))return Uo.set(V,Math.max(0,(ie=Uo.get(V))!=null?ie:0)+1),Ba(),void zn("async-node");Uo.set(V,1),Wi.set(V,(function(Te){return{index:Te,sessionKey:Yn(),threadKey:Ts(),layoutEpochKey:jo.value}})(G)),Ba(),zn("async-node")})(String(A),H)},markSettled(A){if(!Pt.value)return;const H=String(A),V=$2(A);(V!=null||(function(G){return Uo.has(String(G))})(H))&&(function(G){var ie;const Se=(ie=Uo.get(G))!=null?ie:0;return!(Se<=0||(Se<=1?(Uo.delete(G),Wi.delete(G)):Uo.set(G,Se-1),Ba(),Se===1&&zn("async-node"),0))})(H)&&V!=null&&ar()}};function L8(){let A=0;for(const H of Hi.values())A+=yt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=H?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,A))}Ln(mv,{reportHeight(A,H){c1.reportHeight(A,H),Da?.reportHeight(A,H)},markPending(A){c1.markPending(A),Da?.markPending(A)},markSettled(A){c1.markSettled(A),Da?.markSettled(A)}});let u1,d1=null,Pa=null;function cf(A){return A!==!1&&A!=null&&A!==""}function F2(){return Et.value?(function(){if(!Et.value)return!0;const A=st.value.length,H=Us(zs.start,0,A),V=Us(zs.end,H,A);if(H>=V)return!0;for(let G=H;G<V;G++)if(!fs.has(G)||$1(G)&&!Hi.has(G))return!1;return!0})():ys.value>=tf.value}function f1(){return j.value===!0&&!ne.value&&Zm.value===0&&Vr.size===0&&rr.size===0&&qo==null&&F2()}function O2(){var A,H;if(((A=s.virtualScroll)==null?void 0:A.settleMode)!=="manual"||d1===Yn()&&u1===Ts())return!0;const V=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!cf(V)&&Pa===xu(V)}function h1(){return f1()&&O2()}function F8(A,H){return H.totalNodes<=0?A==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?A==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function Vl(A="manual",H){const V=N2(),G=(function(ie){return ie||(j.value!==!0?st.value.length>0?"streaming":"estimating":!F2()||rr.size>0||qo!=null?"measuring":h1()?"settled":"settling")})(H);return{sessionKey:Yn(),threadKey:Ts(),phase:G,nodeCount:V.totalNodes,liveRange:{start:zs.start,end:zs.end},renderedCount:ys.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:L8(),totalHeight:R2(),width:V.width,final:j.value===!0,stable:h1(),confidence:F8(G,V),reason:A}}function au(){const A=me.value||ge(),H=S.value;if(!A||!H)return null;const V=A.ownerDocument||H.ownerDocument||document,G=A===V.documentElement||A===V.body||A===V.scrollingElement,ie=yt("getScrollBox.scrollTop",()=>se(A,V,G)),Se=yt("getScrollBox.scrollHeight",()=>{var Ne,We,Fe,Ve,ze;return G?Math.max((We=(Ne=V.documentElement)==null?void 0:Ne.scrollHeight)!=null?We:0,(Ve=(Fe=V.body)==null?void 0:Fe.scrollHeight)!=null?Ve:0,(ze=A.scrollHeight)!=null?ze:0):A.scrollHeight}),Te=yt("getScrollBox.clientHeight",()=>{var Ne;return G?((Ne=V.documentElement)==null?void 0:Ne.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:V,isViewportRoot:G,scrollTop:ie,scrollHeight:Se,clientHeight:Te}}function R2(){const A=st.value.length,H=Math.max(0,Gr(0,A)),V=yt("getRendererLogicalHeight.offsetHeight",()=>{var ie,Se;return(Se=(ie=S.value)==null?void 0:ie.offsetHeight)!=null?Se:0}),G=Math.max(0,V>0?V:yt("getRendererLogicalHeight.scrollHeight",()=>{var ie,Se;return(Se=(ie=S.value)==null?void 0:ie.scrollHeight)!=null?Se:0}));return A<=0?Math.ceil(V):Et.value?H>0?Math.max(1,Math.ceil(H),(function(){let ie=o1.value+i1.value;for(const Se of fs.values())Se&&(ie+=Math.max(0,yt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Se.offsetHeight||0)));return Math.ceil(Math.max(0,ie))})(),(function(ie,Se){return ie<=0||Se<=0?0:Se<=ie+Math.max(512,.05*ie)?Math.ceil(Se):0})(H,G)):Math.max(1,Math.ceil(G)):Pt.value?H>0||Le.count>0||T2()>0?(ri.value&&ys.value,Math.max(1,Math.ceil(G),Math.ceil(H))):Math.ceil(G):Math.max(1,Math.ceil(G),Math.ceil(H))}function B2(A){const H=S.value;if(!H)return null;const V=yt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(ie){return ie.isViewportRoot?ie.clientHeight:yt("getViewportBottomInRoot.getBoundingClientRect",()=>ie.root.getBoundingClientRect().bottom)})(A)-V.bottom}function O8(A={}){const H=A.requireViewport!==!1,V=(function(Se=64){const Te=au(),Ne=S.value;if(!Te||!Ne)return!1;const We=(function(Ve){if(Ve.isViewportRoot)return{top:0,bottom:Ve.clientHeight};const ze=yt("getVirtualViewportRect.getBoundingClientRect",()=>Ve.root.getBoundingClientRect());return{top:ze.top,bottom:ze.bottom}})(Te),Fe=yt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ne.getBoundingClientRect());return Fe.bottom>=We.top-Se&&Fe.top<=We.bottom+Se})();if(H&&!V)return null;const G=(function(){const Se=au(),Te=S.value;if(!Se||!Te||Math.max(0,Se.scrollHeight-Se.scrollTop-Se.clientHeight)>64)return null;const Ne=B2(Se);return Ne==null?null:Ne>=-8&&Ne<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ne)}:null})();if(G)return{anchor:G,captured:!0};const ie=Eo();if(ie)return{anchor:{type:"node",nodeIndex:ie.nodeIndex,offsetWithinNodePx:ie.offsetWithinNodePx},captured:V};if(A.allowFallback===!0){const Se=(function(){const Te=st.value.length;return Te<=0?null:{type:"node",nodeIndex:Us(li.value,0,Math.max(0,Te-1)),offsetWithinNodePx:0}})();return Se?{anchor:Se,captured:!1}:null}return null}function p1(A){let H=2166136261;for(let V=0;V<A.length;V++)H^=A.charCodeAt(V),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function R8(A,H){let V=A;for(let G=0;G<H.length;G++)V^=H.charCodeAt(G),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const B8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function uf(A,H=new WeakSet,V=0){if(A==null||typeof A=="number"||typeof A=="boolean")return String(A);if(typeof A=="string")return`s:${(function(G){const ie=G.length>8192?`${G.slice(0,8192)}...${G.length}`:G;return`${G.length}:${p1(ie)}`})(A)}`;if(typeof A=="function")return"fn";if(typeof A!="object")return typeof A;if(H.has(A))return"cycle";if(V>=6)return"max-depth";H.add(A);try{if(Array.isArray(A)){if(A.length<=160){const Fe=[];for(let Ve=0;Ve<A.length;Ve++)Fe.push(uf(A[Ve],H,V+1));return`a:${A.length}:${Fe.join(",")}`}const Se=[],Te=[],Ne=Math.max(0,A.length-32);let We=2166136261;for(let Fe=0;Fe<A.length;Fe++){const Ve=uf(A[Fe],H,V+1);We=R8(We,Ve),Fe<32&&Se.push(Ve),Fe>=Ne&&Te.push(Ve)}return[`a:${A.length}`,`h=${Se.join(",")}`,`t=${Te.join(",")}`,`all=${(We>>>0).toString(36)}`].join(":")}const G=A,ie=Object.keys(G).filter(Se=>{const Te=G[Se];return Se!=="parent"&&Se!=="el"&&Se!=="component"&&(Te==null||typeof Te=="string"||typeof Te=="number"||typeof Te=="boolean"||B8.has(Se))}).sort();return`o:${ie.length}:${ie.map(Se=>`${Se}=${uf(G[Se],H,V+1)}`).join(";")}`}finally{H.delete(A)}}let D2=-1,m1="";function cu(A){const H=st.value[A];return H?p1(uf(H)):""}function g1(){const A=ee.value;if(D2===A)return m1;let H=2166136261;for(let V=0;V<st.value.length;V++){const G=cu(V);for(let ie=0;ie<G.length;ie++)H^=G.charCodeAt(ie),H=Math.imul(H,16777619)}return m1=(H>>>0).toString(36),D2=A,m1}function Ha(A,H={}){var V;const G=H.includeHeightCache===!0,ie=(V=H.includeContentHash)!=null?V:G,Se=G?(function(Ne){const We=(function(){var tt,_t;const at=Number((_t=(tt=s.virtualScroll)==null?void 0:tt.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(We)||Ne.length<=We)return Ne;const Fe=new Map,Ve=tt=>{!tt||Fe.size>=We||Fe.set(tt.index,tt)},ze=st.value.length,Re=Us(zs.start-2*iu.value,0,ze),Ue=Us(zs.end+2*iu.value,Re,ze);for(const tt of Ne)tt.index>=Re&&tt.index<Ue&&Ve(tt);const et=Math.max(1,Math.ceil(Ne.length/We));for(let tt=0;tt<Ne.length&&Fe.size<We;tt+=et)Ve(Ne[tt]);for(let tt=Ne.length-1;tt>=0&&Fe.size<We;tt-=et)Ve(Ne[tt]);return Array.from(Fe.values()).sort((tt,_t)=>tt.index-_t.index).slice(0,We)})(jt().map(Ne=>{var We;const Fe=st.value[Ne.index];return Fe?Dt(rt({},Ne),{nodeType:String((We=Fe.type)!=null?We:""),signature:cu(Ne.index)}):null}).filter(Ne=>!!Ne)):[],Te=O8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Te||Se.length||H.includeEmptyState===!0?Dt(rt({sessionKey:A.sessionKey,threadKey:A.threadKey},Te?{anchor:Te.anchor,anchorCaptured:Te.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:ie?g1():void 0,measurementKey:lr()||void 0,heightCache:Se.length?Se:void 0}):null}function v1(A){var H,V;const G=au();if(!G)return;const ie=(function(Ne){const We=S.value;if(!We)return null;const Fe=ye(We,Ne.root),Ve=st.value.length,ze=yt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>We.offsetHeight||0),Re=Math.max(0,ze>0?ze:Ve>0?yt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>We.scrollHeight||0):0),Ue=R2();return Fe+Math.max(Re,Ue)})(G);if(ie==null)return;const Se=Math.max(0,A.distanceFromBottomPx),Te=Math.max(0,ie-G.clientHeight-Se);(function(Ne){lo=pu()+120,be=Ne})(Te),G.isViewportRoot?(V=(H=G.doc.defaultView)==null?void 0:H.scrollTo)==null||V.call(H,0,Te):QS(G.root,G.doc,Te,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:se})}const y1=[];function P2(){if(oe)for(It!=null&&(os?.(It),It=null);y1.length;){const A=y1.pop();A!=null&&window.clearTimeout(A)}}function Wa(A){const H=!!Je.value;Je.value=null,lo=0,be=null,P2(),H&&A&&zn(A)}function za(){if(!Je.value||!oe||It!=null)return;const A=()=>{It=null;const H=Je.value;H&&v1(H)};It=Hn?Hn(A):null,It==null&&A()}function H2(A,H={}){const V=st.value.length;return V<=0?[]:A.filter(G=>!(!Number.isInteger(G.index)||G.index<0||G.index>=V)&&!(!Number.isFinite(G.height)||G.height<=0)&&!(H.requireSignature&&!G.signature)&&!(H.requireCompatibilityMetadata&&!G.nodeType&&!G.signature)&&(function(ie){var Se;const Te=st.value[ie.index];return!(!Te||ie.nodeType&&ie.nodeType!==String((Se=Te.type)!=null?Se:"")||ie.signature&&ie.signature!==cu(ie.index))})(G))}function W2(A){const H=lu(jl()),V=lu(A);return H!==-1&&V!==-1&&H===V}function k1(A){var H;const V=Number(A?.width);if(Number.isFinite(V)&&V>0)return V;const G=Number((H=A?.metrics)==null?void 0:H.width);return Number.isFinite(G)&&G>0?G:null}function z2(A){var H;return A.sessionKey===Yn()&&!!l1(A.threadKey)&&((H=A.measurementKey)!=null?H:"")===lr()&&!!W2(k1(A))&&!!(function(V){const G=V.heightCache;return!!G?.length&&(U2(V)?G.some(ie=>!!(ie.nodeType||ie.signature)):G.some(ie=>!!ie.signature))})(A)}function U2(A){return!!(A.contentHash&&A.contentHash===g1())}function D8(A){return!U2(A)}let Kl=null,Gl=null,df=null,uu=null,du=null;function b1(A){var H;const V=A.map(ie=>{var Se,Te;return[ie.index,Math.round(10*ie.height),(Se=ie.nodeType)!=null?Se:"",(Te=ie.signature)!=null?Te:""].join("")}).join(""),G=lu(jl());return[(H=Ts())!=null?H:"",Yn(),lr(),st.value.length,G,A.length,p1(V)].join(":")}function q2(A=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Pt.value||!A?.length||st.value.length<=0||!W2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const V=H2(A,{requireSignature:!0});if(!V.length)return!1;const G=b1(V);return G===Kl?(Gl="standalone",!0):(d2(V,{mode:"merge"}),ai(),Kl=G,Gl="standalone",gu(),zn("restore"),!0)}function x1(A,H={}){var V,G,ie;if(!Pt.value||!A||A.sessionKey!==Yn()||!l1(A.threadKey)||st.value.length<=0)return!1;const Se=!!((V=A.heightCache)!=null&&V.length)&&!ff(),Te=!A.anchor||A.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:A.anchor,Ne=H.restoreAnchor===!0&&!!Te&&!ff()&&Number(k1(A))>0;let We=!1;if((G=A.heightCache)!=null&&G.length&&z2(A)){const Ve=H2(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:D8(A)});Ve.length&&(d2(Ve,{mode:"merge"}),ai(),Kl=b1(Ve),Gl="restore",gu(),We=!0)}if(Se||Ne)return!1;if(!H.restoreAnchor||!Te)return We&&zn("restore"),!0;const Fe=(function(Ve,ze){var Re;const Ue=Ve.anchor,et=Ue?Ue.type==="bottom"?`bottom:${Math.round(Ue.distanceFromBottomPx)}`:`node:${Ue.nodeIndex}:${Math.round(Ue.offsetWithinNodePx)}`:"none";return[(Re=Ts())!=null?Re:"",Yn(),lr(),af.value,ze,et].join(":")})(A,(ie=H.restoreToken)!=null?ie:"imperative");return df===Fe?(We&&zn("restore"),!0):(df=Fe,(function(Ve){const ze=()=>{if(Ve.type==="node")return Wa(),void J({nodeIndex:Ve.nodeIndex,offsetWithinNodePx:Ve.offsetWithinNodePx});if(cn(),Ce.value=null,Je.value=Ve,P2(),v1(Ve),oe)for(const Re of[0,120,280,480])y1.push(window.setTimeout(()=>{const Ue=Je.value;Ue&&v1(Ue)},Re))};(function(Re){if(!Et.value)return!1;const Ue=st.value.length;return!(Ue<=0||(li.value=Re.type==="node"?Us(Re.nodeIndex,0,Ue-1):Ue-1,zl(),0))})(Ve)?pt(ze):ze()})(Te),zn("restore"),!0)}function ff(){const A=jl();return Number.isFinite(A)&&A>0}function j2(A){var H;return A.sessionKey===Yn()&&!!l1(A.threadKey)&&(st.value.length<=0||!(!((H=A.heightCache)!=null&&H.length)||ff())||!(!(A.anchor&&Number(k1(A))>0)||ff()))}function w1(){Vn.clear();for(const A of Object.keys(we)){const H=Number(A);Number.isInteger(H)&&H>=0&&H<st.value.length&&ir(H)}}function fu(){qo!=null&&(os?.(qo),qo=null),L1()}function V2(){return!oe||Ls?Promise.resolve():new Promise(A=>{let H=!1,V=null;const G=()=>{H||(H=!0,V!=null&&window.clearTimeout(V),A())};if(Hn)return Hn(G),void(V=window.setTimeout(G,50));V=window.setTimeout(G,0)})}function _1(A,H=Ts(),V=jo.value){return Yn()===A&&Ts()===H&&jo.value===V}function S1(){return Jn(this,arguments,function*(A={}){var H,V,G,ie,Se;const Te=Yn(),Ne=Ts(),We=jo.value,Fe=(H=A.frames)!=null?H:2,Ve=(V=A.timeoutMs)!=null?V:120,ze=(G=A.reason)!=null?G:"manual",Re=A.expectedSettledTokenKey,Ue=A.flushPendingTimers===!0,et=Vl(ze),tt=()=>Dt(rt({},et),{phase:et.final?"settling":et.phase,stable:!1,confidence:et.confidence==="final"?"mixed":et.confidence,reason:ze}),_t=()=>_1(Te,Ne,We)&&(Re==null||mu()===Re);for(let St=0;St<Fe;St++){if(yield pt(),!_t()||(yield V2(),!_t()))return tt();ar(),fu()}if(yield(function(St){return!oe||St<=0?Promise.resolve():new Promise(rn=>window.setTimeout(rn,St))})(Ve),!_t()||(Ue&&b2(),ar(),fu(),!_t()))return tt();const at=f1();at&&(d1=Te,u1=Ne,((ie=s.virtualScroll)==null?void 0:ie.settleMode)==="manual"&&Re!=null&&cf((Se=s.virtualScroll)==null?void 0:Se.settledToken)&&mu()===Re&&(Pa=xu(s.virtualScroll.settledToken)));const dt=_t()&&at&&O2(),Ct=Vl(ze,dt?"final":void 0);return T1(Ct,!0),Ct})}let C1="content",Yl=null,Zl=null,A1=0,hu=null,Ua=null,M1=null,E1=null;function pu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function K2(A){var H,V;const G=hu;if(!G)return!0;const ie=(V=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?V:1;return Math.abs(A.totalHeight-G.totalHeight)>ie||A.sessionKey!==G.sessionKey||A.phase!==G.phase||A.stable!==G.stable||A.final!==G.final||A.threadKey!==G.threadKey||A.nodeCount!==G.nodeCount||A.measuredCount!==G.measuredCount||A.width!==G.width}function Rs(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 mu(A=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return Rs(A)}function G2(A,H){var V,G;return[A,H.sessionKey,(V=H.threadKey)!=null?V:"",lr(),g1(),Rs((G=s.virtualScroll)==null?void 0:G.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function gu(){M1=null,E1=null,Ua=null}function P8(A){const H=A.heightCache;return H?.length?b1(H):""}function vu(A){var H,V,G;const ie=A.metrics,Se=A.anchor?(Te=A.anchor).type==="bottom"?`bottom:${Math.round(Te.distanceFromBottomPx)}`:`node:${Te.nodeIndex}:${Math.round(Te.offsetWithinNodePx)}`:"none";var Te;return[A.sessionKey,(H=A.threadKey)!=null?H:"",(V=A.measurementKey)!=null?V:lr(),(G=A.contentHash)!=null?G:"",P8(A),Se,A.anchorCaptured?1:0,ie.liveRange.start,ie.liveRange.end,ie.renderedCount,ie.nodeCount,Math.round(ie.totalHeight),Math.round(ie.width),ie.phase,ie.stable?1:0].join("\0")}function T1(A,H=!1){if(!Pt.value||(function(Te=!1){return!Te&&Nn.value&&!Ye.value})(H))return;const V=H||K2(A),G=(function(Te,Ne=!1){return Ne||Te.stable||Te.phase==="final"?{state:Ha(Te,{includeHeightCache:!0})}:{state:Ha(Te)}})(A,H),ie=G.state,Se=!!(ie&&(V||(function(Te,Ne=!1){return!!Ne||vu(Te)!==Ua})(ie,H)));if(V&&(M(A),hu=A,A1=pu()),ie&&Se&&(N(ie),ie.anchor&&F(ie.anchor),Ua=vu(ie)),A.stable){const Te=G2("settled",A);if(Te!==M1){M1=Te;const Ne=Ha(A,{includeHeightCache:!0});Ne&&(N(Ne),Ua=vu(Ne)),(function(We){o("render-settled",We)})(A)}}if(A.phase==="final"){const Te=G2("final",A);if(Te!==E1){E1=Te;const Ne=Ha(A,{includeHeightCache:!0});Ne&&(N(Ne),Ua=vu(Ne)),(function(We){o("render-final",We)})(A)}}}function N1(){Yl!=null&&(os?.(Yl),Yl=null),Zl!=null&&oe&&(window.clearTimeout(Zl),Zl=null)}function Y2(){Yl=null,Zl=null,(function(A){if(rr.size>0||qo!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(C1)&&(ar(),fu()),T1(Vl(C1))}function zn(A){var H,V;if(!Pt.value||(C1=A,Yl!=null||Zl!=null))return;const G=Math.max(0,(V=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?V:32),ie=Math.max(0,G-(pu()-A1)),Se=()=>{Zl=null,Yl=Hn?Hn(Y2):null,Yl==null&&Y2()};oe&&ie>0?Zl=window.setTimeout(Se,ie):Se()}function I1(A){var H;if(A<=0)return 0;const V=st.value;if(qe.value)return E2(A);if(Ke.value===V.length&&ot.value.length&&Tt.value.length){const ie=zt.value,Se=ot.value,Te=Tt.value,Ne=ze=>ze<=0?0:is(Se,0,ze)+(ze-is(Te,0,ze))*ie;let We=0,Fe=V.length-1,Ve=V.length-1;for(;We<=Fe;){const ze=We+Fe>>1;Ne(ze+1)>=A?(Ve=ze,Fe=ze-1):We=ze+1}return Ve}let G=A;for(let ie=0;ie<V.length;ie++){const Se=(H=we[ie])!=null?H:zt.value;if(G<=Se)return ie;G-=Se}return Math.max(0,V.length-1)}function Z2(){lt.value+=1}function $1(A){return!(ri.value&&A>=ys.value)&&(!qr.value||A<Co.value||Jm.value.has(A))}function qa(A){const H=of.get(A);H&&(H(),of.delete(A));const V=Oa.get(A);V&&(V.destroy(),Oa.delete(A)),rf(A)}function Q2(A,H){let V=!1;if(H){const Se=fs.get(A);fs.set(A,H),Se!==H&&(V=!0)}else fs.delete(A)&&(V=!0);if(V&&Z2(),H||rf(A),!f2.value||!io||!Et.value&&qr.value&&!z.value&&Oa.size>=640&&(z.value||(z.value=!0,e1()),!f2.value||!io))return qa(A),void(H&&Kr(A,!0));if(A<Co.value&&!Et.value||Jm.value.has(A))return qa(A),void Kr(A,!0);if(!H)return void qa(A);qa(A);const G=io(H,{rootMargin:"400px"});if(!G)return;Oa.set(A,G),Kr(A,G.isVisible.value),qr.value&&(function(Se){if(!oe||!qr.value)return;rf(Se);const Te=Se%17*23,Ne=window.setTimeout(()=>{if(x2.delete(Se),!qr.value||Jm.value.has(Se))return;const We=fs.get(Se);if(!We)return;const Fe=ge(We),Ve=We.ownerDocument||document,ze=Ve.defaultView||window,Re=!Fe||Fe===Ve.documentElement||Fe===Ve.body,Ue=!Re&&Fe?yt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Fe.getBoundingClientRect()):null,et=Re?0:Ue.top,tt=Re?yt("nodeVisibilityFallback.clientHeight",()=>{var at,dt;return(dt=(at=ze.innerHeight)!=null?at:Fe?.clientHeight)!=null?dt:0}):Ue.bottom,_t=yt("nodeVisibilityFallback.node.getBoundingClientRect",()=>We.getBoundingClientRect());_t.bottom>=et-500&&_t.top<=tt+500&&Kr(Se,!0)},1800+Te);x2.set(Se,Ne)})(A);let ie=null;ie=Ze(()=>G.isVisible.value,Se=>{if(Se){rf(A),Kr(A,!0),ie?.(),of.delete(A),Oa.get(A)===G&&Oa.delete(A);try{G.destroy()}catch{}}},{immediate:!0}),of.set(A,ie),Et.value&&zi()}function L1(){qo=null;for(const[A,H]of rr)rr.delete(A),Hi.get(A)===H.el&&Ul.get(A)===H.version&&Wl(A,H.height,{allowShrink:H.allowShrink})}function ja(){qo!=null&&(os?.(qo),qo=null),rr.clear()}function hf(A,H){(function(V,G,ie){var Se;if(!Number.isFinite(ie)||ie<=0||Hi.get(V)!==G)return;const Te=Ul.get(V);if(Te==null)return;const Ne=st.value[V],We=ne.value&&j.value!==!0&&!((Se=s.nodes)!=null&&Se.length)&&V>=st.value.length-2,Fe=!(Ne?.loading===!0||We),Ve=rr.get(V),ze=Ve?Ve.allowShrink&&Fe:Fe,Re=Ve&&!ze?Math.max(Ve.height,ie):ie;rr.set(V,{height:Re,allowShrink:ze,version:Te,el:G}),qo==null&&(qo=Hn?Hn(L1):null,qo==null&&L1())})(A,H,Jd(A,H))}function ar(){for(const[A,H]of Hi)H&&hf(A,H)}function X2(){Os?.disconnect(),Os=null,Fs.clear()}function F1(){for(;ef.length;)sf(ef.pop())}Ze(Ye,A=>{A&&zn("content")},{flush:"post"}),t({getVirtualMetrics:Vl,captureVirtualState:function(A={}){var H;return Ha(Vl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:A.allowFallbackAnchor===!0,requireViewport:A.requireViewport===!0,includeEmptyState:(H=A.includeEmptyState)==null||H})},restoreVirtualState:function(A,H={}){const V=H.restoreAnchor===!0,G=H.restoreToken==null?"imperative":String(H.restoreToken);uu=A,du={restoreAnchor:V,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!x1(A,{restoreAnchor:V,restoreToken:G,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&j2(A)||(uu=null,du=null)},forceMeasure:function(A="manual"){return Jn(this,null,function*(){yield pt(),yield V2(),ar(),fu(),yield pt();const H=Vl(A);return T1(H,!0),H})},settle:S1,scrollToNode:function(A,H="start"){Wa(),cn();const V=st.value.length;if(V<=0)return;const G=Us(A,0,V-1),ie=()=>{var Se;const Te=Bt({nodeIndex:G,offsetWithinNodePx:0}),Ne=lf(G),We=au(),Fe=(Se=We?.clientHeight)!=null?Se:0,Ve=De();let ze=Te;if(H==="center")ze=Te-Fe/2+Ne/2;else if(H==="end")ze=Te-Fe+Ne;else if(H==="nearest"&&Ve!=null){if(Te>=Ve&&Te+Ne<=Ve+Fe)return;ze=Te<Ve?Te:Te-Fe+Ne}Ot(Math.max(0,ze)),zi({immediate:!0}),Et.value&&(li.value=G,zl())};if(Et.value)return li.value=G,zl(),void pt(ie);ie()}}),Ze(()=>ns.value,A=>{if(!A){X2();for(const H of jr.values())for(const V of H)sf(V);jr.clear(),Ul.clear(),F1(),ja()}},{immediate:!0}),Ze(j,A=>{A&&(function(){if(oe&&j.value&&Hi.size){F1();for(const H of[80,240,640]){const V=k2(H,()=>{for(const[G,ie]of Hi)ie&&hf(G,ie)},"final");V!=null&&ef.push(V)}}})(),zn(A?"final":"content")}),Ze([()=>st.value.length,()=>ys.value],()=>{Je.value&&za(),zn("content")},{flush:"post",immediate:!0}),Ze([()=>zs.start,()=>zs.end],()=>{zn("batch")},{flush:"post"});const{cleanupBatchScheduler:H8}=(function(A){const{props:H,isClient:V,isTestEnv:G,parsedNodesIdentity:ie,parsedNodeCount:Se,desiredRenderedCount:Te,datasetKey:Ne,batchingEnabled:We,incrementalRenderingActive:Fe,resolvedBatchSize:Ve,resolvedInitialBatch:ze,renderedCount:Re,adaptiveBatchSize:Ue,previousRenderContext:et,previousBatchConfig:tt,requestFrame:_t,cancelFrame:at,hasIdleCallback:dt,cleanupNodeVisibility:Ct,onDatasetKeyChanged:St,onDatasetChanged:rn}=A;let Nt=null,Ut=null,Wt=!1,hn=null,Vo=null,co=0,Ai=!1,Yr=!1;const Zr=new Set,Xl=new Set;function gb(){if(V){Nt!=null&&(at?.(Nt),Nt=null),Ut!=null&&(window.clearTimeout(Ut),Ut=null),Vo!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Vo),Vo=null),co+=1;for(const Xs of Zr)at?.(Xs);Zr.clear();for(const Xs of Xl)window.clearTimeout(Xs);Xl.clear(),Wt=!1,hn=null,Ai=!1,Yr=!1}}function bf(){return typeof performance<"u"?performance.now():Date.now()}function vb(Xs){(function(cr){var Qr;if(!Fe.value)return;const ur=Math.max(2,(Qr=H.renderBatchBudgetMs)!=null?Qr:6),dr=Math.max(1,Ve.value||1),Mi=Math.max(1,Math.floor(dr/4));cr>1.2*ur?Ue.value=Math.max(Mi,Math.floor(.7*Ue.value)):cr<.5*ur&&Ue.value<dr&&(Ue.value=Math.min(dr,Math.ceil(1.2*Ue.value)))})(Xs),Ai=!1;const To=Yr||Re.value<Te.value;Yr=!1,To&&bb()}function yb(Xs,To={}){var cr,Qr;if(!Fe.value)return;const ur=Te.value;if(Re.value>=ur)return;const dr=Math.max(1,Xs),Mi=()=>{const Ga=bf();let Ya=0;Nt=null,Ut=null,Vo=null,Wt=!1;const Za=hn??dr;hn=null;const z1=bf();Re.value=Math.min(ur,Re.value+Za),Ct(Re.value),Ya=bf()-z1,(function(U1,xb){if(!V)return void vb(xb);Ai=!0;const wb=++co;pt().then(()=>{var _b;if(wb!==co)return;const rE=bf(),lE=Math.max(xb,rE-U1),Sb=()=>{wb===co&&vb(lE)};if(_t){let Ab=!1,fr=null;const Mb=()=>{Ab||(Ab=!0,Sb())},xf=_t(()=>{Zr.delete(xf),fr!=null&&(window.clearTimeout(fr),Xl.delete(fr),fr=null),Mb()});return Zr.add(xf),fr=window.setTimeout(()=>{fr!=null&&Xl.delete(fr),fr=null,at?.(xf),Zr.delete(xf),Mb()},Math.max(32,(_b=H.renderBatchIdleTimeoutMs)!=null?_b:120)),void Xl.add(fr)}const Cb=window.setTimeout(()=>{Xl.delete(Cb),Sb()},0);Xl.add(Cb)})})(Ga,Ya)};if(!V||To.immediate)return void Mi();const Xr=Math.max(0,(cr=H.renderBatchDelay)!=null?cr:16);if(hn=hn!=null?Math.max(hn,dr):dr,!Wt){if(Wt=!0,!G&&dt&&window.requestIdleCallback){const Ga=Math.max(0,(Qr=H.renderBatchIdleTimeoutMs)!=null?Qr:120);return void(Vo=window.requestIdleCallback(()=>Mi(),{timeout:Ga}))}_t&&!G?Nt=_t(()=>{Xr!==0?Ut=window.setTimeout(()=>Mi(),Xr):Mi()}):Ut=window.setTimeout(()=>Mi(),Xr)}}function kb(Xs,To={}){Ai?Yr=!0:Xs==null?bb():yb(Xs,To)}function bb(){Fe.value&&yb(We.value?Math.max(1,Math.round(Ue.value)):Math.max(1,Ve.value))}return Ze([ie,Se,Ne,Fe,Ve,ze,()=>H.renderBatchDelay],()=>{var Xs;const To=Se.value,cr=et.value,Qr=Ne.value,ur=!Object.is(Qr,cr.key),dr=To!==cr.total,Mi=ur||dr;et.value={key:Qr,total:To};const Xr=tt.value,Ga=(Xs=H.renderBatchDelay)!=null?Xs:16,Ya=Xr.batchSize!==Ve.value||Xr.initial!==ze.value||Xr.delay!==Ga||Xr.enabled!==Fe.value;tt.value={batchSize:Ve.value,initial:ze.value,delay:Ga,enabled:Fe.value},ur&&St(To),(Mi||Ya||!Fe.value)&&gb(),(Mi||Ya)&&(Ue.value=Math.max(1,Ve.value||1)),Mi&&rn();const Za=Te.value;if(!To)return Re.value=0,void Ct(0);if(!Fe.value)return Re.value=Za,void Ct(Re.value);const z1=ur||cr.total===0;Re.value=z1||Ya?Math.min(Za,ze.value):Math.min(Re.value,Za);const U1=Math.max(1,ze.value||Ve.value||To);Re.value<Za?kb(U1,{immediate:!V}):Ct(Re.value)},{immediate:!0}),Ze(Te,(Xs,To)=>{Fe.value&&(typeof To=="number"&&Xs<=To||Xs>Re.value&&kb())}),{cleanupBatchScheduler:gb}})({props:w,isClient:oe,isTestEnv:Ls,parsedNodesIdentity:Es,parsedNodeCount:Dn,desiredRenderedCount:tf,datasetKey:$8,batchingEnabled:Di,incrementalRenderingActive:ri,resolvedBatchSize:ii,resolvedInitialBatch:Co,renderedCount:ys,adaptiveBatchSize:or,previousRenderContext:Ao,previousBatchConfig:Pi,requestFrame:Hn,cancelFrame:os,hasIdleCallback:oi,cleanupNodeVisibility:A8,onDatasetKeyChanged:A=>{ja(),rs(),ai(),gu(),A>0&&ks(A)},onDatasetChanged:()=>{Et.value&&zi({immediate:!0})}});Ze([h2,Et,()=>S.value,()=>ue()],([A,H])=>{if(!A)return w2(),void Xm();M8(),H?zi({immediate:!0}):Xm()},{flush:"post",immediate:!0}),Ze([()=>st.value.length,()=>Et.value],A=>Jn(null,[A],function*([H,V]){V&&H&&oe&&(yield pt(),zi({immediate:!0}))}),{flush:"post"}),Ze(qe,A=>{A&&(function(){var H;if(Hs.value&&Ws.value&&Qn.value&&((H=Tn.value)!=null&&H[1]))return;const V=ht({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),G=ht({type:"list_item",children:[V],raw:"- Probe paragraph text"}),ie=ht({type:"list",ordered:!1,items:[G],raw:"- Probe paragraph text"});Hs.value=V,Ws.value=G,Qn.value=ie;const Se={1:null,2:null,3:null,4:null,5:null,6:null};for(let Te=1;Te<=6;Te++)Se[Te]=ht({type:"heading",level:Te,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Te)} Probe heading`});Tn.value=Se})()},{immediate:!0}),Ze([()=>S.value,qe],()=>{if(!qe.value)return n1(),void(U.value=0);S2(),n1(),qe.value&&S.value&&typeof ResizeObserver<"u"&&(ru=new ResizeObserver(()=>{S2(),Ce.value&&Kn(),Je.value&&za(),zn("resize")}),ru.observe(S.value))},{immediate:!0}),Ze([qe,_n,jo],()=>Jn(null,null,function*(){if(!qe.value)return Y.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ai();yield pt(),(function(){if(!qe.value||typeof window>"u")return Y.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ai();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=_2(t1(I.value),".paragraph-node");A.paragraph=G0(I.value,H,"pre-wrap");const V=t1(B.value),G=V?.querySelector(".paragraph-node");A.listItem=G0(B.value,G,"pre-wrap");const ie=yt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Te,Ne;return(Ne=(Te=R.value)==null?void 0:Te.offsetHeight)!=null?Ne:0}),Se=yt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Te,Ne;return(Ne=(Te=B.value)==null?void 0:Te.offsetHeight)!=null?Ne:0});A.listWrapperOverhead=Math.max(0,ie-Se);for(let Te=1;Te<=6;Te++){const Ne=_2(t1(P[Te]),`h${Te}`);A.headings[Te]=G0(P[Te],Ne,"pre-wrap")}Y.value=A,ai()})()}),{flush:"post",immediate:!0}),Ze(()=>st.value.length,()=>{Et.value&&zi({immediate:!0})}),Ze([qe,U],()=>{ai(),Et.value&&zi({immediate:!0}),Ce.value&&Kn(),Je.value&&za(),zn("resize")},{immediate:!1}),Ze(()=>qr.value,A=>{if(A)for(const[H,V]of fs)Q2(H,V);else{e1();for(const[H,V]of fs)V&&Kr(H,!0)}},{immediate:!1}),Ze([()=>w.viewportPriority,()=>st.value.length],([A,H])=>{A!==!1?z.value&&H<=200&&(z.value=!1):z.value=!1}),Ze(()=>ys.value,()=>{Et.value&&zi({immediate:!0})}),Ze([li,on,iu,()=>st.value.length,Et],()=>{zl()},{immediate:!0});let yu=null,ku=!1,Va=null;function bu(){yu=null,d1=null,u1=void 0,Pa=null,gu()}function O1(){ja(),rs(),ai(),Vn.clear();const A=st.value.length;A>0&&ks(A),w1()}function R1(){N1(),b2(),hu=null,Kl=null,Gl=null,df=null,uu=null,du=null,ku=!1,bu(),L2("restore"),cn(),Wa()}function xu(A){var H;return[(H=Ts())!=null?H:"",Yn(),lr(),af.value,mu(A),st.value.length,Math.round(Gr(0,st.value.length)),Math.round(jl()),Le.count,Math.round(Le.total)].join(":")}function J2(){return Jn(this,null,function*(){var A,H,V,G;const ie=(A=s.virtualScroll)==null?void 0:A.settledToken,Se=mu(ie),Te=Yn(),Ne=Ts(),We=jo.value;if(Pt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&cf(ie))if(f1()){if(xu(ie)!==Pa&&!ku){ku=!0;try{const Fe=yield S1({reason:"manual",expectedSettledTokenKey:Se}),Ve=mu()===Se;_1(Te,Ne,We)&&Fe.sessionKey===Te&&Fe.threadKey===Ne&&Ve&&Fe.stable&&Fe.phase==="final"&&(Pa=xu((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{ku=!1,yield pt();const Fe=(G=s.virtualScroll)==null?void 0:G.settledToken,Ve=cf(Fe)?xu(Fe):"";_1(Te,Ne,We)&&Ve&&Pa!==Ve&&J2()}}}else zn("manual")})}Ze(Pt,(A,H)=>{if(A!==H){if(!A)return R1(),void N1();R1(),O1(),Va=jo.value,zn("content")}},{flush:"post"}),Ze([Pt,jo],([A,H])=>{A?Va!=null?Va!==H&&(Va=H,(function(V="resize"){ja(),rs(),ai(),Vn.clear();const G=st.value.length;G>0&&ks(G),w1(),Kl=null,Gl=null,df=null,hu=null,ku=!1,bu(),q2(),pt(()=>{ar(),Ce.value&&Kn(),Je.value&&za(),zn(V)})})("resize")):Va=H:Va=null},{flush:"post",immediate:!0}),Ze([Pt,()=>Yn(),()=>Ts()],([A])=>{A&&(R1(),O1(),L2("content"),zn("content"))}),Ze([Pt,()=>Yn(),()=>Ts(),jo,()=>st.value.length],([A])=>{A&&(function(H="async-node"){let V=!1;for(const[G,ie]of Array.from(Wi.entries()))a1(ie)||(Wi.delete(G),Uo.delete(G),V=!0);V&&(Ba(),zn(H))})("async-node")},{flush:"post"}),Ze([Pt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>s.indexKey,()=>ee.value],([A])=>{A&&(gu(),(function(H="content"){if(!Pt.value)return;const V=[],G=st.value.length;for(const ie of Array.from(Vn.keys())){if(ie>=G){V.push(ie);continue}const Se=cu(ie),Te=Vn.get(ie);Te!=null&&Te!==Se&&V.push(ie),Vn.set(ie,Se)}for(const ie of Array.from(Vn.keys()))ie>=G&&Vn.delete(ie);V.length&&((function(ie,Se={}){const Te=Array.from(ie,Number);mt(Te,Se)>0&&(function(We){for(const Fe of We)Vn.delete(Fe)})(Te)})(V,{notify:!1}),ai(),bu(),Ce.value&&Kn(),Je.value&&za(),zn(H))})("content"))},{flush:"post",immediate:!0}),Ze([Pt,()=>st.value.length,()=>Yn(),()=>Ts()],([A,H,V,G],[ie,Se,Te,Ne])=>{A&&ie&&V===Te&&G===Ne&&H!==Se&&bu()},{flush:"post"}),Ze([Pt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.heightCache},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.heightCacheWidth},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>st.value.length,()=>Yn(),U],()=>{q2()},{flush:"post",immediate:!0}),Ze([Pt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreAnchor},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>st.value.length,()=>Yn(),U],A=>Jn(null,[A],function*([H,V]){if(!H||!V)return;yield pt();const G=(function(){var ie;const Se=(ie=s.virtualScroll)==null?void 0:ie.restoreAnchor;return Se==null||Se===!1?null:Se===!0?"true":String(Se)})();x1(V,{restoreAnchor:G!=null,restoreToken:G??void 0})}),{flush:"post",immediate:!0}),Ze([Pt,U,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey}],([A])=>{var H;if(!A)return;const V=(H=s.virtualScroll)==null?void 0:H.restoreState;V&&Kl&&Gl==="restore"&&(z2(V)||(O1(),Kl=null,Gl=null,zn("resize")))},{flush:"post"}),Ze([Pt,()=>st.value.length,()=>Yn(),U],A=>Jn(null,[A],function*([H]){var V;const G=uu,ie=du;H&&G&&(yield pt(),!x1(G,{restoreAnchor:ie?.restoreAnchor===!0,restoreToken:(V=ie?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:ie?.allowUncapturedAnchor===!0})&&j2(G)||(uu=null,du=null))}),{flush:"post",immediate:!0}),Ze([Pt,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>Yn(),()=>Ts(),jo,Zm,m2,()=>ys.value,tf,()=>Le.count,()=>Le.total],([A,H,V])=>{if(!A||H!==!0||V==="manual"||!h1())return;const G=(function(){var ie;const Se=st.value.length;return[(ie=Ts())!=null?ie:"",Yn(),lr(),af.value,Se,Math.round(Gr(0,Se)),Math.round(jl()),Le.count,Math.round(Le.total)].join(":")})();yu!==G&&(yu=G,S1({reason:"final"}).then(ie=>{ie.stable||yu!==G||(yu=null)}))},{flush:"post",immediate:!0}),Ze([Pt,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settledToken},()=>Yn(),()=>Ts(),jo,Zm,m2,()=>ys.value,tf,()=>st.value.length,()=>Le.count,()=>Le.total],()=>{J2()},{flush:"post",immediate:!0}),Ze([()=>st.value.length,Et,on,iu,()=>zs.start,()=>zs.end],([A,H,V,G,ie,Se])=>{te.value&&Ie("virtualization",{nodes:A,virtualization:H,maxLiveNodes:V,buffer:G,focusIndex:li.value,scroll:H?(()=>{const Te=me.value||ge();return Te?{reverse:q(Te),scrollTop:Math.round(Te.scrollTop),scrollTopAbs:Math.round(Math.abs(Te.scrollTop)),scrollHeight:Math.round(Te.scrollHeight),clientHeight:Math.round(Te.clientHeight)}:null})():null,liveRange:{start:ie,end:Se},rendered:ys.value})}),Ze([()=>w.customId],([A],H,V)=>{if(!A||yn)return;const G=(function(ie,Se){return ie?(Ns.controllers[ie]=Se,()=>{Ns.controllers[ie]===Se&&delete Ns.controllers[ie]}):()=>{}})(A,{captureRestoreAnchor:Eo,restoreAnchor:J,getAnchorDrift:_e,getReport:T8});V(()=>{G()})},{immediate:!0}),ps(()=>{(function(){if(Pt.value)try{ar(),fu();const A=Vl("manual");K2(A)&&(M(A),hu=A,A1=pu());const H=Ha(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(N(H),H.anchor&&F(H.anchor),Ua=vu(H))}catch{}})(),H8(),e1(),Oe(),X2();for(const A of jr.values())for(const H of A)sf(H);jr.clear(),Ul.clear(),Vn.clear(),F1(),ja(),n1(),cn(),Wa(),N1(),w2(),Xm()});const W8=Ii({loader:()=>Jn(null,null,function*(){try{return(yield go(()=>import("./index11-D4J7mrqX.js"),__vite__mapDeps([8,5]))).default}catch(A){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',A),Ko}}),loadingComponent:gee,delay:0}),z8=Ii({loader:()=>Jn(null,null,function*(){try{return(yield go(()=>import("./index10-CZB6i7OT.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),Ko}}),loadingComponent:mee,delay:0}),U8=Ii(()=>Jn(null,null,function*(){try{return(yield go(()=>import("./index7-zYh5L7gm.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),Ko}})),eb={text:cs,paragraph:wa,heading:Sp,code_block:H0,list:Pc,list_item:Dc,blockquote:wh,table:ld,definition_list:_h,footnote:Sh,footnote_reference:Jo,footnote_anchor:id,admonition:Eh,vmr_container:Ah,hardbreak:Cl,link:wo,image:Sl,thematic_break:Ch,math_inline:Ri,math_block:zM,strong:bo,emphasis:_o,strikethrough:xo,highlight:ti,insert:Ho,subscript:Po,superscript:Do,emoji:Bo,checkbox:Xo,checkbox_input:Xo,inline_code:oo,html_inline:ei,reference:ko,html_block:rd},q8=D(()=>r1()),tb=D(()=>ZS(w.codeBlockProps)),j8=D(()=>ZS(w.codeBlockProps,{omit:["langs"]})),nb=D(()=>rt(rt({stream:w.codeBlockStream,darkTheme:w.codeBlockDarkTheme,lightTheme:w.codeBlockLightTheme,monacoOptions:w.codeBlockMonacoOptions,themes:w.themes,langs:u.value==="shiki"?w.langs:void 0,minWidth:w.codeBlockMinWidth,maxWidth:w.codeBlockMaxWidth},typeof ae.value=="boolean"?{showTooltips:ae.value}:{}),j8.value)),sb=D(()=>rt(Dt(rt({},nb.value),{langs:w.langs}),tb.value));function ob(A){return typeof A=="boolean"?A:void 0}const V8=D(()=>{const A=w.codeBlockProps||{},H={},V=ob(A.showLineNumbers);V!==void 0&&(H.showLineNumbers=V);const G=ob(A.diffInline);G!==void 0&&(H.diffInline=G);const ie=(function(Se){const Te=Number(Se);return Number.isFinite(Te)&&Te>0?Te:void 0})(A.reservedHeightPx);return ie!==void 0&&(H.reservedHeightPx=ie),H}),K8=D(()=>rt(rt({stream:w.codeBlockStream,darkTheme:w.codeBlockDarkTheme,lightTheme:w.codeBlockLightTheme,themes:w.themes,langs:w.langs,minWidth:w.codeBlockMinWidth,maxWidth:w.codeBlockMaxWidth},typeof ae.value=="boolean"?{showTooltips:ae.value}:{}),tb.value)),G8=D(()=>rt({},w.mermaidProps||{})),ib=D(()=>rt({},w.d2Props||{})),Y8=D(()=>rt({},w.infographicProps||{})),wu=D(()=>({typewriter:w.typewriter,fade:w.fade,customHtmlTags:vs.value.customHtmlTags})),Z8=D(()=>rt(rt({},wu.value),typeof ae.value=="boolean"?{showTooltip:ae.value}:{})),Q8=D(()=>rt(rt({},wu.value),typeof ae.value=="boolean"?{showTooltips:ae.value}:{})),X8=D(()=>rt(rt({},wu.value),typeof ae.value=="boolean"?{showTooltips:ae.value}:{})),J8=D(()=>rt(rt({},wu.value),typeof ae.value=="boolean"?{showTooltips:ae.value}:{}));function eE(A){return Array.isArray(A.children)&&A.children.length>0}const B1=D(()=>E8.value.map(A=>{var H,V,G,ie,Se,Te,Ne,We;let Fe=(function(at){var dt,Ct,St,rn,Nt,Ut,Wt;if(at.type!=="code_block")return at;const hn=at,Vo=[String((dt=hn.language)!=null?dt:""),String((Ct=hn.loading)!=null?Ct:""),String((St=hn.diff)!=null?St:""),String((rn=hn.code)!=null?rn:""),String((Nt=hn.originalCode)!=null?Nt:""),String((Ut=hn.updatedCode)!=null?Ut:""),String((Wt=hn.raw)!=null?Wt:"")].join("\0"),co=Mo.get(hn);if(co&&co.signature===Vo)return co.node;const Ai=rt({},hn);return Mo.set(hn,{signature:Vo,node:Ai}),Ai})(A.node);const Ve=pf(Fe);let ze=cb(Fe,Ve);if((Fe.type==="html_block"||Fe.type==="html_inline")&&ze===eb[Fe.type]){const at=Fe,dt=String((H=at.tag)!=null?H:"").trim().toLowerCase()||$6(at.content);if(dt){const Ct=Jt.value[dt];if(wn.value.has(dt)&&Ct)ze=Ct,Fe=Dt(rt({},at),{type:dt,tag:dt,content:$V(at.content,dt)});else if(L6((V=at.content)!=null?V:at.raw,dt)){const St=String((ie=(G=at.content)!=null?G:at.raw)!=null?ie:"");Fe.type==="html_inline"?(ze=cs,Fe={type:"text",content:St,raw:St}):(ze=wa,Fe={type:"paragraph",children:[{type:"text",content:St,raw:St}],raw:St})}}}const Re=Fe.type==="code_block"&&u.value==="pre"&&ze===Ko&&!D1(Jt.value,Ve);let Ue=rt({},(function(at,dt,Ct){const St=dt??pf(at);if(at.type==="code_block"){const rn=St?D1(Jt.value,St):void 0;if(Ct&&u.value==="pre"&&!rn&&Ct===Ko)return V8.value;if(Ct&&St&&Ct===rn)return St==="mermaid"?lb(at):St==="infographic"?ab(at):St==="d2"||St==="d2lang"?ib.value:sb.value;if(Ct&&Ct===Jt.value.code_block)return sb.value;if(A2(Ct))return K8.value}return St==="mermaid"?lb(at):St==="infographic"?ab(at):St==="d2"||St==="d2lang"?ib.value:at.type==="link"?Z8.value:at.type==="list"?Q8.value:at.type==="blockquote"?X8.value:at.type==="table"?J8.value:at.type==="code_block"?nb.value:wu.value})(Fe,Ve,ze));const et=ql.value[A.index];Fe.type==="code_block"&&et?.kind==="code-block"&&(Ue=Dt(rt({},Ue),Re?{reservedHeightPx:(Se=et.height)!=null?Se:et.contentHeight}:{estimatedHeightPx:et.height,estimatedContentHeightPx:et.contentHeight})),Re||Fe.type!=="code_block"||Ve!=="mermaid"||wc(Ue.estimatedPreviewHeightPx)!=null||(Ue=Dt(rt({},Ue),{estimatedPreviewHeightPx:bv(yv(String((Te=Fe.code)!=null?Te:"")))})),Re||Fe.type!=="code_block"||Ve!=="infographic"||wc(Ue.estimatedPreviewHeightPx)!=null||(Ue=Dt(rt({},Ue),{estimatedPreviewHeightPx:xv(kv(String((Ne=Fe.code)!=null?Ne:"")))})),Fe.type==="math_block"&&(Ue=Dt(rt({},Ue),{cacheScope:En.value}));const tt=(function(at,dt){const Ct=String(at.type);return!Gd(Ct)&&Jt.value[Ct]===dt})(Fe,ze),_t=tt?bk(Fe,He.value):void 0;return Dt(rt({},A),{node:Fe,component:ze,bindings:Ue,customBindings:rt(rt({},_t??{}),Ue),rendersCustomNode:tt,hasSlotChildren:eE(Fe),slotContent:String((We=Fe.content)!=null?We:""),isCodeBlock:Fe.type==="code_block",indexKey:`${q8.value}-${A.index}`})}));function pf(A){var H;return A?.type==="code_block"?String((H=A.language)!=null?H:"").trim().toLowerCase():""}function D1(A,H){const V=H.trim().toLowerCase();if(V)for(const G of[V,hk(V),MM(V)]){const ie=G&&A[G];if(ie)return ie}}function rb(A,H,V,G){var ie,Se;const Te=rt({},A.value);return wc(Te.estimatedPreviewHeightPx)==null&&(Te.estimatedPreviewHeightPx=G(V(String((ie=H?.code)!=null?ie:"")),void 0,Te.maxHeight==="none"?null:(Se=wc(Te.maxHeight))!=null?Se:void 0)),Te}function lb(A){return rb(G8,A,yv,bv)}function ab(A){return rb(Y8,A,kv,xv)}function cb(A,H){if(!A)return Iv;const V=Jt.value,G=V[String(A.type)];if(A.type==="code_block"){const ie=H??pf(A),Se=ie?D1(V,ie):void 0;return Se||(u.value==="pre"?V.code_block||Ko:ie==="mermaid"?V.mermaid||W8:ie==="infographic"?V.infographic||z8:ie==="d2"||ie==="d2lang"?V.d2||U8:G||V.code_block||M2.value)}return G||eb[String(A.type)]||Iv}function P1(A){o("click",A)}function tE(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",A)}function nE(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",A)}function ub(A){o("mouseover",A)}function db(A){o("mouseout",A)}const Ql=X(null),Ui=X(!1);let _u,Ka=null,H1=0,mf=0,gf=0;const fb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],sE=new Set(fb),hb=[".typewriter-cursor",".height-estimation-probes",...fb.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function pb(A){if(!A||typeof A!="object")return!1;const H=A.type;return typeof H=="string"&&sE.has(H)}function vf(A){var H,V;if(!A||typeof A!="object")return 0;const G=A,ie=(V=(H=G.raw)!=null?H:G.content)!=null?V:G.code;if(typeof ie=="string")return ie.length;const Se=G.children;if(Array.isArray(Se))return Se.reduce((Ne,We)=>Ne+vf(We),0);const Te=G.items;return Array.isArray(Te)?Te.reduce((Ne,We)=>Ne+vf(We),0):0}function yf(){_u&&(clearTimeout(_u),_u=void 0)}function mb(){H1+=1,Ka!=null&&(os?.(Ka),Ka=null)}function kf(){mb(),Ql.value&&(Ql.value.style.visibility="hidden")}function oE(A){var H;if(A.nodeType!==Node.TEXT_NODE||!((H=A.textContent)!=null?H:"").trim())return!1;const V=A.parentElement;return!!V&&!V.closest(hb)}function iE(A){let H=A.lastChild;for(;H;){if(oE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const V=H;if(!V.matches(hb)&&V.lastChild){H=V.lastChild;continue}}for(;H&&H!==A&&!H.previousSibling;)H=H.parentNode;if(!H||H===A)break;H=H.previousSibling}return null}function W1(){if(!oe||!Ui.value||Ka!=null)return;const A=H1,H=()=>{Ka=null,A===H1&&(function(){var V,G;if(!(oe&&Ui.value&&S.value&&Ql.value))return;const ie=S.value,Se=Ql.value;Se.style.visibility="hidden";const Te=(function(){const ze=B1.value;for(let Re=ze.length-1;Re>=0;Re--){const Ue=ze[Re];if(!Ue||pb(Ue.node)||!$1(Ue.index))continue;const et=fs.get(Ue.index);if(!et)continue;const tt=iE(et);if(tt)return tt}return null})();if(!Te)return;let Ne=0,We=0,Fe=20,Ve=!1;if(Te?.textContent){const ze=Te.textContent.length,Re=document.createRange();Re.setStart(Te,Math.max(0,ze-1)),Re.setEnd(Te,ze);const Ue=typeof Re.getClientRects=="function"?Re.getClientRects():void 0,et=(G=Ue?.[Ue.length-1])!=null?G:(V=Te.parentElement)==null?void 0:V.getBoundingClientRect();if(et){const tt=yt("typewriterCursor.root.getBoundingClientRect",()=>ie.getBoundingClientRect());Ne=et.right-tt.left+ie.scrollLeft,We=et.top-tt.top+ie.scrollTop,Fe=et.height||Fe,Ve=!0}Re.detach()}Ve&&(Se.style.transform=`translate(${Math.max(0,Ne)}px, ${Math.max(0,We)}px)`,Se.style.height=`${Fe}px`,Se.style.visibility="visible")})()};Hn?Ka=Hn(H):H()}return Ze([ke,()=>s.content,()=>s.nodes,()=>w.typewriter,j],()=>Jn(null,null,function*(){var A,H;if(!oe||Z.value||!K.value)return;if(j.value)return Ui.value=!1,yf(),void kf();if((A=s.nodes)!=null&&A.length)return Ui.value=!1,yf(),kf(),mf=((H=s.content)!=null?H:"").length,void(gf=ke.value.length);const V=(function(){var Ne,We;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((Fe,Ve)=>Fe+vf(Ve),0):((We=s.content)!=null?We:"").length})(),G=(function(){var Ne;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((We,Fe)=>We+vf(Fe),0):ke.value.length})(),ie=!pb(st.value[st.value.length-1]),Se=V>mf,Te=G>gf;if(w.typewriter===!1||!ie||!Se&&!Te)return w.typewriter!==!1&&ie||(Ui.value=!1,kf()),mf=V,void(gf=G);mf=V,gf=G,Ui.value=!0,Ql.value&&(Ql.value.style.visibility="hidden"),yf(),yield pt(),W1(),_u=setTimeout(()=>{_u=void 0,Ui.value=!1},3e3)}),{flush:"post",immediate:!0}),Ze(Ui,A=>Jn(null,null,function*(){A?(yield pt(),W1()):kf()}),{flush:"post"}),Ze([()=>ys.value,()=>zs.start,()=>zs.end],()=>Jn(null,null,function*(){oe&&!Z.value&&K.value&&Ui.value&&(yield pt(),W1())}),{flush:"post"}),ps(()=>{yf(),mb(),gs.clear()}),(A,H)=>{const V=$T("NodeRenderer",!0);return C(Z)?(x(!0),T(Be,{key:0},nt(B1.value,G=>(x(),T(Be,{key:G.index},[G.rendersCustomNode?(x(),xe(Ks(G.component),kn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onClick:P1,onMouseover:ub,onMouseout:db,onCopy:H[0]||(H[0]=ie=>o("copy",ie)),onHandleArtifactClick:H[1]||(H[1]=ie=>o("handleArtifactClick",ie))}),{default:Ee(()=>[G.hasSlotChildren?(x(),xe(V,kn({key:0,ref_for:!0},Bn.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(x(),xe(V,kn({key:1,ref_for:!0},Bn.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),xe(Ks(G.component),kn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onClick:P1,onMouseover:ub,onMouseout:db,onCopy:H[2]||(H[2]=ie=>o("copy",ie)),onHandleArtifactClick:H[3]||(H[3]=ie=>o("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),T("div",{key:1,ref_key:"containerRef",ref:S,class:Pe(["markstream-vue markdown-renderer",[{dark:w.isDark},{virtualized:Et.value},{"virtual-scroll-coordinated":Ye.value}]]),"data-custom-id":w.customId,onClick:P1,onMouseover:tE,onMouseout:nE},[Lt.value||Et.value?(x(),T(Be,{key:0},[Lt.value?(x(),T("div",{key:0,class:"height-estimation-probes",style:Gt({width:`${_n.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[re(C(wa),{node:Hs.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:B,class:"node-content","data-probe":"list-item"},[_("ul",yee,[re(C(Dc),{node:Ws.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[re(C(Pc),{node:Qn.value,"index-key":"probe-list"},null,8,["node"])],512),(x(),T(Be,null,nt(6,G=>_("div",{key:`probe-heading-${G}`,ref_for:!0,ref:ie=>(function(Se,Te){Se<1||Se>6||(P[Se]=Te)})(G,ie),class:"node-content","data-probe":`heading-${G}`},[re(C(Sp),{node:C8(G),"index-key":`probe-heading-${G}`},null,8,["node","index-key"])],8,kee)),64))],4)):le("",!0),Et.value?(x(),T("div",{key:1,class:"node-spacer",style:Gt({height:`${o1.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(x(!0),T(Be,null,nt(B1.value,G=>(x(),T("div",{key:G.index,ref_for:!0,ref:ie=>Q2(G.index,ie),class:"node-slot","data-node-index":G.index,"data-node-type":G.node.type},[$1(G.index)?(x(),T("div",{key:0,ref_for:!0,ref:ie=>(function(Se,Te){var Ne;Te||(function(ze){const Re=`${r1()}-${ze}`;let Ue=!1;for(const et of Array.from(Uo.keys())){const tt=Wi.get(et);(tt?.index===ze||et===Re||et.startsWith(`${Re}-`))&&(Uo.delete(et),Wi.delete(et),Ue=!0)}Ue&&(Ba(),zn("async-node"))})(Se),rr.delete(Se),(function(ze){var Re;const Ue=((Re=Ul.get(ze))!=null?Re:0)+1;Ul.set(ze,Ue)})(Se);const We=jr.get(Se);if(We){for(const ze of We)sf(ze);jr.delete(Se)}if((function(ze){const Re=Fs.get(ze);Re&&(Os?.unobserve(Re),ro.delete(Re),Fs.delete(ze))})(Se),!Te||!ns.value)return Hi.delete(Se),void Ul.delete(Se);Hi.set(Se,Te);const Fe=()=>{hf(Se,Te)};queueMicrotask(Fe);const Ve=(Os||typeof ResizeObserver>"u"||(Os=new ResizeObserver(ze=>{if(ze.length)for(const Re of ze){const Ue=ro.get(Re.target),et=Fs.get(Ue??-1);Ue!=null&&et&&hf(Ue,et)}else ar()})),Os);if(Ve&&(Fs.set(Se,Te),ro.set(Te,Se),Ve.observe(Te)),typeof window<"u"){const ze=((Ne=st.value[Se])==null?void 0:Ne.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(ze.length){const Re=ze.map(Ue=>k2(Ue,Fe,"node-resize")).filter(Ue=>Ue!=null);Re.length&&jr.set(Se,Re)}}})(G.index,ie),class:"node-content"},[G.isCodeBlock?G.rendersCustomNode?(x(),xe(Ks(G.component),kn({key:1,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[8]||(H[8]=ie=>o("copy",ie)),onHandleArtifactClick:H[9]||(H[9]=ie=>o("handleArtifactClick",ie))}),{default:Ee(()=>[G.hasSlotChildren?(x(),xe(V,kn({key:0,ref_for:!0},Bn.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(x(),xe(V,kn({key:1,ref_for:!0},Bn.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),xe(Ks(G.component),kn({key:2,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[10]||(H[10]=ie=>o("copy",ie)),onHandleArtifactClick:H[11]||(H[11]=ie=>o("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),xe(Tl,{key:0,name:"fade",css:w.fade!==!1,appear:w.fade!==!1},{default:Ee(()=>[G.rendersCustomNode?(x(),xe(Ks(G.component),kn({key:0,ref_for:!0},G.customBindings,{node:G.node,loading:G.node.loading,"index-key":G.indexKey,"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[4]||(H[4]=ie=>o("copy",ie)),onHandleArtifactClick:H[5]||(H[5]=ie=>o("handleArtifactClick",ie))}),{default:Ee(()=>[G.hasSlotChildren?(x(),xe(V,kn({key:0,ref_for:!0},Bn.value,{nodes:G.node.children,"index-key":G.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):G.slotContent?(x(),xe(V,kn({key:1,ref_for:!0},Bn.value,{content:G.slotContent,final:!G.node.loading,"index-key":`${G.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),xe(Ks(G.component),kn({key:1,node:G.node,loading:G.node.loading,"index-key":G.indexKey},{ref_for:!0},G.bindings,{"custom-id":w.customId,"is-dark":w.isDark,onCopy:H[6]||(H[6]=ie=>o("copy",ie)),onHandleArtifactClick:H[7]||(H[7]=ie=>o("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),T("div",{key:1,class:"node-placeholder",style:Gt({height:`${lf(G.index)}px`})},null,4))],8,bee))),128)),Ui.value?(x(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:Ql,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),Et.value?(x(),T("div",{key:2,class:"node-spacer",style:Gt({height:`${i1.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,vee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Wo=t5;Wo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Wo.__name,Wo.name].filter(n=>!!n));for(const n of t)e.component(n,t5)};const Mk=Object.freeze(Object.defineProperty({__proto__:null,default:Wo},Symbol.toStringTag,{value:"Module"})),xee={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"},wee={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"},_ee={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"},See={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"},Cee={class:"admonition-title"},Aee=["aria-expanded","aria-controls"],Mee=["id"],Eh=vn(Ge({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=D(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=X(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),T("div",{class:Pe(["admonition",[`admonition-${s.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(x(),T("svg",xee,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(x(),T("svg",wee,[...u[2]||(u[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(x(),T("svg",_ee,[...u[3]||(u[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(x(),T("svg",See,[...u[4]||(u[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),_("span",Cee,O(i.value),1),s.node.collapsible?(x(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),T("svg",{style:Gt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Aee)):le("",!0)]),On(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[re(C(Wo),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Mee),[[yi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Eh.install=e=>{e.component(Eh.__name,Eh)};const n5=()=>go(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Qf=null,Eee=n5;function jwe(){return Jn(this,null,function*(){if(Qf)return Qf;const e=Eee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===n5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Qf=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),Qf):null})}function Vwe(){return!1}function Kwe(){return Jn(this,null,function*(){return null})}const Xf=X(!1);let lC=!1;function Z0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Tee(){return!lC&&typeof window<"u"&&typeof document<"u"&&(lC=!0,Xf.value=Z0(),new MutationObserver(()=>{Xf.value=Z0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Xf.value=Z0()})),Xf}const s5=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],Nee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Rv=[...s5].sort((e,t)=>t.length-e.length).join("|"),Q0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Rv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Rv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),o5=/[),.;!?,。;!?)]+$/;function Iee(e){const t=e.toLowerCase();return s5.some(n=>t.endsWith(`.${n}`))}function $ee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Rv}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function Lee(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(o5,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=Nee.has(i),a=Iee(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function Fee(e,t={}){const n=[];Q0.lastIndex=0;let s;for(;(s=Q0.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(o5,""),u=a.length-c.length;a=c;const d=Lee(a,t);if(!d)continue;const f=s.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(Q0.lastIndex-=u)}return n}const Oee=12e4,Ree=6e4,Bee=32,Dee=3e4,aC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Pee(e){let t=0,n=0,s=0;aC.lastIndex=0;let o;for(;(o=aC.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=Oee||n>=Ree||t>=Bee||s>=Dee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Hee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Wee(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const zee={key:1,class:"diff-wrap"},Uee={class:"diff-bar"},qee=["aria-label","onClick"],jee={class:"diff-pre"},Vee={key:0,class:"diff-sign"},Kee={class:"diff-text"},Gee="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",cC="github-light",uC="github-dark",Yee=Ge({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){SQ(),BQ(),AQ(),zQ(),CQ(new Hee),WQ(new Wee);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Mt(),s=Vt("resolveImage"),o=X(null),i=e,r=D(()=>!i.streaming),l=D(()=>$ee(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Pee(i.text??"")),c=Tee(),u=D(()=>!i.streaming),d=Ps(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function b(R){if(!s)return;const P=[];for(const z of[h,p]){z.lastIndex=0;let W;for(;(W=z.exec(R))!==null;)P.push(W[2]??"")}for(const z of P)!z||!m(z)||d.has(z)||f.has(z)||(f.add(z),s(z).then(W=>{d.set(z,W!==z?W:"")}).catch(()=>{d.set(z,"")}).finally(()=>{f.delete(z)}))}function v(R){if(!s)return R;const P=z=>{if(!m(z))return null;const W=d.get(z);return W===void 0?Gee:W===""?null:W};return R.replace(h,(z,W,ee,U)=>{const Y=P(ee);return Y===null?z:`${W}${Y}${U}`}).replace(p,(z,W,ee,U)=>{const Y=P(ee);return Y===null?z:`${W}${Y}${U}`})}Ze(()=>i.text,R=>b(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),P=[];let z=R.nextNode();for(;z;){const W=z,ee=W.parentElement;ee&&!ee.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&P.push(W),z=R.nextNode()}for(const W of P){const ee=Fee(W.data,{aliases:l.value});if(ee.length===0||!W.parentNode)continue;const U=document.createDocumentFragment();let Y=0;for(const ue of ee){ue.start>Y&&U.append(document.createTextNode(W.data.slice(Y,ue.start)));const fe=document.createElement("button");fe.type="button",fe.className="md-file-link",fe.textContent=ue.text,fe.title=ue.line?`${ue.path}:${ue.line}`:ue.path,fe.addEventListener("click",oe=>{oe.preventDefault(),oe.stopPropagation(),i.openFile?.({path:ue.path,line:ue.line})}),U.append(fe),Y=ue.end}Y<W.data.length&&U.append(document.createTextNode(W.data.slice(Y))),W.parentNode.replaceChild(U,W)}}function y(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function k(R){let P=R.length;for(const z of["#","?"]){const W=R.indexOf(z);W!==-1&&W<P&&(P=W)}return R.slice(0,P)}function E(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const P of R){if(P.dataset.mdLinkHandled==="true"||P.closest("svg"))continue;const z=P.getAttribute("href")??"";y(z)&&(P.dataset.mdLinkHandled="true",P.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),i.openFile?.({path:k(z)})}))}}function L(){pt().then(()=>{g(),E()})}Ze(()=>i.text,L),Ze(()=>i.streaming,L);let $=null;fn(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),xn(()=>{$?.disconnect()});const w={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1};function M(R){const P=typeof navigator<"u"?navigator.clipboard:void 0;P&&typeof P.writeText=="function"||Zs(R)}const N=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,F=D(()=>{const R=v(i.text??""),P=[];let z=0;N.lastIndex=0;let W;for(;(W=N.exec(R))!==null;){const U=W[1]??"",Y=R.slice(z,W.index)+(U||"");Y.trim()&&P.push({kind:"md",text:Y}),P.push({kind:"diff",code:W[2]??""}),z=N.lastIndex}const ee=R.slice(z);return(ee.trim()||P.length===0)&&P.push({kind:"md",text:ee}),P});function S(R){return R.split(`
|
|
281
|
-
`).map(P=>P.startsWith("@@")?{type:"hunk",sign:"",text:P}:/^\+(?!\+\+)/.test(P)?{type:"add",sign:"+",text:P.slice(1)}:/^-(?!--)/.test(P)?{type:"del",sign:"-",text:P.slice(1)}:P.startsWith(" ")?{type:"ctx",sign:"",text:P.slice(1)}:{type:"ctx",sign:"",text:P})}const I=X(null);function B(R,P){Zs(R).then(z=>{z&&(I.value=P,setTimeout(()=>{I.value=null},1400))})}return(R,P)=>(x(),T("div",{ref_key:"mdRef",ref:o,class:"md"},[(x(!0),T(Be,null,nt(F.value,(z,W)=>(x(),T(Be,{key:W},[z.kind==="md"?(x(),xe(C(Wo),{key:0,content:z.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":cC,"code-block-dark-theme":uC,themes:[cC,uC],"code-block-props":w,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:M},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(x(),T("div",zee,[_("div",Uee,[P[0]||(P[0]=_("span",{class:"diff-lang"},"diff",-1)),re(Yt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:ee=>B(z.code,W)},[re(je,{name:I.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,qee)]),_:2},1032,["text"])]),_("pre",jee,[_("code",null,[(x(!0),T(Be,null,nt(S(z.code),(ee,U)=>(x(),T("span",{key:U,class:Pe(["diff-line",`diff-${ee.type}`])},[ee.type!=="hunk"?(x(),T("span",Vee,O(ee.sign),1)):le("",!0),_("span",Kee,O(ee.text),1)],2))),128))])])]))],64))),128))],512))}}),Om=ct(Yee,[["__scopeId","data-v-fbd17874"]]),Zee={class:"tc-anim"},Qee={class:"prev-anim"},Xee={class:"prev"},Jee=Ge({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&o.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>o.value.at(-1)??""),a=X(null);return fn(()=>{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)||pt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),T("div",{class:Pe(["think",{mob:e.mobile}])},[i.value?(x(),T("div",{key:0,class:Pe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[_("div",Zee,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",Qee,[_("span",Xee,O(l.value),1)])],2)):(x(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),ete=ct(Jee,[["__scopeId","data-v-fdc551ea"]]),tte={class:"activity-notice",role:"status"},nte={"aria-hidden":"true"},ste={class:"an-label"},ote=Ge({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),T("div",tte,[_("span",nte,[re(zo,{size:"sm"})]),_("span",ste,O(e.label),1)]))}}),ite=ct(ote,[["__scopeId","data-v-0d497074"]]);function rte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const lte=Ge({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Mt(),s=X(!1),o=D(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=D(()=>s.value?o.value:rte(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(x(),T("button",{type:"button",class:"msg-time",onClick:kt(r,["stop"])},O(i.value),1))}}),i5=ct(lte,[["__scopeId","data-v-9672fbd5"]]);function ate(e){return e.length===1?`0${e}`:e}function cte(e,t){return`${String(Number(e))}:${ate(t)}`}const dC=e=>/^\d+$/.test(e);function ute(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[s,o,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(s==="*"&&o==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(s);if(u&&o==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(s==="0"&&o==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(o);if(s==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(dC(s)&&dC(o)&&c){const f=cte(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const dte=["data-turn-id"],fte={class:"cn-bubble"},hte={class:"cn-title"},pte={key:0,class:"cn-prompt"},mte={class:"cn-meta"},gte={key:0,class:"cn-meta-item"},vte={key:1,class:"cn-meta-item"},yte=["aria-label"],kte=["title"],bte=Ge({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Mt(),s=D(()=>t.cron),o=D(()=>s.value?.missedCount!==void 0),i=D(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const u=s.value?.cron;return u?ute(u,n):""}),l=D(()=>o.value?"error":"ok"),a=D(()=>{const u=s.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=D(()=>t.text??"");return(u,d)=>(x(),T("div",{class:Pe(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",fte,[_("span",hte,O(i.value),1),c.value?(x(),T("span",pte,O(c.value),1)):le("",!0)]),_("div",mte,[re(je,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),T("span",gte,O(r.value),1)):le("",!0),a.value?(x(),T("span",vte,O(a.value),1)):le("",!0),_("span",{class:Pe(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),xe(je,{key:0,name:"check",size:"sm"})):(x(),xe(je,{key:1,name:"close",size:"sm"}))],10,yte),s.value?.jobId?(x(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},O(s.value.jobId),9,kte)):le("",!0),e.createdAt?(x(),xe(i5,{key:3,time:e.createdAt},null,8,["time"])):le("",!0)])],10,dte))}}),xte=ct(bte,[["__scopeId","data-v-a62a6587"]]),wte=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],r5=500,Mp=256*1024,fC=200,X0=16384,J0=500,eg=50,tg=50,_te=6,Ste=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Cte=/^[A-Za-z0-9+/=_-]{200,}$/;let ng=null;function Bi(){if(ng!==null)return ng;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=us(Ft.debug)==="1"),ng=e,e}const Al=[],_c=[];let Hu=0;const da=[];let Wu=0,Ate=1;const Ep=new TextEncoder,Mte=new Set(wte),Ek=X(0),zu=Ia(!1);function Ete(){return Al}function Tte(){Al.length=0,_c.length=0,Hu=0,da.length=0,Wu=0,Ek.value++}function Ur(e){if(!zu.value){try{const t={id:Ate++,ts:Date.now(),source:e.source,kind:String(Hc(e.kind)),label:String(Hc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Hc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Pl(e.detail)},n=JSON.stringify(t),s=Ep.encode(n).byteLength;if(s>Mp)return;for(Al.push(t),_c.push(n),Hu+=s+(_c.length>1?1:0);Al.length>r5||Hu>Mp;){const o=_c.shift();Al.shift(),o!==void 0&&(Hu-=Ep.encode(o).byteLength,_c.length>0&&(Hu-=1))}}catch{return}Ek.value++}}function ia(e){if(typeof e=="string")return e.length<=fC?e:e.slice(0,fC)}function ui(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Nte(e,t){if(Mte.has(e))try{const n={ts:Date.now(),event:e,sessionId:ia(t?.sessionId),status:ia(t?.status),operation:ia(t?.operation),seq:ui(t?.seq),durationMs:ui(t?.durationMs),messageCount:ui(t?.messageCount),contentCount:ui(t?.contentCount),mediaCount:ui(t?.mediaCount),sessionCount:ui(t?.sessionCount),workspaceCount:ui(t?.workspaceCount),promptId:ia(t?.promptId),zipBytes:ui(t?.zipBytes),errorName:ia(t?.errorName),errorCode:ui(t?.errorCode),requestId:ia(t?.requestId),phase:ia(t?.phase),httpStatus:ui(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:ui(t?.line),col:ui(t?.col)},s=JSON.stringify(n),o=Ep.encode(s).byteLength;if(o>Mp)return;for(da.push(s),Wu+=o+(da.length>1?1:0);da.length>r5||Wu>Mp;){const i=da.shift();i!==void 0&&(Wu-=Ep.encode(i).byteLength,da.length>0&&(Wu-=1))}}catch{return}}function Hc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return Cte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>J0?`${i.slice(0,J0)}… [+${i.length-J0} chars]`:i}if(n!=="object")return String(e);if(t>=_te)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,eg).map(r=>Hc(r,t+1));return e.length>eg&&i.push(`[+${e.length-eg} more items]`),i}const s={},o=Object.entries(e);for(const[i,r]of o.slice(0,tg))s[i]=Ste.test(i)?"[redacted]":Hc(r,t+1);return o.length>tg&&(s._truncatedKeys=o.length-tg),s}function Pl(e){if(e===void 0)return;const t=Hc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>X0)return{_truncated:`detail JSON was ${n.length} chars; first ${X0} kept`,preview:n.slice(0,X0)}}catch{return"[unserializable detail]"}return t}function Jf(e){Bi()&&Ur({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Pl(e.body)}})}function sc(e){if(!Bi())return;const t=e.code!==0;Ur({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:Pl(e.data)}})}function rl(e){Bi()&&Ur({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 oc(e,t){Bi()&&Ur({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Pl(t)})}function Ite(e){if(!Bi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;Ur({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Pl(e)})}function $te(e){if(!Bi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Ur({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Pl(t.payload)})}const Lte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Fte(e,t,n){Bi()&&Ur({source:"client",kind:`client:${e}`,label:`${Lte[e]} ${t}`,detail:Pl(n)})}function Cr(e,t){Bi()&&Ur({source:"client",kind:"client:event",label:`· ${e}`,detail:Pl(t)})}function ws(e,t){Nte(e,t),Ur({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let sg=!1,eh=null;function Ote(){if(sg)return()=>eh?.();sg=!0;const e=[];try{if(typeof window<"u"){const n=o=>{ws("window:error",{status:"failed",errorName:o.error instanceof Error?o.error.name:"Error",line:o.lineno,col:o.colno})},s=o=>{const i=o.reason;ws("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",s),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",s)})}}catch{}if(Bi())for(const n of["error","warn","log","info","debug"]){const s=console[n];if(typeof s!="function")continue;const o=(...i)=>{try{Fte(n,i.map(Rte).join(" "),i.length>1?i:i[0])}catch{}s.apply(console,i)};console[n]=o,e.push(()=>{console[n]===o&&(console[n]=s)})}const t=()=>{if(eh===t){for(const n of e.toReversed())n();eh=null,sg=!1}};return eh=t,t}function Rte(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 l5(e=Al){if(typeof document>"u")return;const t=new Blob([Bte(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let s;try{s=document.createElement("a"),s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(s),s.click()}finally{s?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Bte(e=Al){return e===Al?_c.join(`
|
|
282
|
-
`):e.map(t=>JSON.stringify(t)).join(`
|
|
283
|
-
`)}function Dte(){return da.join(`
|
|
284
|
-
`)}function a5(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 Bv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Dv(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 Pte(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 Ti(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:Dv(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:a5(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 ad(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 hC(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 Tk(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:hC(e.source)};case"video":return{type:"video",source:hC(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 Pv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Tk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Hte(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 Wte(e){return{content:e.content.map(Hte),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 zte(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function c5(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 Ute(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function qte(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Ute),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function u5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(qte),createdAt:e.created_at}}function jte(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 Vte(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=jte(s);return{answers:t,method:e.method,note:e.note}}function Th(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function pC(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 ll(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ic(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function di(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function d5(e){if(!e||typeof e!="object")return null;const t=e,n=ll(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:ll(t,"goalId")??ll(t,"goal_id")??"goal",objective:ll(t,"objective")??"",completionCriterion:ll(t,"completionCriterion")??ll(t,"completion_criterion"),status:n,turnsUsed:ic(t,"turnsUsed")??ic(t,"turns_used")??0,tokensUsed:ic(t,"tokensUsed")??ic(t,"tokens_used")??0,wallClockMs:ic(t,"wallClockMs")??ic(t,"wall_clock_ms")??0,terminalReason:ll(t,"terminalReason")??ll(t,"terminal_reason"),budget:{tokenBudget:di(o,"tokenBudget")??di(o,"token_budget"),remainingTokens:di(o,"remainingTokens")??di(o,"remaining_tokens"),turnBudget:di(o,"turnBudget")??di(o,"turn_budget"),remainingTurns:di(o,"remainingTurns")??di(o,"remaining_turns"),wallClockBudgetMs:di(o,"wallClockBudgetMs")??di(o,"wall_clock_budget_ms"),remainingWallClockMs:di(o,"remainingWallClockMs")??di(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Kte(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ti(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ti(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:ad(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:ad(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:Dv(t.payload.status),previousStatus:Dv(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:a5(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=d5(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:Pv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Tk),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:c5(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:u5(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:Th(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:Hv(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Gte(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function mC(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 Hv(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 Yte(e){return e.session_id}function Zte(e){return e.seq}const Qte="main",Xte=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","error"]);function xr(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function Jte(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 gC(){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 ho(e,t){const n=e[t];return typeof n=="string"?n:void 0}function la(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function fi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ene(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=ho(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=ho(t,"goalId")??ho(t,"goal_id")??"goal",r=ho(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ho(t,"completionCriterion")??ho(t,"completion_criterion"),status:o,turnsUsed:la(t,"turnsUsed")??la(t,"turns_used")??0,tokensUsed:la(t,"tokensUsed")??la(t,"tokens_used")??0,wallClockMs:la(t,"wallClockMs")??la(t,"wall_clock_ms")??0,terminalReason:ho(t,"terminalReason")??ho(t,"terminal_reason"),budget:{tokenBudget:fi(s,"tokenBudget")??fi(s,"token_budget"),remainingTokens:fi(s,"remainingTokens")??fi(s,"remaining_tokens"),turnBudget:fi(s,"turnBudget")??fi(s,"turn_budget"),remainingTurns:fi(s,"remainingTurns")??fi(s,"remaining_turns"),wallClockBudgetMs:fi(s,"wallClockBudgetMs")??fi(s,"wall_clock_budget_ms"),remainingWallClockMs:fi(s,"remainingWallClockMs")??fi(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Sc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function tne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ho(t,"name")??ho(t,"toolName")??"tool",s=La(nne(n)),o=sne(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=ho(n,"text");if(o)return og(o);const i=ho(n,"message");if(i)return og(i)}const s=ho(t,"message");if(s)return og(s)}return null}function nne(e){return e.replace(/_\d+$/,"")}const vC=2e3;function og(e){return e.length>vC?`${e.slice(0,vC)}…`:e}function sne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return _d(e,n)}function one(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=ho(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Sc(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=tne(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Sc(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 Lu(e){return{...e,content:e.content.map(t=>({...t}))}}function yC(e,t,n){const s={id:xr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function ine(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function rne(e){return Array.isArray(e)?e.map(t=>Tk(t)):[]}function kC(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function lne(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function ane(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function bC(e,t){e.messages.find(n=>n.id===t)}function cne(e,t,n,s,o,i){const r={id:xr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function ig(e,t){return e.messages.find(n=>n.id===t)}function xC(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 une(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=gC(),e.set(u,d)),d}function s(u){e.set(u,gC())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),h=d.promptId??xr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=yC(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const b=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:b}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:Lu(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),m=d,b=[],v=m?.agentId;if(typeof v=="string"&&v!==Qte){const g=t.has(v);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const y=m?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:m?.reason}];if(Xte.has(u))return one(p,f,v,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,y=m?.patch?.lastPrompt,k={};typeof g=="string"&&g.length>0&&(k.title=g),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const g=m?.promptId,y=m?.userMessageId;if(!g||!y)break;const k=rne(m?.content);if(k.length===0)break;p.currentPromptId=g;const E=ine(p,f,g,y,k,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:Lu(E)});break}case"turn.started":{const g=m?.turnId,y=p.currentPromptId??xr("pr_");p.currentPromptId=y,g!==void 0&&p.turnPromptId.set(g,y),p.turnTextLen=0,p.turnThinkLen=0;break}case"turn.step.started":{const g=m?.turnId;let y=p.turnPromptId.get(g)??p.currentPromptId;y||(y=xr("pr_"),p.currentPromptId=y,g!==void 0&&p.turnPromptId.set(g,y)),p.turnTextLen=0,p.turnThinkLen=0;const k=yC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:Lu(k)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const y=m?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const E=kC(p,g,"thinking",y);if(E<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:E,delta:{thinking:y}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const y=m?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const E=kC(p,g,"text",y);if(E<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:E,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,y=m?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!g||!k)break;const E=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};lne(p,g,E,L,$);const w=ig(p,g);w&&w.content.length-1,p.toolStartTimes.set(E,Date.now()),w&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:w.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,y=ane(m??{});g&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const g=m?.turnId;let y=p.turnPromptId.get(g)??p.currentPromptId;y||(y=xr("pr_"),p.currentPromptId=y,g!==void 0&&p.turnPromptId.set(g,y));const k=m?.toolCallId,E=m?.output,L=m?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const $=cne(p,f,k,E,L,y);b.push({type:"messageCreated",message:Lu($)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,y=Jte(m?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,g){bC(p,g);const k=ig(p,g);k&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:k.content.map(E=>({...E})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:xC(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,y=m?.reason??"completed",k=la(m??{},"durationMs");if(g){bC(p,g);const L=ig(p,g);L&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:L.content.map($=>({...$})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const E=xC(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:E}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{p.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const y={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:xr("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const g=Sc(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&b.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Sc(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&b.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,y=Sc(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,y=Sc(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const g=m?.info??{},y=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,k=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):xr("task_"),E=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Cn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:E,command:L,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"task.terminated":{const g=m?.info??{},y=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=ene(m?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,y=ho(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&y){const k={id:xr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(k),b.push({type:"messageCreated",message:Lu(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const dne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),wC=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","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),fne=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"]),hne=new Set(["assistant.delta","thinking.delta"]);function pne(e,t){if(dne.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return hne.has(s)?mne(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?fne.has(s)?{route:"protocol"}:wC.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:wC.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function mne(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 Uu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class yr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function tr(e){return e instanceof Uu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Nk(e){return e instanceof yr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const qs="kimi-web.server-credential",gne="token",vne=10080*60*1e3;let Ji;const Wv=new Set;function yne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(gne);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function zv(e){return{version:1,credential:e,expiresAt:Date.now()+vne}}function kne(e){return JSON.stringify(e)}function Ik(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Uv(e){globalThis.localStorage?.setItem(qs,kne(e))}function bne(){try{const e=globalThis.localStorage?.getItem(qs);if(e){const n=Ik(e);if(n===void 0){const s=zv(e);let o=!1;try{Uv(s),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(qs)===e&&globalThis.localStorage?.removeItem(qs),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(qs)}catch{}return o?s:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(qs),globalThis.localStorage?.getItem(qs)===e&&globalThis.localStorage?.removeItem(qs);return}const t=globalThis.sessionStorage?.getItem(qs);if(t){const n=zv(t);let s=!1;try{Uv(n),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(qs),s=!0}catch{}return s?n:void 0}return}catch{return}}function xne(){const e=yne();return e?(h5(e),!0):(Ji=bne(),Ji!==void 0)}function f5(){if(Ji!==void 0){if(Ji.expiresAt<=Date.now()){wne(Ji);return}return Ji.credential}}function wne(e){Ji=void 0;try{globalThis.sessionStorage?.removeItem(qs);const t=globalThis.localStorage?.getItem(qs),n=t==null?void 0:Ik(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(qs)}catch{}}function h5(e){const t=zv(e);Ji=t;try{Uv(t)}catch{}try{globalThis.sessionStorage?.removeItem(qs)}catch{}}function _ne(){const e=Ji;Ji=void 0;try{const t=globalThis.localStorage?.getItem(qs),s=(t==null?void 0:Ik(t))?.credential??t;e!==void 0&&s===e.credential&&globalThis.localStorage?.removeItem(qs),globalThis.sessionStorage?.removeItem(qs)}catch{}}function Sne(e){return Wv.add(e),()=>{Wv.delete(e)}}function Cne(){_ne();for(const e of Wv)try{e()}catch{}}const hc=3e4,th=5*6e4,p5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",_C=500,m5=40101;function nh(e=hc){try{return AbortSignal.timeout(e)}catch{return}}function Ane(e,t){let n="",s=e;for(let o=0;o<t;o++)n=p5[s%32]+n,s=Math.floor(s/32);return n}function Mne(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=>p5[n%32]).join("")}function sh(){return`${Ane(Date.now(),10)}${Mne(16)}`}function Ene(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function rg(e){try{const t=await e.text();return t?t.length>_C?`${t.slice(0,_C)}...`:t:void 0}catch{return}}class Tne{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=yc(this.origin,t),s=sh(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();Jf({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:nh()})}catch(a){throw rl({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new yr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:hc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return sc({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),sc({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Uu({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postZip(t,n,s){const o="POST",i=yc(this.origin,t),r=sh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();Jf({method:o,path:t,url:i,requestId:r,body:s});let c;try{c=await fetch(i,{method:o,headers:l,body:JSON.stringify(n),signal:nh(th)})}catch(h){throw rl({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new yr({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:th,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const b=h?.code??c.status,v=h?.msg??c.statusText;throw sc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new Uu({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw rl({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new yr({message:`Invalid ZIP response from ${o} ${t}`,cause:m,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:th,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await rg(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw rl({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new yr({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:th,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return sc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const s=yc(this.origin,t),o=sh(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Jf({method:"POST",path:t,url:s,requestId:o,body:Ene(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:nh()})}catch(u){throw rl({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new yr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:hc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw rl({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new yr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:hc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await rg(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(sc({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Uu({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=yc(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,b]of Object.entries(o))b!==void 0&&h.set(m,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=sh(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Jf({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:nh()})}catch(h){throw rl({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new yr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:hc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw rl({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new yr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:hc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await rg(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(sc({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 Uu({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=f5();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===m5)&&Cne()}}const Nne="kimi-code.bearer.",Ine=3e4;class $ne{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),oc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=f5(),n=t!==void 0?[`${Nne}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{oc("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));$te(i),this.handleFrame(i)}catch(i){oc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{oc("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{oc("close",o?{code:o.code,reason:o.reason,wasClean:o.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,oc("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.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,s){const o=oh(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(oh(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(oh(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Ine),s=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:s}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const s=n.payload?.heartbeat_ms;typeof s=="number"&&s>0&&(this.heartbeatMs=s),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=oh(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=pne(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Ite(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function oh(e,t){return`${e}\0${t}`}function Lne(e,t){if(e===void 0)return t;let n;const s=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(s!==void 0)try{n=decodeURIComponent(s.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function SC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function lg(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function CC(e){return e==="auto_compact"||e==="manual_compact"}class Fne{http;config;constructor(t){this.config=t,this.http=new Tne(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Pte(t.status):void 0,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ti),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return Ti(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ti(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Ti(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return d5(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ti(n)}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(Pv),hasMore:o.has_more}}async getSessionSnapshot(t){const n=Date.now();ws("session:snapshot:start",{sessionId:t});try{const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),o={asOfSeq:s.as_of_seq,epoch:s.epoch,session:Ti(s.session),messages:s.messages.items.map(Pv),hasMoreMessages:s.messages.has_more,inFlightTurn:s.in_flight_turn===null?null:{turnId:s.in_flight_turn.turn_id,assistantText:s.in_flight_turn.assistant_text,thinkingText:s.in_flight_turn.thinking_text,runningTools:s.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:s.in_flight_turn.current_prompt_id},pendingApprovals:s.pending_approvals.map(c5),pendingQuestions:s.pending_questions.map(u5),subagents:(s.subagents??[]).map(Th)};return ws("session:snapshot:accepted",{sessionId:t,status:o.session.status,seq:o.asOfSeq,messageCount:o.messages.length,durationMs:Date.now()-n}),o}catch(s){throw ws("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...SC(s)}),s}}async exportSession(t,n){const s=n===void 0?0:new TextEncoder().encode(n).byteLength,o=n===void 0||n.length===0?0:n.split(`
|
|
285
|
-
`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:s,web_log_entries:o}),r=`${t}.zip`;return{blob:i.blob,fileName:Lne(i.contentDisposition,r)}}async submitPrompt(t,n){const s=Date.now();ws("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Wte(n));return ws("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-s}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw ws("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-s,...SC(o)}),o}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Ti(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Ti(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ti)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,zte(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Vte(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(Th)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return Th(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(lg)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return lg(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return lg(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(pC)])):void 0;return{items:o.items.map(pC),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return yc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(ad)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return ad(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const s=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return ad(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Gte)}async listProviders(){return(await this.http.get("/providers")).items.map(mC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return mC(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return ag(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return ag(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return ag(t)}async getConfig(){const t=await this.http.get("/config");return Hv(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return Hv(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return yc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=yI(this.config.serverHttpUrl,this.config.clientId),s=une(),o=new $ne(n,this.config.clientId,{onWireEvent:i=>{const r=Yte(i),l=Zte(i),a=Kte(i);a.type==="historyCompacted"&&!CC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!CC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function ag(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let AC;function ut(){return AC??=new Fne(hI()),AC}const One=["src","controls","muted"],Rne=["src","alt"],cg=Ge({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=X(t.fileId?"":t.url),s=X(null),o=X(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=await ut().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ze(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),fn(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),ps(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),T("video",{key:0,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,One)):(x(),T("img",{key:1,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Rne))}}),Bne=["aria-label"],Dne=120,Pne=60,Hne=Ge({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*Dne}ms`,"--moon-frame-fast-delay":`${s*Pne}ms`}}return(s,o)=>(x(),T("span",{class:Pe(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),T(Be,null,nt(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:Gt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Bne))}}),g5=ct(Hne,[["__scopeId","data-v-a6b7ec07"]]),Wne={class:"chat"},zne={key:0,class:"chat-loading"},Une={class:"chat-loading-text"},qne={key:1,class:"chat-empty"},jne={key:1,class:"top-sentinel-text"},Vne={key:0,class:"u-turn"},Kne=["data-turn-id"],Gne={key:0,class:"u-imgs"},Yne=["aria-label","onClick"],Zne={key:1,class:"skill-act"},Qne={class:"skill-act-head"},Xne={key:0,class:"skill-act-args"},Jne={key:2,class:"skill-act"},ese={class:"skill-act-head"},tse={key:0,class:"skill-act-args"},nse={key:3,class:"u-text"},sse={key:0,class:"u-meta"},ose=["aria-label","onClick"],ise=["aria-label","onClick"],rse=["data-turn-id"],lse=["onClick"],ase={class:"cd-view"},cse={key:1,class:"cd-label"},use=["data-turn-id"],dse={key:1,class:"msg"},fse={key:0,class:"a-msg-ft"},hse={key:0,class:"a-duration"},pse=["aria-label","onClick"],mse={key:4,class:"sending-placeholder"},gse={key:5,class:"q-stack"},vse={class:"q-head"},yse={class:"q-title"},kse={class:"q-hint"},bse=["onDragover","onDrop"],xse={class:"u-bub q-bub"},wse=["title","onDragstart"],_se=["title","onClick"],Sse={key:0,class:"u-text q-text"},Cse={key:1,class:"q-text q-text-placeholder"},Ase={key:0,class:"q-imgs"},Mse={key:1,class:"q-tag q-tag-next"},Ese={key:2,class:"q-tag q-tag-idx"},Tse=["aria-label","onClick"],Nse=2500,Ise=Ge({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=Mt(),{confirm:o}=zr();xn(()=>{U!==null&&(clearTimeout(U),U=null),I!==null&&(clearTimeout(I),I=null),M!==null&&(clearTimeout(M),M=null)});const i=e,r=X(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Z=>{Z[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}fn(a),xn(()=>{l?.disconnect(),l=null}),Ze(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{pt().then(a)});const c=D(()=>{if(!i.running||i.turns.length===0)return null;const Z=i.turns.at(-1);return Z.role==="assistant"?Z.id:null}),u=D(()=>i.sending||i.running),d=n,f=X(null),h=X(null);function p(Z){return(Z.attachments?.length??0)>0}function m(Z){d("editQueued",Z)}function b(Z,te){if(f.value=Z,!te.dataTransfer)return;te.dataTransfer.effectAllowed="move",te.dataTransfer.setData("text/plain",String(Z));const ae=te.currentTarget?.closest(".q-turn");ae&&te.dataTransfer.setDragImage(ae,24,24)}function v(Z,te){if(f.value===null)return;te.preventDefault(),te.dataTransfer&&(te.dataTransfer.dropEffect="move");const ae=te.currentTarget.getBoundingClientRect(),He=te.clientY<ae.top+ae.height/2?"before":"after";h.value={index:Z,position:He}}function g(Z,te){te.preventDefault();const ae=f.value,He=h.value?.position??"before";if(f.value=null,h.value=null,ae===null)return;let he=He==="before"?Z:Z+1;ae<he&&(he-=1),ae!==he&&d("reorderQueue",{from:ae,to:he})}function y(){f.value=null,h.value=null}const k=D(()=>{for(let Z=i.turns.length-1;Z>=0;Z--)if(i.turns[Z].role==="user")return i.turns[Z].id;return null});function E(Z){return Z.role==="user"&&Z.id===k.value&&!i.running&&!i.sending&&!Z.skillActivation&&!Z.pluginCommand}function L(Z){const te=Z.compaction,ae=te?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof te?.tokensBefore=="number"&&typeof te?.tokensAfter=="number"?ae+s("conversation.compactedTokens",{before:gw(te.tokensBefore),after:gw(te.tokensAfter)}):ae}const $=X(null),w=X(null);let M=null;async function N(Z){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(Z)}function F(Z){w.value===null&&(w.value=Z.id,d("editMessage",{text:Z.text,images:Z.images}),M=setTimeout(()=>{M=null,w.value=null},Nse))}Ze(()=>i.turns,Z=>{w.value!==null&&(Z.some(te=>te.id===w.value)||(w.value=null,M!==null&&(clearTimeout(M),M=null)))},{flush:"post"});const S=X(!1);let I=null;function B(){if(i.turns.length===0)return;const Z=[];for(const ae of i.turns){if(ae.role==="compaction"||ae.role==="cron")continue;const He=ae.role==="user"?"User":"Assistant",he=fW(ae);he.trim()&&Z.push(`**${He}**
|
|
286
|
-
|
|
287
|
-
${he}`)}const te=Z.join(`
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
`);Zs(te).then(ae=>{ae&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}function R(Z){const te=[];for(let ae=Z;ae>=0;ae--){const He=i.turns[ae];if(!He||He.role!=="assistant")break;te.unshift(He)}return te}function P(Z){return R(Z).map(te=>dW(te)).filter(Boolean).join(`
|
|
292
|
-
|
|
293
|
-
`)}function z(){for(let Z=i.turns.length-1;Z>=0;Z-=1)if(i.turns[Z]?.role==="assistant")return P(Z);return""}function W(){const Z=z();Z.trim()&&Zs(Z).then(te=>{te&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:B,copyFinalSummary:W});function ee(Z){const te=i.turns[Z];if(!te||te.role!=="assistant")return!1;const ae=i.turns[Z+1];return!ae||ae.role!=="assistant"}let U=null;function Y(Z){const te=i.turns[Z];if(!te)return;const ae=P(Z);ae.trim()&&Zs(ae).then(He=>{He&&($.value=te.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function ue(Z){const te=Z.text;te.trim()&&Zs(te).then(ae=>{ae&&($.value=Z.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function fe(Z){return{kind:"image",url:Z.url,path:Z.alt,fileId:Z.fileId}}function oe(Z,te){return Z.id!==c.value?!1:te.sourceIndex===mm(Z).length-1}return(Z,te)=>(x(),T("div",Wne,[e.sessionLoading?(x(),T("div",zne,[re(zo,{size:"sm"}),_("span",Une,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),T("div",qne)):le("",!0),e.hasMoreMessages||e.loadingMore?(x(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Pe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),T("span",jne,[re(zo,{size:"sm"}),Qe(" "+O(C(s)("conversation.loadingOlder")),1)])):(x(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:te[0]||(te[0]=ae=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):le("",!0),(x(!0),T(Be,null,nt(e.turns,(ae,He)=>(x(),T(Be,{key:ae.id},[ae.role==="user"?(x(),T("div",Vne,[_("div",{class:Pe(["u-bub turn-anchor",{undoing:w.value===ae.id}]),"data-turn-id":ae.id},[ae.images&&ae.images.length>0?(x(),T("div",Gne,[(x(!0),T(Be,null,nt(ae.images,(he,K)=>(x(),T(Be,{key:K},[he.kind==="video"?(x(),xe(cg,{key:0,url:he.url,kind:"video","file-id":he.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(x(),T("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:ce=>d("openMedia",fe(he))},[re(cg,{url:he.url,kind:"image",alt:he.alt,"file-id":he.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,Yne))],64))),128))])):le("",!0),ae.skillActivation?(x(),T("div",Zne,[_("div",Qne,[te[9]||(te[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(s)("conversation.activatedSkill",{name:ae.skillActivation.name})),1)]),ae.skillActivation.args?(x(),T("div",Xne,O(ae.skillActivation.args),1)):le("",!0)])):ae.pluginCommand?(x(),T("div",Jne,[_("div",ese,[te[10]||(te[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(ae.pluginCommand.pluginId)+":"+O(ae.pluginCommand.commandName),1)]),ae.pluginCommand.args?(x(),T("div",tse,O(ae.pluginCommand.args),1)):le("",!0)])):(x(),T("div",nse,O(ae.text),1))],10,Kne),ae.createdAt||E(ae)?(x(),T("div",sse,[E(ae)?(x(),T("div",{key:0,class:Pe(["u-edit-wrap",{undoing:w.value===ae.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:he=>N(ae)},[re(je,{name:"undo",size:"sm"})],8,ose)],2)):le("",!0),ae.text.trim().length>0?(x(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:kt(he=>ue(ae),["stop"])},[$.value!==ae.id?(x(),xe(je,{key:0,name:"copy",size:"sm"})):(x(),xe(je,{key:1,name:"check",size:"sm"}))],8,ise)):le("",!0),ae.createdAt?(x(),xe(i5,{key:2,time:ae.createdAt},null,8,["time"])):le("",!0)])):le("",!0)])):ae.role==="compaction"?(x(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ae.id,role:"separator"},[te[11]||(te[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ae.text?(x(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:he=>d("openCompaction",{turnId:ae.id})},[_("span",null,O(L(ae)),1),_("span",ase,O(C(s)("conversation.viewSummary")),1)],8,lse)):(x(),T("span",cse,O(L(ae)),1)),te[12]||(te[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,rse)):ae.role==="cron"?(x(),xe(xte,{key:2,text:ae.text,cron:ae.cron,"turn-id":ae.id,"created-at":ae.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":ae.id},[(x(!0),T(Be,null,nt(C(uW)(ae),(he,K)=>(x(),T(Be,{key:C(hW)(he,K)},[he.kind==="thinking"?(x(),xe(ete,{key:0,text:he.thinking,mobile:"",streaming:oe(ae,he),onOpen:ce=>d("openThinking",{turnId:ae.id,blockIndex:he.sourceIndex})},null,8,["text","streaming","onOpen"])):he.kind==="text"&&he.text?(x(),T("div",dse,[re(Om,{text:he.text,streaming:oe(ae,he),"open-file":ce=>d("openFile",ce)},null,8,["text","streaming","open-file"])])):he.kind==="tool-stack"?(x(),xe(bW,{key:2,tools:he.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:te[1]||(te[1]=ce=>d("openMedia",ce)),onOpenFile:te[2]||(te[2]=ce=>d("openFile",ce)),onOpenToolDiff:te[3]||(te[3]=ce=>d("openToolDiff",ce)),onOpenAgent:te[4]||(te[4]=ce=>d("openAgent",ce))},null,8,["tools","tool-diff-panel"])):he.kind==="tool"?(x(),xe(_A,{key:3,tool:he.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:te[5]||(te[5]=ce=>d("openMedia",ce)),onOpenFile:te[6]||(te[6]=ce=>d("openFile",ce)),onOpenToolDiff:te[7]||(te[7]=ce=>d("openToolDiff",ce)),onOpenAgent:te[8]||(te[8]=ce=>d("openAgent",ce))},null,8,["tool","tool-diff-panel"])):le("",!0)],64))),128)),ae.id!==c.value&&ee(He)&&(P(He).trim().length>0||ae.durationMs!==void 0)?(x(),T("div",fse,[re(Yt,{text:`${ae.durationMs} ms`},{default:Ee(()=>[ae.durationMs!==void 0?(x(),T("span",hse,O(C(lW)(ae.durationMs)),1)):le("",!0)]),_:2},1032,["text"]),P(He).trim().length>0?(x(),T("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:he=>Y(He)},[$.value!==ae.id?(x(),xe(je,{key:0,name:"copy",size:"sm"})):(x(),xe(je,{key:1,name:"check",size:"sm"}))],8,pse)):le("",!0)])):le("",!0)],8,use))],64))),128)),e.compaction?(x(),xe(ite,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):le("",!0),u.value?(x(),T("div",mse,[re(g5,{fast:e.fastMoon},null,8,["fast"])])):le("",!0),e.queued.length>0?(x(),T("div",gse,[_("div",vse,[_("span",yse,[re(je,{name:"mail",size:"sm"}),Qe(" "+O(C(s)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",kse,O(C(s)("composer.queueAutoDrain")),1)]),(x(!0),T(Be,null,nt(e.queued,(ae,He)=>(x(),T("div",{key:He,class:Pe(["u-turn q-turn",{"q-dragging":f.value===He,"drop-before":h.value?.index===He&&h.value.position==="before","drop-after":h.value?.index===He&&h.value.position==="after"}]),onDragover:he=>v(He,he),onDrop:he=>g(He,he)},[_("div",xse,[_("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:he=>b(He,he),onDragend:y},[re(je,{name:"grip",size:"sm"})],40,wse),_("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:he=>m(He)},[ae.text?(x(),T("span",Sse,O(ae.text),1)):(x(),T("span",Cse,[re(je,{name:"image",size:"sm"}),Qe(" "+O(C(s)("composer.queuedImageOnly",{n:ae.attachments?.length??0})),1)]))],8,_se),p(ae)?(x(),T("div",Ase,[(x(!0),T(Be,null,nt(ae.attachments,(he,K)=>(x(),xe(cg,{key:K,url:he.url,kind:he.kind,"file-id":he.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):le("",!0),He===0?(x(),T("span",Mse,O(C(s)("composer.queueNext")),1)):(x(),T("span",Ese,"#"+O(He+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:kt(he=>d("unqueue",He),["stop"])},[re(je,{name:"close",size:"sm"})],8,Tse)])],42,bse))),128))])):le("",!0)]))}}),v5=ct(Ise,[["__scopeId","data-v-0e45713a"]]),$se={class:"ch-id"},Lse={key:0,class:"ch-ws"},Fse={key:1,class:"ch-sep"},Ose=["onKeydown"],Rse={class:"ch-ses"},Bse={key:0,class:"ch-pill ch-sync-pill"},Dse={key:0,class:"ch-ahead"},Pse={key:1,class:"ch-behind"},Hse={key:1,class:"ch-pill ch-diff-pill"},Wse={key:0,class:"ch-add"},zse={key:1,class:"ch-del"},Use=Ge({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Mt(),{confirm:s}=zr(),o=e,i=t,r=D(()=>o.ahead??0),l=D(()=>o.behind??0),a=D(()=>o.gitDiffStats?.totalAdditions??0),c=D(()=>o.gitDiffStats?.totalDeletions??0),u=D(()=>a.value>0||c.value>0),d={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function f(U){return U.trim().toLowerCase().replaceAll("_","-")}function h(U){const Y=f(U);return d[Y]?`pr-${Y}`:"pr-unknown"}function p(U){return n(d[f(U)]??"header.prStatusUnknown")}const m=X(!1),b=X(null),v=X(null),g=X({});function y(U){const Y=U.target;v.value?.el?.contains(Y)||b.value?.el?.contains(Y)||L()}function k(){L()}async function E(U){if(U.stopPropagation(),m.value){L();return}m.value=!0,document.addEventListener("mousedown",y),window.addEventListener("resize",k),await pt();const Y=b.value?.el,ue=v.value?.el;if(!Y||!ue)return;const fe=Y.getBoundingClientRect(),oe=4,Z=8,te=ue.offsetWidth,ae=ue.offsetHeight;let He=fe.bottom+oe;He+ae>window.innerHeight-Z&&(He=Math.max(Z,fe.top-ae-oe));let he=fe.left;he+te>window.innerWidth-Z&&(he=Math.max(Z,fe.right-te)),g.value={top:`${Math.round(He)}px`,left:`${Math.round(he)}px`}}function L(){m.value=!1,document.removeEventListener("mousedown",y),window.removeEventListener("resize",k)}xn(()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",k)});function $(){i("copyAll"),L()}function w(){i("copyFinalSummary"),L()}const M=X(!1);function N(){o.sessionId&&Zs(o.sessionId).then(U=>{U&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const F=X(!1),S=X(""),I=X(null);async function B(){if(L(),!!o.sessionId){F.value=!0,S.value=o.sessionTitle??"",await pt();try{I.value?.focus(),I.value?.select()}catch{}}}function R(){const U=S.value.trim();U&&o.sessionId&&U!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,U),F.value=!1}function P(){F.value=!1}function z(){o.sessionId&&(L(),i("forkSession",o.sessionId))}function W(){o.sessionId&&(L(),i("exportSession",o.sessionId))}async function ee(){o.sessionId&&(L(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(U,Y)=>(x(),T("header",{class:Pe(["chat-header",{"macos-desktop":C(Lc)}])},[_("div",$se,[e.workspaceName?(x(),T("span",Lse,O(e.workspaceName),1)):le("",!0),e.workspaceName&&e.sessionTitle?(x(),T("span",Fse,"/")):le("",!0),F.value?On((x(),T("input",{key:2,ref_key:"renameInputRef",ref:I,"onUpdate:modelValue":Y[0]||(Y[0]=ue=>S.value=ue),class:"ch-rename",type:"text",onKeydown:[Xi(kt(R,["stop"]),["enter"]),Xi(kt(P,["stop"]),["esc"])],onBlur:R,onClick:Y[1]||(Y[1]=kt(()=>{},["stop"]))},null,40,Ose)),[[So,S.value]]):e.sessionTitle?(x(),xe(Yt,{key:3,text:e.sessionTitle},{default:Ee(()=>[_("span",Rse,O(e.sessionTitle),1)]),_:1},8,["text"])):le("",!0)]),re(qn,{ref_key:"kebabRef",ref:b,class:Pe(["ch-act-more",{open:m.value}]),label:C(n)("header.options"),"aria-expanded":m.value,"aria-haspopup":"menu",onClick:Y[2]||(Y[2]=kt(ue=>E(ue),["stop"]))},{default:Ee(()=>[re(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),m.value?(x(),xe(vl,{key:0,ref_key:"menuRef",ref:v,class:"ch-menu",style:Gt(g.value),onClick:Y[3]||(Y[3]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{onClick:$},{default:Ee(()=>[re(je,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Qe(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),re(mn,{onClick:w},{default:Ee(()=>[re(je,{name:"file-text",size:"sm"}),Qe(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),T(Be,{key:0},[re(mn,{separator:""}),re(mn,{onClick:N},{default:Ee(()=>[re(je,{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),Qe(" "+O(M.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),re(mn,{onClick:B},{default:Ee(()=>[re(je,{name:"pencil",size:"sm"}),Qe(" "+O(C(n)("header.renameSession")),1)]),_:1}),re(mn,{onClick:z},{default:Ee(()=>[re(je,{name:"git-fork",size:"sm"}),Qe(" "+O(C(n)("header.forkSession")),1)]),_:1}),re(mn,{onClick:W},{default:Ee(()=>[re(je,{name:"download",size:"sm"}),Qe(" "+O(C(n)("header.exportSession")),1)]),_:1}),re(mn,{danger:"",onClick:ee},{default:Ee(()=>[re(je,{name:"archive",size:"sm"}),Qe(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):le("",!0)]),_:1},8,["style"])):le("",!0),Y[6]||(Y[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),T("button",{key:1,type:"button",class:"ch-git",onClick:Y[4]||(Y[4]=ue=>i("openChanges"))},[_("span",{class:Pe(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),r.value>0||l.value>0?(x(),T("span",Bse,[r.value>0?(x(),T("span",Dse,"↑"+O(r.value),1)):le("",!0),l.value>0?(x(),T("span",Pse,"↓"+O(l.value),1)):le("",!0)])):le("",!0),u.value?(x(),T("span",Hse,[a.value>0?(x(),T("span",Wse,"+"+O(a.value),1)):le("",!0),c.value>0?(x(),T("span",zse,"-"+O(c.value),1)):le("",!0)])):le("",!0)])):le("",!0),e.pr?(x(),T("button",{key:2,type:"button",class:Pe(["ch-pill ch-pr",h(e.pr.state)]),onClick:Y[5]||(Y[5]=ue=>e.pr&&i("openPr",e.pr.url))},[re(je,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(p(e.pr.state)),1)],2)):le("",!0)],2))}}),qse=ct(Use,[["__scopeId","data-v-59cdb23e"]]),jse=["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"],MC=[[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 Vse(e){if(e<=255)return jse[e];let t=0,n=MC.length-1;for(;t<=n;){const s=t+n>>1,o=MC[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function Kse(e){const t=e.length;if(t===0)return null;const n=new Array(t);let s=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=Vse(d);(h==="R"||h==="AL"||h==="AN")&&(s=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!s)return null;let o=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){o=0;break}if(u==="R"||u==="AL"){o=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;const r=o&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function Gse(e,t){const n=Kse(e);if(n===null)return null;const s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}const Yse=/[ \t\n\r\f]+/g,Zse=/[\t\n\r\f]| {2,}|^ | $/;function Qse(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Xse(e){if(!Zse.test(e))return e;let t=e.replace(Yse," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Jse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
294
|
-
`).replace(/[\r\f]/g,`
|
|
295
|
-
`):e}let ug=null,eoe;function toe(){return ug===null&&(ug=new Intl.Segmenter(eoe,{granularity:"word"})),ug}const noe=/\p{Script=Arabic}/u,Hl=/\p{M}/u,$k=/\p{Nd}/u;function EC(e){return noe.test(e)}function TC(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function nr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){const o=(n-55296<<10)+(s-56320)+65536;if(TC(o))return!0;t++;continue}}if(TC(n))return!0}}return!1}function soe(e){const t=Yd(e);return t!==null&&(Lk.has(t)||Aa.has(t))}const ooe=new Set([" "," ","","\uFEFF"]),ioe=new Set(["-","‐","–","—"]);function roe(e){const t=Yd(e);return t!==null&&ooe.has(t)}function loe(e){const t=Yd(e);return t!==null&&ioe.has(t)}function y5(e,t){return roe(e)?!1:t?!(soe(e)||loe(e)):!0}const Lk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Rm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Fk=new Set(["'","’"]),Aa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),aoe=new Set([":",".","،","؛"]),coe=new Set(["၏"]),uoe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function doe(e){if(Ok(e))return!0;let t=!1;for(const n of e){if(Aa.has(n)||Dm(n)){t=!0;continue}if(!(t&&Hl.test(n)))return!1}return t}function foe(e){for(const t of e)if(!Lk.has(t)&&!Aa.has(t))return!1;return e.length>0}function hoe(e){if(Ok(e))return!0;for(const t of e)if(!Rm.has(t)&&!Fk.has(t)&&!Hl.test(t)&&!Dm(t))return!1;return e.length>0}function Ok(e){let t=!1;for(const n of e)if(!(n==="\\"||Hl.test(n))){if(Rm.has(n)||Aa.has(n)||Fk.has(n)){t=!0;continue}return!1}return t}function Bm(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Yd(e){if(e.length===0)return null;const t=Bm(e,e.length);return e.slice(t)}function poe(e){for(const t of e)if(!Hl.test(t))return t;return null}function moe(e){for(let t=e.length;t>0;){const n=Bm(e,t),s=e.slice(n,t);if(!Hl.test(s))return s;t=n}return null}const goe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function voe(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Dm(e){const t=e.codePointAt(0);return t!==void 0&&voe(t,goe)}function yoe(e){const t=moe(e);return t!==null&&Dm(t)}function koe(e){const t=poe(e);return t!==null&&$k.test(t)}function boe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Hl.test(s)){n--;continue}if(Rm.has(s)||Fk.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function xoe(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function NC(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function IC(e,t){return e&&t!==null&&aoe.has(t)}function woe(e){const t=Yd(e);return t!==null&&coe.has(t)}function _oe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function qv(e){let t=e.length;for(;t>0;){const n=Bm(e,t),s=e.slice(n,t);if(uoe.has(s))return!0;if(!Aa.has(s))return!1;t=n}return!1}function Soe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
296
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const Coe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Fi(e){return e.length===1?e[0]:e.join("")}function Aoe(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Fi(n)}function Moe(e,t,n,s){if(!Coe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Soe(u,s),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&o.push({text:Fi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&o.push({text:Fi(r),isWordLike:a,kind:i,start:l}),o}function jv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Eoe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Toe(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Eoe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Noe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Ioe(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let r=0;r<e.len;r++){if(s[r]!=="text"||!Toe(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!jv(s[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(s[a]="text",t[a]="",a++,c)break}t[r]=Fi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],s[i]=s[r],o[i]=o[r]),i++)}return t.length=i,n.length=i,s.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:s,starts:o}}function $oe(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i]),!Noe(r))continue;const l=i+1;if(l>=e.len||jv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!jv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Fi(a)),n.push(!0),s.push("text"),o.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}const Loe=new Set([":","-","/","×",",",".","+","–","—"]),Foe=/[\p{P}\p{S}\p{Co}]/u,Ooe=/\p{Emoji_Presentation}/u,Roe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function Boe(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function k5(e){const t=e.charCodeAt(0);return t<128?Boe(t):!Roe.has(e)&&!Ooe.test(e)&&Foe.test(e)}function $C(e){let t=!1;for(const n of e)if(!Hl.test(n)){if(!k5(n))return!1;t=!0}return t}function Doe(e){for(let t=e.length;t>0;){const n=Bm(e,t),s=e.slice(n,t);if(Hl.test(s)){t=n;continue}return k5(s)||Dm(s)}return!1}function Poe(e,t,n,s){const o=!t&&$C(e),i=!s&&$C(n),r=yoe(e),l=(t||r)&&Doe(e);return!o&&!i&&!l||nr(e)||nr(n)?!1:(t||o||r)&&(s||i)}function b5(e){for(const t of e)if($k.test(t))return!0;return!1}function Tp(e){if(e.length===0)return!1;for(const t of e)if(!($k.test(t)||Loe.has(t)))return!1;return!0}function Hoe(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Tp(r)&&b5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Tp(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Fi(a)),n.push(!0),s.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),s.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Woe(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&Poe(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(Fi(c)),n.push(d),s.push("text"),o.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),s.push(l),o.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function zoe(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!b5(u)||!Tp(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),s.push("text"),o.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Uoe(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Fi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),s.push("glue"),o.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Fi(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(Fi(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function qoe(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!nr(t[i])||!nr(t[i+1]))continue;const r=boe(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],o[i+1]=o[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function joe(e,t,n){const s=toe();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],b=[];for(const L of s.segment(e))for(const $ of Moe(L.segment,L.isWordLike??!1,L.index,n)){let P=function(){u[R]!==null&&(r[R]=[NC(i,u,d,R)],u[R]=null),r[R].push($.text),l[R]=l[R]||$.isWordLike,f[R]=f[R]||N,h[R]=h[R]||F,p[R]=I,m[R]=B,b[R]=IC(h[R],S)};const w=$.kind==="text",M=xoe($.text,$.isWordLike,$.kind),N=nr($.text),F=EC($.text),S=Yd($.text),I=qv($.text),B=woe($.text),R=o-1;t.carryCJKAfterClosingQuote&&w&&o>0&&a[R]==="text"&&N&&f[R]&&p[R]||w&&o>0&&a[R]==="text"&&foe($.text)&&f[R]||w&&o>0&&a[R]==="text"&&m[R]?P():w&&o>0&&a[R]==="text"&&$.isWordLike&&F&&b[R]?(P(),l[R]=!0):M!==null&&o>0&&a[R]==="text"&&u[R]===M?d[R]=(d[R]??1)+1:w&&!$.isWordLike&&o>0&&a[R]==="text"&&!f[R]&&(doe($.text)||$.text==="-"&&l[R])?P():(i[o]=$.text,r[o]=[$.text],l[o]=$.isWordLike,a[o]=$.kind,c[o]=$.start,u[o]=M,d[o]=M===null?0:1,f[o]=N,h[o]=F,p[o]=I,m[o]=B,b[o]=IC(F,S),o++)}for(let L=0;L<o;L++){if(u[L]!==null){i[L]=NC(i,u,d,L);continue}i[L]=Fi(r[L])}for(let L=1;L<o;L++)a[L]==="text"&&!l[L]&&Ok(i[L])&&a[L-1]==="text"&&!f[L-1]&&(i[L-1]+=i[L],l[L-1]=l[L-1]||l[L],i[L]="");const v=Array.from({length:o},()=>null);let g=-1;for(let L=o-1;L>=0;L--){const $=i[L];if($.length!==0){if(a[L]==="text"&&!l[L]&&g>=0&&a[g]==="text"&&(hoe($)||$==="-"&&koe(i[g]))){const w=v[g]??[];w.push($),v[g]=w,c[g]=c[L],i[L]="";continue}g=L}}for(let L=0;L<o;L++){const $=v[L];$!=null&&(i[L]=Aoe($,i[L]))}let y=0;for(let L=0;L<o;L++){const $=i[L];$.length!==0&&(y!==L&&(i[y]=$,l[y]=l[L],a[y]=a[L],c[y]=c[L]),y++)}i.length=y,l.length=y,a.length=y,c.length=y;const k=Uoe({len:y,texts:i,isWordLike:l,kinds:a,starts:c}),E=qoe(Woe(zoe(Hoe($oe(Ioe(k))))));for(let L=0;L<E.len-1;L++){const $=_oe(E.texts[L]);$!==null&&(E.kinds[L]!=="space"&&E.kinds[L]!=="preserved-space"||E.kinds[L+1]!=="text"||!EC(E.texts[L+1])||(E.texts[L]=$.space,E.isWordLike[L]=!1,E.kinds[L]=E.kinds[L]==="preserved-space"?"preserved-space":"space",E.texts[L+1]=$.marks+E.texts[L+1],E.starts[L+1]=E.starts[L]+$.space.length))}return E}function Voe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Koe(e,t,n){if(t.len<=1)return t;const s=[],o=[],i=[],r=[];let l=-1,a=!1;function c(f){s.push(t.texts[f]),o.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let v=f;v<h;v++)p=p||t.isWordLike[v];const m=t.starts[f],b=h<t.len?t.starts[h]:e.length;s.push(e.slice(m,b)),o.push(p),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!y5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||nr(h);continue}d(f),s.push(h),o.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function Goe(e,t,n="normal",s="normal"){const o=Qse(n),i=o.mode==="pre-wrap"?Jse(e):Xse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=joe(i,t,o),l=s==="keep-all"?Koe(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:Voe(l,o),...l}}let rc=null;const LC=new Map;let lc=null;const Yoe=96,Zoe=/\p{Emoji_Presentation}/u,Qoe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let dg=null;const FC=new Map;function Rk(){if(rc!==null)return rc;if(typeof OffscreenCanvas<"u")return rc=new OffscreenCanvas(1,1).getContext("2d"),rc;if(typeof document<"u")return rc=document.createElement("canvas").getContext("2d"),rc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Xoe(e){let t=LC.get(e);return t||(t=new Map,LC.set(e,t)),t}function bl(e,t){let n=t.get(e);return n===void 0&&(n={width:Rk().measureText(e).width,containsCJK:nr(e)},t.set(e,n)),n}function Pm(){if(lc!==null)return lc;if(typeof navigator>"u")return lc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},lc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),s=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return lc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},lc}function Joe(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function x5(){return dg===null&&(dg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),dg}function eie(e){return Zoe.test(e)||e.includes("️")}function tie(e){return Qoe.test(e)}function nie(e,t){let n=FC.get(e);if(n!==void 0)return n;const s=Rk();s.font=e;const o=s.measureText("😀").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),o-r>.5&&(n=o-r)}return FC.set(e,n),n}function sie(e){let t=0;const n=x5();for(const s of n.segment(e))eie(s.segment)&&t++;return t}function oie(e,t){return t.emojiCount===void 0&&(t.emojiCount=sie(e)),t.emojiCount}function ma(e,t,n){return n===0?t.width:t.width-oie(e,t)*n}function iie(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=x5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const u=[];for(const d of r){const f=bl(d,n);u.push(ma(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>Yoe){const u=[];let d=null,f=0;for(const h of r){const p=bl(h,n),m=ma(h,p,s);if(d===null)u.push(m);else{const b=d+h,v=bl(b,n);u.push(ma(b,v,s)-f)}d=h,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=bl(a,n),f=ma(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function rie(e,t){const n=Rk();n.font=e;const s=Xoe(e),o=Joe(e),i=t?nie(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function lie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function w5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function _5(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!lie(s))break;t++}return t}function aie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function cie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Bk(e,t){return t===0?0:e+t}function uie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function die(e,t,n,s,o){const i=t==="tab"?o+uie(e,n):e.lineEndFitAdvances[n];return Bk(s,i)}function OC(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return Bk(s,o)}function RC(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return Bk(s,i)}function fie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function hie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Np(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function pie(e,t,n,s,o){if(e.letterSpacing===0)return 0;if(o>0)return e.spacingGraphemeCounts[s]>0?e.letterSpacing:0;for(let i=s-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===s-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function mie(e,t,n,s,o,i){return t+pie(e,n,s,o,i)}function gie(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=Pm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,b=0,v=-1,g=0;function y(){v=-1,g=0}function k(N=m,F=b,S=d){u++,n?.(S,h,p,N,F),d=0,f=!1,y()}function E(N,F){f=!0,h=N,p=0,m=N+1,b=0,d=F}function L(N,F,S){f=!0,h=N,p=F,m=N,b=F+1,d=S}function $(N,F){if(!f){E(N,F);return}d+=F,m=N+1,b=0}function w(N,F){const S=i[N],I=r[N]??null;let B=I===null?-1:Np(I,0,F+1),R=-1,P=0,z=F;for(;z<S.length;){const W=S[z];if(!f)L(N,z,W);else if(d+W>c){if(I!==null&&R>F){k(N,R,P),z=R,B=Np(I,B,z+1),R=-1,P=0;continue}k(),L(N,z,W)}else d+=W,m=N,b=z+1;const ee=z+1;I!==null&&I[B]===ee&&(R=ee,P=d,B++),z++}f&&m===N&&b===S.length&&(m=N+1,b=0)}let M=0;for(;M<s.length&&!(!f&&(M=_5(e,M),M>=s.length));){const N=s[M],F=o[M],S=w5(F);if(!f){N>c&&i[M]!==null?w(M,0):E(M,N),S&&(v=M+1,g=d-N),M++;continue}if(d+N>c){if(S){$(M,N),k(M+1,0,d-N),M++;continue}if(v>=0){if(m>v||m===v&&b>0){k();continue}k(v,0,g);continue}if(N>c&&i[M]!==null){k(),w(M,0),M++;continue}k();continue}$(M,N),S&&(v=M+1,g=d-N),M++}return f&&k(),u}function vie(e,t,n){if(e.simpleLineWalkFastPath)return gie(e,t,n);const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(s.length===0||a.length===0)return 0;const c=Pm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,b=0,v=0,g=0,y=-1,k=0,E=0,L=null;function $(){y=-1,k=0,E=0,L=null}function w(){return L==="soft-hyphen"&&y===v&&g===0?E:h}function M(P=v,z=g,W){f++,n!==void 0&&n(mie(e,W??w(),m,b,P,z),m,b,P,z),h=0,p=!1,$()}function N(P,z){p=!0,m=P,b=0,v=P+1,g=0,h=z}function F(P,z,W){p=!0,m=P,b=z,v=P,g=z+1,h=W}function S(P,z){if(!p){N(P,z);return}h+=z,v=P+1,g=0}function I(P,z,W,ee,U,Y){if(!z)return;const ue=OC(e,P,W,U),fe=RC(e,P,W,U,ee);y=W+1,k=h-Y+ue,E=h-Y+fe,L=P}function B(P,z){const W=i[P],ee=r[P]??null;let U=ee===null?-1:Np(ee,0,z+1),Y=-1,ue=0,fe=z;for(;fe<W.length;){const oe=W[fe];if(!p)F(P,fe,oe);else{const te=fie(e,!0,oe),ae=h+te;if(hie(e,ae)>d){if(ee!==null&&Y>z){M(P,Y,ue),fe=Y,U=Np(ee,U,fe+1),Y=-1,ue=0;continue}M(),F(P,fe,oe)}else h=ae,v=P,g=fe+1}const Z=fe+1;ee!==null&&ee[U]===Z&&(Y=Z,ue=h,U++),fe++}p&&v===P&&g===W.length&&(v=P+1,g=0)}function R(P){f++,n?.(0,P.startSegmentIndex,0,P.consumedEndSegmentIndex,0),$()}for(let P=0;P<a.length;P++){const z=a[P];if(z.startSegmentIndex===z.endSegmentIndex){R(z);continue}p=!1,h=0,m=z.startSegmentIndex,b=0,v=z.startSegmentIndex,g=0,$();let W=z.startSegmentIndex;for(;W<z.endSegmentIndex&&!(!p&&(W=_5(e,W,z.endSegmentIndex),W>=z.endSegmentIndex));){const ee=o[W],U=w5(ee),Y=cie(e,p,W),ue=ee==="tab"?aie(h+Y,e.tabStopAdvance):s[W],fe=Y+ue,oe=die(e,ee,W,Y,ue);if(ee==="soft-hyphen"){p&&(v=W+1,g=0,y=W+1,k=h+l,E=h+l,L=ee),W++;continue}if(!p){oe>d&&i[W]!==null?B(W,0):N(W,ue),I(ee,U,W,ue,Y,fe),W++;continue}if(h+oe>d){const te=h+OC(e,ee,W,Y),ae=h+RC(e,ee,W,Y,ue);if(L==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){M(y,0,E);continue}if(U&&te<=d){S(W,fe),M(W+1,0,ae),W++;continue}if(y>=0&&k<=d){if(v>y||v===y&&g>0){M();continue}const He=y;M(He,0,E),W=He;continue}if(oe>d&&i[W]!==null){M(),B(W,0),W++;continue}M();continue}S(W,fe),I(ee,U,W,ue,Y,fe),W++}if(p){const ee=y===z.consumedEndSegmentIndex?E:h;M(z.consumedEndSegmentIndex,0,ee)}}return f}let fg=null;function Dk(){return fg===null&&(fg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fg}function yie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function kie(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=qv(d),l=Rm.has(d)}function u(d,f){s.push(d),i=i||f;const h=qv(d);d.length===1&&Aa.has(d)?r=r||h:r=h,l=!1}for(const d of Dk().segment(e)){const f=d.segment,h=nr(f);if(s.length===0){c(f,d.index,h);continue}if(l||Lk.has(f)||Aa.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function bie(e,t,n){if(t.length<=1)return t;const s=[];let o=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;s.push({text:e.slice(u,d),start:u})}function l(a){if(!(o<0)){if(i)o+1===a?s.push(t[o]):r(o,a);else for(let c=o;c<a;c++)s.push(t[c]);o=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];o>=0&&!y5(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||nr(c.text)}return l(t.length),s}function BC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const s=Dk();for(const o of s.segment(e))n++;return n}function xie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function wie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of Dk().segment(e))n++,xie(s.segment)&&t.push(n);return t.length===0?null:t}function _ie(e,t,n){return t>1?e+(t-1)*n:e}function Sie(e,t,n,s,o){const i=Pm(),{cache:r,emojiCorrection:l}=rie(t,tie(e.normalized)),a=ma("-",bl("-",r),l)+(o===0?0:o*2),u=ma(" ",bl(" ",r),l)*8,d=o!==0;if(e.len===0)return yie();const f=[],h=[],p=[],m=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,g=[],y=[],k=[],E=n?[]:null,L=Array.from({length:e.len});function $(F,S,I,B,R,P,z,W,ee){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(b=!1),f.push(S),h.push(I),p.push(B),m.push(R),v?.push(P),g.push(z),y.push(W),d&&k.push(ee),E!==null&&E.push(F)}function w(F,S,I,B,R){const P=bl(F,r),z=d?BC(F,S):0,W=_ie(ma(F,P,l),z,o),ee=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:W,U=ee===0?0:ee+(z>0?o:0),Y=S==="space"||S==="zero-width-break"?0:W;if(R&&B&&F.length>1){let ue="sum-graphemes";o!==0?ue="segment-prefixes":Tp(F)?ue="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ue="segment-prefixes");const fe=iie(F,P,r,l,ue),oe=fe===null||s==="keep-all"?null:wie(F);$(F,W,U,Y,S,I,fe,oe,z);return}$(F,W,U,Y,S,I,null,null,z)}for(let F=0;F<e.len;F++){L[F]=f.length;const S=e.texts[F],I=e.isWordLike[F],B=e.kinds[F],R=e.starts[F];if(B==="soft-hyphen"){$(S,0,a,a,B,R,null,null,0);continue}if(B==="hard-break"){$(S,0,0,0,B,R,null,null,0);continue}if(B==="tab"){$(S,0,0,0,B,R,null,null,d?BC(S,B):0);continue}const P=bl(S,r);if(B==="text"&&P.containsCJK){const z=kie(S,i),W=s==="keep-all"?bie(S,z,i.breakKeepAllAfterPunctuation):z;for(let ee=0;ee<W.length;ee++){const U=W[ee];w(U.text,"text",R+U.start,I,s==="keep-all"||!nr(U.text))}continue}w(S,B,R,I,!0)}const M=Cie(e.chunks,L,f.length),N=v===null?null:Gse(e.normalized,v);return E!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:b,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:y,letterSpacing:o,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:M,segments:E}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:b,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:y,letterSpacing:o,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:M}}function Cie(e,t,n){const s=[];for(let o=0;o<e.length;o++){const i=e[o],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;s.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return s}function Aie(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=Goe(e,Pm(),s?.whiteSpace,o);return Sie(r,t,n,o,i)}function Mie(e,t,n){return Aie(e,t,!0,n)}function Eie(e){let t=0;return vie(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const Tie={key:0,class:"slash-menu",role:"listbox"},Nie=["aria-selected","onMouseenter","onMousedown"],Iie={class:"slash-name"},$ie={class:"slash-desc"},Lie=Ge({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=X([]);return Ze(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),T("div",Tie,[(x(!0),T(Be,null,nt(e.items,(a,c)=>(x(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Pe(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:kt(u=>o("select",a),["prevent"])},[_("span",Iie,O(a.name),1),_("span",$ie,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Nie))),128))])):le("",!0)}}),Fie=ct(Lie,[["__scopeId","data-v-f60b70d9"]]),Oie={class:"mention-menu",role:"listbox"},Rie={key:0,class:"mention-state dim"},Bie={key:1,class:"mention-state dim"},Die=["aria-selected","onMouseenter","onMousedown"],Pie=["innerHTML"],Hie={class:"mention-name"},Wie={class:"mention-path"},zie=Ge({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),i=fc("folder","sm"),r=fc("code","sm"),l=fc("file-text","sm"),a=fc("image","sm"),c=fc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const b=p.name||m.split("/").pop()||m,v=b.lastIndexOf("."),g=v>0?b.slice(v+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(x(),T("div",Oie,[n.loading?(x(),T("div",Rie,O(C(o)("mention.searching")),1)):n.items.length===0?(x(),T("div",Bie,O(C(o)("mention.noMatch")),1)):(x(!0),T(Be,{key:2},nt(n.items,(b,v)=>(x(),T("div",{key:b.path,class:Pe(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:g=>s("hover",v),onMousedown:kt(g=>s("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,Pie),_("span",Hie,O(b.name),1),_("span",Wie,O(b.path),1)],42,Die))),128))]))}}),Uie=ct(zie,[["__scopeId","data-v-f4d6b958"]]),S5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function qie(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Ip="skill:";function jie(e){return e.startsWith(Ip)?e.slice(Ip.length):e}function C5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Ip}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...S5,...t]}function Vie(e,t=S5){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function Hm(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 A5(e){return e?.supportEfforts??[]}function Kie(e){return e[Math.floor(e.length/2)]}function Wm(e){if(Hm(e)==="unsupported")return"off";const t=A5(e);return t.length>0?e?.defaultEffort??Kie(t):"on"}function Pk(e){const t=A5(e),n=Hm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Vv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Gie(e){return e!=="off"}function Hk(e,t){return t==="off"?"off":t==="on"?Wm(e):t}function $p(e,t){return t??Wm(e)}function Yie(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function Zie(e,t,n){return!n||e===void 0?t:Wm(e)}const Lp=100;function Qie(e){const t=fm(Ft.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const s=n.length>Lp?n.slice(-Lp):n,o={[e]:s};return zd(Ft.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function Xie(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=X(Qie(o())),r=D(()=>i.value[o()??""]??[]);let l=-1,a="";function c(v){const g=o();if(l=-1,!g)return;const y=v.trim();if(!y)return;const k=i.value[g]??[];if(k.at(-1)===y)return;const E=[...k,y],L=E.length>Lp?E.slice(-Lp):E;i.value={...i.value,[g]:L},zd(Ft.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,pt(()=>{const g=n.value;if(!g)return;s();const y=v.length;g.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l<v.length-1?(l+=1,d(v[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function b(){return r.value.length>0}return Ze(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:b}}function Jie(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=X(!1),c=X([]),u=X(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=Vie(h,C5(o())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,pt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),s()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function ere(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=X(!1),r=X([]),l=X(0),a=X(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const b=h.slice(m,p);return b.startsWith("@")?{token:b.slice(1),start:m,end:p}:null}function d(){const h=u(),p=o();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,pt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function tre(e){const{sessionId:t}=e;function n(c){return us(Yx(c))??""}function s(c,u){const d=Yx(c);u?ms(d,u):Kc(d)}const o=X(n(t())),i=X(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ze(o,c=>{pt(r),s(t(),c)}),Ze(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),pt(r))});function l(c){o.value=c,pt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){s(t(),"")}return{text:o,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function nre(e){const{uploadImage:t,sessionId:n}=e,s=X({}),o=D(()=>s.value[n()??""]??[]),i=X(null),r=X(null),l=X(!1);let a=0;function c(){return`att_${++a}`}function u(F,S){s.value={...s.value,[F]:S}}function d(F){try{URL.revokeObjectURL(F.previewUrl)}catch{}}function f(F){return F.startsWith("image/")?"image":F.startsWith("video/")?"video":null}async function h(F){const S=t();if(!S)return;const I=n()??"",B=F.map(R=>({file:R,kind:f(R.type)})).filter(R=>R.kind!==null);if(B.length!==0)for(const{file:R,kind:P}of B){const z=c(),W=URL.createObjectURL(R),ee={localId:z,name:R.name,kind:P,previewUrl:W,uploading:!0};u(I,[...s.value[I]??[],ee]),S(R,R.name).then(U=>{const Y=s.value[I]??[];u(I,Y.map(ue=>ue.localId===z?{...ue,uploading:!1,fileId:U?.fileId,error:U===null}:ue))}).catch(()=>{const U=s.value[I]??[];u(I,U.map(Y=>Y.localId===z?{...Y,uploading:!1,error:!0}:Y))})}}function p(F){const S=n()??"",I=s.value[S]??[],B=I.find(R=>R.localId===F);i.value?.localId===F&&(i.value=null),B&&d(B),u(S,I.filter(R=>R.localId!==F))}function m(F){i.value=F}function b(){i.value=null}function v(){r.value?.click()}function g(F){const S=F.target,I=Array.from(S.files??[]);h(I),S.value=""}function y(F){if(!t())return;const S=F.clipboardData;if(!S)return;const I=[],B=new Set,R=(P,z)=>{const W=`${P.size}:${P.type}:${z}`;if(B.has(W))return;B.add(W);const ee=P.type.split("/")[1]??"png",U=z.includes(".")?z:`paste-${Date.now()}.${ee}`;I.push(P instanceof File?P:new File([P],U,{type:P.type}))};for(const P of Array.from(S.items))if(P.kind==="file"&&f(P.type)){const z=P.getAsFile();z&&R(z,z.name||`paste-${Date.now()}.${P.type.split("/")[1]??"png"}`)}for(const P of Array.from(S.files))f(P.type)&&R(P,P.name);I.length!==0&&(F.preventDefault(),h(I))}function k(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(I=>I.kind==="file")||(F.preventDefault(),l.value=!0)}function E(){l.value=!1}function L(F){if(l.value=!1,!t())return;F.preventDefault();const S=Array.from(F.dataTransfer?.files??[]);h(S)}function $(){const F=n()??"";for(const S of s.value[F]??[])d(S);u(F,[])}function w(F,S,I){const B=s.value[F]??[];B.some(R=>R.localId===S)&&u(F,B.map(R=>R.localId===S?{...R,...I}:R))}function M(F){return fetch(F).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function N(F){const S=n()??"";for(const I of s.value[S]??[])d(I);u(S,[]);for(const I of F){const B=c(),R=/^data:/i.test(I.url),P=/^blob:/i.test(I.url),z=I.name??I.kind;if(I.fileId){const W={localId:B,name:z,kind:I.kind,previewUrl:I.url,uploading:!1,fileId:I.fileId};u(S,[...s.value[S]??[],W]),!R&&!P&&ut().getFileBlob(I.fileId).then(ee=>{const U=URL.createObjectURL(ee);if(!(s.value[S]??[]).some(ue=>ue.localId===B)){URL.revokeObjectURL(U);return}w(S,B,{previewUrl:U})}).catch(()=>{})}else{const W=t();if(!W)continue;const ee={localId:B,name:z,kind:I.kind,previewUrl:I.url,uploading:!0};u(S,[...s.value[S]??[],ee]),M(I.url).then(U=>{const Y=z.includes(".")?z:`${z}.${U.type.split("/")[1]??"bin"}`;return W(U,Y)}).then(U=>{if(U===null){const Y=s.value[S]??[];u(S,Y.filter(ue=>ue.localId!==B));return}w(S,B,{uploading:!1,fileId:U.fileId})}).catch(()=>{const U=s.value[S]??[];u(S,U.filter(Y=>Y.localId!==B))})}}}return Ze(n,()=>{i.value=null}),fn(()=>{document.addEventListener("paste",y)}),xn(()=>{document.removeEventListener("paste",y);for(const F of Object.values(s.value))for(const S of F)d(S);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:g,handleDragOver:k,handleDragLeave:E,handleDrop:L,clearAfterSubmit:$,loadAttachments:N}}const sre=["type","disabled"],ore={class:"ui-button__content"},ire=Ge({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),T("button",{class:Pe(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),xe(zo,{key:0,size:"sm",class:"ui-button__spinner"})):le("",!0),_("span",ore,[Rn(t.$slots,"default",{},void 0,!0)])],10,sre))}}),Rt=ct(ire,[["__scopeId","data-v-e58393a8"]]),rre={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},lre=["stroke-dasharray","stroke-dashoffset"],hg=7,are=Ge({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*hg;return(s,o)=>(x(),T("svg",rre,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:hg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:hg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,lre)]))}}),cre=ct(are,[["__scopeId","data-v-a364f1f1"]]),ure={key:0,class:"att-strip"},dre=["onClick"],fre=["src"],hre=["src","alt"],pre={key:2,class:"att-video-badge","aria-hidden":"true"},mre={class:"att-name"},gre={class:"att-err-icon"},vre=["onClick"],yre={class:"att-lightbox-card"},kre=["src"],bre=["src","alt"],xre={class:"att-lightbox-name"},wre={class:"composer-card"},_re={class:"cin-wrap"},Sre={class:"input-row"},Cre=["placeholder","disabled"],Are=["aria-label"],Mre={class:"toolbar-left"},Ere=["onKeydown"],Tre=["onClick"],Nre={class:"pd-check"},Ire={class:"pd-info"},$re={class:"pd-desc"},Lre={class:"mode-label"},Fre={key:0,class:"mode-tag"},Ore={key:1,class:"mode-tag"},Rre={key:2,class:"mode-tag"},Bre={class:"mode-row-icon"},Dre={class:"mode-row-info"},Pre={class:"mode-row-name"},Hre={class:"mode-row-desc"},Wre={class:"mode-row-icon"},zre={class:"mode-row-info"},Ure={class:"mode-row-name"},qre={class:"mode-row-desc"},jre={class:"mode-row-icon"},Vre={class:"mode-row-info"},Kre={class:"mode-row-name"},Gre={class:"mode-row-desc"},Yre={key:0,class:"mode-row-actions"},Zre={class:"toolbar-right"},Qre=["aria-label"],Xre={class:"ctx-num"},Jre=["onKeydown"],ele={key:0,class:"think-suffix"},tle=["aria-label"],nle=["aria-label","disabled"],sle={key:0,class:"md-section"},ole=["onClick"],ile={class:"md-check"},rle={class:"md-name"},lle={class:"md-provider"},ale={key:1,class:"md-divider"},cle={key:2,class:"md-section"},ule=["onClick"],dle={class:"md-check"},fle={class:"md-name"},hle={key:3,class:"md-divider"},ple={class:"md-name"},mle={key:0,class:"md-note"},gle=["aria-label"],vle=["disabled","onClick"],yle={class:"md-name"},DC=36,kle=Ge({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=D(()=>s.starting?r("composer.starting"):s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Mt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=tre({sessionId:()=>s.sessionId}),h=X(!1);function p(){h.value=!h.value,pt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,pt(u))}function b(Q){if(typeof getComputedStyle>"u")return DC;const me=Number.parseFloat(getComputedStyle(Q).minHeight);return Number.isFinite(me)&&me>0?me:DC}const v=X(!1);function g(){const Q=c.value;v.value=!!Q&&Q.scrollHeight>b(Q)}Ze(a,()=>{pt(g)}),Ze(()=>s.sessionId,()=>{h.value=!1});const y=Xie({text:a,textareaRef:c,autosize:u,sessionId:()=>s.sessionId}),{open:k,items:E,active:L,update:$,select:w}=Jie({text:a,textareaRef:c,autosize:u,skills:()=>s.skills,emitCommand:Q=>i("command",Q),historyPush:Q=>y.push(Q),clearDraft:f}),{open:M,items:N,active:F,loading:S,update:I,select:B}=ere({text:a,textareaRef:c,autosize:u,searchFiles:()=>s.searchFiles});function R(){y.resetBrowsing(),$(),I()}const{attachments:P,previewAttachment:z,fileInputRef:W,isDragOver:ee,removeAttachment:U,openAttachmentPreview:Y,closeAttachmentPreview:ue,openFilePicker:fe,handleFileInputChange:oe,handleDragOver:Z,handleDragLeave:te,handleDrop:ae,clearAfterSubmit:He,loadAttachments:he}=nre({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});fn(()=>{a.value&&pt(()=>{u(),g()})}),xn(()=>{document.removeEventListener("mousedown",sn),de()});function K(){c.value?.focus({preventScroll:!0})}function ce(Q){he(Q)}t({loadForEdit:d,loadAttachmentsForEdit:ce,focus:K});function ge(){const Q=a.value.trim();if(P.value.some(It=>It.uploading))return;const me=P.value.filter(It=>!It.uploading&&!It.error&&It.fileId);if(!Q&&me.length===0)return;if(y.push(Q),Q){const It=qie(Q),lo=It?C5(s.skills).some(be=>be.name===It.cmd||be.name===`/${Ip}${It.cmd.slice(1)}`):!1;if(It&&lo){a.value="",f(),k.value=!1,m(),i("command",It.arg?`${It.cmd} ${It.arg}`:It.cmd);return}}const Je={text:Q,attachments:me.map(It=>({fileId:It.fileId,kind:It.kind}))};z.value=null,He(),a.value="",f(),k.value=!1,M.value=!1,m(),i("submit",Je)}function q(){if(!s.running||P.value.some(It=>It.uploading))return;const Q=a.value.trim(),me=P.value.filter(It=>!It.uploading&&!It.error&&It.fileId);if(!Q&&me.length===0&&s.queued.length===0)return;const Je={text:Q,attachments:me.map(It=>({fileId:It.fileId,kind:It.kind}))};He(),y.push(Q),a.value="",f(),k.value=!1,M.value=!1,m(),i("steer",Je)}let se=!1,ye=null;function de(){ye!==null&&(clearTimeout(ye),ye=null)}function ke(){de(),se=!0}function j(){de(),ye=setTimeout(()=>{ye=null,se=!1},0)}function ne(Q){return se||Q.isComposing||Q.keyCode===229}function ve(Q){if(!ne(Q)){if(Q.key==="Escape"){if(Oe.value){Q.preventDefault(),it();return}if(pe.value){Q.preventDefault(),bt();return}}if(k.value){if(Q.key==="ArrowDown"){Q.preventDefault(),L.value=(L.value+1)%E.value.length;return}if(Q.key==="ArrowUp"){Q.preventDefault(),L.value=(L.value-1+E.value.length)%E.value.length;return}if(Q.key==="Enter"||Q.key==="Tab"){Q.preventDefault();const me=E.value[L.value];me&&w(me);return}if(Q.key==="Escape"){Q.preventDefault(),k.value=!1;return}}if(M.value&&!S.value){if(Q.key==="ArrowDown"){Q.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(Q.key==="ArrowUp"){Q.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(Q.key==="Enter"||Q.key==="Tab"){Q.preventDefault();const me=N.value[F.value];me&&B(me);return}if(Q.key==="Escape"){Q.preventDefault(),M.value=!1;return}}if(Q.key==="s"&&(Q.ctrlKey||Q.metaKey)&&!Q.shiftKey&&!Q.altKey){s.running&&(Q.preventDefault(),q());return}if(!h.value&&!k.value&&!M.value&&!Q.shiftKey&&!Q.altKey&&!Q.metaKey&&!Q.ctrlKey){const me=y.isBrowsing();if(Q.key==="ArrowUp"&&y.hasHistory()&&(me||y.caretAtTextStart())){Q.preventDefault(),y.recallOlder();return}if(Q.key==="ArrowDown"&&me){Q.preventDefault(),y.recallNewer();return}}if(Q.key==="Enter"&&!Q.shiftKey){if(h.value&&!(Q.metaKey||Q.ctrlKey))return;Q.preventDefault(),ge()}}}const Ae=D(()=>r("composer.send")),$e=D(()=>!!s.uploadImage),Oe=X(!1),pe=X(!1),Ie=X(null);function Xe(){Oe.value=!Oe.value,Oe.value?(pe.value=!1,Ht(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function it(){Oe.value=!1,pe.value||document.removeEventListener("click",wt,!0)}function At(){pe.value=!pe.value,pe.value?(Oe.value=!1,Ht(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function bt(){pe.value=!1,Oe.value||document.removeEventListener("click",wt,!0)}function wt(Q){Ie.value&&!Ie.value.contains(Q.target)&&(it(),bt())}xn(()=>{document.removeEventListener("click",wt,!0)});const qt=Q=>`${Math.round(Q/1e3)}k`,yt=D(()=>{const Q=s.status?.ctxMax??0;return Q<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Q*100)))}),Kt=D(()=>{const Q=(s.status?.ctxUsed??0).toLocaleString(),me=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Q,max:me,pct:yt.value})}),gs=D(()=>yt.value>=80),En=D(()=>s.models?.find(Q=>Q.id===s.status?.modelId)),Jt=D(()=>Hm(En.value)),wn=D(()=>Pk(En.value)),vs=D(()=>$p(En.value,s.thinking)),st=D(()=>wn.value.includes(vs.value)?vs.value:""),Bn=D(()=>Gie(vs.value)),Es=D(()=>Jt.value==="unsupported"||wn.value.length<=1),Dn=D(()=>{if(!Bn.value)return"";const Q=(En.value?.supportEfforts?.length??0)>0,me=vs.value;return Q&&me!=="on"?r("composer.thinkingSuffixEffort",{level:me}):r("composer.thinkingSuffix")});function Hs(Q){Es.value||i("setThinking",Hk(En.value,Q))}function Ws(Q){return Q==="on"?r("status.thinkingOn"):Q==="off"?r("status.thinkingOff"):Vv(Q)}const Qn=D(()=>s.planMode===!0),Tn=D(()=>s.swarmMode===!0),yn=D(()=>s.goal?.status??s.activationBadges?.goal?.status??null),jn=D(()=>yn.value!==null&&yn.value!=="complete"),ds=D(()=>jn.value||s.goalMode===!0),Gn=D(()=>yn.value==="active"),Nn=D(()=>yn.value==="paused"||yn.value==="blocked"),Pn=X(!1),Pt=X(null),Ye=X(null),qe=X({}),Lt=D(()=>Qn.value||Tn.value||ds.value);function Ht(){Pn.value=!1,document.removeEventListener("mousedown",sn)}function sn(Q){const me=Q.target;Pt.value?.contains(me)||Ye.value?.contains(me)||Ht()}function Zt(){if(Pn.value){Ht();return}it(),bt();const Q=Pt.value?.getBoundingClientRect();Q&&(qe.value={left:`${Math.round(Q.left)}px`,bottom:`${Math.round(window.innerHeight-Q.top+8)}px`}),Pn.value=!0,setTimeout(()=>document.addEventListener("mousedown",sn),0)}const _n=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],on=["status.planDesc","status.swarmDesc","status.goalDesc"],Et=X(null),ns=X(""),ss=X("");function io(Q){const me={};return Q&&(me["--composer-menu-desc-width"]=Q),me}const Hn=D(()=>io(ns.value)),os=D(()=>io(ss.value)),oi=D(()=>({...qe.value,...os.value}));let Ls=null;function ii(Q){const me=Number.parseFloat(Q);return Number.isFinite(me)?me:0}function Co(Q){return`${Q.fontStyle||"normal"} ${Q.fontWeight||"400"} ${Q.fontSize} ${Q.fontFamily}`}function Di(Q){return Q.letterSpacing==="normal"?0:ii(Q.letterSpacing)}function ri(Q,me){if(!Q)return 0;const Je=Mie(Q,Co(me),{letterSpacing:Di(me)});return Eie(Je)}function ys(){const Q=Et.value?.querySelector(".pd-desc");if(!Q)return;const me=getComputedStyle(Q),Je=Math.max(0,..._n.map(lo=>ri(r(lo.descKey),me))),It=Math.max(0,...on.map(lo=>ri(r(lo),me)));ns.value=Je>0?`${Math.ceil(Je)}px`:"",ss.value=It>0?`${Math.ceil(It)}px`:""}function Ao(){typeof window>"u"||(Ls!==null&&window.cancelAnimationFrame(Ls),pt(()=>{Ls=window.requestAnimationFrame(()=>{Ls=null,ys()})}))}Ze(l,Ao,{immediate:!0}),fn(()=>{Ao(),document.fonts?.ready.then(Ao)}),xn(()=>{Ls!==null&&(window.cancelAnimationFrame(Ls),Ls=null)});function or(Q){i("setPermission",Q),bt()}const Pi=D(()=>_n.find(Q=>Q.mode===s.status?.permission)),fs=D(()=>Pi.value?r(Pi.value.labelKey):""),Fs=D(()=>En.value?.provider??""),ro=D(()=>!Fs.value||!s.models?.length?[]:s.models.filter(Q=>Q.provider===Fs.value)),Os=D(()=>new Set(s.starredIds??[]));function Mo(Q){return Os.value.has(Q)}const Vn=D(()=>s.models?.length?s.models.filter(Q=>Mo(Q.id)&&Q.provider!==Fs.value):[]);function lt(Q){i("selectModel",Q),it()}return(Q,me)=>(x(),T("div",{class:Pe(["composer",{"drag-over":C(ee),expanded:h.value}]),onDragover:me[18]||(me[18]=(...Je)=>C(Z)&&C(Z)(...Je)),onDragleave:me[19]||(me[19]=(...Je)=>C(te)&&C(te)(...Je)),onDrop:me[20]||(me[20]=(...Je)=>C(ae)&&C(ae)(...Je))},[C(P).length>0?(x(),T("div",ure,[(x(!0),T(Be,null,nt(C(P),Je=>(x(),T("div",{key:Je.localId,class:Pe(["att-chip",{"att-error":Je.error}])},[re(Yt,{text:C(r)("composer.previewAttachment",{name:Je.name})},{default:Ee(()=>[_("button",{type:"button",class:"att-preview",onClick:It=>C(Y)(Je)},[Je.kind==="video"?(x(),T("video",{key:0,class:"att-thumb",src:Je.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,fre)):(x(),T("img",{key:1,class:"att-thumb",src:Je.previewUrl,alt:Je.name},null,8,hre)),Je.kind==="video"?(x(),T("span",pre,[re(je,{name:"play",size:"sm"})])):le("",!0)],8,dre)]),_:2},1032,["text"]),_("span",mre,O(Je.name),1),Je.uploading?(x(),xe(zo,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):Je.error?(x(),xe(Yt,{key:1,text:C(r)("composer.uploadFailed")},{default:Ee(()=>[_("span",gre,[re(je,{name:"info",size:"sm"})])]),_:1},8,["text"])):le("",!0),re(Yt,{text:C(r)("composer.removeNamed",{name:Je.name})},{default:Ee(()=>[_("button",{class:"att-rm",onClick:It=>C(U)(Je.localId)},[re(je,{name:"close",size:"sm"})],8,vre)]),_:2},1032,["text"])],2))),128))])):le("",!0),C(z)?(x(),T("div",{key:1,class:"att-lightbox",onClick:me[1]||(me[1]=kt((...Je)=>C(ue)&&C(ue)(...Je),["self"]))},[_("div",yre,[re(Yt,{text:C(r)("model.close")},{default:Ee(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:me[0]||(me[0]=(...Je)=>C(ue)&&C(ue)(...Je))},"✕")]),_:1},8,["text"]),C(z).kind==="video"?(x(),T("video",{key:0,class:"att-lightbox-media",src:C(z).previewUrl,controls:"",playsinline:""},null,8,kre)):(x(),T("img",{key:1,class:"att-lightbox-media",src:C(z).previewUrl,alt:C(z).name},null,8,bre)),_("div",xre,O(C(z).name),1)])])):le("",!0),_("div",wre,[_("div",_re,[C(k)?(x(),xe(Fie,{key:0,items:C(E),"active-index":C(L),onSelect:C(w),onHover:me[2]||(me[2]=Je=>L.value=Je)},null,8,["items","active-index","onSelect"])):le("",!0),C(M)?(x(),xe(Uie,{key:1,items:C(N),"active-index":C(F),loading:C(S),onSelect:C(B),onHover:me[3]||(me[3]=Je=>F.value=Je)},null,8,["items","active-index","loading","onSelect"])):le("",!0),_("div",Sre,[On(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":me[4]||(me[4]=Je=>hs(a)?a.value=Je:null),class:"ph",placeholder:o.value,disabled:e.starting,rows:"1",onKeydown:ve,onCompositionstart:ke,onCompositionend:j,onInput:R},null,40,Cre),[[So,C(a)]]),h.value||v.value?(x(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(x(),xe(je,{key:0,name:"collapse",size:"sm"})):(x(),xe(je,{key:1,name:"expand",size:"sm"}))],8,Are)):le("",!0)])]),$e.value?(x(),T("input",{key:0,ref_key:"fileInputRef",ref:W,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:me[5]||(me[5]=(...Je)=>C(oe)&&C(oe)(...Je))},null,544)):le("",!0),_("div",{ref_key:"toolbarRef",ref:Ie,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Et,class:"menu-measure","aria-hidden":"true"},[...me[21]||(me[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Mre,[$e.value?(x(),xe(qn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(fe)},{default:Ee(()=>[re(je,{name:"image"})]),_:1},8,["label","onClick"])):le("",!0),e.status?(x(),T("span",{key:1,class:Pe(["perm-pill",["perm-"+e.status.permission,{open:pe.value}]]),role:"button",tabindex:"0",onClick:kt(At,["stop"]),onKeydown:[Xi(At,["enter"]),Xi(kt(At,["prevent"]),["space"])]},O(fs.value),43,Ere)):le("",!0),pe.value&&e.status?(x(),T("div",{key:2,class:"perm-dropdown",style:Gt(Hn.value),role:"menu",onClick:me[6]||(me[6]=kt(()=>{},["stop"]))},[(x(),T(Be,null,nt(_n,Je=>_("button",{key:Je.mode,class:Pe(["pd-row",{"is-current":Je.mode===e.status.permission}]),role:"menuitem",onClick:It=>or(Je.mode)},[_("span",Nre,[Je.mode===e.status.permission?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",Ire,[_("span",{class:"pd-name",style:Gt({color:Je.color})},O(C(r)(Je.labelKey)),5),_("span",$re,O(C(r)(Je.descKey)),1)])],10,Tre)),64))],4)):le("",!0),e.status?(x(),T("div",{key:3,ref_key:"modesRef",ref:Pt,class:"modes"},[_("button",{type:"button",class:Pe(["mode-pill",{on:Lt.value,open:Pn.value}]),onClick:kt(Zt,["stop"])},[_("span",Lre,O(C(r)("status.modesLabel")),1),Qn.value?(x(),T("span",Fre,O(C(r)("status.planLabel")),1)):le("",!0),Tn.value?(x(),T("span",Ore,O(C(r)("status.swarmLabel")),1)):le("",!0),ds.value?(x(),T("span",Rre,O(C(r)("status.goalLabel")),1)):le("",!0)],2),Pn.value?(x(),T("div",{key:0,ref_key:"modesMenuRef",ref:Ye,class:"modes-menu",style:Gt(oi.value),role:"menu"},[_("button",{type:"button",class:Pe(["mode-row",{on:Qn.value}]),role:"menuitem",onClick:me[7]||(me[7]=Je=>i("togglePlan"))},[_("span",Bre,[re(je,{name:"file-edit",size:"sm"})]),_("span",Dre,[_("span",Pre,O(C(r)("status.planLabel")),1),_("span",Hre,O(C(r)("status.planDesc")),1)]),_("span",{class:Pe(["mode-switch",{on:Qn.value}])},[...me[22]||(me[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:Pe(["mode-row",{on:Tn.value}]),role:"menuitem",onClick:me[8]||(me[8]=Je=>i("toggleSwarm"))},[_("span",Wre,[re(je,{name:"sparkles",size:"sm"})]),_("span",zre,[_("span",Ure,O(C(r)("status.swarmLabel")),1),_("span",qre,O(C(r)("status.swarmDesc")),1)]),_("span",{class:Pe(["mode-switch",{on:Tn.value}])},[...me[23]||(me[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:Pe(["mode-row mode-row-goal",{on:jn.value||s.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:me[9]||(me[9]=Je=>jn.value?i("focusGoal"):i("toggleGoal"))},[_("span",jre,[re(je,{name:"target",size:"sm"})]),_("span",Vre,[_("span",Kre,O(C(r)("status.goalLabel")),1),_("span",Gre,O(C(r)("status.goalDesc")),1)]),jn.value?le("",!0):(x(),T("span",{key:0,class:Pe(["mode-switch",{on:s.goalMode}])},[...me[24]||(me[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),jn.value?(x(),T("div",Yre,[Gn.value?(x(),xe(Rt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:me[10]||(me[10]=Je=>i("controlGoal","pause"))},{default:Ee(()=>[re(je,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):le("",!0),Nn.value?(x(),xe(Rt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:me[11]||(me[11]=Je=>i("controlGoal","resume"))},{default:Ee(()=>[re(je,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):le("",!0),re(Rt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:me[12]||(me[12]=Je=>i("controlGoal","cancel"))},{default:Ee(()=>[re(je,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):le("",!0)],2)],4)):le("",!0)],512)):le("",!0)]),_("div",Zre,[gs.value?(x(),T("button",{key:0,class:"compact-chip",onClick:me[13]||(me[13]=kt(Je=>i("compact"),["stop"]))},"/compact")):le("",!0),re(Yt,{text:Kt.value},{default:Ee(()=>[e.status&&!e.hideContext?(x(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":Kt.value},[re(cre,{pct:yt.value},null,8,["pct"]),_("span",Xre,O(qt(e.status.ctxUsed))+"/"+O(qt(e.status.ctxMax)),1)],8,Qre)):le("",!0)]),_:1},8,["text"]),e.status?(x(),T("span",{key:1,class:Pe(["model-pill",{open:Oe.value}]),role:"button",tabindex:"0",onClick:kt(Xe,["stop"]),onKeydown:[Xi(Xe,["enter"]),Xi(kt(Xe,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),Dn.value?(x(),T("span",ele,O(Dn.value),1)):le("",!0),re(je,{class:"cv",name:"chevron-down",size:"sm"})],42,Jre)):le("",!0),e.running?(x(),xe(Yt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:me[14]||(me[14]=Je=>i("interrupt"))},[re(je,{name:"stop",size:"sm"})],8,tle)]),_:1},8,["text"])):le("",!0),_("button",{class:Pe(["send",{"is-starting":e.starting}]),"aria-label":Ae.value,disabled:e.starting,onClick:me[15]||(me[15]=Je=>ge())},[e.starting?(x(),xe(zo,{key:0,size:"sm"})):(x(),xe(je,{key:1,name:"send",size:"sm"}))],10,nle)]),Oe.value&&e.status?(x(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:me[17]||(me[17]=kt(()=>{},["stop"]))},[Vn.value.length>0?(x(),T("div",sle,O(C(r)("status.starredModels")),1)):le("",!0),(x(!0),T(Be,null,nt(Vn.value,Je=>(x(),T("button",{key:Je.id,class:Pe(["md-row",{"is-current":Je.id===e.status.modelId}]),role:"menuitem",onClick:It=>lt(Je.id)},[_("span",ile,[Je.id===e.status.modelId?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",rle,O(Je.displayName??Je.model),1),_("span",lle,O(Je.provider),1),re(je,{class:"md-star",name:"star",size:"sm"})],10,ole))),128)),Vn.value.length>0?(x(),T("div",ale)):le("",!0),ro.value.length>0?(x(),T("div",cle,O(Fs.value),1)):le("",!0),(x(!0),T(Be,null,nt(ro.value,Je=>(x(),T("button",{key:Je.id,class:Pe(["md-row",{"is-current":Je.id===e.status.modelId}]),role:"menuitem",onClick:It=>lt(Je.id)},[_("span",dle,[Je.id===e.status.modelId?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",fle,O(Je.displayName??Je.model),1),Mo(Je.id)?(x(),xe(je,{key:0,class:"md-star",name:"star",size:"sm"})):le("",!0)],10,ule))),128)),ro.value.length>0?(x(),T("div",hle)):le("",!0),_("div",{class:Pe(["md-thinking",{"is-readonly":Es.value}])},[_("span",ple,O(C(r)("status.thinkingLabel")),1),Jt.value==="unsupported"?(x(),T("span",mle,O(C(r)("status.modeNotSupported")),1)):(x(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(x(!0),T(Be,null,nt(wn.value,Je=>(x(),T("button",{key:Je,type:"button",class:Pe(["effort-seg",{"is-active":Je===st.value}]),disabled:Es.value,onClick:It=>Hs(Je)},O(Ws(Je)),11,vle))),128))],8,gle))],2),me[25]||(me[25]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:me[16]||(me[16]=Je=>{it(),i("pickModel")})},[_("span",yle,O(C(r)("status.moreModels")),1)])])):le("",!0)],512)])],34))}}),M5=ct(kle,[["__scopeId","data-v-0e0bb58b"]]),ble={key:0,class:"ui-card__head"},xle={class:"ui-card__body"},wle={key:1,class:"ui-card__foot"},_le=Ge({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),T("div",{class:Pe(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),T("div",ble,[Rn(t.$slots,"head",{},void 0,!0)])):le("",!0),_("div",xle,[Rn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),T("div",wle,[Rn(t.$slots,"foot",{},void 0,!0)])):le("",!0)],2))}}),Wk=ct(_le,[["__scopeId","data-v-9c9f9a9a"]]),Sle={class:"goal-kicker"},Cle={key:0,class:"goal-progress","aria-hidden":"true"},Ale={class:"goal-full"},Mle={key:0,class:"goal-criterion"},Ele=["inert","aria-hidden"],Tle={class:"goal-meta"},Nle={key:0},Ile={class:"goal-actions"},$le=Ge({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),{confirm:i}=zr(),r=X(!1);Ze(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=D(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return o("status.goalStatusActive");case"paused":return o("status.goalStatusPaused");case"blocked":return o("status.goalStatusBlocked");case"complete":return o("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:o("status.goalCancel"),message:o("status.goalCancelConfirm"),confirmLabel:o("status.goalCancelConfirmYes"),cancelLabel:o("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}return(d,f)=>(x(),xe(Wk,{class:Pe(["goal-strip",{expanded:r.value}])},{head:Ee(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[re(je,{class:"goal-icon",name:"target",size:"md"}),_("span",Sle,O(C(o)("status.goalLabel")),1),_("span",{class:Pe(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),re(Ro,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Qe(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(x(),T("span",Cle,[_("span",{class:"goal-progress-fill",style:Gt({width:`${l.value}%`})},null,4)])):le("",!0),re(je,{class:Pe(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ee(()=>[_("div",Ale,O(e.goal.objective),1),e.goal.completionCriterion?(x(),T("div",Mle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):le("",!0)]),foot:Ee(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",Tle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),T("span",Nle,O(l.value)+"% token budget",1)):le("",!0)]),_("div",Ile,[e.goal.status==="active"?(x(),xe(Rt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=kt(h=>s("controlGoal","pause"),["stop"]))},{default:Ee(()=>[re(je,{name:"pause",size:"md"}),_("span",null,O(C(o)("status.goalPause")),1)]),_:1})):le("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(x(),xe(Rt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=kt(h=>s("controlGoal","resume"),["stop"]))},{default:Ee(()=>[re(je,{name:"play",size:"md"}),_("span",null,O(C(o)("status.goalResume")),1)]),_:1})):le("",!0),re(Rt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:kt(u,["stop"])},{default:Ee(()=>[re(je,{name:"close",size:"md"}),_("span",null,O(C(o)("status.goalCancel")),1)]),_:1})])],8,Ele)]),_:1},8,["class"]))}}),Lle=ct($le,[["__scopeId","data-v-353c73e2"]]),Fle={class:"qh"},Ole={class:"qtitle"},Rle={key:0,class:"qstep"},Ble={key:1,class:"qmin-peek"},Dle={class:"qbody"},Ple=["aria-label"],Hle=["aria-selected","aria-label","onClick"],Wle={class:"qstep-num"},zle={key:1,class:"qheader-chip"},Ule={class:"qtext"},qle={class:"qopts"},jle=["onClick"],Vle={class:"qopt-key"},Kle={class:"qopt-glyph"},Gle={key:0,class:"chk"},Yle={key:1,class:"rad"},Zle={class:"qopt-text"},Qle={class:"qopt-label"},Xle={key:0,class:"qopt-desc"},Jle={class:"qopt-glyph"},eae={key:0,class:"chk"},tae={key:1,class:"rad"},nae={class:"qopt-label"},sae=["placeholder"],oae={class:"qfoot"},iae=Ge({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Mt(),o=t,i=X(0),r=X(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>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 z=p.value[P];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=X({});function m(P){return P.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${P.label} ${P.description??""}`.toLowerCase())}function b(){const P={...p.value};let z=!1;for(const W of n.question.questions){if(P[W.id])continue;const ee=W.options.filter(m);ee.length!==0&&(P[W.id]=W.multiSelect?{kind:"multi",optionIds:ee.map(U=>U.id)}:{kind:"single",optionId:ee[0].id},z=!0)}z&&(p.value=P)}Ze(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Ze(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(P,z){const W=p.value[P];if(W&&W.kind==="single"&&W.optionId===z){const ee={...p.value};delete ee[P],p.value=ee}else p.value={...p.value,[P]:{kind:"single",optionId:z}}}function g(P,z){const W=p.value[P],ee=W&&(W.kind==="multi"||W.kind==="multiWithOther")?W.kind==="multi"?[...W.optionIds]:[...W.optionIds]:[],U=ee.indexOf(z);U>=0?ee.splice(U,1):ee.push(z);const Y=p.value[P],ue=Y&&Y.kind==="multiWithOther"?Y.otherText:"";ue?p.value={...p.value,[P]:{kind:"multiWithOther",optionIds:ee,otherText:ue}}:p.value={...p.value,[P]:{kind:"multi",optionIds:ee}}}const y=X({}),k=X(null);function E(P){const z=n.question.questions.find(ee=>ee.id===P),W=y.value[P]??"";if(z.multiSelect){const ee=p.value[P],U=ee&&(ee.kind==="multi"||ee.kind==="multiWithOther")?ee.kind==="multi"?[...ee.optionIds]:[...ee.optionIds]:[];p.value={...p.value,[P]:{kind:"multiWithOther",optionIds:U,otherText:W}}}else p.value={...p.value,[P]:{kind:"other",text:W}}}function L(P){E(P),pt(()=>k.value?.focus())}function $(P,z){const W=p.value[P];return W?W.kind==="single"?W.optionId===z:W.kind==="multi"||W.kind==="multiWithOther"?W.optionIds.includes(z):!1:!1}function w(P){const z=p.value[P];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function M(){return n.question.questions.every(P=>f(P.id))}const N=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function I(){if(S.value||!M())return;const P={answers:p.value,method:"click"};o("answer",n.question.questionId,P)}function B(){S.value||o("dismiss",n.question.questionId)}function R(P){const z=(document.activeElement?.tagName??"").toLowerCase(),W=z==="input"||z==="textarea";if(S.value)return;if(P.key==="Enter"){if(P.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():M()&&I();return}if(W)return;if(P.key==="Escape"){P.preventDefault(),B();return}if(r.value)return;const ee=parseInt(P.key,10);if(!isNaN(ee)&&ee>=1&&ee<=9){P.preventDefault();const U=l.value,Y=ee-1,ue=U.options[Y];ue&&(U.multiSelect?g(U.id,ue.id):v(U.id,ue.id))}}return fn(()=>document.addEventListener("keydown",R)),xn(()=>document.removeEventListener("keydown",R)),(P,z)=>(x(),xe(Wk,{class:Pe(["qcard",{minimized:r.value}])},K4({head:Ee(()=>[_("div",Fle,[z[5]||(z[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",Ole,O(C(s)("question.title")),1),a.value>1&&!r.value?(x(),T("span",Rle,O(C(s)("question.step",{current:i.value+1,total:a.value})),1)):le("",!0),r.value?(x(),T("span",Ble,O(l.value.question),1)):le("",!0),re(qn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:z[0]||(z[0]=W=>r.value=!r.value)},{default:Ee(()=>[r.value?(x(),xe(je,{key:0,name:"chevron-up",size:"md"})):(x(),xe(je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[_("div",Dle,[a.value>1?(x(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(x(!0),T(Be,null,nt(n.question.questions,(W,ee)=>(x(),T("button",{key:W.id,type:"button",class:Pe(["qstep-dot",{active:ee===i.value,answered:f(W.id)}]),"aria-selected":ee===i.value,"aria-label":C(s)("question.step",{current:ee+1,total:a.value}),onClick:U=>d(ee)},[_("span",Wle,O(ee+1),1)],10,Hle))),128))],8,Ple)):le("",!0),l.value.header?(x(),T("div",zle,[re(Ro,{variant:"neutral",size:"sm"},{default:Ee(()=>[Qe(O(l.value.header),1)]),_:1})])):le("",!0),_("div",Ule,O(l.value.question),1),l.value.body?(x(),xe(Om,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):le("",!0),_("div",qle,[(x(!0),T(Be,null,nt(l.value.options,(W,ee)=>(x(),T("label",{key:W.id,class:Pe(["qopt",{selected:$(l.value.id,W.id)}]),onClick:kt(U=>l.value.multiSelect?g(l.value.id,W.id):v(l.value.id,W.id),["prevent"])},[_("span",Vle,O(ee+1),1),_("span",Kle,[l.value.multiSelect?(x(),T("span",Gle,O($(l.value.id,W.id)?"■":"□"),1)):(x(),T("span",Yle,O($(l.value.id,W.id)?"●":"○"),1))]),_("span",Zle,[_("span",Qle,O(W.label),1),W.description?(x(),T("span",Xle,O(W.description),1)):le("",!0)])],10,jle))),128)),l.value.allowOther?(x(),T("label",{key:0,class:Pe(["qopt",{selected:w(l.value.id)}]),onClick:z[4]||(z[4]=kt(W=>L(l.value.id),["prevent"]))},[z[6]||(z[6]=_("span",{class:"qopt-key"},null,-1)),_("span",Jle,[l.value.multiSelect?(x(),T("span",eae,O(w(l.value.id)?"■":"□"),1)):(x(),T("span",tae,O(w(l.value.id)?"●":"○"),1))]),_("span",nae,O(l.value.otherLabel??C(s)("question.otherDefault")),1),On(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":z[1]||(z[1]=W=>y.value[l.value.id]=W),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:z[2]||(z[2]=W=>E(l.value.id)),onFocus:z[3]||(z[3]=W=>E(l.value.id))},null,40,sae),[[So,y.value[l.value.id]]])],2)):le("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[_("div",oae,[i.value<a.value-1?(x(),xe(Rt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ee(()=>[Qe(O(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),xe(Rt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!M(),loading:N.value,onClick:I},{default:Ee(()=>[Qe(O(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),xe(Rt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Qe(O(C(s)("question.back")),1)]),_:1},8,["disabled"])):le("",!0),re(Rt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:B},{default:Ee(()=>[Qe(O(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),rae=ct(iae,[["__scopeId","data-v-14c58ac1"]]),lae={class:"ah"},aae={class:"akind"},cae={class:"apath"},uae={class:"ah-path"},dae={key:1,class:"diff"},fae={class:"dg"},hae={class:"dc"},pae={key:2,class:"body-shell"},mae={class:"shell-cmd"},gae={key:0,class:"shell-cwd"},vae={key:1,class:"shell-danger"},yae={key:3,class:"body-file"},kae={class:"file-bar"},bae={class:"file-lang"},xae={class:"file-content"},wae={class:"file-ln"},_ae={class:"file-text"},Sae={key:4,class:"body-chip"},Cae={class:"chip-label"},Aae={class:"chip-value"},Mae={key:0,class:"chip-detail"},Eae={key:5,class:"body-chip"},Tae={key:0,class:"chip-label"},Nae={class:"chip-value"},Iae={key:6,class:"body-chip"},$ae={class:"chip-label"},Lae={class:"chip-value"},Fae={key:0,class:"chip-detail"},Oae={key:7,class:"body-chip"},Rae={class:"chip-label"},Bae={class:"chip-value"},Dae={key:0,class:"chip-detail"},Pae={key:8,class:"body-todo"},Hae={class:"todo-glyph"},Wae={key:9,class:"body-plan"},zae={key:10,class:"body-generic"},Uae={class:"gen-text"},qae={key:11,class:"feedback-wrap"},jae=["placeholder"],Vae={class:"feedback-hint"},Kae={key:0,class:"plan-actions"},Gae={key:1,class:"abtn"},Yae=Ge({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),i=D(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=X(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const N=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${N}`)}const c=X(!1),u=X(""),d=X(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const N=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:N||void 0}):v("feedback",{decision:"rejected",feedback:N||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(N){N.key==="Enter"&&!N.shiftKey?(N.preventDefault(),h()):N.key==="Escape"&&(N.preventDefault(),p())}const b=X(null);Ze(()=>n.busy,N=>{N||(b.value=null)});function v(N,F){n.busy||(b.value=N,s("decide",F))}function g(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function E(){v("approvePlan",{decision:"approved"})}function L(N){v(`option:${N}`,{decision:"approved",selectedLabel:N})}function $(){n.busy||f()}function w(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function M(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){N.key==="1"?(N.preventDefault(),E()):N.key==="2"?(N.preventDefault(),$()):N.key==="3"&&(N.preventDefault(),w());return}N.key==="1"&&S.options[0]?(N.preventDefault(),L(S.options[0].label)):N.key==="2"&&S.options[1]?(N.preventDefault(),L(S.options[1].label)):N.key==="3"&&S.options[2]&&(N.preventDefault(),L(S.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),y()):N.key==="3"?(N.preventDefault(),k()):N.key==="4"&&(N.preventDefault(),f())}return fn(()=>document.addEventListener("keydown",M)),xn(()=>document.removeEventListener("keydown",M)),(N,F)=>(x(),xe(Wk,{class:Pe(["appr",{minimized:r.value}])},K4({head:Ee(()=>[_("div",lae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",aae,O(a()),1),_("span",cae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),T(Be,{key:0},[Qe(O(e.block.path),1)],64)):e.block.kind==="shell"?(x(),T(Be,{key:1},[Qe(O(e.block.command),1)],64)):e.block.kind==="url"?(x(),T(Be,{key:2},[Qe(O(e.block.url),1)],64)):e.block.kind==="search"?(x(),T(Be,{key:3},[Qe(O(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),T(Be,{key:4},[Qe(O(e.block.name),1)],64)):e.block.kind==="generic"?(x(),T(Be,{key:5},[Qe(O(e.block.summary),1)],64)):le("",!0)]),e.agentName&&!r.value?(x(),xe(Ro,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Qe(O(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):le("",!0),r.value?le("",!0):(x(),xe(Ro,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Qe(O(C(o)("approval.required")),1)]),_:1})),re(qn,{class:"amin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ee(()=>[r.value?(x(),xe(je,{key:0,name:"chevron-up",size:"md"})):(x(),xe(je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),xe(Yt,{key:0,text:e.block.path},{default:Ee(()=>[_("div",uae,O(e.block.path),1)]),_:1},8,["text"])):le("",!0),e.block.kind==="diff"?(x(),T("div",dae,[(x(!0),T(Be,null,nt(e.block.diff,(S,I)=>(x(),T("div",{key:I,class:Pe(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",fae,O(S.gutter),1),_("span",hae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(x(),T("div",pae,[_("div",mae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Qe(" "+O(e.block.command),1)]),e.block.cwd?(x(),T("div",gae,"cwd: "+O(e.block.cwd),1)):le("",!0),e.block.danger?(x(),T("div",vae,O(C(o)("approval.danger",{detail:e.block.danger})),1)):le("",!0)])):e.block.kind==="file"?(x(),T("div",yae,[_("div",kae,[_("span",bae,O(e.block.language??""),1)]),_("div",xae,[(x(!0),T(Be,null,nt(e.block.content.split(`
|
|
297
|
-
`),(S,I)=>(x(),T("div",{key:I,class:"file-line"},[_("span",wae,O(I+1),1),_("span",_ae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(x(),T("div",Sae,[_("span",Cae,O(e.block.op),1),_("span",Aae,O(e.block.path),1),e.block.detail?(x(),T("span",Mae,O(e.block.detail),1)):le("",!0)])):e.block.kind==="url"?(x(),T("div",Eae,[e.block.method?(x(),T("span",Tae,O(e.block.method),1)):le("",!0),_("span",Nae,O(e.block.url),1)])):e.block.kind==="search"?(x(),T("div",Iae,[_("span",$ae,O(C(o)("approval.searchQueryLabel")),1),_("span",Lae,O(e.block.query),1),e.block.scope?(x(),T("span",Fae,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):le("",!0)])):e.block.kind==="invocation"?(x(),T("div",Oae,[_("span",Rae,O(e.block.kind2),1),_("span",Bae,O(e.block.name),1),e.block.description?(x(),T("span",Dae,O(e.block.description),1)):le("",!0)])):e.block.kind==="todo"?(x(),T("div",Pae,[(x(!0),T(Be,null,nt(e.block.items,(S,I)=>(x(),T("div",{key:I,class:"todo-item"},[_("span",Hae,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:Pe(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),T("div",Wae,[re(Om,{text:e.block.plan},null,8,["text"])])):(x(),T("div",zae,[_("span",Uae,O(e.block.summary),1)])),c.value?(x(),T("div",qae,[On(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,jae),[[So,u.value]]),_("div",Vae,O(C(o)("approval.feedbackHint")),1)])):le("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(x(),T("div",Kae,[i.value.options.length>0?(x(!0),T(Be,{key:0},nt(i.value.options,(S,I)=>(x(),xe(Yt,{key:I,text:S.description},{default:Ee(()=>[re(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:B=>L(S.label)},{default:Ee(()=>[Qe(O(S.label),1),re(gr,{class:"k",keys:[String(I+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),xe(Rt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:E},{default:Ee(()=>[Qe(O(C(o)("approval.approvePlan")),1),re(gr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:Ee(()=>[Qe(O(C(o)("approval.revise")),1),i.value.options.length===0?(x(),xe(gr,{key:0,class:"k",keys:["2"]})):le("",!0)]),_:1},8,["disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:w},{default:Ee(()=>[Qe(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),xe(gr,{key:0,class:"k",keys:["3"]})):le("",!0)]),_:1},8,["loading","disabled"])])):(x(),T("div",Gae,[re(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:g},{default:Ee(()=>[Qe(O(C(o)("approval.approve")),1),re(gr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ee(()=>[Qe(O(C(o)("approval.approveSession")),1),re(gr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ee(()=>[Qe(O(C(o)("approval.reject")),1),re(gr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),re(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Qe(O(C(o)("approval.feedback")),1),re(gr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),Zae=ct(Yae,[["__scopeId","data-v-458a9d7d"]]),Qae=Ge({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(x(),T("span",{class:Pe(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),E5=ct(Qae,[["__scopeId","data-v-f595d935"]]),Xae={class:"taskspane"},Jae={class:"tp-head"},ece={class:"tp-title"},tce={class:"tp-count"},nce={class:"tp-list"},sce={key:0,class:"tp-empty"},oce=["role","onClick"],ice={class:"tp-name"},rce={class:"tp-time"},lce=["onClick"],ace={key:0,class:"tp-detail"},cce={key:0,class:"tp-codebox"},uce=["onClick"],dce={class:"tp-pre"},fce={class:"tp-cmd"},hce={key:1,class:"tp-codebox"},pce=["onClick"],mce={class:"tp-pre"},gce=Ge({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Mt(),o=Ps(new Set),i=Ps(new Set),r=Ps(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(o.has(p.id)?o.delete(p.id):o.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,m,b){await Zs(p)&&(b.add(m),setTimeout(()=>b.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
|
|
298
|
-
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(x(),T("div",Xae,[_("div",Jae,[_("span",ece,O(C(s)("tasks.tag")),1),_("span",tce,O(e.tasks.length),1)]),_("div",nce,[e.tasks.length===0?(x(),T("div",sce,O(C(s)("tasks.emptyTasks")),1)):(x(!0),T(Be,{key:1},nt(e.tasks,b=>(x(),T("div",{key:b.id,class:Pe(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[re(E5,{status:u(b.state)},null,8,["status"]),_("span",ice,O(b.name),1),re(Ro,{variant:"neutral",size:"sm"},{default:Ee(()=>[Qe(O(b.kind),1)]),_:2},1024),_("span",rce,O(b.timing),1),b.state==="run"?(x(),T("button",{key:0,class:"tp-stop",onClick:kt(v=>n("cancel",b.id),["stop"])},O(C(s)("tasks.stop")),9,lce)):le("",!0),b.kind==="subagent"?(x(),xe(je,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(x(),xe(je,{key:2,class:Pe(["tp-chevron",{open:o.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):le("",!0)],8,oce),o.has(b.id)&&l(b)?(x(),T("div",ace,[b.meta?(x(),T("div",cce,[_("button",{class:Pe(["tp-copy",{copied:i.has(b.id)}]),onClick:kt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,uce),_("pre",dce,[_("code",null,[_("span",fce,O(b.meta),1)])])])):le("",!0),b.output&&b.output.length>0?(x(),T("div",hce,[_("button",{class:Pe(["tp-copy",{copied:r.has(b.id)}]),onClick:kt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,pce),_("pre",mce,[_("code",null,[m[0]||(m[0]=Qe(`
|
|
299
|
-
`,-1)),(x(!0),T(Be,null,nt(b.output,(v,g)=>(x(),T("span",{key:g,class:"tp-line"},O(v),1))),128)),m[1]||(m[1]=Qe(`
|
|
300
|
-
`,-1))])])])):le("",!0)])):le("",!0)],2))),128))])]))}}),PC=ct(gce,[["__scopeId","data-v-28fd5fc0"]]),vce={class:"todo-card"},yce={key:0,class:"tc-empty"},kce={class:"tc-name"},bce=Ge({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Mt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(x(),T("div",vce,[t.todos.length===0?(x(),T("div",yce,[i[0]||(i[0]=_("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):le("",!0),(x(!0),T(Be,null,nt(t.todos,(r,l)=>(x(),T("div",{key:l,class:Pe(["tc-row",`s-${r.status}`])},[re(E5,{status:s(r.status)},null,8,["status"]),_("span",kce,O(r.title),1)],2))),128))]))}}),xce=ct(bce,[["__scopeId","data-v-01c65735"]]),wce={class:"dock-work-head"},_ce={key:0,class:"dock-work-tab static"},Sce={key:1,class:"dock-work-tab static"},Cce={key:2,class:"dock-work-tab static"},Ace={class:"dock-work-body"},Mce={class:"dw-count"},Ece={class:"dw-count"},Tce={class:"dw-count"},Nce=Ge({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=Mt(),r=X(null),l=X(null),a=X(null),c=X(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!s.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||o("close-dock-panel"))}Ze(()=>s.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function m(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return fn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(m),p.observe(c.value),m())}),xn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(x(),T("div",{ref_key:"dockRef",ref:c,class:Pe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=kt(()=>{},["stop"]))},[re(Tl,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(x(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=kt(()=>{},["stop"]))},[_("div",wce,[e.dockPanel==="bash"?(x(),T("span",_ce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),T("span",Sce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),T("span",Cce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):le("",!0)]),_("div",Ace,[e.dockPanel==="bash"?(x(),xe(PC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=g=>o("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),xe(PC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=g=>o("cancelTask",g)),onOpen:v[2]||(v[2]=g=>o("openAgent",g))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),xe(xce,{key:2,todos:e.todos??[]},null,8,["todos"])):le("",!0)])],512)):le("",!0)]),_:1}),e.goal?(x(),xe(Lle,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=g=>o("controlGoal",g))},null,8,["goal","force-expanded"])):le("",!0),e.hasDockWork?(x(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),xe(fh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=g=>o("toggle-dock-panel","bash"))},{default:Ee(()=>[re(je,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",Mce,[v[29]||(v[29]=Qe("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Qe(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),e.subagentTasks.length>0?(x(),xe(fh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=g=>o("toggle-dock-panel","subagent"))},{default:Ee(()=>[re(je,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Ece,[v[31]||(v[31]=Qe("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Qe(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0),(e.todos?.length??0)>0?(x(),xe(fh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=g=>o("toggle-dock-panel","todos"))},{default:Ee(()=>[re(je,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",Tce,[v[33]||(v[33]=Qe("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Qe(")",-1))])]),_:1},8,["active","aria-pressed"])):le("",!0)],512)):le("",!0),e.pendingQuestion?(x(),xe(rae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(g,y)=>o("answer",g,y)),onDismiss:v[9]||(v[9]=g=>o("dismiss",g))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),xe(Zae,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=g=>o("approval",e.pendingApproval.approvalId,g))},null,8,["block","agent-name","busy"])):(x(),xe(M5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:v[11]||(v[11]=g=>o("submit",g)),onSteer:v[12]||(v[12]=g=>o("steer",g)),onCommand:v[13]||(v[13]=g=>o("command",g)),onInterrupt:v[14]||(v[14]=g=>o("interrupt")),onSetPermission:v[15]||(v[15]=g=>o("setPermission",g)),onSetThinking:v[16]||(v[16]=g=>o("setThinking",g)),onTogglePlan:v[17]||(v[17]=g=>o("togglePlan")),onToggleSwarm:v[18]||(v[18]=g=>o("toggleSwarm")),onToggleGoal:v[19]||(v[19]=g=>o("toggleGoal")),onOpenBtw:v[20]||(v[20]=g=>o("openBtw")),onCreateGoal:v[21]||(v[21]=g=>o("createGoal",g)),onControlGoal:v[22]||(v[22]=g=>o("controlGoal",g)),onFocusGoal:v[23]||(v[23]=g=>o("focusGoal")),onFocusSwarm:v[24]||(v[24]=g=>o("focusSwarm")),onCompact:v[25]||(v[25]=g=>o("compact")),onPickModel:v[26]||(v[26]=g=>o("pickModel")),onSelectModel:v[27]||(v[27]=g=>o("selectModel",g))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Ice=ct(Nce,[["__scopeId","data-v-b8fcd8f4"]]),$ce=["aria-label","aria-hidden"],Lce={class:"toc-scroll"},Fce=["onClick"],Oce={class:"toc-label"},Rce=240,Bce=Ge({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),i=X(null),r=X(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=Rce}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ze(c,u=>{l?.disconnect(),l=null,u&&pt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ps(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),T("nav",{key:0,ref_key:"navRef",ref:i,class:Pe(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",Lce,[(x(!0),T(Be,null,nt(e.items,f=>(x(),T("button",{key:f.id,type:"button",class:Pe(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",Oce,O(f.title),1)],10,Fce))),128))])],10,$ce)):le("",!0)}}),Dce=ct(Bce,[["__scopeId","data-v-3f1c1f66"]]),Pce=5;function Hce(e,t,n,s=Pce){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const Wce={class:"chat-layout"},zce={class:"empty-hint"},Uce={key:0,class:"empty-hint-text"},qce={key:1,class:"ws-pick"},jce={class:"ws-pick-name"},Vce={key:1,class:"ws-pick-menu"},Kce=["onClick"],Gce={class:"ws-pick-item-name"},Yce={class:"ws-pick-item-path"},Zce=["aria-label"],Qce={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Xce={class:"abort-toast-text"},pg=80,HC=1e3,Jce=420,eue=3e3,tue=Ge({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:s}=Mt(),o=e,i=n,r=X(!1),l=X(!1),a=D(()=>o.workspaces?.find(Ce=>Ce.id===o.activeWorkspaceId)?.name??o.workspaceName??""),c=D(()=>(o.workspaces?.length??0)>0),u=D(()=>Hce(o.workspaces??[],o.activeWorkspaceId,l.value)),d=D(()=>(o.workspaces?.length??0)-u.value.length);Ze(r,be=>{be||(l.value=!1)});function f(be){r.value=!1,be!==o.activeWorkspaceId&&i("selectWorkspace",be)}Kc(Ft.contentAlign);const h=X(null),p=X(null),m=X(null),b=X(!1),v=X(0);let g=null;function y(be,Ce){const De=m.value??p.value;return!De||De.loadForEdit(be)===!1?!1:(De.loadAttachmentsForEdit(Ce??[]),!0)}function k(){b.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,b.value=!1},2e3)}function E(){v.value++}const L=D(()=>o.tasks.filter(be=>be.kind!=="subagent")),$=D(()=>o.tasks.filter(be=>be.kind==="subagent"&&be.runInBackground)),w=D(()=>L.value.filter(be=>be.state==="run").length),M=D(()=>$.value.filter(be=>be.state==="run").length);function N(be){const Ce=o.tasks,De=Ce.find(Bt=>Bt.id===be)??Ce.find(Bt=>Bt.parentToolCallId===be);if(De)return De.id;const Ot=Ce.filter(Bt=>Bt.kind==="subagent"&&!Bt.parentToolCallId);if(Ot.length===1)return Ot[0].id}Ln("resolveAgentTaskId",N),Ln("pinScroll",Tn);const F=D(()=>(o.todos??[]).filter(be=>be.status==="done").length),S=D(()=>L.value.length>0||$.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),I=X(null),B=D(()=>o.gitInfo?o.changes?.length??0:0);function R(be){I.value=I.value===be?null:be}function P(){I.value=null}Ze(S,be=>{be||P()});function z(be){if(be.role==="compaction")return s("conversation.compactedPlain");if(be.role==="user"){if(be.skillActivation)return`/${be.skillActivation.name}`;if(be.pluginCommand)return`/${be.pluginCommand.pluginId}:${be.pluginCommand.commandName}`;const De=be.text.trim().replaceAll(/\s+/g," ");return De.length>0?De:"user"}const Ce=(be.text||be.thinking||"").trim().replaceAll(/\s+/g," ");return Ce.length>0?Ce:(be.tools?.length??0)>0?`${be.tools.length} tools`:"kimi"}const W=D(()=>o.turns.filter(be=>be.role==="user").map((be,Ce)=>({id:be.id,role:be.role,no:Ce+1,title:z(be)}))),ee=X(null);function U(){const be=he.value;if(!be)return;const Ce=be.querySelectorAll(".turn-anchor[data-turn-id]");if(Ce.length===0)return;const De=W.value;if(De.length===0)return;const Ot=new Set(De.map(Eo=>Eo.id));if(ve()<=pg){ee.value=De[De.length-1].id;return}const Bt=be.getBoundingClientRect(),cn=Bt.height/2;let Kn=null;Ce.forEach(Eo=>{const J=Eo.dataset.turnId;if(!J||!Ot.has(J))return;Eo.getBoundingClientRect().top-Bt.top<=cn&&(Kn=J)}),ee.value=Kn??De[0].id}const Y=X(!1);let ue=0;function fe(){ue||(ue=st(()=>{ue=0,oe()}))}function oe(){const be=he.value,Ce=!o.mobile&&o.conversationToc&&be?be.closest(".con")?.querySelector(".conversation-toc"):null,De=Ce?.querySelector(".toc-bar");let Ot=!1;if(be&&Ce&&De){const Bt=De.getBoundingClientRect(),cn=Ce.getBoundingClientRect(),Kn=Bt.left+Bt.width/2;Ot=Array.from(be.querySelectorAll(".table-node-wrapper")).some(Eo=>{const J=Eo.getBoundingClientRect();return J.left<=Kn&&Kn<=J.right&&J.top<cn.bottom&&J.bottom>cn.top})}Y.value!==Ot&&(Y.value=Ot)}const Z=D(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),te=D(()=>{const be=Z.value;if(be)return o.pendingQuestionActions?.[be.questionId]}),ae=D(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),He=D(()=>{const be=ae.value;return be?!!o.pendingApprovalActions?.[be.approvalId]:!1}),he=X(null),K=X(null),ce=X(0),ge=X(0),q=D(()=>({"--panes-scrollbar-width":`${ce.value}px`}));function se(be){return be instanceof HTMLElement?be:be&&"$el"in be&&be.$el instanceof HTMLElement?be.$el:null}function ye(){const be=he.value;ce.value=be?Math.max(0,be.offsetWidth-be.clientWidth):0,ge.value=K.value?.offsetHeight??0}function de(be){const Ce=se(be);he.value=Ce,Ce&&ro()}function ke(be){const Ce=se(be);K.value=Ce??null,be&&"loadForEdit"in be&&typeof be.loadForEdit=="function"&&"focus"in be&&typeof be.focus=="function"?m.value={loadForEdit:be.loadForEdit.bind(be),loadAttachmentsForEdit:"loadAttachmentsForEdit"in be&&typeof be.loadAttachmentsForEdit=="function"?be.loadAttachmentsForEdit.bind(be):()=>{},focus:be.focus.bind(be)}:m.value=null,Fs()}const j=X(!0),ne=X(!1);function ve(){const be=he.value;return be?be.scrollHeight-be.scrollTop-be.clientHeight:0}let Ae=0,$e=0,Oe=0,pe=0,Ie=0,Xe=0;function it(){return Date.now()<$e}function At(){fe();const be=he.value;if(!be)return;const Ce=be.scrollTop;if(Qn()){Ae=Ce;return}if(performance.now()-Oe<100){Ae=Ce;return}const De=ve();if(it()){j.value=!0,ne.value=!1,Ae=Ce;return}Ce<Ae-1&&De>1?(j.value=!1,ne.value=!0):De<=pg&&Ce>Ae+1&&(j.value=!0,ne.value=!1),Ae=Ce,U()}function bt(be=!1){const Ce=he.value;j.value=!0,ne.value=!1,Ce&&(!be&&performance.now()<pe||(be&&typeof Ce.scrollTo=="function"?(Oe=performance.now(),pe=performance.now()+Jce,Ce.scrollTo({top:Ce.scrollHeight,behavior:"smooth"})):Ce.scrollTop=Ce.scrollHeight,Ae=Ce.scrollTop))}function wt(be,Ce){return(Ce.closest("[inert]")?.closest(".tool-group")??Ce).getBoundingClientRect().top-be.getBoundingClientRect().top+be.scrollTop}function qt(be,Ce){const De=Array.from(be.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(cn=>({node:cn,top:wt(be,cn)})),Ot=De.findIndex(cn=>cn.top>=Ce),Bt=Ot<0?Math.max(0,De.length-1):Ot;return De.slice(Bt,Bt+2).flatMap(cn=>{const Kn=cn.node.dataset.scrollAnchorId,Eo=Kn??cn.node.dataset.turnId;return Eo?[{kind:Kn?"tool":"turn",id:Eo,top:cn.top}]:[]})}const yt=new Map;function Kt(be,Ce){for(const De of Ce.anchors){const Ot=De.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Bt=be.querySelector(`[${Ot}="${Jt(De.id)}"]`);if(Bt)return wt(be,Bt)-De.top}return be.scrollHeight-Ce.oldHeight}function gs(be,Ce,De=be.scrollTop){return be.scrollTop=De+Kt(be,Ce),Ae=be.scrollTop,be.scrollTop}async function En(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||Hn.value||!o.hasMoreMessages)return;const be=o.sessionId,Ce=he.value,De=Ce?.scrollTop??0,Ot={anchors:Ce?qt(Ce,De):[],oldHeight:Ce?.scrollHeight??0};os(be,!0),Ls();try{if(await pt(),await o.loadOlderMessages(be),await pt(),o.sessionId!==be){yt.set(be,Ot);return}const Bt=he.value;if(!Bt)return;gs(Bt,Ot),yt.delete(be)}finally{os(be,!1)}}function Jt(be){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(be):be.replaceAll(/["\\]/g,"\\$&")}function wn(be){const Ce=he.value;if(!Ce)return;const De=Ce.querySelector(`.turn-anchor[data-turn-id="${Jt(be)}"]`);De&&(ii(),j.value=!1,ne.value=ve()>pg,De.scrollIntoView({behavior:"smooth",block:"center"}))}function vs(){const be=he.value;if(!be)return"none";const Ce=be.firstElementChild,De=Ce instanceof HTMLElement?Ce.offsetHeight:0,Ot=K.value?.offsetHeight??0;return`${be.scrollHeight}:${be.clientHeight}:${De}:${Ot}`}function st(be){return typeof requestAnimationFrame=="function"?requestAnimationFrame(be):setTimeout(be,16)}function Bn(be){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(be):clearTimeout(be)}let Es=0,Dn=0,Hs=null,Ws=0;function Qn(){return performance.now()<Es}function Tn(be,Ce=260){const De=he.value;if(!De||(Hs=be,Ws=be.getBoundingClientRect().top,Es=performance.now()+Ce,Dn))return;const Ot=()=>{if(Dn=0,performance.now()>=Es||!Hs){Hs=null;return}const Bt=Hs.getBoundingClientRect().top-Ws;Bt&&(De.scrollTop+=Bt),Dn=st(Ot)};Dn=st(Ot)}function yn(be=36){if(!j.value&&!it())return;const Ce=++Xe;let De="",Ot=0,Bt=0;Ie&&(Bn(Ie),Ie=0);const cn=()=>{if(Ie=0,Ce!==Xe||!j.value&&!it())return;bt(!1);const Kn=vs();Ot=Kn===De?Ot+1:0,De=Kn,Bt++,Ot<3&&Bt<be&&(Ie=st(cn))};Ie=st(cn)}function jn(be,Ce){return be!==void 0&&be.length>0&&Ce.length>=be.length&&be.firstId!==Ce.firstId&&be.lastId===Ce.lastId&&be.lastTextLen===Ce.lastTextLen&&be.lastThinkingLen===Ce.lastThinkingLen&&be.lastToolsLen===Ce.lastToolsLen&&be.approvalIds===Ce.approvalIds}const ds=D(()=>{const be=(o.approvals??[]).map(cn=>cn.approvalId).join(","),Ce=o.turns,De=Ce.at(-1),Ot=De?.thinking?.length??0,Bt=De?.tools?.reduce((cn,Kn)=>cn+Kn.name.length+(Kn.arg?.length??0)+(Kn.output?.join("").length??0),0)??0;return{length:Ce.length,firstId:Ce[0]?.id??"",lastId:De?.id??"",lastTextLen:De?.text.length??0,lastThinkingLen:Ot,lastToolsLen:Bt,approvalIds:be}});Ze(ds,async(be,Ce)=>{if(Hn.value&&jn(Ce,be)){U();return}await pt(),j.value||it()?bt(be.length<Ce.length):ne.value=!0,U()}),Ze(K,()=>{Fs()}),Ze(()=>o.mobile,async()=>{await pt(),ye()});const Gn=new Map;Ze(()=>o.fileReloadKey,async(be,Ce)=>{const De=he.value;Ce&&De&&Gn.set(String(Ce),{top:De.scrollTop,following:j.value}),ii(),await pt();const Ot=he.value,Bt=be?Gn.get(String(be)):void 0;if(Bt&&Ot){const cn=yt.get(String(be)),Kn=cn?gs(Ot,cn,Bt.top):Bt.top;cn&&yt.delete(String(be)),j.value=Bt.following,Ot.scrollTop=Kn,Ae=Ot.scrollTop,ne.value=!Bt.following&&ve()>1,Bt.following&&yn()}else j.value=!0,Ae=0,bt(!1),yn();U()}),Ze(()=>o.sessionLoading,async(be,Ce)=>{be||!Ce||(j.value=!0,await pt(),yn(),U())}),Ze(()=>o.running,async(be,Ce)=>{be||!Ce||!j.value&&!it()||(await pt(),yn(48),U())});function Nn(){j.value=!0,ne.value=!1,$e=Date.now()+HC,pt(()=>{bt(!0),yn(16)})}function Pn(be){Nn(),i("submit",be)}function Pt(be){j.value=!0,ne.value=!1,$e=Date.now()+HC,i("editMessage",be)}function Ye(be){const Ce=o.queued?.[be],De=Ce?.text??"";y(De,Ce?.attachments)&&i("editQueued",be)}function qe(be){i("reorderQueue",be)}function Lt(be,Ce){Nn(),i("answer",be,Ce)}function Ht(be,Ce){!be||!Ce||i("approval",be,Ce)}let sn=null,Zt=null,_n=null,on=null,Et=0,ns=0,ss=0;const io=X(new Set),Hn=D(()=>!!o.sessionId&&io.value.has(o.sessionId));function os(be,Ce){const De=new Set(io.value);Ce?De.add(be):De.delete(be),io.value=De}function oi(){Hn.value||ss||(ss=st(()=>{ss=0,!Hn.value&&(Qn()||(j.value||it())&&bt(!1))}))}function Ls(){Xe++,Ie&&(Bn(Ie),Ie=0),ss&&(Bn(ss),ss=0)}function ii(){const be=he.value;if($e=0,Ls(),Es=0,Hs=null,be){const Ce=be.scrollTop;typeof be.scrollTo=="function"?be.scrollTo({top:Ce,behavior:"auto"}):be.scrollTop=Ce}pe=0,Oe=Number.NEGATIVE_INFINITY,be&&(Ae=be.scrollTop)}function Co(){const be=he.value;!be||be.scrollHeight-be.clientHeight<=1&&!o.hasMoreMessages||(j.value=!1,ii(),be.scrollHeight-be.clientHeight>1&&(ne.value=!0))}function Di(be){const Ce=he.value;if(!Ce)return!1;for(const De of be.composedPath()){if(De===Ce)return!1;if(De instanceof HTMLElement&&De.scrollHeight>De.clientHeight+1&&De.scrollTop>1)return!0}return!1}function ri(be){be.defaultPrevented||be.ctrlKey||be.shiftKey||be.deltaY>=0||Di(be)||Co()}function ys(be){const Ce=he.value;if(!Ce||be.defaultPrevented||be.button!==0||be.pointerType==="touch")return;const De=Ce.getBoundingClientRect(),Ot=Ce.offsetWidth-Ce.clientWidth,Bt=Ot>0?Ot:12;be.target===Ce&&be.clientX>=De.right-Bt&&Co()}let Ao=null;function or(be){Ao=be.touches.length===1?be.touches[0].clientY:null}function Pi(be){const Ce=be.touches.length===1?be.touches[0].clientY:null;Ce!==null&&Ao!==null&&Ce>Ao+2&&!Di(be)&&Co(),Ao=Ce}function fs(){if(!Zt)return;const be=he.value?.firstElementChild??null;be!==_n&&(_n&&Zt.unobserve(_n),_n=be,be&&Zt.observe(be))}function Fs(){if(!Zt)return;const be=K.value;be!==on&&(on&&Zt.unobserve(on),on=be,be&&Zt.observe(be))}function ro(){const be=he.value;ye(),sn&&(sn.disconnect(),be&&sn.observe(be,{childList:!0,subtree:!0,characterData:!0})),Zt&&(Zt.disconnect(),_n=null,on=null,be&&Zt.observe(be),fs(),Fs()),Et=be?.scrollHeight??0,ns=be?.clientHeight??0,fe()}function Os(){fs(),oi(),fe()}function Mo(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&yn()}const Vn=X(!1);let lt=null;function Q(){Vn.value=!0,lt!==null&&clearTimeout(lt),lt=setTimeout(()=>{Vn.value=!1},eue)}function me(){Q(),i("interrupt")}function Je(be){be.key==="Escape"&&(o.running||o.sending)&&(be.preventDefault(),me())}function It(){j.value&&oi()}fn(()=>{pt(()=>{typeof MutationObserver=="function"&&(sn=new MutationObserver(Os)),typeof ResizeObserver=="function"&&(Zt=new ResizeObserver(()=>{fe(),ye();const be=he.value;if(!be)return;const{scrollHeight:Ce,clientHeight:De}=be,Ot=Ce>Et+1,Bt=De<ns-1;Et=Ce,ns=De,!Qn()&&(Ot||Bt)&&oi()})),ro(),yn(48),U(),typeof document<"u"&&(document.addEventListener("visibilitychange",Mo),document.addEventListener("keydown",Je)),window.visualViewport?.addEventListener("resize",It)})}),xn(()=>{sn&&sn.disconnect(),Zt&&Zt.disconnect(),ss&&Bn(ss),Ie&&Bn(Ie),Dn&&Bn(Dn),ue&&Bn(ue),lt!==null&&clearTimeout(lt),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Mo),document.removeEventListener("keydown",Je)),window.visualViewport?.removeEventListener("resize",It)});function lo(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:lo}),(be,Ce)=>(x(),T("section",{class:Pe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),xe(qse,{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":B.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:Ce[0]||(Ce[0]=De=>i("openChanges")),onCopyAll:Ce[1]||(Ce[1]=De=>h.value?.copyConversation()),onCopyFinalSummary:Ce[2]||(Ce[2]=De=>h.value?.copyFinalSummary()),onOpenPr:Ce[3]||(Ce[3]=De=>e.pr&&i("openPr",e.pr.url)),onRenameSession:Ce[4]||(Ce[4]=(De,Ot)=>i("renameSession",De,Ot)),onForkSession:Ce[5]||(Ce[5]=De=>i("forkSession",De)),onArchiveSession:Ce[6]||(Ce[6]=De=>i("archiveSession",De)),onExportSession:Ce[7]||(Ce[7]=De=>i("exportSession",De))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):le("",!0),e.conversationToc?(x(),xe(Dce,{key:1,items:W.value,"active-turn-id":ee.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:Y.value,onSelect:wn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):le("",!0),_("div",Wce,[_("div",{ref:de,class:Pe(["panes chat-scroll",{"is-following":j.value,"history-prepending":Hn.value}]),onScrollPassive:At,onWheelPassive:ri,onPointerdownPassive:ys,onTouchstartPassive:or,onTouchmovePassive:Pi},[_("div",{class:Pe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),T(Be,{key:0},[Ce[55]||(Ce[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",zce,[_("span",{class:Pe(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),xe(zo,{key:0,size:"sm"})):le("",!0),_("span",null,O(e.starting?C(s)("conversation.starting"):C(s)("composer.emptyConversationTitle")),1)],2),e.starting?le("",!0):(x(),T("span",Uce,O(C(s)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),T("div",qce,[re(Yt,{text:C(s)("conversation.switchWorkspace")},{default:Ee(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:Ce[8]||(Ce[8]=kt(De=>r.value=!r.value,["stop"]))},[re(je,{name:"folder",size:"sm"}),_("span",jce,O(a.value),1),re(je,{class:Pe(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),T("div",{key:0,class:"ws-pick-backdrop",onClick:Ce[9]||(Ce[9]=De=>r.value=!1)})):le("",!0),r.value?(x(),T("div",Vce,[(x(!0),T(Be,null,nt(u.value,De=>(x(),T("button",{key:De.id,type:"button",class:Pe(["ws-pick-item",{on:De.id===e.activeWorkspaceId}]),onClick:kt(Ot=>f(De.id),["stop"])},[_("span",Gce,O(De.name),1),_("span",Yce,O(De.shortPath),1)],10,Kce))),128)),d.value>0?(x(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Ce[10]||(Ce[10]=kt(De=>l.value=!l.value,["stop"]))},[_("span",null,O(C(s)("conversation.moreWorkspaces",{count:d.value})),1)])):le("",!0),Ce[54]||(Ce[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:Ce[11]||(Ce[11]=kt(De=>{r.value=!1,i("addWorkspace")},["stop"]))},[re(je,{name:"plus",size:"sm"}),_("span",null,O(C(s)("conversation.addWorkspace")),1)])])):le("",!0)])):e.starting?le("",!0):(x(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:Ce[12]||(Ce[12]=De=>i("addWorkspace"))},[re(je,{name:"folder-plus",size:"sm"}),_("span",null,O(C(s)("conversation.addWorkspace")),1)]))]),re(M5,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Pn,onSteer:Ce[13]||(Ce[13]=De=>i("steer",De)),onCommand:Ce[14]||(Ce[14]=De=>i("command",De)),onInterrupt:me,onUnqueue:Ce[15]||(Ce[15]=De=>i("unqueue",De)),onEditQueued:Ce[16]||(Ce[16]=De=>i("editQueued",De)),onSetPermission:Ce[17]||(Ce[17]=De=>i("setPermission",De)),onSetThinking:Ce[18]||(Ce[18]=De=>i("setThinking",De)),onTogglePlan:Ce[19]||(Ce[19]=De=>i("togglePlan")),onToggleSwarm:Ce[20]||(Ce[20]=De=>i("toggleSwarm")),onToggleGoal:Ce[21]||(Ce[21]=De=>i("toggleGoal")),onOpenBtw:Ce[22]||(Ce[22]=De=>i("command","/btw")),onCreateGoal:Ce[23]||(Ce[23]=De=>i("createGoal",De)),onControlGoal:Ce[24]||(Ce[24]=De=>i("controlGoal",De)),onFocusGoal:E,onCompact:Ce[25]||(Ce[25]=De=>i("compact")),onPickModel:Ce[26]||(Ce[26]=De=>i("pickModel")),onSelectModel:Ce[27]||(Ce[27]=De=>i("selectModel",De))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),Ce[56]||(Ce[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(x(),xe(v5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:Ce[28]||(Ce[28]=De=>i("openFile",De)),onOpenMedia:Ce[29]||(Ce[29]=De=>i("openMedia",De)),onCopyConversationCopied:k,onOpenThinking:Ce[30]||(Ce[30]=De=>i("openThinking",De)),onOpenCompaction:Ce[31]||(Ce[31]=De=>i("openCompaction",De)),onOpenAgent:Ce[32]||(Ce[32]=De=>i("openAgent",De)),onOpenToolDiff:Ce[33]||(Ce[33]=De=>i("openToolDiff",De)),onEditMessage:Pt,onLoadOlderMessages:En,onUnqueue:Ce[34]||(Ce[34]=De=>i("unqueue",De)),onEditQueued:Ye,onReorderQueue:qe},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?le("",!0):(x(),xe(Ice,{key:0,ref:ke,style:Gt(q.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":v.value,"dock-panel":I.value,"bash-tasks":L.value,"subagent-tasks":$.value,"bash-running":w.value,"subagent-running":M.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":Z.value,"question-busy-kind":te.value,"pending-approval":ae.value,"approval-busy":He.value,mobile:e.mobile,onToggleDockPanel:Ce[35]||(Ce[35]=De=>R(De)),onCloseDockPanel:Ce[36]||(Ce[36]=De=>P()),onOpenAgent:Ce[37]||(Ce[37]=De=>i("openAgent",De)),onAnswer:Lt,onDismiss:Ce[38]||(Ce[38]=De=>i("dismiss",De)),onApproval:Ht,onCancelTask:Ce[39]||(Ce[39]=De=>i("cancelTask",De)),onControlGoal:Ce[40]||(Ce[40]=De=>i("controlGoal",De)),onSubmit:Pn,onSteer:Ce[41]||(Ce[41]=De=>i("steer",De)),onCommand:Ce[42]||(Ce[42]=De=>i("command",De)),onInterrupt:me,onSetPermission:Ce[43]||(Ce[43]=De=>i("setPermission",De)),onSetThinking:Ce[44]||(Ce[44]=De=>i("setThinking",De)),onTogglePlan:Ce[45]||(Ce[45]=De=>i("togglePlan")),onToggleSwarm:Ce[46]||(Ce[46]=De=>i("toggleSwarm")),onToggleGoal:Ce[47]||(Ce[47]=De=>i("toggleGoal")),onOpenBtw:Ce[48]||(Ce[48]=De=>i("command","/btw")),onCreateGoal:Ce[49]||(Ce[49]=De=>i("createGoal",De)),onFocusGoal:E,onCompact:Ce[50]||(Ce[50]=De=>i("compact")),onPickModel:Ce[51]||(Ce[51]=De=>i("pickModel")),onSelectModel:Ce[52]||(Ce[52]=De=>i("selectModel",De))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),re(Tl,{name:"pill"},{default:Ee(()=>[ne.value?(x(),T("button",{key:0,class:"newmsg-pill",style:Gt({bottom:`${ge.value+12}px`}),"aria-label":C(s)("conversation.jumpToLatestAria"),onClick:Ce[53]||(Ce[53]=De=>bt(!0))},[re(je,{class:"pill-chevron",name:"chevron-down",size:"md"}),Qe(" "+O(C(s)("conversation.newMessages")),1)],12,Zce)):le("",!0)]),_:1}),re(Tl,{name:"abort-toast"},{default:Ee(()=>[Vn.value?(x(),T("div",Qce,[_("span",Xce,O(C(s)("conversation.manuallyAborted")),1)])):le("",!0)]),_:1})],2))}}),nue=ct(tue,[["__scopeId","data-v-780ee8c7"]]),sue=["aria-selected","onClick"],oue=Ge({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(x(),T("div",{class:Pe(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),T(Be,null,nt(e.options,i=>(x(),T("button",{key:i.value,class:Pe(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},O(i.label),11,sue))),128))],2))}}),vo=ct(oue,[["__scopeId","data-v-d1aaccd7"]]),iue={class:"ui-panel-header__title"},rue={key:0,class:"ui-panel-header__sub"},lue=Ge({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),T("div",{class:Pe(["ui-panel-header",{wrap:e.wrap}])},[_("span",iue,O(e.title),1),re(Yt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(x(),T("span",rue,O(e.subtitle),1)):le("",!0)]),_:1},8,["text"]),Rn(t.$slots,"default",{},void 0,!0),e.closable?(x(),xe(qn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Ee(()=>[re(je,{name:"close",size:"sm"})]),_:1},8,["label"])):le("",!0)],2))}}),Ma=ct(lue,[["__scopeId","data-v-c47879ad"]]),aue={key:0,class:"fp-empty fp-error"},cue={key:1,class:"fp-empty"},uue={key:2,class:"fp-loading"},due={class:"fp-path"},fue={class:"fp-meta"},hue={key:0,class:"fp-lines"},pue={class:"fp-size"},mue={key:3,class:"fp-search"},gue=["placeholder"],vue={key:0,class:"fp-search-count"},yue=["href","aria-label"],kue={key:1,class:"fp-code"},bue={class:"fp-line-table"},xue=["data-line"],wue={class:"fp-gutter"},_ue=["innerHTML"],Sue={key:1,class:"fp-body fp-code"},Cue={class:"fp-line-table"},Aue=["data-line"],Mue={class:"fp-gutter"},Eue=["innerHTML"],Tue={key:2,class:"fp-body"},Nue=["srcdoc","title"],Iue={key:1,class:"fp-code"},$ue={class:"fp-line-table"},Lue=["data-line"],Fue={class:"fp-gutter"},Oue=["innerHTML"],Rue={key:3,class:"fp-body fp-pdf-wrap"},Bue=["src","title"],Due={key:1,class:"fp-binary-card"},Pue={class:"fp-binary-label"},Hue={key:4,class:"fp-body fp-table-wrap"},Wue={class:"fp-table"},zue=["data-line"],Uue={key:5,class:"fp-body fp-image-wrap"},que=["src","alt"],jue={key:1,class:"fp-binary-card"},Vue={class:"fp-binary-icon"},Kue={class:"fp-binary-label"},Gue={key:6,class:"fp-body fp-code"},Yue={class:"fp-line-table"},Zue=["data-line"],Que={class:"fp-gutter"},Xue=["innerHTML"],Jue={key:7,class:"fp-body fp-binary-wrap"},ede={class:"fp-binary-card"},tde={class:"fp-binary-icon"},nde={class:"fp-binary-label"},sde=Ge({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Mt();function s(he,K){const ce=K?K.split("/").filter(Boolean):[];for(const ge of he.split("/"))ge===""||ge==="."||(ge===".."?ce.pop():ce.push(ge));return ce.join("/")}const o=Vt("resolveImage",async he=>he),i=D(()=>{const he=c.file?.path??"",K=he.lastIndexOf("/");return K>0?he.slice(0,K):""});function r(he){if(/^(https?:|data:|blob:)/i.test(he)||he.startsWith("/"))return he;const K=i.value;return K?s(he,K):he}async function l(he){const K=r(he);return o?o(K):K}Ln("resolveImage",l);function a(he){let K=he.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(K)||K.startsWith("/"))return he;for(const ge of["#","?"]){const q=K.indexOf(ge);q!==-1&&(K=K.slice(0,q))}const ce=i.value;return{...he,path:s(K,ce)}}const c=e,u=t;function d(he){c.openFile?.(a(he))}const f=X(null),h=D(()=>{const he=c.file;if(!he)return"binary";const K=he.mime??"",ce=he.languageId??"",ge=he.path.toLowerCase();return K==="text/markdown"||ce==="markdown"||ce==="md"||ge.endsWith(".mdx")?"markdown":K==="application/json"||ce==="json"?"json":K==="text/html"||ce==="html"||ge.endsWith(".html")||ge.endsWith(".htm")?"html":K==="application/pdf"||ge.endsWith(".pdf")?"pdf":K==="text/csv"||ce==="csv"||ge.endsWith(".csv")?"csv":K.startsWith("image/")?"image":he.isBinary?"binary":K.startsWith("text/")||ce!==""?"text":"binary"});function p(he){const K=atob(he),ce=Uint8Array.from(K,ge=>ge.charCodeAt(0));return new TextDecoder().decode(ce)}const m=D(()=>{const he=c.file;if(!he)return"";if(he.encoding==="base64")try{return p(he.content)}catch{return he.content}return he.content}),b=D(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),v=D(()=>c.file?(h.value==="json"?b.value:m.value).split(`
|
|
301
|
-
`):[]),g=D(()=>c.file?h.value==="json"?b.value:m.value:""),y=X(""),k=X(0),E=D(()=>{const he=y.value.trim().toLowerCase();if(!he)return[];const K=[];return v.value.forEach((ce,ge)=>{ce.toLowerCase().includes(he)&&K.push(ge+1)}),K});Ze(y,()=>{k.value=0});function L(he,K=!1){he&&pt(()=>{const ce=f.value?.querySelector(".fp-body"),ge=ce?.querySelector(`[data-line="${he}"]`);if(!ce||!ge)return;K&&(ce.scrollTop=0);const q=ce.getBoundingClientRect(),se=ge.getBoundingClientRect(),ye=se.top-q.top+ce.scrollTop;ce.scrollTop=ye-ce.clientHeight/2+se.height/2})}Ze(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(he){const K=E.value;K.length!==0&&(k.value=(k.value+he+K.length)%K.length,L(K[k.value]))}function w(he){const K=E.value;return{target:c.line===he,hit:K.includes(he),active:K[k.value]===he}}function M(he){return he<1024?`${he} B`:he<1024*1024?`${(he/1024).toFixed(1)} KB`:`${(he/(1024*1024)).toFixed(1)} MB`}const N=X(!1),F=X(!1);function S(){c.file&&Zs(g.value).then(he=>{he&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function I(){c.file&&Zs(c.file.path).then(he=>{he&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const B=X("preview"),R=X("preview"),P=X("fit");function z(he){B.value=he}function W(he){R.value=he}function ee(he){P.value=he}Ze(h,he=>{B.value=he==="html"?"preview":"source",R.value="preview",P.value="fit"});const U=D(()=>{const he=c.file;return!he||h.value!=="image"?null:he.sourceUrl?he.sourceUrl:he.encoding==="base64"?`data:${he.mime};base64,${he.content}`:he.mime==="image/svg+xml"?`data:${he.mime};charset=utf-8,${encodeURIComponent(he.content)}`:null}),Y=D(()=>{const he=c.file;return!he||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:he.encoding==="base64"?`data:${he.mime};base64,${he.content}`:null}),ue=D(()=>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 fe(he){const K=[];let ce="",ge=!1;for(let q=0;q<he.length;q++){const se=he[q];se==='"'&&he[q+1]==='"'?(ce+='"',q++):se==='"'?ge=!ge:se===","&&!ge?(K.push(ce),ce=""):ce+=se}return K.push(ce),K}const oe=D(()=>v.value.slice(0,200).map(fe));function Z(he){return he.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function te(){const he=c.file;if(!he)return"";const K=he.languageId?.toLowerCase();return K||(he.path.split(".").pop()?.toLowerCase()??"")}function ae(he){const K=te();let ce=Z(he);return h.value==="json"||K==="json"||K==="jsonc"?(ce=ce.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ce=ce.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ce=ce.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ce=ce.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ce):h.value==="html"||K==="html"||K==="xml"||K==="svg"?(ce=ce.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ce=ce.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ce):(ce=ce.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),ce=ce.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ce=ce.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ce)}function He(he,K=55){return!he||he.length<=K?he:"…"+he.slice(he.length-K+1)}return(he,K)=>(x(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),T("div",aue,[_("span",null,O(e.error),1),e.closable?(x(),xe(Rt,{key:0,variant:"secondary",size:"sm",onClick:K[0]||(K[0]=ce=>u("close"))},{default:Ee(()=>[Qe(O(C(n)("filePreview.close")),1)]),_:1})):le("",!0)])):!e.file&&!e.loading?(x(),T("div",cue,O(C(n)("filePreview.empty")),1)):e.loading?(x(),T("div",uue,[K[7]||(K[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(x(),T(Be,{key:3},[re(Ma,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:K[6]||(K[6]=ce=>u("close"))},{default:Ee(()=>[re(Yt,{text:e.file.path},{default:Ee(()=>[_("span",due,O(He(e.file.path)),1)]),_:1},8,["text"]),_("span",fue,[e.file.lineCount?(x(),T("span",hue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),_("span",pue,O(M(e.file.size)),1)]),h.value==="html"?(x(),xe(vo,{key:0,"model-value":B.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):le("",!0),h.value==="markdown"?(x(),xe(vo,{key:1,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):le("",!0),h.value==="image"?(x(),xe(vo,{key:2,"model-value":P.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":ee},null,8,["model-value","options"])):le("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),T("div",mue,[On(_("input",{"onUpdate:modelValue":K[1]||(K[1]=ce=>y.value=ce),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,gue),[[So,y.value]]),y.value.trim()?(x(),T("span",vue,O(E.value.length),1)):le("",!0),re(qn,{size:"sm",disabled:E.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:K[2]||(K[2]=ce=>$(-1))},{default:Ee(()=>[re(je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),re(qn,{size:"sm",disabled:E.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:K[3]||(K[3]=ce=>$(1))},{default:Ee(()=>[re(je,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):le("",!0),re(qn,{size:"sm",class:Pe({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:I},{default:Ee(()=>[F.value?(x(),xe(je,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),xe(je,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),xe(qn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:K[4]||(K[4]=ce=>u("openExternal"))},{default:Ee(()=>[re(je,{name:"external-link",size:"md"})]),_:1},8,["label"])):le("",!0),e.externalActions?(x(),xe(qn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:K[5]||(K[5]=ce=>u("reveal"))},{default:Ee(()=>[re(je,{name:"folder",size:"md"})]),_:1},8,["label"])):le("",!0),e.downloadUrl?(x(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[re(je,{name:"download",size:"md"})],8,yue)):le("",!0),!e.file.isBinary&&h.value!=="image"?(x(),xe(qn,{key:7,size:"sm",class:Pe({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[N.value?(x(),xe(je,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),xe(je,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):le("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),T("div",{key:0,class:Pe(["fp-body",{"fp-markdown":R.value==="preview"}])},[R.value==="preview"?(x(),xe(Om,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),T("div",kue,[_("div",bue,[(x(!0),T(Be,null,nt(v.value,(ce,ge)=>(x(),T("div",{key:ge,class:Pe(["fp-line-row",w(ge+1)]),"data-line":ge+1},[_("span",wue,O(ge+1),1),_("span",{class:"fp-line-text",innerHTML:ae(ce)},null,8,_ue)],10,xue))),128))])]))],2)):h.value==="json"?(x(),T("div",Sue,[_("div",Cue,[(x(!0),T(Be,null,nt(v.value,(ce,ge)=>(x(),T("div",{key:ge,class:Pe(["fp-line-row",w(ge+1)]),"data-line":ge+1},[_("span",Mue,O(ge+1),1),_("span",{class:"fp-line-text",innerHTML:ae(ce)},null,8,Eue)],10,Aue))),128))])])):h.value==="html"?(x(),T("div",Tue,[B.value==="preview"?(x(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ue.value,title:e.file.path},null,8,Nue)):(x(),T("div",Iue,[_("div",$ue,[(x(!0),T(Be,null,nt(v.value,(ce,ge)=>(x(),T("div",{key:ge,class:Pe(["fp-line-row",w(ge+1)]),"data-line":ge+1},[_("span",Fue,O(ge+1),1),_("span",{class:"fp-line-text",innerHTML:ae(ce)},null,8,Oue)],10,Lue))),128))])]))])):h.value==="pdf"?(x(),T("div",Rue,[Y.value?(x(),T("iframe",{key:0,class:"fp-pdf-frame",src:Y.value,title:e.file.path},null,8,Bue)):(x(),T("div",Due,[_("span",Pue,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),T("div",Hue,[_("table",Wue,[_("tbody",null,[(x(!0),T(Be,null,nt(oe.value,(ce,ge)=>(x(),T("tr",{key:ge,class:Pe(w(ge+1)),"data-line":ge+1},[_("th",null,O(ge+1),1),(x(!0),T(Be,null,nt(ce,(q,se)=>(x(),T("td",{key:se},O(q),1))),128))],10,zue))),128))])])])):h.value==="image"?(x(),T("div",Uue,[U.value?(x(),T("img",{key:0,src:U.value,alt:e.file.path,class:Pe(["fp-image",{actual:P.value==="actual"}])},null,10,que)):(x(),T("div",jue,[_("span",Vue,[re(je,{name:"image-off",size:"lg"})]),_("span",Kue,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(x(),T("div",Gue,[_("div",Yue,[(x(!0),T(Be,null,nt(v.value,(ce,ge)=>(x(),T("div",{key:ge,class:Pe(["fp-line-row",w(ge+1)]),"data-line":ge+1},[_("span",Que,O(ge+1),1),_("span",{class:"fp-line-text",innerHTML:ae(ce)},null,8,Xue)],10,Zue))),128))])])):(x(),T("div",Jue,[_("div",ede,[_("span",tde,[re(je,{name:"file-off",size:"lg"})]),_("span",nde,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),ode=ct(sde,[["__scopeId","data-v-62bfaf2d"]]),ide={class:"tp"},rde=Ge({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),i=X(null);return Ze(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||pt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),T("div",ide,[re(Ma,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),WC=ct(rde,[["__scopeId","data-v-cf9c560b"]]),lde={class:"ap"},ade={key:0,class:"ap-type"},cde={key:1,class:"ap-reason"},ude={key:2,class:"ap-field"},dde={class:"ap-field-body"},fde={key:3,class:"ap-field"},hde={class:"ap-field-body ap-live"},pde={key:4,class:"ap-field"},mde={class:"ap-field-body ap-progress"},gde={key:0,class:"ap-call"},vde={key:1,class:"ap-output"},yde=["onClick"],kde={key:5,class:"ap-field"},bde={class:"ap-field-body"},xde=8,zC=5,UC=2,wde=Ge({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const b=[];let v=null,g=0;for(const y of m)y.startsWith("Calling ")?(v={key:`g${g++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${g++}`,call:"",output:[y]},b.push(v));return b}const a=D(()=>l(i.value)),c=X(new Set);function u(m){return c.value.has(m)}function d(m){const b=new Set(c.value);b.has(m)?b.delete(m):b.add(m),c.value=b}function f(m){return m.output.length-zC-UC}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=X(null);return Ze(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||pt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,b)=>(x(),T("div",lde,[re(Ma,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:b[0]||(b[0]=v=>s("close"))},{default:Ee(()=>[re(Ro,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Qe(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),T("div",ade,O(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(x(),T("div",cde,O(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(x(),T("div",ude,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",dde,O(e.member.prompt),1)])):le("",!0),r.value?(x(),T("div",fde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",hde,O(r.value),1)])):le("",!0),a.value.length>0?(x(),T("div",pde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",mde,[(x(!0),T(Be,null,nt(a.value,v=>(x(),T("div",{key:v.key,class:"ap-group"},[v.call?(x(),T("div",gde,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Qe(" "+O(v.call),1)])):le("",!0),v.output.length>0?(x(),T("div",vde,[v.output.length<=xde||u(v.key)?(x(!0),T(Be,{key:0},nt(v.output,(g,y)=>(x(),T("div",{key:y,class:"ap-out-line"},O(g),1))),128)):(x(),T(Be,{key:1},[(x(!0),T(Be,null,nt(v.output.slice(0,zC),(g,y)=>(x(),T("div",{key:y,class:"ap-out-line"},O(g),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:g=>d(v.key)}," … ("+O(f(v))+" more) ",9,yde),(x(!0),T(Be,null,nt(v.output.slice(-UC),(g,y)=>(x(),T("div",{key:"t"+y,class:"ap-out-line"},O(g),1))),128))],64))])):le("",!0)]))),128))])])):le("",!0),e.member.summary?(x(),T("div",kde,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",bde,O(e.member.summary),1)])):le("",!0)],512)]))}}),_de=ct(wde,[["__scopeId","data-v-715bd93e"]]),Sde={class:"diff-lines"},Cde={key:0,class:"hunk-text"},Ade={class:"dl-gutter old"},Mde={class:"dl-gutter new"},Ede={class:"dl-sign"},Tde={class:"dl-text"},Nde=Ge({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(x(),T("div",Sde,[(x(!0),T(Be,null,nt(e.lines,(r,l)=>(x(),T("div",{key:l,class:Pe(["dl",s(r)])},[r.type==="hunk"?(x(),T("span",Cde,O(r.text),1)):(x(),T(Be,{key:1},[_("span",Ade,O(t(r)),1),_("span",Mde,O(n(r)),1),_("span",Ede,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",Tde,O(r.text),1)],64))],2))),128))]))}}),T5=ct(Nde,[["__scopeId","data-v-2f6bc1cc"]]),Ide={class:"tdp"},$de={class:"tdp-body"},Lde={key:1,class:"tdp-output"},Fde={key:2,class:"tdp-empty"},Ode=Ge({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Mt();return(o,i)=>(x(),T("div",Ide,[re(Ma,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",$de,[e.target.lines&&e.target.lines.length>0?(x(),xe(T5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),T("div",Lde,[(x(!0),T(Be,null,nt(e.target.output,(r,l)=>(x(),T("div",{key:l},O(r),1))),128))])):(x(),T("div",Fde,O(C(s)("diff.noDiff")),1))])]))}}),Rde=ct(Ode,[["__scopeId","data-v-76f2fbca"]]),Bde={class:"sc"},Dde={key:0,class:"sc-empty"},Pde={key:2,class:"sc-loading","aria-hidden":"true"},Hde={class:"sc-composer"},Wde=["placeholder"],zde=["disabled"],Ude=Ge({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt(),i=D(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=D(()=>n.title?.trim()||o("sideChat.title")),l=D(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=X(""),c=X(null),u=X(null);function d(){const v=a.value.trim();v&&(s("send",v),a.value="",pt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=D(()=>{const v=n.turns;if(v.length===0)return"0";const g=v.at(-1),y=g.thinking?.length??0,k=g.tools?.reduce((E,L)=>E+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${v.length}:${g.text.length}:${y}:${k}`});Ze(h,async()=>{!n.running&&!n.sending||(await pt(),f())});const p=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,g)=>(x(),T("div",Bde,[re(Ma,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=y=>s("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),T("div",Dde,O(C(o)("sideChat.empty")),1)):(x(),xe(v5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(x(),T("div",Pde,[re(g5)])):le("",!0)],512),_("div",Hde,[On(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:b,onKeydown:m},null,40,Wde),[[So,a.value]]),re(Yt,{text:C(o)("sideChat.send")},{default:Ee(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[re(je,{name:"arrow-right",size:"sm"})],8,zde)]),_:1},8,["text"])])]))}}),qde=ct(Ude,[["__scopeId","data-v-9ee5df02"]]),jde={class:"changes-pane"},Vde={class:"dv-path"},Kde={class:"diff-head"},Gde={class:"back-label"},Yde={key:0,class:"empty-state"},Zde={key:1,class:"dv-lines-wrap"},Qde={key:2,class:"empty-state"},Xde={class:"dv-change-count"},Jde={class:"ch-head"},efe={class:"br-label"},tfe={class:"br-name"},nfe={key:0,class:"sync-info"},sfe={key:0,class:"ahead"},ofe={key:0,class:"behind"},ife={key:1,class:"empty-head"},rfe={key:0,class:"ch-list"},lfe=["onClick"],afe={class:"fpath"},cfe={key:1,class:"ch-list ch-tree"},ufe={class:"tree-list"},dfe=["onClick"],ffe={class:"tree-name"},hfe=["onClick"],pfe={class:"tree-name"},mfe={key:2,class:"empty-state"},gfe={key:3,class:"empty-state"},vfe=Ge({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=D(()=>s.gitInfo!==null),u=D(()=>s.changes.length>0),d=D(()=>(s.selectedDiffPath??null)!==null),f=D(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=D(()=>s.fileDiff??[]),p=D(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function b(){o("back")}function v(){o("close")}const g=X("list");function y(F){g.value=F}function k(F){const S={children:[]},I=[...F].sort((B,R)=>B.path.localeCompare(R.path));for(const B of I){const R=B.path.split("/");let P=S;for(let z=0;z<R.length;z++){const W=R[z],ee=z===R.length-1,U=R.slice(0,z+1).join("/");let Y=P.children.find(ue=>ue.name===W&&ue.kind===(ee?"file":"folder"));Y||(Y={name:W,path:U,kind:ee?"file":"folder",status:ee?B.status:void 0,children:[]},P.children.push(Y)),P=Y}}return S.children}const E=D(()=>k(s.changes)),L=X(new Set);function $(F){return!L.value.has(F)}const w=D(()=>{const F=[];function S(I,B){for(const R of I)F.push({node:R,depth:B}),R.kind==="folder"&&$(R.path)&&S(R.children,B+1)}return S(E.value,0),F});function M(F){const S=new Set(L.value);S.has(F.path)?S.delete(F.path):S.add(F.path),L.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(x(),T("div",jde,[f.value?(x(),T(Be,{key:0},[re(Ma,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[re(Yt,{text:e.selectedDiffPath??""},{default:Ee(()=>[_("span",Vde,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",Kde,[e.hideBack?le("",!0):(x(),xe(Rt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ee(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",Gde,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(x(),T("div",Yde,O(C(n)("diff.loading")),1)):h.value.length>0?(x(),T("div",Zde,[re(T5,{lines:h.value},null,8,["lines"])])):(x(),T("div",Qde,O(C(n)("diff.noDiff")),1))],64)):(x(),T(Be,{key:1},[re(Ma,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[_("span",Xde,O(C(n)("diff.changeCount",{count:e.changes.length})),1),re(vo,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",Jde,[c.value?(x(),T(Be,{key:0},[_("span",efe,O(C(n)("diff.branch")),1),_("span",tfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),T("span",nfe,[re(Yt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(x(),T("span",sfe,"↑"+O(e.gitInfo.ahead),1)):le("",!0)]),_:1},8,["text"]),re(Yt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(x(),T("span",ofe,"↓"+O(e.gitInfo.behind),1)):le("",!0)]),_:1},8,["text"])])):le("",!0)],64)):(x(),T("span",ife,O(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(x(),T("div",rfe,[(x(!0),T(Be,null,nt(e.changes,I=>(x(),xe(Yt,{key:I.path,text:I.path},{default:Ee(()=>[_("button",{type:"button",class:"ch-row",onClick:B=>m(I.path)},[_("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),_("span",afe,O(a(I.path)),1)],8,lfe)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(x(),T("div",cfe,[_("ul",ufe,[(x(!0),T(Be,null,nt(w.value,({node:I,depth:B})=>(x(),T("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(x(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Gt({paddingLeft:N(B)}),onClick:R=>M(I)},[re(je,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",ffe,O(I.name),1)],12,dfe)):(x(),xe(Yt,{key:1,text:I.path},{default:Ee(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Gt({paddingLeft:N(B)}),onClick:R=>m(I.path)},[_("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),_("span",pfe,O(I.name),1)],12,hfe)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),T("div",mfe,O(C(n)("diff.clean")),1)):(x(),T("div",gfe,O(C(n)("diff.empty")),1))],64))]))}}),yfe=ct(vfe,[["__scopeId","data-v-7778610a"]]);function zk(e,t){let n=null;fn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,pt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),ps(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const kfe=["type","value","placeholder","disabled","readonly"],bfe=Ge({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const s=n,o=X();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(x(),T("input",{ref_key:"el",ref:o,class:Pe(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,kfe))}}),Wc=ct(bfe,[["__scopeId","data-v-340f0da2"]]),xfe={class:"search-wrap"},wfe={key:0,class:"tab-strip"},_fe={key:1,class:"state-row"},Sfe={key:2,class:"state-row unavail"},Cfe={key:3,class:"model-list"},Afe=["aria-selected","onClick","onMouseenter"],Mfe={class:"check"},Efe={class:"model-main"},Tfe={class:"model-name"},Nfe={class:"model-id"},Ife={key:0,class:"caps"},$fe={class:"model-provider"},Lfe={class:"model-ctx"},Ffe={key:0,class:"empty"},Ofe={class:"footer-hint"},Rfe=Ge({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=D(()=>new Set(s.starredIds??[]));function r(y){return i.value.has(y)}const l=X(""),a=X(null),c=X(null),u=X("all");zk(c,a);const d=D(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const E of s.models)y.has(E.provider)||(y.add(E.provider),k.push({id:E.provider,label:E.provider}));return k}),f=D(()=>{const y=l.value.toLowerCase().trim(),k=s.models.filter(E=>{if(u.value!=="all"&&E.provider!==u.value)return!1;const L=(E.displayName??E.model).toLowerCase().includes(y),$=E.provider.toLowerCase().includes(y),w=E.id.toLowerCase().includes(y);return!y||L||$||w});return u.value!=="all"?k:k.sort((E,L)=>{const $=r(E.id)?1:0;return(r(L.id)?1:0)-$})}),h=D(()=>f.value),p=X(0);Ze([l,u],()=>{p.value=0}),Ze(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Ze(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function m(y){if(y.key==="Escape"){o("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&o("select",k.id)}}fn(()=>{document.addEventListener("keydown",m)}),xn(()=>{document.removeEventListener("keydown",m)});function b(y){o("select",y)}function v(y){return h.value.indexOf(y)}function g(y){u.value=y}return(y,k)=>(x(),xe(Wr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=E=>o("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",xfe,[re(Wc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=E=>l.value=E),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),T("div",wfe,[(x(!0),T(Be,null,nt(d.value,E=>(x(),xe(Rt,{key:E.id,variant:E.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(E.id)},{default:Ee(()=>[Qe(O(E.label),1)]),_:2},1032,["variant","onClick"]))),128))])):le("",!0),e.loading?(x(),T("div",_fe,[re(zo,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(x(),T("div",Sfe,[re(je,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(x(),T("div",Cfe,[(x(!0),T(Be,null,nt(h.value,E=>(x(),T("div",{key:E.id,class:Pe(["model-row",{"is-current":E.id===e.current,"is-selected":v(E)===p.value}]),role:"option","aria-selected":E.id===e.current,onClick:L=>b(E.id),onMouseenter:L=>p.value=v(E)},[_("span",Mfe,[E.id===e.current?(x(),xe(je,{key:0,name:"check",size:"sm"})):le("",!0)]),_("span",Efe,[_("span",Tfe,O(E.displayName??E.model),1),_("span",Nfe,O(E.id),1),E.capabilities&&E.capabilities.length>0?(x(),T("span",Ife,[(x(!0),T(Be,null,nt(E.capabilities,L=>(x(),xe(Ro,{key:L,variant:"info",size:"sm"},{default:Ee(()=>[Qe(O(L),1)]),_:2},1024))),128))])):le("",!0)]),_("span",$fe,O(E.provider),1),_("span",Lfe,O(C(n)("model.contextSuffix",{size:Math.round(E.maxContextSize/1e3)})),1),re(qn,{size:"sm",label:r(E.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:kt(L=>o("toggle-star",E.id),["stop"])},{default:Ee(()=>[r(E.id)?(x(),xe(je,{key:0,name:"star",size:"md"})):(x(),xe(je,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Afe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),T("div",Ffe,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),_("div",Ofe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Bfe=ct(Rfe,[["__scopeId","data-v-e93073d7"]]),Dfe={key:0,class:"ui-field__label"},Pfe={key:1,class:"ui-field__error"},Hfe={key:2,class:"ui-field__hint"},Wfe=Ge({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),T("div",{class:Pe(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),T("label",Dfe,O(e.label),1)):le("",!0),Rn(t.$slots,"default",{},void 0,!0),e.error?(x(),T("span",Pfe,O(e.error),1)):e.hint?(x(),T("span",Hfe,O(e.hint),1)):le("",!0)],2))}}),ih=ct(Wfe,[["__scopeId","data-v-49bce958"]]),zfe=["value","disabled"],Ufe=Ge({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(x(),T("select",{class:Pe(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Rn(o.$slots,"default",{},void 0,!0)],42,zfe))}}),Kv=ct(Ufe,[["__scopeId","data-v-92a040fd"]]),qfe={class:"prov-list"},jfe={key:0,class:"state-row"},Vfe={key:1,class:"state-row unavail"},Kfe={key:2,class:"empty"},Gfe={class:"prov-info"},Yfe={class:"prov-type"},Zfe={key:0,class:"prov-url"},Qfe={class:"prov-meta"},Xfe={key:0},Jfe={class:"prov-actions"},ehe={key:0,class:"add-section"},the={key:0,class:"add-btns"},nhe={key:1,class:"add-form"},she=["value"],ohe={key:0,class:"add-error"},ihe={class:"form-btns"},rhe={class:"footer-hint"},lhe=Ge({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Mt(),{confirm:s}=zr(),o=X(null);zk(o);const i=t;async function r(v){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",v)}const l=X(!1),a=Ps({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=X(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function h(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function p(v){if(v.key==="Escape"){if(l.value){f();return}i("close")}}fn(()=>document.addEventListener("keydown",p)),xn(()=>document.removeEventListener("keydown",p));function m(v){return v==="connected"?"var(--color-success)":v==="error"?"var(--color-danger)":"var(--color-text-faint)"}function b(v){return n(v==="connected"?"providers.status.connected":v==="error"?"providers.status.error":"providers.status.unconfigured")}return(v,g)=>(x(),xe(Wr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=y=>i("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",qfe,[e.loading?(x(),T("div",jfe,[re(zo,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(x(),T("div",Vfe,[re(je,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),T("div",Kfe,O(C(n)("providers.empty")),1)):(x(!0),T(Be,{key:3},nt(e.providers,y=>(x(),T("div",{key:y.id,class:"prov-row"},[re(Yt,{text:b(y.status)},{default:Ee(()=>[_("span",{class:Pe(["status-dot",{"status-dot--empty":y.status!=="connected"&&y.status!=="error"}]),style:Gt(y.status==="connected"||y.status==="error"?{background:m(y.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",Gfe,[_("span",Yfe,O(y.type),1),y.baseUrl?(x(),T("span",Zfe,O(y.baseUrl),1)):le("",!0),_("span",Qfe,[re(Ro,{variant:y.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Qe(O(y.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),y.models&&y.models.length>0?(x(),T("span",Xfe," · "+O(C(n)("providers.modelCount",{count:y.models.length})),1)):le("",!0)])]),_("div",Jfe,[re(Yt,{text:C(n)("providers.refreshTitle",{type:y.type})},{default:Ee(()=>[re(Rt,{variant:"secondary",size:"sm",onClick:k=>i("refresh",y.id)},{default:Ee(()=>[Qe(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),re(Yt,{text:C(n)("providers.deleteTitle",{type:y.type})},{default:Ee(()=>[re(Rt,{variant:"danger-soft",size:"sm",onClick:k=>r(y.id)},{default:Ee(()=>[Qe(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?le("",!0):(x(),T("div",ehe,[l.value?(x(),T("div",nhe,[re(ih,{label:C(n)("providers.fieldType")},{default:Ee(()=>[re(Kv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=y=>a.type=y)},{default:Ee(()=>[(x(),T(Be,null,nt(u,y=>_("option",{key:y,value:y},O(y),9,she)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),re(ih,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[re(Wc,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=y=>a.apiKey=y),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),re(ih,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[re(Wc,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=y=>a.baseUrl=y),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),re(ih,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[re(Wc,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=y=>a.defaultModel=y),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(x(),T("div",ohe,O(c.value),1)):le("",!0),_("div",ihe,[re(Rt,{variant:"primary",size:"sm",onClick:h},{default:Ee(()=>[Qe(O(C(n)("providers.add")),1)]),_:1}),re(Rt,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Qe(O(C(n)("common.cancel")),1)]),_:1})])])):(x(),T("div",the,[re(Rt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=y=>i("openLogin","moonshot"))},{default:Ee(()=>[re(je,{name:"user",size:"sm"}),Qe(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),re(Rt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=y=>i("openLogin","anthropic"))},{default:Ee(()=>[re(je,{name:"user",size:"sm"}),Qe(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),re(Rt,{variant:"primary",size:"sm",onClick:d},{default:Ee(()=>[re(je,{name:"plus",size:"sm"}),Qe(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",rhe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),ahe=ct(lhe,[["__scopeId","data-v-fb6f1365"]]),che={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},uhe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},dhe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},mg=Ge({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),T("svg",che,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),T("svg",uhe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),T("svg",dhe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),fhe={key:0,class:"center-body"},hhe={class:"center-text"},phe={key:1,class:"nb"},mhe={class:"nb-lead"},ghe=["href"],vhe={class:"nb-or"},yhe={class:"nb-fallback"},khe={class:"nb-fb-text"},bhe=["href"],xhe={class:"nb-code-row"},whe={class:"nb-code"},_he={class:"nb-status"},She={class:"nb-status-text"},Che={class:"nb-countdown"},Ahe={key:2,class:"center-body"},Mhe={class:"center-text success-text"},Ehe={class:"center-hint"},The={class:"center-body"},Nhe={class:"center-text err-text"},Ihe={class:"center-hint"},$he={class:"actions"},Lhe={class:"center-body"},Fhe={class:"center-text warn-text"},Ohe={class:"center-hint"},Rhe={class:"actions"},Bhe=3,Dhe=Ge({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=X(!0),o=t,i=e,r=X("starting"),l=X(!1),a=X(null),c=X(0),u=X(!1);let d=null,f=null,h=0;fn(async()=>{await p()}),xn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const L=await i.onStartOAuthLogin();if(!L){r.value="error";return}if(L.status==="authenticated"){v(),r.value="success",setTimeout(()=>{o("success"),o("close")},800);return}a.value={flowId:L.flowId,verificationUri:L.verificationUri,verificationUriComplete:L.verificationUriComplete,userCode:L.userCode,expiresIn:L.expiresIn,interval:L.interval},c.value=L.expiresIn,r.value="device-code",m(),b(L.interval)}function m(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b(L){d&&clearTimeout(d),d=setTimeout(async()=>{const $=await i.onPollOAuthLogin();if($===null){if(h+=1,h>=Bhe){v(),l.value=!0,r.value="error";return}b(L);return}h=0,$.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):$.status==="expired"||$.status==="cancelled"?(v(),r.value="expired"):b(L)},L*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function g(){await p()}async function y(){!a.value||!await Zs(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function E(L){const $=Math.floor(L/60),w=L%60;return`${$}:${String(w).padStart(2,"0")}`}return(L,$)=>(x(),xe(Wr,{open:s.value,"onUpdate:open":$[0]||($[0]=w=>s.value=w),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ee(()=>[r.value==="starting"?(x(),T("div",fhe,[re(zo,{size:"md"}),_("span",hhe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),T("div",phe,[_("div",mhe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Qe(O(C(n)("login.authorizeInBrowser"))+" ",1),re(je,{name:"external-link",size:"sm"})],8,ghe),_("div",vhe,O(C(n)("login.orDivider")),1),_("div",yhe,[_("div",khe,[Qe(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,bhe),Qe(O(C(n)("login.fallbackSuffix")),1)]),_("div",xhe,[_("span",whe,O(a.value.userCode),1),re(Rt,{class:Pe(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ee(()=>[u.value?(x(),T(Be,{key:0},[re(je,{name:"check",size:"sm"}),Qe(" "+O(C(n)("login.copied")),1)],64)):(x(),T(Be,{key:1},[re(je,{name:"copy",size:"sm"}),Qe(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",_he,[re(zo,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",She,O(C(n)("login.waitingAutoClose")),1),_("span",Che,O(E(c.value)),1)])])):r.value==="success"?(x(),T("div",Ahe,[re(mg,{kind:"success"}),_("span",Mhe,O(C(n)("login.success")),1),_("span",Ehe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),T(Be,{key:3},[_("div",The,[re(mg,{kind:"expired"}),_("span",Nhe,O(C(n)("login.expiredTitle")),1),_("span",Ihe,O(C(n)("login.expiredHint")),1)]),_("div",$he,[re(Rt,{variant:"primary",onClick:g},{default:Ee(()=>[Qe(O(C(n)("login.retry")),1)]),_:1}),re(Rt,{variant:"secondary",onClick:k},{default:Ee(()=>[Qe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),T(Be,{key:4},[_("div",Lhe,[re(mg,{kind:"error"}),_("span",Fhe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",Ohe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",Rhe,[re(Rt,{variant:"primary",onClick:g},{default:Ee(()=>[Qe(O(C(n)("login.retry")),1)]),_:1}),re(Rt,{variant:"secondary",onClick:k},{default:Ee(()=>[Qe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):le("",!0)]),_:1},8,["open","title"]))}}),Phe=ct(Dhe,[["__scopeId","data-v-8308a28f"]]);function Hhe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Whe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function zhe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:Hhe(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=Whe(t,h);c.set(p,(c.get(p)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),m=c.get(p.id)??c.get(p.root)??0,b=r[p.id]===!1?m:Math.max(p.sessionCount,m);let v=p.branch;!v&&i&&o===p.root&&(v=i),f.push({...p,sessionCount:b,branch:v})}return f}function Uhe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const s=new Set(t.map(r=>r.id)),o=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||s.has(r.id)||r.role==="user"&&r.promptId!==void 0&&o.has(r.promptId))});return i.length>0?[...i,...t]:t}function qC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}function qhe(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),s=new Set(e.map(r=>r.id)),o=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!s.has(r.id));return i.length===0?o:[...o,...i]}function jhe(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const Vhe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Khe(e){return Vhe.has(e.type)}const Ghe=50,Yhe=100,Gv=32*1024,Zhe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,Ghe)},cancelTask(e){clearTimeout(e)}};function Qhe(e,t,n={}){const s=n.scheduler??Zhe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??Yhe)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(s.cancelFrame(l),l=null),a!==null&&(s.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,g=()=>{v===c&&p()};l=s.requestFrame(g),a=s.requestTask(g)};p=()=>{f();let v=0;for(;!u&&v<o&&r<i.length;){const g=i[r++];e(g),v+=1}h(),m()};const b=(v=>{if(!u){if(t(v)){const g=i.length>r?i.at(-1):void 0,y=g===void 0?void 0:n.coalesce?.(g,v);y===void 0?i.push(v):i[i.length-1]=y,m();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},b.discard=v=>{if(u||d()===0)return;let g=r;for(let y=r;y<i.length;y+=1){const k=i[y];v(k)||(i[g++]=k)}i.length=g,h(),d()===0?f():m()},b.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},b}function Yv(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function Xhe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,s=Yv(t);if(n===void 0||s===void 0||n.kind!==s.kind||s.value.length<=Gv)return[e];const o=[];let i=0;for(;i<s.value.length;){let r=Math.min(i+Gv,s.value.length);r<s.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(s.value[r-1])&&/[\uDC00-\uDFFF]/u.test(s.value[r])&&(r-=1);const l=s.value.slice(i,r);o.push({appEvent:{...t,delta:s.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return o}function Jhe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,s=t.meta.stream,o=Yv(e.appEvent),i=Yv(t.appEvent);if(n===void 0||s===void 0||o===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==s.turnId||n.kind!==s.kind||o.kind!==i.kind||n.kind!==o.kind||s.kind!==i.kind||s.offset!==n.offset+o.value.length||o.value.length+i.value.length>Gv)return;const r=o.value+i.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const N5=["blue","mono"],I5=["light","dark","system"],$5=14,epe=12,tpe=20;function npe(){const e=us(Ft.accent);return e&&N5.includes(e)?e:"blue"}function spe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function ope(){const e=us(Ft.colorScheme);return e&&I5.includes(e)?e:"system"}function ipe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function Uk(e){return Number.isFinite(e)?Math.min(tpe,Math.max(epe,Math.round(e))):$5}function rpe(){const e=us(Ft.uiFontSize);return e===null?$5:Uk(Number(e))}function lpe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Uk(e)}px`)}const qk=X(ope()),jk=X(npe()),Vk=X(rpe());Ze(qk,ipe,{immediate:!0});Ze(jk,spe,{immediate:!0});Ze(Vk,lpe,{immediate:!0});function ape(e){I5.includes(e)&&(qk.value=e,ms(Ft.colorScheme,e))}function cpe(e){N5.includes(e)&&(jk.value=e,ms(Ft.accent,e))}function upe(e){const t=Uk(e);Vk.value=t,ms(Ft.uiFontSize,String(t))}const dpe=600,fpe=250,zm=250,hpe=1e3,ppe=160,Fp=X(!1);let fa=[],ga=null,Op=-zm;function mpe(){fa=[],Op=-zm,Fp.value=!1,ga!==null&&(clearTimeout(ga),ga=null)}function gpe(){Fp.value=!0,ga!==null&&clearTimeout(ga),ga=setTimeout(()=>{ga=null,fa=[],Op=-zm,Fp.value=!1},hpe)}function vpe(e){if(e<=0)return;const t=Date.now();fa.push({time:t,chars:e});const n=t-dpe;if(fa=fa.filter(l=>l.time>=n),t-Op<zm)return;Op=t;const s=fa[0]?.time??t,o=Math.max(t-s,fpe);fa.reduce((l,a)=>l+a.chars,0)/o*1e3>=ppe&&gpe()}function L5(){return{colorScheme:qk,accent:jk,uiFontSize:Vk,fastMoon:Fp,setColorScheme:ape,setAccent:cpe,setUiFontSize:upe,resetFastMoon:mpe,recordMoonDelta:vpe}}function ype(e,t,n){return e==="idle"&&!t&&!n}function Kk(e,t){const n=us(e);return n===null?t:n==="1"}const Gk=X(Kk(Ft.notifyOnComplete,!0)),Yk=X(Kk(Ft.notifyOnQuestion,!1)),Zk=X(Kk(Ft.notifyOnApproval,!1)),Qk=X(typeof Notification<"u"?Notification.permission:"denied"),kpe="/favicon.ico";async function Xk(e,t,n){if(!n){e.value=!1,ms(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}Qk.value=s,s==="granted"&&(e.value=!0,ms(t,"1"))}function bpe(e){return Xk(Gk,Ft.notifyOnComplete,e)}function xpe(e){return Xk(Yk,Ft.notifyOnQuestion,e)}function wpe(e){return Xk(Zk,Ft.notifyOnApproval,e)}function Jk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function _pe(e){return{title:Cn.global.t("settings.notifyTitle"),body:Jk(e,Cn.global.t("settings.notifyFallback"))}}function Spe(e,t){return{title:Cn.global.t("settings.notifyQuestionTitle"),body:Jk(t,e,Cn.global.t("settings.notifyQuestionFallback"))}}function Cpe(e,t){return{title:Cn.global.t("settings.notifyApprovalTitle"),body:Jk(t,e,Cn.global.t("settings.notifyApprovalFallback"))}}function e2(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{Qk.value=i,i==="granted"&&jC(t,n,s)});return}jC(t,n,s)}}function jC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:kpe});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function Ape(e,t){e2(Gk.value,t,_pe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function Mpe(e){e2(Yk.value,e,Spe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Epe(e){e2(Zk.value,e,Cpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function Tpe(){return{notifyOnComplete:Gk,notifyOnQuestion:Yk,notifyOnApproval:Zk,notifyPermission:Qk,setNotifyOnComplete:bpe,setNotifyOnQuestion:xpe,setNotifyOnApproval:wpe,maybeNotifyCompletion:Ape,maybeNotifyQuestion:Mpe,maybeNotifyApproval:Epe}}function Npe(){return us(Ft.soundOnComplete)==="1"}const ou=X(Npe());function Ipe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let gg=null;function F5(){const e=Ipe();if(!e)return null;if(gg===null)try{gg=new e}catch{return null}return gg}function O5(){if(!ou.value)return;const e=F5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Cr("sound: audio context resumed",{state:e.state})},t=>{Cr("sound: audio context resume rejected",{error:String(t)})})}let VC=!1;function $pe(){if(VC||typeof window>"u")return;VC=!0;const e=()=>{O5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}$pe();function Lpe(e){ou.value=e,ms(Ft.soundOnComplete,e?"1":"0"),e&&O5()}function KC(e,t,n,s,o){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(o,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+s),i.start(l),i.stop(l+s+.02)}function t2(){const e=F5();if(e===null){Cr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Cr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Cr("sound: context resumed for next time",{state:e.state})},t=>{Cr("sound: resume rejected",{error:String(t)})});return}try{KC(e,880,0,.16,.18),KC(e,1320,.1,.22,.16),Cr("sound: chime scheduled",{state:e.state})}catch(t){Cr("sound: failed to play",{error:String(t)})}}function Fpe(){ou.value&&t2()}function Ope(){ou.value&&t2()}function Rpe(){ou.value&&t2()}function Bpe(){return{soundOnComplete:ou,setSoundOnComplete:Lpe,maybePlayCompletionSound:Fpe,maybePlayQuestionSound:Ope,maybePlayApprovalSound:Rpe}}const Dpe=1e3,Ppe=4096,GC=32*1024;function Hpe(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await ut().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:qC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=ut(),b=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const k=await m.getTask(f,g.id,{withOutput:!0,outputBytes:GC});k.outputPreview!==void 0&&b.set(g.id,{preview:k.outputPreview,bytes:k.outputBytes})}catch{}finally{o.add(g.id)}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(g=>{const y=b.get(g.id);return y?{...g,outputPreview:y.preview,outputBytes:y.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=ut();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",E=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!E)&&!(E&&(o.has(y.id)||(y.outputLines?.length??0)>0)))try{const L=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?Ppe:GC});L.outputPreview!==void 0&&m.set(y.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{E&&o.add(y.id)}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),g=p.map(y=>{const k=v.get(y.id),E=m.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:E?.preview??k?.outputPreview,outputBytes:E?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:qC(g,b)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Dpe))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=X(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 h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function Wpe(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 zpe(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
302
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Wpe(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const Zv="/sessions/";function YC(e){const{pathname:t}=e;if(!t.startsWith(Zv))return;const n=t.slice(Zv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Upe(e){return e===void 0||e.length===0?"/":`${Zv}${encodeURIComponent(e)}`}const qpe=50,Qv=5,jpe=40402,Vpe=40410,Kpe=40902,Gpe=2e3;function vg(e){return tr(e)&&e.code===Kpe}const Ype=40904;function Zpe(e){return tr(e)&&e.code===Ype}const ra=Ps({}),rh=Ps({}),yg=Ps({}),Vi=Ps(new Set),Um=new Map,Ea=new Map,Rp=new Map;let Qpe=0;function Xpe(e){return{generation:Um.get(e)??0,pending:(Ea.get(e)?.size??0)>0}}function Xv(e){const t=++Qpe;Um.set(e,t);const n=Ea.get(e)??new Set;return n.add(t),Ea.set(e,n),t}function Jv(e,t){const n=Ea.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Ea.delete(e);const s=Rp.get(e);Rp.delete(e),s?.()}function Jpe(e){Um.delete(e),Ea.delete(e),Rp.delete(e)}function eme(e,t){return!t.pending&&t.generation===(Um.get(e)??0)}function tme(e,t){if((Ea.get(e)?.size??0)===0){t();return}Rp.set(e,t)}function nme(e,t){const{t:n}=Cn.global,{confirm:s}=zr(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:h,appendSession:p,forgetSession:m,setActiveSessionId:b,updateSessionMessages:v,nextOptimisticMsgId:g,getEventConn:y,syncSessionFromSnapshot:k,reopenSession:E,hasLoadedMessages:L,refreshSessionStatus:$,refreshSessionGoal:w,persistSessionProfile:M,mergedWorkspaces:N,workspacesView:F,status:S,workspaceIdForSession:I,savePermissionToStorage:B,savePlanModeToStorage:R,saveSwarmModeToStorage:P,saveGoalModeToStorage:z,draftModes:W,saveUnread:ee,saveActiveWorkspaceToStorage:U,saveHiddenWorkspacesToStorage:Y,goalErrorMessage:ue,resetFastMoon:fe,initialized:oe,connectIssue:Z,selectedDiffPath:te,fileDiffLines:ae,fileDiffLoading:He}=t;let he=!1;async function K(J){if(e.messagesLoadingMoreBySession[J])return;const _e=e.messagesBySession[J];if(!_e||_e.length===0)return;const we=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[J]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[J]:!1};try{const Le=await ut().listMessages(J,{beforeId:we,pageSize:qpe}),Ke=[...Le.items].reverse();v(J,ot=>[...Ke,...ot]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[J]:Le.hasMore}}catch(Le){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[J]:!0},l("loadOlderMessages",Le,{sessionId:J})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[J]:!1}}}function ce(J){o.loadTasksForSession(J),se(J),$(J),w(J),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,J)||r.loadSkillsForSession(J)}async function ge(J){const _e=e.activeSessionId;if(_e){te.value=J,ae.value=[],He.value=!0;try{const Le=await ut().getFileDiff(_e,J);if(te.value!==J)return;ae.value=zpe(Le.diff)}catch(we){te.value===J&&(ae.value=[]),console.warn("[loadFileDiff] diff unavailable for",J,we)}finally{te.value===J&&(He.value=!1)}}}function q(){te.value=null,ae.value=[],He.value=!1}async function se(J){try{const we=await ut().getGitStatus(J);e.gitStatusBySession={...e.gitStatusBySession,[J]:we}}catch{}}async function ye(){try{const _e=await ut().getAuth();return e.authReady=_e.ready,e.defaultModel=_e.defaultModel,e.managedProviderStatus=_e.managedProvider?.status??null,Z.value=null,"proceed"}catch(J){return tr(J)&&(J.code===401||J.code===m5)?(Z.value=null,"server-auth-required"):(Z.value=(J instanceof Error?J.message:String(J)).slice(0,140),"retry")}}async function de(){let J=!0;for(;;){const _e=await ye();if(_e!=="retry")return _e;J&&(Z.value=null,J=!1),await new Promise(we=>{setTimeout(we,Gpe)})}}async function ke(){try{const J=ut();e.config=await J.getConfig()}catch{}}async function j(J){try{const we=await ut().setConfig(J);return e.config=we,e.defaultModel=we.defaultModel??null,!0}catch(_e){return l("setConfig",_e),!1}}const ne=100,ve=30,Ae=720*60*1e3;async function $e(){const J=ut(),_e=[];let we,Le;for(;;){let Ke;try{Ke=await J.listSessions({pageSize:ne,beforeId:we,excludeEmpty:!0})}catch(ot){if(_e.length===0)throw ot;Le=ot;break}if(_e.push(...Ke.items),!Ke.hasMore||Ke.items.length===0)break;we=Ke.items[Ke.items.length-1].id}return{sessions:_e,error:Le}}function Oe(J){const _e=new Map(e.sessions.map(we=>[we.id,we.usage]));d(J.map(we=>{const Le=_e.get(we.id);return Le!==void 0&&Bv(we.usage)&&!Bv(Le)?{...we,usage:Le}:we}))}function pe(J){const _e=[...J],we=new Set(_e.map(Le=>Le.id));for(const Le of e.sessions)we.has(Le.id)||(_e.push(Le),we.add(Le.id));return _e.sort((Le,Ke)=>new Date(Ke.updatedAt).getTime()-new Date(Le.updatedAt).getTime()),_e}async function Ie(J){const _e=ut(),we=[],Le=Date.now(),Ke=tn=>Le-new Date(tn.updatedAt).getTime();let ot,Tt=!1,zt=!0,Wn;for(;;){let tn;try{tn=await _e.listSessions({workspaceId:J,pageSize:Qv,beforeId:ot,excludeEmpty:!0})}catch(mt){if(zt)throw mt;Wn=mt,Tt=!0;break}if(Tt=tn.hasMore,tn.items.length===0)break;const ks=tn.items[tn.items.length-1],ao=Ke(ks)>=Ae;if(!zt&&ao){const mt=tn.items.findIndex(Sn=>Ke(Sn)>=Ae),jt=mt>=0?mt+1:tn.items.length;we.push(...tn.items.slice(0,jt)),Tt=tn.hasMore||jt<tn.items.length;break}if(we.push(...tn.items),zt=!1,!tn.hasMore||ao)break;ot=ks.id}return{workspaceId:J,page:{items:we,hasMore:Tt},error:Wn}}async function Xe(){const J=e.workspaces;if(J.length===0){const mt=await $e(),jt=mt.error===void 0?mt.sessions:pe(mt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=mt.error===void 0,mt.error!==void 0&&l("load",mt.error),jt}const _e=await Promise.allSettled(J.map(mt=>Ie(mt.id))),we=[],Le=new Set,Ke=new Map,ot=new Set;let Tt;for(let mt=0;mt<_e.length;mt++){const jt=_e[mt];if(jt.status==="fulfilled"){Ke.set(jt.value.workspaceId,jt.value.page),jt.value.error!==void 0&&(ot.size===0&&(Tt=jt.value.error),ot.add(jt.value.workspaceId));for(const Sn of jt.value.page.items)Le.has(Sn.id)||(we.push(Sn),Le.add(Sn.id));continue}ot.size===0&&(Tt=jt.reason),ot.add(J[mt].id)}if(Ke.size===0){l("load",Tt);return}const zt=new Set(J.filter(mt=>ot.has(mt.id)).map(mt=>mt.root)),Wn=new Set(J.map(mt=>mt.id));for(const mt of e.sessions)!(mt.workspaceId!==void 0&&Wn.has(mt.workspaceId)?ot.has(mt.workspaceId):zt.has(mt.cwd)||ot.has(I(mt)))||Le.has(mt.id)||(we.push(mt),Le.add(mt.id));const tn={},ks={},ao={};for(const{id:mt}of J){const jt=Ke.get(mt);if(jt===void 0){const Sn=e.sessionsHasMoreByWorkspace[mt],is=e.sessionsCursorByWorkspace[mt],rs=e.sessionsInitialCountByWorkspace[mt];Sn!==void 0&&(tn[mt]=Sn),is!==void 0&&(ks[mt]=is),rs!==void 0&&(ao[mt]=rs);continue}tn[mt]=jt.hasMore,ks[mt]=jt.items.length>0?jt.items[jt.items.length-1].id:void 0,ao[mt]=Math.max(jt.items.length,Qv)}return e.sessionsHasMoreByWorkspace=tn,e.sessionsCursorByWorkspace=ks,e.sessionsInitialCountByWorkspace=ao,e.sessionsFullyLoaded=!1,we.sort((mt,jt)=>new Date(jt.updatedAt).getTime()-new Date(mt.updatedAt).getTime()),ot.size>0&&l("load",Tt),we}async function it(J){if(e.sessionsLoadingMoreByWorkspace[J]||e.sessionsHasMoreByWorkspace[J]===!1)return;const _e=e.sessionsCursorByWorkspace[J];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[J]:!0};try{const we=await ut().listSessions({workspaceId:J,pageSize:ve,beforeId:_e,excludeEmpty:!0}),Le=new Set(e.sessions.map(ot=>ot.id)),Ke=we.items.filter(ot=>!Le.has(ot.id));Ke.length>0&&d([...e.sessions,...Ke]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[J]:we.items.length>0?we.items[we.items.length-1].id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[J]:we.hasMore}}catch(we){l("loadMoreSessions",we)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[J]:!1}}}}async function At(){if(e.sessionsFullyLoaded)return;const J=await $e().catch(Le=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Le),null));if(J===null)return;const _e=J.error===void 0?J.sessions:pe(J.sessions);if(Oe(_e),e.sessionsFullyLoaded=J.error===void 0,J.error!==void 0)return;const we={};for(const Le of e.workspaces)we[Le.id]=!1;e.sessionsHasMoreByWorkspace=we}async function bt(){const J=await ut().getMeta().catch(()=>null);J!==null&&(e.serverVersion=J.serverVersion,e.availableOpenInApps=J.openInApps,e.dangerousBypassAuth=J.dangerousBypassAuth,e.backend=J.backend)}async function wt(){const J=Date.now();let _e="accepted";ws("app:load:start"),e.loading=!0;const we=!oe.value;let Le=!0;try{if(we&&await de()==="server-auth-required"){Le=!1,_e="auth-required";return}const Ke=ut();await Promise.all([Ke.getHealth().catch(()=>null),bt(),r.loadModels()]),we||await ye(),await ke(),await qt();const ot=await Xe(),Tt=ot??e.sessions;ot!==void 0&&Oe(ot);const zt=Tt[0],Wn=e.activeWorkspaceId;!(Wn!==null&&N.value.some(ao=>ao.id===Wn))&&zt&&Kt(I(zt)),Gn();const ks=typeof window<"u"?YC(window.location):void 0;!e.activeSessionId&&ks!==void 0&&(e.sessions.some(mt=>mt.id===ks)||await yn(ks))&&await Nn(ks,{urlMode:"replace"}),!e.activeSessionId&&Tt.length>0&&await Nn(Tt[0].id,{urlMode:"replace"})}catch(Ke){_e="failed",l("load",Ke)}finally{e.loading=!1,Le&&(oe.value=!0),ws("app:load:complete",{status:_e,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-J})}}async function qt(){try{const J=ut(),[_e,we]=await Promise.all([J.listWorkspaces().catch(()=>[]),J.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=yt(_e),e.fsHome=we.home||null,e.recentRoots=we.recentRoots}catch{}}function yt(J){const _e=Of();return Object.keys(_e).length===0?J:J.map(we=>{const Le=_e[we.root];return Le!==void 0?{...we,name:Le}:we})}function Kt(J){e.activeWorkspaceId=J,U(J)}function gs(J){Kt(J);const _e=e.sessions.filter(we=>I(we)===J);if(_e.length>0){const we=_e[0];we&&we.id!==e.activeSessionId&&Nn(we.id)}else b(void 0),Tn(void 0,"push")}function En(J){const _e=Of()[J.root],we=_e!==void 0?{...J,name:_e}:J;e.hiddenWorkspaceRoots.includes(we.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(ot=>ot!==we.root),Y(e.hiddenWorkspaceRoots));const Le=e.workspaces.findIndex(ot=>ot.id===we.id||ot.root===we.root);if(Le===-1){e.workspaces=[we,...e.workspaces];return}const Ke=[...e.workspaces];Ke[Le]=we,e.workspaces=Ke}function Jt(J){if(J.type==="workspaceCreated"||J.type==="workspaceUpdated"){En(J.workspace);return}const _e=e.workspaces.find(Le=>Le.id===J.workspaceId)?.root??J.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],Y(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Le=>Le.id!==J.workspaceId&&Le.root!==_e),e.activeWorkspaceId===J.workspaceId||e.activeWorkspaceId===_e){const Le=F.value[0]?.id??null;if(e.activeWorkspaceId=Le,Le)U(Le);else try{Kc(Ft.activeWorkspace)}catch{}b(void 0),e.sessionLoading=!1,q(),Tn(void 0,"replace")}}function wn(){b(void 0),Tn(void 0,"push")}function vs(J){Kt(J),wn(),q()}async function st(J){const _e=N.value.find(tn=>tn.id===J);if(!_e)return null;const we=ut();let Le,Ke=_e.root;try{const tn=await we.addWorkspace({root:_e.root});Le=tn.id,Ke=tn.root,En(tn)}catch{}const ot=r.draftModel.value??void 0,Tt=await we.createSession({workspaceId:Le,cwd:Ke,model:ot});r.draftModel.value=null;const zt=ot!==void 0&&(!Tt.model||Tt.model.length===0)?{...Tt,model:ot}:Tt;h(zt),Kt(Tt.workspaceId??Le??J),await Nn(Tt.id);const Wn=Tt.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[Wn]:!0},R()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Wn]:!0},P()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Wn]:!0},z()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,Wn}async function Bn(J,_e,we){if(!Vi.has(J)){Vi.add(J);try{const Le=await st(J);if(!Le)return;await Pn(Le,_e,we)}catch(Le){l("startSessionAndSendPrompt",Le)}finally{Vi.delete(J)}}}async function Es(J,_e,we){if(!Vi.has(J)){Vi.add(J);try{const Le=await st(J);if(!Le)return;const Ke=e.planModeBySession[Le]??!1,ot=e.swarmModeBySession[Le]??!1,Tt=e.sessions.find(Wn=>Wn.id===Le),zt=(Tt?.model&&Tt.model.length>0?Tt.model:e.defaultModel)??void 0;await M({model:zt,planMode:Ke,swarmMode:ot,permissionMode:e.permission,thinking:e.thinking},Le),await r.activateSkill(_e,we,Le)}catch(Le){l("startSessionAndActivateSkill",Le)}finally{Vi.delete(J)}}}async function Dn(J,_e){if(!Vi.has(J)){Vi.add(J);try{const we=await st(J);if(!we)return;await i.openSideChatOn(we,_e)}catch(we){l("startSessionAndOpenSideChat",we)}finally{Vi.delete(J)}}}async function Hs(J){const _e=J.trim();if(!_e)return!1;const we=ut();try{const Le=await we.addWorkspace({root:_e});return En(Le),vs(Le.id),!0}catch(Le){return console.warn("[kimi-web] addWorkspaceByPath failed for",_e,Le),!1}}async function Ws(J){try{return await ut().browseFs(J)}catch{return{path:"",parent:null,entries:[]}}}async function Qn(){try{return await ut().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Tn(J,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const we=Upe(J);if(window.location.pathname!==we)try{_e==="push"?window.history.pushState(null,"",we):window.history.replaceState(null,"",we)}catch{}}async function yn(J){try{const _e=await ut().getSession(J);return e.sessions.some(we=>we.id===_e.id)||p(_e),!0}catch{return!1}}function jn(){const J=YC(window.location);if(J===void 0){b(void 0);return}if(J!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===J)){Nn(J,{urlMode:"none"});return}(async()=>{if(await yn(J)){await Nn(J,{urlMode:"none"});return}const _e=e.sessions[0];_e?await Nn(_e.id,{urlMode:"replace"}):(b(void 0),Tn(void 0,"replace"))})()}}let ds=!1;function Gn(){ds||typeof window>"u"||(ds=!0,window.addEventListener("popstate",jn))}async function Nn(J,_e){const we=L(J),Le=!we&&u.has(J);u.delete(J);try{Tn(J,_e?.urlMode??"push"),e.sessionLoading=!we&&!Le,b(J),fe(),e.unreadBySession[J]&&(e.unreadBySession={...e.unreadBySession,[J]:!1},ee({[J]:!1})),q();const Ke=e.sessions.find(ot=>ot.id===J);if(Ke){const ot=I(Ke);e.activeWorkspaceId!==ot&&Kt(ot)}if(we){if(await E(J)==="not-found")return}else if(await k(J)==="not-found")return;ce(J)}catch(Ke){l("selectSession",Ke,{sessionId:J})}finally{e.activeSessionId===J&&(e.sessionLoading=!1)}}async function Pn(J,_e,we){const Le=Xv(J);c.add(J),e.sendingBySession={...e.sendingBySession,[J]:!0};const Ke=g();try{const ot=ut(),Tt=[];_e&&Tt.push({type:"text",text:_e});for(const Sn of we??[])Sn.kind==="video"?Tt.push({type:"video",source:{kind:"file",fileId:Sn.fileId}}):Tt.push({type:"image",source:{kind:"file",fileId:Sn.fileId}});if(Tt.length===0)return c.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},!1;const zt={id:Ke,sessionId:J,role:"user",content:Tt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};v(J,Sn=>[...Sn,zt]);const Wn=e.sessions.find(Sn=>Sn.id===J),tn=(Wn?.model&&Wn.model.length>0?Wn.model:e.defaultModel)??void 0,ks=e.planModeBySession[J]??!1,ao=e.swarmModeBySession[J]??!1,mt=e.goalModeBySession[J]??!1;if(mt&&_e)try{await ot.updateSession(J,{goalObjective:_e.trim()})}catch(Sn){return l("createGoal",Sn,{sessionId:J}),c.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},v(J,is=>is.some(rs=>rs.id===Ke)?is.filter(rs=>rs.id!==Ke):is),!1}const jt=await ot.submitPrompt(J,{content:Tt,model:tn,thinking:e.thinking,permissionMode:e.permission,planMode:ks,swarmMode:ao});return mt&&(e.goalModeBySession={...e.goalModeBySession,[J]:!1},z()),e.promptIdBySession={...e.promptIdBySession,[J]:jt.promptId},v(J,Sn=>{const is=Sn.findIndex(ir=>ir.id===Ke);if(is===-1)return Sn;const rs=[...Sn];return rs[is]={...rs[is],promptId:rs[is].promptId??jt.promptId},rs}),y()?.bindNextPromptId(J,jt.promptId),!0}catch(ot){return c.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},v(J,Tt=>Tt.some(zt=>zt.id===Ke)?Tt.filter(zt=>zt.id!==Ke):Tt),l("sendPrompt",ot,{sessionId:J}),!1}finally{Jv(J,Le)}}async function Pt(J,_e){const we=e.activeSessionId;if(we){if(a.value!=="idle"||c.has(we)){Lt(J,_e);return}await Pn(we,J,_e)}}async function Ye(J,_e){const we=e.activeSessionId;if(!we)return;const Le=e.queuedBySession[we]??[],Ke=[],ot=[];for(const mt of Le){const jt=mt.text.trim();jt&&Ke.push(jt),mt.attachments?.length&&ot.push(...mt.attachments)}const Tt=J.trim();if(Tt&&Ke.push(Tt),_e?.length&&ot.push(..._e),Ke.length===0&&ot.length===0)return;Le.length>0&&(e.queuedBySession={...e.queuedBySession,[we]:[]});const zt=Ke.join(`
|
|
303
|
-
|
|
304
|
-
`);if(a.value==="idle"&&!c.has(we)){await Pn(we,zt,ot);return}const Wn=[];zt&&Wn.push({type:"text",text:zt});for(const mt of ot)mt.kind==="video"?Wn.push({type:"video",source:{kind:"file",fileId:mt.fileId}}):Wn.push({type:"image",source:{kind:"file",fileId:mt.fileId}});const tn=g(),ks={id:tn,sessionId:we,role:"user",content:Wn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};v(we,mt=>[...mt,ks]);const ao=Xv(we);try{const mt=ut(),jt=e.sessions.find(rs=>rs.id===we),Sn=(jt?.model&&jt.model.length>0?jt.model:e.defaultModel)??void 0,is=await mt.submitPrompt(we,{content:Wn,model:Sn,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[we]??!1,swarmMode:e.swarmModeBySession[we]??!1});if(v(we,rs=>{const ir=rs.findIndex(Jd=>Jd.id===tn);if(ir===-1)return rs;const Wl=[...rs];return Wl[ir]={...Wl[ir],promptId:Wl[ir].promptId??is.promptId},Wl}),is.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[we]:is.promptId},y()?.bindNextPromptId(we,is.promptId);return}try{await mt.steerPrompts(we,[is.promptId])}catch{}}catch(mt){v(we,jt=>jt.filter(Sn=>Sn.id!==tn)),l("steer",mt,{sessionId:we})}finally{Jv(we,ao)}}async function qe(J,_e){try{const Le=await ut().uploadFile({file:J,name:_e});return{fileId:Le.id,name:Le.name,mediaType:Le.mediaType}}catch(we){return l("uploadImage",we),null}}function Lt(J,_e){const we=e.activeSessionId;if(!we)return;const Le=e.queuedBySession[we]??[];e.queuedBySession={...e.queuedBySession,[we]:[...Le,{text:J,attachments:_e}]}}function Ht(J){const _e=c.delete(J);if(e.sendingBySession={...e.sendingBySession,[J]:!1},e.promptIdBySession[J]!==void 0){const Le={...e.promptIdBySession};delete Le[J],e.promptIdBySession=Le}J===e.activeSessionId&&fe();const we=e.queuedBySession[J]??[];if(we.length>0){const[Le,...Ke]=we;e.queuedBySession={...e.queuedBySession,[J]:Ke},Le!==void 0&&Pn(J,Le.text,Le.attachments).then(ot=>{if(!ot){const Tt=e.queuedBySession[J]??[];e.queuedBySession={...e.queuedBySession,[J]:[Le,...Tt]}}})}return _e}function sn(J,_e){_e.inFlightTurn===null&&(_e.status!=="idle"&&_e.status!=="aborted"||Ht(J))}async function Zt(){const J=e.activeSessionId;if(!J)return;const _e=e.sessions.find(Ke=>Ke.id===J);let we=e.promptIdBySession[J];if(we===void 0){const Ke=_e?.currentPromptId;Ke!==void 0&&Ke.length>0&&!Ke.startsWith("pr_")&&(we=Ke)}const Le=ut();if(we!==void 0)try{if((await Le.abortPrompt(J,we)).aborted)return;const ot={...e.promptIdBySession};delete ot[J],e.promptIdBySession=ot}catch(Ke){if(tr(Ke)&&Ke.code===jpe){const ot={...e.promptIdBySession};delete ot[J],e.promptIdBySession=ot}else{l("abortCurrentPrompt",Ke,{sessionId:J});return}}try{await Le.abortSession(J)}catch(Ke){l("abortCurrentPrompt",Ke,{sessionId:J})}}function _n(J,_e){const we=e.approvalsBySession[J]??[];e.approvalsBySession={...e.approvalsBySession,[J]:we.filter(Le=>Le.approvalId!==_e)}}function on(J,_e){const we=e.questionsBySession[J]??[];e.questionsBySession={...e.questionsBySession,[J]:we.filter(Le=>Le.questionId!==_e)}}async function Et(J,_e){const we=e.activeSessionId;if(we&&!rh[J]){rh[J]=!0;try{const Le=ut(),Ke={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await Le.respondApproval(we,J,Ke),_n(we,J)}catch(Le){vg(Le)?_n(we,J):l("respondApproval",Le,{sessionId:we})}finally{delete rh[J]}}}async function ns(J,_e){const we=e.activeSessionId;if(we&&!ra[J]){ra[J]="answer";try{await ut().respondQuestion(we,J,_e),on(we,J)}catch(Le){vg(Le)?on(we,J):l("respondQuestion",Le,{sessionId:we})}finally{delete ra[J]}}}async function ss(J){const _e=e.activeSessionId;if(_e&&!ra[J]){ra[J]="dismiss";try{await ut().dismissQuestion(_e,J),on(_e,J)}catch(we){vg(we)?on(_e,J):l("dismissQuestion",we,{sessionId:_e})}finally{delete ra[J]}}}async function io(J){const _e=e.activeSessionId;if(_e&&!yg[J]){yg[J]=!0;try{await ut().cancelTask(_e,J);const Le=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:Le.map(Ke=>Ke.id===J?{...Ke,status:"cancelled"}:Ke)}}catch(we){Zpe(we)||l("cancelTask",we,{sessionId:_e})}finally{delete yg[J]}}}function Hn(J){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:J},R(),M({planMode:J})):W.planMode=J}function os(){const J=e.activeSessionId,_e=J?e.planModeBySession[J]??!1:W.planMode;Hn(!_e)}function oi(J){const _e=e.activeSessionId;_e?(e.swarmModeBySession={...e.swarmModeBySession,[_e]:J},P(),M({swarmMode:J})):W.swarmMode=J}async function Ls(){const J=e.activeSessionId,we=!(J?e.swarmModeBySession[J]??!1:W.swarmMode);we&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||oi(we)}function ii(J){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:J},z()):W.goalMode=J}function Co(){const J=e.activeSessionId,_e=J?e.goalModeBySession[J]??!1:W.goalMode;ii(!_e)}async function Di(J){const _e=J.trim();if(!_e||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;let we=e.activeSessionId;if(!we){const Le=e.activeWorkspaceId,Ke=Le&&F.value.some(ot=>ot.id===Le)?Le:F.value[0]?.id??null;if(!Ke)return;try{we=await st(Ke)??void 0}catch(ot){l("createGoal",ot);return}if(!we)return}try{await ut().updateSession(we,{goalObjective:_e})}catch(Le){l("createGoal",Le,{sessionId:we,message:ue(Le)});return}e.goalModeBySession[we]&&(e.goalModeBySession={...e.goalModeBySession,[we]:!1},z()),e.activeSessionId===we?await Pt(_e):await Pn(we,_e)}function ri(J){const _e=e.activeSessionId;_e&&Promise.resolve(ut().updateSession(_e,{goalControl:J})).catch(we=>{l("controlGoal",we,{sessionId:_e,message:ue(we)})})}function ys(J){e.permission=J,B(J),M({permissionMode:J})}function Ao(J){const _e=[...e.warnings];_e.splice(J,1),e.warnings=_e}async function or(J,_e){try{await ut().updateSession(J,{title:_e}),f(J,Le=>({...Le,title:_e}))}catch(we){l("renameSession",we,{sessionId:J})}}async function Pi(J,_e){const we=e.workspaces.find(Ke=>Ke.id===J)?.root,Le=()=>{e.workspaces=e.workspaces.map(Ke=>Ke.id===J?{...Ke,name:_e}:Ke)};try{if(await ut().updateWorkspace(J,{name:_e}),we!==void 0){const Ke=Of();we in Ke&&(delete Ke[we],Zx(Ke))}Le()}catch(Ke){if(we!==void 0&&tr(Ke)&&Ke.code===Vpe){Zx({...Of(),[we]:_e}),Le();return}l("renameWorkspace",Ke)}}async function fs(J){const _e=e.workspaces.find(ot=>ot.id===J)?.root??N.value.find(ot=>ot.id===J)?.root??J,we=e.activeSessionId?e.sessions.find(ot=>ot.id===e.activeSessionId):void 0,Le=e.activeWorkspaceId===J||e.activeWorkspaceId===_e,Ke=!!(we&&(we.cwd===_e||we.workspaceId===J||I(we)===J));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],Y(e.hiddenWorkspaceRoots));try{await ut().deleteWorkspace(J)}catch(ot){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",J,ot)}if(e.workspaces=e.workspaces.filter(ot=>ot.id!==J&&ot.root!==_e),Le||Ke){const ot=F.value[0]?.id??null;if(e.activeWorkspaceId=ot,ot)U(ot);else try{Kc(Ft.activeWorkspace)}catch{}}(Le||Ke)&&(b(void 0),e.sessionLoading=!1,q(),Tn(void 0,"replace"))}async function Fs(J){try{await ut().archiveSession(J),m(J),i.clearSideChatForSession(J);const{[J]:we,...Le}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Le,e.activeSessionId===J){const Ke=e.sessions[0];Ke?await Nn(Ke.id,{urlMode:"replace"}):(b(void 0),Tn(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:J})}}async function ro(J){if(he)return;const _e=J??e.activeSessionId;if(!_e){const Le=n("commands.export.noSession");ws("export:failed",{status:"no-session"}),l("exportSession",new Error(Le),{message:Le});return}he=!0;const we=Date.now();ws("export:start",{sessionId:_e});try{const Le=Dte(),{blob:Ke,fileName:ot}=await ut().exportSession(_e,Le);if(typeof document>"u")throw new Error("Document is unavailable");const Tt=URL.createObjectURL(Ke);let zt;try{zt=document.createElement("a"),zt.href=Tt,zt.download=ot,document.body.append(zt),zt.click()}finally{zt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Tt)}catch{}},0)}ws("export:accepted",{sessionId:_e,status:"accepted",zipBytes:Ke.size,durationMs:Date.now()-we})}catch(Le){const Ke=typeof Le=="object"&&Le!==null?Le:void 0;ws("export:failed",{sessionId:_e,status:"failed",durationMs:Date.now()-we,errorName:typeof Ke?.name=="string"?Ke.name:typeof Le,errorCode:typeof Ke?.code=="number"?Ke.code:void 0,requestId:typeof Ke?.requestId=="string"?Ke.requestId:void 0,phase:typeof Ke?.phase=="string"?Ke.phase:void 0,httpStatus:typeof Ke?.status=="number"?Ke.status:void 0}),l("exportSession",Le,{sessionId:_e})}finally{he=!1}}async function Os(J){try{const _e=await ut().restoreSession(J);return h(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:J}),!1}}function Mo(J){return ut().listSessions({archivedOnly:!0,beforeId:J?.beforeId,pageSize:J?.pageSize??50})}async function Vn(){try{await ut().logout(),await ye(),await wt()}catch(J){l("logout",J)}}function lt(J){const _e=e.activeSessionId;_e&&ut().compactSession(_e,J).catch(we=>{l("compact",we,{sessionId:_e})})}async function Q(J){const _e=J??e.activeSessionId;if(_e)try{const we=await ut().forkSession(_e);h(we),await Nn(we.id)}catch(we){l("fork",we,{sessionId:_e})}}async function me(J=1){const _e=e.activeSessionId;if(!_e)return null;const we=(()=>{const Le=e.messagesBySession[_e]??[];for(let Ke=Le.length-1;Ke>=0;Ke--){const ot=Le[Ke];if(ot.role==="user"&&!(ot.metadata?.origin&&ot.metadata.origin.kind!=="user"))return ot.content.filter(Tt=>Tt.type==="text").map(Tt=>Tt.text).join(`
|
|
305
|
-
`)}return null})();try{return await ut().undoSession(_e,J),await k(_e),we}catch(Le){return l("undo",Le,{sessionId:_e}),null}}function Je(J){const _e=e.activeSessionId;if(!_e)return;const we=e.queuedBySession[_e]??[];if(J<0||J>=we.length)return;const Le=[...we];Le.splice(J,1),e.queuedBySession={...e.queuedBySession,[_e]:Le}}function It(J,_e){const we=e.activeSessionId;if(!we)return;const Le=e.queuedBySession[we]??[];if(J===_e||J<0||J>=Le.length||_e<0||_e>=Le.length)return;const Ke=[...Le],[ot]=Ke.splice(J,1);ot!==void 0&&(Ke.splice(_e,0,ot),e.queuedBySession={...e.queuedBySession,[we]:Ke})}async function lo(J){const _e=e.activeSessionId;if(!_e)return[];try{return(await ut().listDirectory(_e,{path:J,includeGitStatus:!0})).items}catch{return[]}}async function be(J){const _e=e.activeSessionId;if(!_e)return null;try{const Le=await ut().readFile(_e,{path:J});return{path:Le.path,content:Le.content,encoding:Le.encoding,mime:Le.mime,languageId:Le.languageId,isBinary:Le.isBinary,size:Le.size,lineCount:Le.lineCount}}catch(we){return console.warn("[kimi-web] readFileContent failed for",J,we),null}}const Ce=10485760;function De(J){const _e=e.activeSessionId;return _e?ut().getFileDownloadUrl(_e,J):null}async function Ot(J,_e){const we=e.activeSessionId;if(!we)return!1;try{return await ut().openFile(we,{path:J,line:_e}),!0}catch(Le){return l("openFile",Le,{sessionId:we}),!1}}async function Bt(J){const _e=e.activeSessionId;if(!_e)return;const we=S.value.cwd||".";try{await ut().openInApp(_e,J,we)}catch(Le){l("openInApp",Le,{sessionId:_e})}}async function cn(J){const _e=e.activeSessionId;if(!_e)return!1;try{return await ut().revealFile(_e,{path:J}),!0}catch(we){return l("revealFile",we,{sessionId:_e}),!1}}async function Kn(J){if(/^(https?:|data:|blob:)/i.test(J))return J;const _e=e.activeSessionId;if(!_e)return J;let we=J;if(we.startsWith("/")){const Le=e.sessions.find(Ke=>Ke.id===_e)?.cwd;if(Le&&(we===Le||we.startsWith(Le.endsWith("/")?Le:`${Le}/`))){if(we=we.slice(Le.length).replace(/^\//,""),!we)return J}else return J}try{const Ke=await ut().readFile(_e,{path:we,length:Ce});return!Ke.isBinary||Ke.encoding!=="base64"||Ke.truncated?J:`data:${Ke.mime};base64,${Ke.content}`}catch{return J}}async function Eo(J){const _e=e.activeSessionId;if(!_e)return[];try{return(await ut().searchFiles(_e,{query:J,limit:20})).items.map(Ke=>({path:Ke.path,name:Ke.name}))}catch{return[]}}return{loadFileDiff:ge,clearFileDiff:q,loadGitStatus:se,checkAuth:ye,loadConfig:ke,updateConfig:j,listAllSessionsGlobal:$e,load:wt,refreshServerMeta:bt,loadWorkspaces:qt,loadMoreSessions:it,loadAllSessions:At,selectWorkspace:Kt,openWorkspace:gs,upsertWorkspacePreserveOrder:En,applyWorkspaceEvent:Jt,clearActiveSession:wn,openWorkspaceDraft:vs,startSessionAndSendPrompt:Bn,startSessionAndActivateSkill:Es,startSessionAndOpenSideChat:Dn,addWorkspaceByPath:Hs,browseFs:Ws,getFsHome:Qn,writeSessionUrl:Tn,fetchSessionIntoList:yn,onSessionRoutePopState:jn,bindSessionRoute:Gn,selectSession:Nn,submitPromptInternal:Pn,finishPromptLocal:Ht,localTurnStartState:Xpe,isLocalTurnSnapshotCurrent:eme,afterLocalTurnStartsSettle:tme,handleSessionSnapshot:sn,sendPrompt:Pt,steerPrompt:Ye,uploadImage:qe,enqueue:Lt,unqueue:Je,reorderQueue:It,abortCurrentPrompt:Zt,respondApproval:Et,respondQuestion:ns,dismissQuestion:ss,pendingQuestionActions:ra,pendingApprovalActions:rh,cancelTask:io,setPlanMode:Hn,togglePlanMode:os,setSwarmMode:oi,toggleSwarmMode:Ls,setGoalMode:ii,toggleGoalMode:Co,createGoal:Di,controlGoal:ri,setPermission:ys,dismissWarning:Ao,renameSession:or,renameWorkspace:Pi,deleteWorkspace:fs,archiveSession:Fs,exportSession:ro,restoreSession:Os,loadArchivedSessions:Mo,logout:Vn,compact:lt,forkSession:Q,undo:me,listDir:lo,readFileContent:be,getFileDownloadUrl:De,openWorkspaceFile:Ot,openInApp:Bt,revealWorkspaceFile:cn,resolveImageUrl:Kn,searchFiles:Eo,loadOlderMessages:K,refreshSessionSidecars:ce,isStartingFirstPrompt:()=>Vi.size>0}}const R5=Ft.starredModels;function sme(){try{const e=us(R5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function ome(e){try{ms(R5,JSON.stringify(e))}catch{}}function ime(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=X([]),d=X(sme()),f=X({}),h=X({}),p=X([]),m=X(null);function b(U){if(!(U==null||U.length===0))return u.value.find(Y=>Y.id===U)??u.value.find(Y=>Y.model===U)}function v(){const U=e.activeSessionId?e.sessions.find(ue=>ue.id===e.activeSessionId):void 0,Y=U===void 0?m.value??e.defaultModel:U.model||e.defaultModel;return b(Y)?.id??Y??void 0}function g(U){return e.thinking=U,U!==void 0&&l(U),U}function y(U){ut().setConfig({thinking:Yie(U)}).catch(Y=>n("setConfig",Y))}async function k(U){try{const ue=await ut().listSkills(U);f.value={...f.value,[U]:ue}}catch{}}async function E(U){try{const ue=await ut().listSkillsForWorkspace(U);h.value={...h.value,[U]:ue}}catch{}}async function L(){try{const U=ut();if(u.value=await U.listModels(),e.thinking===void 0){const Y=b(v());Y!==void 0&&(e.thinking=Wm(Y))}}catch(U){n("loadModels",U)}}async function $(){try{const U=await ut().refreshOAuthProviderModels();for(const Y of U.failed)n("refreshOAuthProviderModels",new Error(Y.reason),{message:Y.provider})}catch{}}async function w(){try{const U=ut();p.value=await U.listProviders()}catch(U){n("loadProviders",U)}}async function M(U){const Y=e.activeSessionId,ue=b(U),fe=e.thinking,oe=Y?e.sessions.find(ae=>ae.id===Y)?.model:void 0,Z=v()!==(ue?.id??U),te=Zie(ue,fe,Z);if(!Y)return m.value=U,g(te),te!==fe&&te!==void 0&&y(te),!0;a(Y,ae=>({...ae,model:U})),te!==fe&&g(te);try{await ut().updateSession(Y,{model:U,thinking:te!==fe?te:void 0})}catch(ae){return a(Y,He=>({...He,model:oe??He.model})),te!==fe&&g(fe),n("setModel",ae,{sessionId:Y}),!1}return te!==fe&&te!==void 0&&y(te),await s(Y),!0}function N(U){const Y=new Set(d.value);Y.has(U)?Y.delete(U):Y.add(U),d.value=Array.from(Y),ome(d.value)}async function F(U,Y,ue){const fe=ue??e.activeSessionId;if(!fe)return;const oe=i.value==="idle"&&!r.has(fe),Z=`msg_skill_opt_${Date.now().toString(36)}`,te=oe?Xv(fe):void 0;if(oe){r.add(fe),e.sendingBySession={...e.sendingBySession,[fe]:!0};const ae={id:Z,sessionId:fe,role:"user",content:[{type:"text",text:`/${U}${Y?` ${Y}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:U,skillArgs:Y}}};c(fe,He=>[...He,ae])}try{await ut().activateSkill(fe,U,Y)}catch(ae){oe&&(r.delete(fe),e.sendingBySession={...e.sendingBySession,[fe]:!1},c(fe,He=>He.filter(he=>he.id!==Z))),n("activateSkill",ae,{sessionId:fe})}finally{te!==void 0&&Jv(fe,te)}}async function S(U){try{await ut().addProvider(U),await Promise.all([w(),L()])}catch(Y){n("addProvider",Y)}}async function I(U){try{await ut().deleteProvider(U),await Promise.all([w(),L()])}catch(Y){n("deleteProvider",Y)}}async function B(U){try{const Y=await ut().refreshProvider(U);for(const ue of Y.failed)n("refreshProvider",new Error(ue.reason),{message:ue.provider});await Promise.all([w(),L()])}catch(Y){n("refreshProvider",Y)}}async function R(){try{const U=await ut().refreshAllProviders();for(const Y of U.failed)n("refreshAllProviders",new Error(Y.reason),{message:Y.provider});await Promise.all([w(),L()])}catch(U){n("refreshAllProviders",U)}}async function P(){try{return await ut().startOAuthLogin()}catch{return null}}async function z(){try{return await ut().pollOAuthLogin()}catch(U){return console.warn("[kimi-web] pollOAuthLogin failed",U),null}}async function W(){try{await ut().cancelOAuthLogin()}catch{}}function ee(U){const Y=g(U);o({thinking:Y}),Y!==void 0&&y(Y)}return{models:u,starredModelIds:d,providers:p,draftModel:m,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:k,loadSkillsForWorkspace:E,loadModels:L,refreshOAuthProviderModels:$,loadProviders:w,setModel:M,toggleStarModel:N,activateSkill:F,addProvider:S,deleteProvider:I,refreshProvider:B,refreshAllProviders:R,startOAuthLogin:P,pollOAuthLogin:z,cancelOAuthLogin:W,setThinking:ee}}const B5="kimiWeb.compaction",rme=/^read[_-]?media(?:file)?$/i,lme=/^data:([^;]+);base64,(.*)$/s,ame=/^<(image|video|audio)\s+path="([^"]+)">$/,cme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,ume=/Mime type:\s*([^.\s]+)/i,dme=/Size:\s*(\d+)\s*bytes/i,fme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,hme="<system>Image compressed to fit model limits:",pme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function mme(e){return e.includes(hme)?e.replace(pme,""):e}function gme(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function vme(e){const t=cme.exec(e.trim());return t?{kind:t[1],path:gme(t[2])}:null}const yme=/^f_[A-Za-z0-9]{10,}$/;function kme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return yme.test(s)?s:void 0}function bme(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function xme(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 wme(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function _me(e,t){if(!rme.test(e))return;const n=xme(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=ame.exec(h);p&&(o=p[1],s=p[2]);const m=ume.exec(h);m?.[1]&&(i=m[1]);const b=dme.exec(h);b?.[1]&&(r=Number(b[1]));const v=fme.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=wme(d);f&&(a=f)}if(a===null)return;const c=lme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=bme(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Sme(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
306
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
307
|
-
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
308
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
309
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Cme(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Ame(e,t){const n=e.split(`
|
|
310
|
-
`),s=t.split(`
|
|
311
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Mme(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Ame(t.old_text,t.new_text)}:{kind:"diff",path:s,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 s=typeof t.plan=="string"?t.plan:"",o=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:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Eme(e){const t=`<prompt>
|
|
312
|
-
`,n=`
|
|
313
|
-
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):Tme(e)}function Tme(e){const t=e.split(`
|
|
314
|
-
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
315
|
-
`):e}function Nme(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Ime(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
316
|
-
`);return Eme(t)}function $me(e,t){const n=e.metadata?.origin??{},s=Ime(e);return t==="cron_missed"?{text:s,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:s,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Lme(e,t,n){const{text:s,cron:o}=$me(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function Fme(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Ome(e){return e.metadata?.origin?.kind==="compaction_summary"}function Rme(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Bme(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 Dme(e){let t="",n="";const s=[],o=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?s.push(i.toolCallId):o.push(JSON.stringify(i));return s.sort(),o.sort(),{text:t,thinking:n,toolIds:s,rest:o}}function Pme(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function D5(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!s)for(let m=0;m<p.tools.length;m++){const b=p.tools[m];if(b.status!=="running")continue;const v={...b,status:"ok"};p.tools[m]=v;const g=p.blocks.find(y=>y.kind==="tool"&&y.tool.id===v.id);g&&g.kind==="tool"&&(g.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
|
|
317
|
-
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
318
|
-
`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=`
|
|
319
|
-
`+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
|
|
320
|
-
`+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const b=l.get(m.toolCallId),v={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?o[m.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=Mme(b),h.approvalId=b.approvalId)}else if(m.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===m.toolCallId);if(b!==-1){const v=h.tools[b],g={...v,status:m.isError?"error":"ok",output:Sme(m.output),media:m.isError?void 0:_me(v.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=Bme(g.output)),h.tools[b]=g;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===m.toolCallId);y&&y.kind==="tool"&&(y.tool=g)}}}function d(h,p){for(const m of p){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===m.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const g={...v,output:m.outputLines};h.tools[b]=g;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===m.toolCallId);y&&y.kind==="tool"&&(y.tool=g)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,m=h.source;if(m.kind==="url")return{url:m.url,kind:p};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:p};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:p,fileId:m.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(Ome(h)){c();const g=h.metadata?.[B5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
321
|
-
`),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=Nme(h);if(c(),g!==void 0){i.push(Lme(h,r++,g));continue}if(!Fme(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",E=y?.kind==="plugin_command"&&y?.trigger==="user-slash",L=[],$=[];for(const w of h.content){if(w.type==="text")if(k)L.push(y.skillArgs??"");else if(E)L.push(y.commandArgs??"");else{const N=vme(w.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const S=kme(N.path);if(S){$.push({url:n(S),kind:N.kind,alt:S,fileId:S});continue}}const F=mme(w.text);if(F!==w.text&&F.trim().length===0)continue;L.push(F)}const M=f(w);M&&$.push({url:M.url,kind:M.kind,alt:w.type==="file"?w.name:void 0,fileId:M.fileId})}i.push({id:h.id,role:"user",no:r++,text:L.join(`
|
|
322
|
-
`),images:$.length>0?$:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:E?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;Rme(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const b=a;if(b===null)continue;const v=Dme(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(g=>Pme(g,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function Hme(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=X({}),l=D(()=>{const M=e.activeSessionId;if(!M)return null;const N=r.value[M];return N?{parentId:M,agentId:N.agentId}:null}),a=D(()=>l.value?.parentId??null),c=D(()=>l.value!==null),u=D(()=>{const M=l.value;return M?!!e.sideChatSendingByAgent[M.agentId]:!1}),d=D(()=>{const M=l.value;return M?e.sideChatSendingByAgent[M.agentId]?!0:(e.tasksBySession[M.parentId]??[]).some(N=>N.id===M.agentId&&N.status==="running"):!1}),f=D(()=>{const M=l.value;if(!M)return[];const N=e.sideChatMessagesByAgent[M.agentId]??[];return D5(N,[],F=>ut().getFileUrl(F),d.value)});function h(M,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:N(e.sideChatMessagesByAgent[M]??[])}}function p(M,N){h(M,F=>[...F,N])}function m(M){h(M,N=>{const F=[...N].reverse().findIndex(I=>I.role==="user");if(F===-1)return N;const S=N.length-1-F;return N.filter((I,B)=>B!==S)})}function b(M,N){h(M,F=>{const S=[...F];for(let I=S.length-1;I>=0;I-=1){const B=S[I];if(B.role==="user")return S[I]={...B,promptId:B.promptId??N},S}return F})}function v(M,N,F){F&&h(M,S=>{const I=S.at(-1);if(I?.role==="assistant"){const B=I.content[0],R=B?.type==="text"?B.text:"";return[...S.slice(0,-1),{...I,content:[{type:"text",text:`${R}${F}`}]}]}return[...S,{id:s(),sessionId:N,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function g(M,N,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[M]:!1},!F)return;const I=(e.sideChatMessagesByAgent[M]??[]).at(-1);(I?.role==="assistant"&&I.content[0]?.type==="text"?I.content[0].text:"").trim().length>0||v(M,N,F)}async function y(M){const N=e.activeSessionId;N&&await k(N,M)}async function k(M,N){if(!r.value[M]){let F;try{({agentId:F}=await ut().startBtw(M))}catch(S){n("openSideChat",S,{sessionId:M});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[F]:e.sideChatMessagesByAgent[F]??[]},r.value={...r.value,[M]:{agentId:F}},o(),i()?.markSideChannelAgent(F)}N&&N.trim()&&await E(M,N.trim())}async function E(M,N){const F=r.value[M],S=N.trim();if(!F||!S)return;const I=M,B=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!0};const R={id:s(),sessionId:I,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(B,R);try{const P=e.sessions.find(ee=>ee.id===I),z=(P?.model&&P.model.length>0?P.model:e.defaultModel)??void 0,W=await ut().submitPrompt(I,{content:[{type:"text",text:S}],agentId:B,model:z,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[I]??!1,swarmMode:e.swarmModeBySession[I]??!1});b(B,W.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],W.userMessageId]}}catch(P){n("sendSideChatPrompt",P,{sessionId:I}),m(B),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!1}}}function L(){const M=e.activeSessionId;if(!M)return;const{[M]:N,...F}=r.value;r.value=F}async function $(M){const N=l.value;N&&await E(N.parentId,M)}function w(M){if(!r.value[M])return;const{[M]:N,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:v,finishSideChatAgent:g,openSideChat:y,openSideChatOn:k,closeSideChat:L,sendSideChatPrompt:$,clearSideChatForSession:w}}const Wme="kimiWeb.optimisticUserMessage",ZC="Sub Agent";function zme(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Ume(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function qme(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function kg(e){return e.role==="user"&&e.metadata?.[Wme]===!0}function jme(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Vme(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Kme=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function QC(e){let t="",n=0;for(const s of e.content)s.type==="text"?Kme.test(s.text.trim())?n+=1:t+=s.text:(s.type==="image"||s.type==="video"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Gme(e,t){const n=QC(e),s=QC(t);return n.text===s.text&&n.media===s.media}function Yme(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(kg(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(kg(o)&&Vme(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(kg(o)&&Gme(o,t))return s}return-1}function Zme(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Qme(e,t,n){const s=Ume(e);switch(qme(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[B5]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!jme(t.message)){const a=Yme(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}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=Zme(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===ZC&&a.description!==ZC?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;s.goalVersionBySession[o]=(s.goalVersionBySession[o]??0)+1,t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?Cn.global.t("warnings.errorLabel"):Cn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Xme(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Jme(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||$a(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Xme(a.status)}]:[]})}}return[]}const e1e=["queued","working","suspended","completed","failed"];function P5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function t1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function n1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:P5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=t1e();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function s1e(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of e1e)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function o1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const s=t.get(n.parentToolCallId)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:P5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,s)}for(const[n,s]of t)t.set(n,s.toSorted((o,i)=>o.swarmIndex-i.swarmIndex||o.id.localeCompare(i.id)));return t}const wr=L5(),Zi=Tpe(),Fd=Bpe(),H5=Ft.permission,W5=Ft.activeWorkspace,z5=Ft.thinking,U5=Ft.planMode,q5=Ft.swarmMode,j5=Ft.goalMode,XC=40401,V5=Ft.onboarded,i1e=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Kc(Ft.codeFont);Kc(Ft.theme);function r1e(){try{const e=us(H5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function l1e(e){try{ms(H5,e)}catch{}}function a1e(){try{const e=us(z5);if(e&&i1e.test(e))return e}catch{}}function c1e(e){try{ms(z5,e)}catch{}}function bg(e){const t=us(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const s={};for(const[o,i]of Object.entries(n))i===!0&&(s[o]=!0);return s}catch{return{}}}function n2(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ms(e,JSON.stringify(n))}catch{}}function K5(){n2(U5,Me.planModeBySession)}function G5(){n2(q5,Me.swarmModeBySession)}function Y5(){n2(j5,Me.goalModeBySession)}function u1e(){try{return us(W5)}catch{return null}}const Z5=Ft.hiddenWorkspaces;function d1e(){try{const e=us(Z5);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function f1e(e){try{ms(Z5,JSON.stringify(e))}catch{}}function h1e(e){try{ms(W5,e)}catch{}}function p1e(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Me=Ps({...zme(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:r1e(),thinking:a1e(),planModeBySession:bg(U5),swarmModeBySession:bg(q5),goalModeBySession:bg(j5),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Oy(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:u1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:d1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),qm=Ps({planMode:!1,swarmMode:!1,goalMode:!1});function Q5(e){Me.sessions=e}function jm(e,t){Me.sessions=Me.sessions.map(n=>n.id===e?t(n):n)}function m1e(e){Me.sessions=[e,...Me.sessions.filter(t=>t.id!==e.id)]}function g1e(e){Me.sessions=[...Me.sessions,e]}function v1e(e){Me.sessions=Me.sessions.filter(t=>t.id!==e)}function X5(){const e=Me.activeSessionId;e&&Me.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Me.unreadBySession={...Me.unreadBySession,[e]:!1},Ry({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ft.unread&&(Me.unreadBySession=Oy(),X5())});function ey(){if(_i===null||!_i.health().stale)return;ws("ws:stale-reconnect",{sessionId:Me.activeSessionId,status:"stale"}),Cr("ws: stale socket on focus, reconnecting",{activeSessionId:Me.activeSessionId}),_i.reconnect();const e=Me.activeSessionId;e&&Pp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(X5(),ey())});typeof window<"u"&&(window.addEventListener("focus",ey),window.addEventListener("online",ey));function s2(e){Me.activeSessionId=e}function y1e(e){Me.messagesBySession=e}function k1e(e,t){Me.messagesBySession={...Me.messagesBySession,[e]:t}}function J5(e,t){Me.messagesBySession={...Me.messagesBySession,[e]:t(Me.messagesBySession[e]??[])}}function b1e(e){const{[e]:t,...n}=Me.messagesBySession;Me.messagesBySession=n}function e8(e){_i?.unsubscribe(e),q1e(e),Bp.discard(({meta:t})=>t.sessionId===e),v1e(e),b1e(e),delete Me.approvalsBySession[e],delete Me.questionsBySession[e],delete Me.tasksBySession[e],delete Me.goalBySession[e],delete Me.gitStatusBySession[e],delete Me.lastSeqBySession[e],delete Me.compactionBySession[e],delete Me.messagesLoadingMoreBySession[e],delete Me.messagesHasMoreBySession[e],delete Me.messagesLoadMoreErrorBySession[e],delete ty[e],Dp.delete(e),Nh.delete(e),f8.delete(e),o2.delete(e),Jpe(e),delete Me.queuedBySession[e],delete Me.promptIdBySession[e],delete Me.sendingBySession[e],delete Me.planModeBySession[e],delete Me.swarmModeBySession[e],delete Me.goalModeBySession[e],K5(),G5(),Y5()}const t8=X(null),n8=X([]),s8=X(!1),o8=X(!1),i8=X(null);async function Zd(e){let t;try{t=await ut().getSessionStatus(e)}catch{return}jm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Me.swarmModeBySession={...Me.swarmModeBySession,[e]:t.swarmMode},Me.planModeBySession={...Me.planModeBySession,[e]:t.planMode}}async function x1e(e){const t=Me.goalVersionBySession[e]??0;let n;try{n=await ut().getSessionGoal(e)}catch{return}if((Me.goalVersionBySession[e]??0)!==t)return;const s={...Me.goalBySession};n===null||n.status==="complete"?delete s[e]:s[e]=n,Me.goalBySession=s}function r8(e,t){const n=t??Me.activeSessionId;return n?Promise.resolve(ut().updateSession(n,e)).then(()=>Zd(n)).catch(s=>{Qd("persistSessionProfile",s,{sessionId:n})}):Promise.resolve()}const l8=Ft.conversationToc;function w1e(){try{const e=us(l8);return e===null?!0:e==="true"}catch{return!0}}function _1e(e){try{ms(l8,e?"true":"false")}catch{}}const a8=X(w1e());function S1e(e){a8.value=e,_1e(e)}function C1e(e){try{return us(e)??""}catch{return""}}const c8=X(C1e(V5)==="1");function A1e(e){c8.value=e;try{ms(V5,e?"1":"0")}catch{}}let _i=null,JC=0;function u8(){return JC+=1,`msg_opt_${Date.now().toString(36)}_${JC}`}const o2=new Set;function M1e(e,t,n){const s={sessions:Me.sessions,activeSessionId:Me.activeSessionId,messagesBySession:Me.messagesBySession,approvalsBySession:Me.approvalsBySession,planReviewByToolCallId:Me.planReviewByToolCallId,questionsBySession:Me.questionsBySession,tasksBySession:Me.tasksBySession,goalBySession:Me.goalBySession,goalVersionBySession:Me.goalVersionBySession,lastSeqBySession:Me.lastSeqBySession,compactionBySession:Me.compactionBySession,config:Me.config,warnings:Me.warnings},o=Qme(s,e,{sessionId:t,seq:n});Q5(o.sessions),s2(o.activeSessionId),y1e(o.messagesBySession),Me.approvalsBySession=o.approvalsBySession,Me.planReviewByToolCallId=o.planReviewByToolCallId,Me.questionsBySession=o.questionsBySession,Me.tasksBySession=o.tasksBySession,Me.goalBySession=o.goalBySession,Me.goalVersionBySession=o.goalVersionBySession,Me.lastSeqBySession=o.lastSeqBySession,Me.compactionBySession=o.compactionBySession,Me.config=o.config??null,Me.warnings=o.warnings,e.type==="configChanged"&&(Me.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&($n.loadModels(),$n.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Me.swarmModeBySession={...Me.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Me.planModeBySession={...Me.planModeBySession,[e.sessionId]:e.planMode}))}function E1e(e,t){const n=Me.lastSeqBySession[t.sessionId]??0;M1e(e,t.sessionId,t.seq);const s=eo.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:o}=s,i=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&eo.appendSideChatAssistantText(o,i,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?eo.finishSideChatAgent(o,i):e.type==="taskProgress"&&e.taskId===o?eo.appendSideChatAssistantText(o,i,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&eo.finishSideChatAgent(o,i,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;Me.promptIdBySession[o]!==e.message.promptId&&(Me.promptIdBySession={...Me.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Me.activeSessionId&&wr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&t.seq>n&&Y0e(e.sessionId,e.status),e.type==="questionRequested"&&Z0e(e.sessionId,e.question),e.type==="approvalRequested"&&Q0e(e.sessionId,e.approval)}const Bp=Qhe(({appEvent:e,meta:t})=>E1e(e,t),({appEvent:e})=>Khe(e),{coalesce:Jhe});function d8(){if(_i!==null||typeof WebSocket>"u")return;ws("ws:connection",{status:"connecting"}),Me.connection="connecting",_i=ut().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ft.applyWorkspaceEvent(t);return}for(const s of Xhe({appEvent:t,meta:n}))Bp(s)},onResync(t,n,s){ws("ws:resync",{sessionId:t,status:"required",seq:n}),Bp.flush(),Dp.add(t),Pp.request(t)},onError(t,n,s){ws("ws:error",{status:"failed",errorCode:t,fatal:s}),i2({severity:"error",title:Cn.global.t("warnings.wsTitle"),message:n,details:[Xn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){ws("ws:connection",{status:t?"connected":"disconnected"}),Me.connected=t,Me.connection=t?"connected":"disconnected",t&&(R1e(),ft.refreshServerMeta())}})}const ty={},Dp=new Set,Nh=new Set,f8=new Set;function T1e(e){return tr(e)&&e.code===XC?!0:typeof e=="object"&&e!==null&&e.code===XC}function Xn(e,t){if(!(t==null||t===""))return{label:Cn.global.t(`warnings.details.${e}`),value:h8(t)}}function h8(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function N1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function I1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function $1e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function L1e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function e4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function F1e(e,t,n){const s=Nk(t),o=tr(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Xn("operation",e),Xn("sessionId",n??Me.activeSessionId),Xn("connection",Me.connection),Xn("timestamp",L1e(i??Date.now()))];return s?l.push(Xn("duration",e4(r)),Xn("request",`${t.method} ${t.path}`),Xn("endpoint",t.url),Xn("requestId",t.requestId),Xn("phase",t.phase),Xn("timeout",`${t.timeoutMs}ms`),Xn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Xn("contentType",t.contentType),Xn("responsePreview",t.bodyPreview),Xn("cause",t.cause)):o?l.push(Xn("duration",e4(r)),Xn("code",t.code),Xn("requestId",t.requestId),Xn("message",t.message),Xn("details",t.details)):l.push(Xn("errorName",N1e(t)),Xn("message",I1e(t)??h8(t)),Xn("stack",$1e(t))),l.filter(a=>a!==void 0)}function O1e(e,t,n={}){const s=Nk(t),o=tr(t),i=n.title??(s?Cn.global.t("warnings.daemonNetworkTitle"):o?Cn.global.t("warnings.daemonApiTitle"):Cn.global.t("warnings.operationFailedTitle")),r=n.message??(s?Cn.global.t("warnings.daemonNetworkMessage"):o?t.message:Cn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:F1e(e,t,n.sessionId)}}function i2(e){Me.warnings=[...Me.warnings,e]}function R1e(){const e=Cn.global.t("warnings.wsTitle"),t=Me.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Me.warnings.length&&(Me.warnings=t)}function Qd(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const s=tr(t),o=Nk(t);ws("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:s?t.code:void 0,requestId:s||o?t.requestId:void 0,phase:o?t.phase:void 0,httpStatus:o?t.status:void 0}),i2(O1e(e,t,n))}const B1e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function D1e(e){if(!tr(e))return;const t=B1e[e.code];return t?Cn.global.t(t):void 0}async function P1e(e){if(e8(e),Me.activeSessionId!==e)return;const t=Me.sessions[0];t?await ft.selectSession(t.id,{urlMode:"replace"}):(s2(void 0),Me.sessionLoading=!1,ft.writeSessionUrl(void 0,"replace"))}const t4=new Set;async function H1e(e){if(!t4.has(e)){t4.add(e);try{const t=await ut().getSessionWarnings(e),n=Cn.global.t("warnings.noteLabel");for(const s of t)i2(`${n}: ${s.message}`)}catch{}}}async function r2(e){const t=ft.localTurnStartState(e);try{const s=await ut().getSessionSnapshot(e);if(!Me.sessions.some(a=>a.id===e))return"ok";Bp.flush();const o=Me.lastSeqBySession[e]??0,i=ty[e];if(!(Dp.has(e)||Hp.has(e))&&i!==void 0&&i===s.epoch&&o>s.asOfSeq)return Nh.delete(e)||(Nh.add(e),Pp.request(e)),"ok";if(!ft.isLocalTurnSnapshotCurrent(e,t))return ft.afterLocalTurnStartsSettle(e,()=>{Pp.request(e)}),"ok";const l=Bv(s.session.usage);jm(e,a=>({...s.session,model:s.session.model&&s.session.model.length>0?s.session.model:a.model,usage:l?a.usage:s.session.usage})),k1e(e,Uhe(Me.messagesBySession[e]??[],s.messages)),Me.tasksBySession={...Me.tasksBySession,[e]:qhe(s.subagents,Me.tasksBySession[e]??[])},Me.messagesHasMoreBySession={...Me.messagesHasMoreBySession,[e]:s.hasMoreMessages},Me.approvalsBySession={...Me.approvalsBySession,[e]:s.pendingApprovals};for(const a of s.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(Me.planReviewByToolCallId={...Me.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}return Me.questionsBySession={...Me.questionsBySession,[e]:s.pendingQuestions},Me.lastSeqBySession={...Me.lastSeqBySession,[e]:s.asOfSeq},ty[e]=s.epoch,Dp.delete(e),Nh.delete(e),ft.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,status:s.session.status}),d8(),_i&&(_i.seedSnapshot(e,s),_i.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),U1e(e)),Hp.delete(e),l&&Zd(e),H1e(e),"ok"}catch(n){return T1e(n)?(await P1e(e),"not-found"):(Qd("getSessionSnapshot",n,{title:Cn.global.t("warnings.sessionSnapshotTitle"),message:Cn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Pp=jhe(r2);function W1e(e){return Object.prototype.hasOwnProperty.call(Me.messagesBySession,e)}const z1e=4,_r=[],Hp=new Set;function U1e(e){const t=_r.indexOf(e);for(t!==-1&&_r.splice(t,1),_r.unshift(e);_r.length>z1e;){let n=-1;for(let o=_r.length-1;o>=0;o--)if(_r[o]!==Me.activeSessionId){n=o;break}if(n===-1)break;const[s]=_r.splice(n,1);if(s===void 0)break;_i?.unsubscribe(s),Hp.add(s)}}function q1e(e){const t=_r.indexOf(e);t!==-1&&_r.splice(t,1),Hp.delete(e)}async function j1e(e){return r2(e)}function Vm(e){if(!e||e.status!=="running")return!1;const t=e.id,n=eo.sideChatTargetBySession.value[t]?.agentId,o=(Me.tasksBySession[t]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Me.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function l2(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return Cn.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}mo`:`${Math.round(r/365)}y`}catch{return e}}const V1e=3e4,Od=X(0);let xg=null;function K1e(){xg===null&&(xg=setInterval(()=>{Od.value=(Od.value+1)%Number.MAX_SAFE_INTEGER},V1e),xg.unref?.())}function G1e(e,t){const n=e.split(`
|
|
323
|
-
`),s=t.split(`
|
|
324
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Y1e(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:G1e(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}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 s=typeof t.plan=="string"?t.plan:"",o=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:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Z1e(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 Q1e(e){const t=Me.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function X1e(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 s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Q1e(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const J1e=D(()=>{const e=Me.sessions.find(n=>n.id===Me.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Me.workspaceName,branch:t}}),e0e=D(()=>(Od.value,Me.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:l2(e.updatedAt,e.status),status:e.status,busy:Vm(e)})))),t0e=D(()=>Me.activeSessionId??""),n0e=D(()=>{const e=Me.activeSessionId;if(e)return $n.skillsBySession.value[e]??[];const t=Gm.value;return t?$n.skillsByWorkspace.value[t]??[]:[]}),s0e=D(()=>{const e=Me.activeSessionId;return e?Me.sendingBySession[e]??!1:!1}),o0e=D(()=>ft.isStartingFirstPrompt()),eo=Hme(Me,{pushOperationFailure:Qd,nextOptimisticMsgId:u8,connectEventsIfNeeded:d8,getEventConn:()=>_i}),Xd=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=eo.sideChatTargetBySession.value[e]?.agentId;return(Me.tasksBySession[e]??[]).filter(n=>n.id!==t)}),p8=Hpe(Me,Xd),i0e=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=new Set(Me.sideChatUserMessageIdsBySession[e]??[]),n=(Me.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Me.approvalsBySession[e]??[];return D5(n,s,o=>ut().getFileUrl(o),Km.value!=="idle",Me.planReviewByToolCallId)}),r0e=D(()=>(p8.taskClock.value,Xd.value.map(X1e))),m8=D(()=>n1e(Xd.value)),l0e=D(()=>o1e(Xd.value)),pc=D(()=>{const e=Me.activeSessionId;return e?Me.goalBySession[e]??null:null}),a0e=D(()=>{const e=Me.activeSessionId;return e?Jme(Me.messagesBySession[e]??[]):[]}),c0e=D(()=>{const e=Me.activeSessionId;return e?Me.compactionBySession[e]??null:null}),u0e=D(()=>Me.connection),d0e=D(()=>Me.loading),f0e=D(()=>Me.sessionLoading),h0e=D(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadingMoreBySession[e]??!1:!1}),p0e=D(()=>{const e=Me.activeSessionId;return e?Me.messagesHasMoreBySession[e]??!1:!1}),m0e=D(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadMoreErrorBySession[e]??!1:!1}),g0e=D(()=>Me.serverVersion),v0e=D(()=>Me.backend),y0e=D(()=>Me.dangerousBypassAuth);function k0e(){Me.dangerousBypassAuth=!1}const b0e=D(()=>Me.permission),x0e=D(()=>Me.thinking),g8=D(()=>{const e=Me.activeSessionId;return e?Me.planModeBySession[e]??!1:qm.planMode}),w0e=D(()=>{const e=Me.activeSessionId;return e?Me.swarmModeBySession[e]??!1:qm.swarmMode}),_0e=D(()=>{const e=Me.activeSessionId;return e?Me.goalModeBySession[e]??!1:qm.goalMode}),S0e=D(()=>{const e=s1e(m8.value);return{plan:g8.value,goal:pc.value&&pc.value.status!=="complete"?{status:pc.value.status,turnsUsed:pc.value.turnsUsed,elapsedMs:pc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),C0e=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=ut();return(Me.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId)}))}))}),A0e=D(()=>Me.warnings),M0e=D(()=>{const e=Me.activeSessionId;return e?(Me.questionsBySession[e]??[]).map(Z1e):[]}),E0e=D(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Y1e(t),agentName:t.agentName})):[]}),Km=D(()=>{const e=Me.activeSessionId;if(!e)return"idle";if((Me.approvalsBySession[e]??[]).length>0)return"awaiting-approval";if((Me.questionsBySession[e]??[]).length>0)return"awaiting-question";const s=Me.sessions.find(o=>o.id===e);return Vm(s)?"running":"idle"}),$n=ime(Me,{pushOperationFailure:Qd,refreshSessionStatus:Zd,persistSessionProfile:r8,activity:Km,inFlightPromptSessions:o2,saveThinkingToStorage:c1e,updateSession:jm,updateSessionMessages:J5}),Wp=D(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),T0e=D(()=>{const e=Me.activeSessionId;return e?Me.gitStatusBySession[e]?.pullRequest??null:null}),N0e=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=Me.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),I0e=D(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),v8=D(()=>{const e=Me.sessions.find(r=>r.id===Me.activeSessionId),t=Wp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?$n.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Me.defaultModel)??"—",o=$n.models.value.find(r=>r.id===s)??$n.models.value.find(r=>r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Me.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Wp.value!==null}}),$0e=D(()=>n8.value),L0e=D(()=>Me.sessions.find(t=>t.id===Me.activeSessionId)?.usage.totalCostUsd??0),F0e=D(()=>Me.authReady),O0e=D(()=>Me.defaultModel),R0e=D(()=>Me.managedProviderStatus),B0e=D(()=>Me.config),D0e=D(()=>{const e=Me.activeSessionId;if(!e)return{};const t=Me.gitStatusBySession[e];return t?{...t.entries}:{}});function Zc(e){return Me.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const a2=D(()=>zhe({workspaces:Me.workspaces,sessions:Me.sessions,hiddenWorkspaceRoots:Me.hiddenWorkspaceRoots,activeRoot:Me.sessions.find(e=>e.id===Me.activeSessionId)?.cwd,activeBranch:Wp.value?.branch??null,sessionsHasMoreByWorkspace:Me.sessionsHasMoreByWorkspace})),zp=X(cI()),Qc=X(uI()==="manual"?"manual":"recent");Ze(()=>[a2.value.map(e=>e.id).join("\0"),Me.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=SI(n,zp.value);s!==null&&(zp.value=s,fA(s))});const Ta=D(()=>{const e=a2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:p1e(t.root,Me.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Qc.value==="recent"){const t=new Map;for(const n of Me.sessions){if(n.parentSessionId)continue;const s=Zc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return MI(e,t)}return CI(e,zp.value)}),Gm=D(()=>{const e=Me.activeWorkspaceId,t=Ta.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ze(Gm,e=>{e&&(Object.prototype.hasOwnProperty.call($n.skillsByWorkspace.value,e)||$n.loadSkillsForWorkspace(e))},{immediate:!0});const P0e=D(()=>{const e=Gm.value;return e?Ta.value.find(t=>t.id===e)??null:null}),H0e=D(()=>{Od.value;const e=new Set(Ta.value.map(n=>n.id)),t=new Map(Ta.value.map(n=>[n.id,n.name]));return Me.sessions.filter(n=>!n.parentSessionId&&e.has(Zc(n))).map(n=>{const s=Zc(n);return{id:n.id,title:n.title,time:l2(n.updatedAt,n.status),status:n.status,busy:Vm(n),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),W0e=D(()=>{Od.value;const e=new Map;for(const t of Me.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Zc(t),s={id:t.id,title:t.title,time:l2(t.updatedAt,t.status),status:t.status,busy:Vm(t),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Ta.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Me.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Me.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Me.sessionsInitialCountByWorkspace[t.id]??Qv}))});function z0e(e){zp.value=e,fA(e),Qc.value!=="manual"&&(Qc.value="manual",hA("manual"))}function U0e(e){Qc.value!==e&&(Qc.value=e,hA(e))}const y8=D(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),q0e=D(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),j0e=D(()=>{const e={};for(const[t,n]of Object.entries(Me.unreadBySession))n&&(e[t]=!0);return e}),V0e=D(()=>{const e={},t=y8.value;for(const n of Me.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Zc(n);e[o]=(e[o]??0)+s}return e}),K0e=D(()=>Me.recentRoots),G0e=D(()=>Me.availableOpenInApps),ft=nme(Me,{taskPoller:p8,sideChat:eo,modelProvider:$n,pushOperationFailure:Qd,activity:Km,inFlightPromptSessions:o2,sessionsKnownEmpty:f8,setSessions:Q5,updateSession:jm,upsertSessionFront:m1e,appendSession:g1e,forgetSession:e8,setActiveSessionId:s2,updateSessionMessages:J5,nextOptimisticMsgId:u8,getEventConn:()=>_i,syncSessionFromSnapshot:r2,reopenSession:j1e,hasLoadedMessages:W1e,refreshSessionStatus:Zd,refreshSessionGoal:x1e,persistSessionProfile:r8,mergedWorkspaces:a2,workspacesView:Ta,status:v8,workspaceIdForSession:Zc,savePermissionToStorage:l1e,savePlanModeToStorage:K5,saveSwarmModeToStorage:G5,saveGoalModeToStorage:Y5,draftModes:qm,saveUnread:Ry,saveActiveWorkspaceToStorage:h1e,saveHiddenWorkspacesToStorage:f1e,goalErrorMessage:D1e,resetFastMoon:wr.resetFastMoon,initialized:o8,connectIssue:i8,selectedDiffPath:t8,fileDiffLines:n8,fileDiffLoading:s8});function c2(e){return e===Me.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function Y0e(e,t){const n=Me.promptIdBySession[e];ft.finishPromptLocal(e),e===Me.activeSessionId?(ft.loadGitStatus(e),Zd(e)):t==="idle"&&(Me.unreadBySession={...Me.unreadBySession,[e]:!0},Ry({[e]:!0}));const s=(Me.approvalsBySession[e]??[]).length>0,o=(Me.questionsBySession[e]??[]).length>0;ype(t,s,o)&&Zi.maybeNotifyCompletion(e,{isUserWatching:c2(e),sessionTitle:Me.sessions.find(i=>i.id===e)?.title??"",promptId:n,onClick:()=>{ft.selectSession(e)}}),t==="idle"&&Fd.maybePlayCompletionSound()}function Z0e(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Zi.maybeNotifyQuestion({isUserWatching:c2(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ft.selectSession(e)}}),Fd.maybePlayQuestionSound()}function Q0e(e,t){Zi.maybeNotifyApproval({isUserWatching:c2(e),sessionTitle:Me.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ft.selectSession(e)}}),Fd.maybePlayApprovalSound()}function u2(){return K1e(),{workspace:J1e,sessions:e0e,activeSessionId:t0e,workspacesView:Ta,workspaceSortMode:Qc,visibleWorkspace:P0e,activeWorkspaceId:Gm,sessionsForView:H0e,workspaceGroups:W0e,attentionBySession:y8,pendingBySession:q0e,attentionByWorkspace:V0e,unreadBySession:j0e,recentRoots:K0e,turns:i0e,tasks:r0e,activeAppTasks:Xd,todos:a0e,goal:pc,swarms:m8,swarmMembersByToolCallId:l0e,activationBadges:S0e,compaction:c0e,status:v8,sessionCost:L0e,fileDiff:$0e,selectedDiffPath:t8,fileDiffLoading:s8,changes:N0e,gitInfo:Wp,gitDiffStats:I0e,activePullRequest:T0e,changesByPath:D0e,pendingApprovals:E0e,availableOpenInApps:G0e,connection:u0e,loading:d0e,sessionLoading:f0e,loadingMoreMessages:h0e,hasMoreMessages:p0e,loadMoreMessagesError:m0e,serverVersion:g0e,backend:v0e,dangerousBypassAuth:y0e,clearDangerousBypassAuth:k0e,initialized:o8,connectIssue:i8,permission:b0e,thinking:x0e,planMode:g8,swarmMode:w0e,goalMode:_0e,queued:C0e,warnings:A0e,questions:M0e,activity:Km,isSending:s0e,isStartingFirstPrompt:o0e,fastMoon:wr.fastMoon,models:$n.models,starredModelIds:$n.starredModelIds,providers:$n.providers,uiFontSize:wr.uiFontSize,setUiFontSize:wr.setUiFontSize,conversationToc:a8,setConversationToc:S1e,colorScheme:wr.colorScheme,setColorScheme:wr.setColorScheme,accent:wr.accent,setAccent:wr.setAccent,notifyOnComplete:Zi.notifyOnComplete,notifyOnQuestion:Zi.notifyOnQuestion,notifyOnApproval:Zi.notifyOnApproval,notifyPermission:Zi.notifyPermission,setNotifyOnComplete:Zi.setNotifyOnComplete,setNotifyOnQuestion:Zi.setNotifyOnQuestion,setNotifyOnApproval:Zi.setNotifyOnApproval,soundOnComplete:Fd.soundOnComplete,setSoundOnComplete:Fd.setSoundOnComplete,onboarded:c8,setOnboarded:A1e,load:ft.load,selectSession:ft.selectSession,clearActiveSession:ft.clearActiveSession,loadOlderMessages:ft.loadOlderMessages,loadWorkspaces:ft.loadWorkspaces,loadMoreSessions:ft.loadMoreSessions,loadAllSessions:ft.loadAllSessions,selectWorkspace:ft.selectWorkspace,openWorkspace:ft.openWorkspace,openWorkspaceDraft:ft.openWorkspaceDraft,startSessionAndSendPrompt:ft.startSessionAndSendPrompt,startSessionAndActivateSkill:ft.startSessionAndActivateSkill,startSessionAndOpenSideChat:ft.startSessionAndOpenSideChat,addWorkspaceByPath:ft.addWorkspaceByPath,browseFs:ft.browseFs,getFsHome:ft.getFsHome,sendPrompt:ft.sendPrompt,steerPrompt:ft.steerPrompt,sideChatVisible:eo.sideChatVisible,sideChatSessionId:eo.sideChatSessionId,sideChatTurns:eo.sideChatTurns,sideChatRunning:eo.sideChatRunning,sideChatSending:eo.sideChatSending,openSideChat:eo.openSideChat,closeSideChat:eo.closeSideChat,sendSideChatPrompt:eo.sendSideChatPrompt,uploadImage:ft.uploadImage,abortCurrentPrompt:ft.abortCurrentPrompt,respondApproval:ft.respondApproval,respondQuestion:ft.respondQuestion,dismissQuestion:ft.dismissQuestion,pendingQuestionActions:ft.pendingQuestionActions,pendingApprovalActions:ft.pendingApprovalActions,cancelTask:ft.cancelTask,setPermission:ft.setPermission,setThinking:$n.setThinking,setPlanMode:ft.setPlanMode,togglePlanMode:ft.togglePlanMode,setSwarmMode:ft.setSwarmMode,toggleSwarmMode:ft.toggleSwarmMode,setGoalMode:ft.setGoalMode,toggleGoalMode:ft.toggleGoalMode,createGoal:ft.createGoal,controlGoal:ft.controlGoal,enqueue:ft.enqueue,dismissWarning:ft.dismissWarning,renameSession:ft.renameSession,renameWorkspace:ft.renameWorkspace,deleteWorkspace:ft.deleteWorkspace,reorderWorkspaces:z0e,setWorkspaceSortMode:U0e,archiveSession:ft.archiveSession,exportSession:ft.exportSession,restoreSession:ft.restoreSession,loadArchivedSessions:ft.loadArchivedSessions,compact:ft.compact,forkSession:ft.forkSession,undo:ft.undo,unqueue:ft.unqueue,reorderQueue:ft.reorderQueue,searchFiles:ft.searchFiles,loadGitStatus:ft.loadGitStatus,loadFileDiff:ft.loadFileDiff,clearFileDiff:ft.clearFileDiff,listDir:ft.listDir,readFileContent:ft.readFileContent,getFileDownloadUrl:ft.getFileDownloadUrl,openWorkspaceFile:ft.openWorkspaceFile,openInApp:ft.openInApp,revealWorkspaceFile:ft.revealWorkspaceFile,resolveImageUrl:ft.resolveImageUrl,refreshOAuthProviderModels:$n.refreshOAuthProviderModels,loadModels:$n.loadModels,loadProviders:$n.loadProviders,skills:n0e,activateSkill:$n.activateSkill,setModel:$n.setModel,toggleStarModel:$n.toggleStarModel,addProvider:$n.addProvider,deleteProvider:$n.deleteProvider,refreshProvider:$n.refreshProvider,refreshAllProviders:$n.refreshAllProviders,authReady:F0e,defaultModel:O0e,managedProviderStatus:R0e,config:B0e,updateConfig:ft.updateConfig,checkAuth:ft.checkAuth,startOAuthLogin:$n.startOAuthLogin,pollOAuthLogin:$n.pollOAuthLogin,cancelOAuthLogin:$n.cancelOAuthLogin,logout:ft.logout}}const k8=Ge({__name:"LanguageSwitcher",setup(e){const{locale:t}=Mt(),n=vA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&yA(o)}return(o,i)=>(x(),xe(vo,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),X0e=["aria-checked","aria-label","disabled"],J0e=Ge({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(x(),T("button",{class:Pe(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,X0e))}}),mr=ct(J0e,[["__scopeId","data-v-dbe22dc4"]]),ege=["aria-label"],tge=["aria-selected","onClick"],nge={class:"body"},sge={class:"panel"},oge={class:"sec"},ige={class:"sec-title"},rge={class:"row"},lge={class:"rlabel"},age={class:"row"},cge={class:"rlabel"},uge={class:"row"},dge={class:"rlabel"},fge={class:"num-field"},hge=["value","aria-label"],pge={class:"row"},mge={class:"rlabel"},gge={class:"row"},vge={class:"rlabel"},yge={class:"hint"},kge={class:"sec"},bge={class:"sec-title"},xge={class:"row"},wge={class:"rlabel"},_ge={key:0,class:"hint"},Sge={class:"row"},Cge={class:"rlabel"},Age={key:0,class:"hint"},Mge={class:"row"},Ege={class:"rlabel"},Tge={key:0,class:"hint"},Nge={class:"row"},Ige={class:"rlabel"},$ge={class:"panel"},Lge={class:"sec"},Fge={class:"sec-title"},Oge={class:"row"},Rge={class:"rlabel"},Bge={key:0,class:"rvalue"},Dge={class:"actions"},Pge={class:"panel"},Hge={class:"sec"},Wge={class:"sec-head"},zge={class:"sec-title"},Uge={key:0,class:"saving"},qge={class:"row"},jge={class:"rlabel"},Vge={class:"hint"},Kge={key:0,class:"select-wrap"},Gge={key:0,value:"",disabled:""},Yge=["label"],Zge=["value"],Qge={key:1,class:"rvalue mono"},Xge={class:"row"},Jge={class:"rlabel"},eve={class:"hint"},tve={class:"row"},nve={class:"rlabel"},sve={class:"hint"},ove={class:"row"},ive={class:"rlabel"},rve={class:"hint"},lve={class:"row"},ave={class:"rlabel"},cve={class:"hint"},uve={key:1,class:"empty-config"},dve={class:"panel"},fve={class:"sec"},hve={class:"sec-title"},pve={class:"row"},mve={class:"rlabel"},gve={class:"rvalue mono"},vve={class:"row"},yve={class:"rlabel"},kve={class:"rvalue mono"},bve={class:"row"},xve={class:"rlabel"},wve={class:"rvalue mono"},_ve={key:0,class:"row"},Sve={class:"rlabel"},Cve={class:"hint"},Ave={class:"hint"},Mve={class:"row"},Eve={class:"rlabel"},Tve={key:0,class:"hint"},Nve={class:"panel"},Ive={class:"panel-head"},$ve={class:"panel-title"},Lve={class:"panel-desc"},Fve={class:"archive-toolbar"},Ove={class:"archive-search"},Rve=["placeholder"],Bve={value:"all"},Dve=["value"],Pve={key:0,class:"archive-empty"},Hve={key:0,class:"archive-list"},Wve={class:"archive-workspace"},zve={class:"path"},Uve={class:"count"},qve={class:"setting-card"},jve={class:"archive-meta"},Vve={class:"archive-name"},Kve={class:"archive-time"},Gve={key:1,class:"archive-empty"},Yve=100,Zve=Ge({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=X("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=vI(),a=D(()=>s.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=X(null);zk(d);function f(oe){oe.key==="Escape"&&o("close")}fn(()=>document.addEventListener("keydown",f)),xn(()=>document.removeEventListener("keydown",f));function h(){l5()}const p=D(()=>{const oe=new Map;for(const Z of s.models??[])oe.set(Z.id,{id:Z.id,label:Z.displayName??Z.model??Z.id,provider:Z.provider});for(const[Z,te]of Object.entries(s.config?.models??{})){if(oe.has(Z))continue;const ae=v(te);oe.set(Z,{id:Z,label:g(Z,te,ae),provider:ae??Z})}return Array.from(oe.values())}),m=D(()=>{const oe=new Map;for(const Z of p.value){const te=oe.get(Z.provider)??[];te.push(Z),oe.set(Z.provider,te)}for(const Z of oe.values())Z.sort((te,ae)=>te.label.localeCompare(ae.label));return Array.from(oe.entries()).toSorted(([Z],[te])=>Z.localeCompare(te)).map(([Z,te])=>({provider:Z,options:te}))}),b=D(()=>{const oe=s.config?.defaultPermissionMode;return oe==="auto"||oe==="yolo"||oe==="manual"?oe:"manual"});function v(oe){if(!oe||typeof oe!="object")return;const Z=oe;return typeof Z.provider=="string"?Z.provider:void 0}function g(oe,Z,te){if(!Z||typeof Z!="object")return oe;const ae=Z,He=typeof ae.model=="string"?ae.model:void 0,he=te??v(Z);return He&&he?`${oe} (${he}/${He})`:He?`${oe} (${He})`:oe}function y(oe){return oe===!0}function k(oe){!oe||oe===s.config?.defaultModel||o("updateConfig",{defaultModel:oe})}function E(oe){oe!==b.value&&o("updateConfig",{defaultPermissionMode:oe})}function L(oe){const Z=s.config?.[oe];o("updateConfig",{[oe]:!y(Z)})}function $(){const oe=s.config?.thinking;return!oe||typeof oe!="object"?!0:oe.enabled!==!1}function w(){o("updateConfig",{thinking:{enabled:!$()}})}function M(){const oe=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!oe})}function N(oe){i.value=oe}const F=u2(),S=X([]),I=X(!1),B=X(!1),R=X(""),P=X("all"),z=X("archived-desc");async function W(){if(!(I.value||B.value)){I.value=!0;try{const oe=[];let Z;for(;;){const te=await F.loadArchivedSessions({beforeId:Z,pageSize:Yve});if(oe.push(...te.items),!te.hasMore||te.items.length===0)break;const ae=te.items.at(-1)?.id;if(ae===void 0)break;Z=ae}S.value=oe,B.value=!0}catch(oe){console.warn("loadAllArchived failed",oe)}finally{I.value=!1}}}Ze(i,oe=>{oe==="archived"&&!B.value&&W()});const ee=D(()=>{const oe=new Set;for(const Z of S.value)oe.add(Z.cwd);return Array.from(oe).sort((Z,te)=>Z.localeCompare(te))}),U=D(()=>{const oe=R.value.trim().toLowerCase();let Z=S.value.filter(te=>te.archived===!0);return P.value!=="all"&&(Z=Z.filter(te=>te.cwd===P.value)),oe&&(Z=Z.filter(te=>te.title.toLowerCase().includes(oe))),Z=Z.slice(),z.value==="archived-desc"?Z.sort((te,ae)=>ae.updatedAt.localeCompare(te.updatedAt)):z.value==="created-desc"?Z.sort((te,ae)=>ae.createdAt.localeCompare(te.createdAt)):Z.sort((te,ae)=>te.title.localeCompare(ae.title,"zh")),Z}),Y=D(()=>{const oe=new Map;for(const Z of U.value){const te=oe.get(Z.cwd)??[];te.push(Z),oe.set(Z.cwd,te)}return Array.from(oe.entries()).map(([Z,te])=>({cwd:Z,items:te}))});async function ue(oe){await F.restoreSession(oe)&&(S.value=S.value.filter(te=>te.id!==oe))}function fe(oe){const Z=new Date(oe);if(Number.isNaN(Z.getTime()))return oe;const te=ae=>String(ae).padStart(2,"0");return`${Z.getFullYear()}-${te(Z.getMonth()+1)}-${te(Z.getDate())} ${te(Z.getHours())}:${te(Z.getMinutes())}`}return(oe,Z)=>(x(),xe(Wr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Z[19]||(Z[19]=te=>o("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),T(Be,null,nt(r,te=>_("button",{key:te.id,type:"button",class:Pe(["tab",{on:i.value===te.id}]),role:"tab","aria-selected":i.value===te.id,onClick:ae=>N(te.id)},O(C(n)(te.labelKey)),11,tge)),64))],8,ege),_("div",nge,[On(_("section",sge,[_("section",oge,[_("h3",ige,O(C(n)("settings.appearance")),1),_("div",rge,[_("span",lge,O(C(n)("theme.colorSchemeLabel")),1),re(vo,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":Z[0]||(Z[0]=te=>o("setColorScheme",te))},null,8,["model-value","options"])]),_("div",age,[_("span",cge,O(C(n)("theme.accentLabel")),1),re(vo,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":Z[1]||(Z[1]=te=>o("setAccent",te))},null,8,["model-value","options"])]),_("div",uge,[_("span",dge,O(C(n)("settings.uiFontSize")),1),_("label",fge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:Z[2]||(Z[2]=te=>o("setUiFontSize",Number(te.target.value)))},null,40,hge),Z[20]||(Z[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",pge,[_("span",mge,O(C(n)("sidebar.language")),1),re(k8)]),_("div",gge,[_("span",vge,[Qe(O(C(n)("settings.conversationToc"))+" ",1),_("span",yge,O(C(n)("settings.conversationTocHint")),1)]),re(mr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":Z[3]||(Z[3]=te=>o("setConversationToc",te))},null,8,["model-value","label"])])]),_("section",kge,[_("h3",bge,O(C(n)("settings.notifications")),1),_("div",xge,[_("span",wge,[Qe(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),T("span",_ge,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),re(mr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Z[4]||(Z[4]=te=>o("setNotify",te))},null,8,["model-value","disabled","label"])]),_("div",Sge,[_("span",Cge,[Qe(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),T("span",Age,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),re(mr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Z[5]||(Z[5]=te=>o("setNotifyQuestion",te))},null,8,["model-value","disabled","label"])]),_("div",Mge,[_("span",Ege,[Qe(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),T("span",Tge,O(C(n)("settings.notifyDenied")),1)):le("",!0)]),re(mr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Z[6]||(Z[6]=te=>o("setNotifyApproval",te))},null,8,["model-value","disabled","label"])]),_("div",Nge,[_("span",Ige,O(C(n)("settings.soundOnComplete")),1),re(mr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":Z[7]||(Z[7]=te=>o("setSound",te))},null,8,["model-value","label"])])])],512),[[yi,i.value==="general"]]),On(_("section",$ge,[_("section",Lge,[_("h3",Fge,O(C(n)("settings.account")),1),_("div",Oge,[_("span",Rge,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),re(Yt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(x(),T("span",Bge,O(e.accountModel),1)):le("",!0)]),_:1},8,["text"])]),_("div",Dge,[re(Rt,{variant:"secondary",size:"sm",onClick:Z[8]||(Z[8]=te=>{o("openOnboarding"),o("close")})},{default:Ee(()=>[Qe(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),xe(Rt,{key:0,variant:"danger-soft",size:"sm",onClick:Z[9]||(Z[9]=te=>o("logout"))},{default:Ee(()=>[Qe(O(C(n)("sidebar.signOut")),1)]),_:1})):(x(),xe(Rt,{key:1,variant:"primary",size:"sm",onClick:Z[10]||(Z[10]=te=>o("login"))},{default:Ee(()=>[Qe(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[yi,i.value==="account"]]),On(_("section",Pge,[_("section",Hge,[_("div",Wge,[_("h3",zge,O(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),T("span",Uge,O(C(n)("settings.saving")),1)):le("",!0)]),e.config?(x(),T(Be,{key:0},[_("div",qge,[_("span",jge,[Qe(O(C(n)("settings.defaultModel"))+" ",1),_("span",Vge,O(C(n)("settings.defaultModelHint")),1)]),m.value.length>0?(x(),T("div",Kge,[re(Kv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ee(()=>[e.config.defaultModel?le("",!0):(x(),T("option",Gge,O(C(n)("settings.noDefaultModel")),1)),(x(!0),T(Be,null,nt(m.value,te=>(x(),T("optgroup",{key:te.provider,label:te.provider},[(x(!0),T(Be,null,nt(te.options,ae=>(x(),T("option",{key:ae.id,value:ae.id},O(ae.label),9,Zge))),128))],8,Yge))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),T("span",Qge,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",Xge,[_("span",Jge,[Qe(O(C(n)("settings.defaultPermission"))+" ",1),_("span",eve,O(C(n)("settings.defaultPermissionHint")),1)]),re(vo,{"model-value":b.value,options:c.map(te=>({value:te,label:C(n)(u[te])})),"onUpdate:modelValue":Z[11]||(Z[11]=te=>E(te))},null,8,["model-value","options"])]),_("div",tve,[_("span",nve,[Qe(O(C(n)("settings.defaultThinking"))+" ",1),_("span",sve,O(C(n)("settings.defaultThinkingHint")),1)]),re(mr,{"model-value":$(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Z[12]||(Z[12]=te=>w())},null,8,["model-value","disabled","label"])]),_("div",ove,[_("span",ive,[Qe(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",rve,O(C(n)("settings.defaultPlanModeHint")),1)]),re(mr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Z[13]||(Z[13]=te=>L("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",lve,[_("span",ave,[Qe(O(C(n)("settings.mergeSkills"))+" ",1),_("span",cve,O(C(n)("settings.mergeSkillsHint")),1)]),re(mr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Z[14]||(Z[14]=te=>L("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),T("div",uve,O(C(n)("settings.configUnavailable")),1))])],512),[[yi,i.value==="agent"]]),On(_("section",dve,[_("section",fve,[_("h3",hve,O(C(n)("settings.advanced")),1),_("div",pve,[_("span",mve,O(C(n)("sidebar.daemon")),1),_("span",gve,O(C(l)),1)]),_("div",vve,[_("span",yve,O(C(n)("settings.backend")),1),_("span",kve,O(a.value),1)]),_("div",bve,[_("span",xve,O(C(n)("settings.serverVersion")),1),_("span",wve,O(e.serverVersion||"-"),1)]),e.config?(x(),T("div",_ve,[_("span",Sve,[Qe(O(C(n)("settings.telemetry"))+" ",1),_("span",Cve,O(C(n)("settings.telemetryHint")),1),_("span",Ave,O(C(n)("settings.telemetryRestartHint")),1)]),re(mr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Z[15]||(Z[15]=te=>M())},null,8,["model-value","disabled","label"])])):le("",!0),_("div",Mve,[_("span",Eve,[Qe(O(C(n)("settings.exportLog"))+" ",1),C(Bi)()?le("",!0):(x(),T("span",Tve,O(C(n)("settings.logHint")),1))]),re(Rt,{variant:"secondary",size:"sm",onClick:h},{default:Ee(()=>[Qe(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[yi,i.value==="advanced"]]),On(_("section",Nve,[_("div",Ive,[Z[21]||(Z[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",$ve,O(C(n)("settings.archivedTitle")),1),_("p",Lve,O(C(n)("settings.archivedDesc")),1)]),_("div",Fve,[_("label",Ove,[Z[22]||(Z[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),On(_("input",{"onUpdate:modelValue":Z[16]||(Z[16]=te=>R.value=te),placeholder:C(n)("settings.archivedSearch")},null,8,Rve),[[So,R.value]])]),re(Kv,{"model-value":P.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Z[17]||(Z[17]=te=>P.value=te)},{default:Ee(()=>[_("option",Bve,O(C(n)("settings.archivedAllWorkspaces")),1),(x(!0),T(Be,null,nt(ee.value,te=>(x(),T("option",{key:te,value:te},O(te),9,Dve))),128))]),_:1},8,["model-value","aria-label"]),re(vo,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":Z[18]||(Z[18]=te=>z.value=te)},null,8,["model-value","options"])]),I.value?(x(),T("div",Pve,O(C(n)("settings.archivedLoadingAll")),1)):(x(),T(Be,{key:1},[Y.value.length>0?(x(),T("div",Hve,[(x(!0),T(Be,null,nt(Y.value,te=>(x(),T("section",{key:te.cwd,class:"archive-card"},[_("div",Wve,[Z[23]||(Z[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",zve,O(te.cwd),1),_("span",Uve,O(C(n)("settings.archivedSessionsCount",{count:te.items.length})),1)]),_("div",qve,[(x(!0),T(Be,null,nt(te.items,ae=>(x(),T("div",{key:ae.id,class:"archive-row"},[_("div",jve,[_("div",Vve,O(ae.title),1),_("div",Kve,O(C(n)("settings.archivedAt",{time:fe(ae.updatedAt)})),1)]),re(Rt,{variant:"secondary",size:"sm",onClick:He=>ue(ae.id)},{default:Ee(()=>[Qe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),T("div",Gve,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[yi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Qve=ct(Zve,[["__scopeId","data-v-2377814f"]]),Xve=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,b8=/^[A-Za-z]:[\\/]/,Jve=/^\/\/(?!\/)/;function wg(e){return Xve.test(e.trim())}function eye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function tye(e){return Jve.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function nye(e){return b8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function sye(e){return b8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function ny(e,t){let n=tye(eye(e.trim(),t));const s=nye(n),o=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=s?/[\\/]$/.test(n):n.endsWith("/");!o&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=s?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=sye(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function oye(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function iye(e,t,n){if(n===null)return null;const{target:s}=ny(e,t);return s===n?n:null}const rye={class:"aw"},lye={key:0,class:"crumbbar"},aye={class:"crumbs"},cye={key:0,class:"crumb-sep"},uye=["onClick"],dye=["placeholder"],fye={key:2,class:"folder-list"},hye={key:0,class:"fl-loading"},pye={key:0,class:"fl-loading"},mye={key:0,class:"fl-note"},gye=["onClick"],vye={class:"folder-name"},yye={key:0,class:"git-branch"},kye={key:1,class:"fl-empty fl-error"},bye={key:2,class:"fl-empty fl-error"},xye=["onClick"],wye={class:"folder-name search-rel"},_ye={key:0,class:"git-branch"},Sye={key:0,class:"fl-empty"},Cye={key:1,class:"fl-loading"},Aye=["onClick"],Mye={class:"folder-name"},Eye={key:0,class:"git-branch"},Tye={key:0,class:"fl-empty"},Nye={key:3,class:"degraded-hint"},Iye={key:4,class:"add-error",role:"alert"},$ye={class:"actions"},Lye={class:"footer-hint"},Fye=600,Oye=6,n4=150,Rye=Ge({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=X(!0),r=X(!1),l=X(!1),a=X(""),c=X(null),u=X([]),d=X(""),f=X(!1),h=X([]),p=D(()=>d.value.trim().length>0);let m=0,b=null;const v=D(()=>wg(d.value)),g=X("idle"),y=X(""),k=X("/"),E=X([]),L=X(""),$=X(null),w=X(null),M=D(()=>g.value!=="valid"?null:iye(d.value,L.value,w.value));let N=0,F=null;function S(Z,te){const ae=Z.toLowerCase(),He=te.toLowerCase();let he=0;for(let K=0;K<He.length&&he<ae.length;K++)He[K]===ae[he]&&he++;return he===ae.length}async function I(Z){const te=a.value,ae=Z.trim();if(!te||ae===""){h.value=[],f.value=!1;return}const He=++m;f.value=!0;const he=[],K=[{path:te,depth:0}];let ce=0;for(;K.length>0&&ce<Fye&&he.length<n4;){if(He!==m)return;const ge=K.shift();ce++;let q;try{q=await s.browseFs(ge.path)}catch{continue}if(He!==m)return;for(const se of q.entries){if(!se.isDir)continue;const ye=se.path.startsWith(te)?se.path.slice(te.length).replace(/^\/+/,""):se.path;if(S(ae,ye||se.name)&&(he.push({path:se.path,name:se.name,rel:ye||se.name,isGitRepo:se.isGitRepo,branch:se.branch}),he.length>=n4))break;ge.depth+1<Oye&&K.push({path:se.path,depth:ge.depth+1})}He===m&&(h.value=[...he])}He===m&&(f.value=!1)}Ze(d,Z=>{b&&clearTimeout(b),F&&clearTimeout(F),N++,g.value="idle",E.value=[],w.value=null;const te=Z.trim();if(te===""){m++,h.value=[],f.value=!1;return}if(wg(te)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void B(te),150);return}b=setTimeout(()=>void I(Z),220)});async function B(Z){const te=++N;g.value="checking",w.value=null;const ae=ny(Z,L.value),{target:He}=ae;try{const K=await s.browseFs(He);if(te!==N)return;if(K.path){g.value="valid",E.value=[],w.value=He,a.value=K.path,c.value=K.parent,u.value=K.entries,l.value=!1;return}}catch{}if(te!==N)return;const he=ae.base.toLowerCase();y.value=ae.parent,k.value=ae.separator;try{const K=await s.browseFs(ae.parent);if(te!==N)return;if(K.path){E.value=K.entries.filter(ce=>ce.isDir&&ce.name.toLowerCase().startsWith(he)),g.value="not-found";return}}catch{}te===N&&(E.value=[],g.value="bad-parent")}function R(Z){d.value=oye(y.value,Z,k.value),$.value?.focus()}const P=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),z=D(()=>l.value?n("workspace.degradedHint"):v.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function W(Z){if(Z.key==="Escape"){d.value?d.value="":o("close");return}if(Z.key!=="Enter")return;const te=d.value.trim();if(wg(te)){if(Z.preventDefault(),l.value){const{target:ae}=ny(te,L.value);ae&&o("add",ae);return}g.value==="valid"?oe():g.value==="not-found"&&E.value[0]&&R(E.value[0].name)}}const ee=D(()=>{const Z=a.value;if(!Z)return[];const te=Z.split("/").filter(Boolean),ae=[{label:"/",path:"/"}];let He="";for(const he of te)He+=`/${he}`,ae.push({label:he,path:He});return ae}),U=D(()=>!(a.value.length===0||v.value&&M.value===null));async function Y(Z){r.value=!0;try{const te=await s.browseFs(Z);if(!te.path){l.value=!0;return}a.value=te.path,c.value=te.parent,u.value=te.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ue(Z){Z.isDir&&Y(Z.path)}function fe(){c.value&&Y(c.value)}function oe(){U.value&&o("add",M.value??a.value)}return fn(async()=>{r.value=!0;try{const Z=await s.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(Z.home&&(L.value=Z.home),s.defaultPath&&(await Y(s.defaultPath),!l.value))return;L.value?await Y(L.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),xn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(Z,te)=>(x(),xe(Wr,{open:i.value,"onUpdate:open":te[2]||(te[2]=ae=>i.value=ae),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:te[3]||(te[3]=ae=>o("close"))},{default:Ee(()=>[_("div",rye,[l.value?le("",!0):(x(),T("div",lye,[re(qn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Ee(()=>[re(je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",aye,[(x(!0),T(Be,null,nt(ee.value,(ae,He)=>(x(),T(Be,{key:ae.path},[He>1?(x(),T("span",cye,"/")):le("",!0),_("button",{class:Pe(["crumb",{last:He===ee.value.length-1}]),onClick:he=>Y(ae.path)},O(ae.label),11,uye)],64))),128))])])),!r.value||l.value?(x(),T("div",{key:1,class:Pe(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[re(je,{class:"filter-icon",name:"search",size:"md"}),On(_("input",{ref_key:"filterEl",ref:$,"onUpdate:modelValue":te[0]||(te[0]=ae=>d.value=ae),class:"filter-input",type:"text",placeholder:P.value,autocomplete:"off",spellcheck:"false",onKeydown:kt(W,["stop"])},null,40,dye),[[So,d.value]]),f.value||g.value==="checking"?(x(),xe(zo,{key:0,size:"sm"})):le("",!0)],2)):le("",!0),l.value?(x(),T("div",Nye,O(C(n)("workspace.degradedHint")),1)):(x(),T("div",fye,[r.value?(x(),T("div",hye,O(C(n)("workspace.browsing")),1)):v.value&&g.value!=="valid"?(x(),T(Be,{key:1},[g.value==="checking"?(x(),T("div",pye,O(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(x(),T(Be,{key:1},[E.value.length>0?(x(),T("div",mye,O(C(n)("workspace.pathPickHint")),1)):le("",!0),(x(!0),T(Be,null,nt(E.value,ae=>(x(),T("button",{key:ae.path,class:"folder-row",onClick:He=>R(ae.name)},[re(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",vye,O(ae.name),1),ae.isGitRepo?(x(),xe(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Qe(O(C(n)("workspace.gitTag")),1),ae.branch?(x(),T("span",yye,O(ae.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,gye))),128)),E.value.length===0?(x(),T("div",kye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):le("",!0)],64)):g.value==="bad-parent"?(x(),T("div",bye,O(C(n)("workspace.badParent",{parent:y.value})),1)):le("",!0)],64)):p.value&&!v.value?(x(),T(Be,{key:2},[(x(!0),T(Be,null,nt(h.value,ae=>(x(),T("button",{key:ae.path,class:"folder-row",onClick:He=>Y(ae.path)},[re(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",wye,O(ae.rel),1),ae.isGitRepo?(x(),xe(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Qe(O(C(n)("workspace.gitTag")),1),ae.branch?(x(),T("span",_ye,O(ae.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,xye))),128)),!f.value&&h.value.length===0?(x(),T("div",Sye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),T("div",Cye,O(C(n)("workspace.searching")),1)):le("",!0)],64)):(x(),T(Be,{key:3},[(x(!0),T(Be,null,nt(u.value,ae=>(x(),T("button",{key:ae.path,class:"folder-row",onClick:He=>ue(ae)},[re(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Mye,O(ae.name),1),ae.isGitRepo?(x(),xe(Ro,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Qe(O(C(n)("workspace.gitTag")),1),ae.branch?(x(),T("span",Eye,O(ae.branch),1)):le("",!0)]),_:2},1024)):le("",!0)],8,Aye))),128)),u.value.length===0?(x(),T("div",Tye,O(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])),e.error?(x(),T("div",Iye,O(e.error),1)):le("",!0),_("div",$ye,[re(Yt,{text:a.value},{default:Ee(()=>[l.value?le("",!0):(x(),xe(Rt,{key:0,variant:"primary",disabled:!U.value,onClick:oe},{default:Ee(()=>[Qe(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),re(Rt,{variant:"secondary",onClick:te[1]||(te[1]=ae=>o("close"))},{default:Ee(()=>[Qe(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",Lye,O(z.value),1)])]),_:1},8,["open","title"]))}}),Bye=ct(Rye,[["__scopeId","data-v-b24b02ce"]]),Dye={key:0,class:"confirm-dialog__message"},Pye=Ge({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=X(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Mt();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!o.open||o.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),ps(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(x(),xe(Wr,{open:e.open,title:e.title,height:"auto","initial-focus":s,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:Ee(()=>[re(Rt,{variant:"secondary",disabled:e.loading,onClick:l},{default:Ee(()=>[Qe(O(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),re(Rt,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Ee(()=>[Qe(O(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(x(),T("p",Dye,O(e.message),1)):le("",!0)]),_:1},8,["open","title"]))}}),Hye=ct(Pye,[["__scopeId","data-v-76e206e7"]]),Wye=Ge({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=zr();return(s,o)=>(x(),xe(Hye,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),zye={class:"rows"},Uye={class:"row"},qye={class:"row"},jye={class:"row"},Vye={class:"row"},Kye={class:"row"},Gye={class:"row"},Yye={class:"ctx-text"},Zye={key:0,class:"bar"},Qye={class:"row"},Xye=Ge({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=X(!0),r=D(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=D(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=D(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=D(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(x(),xe(Wr,{open:i.value,"onUpdate:open":m[0]||(m[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=b=>o("close"))},{default:Ee(()=>[_("dl",zye,[_("div",Uye,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",qye,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",jye,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:Gt({color:c.value})},O(a(e.status.permission)),5)]),_("div",Vye,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:Pe({"plan-on":e.planMode})},O(u.value),3)]),_("div",Kye,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:Pe({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",Gye,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",Yye,O(l.value),1),e.status.ctxMax>0?(x(),T("span",Zye,[_("i",{style:Gt({width:r.value+"%"})},null,4)])):le("",!0)])]),_("div",Qye,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Jye=ct(Xye,[["__scopeId","data-v-59dd31f3"]]),eke={class:"ui-toast__icon","aria-hidden":"true"},tke={class:"ui-toast__body"},nke={class:"ui-toast__title"},ske={key:0,class:"ui-toast__msg"},oke=Ge({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),T("div",{class:Pe(["ui-toast",`ui-toast--${e.variant}`])},[_("span",eke,[Rn(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),xe(je,{key:0,name:"check"})):e.variant==="danger"?(x(),xe(je,{key:1,name:"close"})):e.variant==="warning"?(x(),xe(je,{key:2,name:"alert-triangle"})):(x(),xe(je,{key:3,name:"info"}))],!0)]),_("div",tke,[_("div",nke,O(e.title),1),e.message?(x(),T("div",ske,O(e.message),1)):le("",!0),Rn(t.$slots,"default",{},void 0,!0)]),re(qn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Ee(()=>[re(je,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),ike=ct(oke,[["__scopeId","data-v-adc6f346"]]),rke={key:0,class:"actions"},lke=["onClick"],ake=["onClick"],cke={key:1,class:"details"},uke=Ge({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Mt();function i(w){return typeof w=="object"&&w!==null}function r(w){return i(w)?w.title:w}function l(w){return i(w)?w.message??"":""}function a(w){return i(w)?w.details:void 0}function c(w){return i(w)?w.severity==="error":w.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(w)}function u(w){return i(w)?`notice:${w.severity}:${w.title}:${w.message??""}:${JSON.stringify(w.details??[])}`:`text:${w}`}function d(w){if(!i(w))return w;const M=[w.title];w.message&&M.push(w.message);const N=w.details??[];if(N.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const F of N)M.push(`${F.label}: ${F.value}`)}return M.join(`
|
|
325
|
-
`)}let f=1;const h=X([]),p=new Map,m=new Map;function b(w){const M=c(w)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function v(w,M){const N=p.get(w)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(w),M),N.deadline=Date.now()+M,p.set(w,N)}function g(w){const M=p.get(w);M&&M.handle!==null&&clearTimeout(M.handle),p.delete(w)}function y(w){const M=p.get(w);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function k(w){if(h.value.find(F=>F.id===w)?.detailsOpen)return;const N=p.get(w);!N||N.handle!==null||v(w,N.remaining)}function E(w){w.detailsOpen=!w.detailsOpen,w.detailsOpen?y(w.id):k(w.id)}async function L(w){if(!await Zs(d(w.warning)))return;w.copied=!0;const N=m.get(w.id);N&&clearTimeout(N),m.set(w.id,setTimeout(()=>{w.copied=!1,m.delete(w.id)},1400))}function $(w){g(w);const M=m.get(w);M&&clearTimeout(M),m.delete(w);const N=h.value.findIndex(F=>F.id===w);N!==-1&&(h.value=h.value.filter(F=>F.id!==w),s("dismiss",N))}return Ze(()=>n.warnings,w=>{const M=[...h.value];h.value=w.map(N=>{const F=u(N),S=M.findIndex(R=>R.key===F),I=S===-1?void 0:M.splice(S,1)[0];if(I)return I.warning=N,I;const B={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return v(B.id,b(N)),B});for(const N of M){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),xn(()=>{p.forEach(w=>{w.handle!==null&&clearTimeout(w.handle)}),p.clear(),m.forEach(w=>clearTimeout(w)),m.clear()}),(w,M)=>(x(),xe(q9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(x(!0),T(Be,null,nt(h.value,N=>(x(),xe(ike,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(N.id),onPointerenter:F=>y(N.id),onPointerleave:F=>k(N.id)},{default:Ee(()=>[a(N.warning)?.length?(x(),T("div",rke,[_("button",{class:"link",type:"button",onClick:F=>E(N)},O(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,lke),_("button",{class:"link",type:"button",onClick:F=>L(N)},O(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,ake)])):le("",!0),N.detailsOpen&&a(N.warning)?.length?(x(),T("dl",cke,[(x(!0),T(Be,null,nt(a(N.warning),F=>(x(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):le("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),dke=ct(uke,[["__scopeId","data-v-6cc72bd4"]]),fke={class:"topbar"},hke={class:"wsq"},pke=["aria-label"],mke={class:"tb-path"},gke={class:"ws"},vke={class:"se"},yke={class:"tb-sub"},kke=Ge({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t,i=D(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=D(()=>s.workspace?.name??n("workspace.noWorkspace")),l=D(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),T("div",fke,[_("span",hke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[_("span",mke,[_("span",gke,O(r.value),1),e.sessionTitle?(x(),T(Be,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",vke,O(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",yke,[_("span",{class:Pe(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(x(),T(Be,{key:0},[Qe(" · "+O(e.branch),1)],64)):le("",!0),e.sessionCount>0?(x(),T(Be,{key:1},[Qe(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,pke),re(qn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Ee(()=>[re(je,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),bke=ct(kke,[["__scopeId","data-v-6b4b901f"]]),xke={key:0,class:"sheet-root"},wke=["aria-label"],_ke=["aria-label"],Ske={key:0,class:"sheet-head"},Cke={class:"sheet-title"},Ake={class:"sheet-body"},Mke=Ge({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ze(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),xn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),xe(Tl,{name:"sheet"},{default:Ee(()=>[e.modelValue?(x(),T("div",xke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,_ke),e.title?(x(),T("div",Ske,[_("span",Cke,O(e.title),1)])):le("",!0),_("div",Ake,[Rn(l.$slots,"default",{},void 0,!0)])],8,wke)])):le("",!0)]),_:3}))}}),x8=ct(Mke,[["__scopeId","data-v-745ee5a2"]]),Eke={class:"mlist"},Tke={key:0,class:"mempty"},Nke=["onClick"],Ike={class:"mgh-main"},$ke={class:"mgh-name"},Lke={class:"mgh-path"},Fke={key:2,class:"att"},Oke={key:0,class:"mempty small"},Rke=["onClick"],Bke={class:"m"},Dke={class:"s"},Pke={key:0,class:"att"},Hke=["disabled","onClick"],Wke=["onClick"],zke=Ge({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Mt(),{confirm:s}=zr(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=X(new Set);function f(S){return d.value.has(S)}function h(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,k.value=null,w.value=null}const p=X(new Set);function m(S){return p.value.has(S)}function b(S){const I=new Set(p.value);I.has(S)?I.delete(S):I.add(S),p.value=I}function v(S){if(m(S.workspace.id))return S.sessions;const I=S.sessions.slice(0,S.initialCount);if(o.activeId&&!I.some(B=>B.id===o.activeId)){const B=S.sessions.find(R=>R.id===o.activeId);if(B)return[...I,B]}return I}function g(S){if(!p.value.has(S)){const I=new Set(p.value);I.add(S),p.value=I}i("loadMore",S)}function y(S){return o.attentionByWorkspace[S]??0}const k=X(null);function E(S){k.value=k.value===S?null:S,w.value=null}function L(S){k.value=null;const B=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();B&&i("rename",S.id,B)}async function $(S){k.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const w=X(null);function M(S){w.value=w.value===S?null:S,k.value=null}function N(S){Zs(S.root),w.value=null}async function F(S){w.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,I)=>(x(),xe(x8,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=B=>i("update:modelValue",B))},{default:Ee(()=>[_("button",{type:"button",class:"newrow",onClick:c},[re(je,{name:"message",size:"sm"}),Qe(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:u},[re(je,{name:"folder",size:"sm"}),Qe(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",Eke,[e.groups.length===0?(x(),T("div",Tke,O(C(n)("workspace.noWorkspace")),1)):le("",!0),(x(!0),T(Be,null,nt(e.groups,B=>(x(),T("div",{key:B.workspace.id,class:"mgroup"},[_("div",{class:Pe(["mgh",{on:B.workspace.id===e.activeWorkspaceId}]),onClick:R=>h(B.workspace.id)},[f(B.workspace.id)?(x(),xe(je,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),xe(je,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",Ike,[_("span",$ke,O(B.workspace.name),1),re(Yt,{text:B.workspace.root},{default:Ee(()=>[_("span",Lke,O(B.workspace.branch||B.workspace.shortPath),1)]),_:2},1032,["text"])]),f(B.workspace.id)&&y(B.workspace.id)>0?(x(),T("span",Fke,O(y(B.workspace.id)),1)):le("",!0),re(qn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:kt(R=>M(B.workspace.id),["stop"])},{default:Ee(()=>[re(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),re(qn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:kt(R=>a(B.workspace.id),["stop"])},{default:Ee(()=>[re(je,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),w.value===B.workspace.id?(x(),xe(vl,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{size:"lg",onClick:R=>N(B.workspace)},{default:Ee(()=>[Qe(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),re(mn,{size:"lg",danger:"",onClick:R=>F(B.workspace)},{default:Ee(()=>[Qe(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,Nke),On(_("div",null,[B.sessions.length===0?(x(),T("div",Oke,O(C(n)("sidebar.noSessions")),1)):le("",!0),(x(!0),T(Be,null,nt(v(B),R=>(x(),T("div",{key:R.id,class:Pe(["srow",{cur:R.id===e.activeId}]),onClick:P=>l(R.id)},[_("div",Bke,[_("div",{class:Pe(["t",{run:R.busy,aborted:R.status==="aborted"}])},O(R.title),3),_("div",Dke,O(R.time),1)]),(e.attentionBySession[R.id]??0)>0?(x(),T("span",Pke,O(e.attentionBySession[R.id]),1)):le("",!0),re(qn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:kt(P=>E(R.id),["stop"])},{default:Ee(()=>[re(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),k.value===R.id?(x(),xe(vl,{key:1,class:"kmenu",onClick:I[1]||(I[1]=kt(()=>{},["stop"]))},{default:Ee(()=>[re(mn,{size:"lg",onClick:P=>L(R)},{default:Ee(()=>[Qe(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),re(mn,{size:"lg",danger:"",onClick:P=>$(R.id)},{default:Ee(()=>[Qe(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):le("",!0)],10,Rke))),128)),B.hasMore||B.loadingMore?(x(),T("button",{key:1,type:"button",class:"mshow-more",disabled:B.loadingMore,onClick:kt(R=>g(B.workspace.id),["stop"])},O(B.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,B.workspace.sessionCount-B.sessions.length)})),9,Hke)):le("",!0),B.sessions.length>B.initialCount?(x(),T("button",{key:2,type:"button",class:"mshow-more",onClick:kt(R=>b(B.workspace.id),["stop"])},O(m(B.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:B.sessions.length-B.initialCount})),9,Wke)):le("",!0)],512),[[yi,!f(B.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Uke=ct(zke,[["__scopeId","data-v-7ca5a6a0"]]),qke={class:"group-title"},jke={class:"srow-main"},Vke={class:"srow-label"},Kke={class:"srow-sub"},Gke={class:"srow read-only"},Yke={class:"srow-main"},Zke={class:"srow-label"},Qke={key:0,class:"srow-sub"},Xke={class:"srow-main"},Jke={class:"srow-label"},e2e={class:"srow-sub"},t2e=["aria-checked"],n2e={class:"srow-main"},s2e={class:"srow-label"},o2e={class:"srow-sub"},i2e=["aria-checked"],r2e={class:"srow-main"},l2e={class:"srow-label"},a2e={class:"srow read-only"},c2e={class:"srow-main"},u2e={class:"srow-label"},d2e={class:"srow-sub"},f2e=["aria-label"],h2e={class:"group-title"},p2e={class:"srow-main"},m2e={class:"srow-label"},g2e={class:"srow-sub"},v2e={class:"srow read-only pref"},y2e={class:"srow-main"},k2e={class:"srow-label"},b2e={class:"srow read-only pref"},x2e={class:"srow-main"},w2e={class:"srow-label"},_2e={class:"srow read-only pref"},S2e={class:"srow-main"},C2e={class:"srow-label"},A2e={class:"num-field"},M2e=["value","aria-label"],E2e={class:"srow-main"},T2e={class:"srow-label"},N2e={class:"srow-sub"},I2e=["aria-checked"],$2e={class:"srow-main"},L2e={class:"srow-label"},F2e={class:"srow-main"},O2e={class:"srow-label"},R2e={key:2,class:"srow read-only"},B2e={class:"srow-main"},D2e={class:"srow-label"},P2e={class:"srow-val dim"},H2e={class:"arch-subhead"},W2e={class:"arch-count"},z2e={class:"arch-tools"},U2e={key:0,class:"arch-empty"},q2e={class:"arch-meta"},j2e={class:"arch-name"},V2e={class:"arch-time"},K2e={key:2,class:"arch-empty"},G2e=100,Y2e=Ge({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Mt(),s=e,o=t;function i(ue){o("setColorScheme",ue)}const r=["manual","auto","yolo"],l=D(()=>s.models?.find(ue=>ue.id===s.status?.modelId)),a=D(()=>Hm(l.value)),c=D(()=>Pk(l.value)),u=D(()=>$p(l.value,s.thinking)),d=D(()=>c.value.includes(u.value)?u.value:""),f=D(()=>c.value.map(ue=>({value:ue,label:Vv(ue)}))),h=D(()=>s.planMode===!0),p=D(()=>s.swarmMode===!0),m=D(()=>{const ue=s.status.permission;return ue==="yolo"?"var(--color-danger)":ue==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=D(()=>{const ue=s.status.permission,fe=n(ue==="yolo"?"mobile.permYoloSub":ue==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ue} · ${fe}`}),v=ue=>`${Math.round(ue/1e3)}k`,g=D(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),y=D(()=>s.status.ctxMax>0?`${v(s.status.ctxUsed)}/${v(s.status.ctxMax)}`:n("status.statusNone"));function k(ue){o("setThinking",Hk(l.value,ue))}function E(){const ue=r.indexOf(s.status.permission),fe=r[(ue+1)%r.length];o("setPermission",fe)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function w(){o("logout"),o("update:modelValue",!1)}const M=u2(),N=X("main"),F=X([]),S=X(!1),I=X(!1),B=X(""),R=X("archived-desc");async function P(){if(!S.value){S.value=!0,I.value=!1;try{const ue=[];let fe;for(;;){const oe=await M.loadArchivedSessions({beforeId:fe,pageSize:G2e});if(ue.push(...oe.items),!oe.hasMore||oe.items.length===0)break;const Z=oe.items.at(-1)?.id;if(Z===void 0)break;fe=Z}F.value=ue,I.value=!0}catch(ue){console.warn("loadAllArchived failed",ue)}finally{S.value=!1}}}function z(){N.value="archived",B.value="",P()}function W(){N.value="main"}const ee=D(()=>{const ue=B.value.trim().toLowerCase();let fe=F.value.filter(oe=>oe.archived===!0);return ue&&(fe=fe.filter(oe=>oe.title.toLowerCase().includes(ue))),fe=fe.slice(),R.value==="archived-desc"?fe.sort((oe,Z)=>Z.updatedAt.localeCompare(oe.updatedAt)):R.value==="created-desc"?fe.sort((oe,Z)=>Z.createdAt.localeCompare(oe.createdAt)):fe.sort((oe,Z)=>oe.title.localeCompare(Z.title,"zh")),fe});async function U(ue){await M.restoreSession(ue)&&(F.value=F.value.filter(oe=>oe.id!==ue))}function Y(ue){const fe=new Date(ue);if(Number.isNaN(fe.getTime()))return ue;const oe=Z=>String(Z).padStart(2,"0");return`${fe.getFullYear()}-${oe(fe.getMonth()+1)}-${oe(fe.getDate())} ${oe(fe.getHours())}:${oe(fe.getMinutes())}`}return Ze(()=>s.modelValue,ue=>{ue||(N.value="main")}),(ue,fe)=>(x(),xe(x8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":fe[6]||(fe[6]=oe=>o("update:modelValue",oe))},{default:Ee(()=>[N.value==="main"?(x(),T(Be,{key:0},[_("div",qke,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:L},[_("span",jke,[_("span",Vke,O(C(n)("status.statusModel")),1),_("span",Kke,O(e.status.model),1)]),fe[7]||(fe[7]=_("span",{class:"chev"},"›",-1))]),_("div",Gke,[_("span",Yke,[_("span",Zke,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),T("span",Qke,O(C(n)("status.modeNotSupported")),1)):le("",!0)]),c.value.length>1?(x(),xe(vo,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":k},null,8,["model-value","options"])):(x(),T("span",{key:1,class:Pe(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(Vv)(u.value)),3))]),_("button",{type:"button",class:"srow",onClick:fe[0]||(fe[0]=oe=>o("togglePlan"))},[_("span",Xke,[_("span",Jke,O(C(n)("status.statusPlanMode")),1),_("span",e2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:Pe(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,t2e)]),_("button",{type:"button",class:"srow",onClick:fe[1]||(fe[1]=oe=>o("toggleSwarm"))},[_("span",n2e,[_("span",s2e,O(C(n)("status.statusSwarmMode")),1),_("span",o2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:Pe(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,i2e)]),_("button",{type:"button",class:"srow",onClick:E},[_("span",r2e,[_("span",l2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Gt({color:m.value})},O(b.value),5)]),fe[8]||(fe[8]=_("span",{class:"chev"},"›",-1))]),_("div",a2e,[_("span",c2e,[_("span",u2e,O(C(n)("status.statusContext")),1),_("span",d2e,O(y.value),1)]),_("span",{class:"ctx-meter","aria-label":y.value},[_("i",{style:Gt({width:g.value+"%"})},null,4)],8,f2e)]),_("div",h2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:z},[_("span",p2e,[_("span",m2e,O(C(n)("mobile.archivedSessions")),1),_("span",g2e,O(C(n)("mobile.archivedSessionsSub")),1)]),fe[9]||(fe[9]=_("span",{class:"chev"},"›",-1))]),_("div",v2e,[_("span",y2e,[_("span",k2e,O(C(n)("theme.colorSchemeLabel")),1)]),re(vo,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",b2e,[_("span",x2e,[_("span",w2e,O(C(n)("sidebar.language")),1)]),re(k8)]),_("div",_2e,[_("span",S2e,[_("span",C2e,O(C(n)("settings.uiFontSize")),1)]),_("label",A2e,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:fe[2]||(fe[2]=oe=>o("setUiFontSize",Number(oe.target.value)))},null,40,M2e),fe[10]||(fe[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:fe[3]||(fe[3]=oe=>o("setConversationToc",!e.conversationToc))},[_("span",E2e,[_("span",T2e,O(C(n)("settings.conversationToc")),1),_("span",N2e,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:Pe(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,I2e)]),e.authReady?(x(),T("button",{key:0,type:"button",class:"srow acct out",onClick:w},[_("span",$2e,[_("span",L2e,O(C(n)("sidebar.signOut")),1)])])):(x(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[_("span",F2e,[_("span",O2e,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),T("div",R2e,[_("span",B2e,[_("span",D2e,O(C(n)("settings.serverVersion")),1)]),_("span",P2e,O(e.serverVersion),1)])):le("",!0)],64)):(x(),T(Be,{key:1},[_("div",H2e,[_("button",{type:"button",class:"arch-back",onClick:W},[fe[11]||(fe[11]=_("span",{class:"chev back"},"‹",-1)),Qe(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",W2e,O(C(n)("mobile.sessionCount",{n:ee.value.length})),1)]),_("div",z2e,[re(Wc,{class:"arch-search-input","model-value":B.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":fe[4]||(fe[4]=oe=>B.value=oe)},null,8,["model-value","placeholder"]),re(vo,{size:"sm","model-value":R.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":fe[5]||(fe[5]=oe=>R.value=oe)},null,8,["model-value","options"])]),S.value?(x(),T("div",U2e,O(C(n)("settings.archivedLoadingAll")),1)):ee.value.length>0?(x(!0),T(Be,{key:1},nt(ee.value,oe=>(x(),T("div",{key:oe.id,class:"arch-row"},[_("div",q2e,[_("div",j2e,O(oe.title),1),_("div",V2e,O(C(n)("settings.archivedAt",{time:Y(oe.updatedAt)})),1)]),re(Rt,{variant:"secondary",size:"sm",onClick:Z=>U(oe.id)},{default:Ee(()=>[Qe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),T("div",K2e,O(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),Z2e=ct(Y2e,[["__scopeId","data-v-83a012a5"]]),Q2e={class:"ob-brand"},X2e={class:"ob-brand-text"},J2e={class:"ob-title"},ebe={class:"ob-sub"},tbe={class:"ob-sec"},nbe={class:"ob-label"},sbe={class:"ob-sec"},obe={class:"ob-label"},ibe={class:"ob-sec"},rbe={class:"ob-label"},lbe=Ge({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Mt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=L5();function c(d){o.value!==d&&yA(d)}function u(){n("complete")}return(d,f)=>(x(),xe(Wr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ee(()=>[_("div",Q2e,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",X2e,[_("div",J2e,O(C(s)("onboarding.title")),1),_("div",ebe,O(C(s)("onboarding.subtitle")),1)])])]),default:Ee(()=>[_("section",tbe,[_("div",nbe,O(C(s)("onboarding.languageLabel")),1),re(vo,{"model-value":C(o),options:C(vA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",sbe,[_("div",obe,O(C(s)("theme.colorSchemeLabel")),1),re(vo,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",ibe,[_("div",rbe,O(C(s)("theme.accentLabel")),1),re(vo,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),re(Rt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Qe(O(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),abe=ct(lbe,[["__scopeId","data-v-fbdd3eab"]]),cbe=["aria-label"],ube={class:"gload-box"},dbe={class:"gload-text"},fbe={key:0,class:"gload-issue"},hbe={class:"gload-issue-detail"},pbe=Ge({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Mt();return(n,s)=>(x(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",ube,[s[0]||(s[0]=_y('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-0b6dec6a></path></svg>',1)),re(zo,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",dbe,O(C(t)("app.connecting")),1),e.issue?(x(),T("div",fbe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",hbe,O(e.issue),1)])):le("",!0)])],8,cbe))}}),mbe=ct(pbe,[["__scopeId","data-v-0b6dec6a"]]),gbe={class:"kap-root"},vbe={class:"kap-head"},ybe={class:"kap-count"},kbe={class:"kap-head-actions"},bbe={class:"kap-filters"},xbe=["value"],wbe={class:"kap-check"},_be={class:"kap-check"},Sbe={class:"kap-view-toggle",role:"group"},Cbe={key:0,class:"kap-empty"},Abe=["onClick"],Mbe={class:"kap-ts"},Ebe={class:"kap-label"},Tbe={key:0,class:"kap-detail"},Nbe={class:"kap-detail-actions"},Ibe=["onClick"],$be={key:1,class:"kap-agg"},Lbe={class:"mono"},Fbe={class:"mono"},Obe={class:"num"},Rbe={class:"num"},Bbe={key:0},Dbe={class:"mono"},Pbe={class:"num"},Hbe={class:"num"},Wbe={key:0},zbe=Ge({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=X("all"),o=X(""),i=X(""),r=X(!1),l=X("timeline"),a=D(()=>(Ek.value,[...Ete()])),c=D(()=>{const M=new Set;for(const N of a.value)N.sessionId&&M.add(N.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=D(()=>{const M=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||M&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(M)))}),f=D(()=>{const M=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,I=M.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};I.count++,N.seq!==void 0&&(I.lastSeq=N.seq),M.set(S,I)}return[...M.values()].sort((N,F)=>F.count-N.count)}),h=D(()=>{const M=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=M.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),M.set(F,S)}return[...M.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),p=X(null),m=X(!0),b=X(null),v=X(null);Ze(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await pt();const M=b.value;M&&(M.scrollTop=M.scrollHeight)});function g(M){p.value=p.value===M?null:M}function y(M){const N=new Date(M),F=(S,I=2)=>String(S).padStart(I,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function k(M){return JSON.stringify(M,null,2)}async function E(M){await Zs(k(M))&&(v.value=M.id,setTimeout(()=>{v.value===M.id&&(v.value=null)},1500))}function L(){l5(d.value)}function $(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 w(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,N)=>(x(),T("section",gbe,[_("header",vbe,[N[11]||(N[11]=_("strong",null,"KAP debug",-1)),_("span",ybe,O(d.value.length)+"/"+O(a.value.length),1),_("div",kbe,[_("button",{type:"button",class:Pe({on:C(zu)}),onClick:N[0]||(N[0]=F=>zu.value=!C(zu))},O(C(zu)?"resume":"pause"),3),_("button",{type:"button",onClick:N[1]||(N[1]=F=>C(Tte)())},"clear"),_("button",{type:"button",onClick:N[2]||(N[2]=F=>L())},"export jsonl"),re(Yt,{text:"Close window"},{default:Ee(()=>[_("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",bbe,[On(_("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[Wg,s.value]]),On(_("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=_("option",{value:""},"all sessions",-1)),(x(!0),T(Be,null,nt(c.value,F=>(x(),T("option",{key:F,value:F},O(F),9,xbe))),128))],512),[[Wg,i.value]]),On(_("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[So,o.value]]),_("label",wbe,[On(_("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[Yh,r.value]]),N[14]||(N[14]=Qe(" errors",-1))]),_("label",_be,[On(_("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[Yh,m.value]]),N[15]||(N[15]=Qe(" follow",-1))]),_("div",Sbe,[_("button",{type:"button",class:Pe({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:Pe({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),T("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(x(),T("div",Cbe," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(x(!0),T(Be,null,nt(d.value,F=>(x(),T("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:Pe(["kap-row",{expanded:p.value===F.id}]),onClick:S=>g(F.id)},[_("span",Mbe,O(y(F.ts)),1),_("span",{class:Pe(["kap-badge",$(F)])},O(w(F)),3),_("span",Ebe,O(F.label),1)],10,Abe),p.value===F.id?(x(),T("div",Tbe,[_("div",Nbe,[_("button",{type:"button",onClick:S=>E(F)},O(v.value===F.id?"copied ✓":"copy json"),9,Ibe)]),_("pre",null,O(k(F)),1)])):le("",!0)]))),128))],512)):(x(),T("div",$be,[N[20]||(N[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[N[17]||(N[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(x(!0),T(Be,null,nt(f.value,F=>(x(),T("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",Lbe,O(F.eventType),1),_("td",Fbe,O(F.sessionId),1),_("td",Obe,O(F.count),1),_("td",Rbe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),T("tr",Bbe,[...N[16]||(N[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),N[21]||(N[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[N[19]||(N[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(x(!0),T(Be,null,nt(h.value,F=>(x(),T("tr",{key:F.key},[_("td",Dbe,O(F.key),1),_("td",Pbe,O(F.count),1),_("td",{class:Pe(["num",{err:F.errors>0}])},O(F.errors),3),_("td",Hbe,O(F.avgMs),1)]))),128)),h.value.length===0?(x(),T("tr",Wbe,[...N[18]||(N[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),Ube=ct(zbe,[["__scopeId","data-v-3cda6fe3"]]),qbe=Ge({__name:"DebugPanel",setup(e){const t=X(!1);let n=null,s=null,o=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=Zh(Ube,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return fn(()=>{c()}),ps(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),xe(Yt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),jbe=ct(qbe,[["__scopeId","data-v-21346738"]]);function Vbe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),s=D(()=>e.initialized.value&&!n.value),o="/login",i=X(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ze(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(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 xn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function Kbe({running:e,showAuthGate:t}){const{t:n}=Mt(),s=["◐","◓","◑","◒"],o=X(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ze(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});rT(()=>{typeof document<"u"&&(document.title=a.value)}),xn(()=>{l()})}const w8=X(typeof window>"u"?0:window.innerWidth);let lh=0,Up=!1;function sy(){w8.value=window.innerWidth}function Gbe(){Up||typeof window>"u"||(window.addEventListener("resize",sy),Up=!0,sy())}function Ybe(){!Up||typeof window>"u"||(window.removeEventListener("resize",sy),Up=!1)}function _8(e,t,n){return Math.max(t,e-n)}function oy(e,t,n){return Math.min(n,Math.max(t,e))}function S8(){return fn(()=>{lh+=1,Gbe()}),ps(()=>{lh=Math.max(0,lh-1),lh===0&&Ybe()}),{viewportWidth:w8}}const Zbe="kimi-web.file-preview-width",mc=320;function Qbe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=S8(),i=D(()=>Math.max(0,o.value-t.value)),r=D(()=>_8(i.value,mc,mc));function l(ge){return oy(Math.round(ge),mc,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=X(c.value),d=D(()=>oy(u.value,mc,r.value)),f=X(null),h=D(()=>{const ge=f.value;if(!ge)return null;const se=e.turns.value.find(ye=>ye.id===ge.turnId)?.blocks?.[ge.blockIndex];return se?.kind==="thinking"?se.thinking:null}),p=D(()=>h.value!==null);function m(ge){const q=f.value;if(q&&q.turnId===ge.turnId&&q.blockIndex===ge.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ge}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=X(null),g=D(()=>{const ge=v.value;if(!ge)return null;const q=e.turns.value.find(se=>se.id===ge.turnId);return q?.role==="compaction"&&q.text?q.text:null}),y=D(()=>g.value!==null);function k(ge){if(v.value?.turnId===ge.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=ge}function E(){v.value=null,n.value==="compaction"&&(n.value=null)}const L=X(null);function $(ge){const q=e.activeAppTasks.value,se=q.find(de=>de.id===ge)??q.find(de=>de.parentToolCallId===ge);if(se)return se.id;const ye=q.filter(de=>de.kind==="subagent"&&!de.parentToolCallId);if(ye.length===1)return ye[0].id}const w=D(()=>{const ge=L.value;if(!ge)return null;const q=e.activeAppTasks.value.find(se=>se.id===ge.subagentId);return q?Cme(q):null}),M=D(()=>w.value!==null);function N(ge){const q=$(ge);if(q){if(L.value?.subagentId===q){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:q},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=X(null),I=D(()=>{const ge=S.value;if(!ge)return null;const q=oH(e.turns.value,ge);return q?{id:ge,title:La(q.name),path:sH(q.arg),lines:q.status==="error"?null:xA(q),output:q.output}:null}),B=D(()=>I.value!==null);function R(ge){if(n.value==="toolDiff"&&S.value===ge){P();return}n.value="toolDiff",S.value=ge}function P(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=X("list"),W=X(null);function ee(){if(n.value==="diff"){U();return}n.value="diff",z.value="list",W.value=null,e.loadGitStatus(e.activeSessionId.value)}function U(){n.value==="diff"&&(n.value=null),z.value="list",W.value=null,e.clearFileDiff()}async function Y(ge){z.value="detail",W.value=ge,await e.loadFileDiff(ge)}async function ue(ge){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,ge):await e.openSideChat(ge),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function oe(){n.value==="btw"&&(n.value=null)}const Z=D(()=>e.sideChatVisible.value),te=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||M.value)&&(n.value!=="toolDiff"||B.value)&&(n.value!=="btw"||Z.value)),ae=X(!1),He=X({});function he(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function K(ge){if(ge)switch(ge.kind){case"thinking":f.value={turnId:ge.turnId,blockIndex:ge.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:ge.turnId},n.value="compaction";break;case"agent":L.value={subagentId:ge.subagentId},n.value="agent";break;case"toolDiff":S.value=ge.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ce(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(E(),!0):n.value==="agent"&&M.value?(F(),!0):n.value==="toolDiff"&&B.value?(P(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(U(),!0):n.value==="btw"?(fe(),!0):!1}return Ze(e.activeSessionId,(ge,q)=>{if(q){const se=he();se?He.value[q]=se:delete He.value[q]}s(),b(),E(),F(),P(),U(),oe(),ge&&K(He.value[ge])}),{PREVIEW_WIDTH_KEY:Zbe,PREVIEW_MIN:mc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:b,compactionPanelText:g,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:E,agentPanelMember:w,agentPanelVisible:M,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:I,toolDiffVisible:B,openToolDiff:R,closeToolDiff:P,detailDiffMode:z,detailDiffPath:W,openDiffDetail:ee,closeDiffDetail:U,selectDiffFile:Y,btwVisible:Z,openSideChatTab:ue,closeSideChat:fe,hideSideChatPanel:oe,sidePanelVisible:te,panelDragging:ae,closeOpenSidePanel:ce}}const Xbe=Ft.sidebarWidth,s4=Ft.sidebarCollapsed,o4=270,_g=170,Jbe=480,exe=320;function txe(e={}){const{viewportWidth:t}=S8(),n=X(o4),s=X(!1),o=X(!1),i=D(()=>{const u=exe+(E4(e.previewOpen)?mc:0);return Math.min(Jbe,_8(t.value,_g,u))}),r=D(()=>oy(n.value,_g,i.value));function l(){try{s.value=us(s4)==="true"}catch{s.value=!1}}function a(){try{ms(s4,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:Xbe,SIDEBAR_DEFAULT:o4,SIDEBAR_MIN:_g,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function nxe({client:e,detailTarget:t}){const{t:n}=Mt(),s=X(null),o=X(null),i=X(!1),r=X(null),l=X(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),f=D(()=>s.value!==null);function h($){return $.length>1?$.replace(/\/+$/,""):$}function p($){const w=[];for(const M of $.split(/[\\/]+/))if(!(!M||M===".")){if(M===".."){w.pop();continue}w.push(M)}return w.join("/")}function m($){const w=$.trim();if(!w)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(w))return{error:n("filePreview.errors.unsupportedPath")};if(w.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const M=h(e.status.value.cwd);if(w.startsWith("/")){if(!M||w!==M&&!w.startsWith(`${M}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=w===M?"":w.slice(M.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(w.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=p(w);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function b($){const w=s.value;if(t.value==="file"&&w&&w.path===$.path&&w.line===$.line){k();return}const M=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=$,l.value=null;const N=m($.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if(M!==a)return;F?o.value={...F,path:F.path||N.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(M!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{M===a&&(i.value=!1)}}function v($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const w=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const M={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??v($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,o.value=M,ut().getFileBlob($.fileId).then(N=>{if(w===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(N),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{w===a&&(o.value&&(o.value={...o.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,o.value={...M,sourceUrl:$.url})}function y(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Ze(t,($,w)=>{w==="file"&&$!=="file"&&y()});function E(){const $=o.value?.path??s.value?.path;$&&e.openWorkspaceFile($,s.value?.line)}function L(){const $=o.value?.path??s.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:g,closeFilePreview:k,openPreviewInEditor:E,revealPreviewFile:L}}const sxe=640,oxe=`(max-width: ${sxe}px)`;function ixe(){const e=X(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(oxe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),xn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),xn(()=>t.removeListener(n))),e}const rxe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},lxe={class:"server-auth-card"},axe={class:"server-auth-body"},cxe={class:"server-auth-foot"},uxe=Ge({__name:"ServerAuthDialog",setup(e){const t=X(""),n=X(null),s=X(!1);fn(()=>{pt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,h5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(x(),T("div",rxe,[_("div",lxe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[Qe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Qe("). ")])],-1)),_("div",axe,[re(Wc,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:s.value,onKeydown:i},null,8,["modelValue","disabled"])]),_("div",cxe,[re(Rt,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Ee(()=>[Qe(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),dxe=ct(uxe,[["__scopeId","data-v-6f624612"]]),fxe=["aria-label"],hxe=Ge({__name:"InternalBuildBanner",setup(e){const{t}=Mt(),n=xB;return(s,o)=>C(n)?(x(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=_("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,fxe)):le("",!0)}}),pxe=ct(hxe,[["__scopeId","data-v-166b3735"]]),mxe={class:"app-shell"},gxe={key:1,class:"auth-page"},vxe={class:"auth-page-inner"},yxe={class:"auth-page-copy"},kxe=["aria-label","aria-hidden"],bxe=Ge({__name:"App",setup(e){xne();const t=X(!1);let n=null;const s=u2(),o=D(()=>!s.dangerousBypassAuth.value&&t.value);Ln("resolveImage",s.resolveImageUrl),Ln("resolveSwarmMembers",lt=>s.swarmMembersByToolCallId.value.get(lt)??[]);const{t:i}=Mt(),r=Bi(),l=ixe(),a=X(!1),c=X(!1),u=D(()=>{const lt=s.activeSessionId.value;return s.sessions.value.find(Q=>Q.id===lt)?.title??""}),d=D(()=>s.visibleWorkspace.value?.sessionCount??0),f=D(()=>s.activity.value!=="idle"),h=X(null),{showAuthGate:p,blinkAuthLogo:m}=Vbe({client:s,authLogoRef:h});Kbe({running:f,showAuthGate:p});function b(lt){const Q=s.models.value.find(lo=>lo.id===s.status.value.modelId),me=Pk(Q),Je=me.indexOf($p(Q,lt)),It=me[(Je+1)%me.length]??me[0]??"off";return Hk(Q,It)}const v=D(()=>{const lt=s.models.value.find(Q=>Q.id===s.status.value.modelId);return $p(lt,s.thinking.value)}),g=X(!s.onboarded.value);function y(){s.setOnboarded(!0),g.value=!1}function k(){g.value=!0}let E=0;function L(){const lt=window.visualViewport,Q=document.documentElement.style;Q.setProperty("--app-height",`${lt?.height??window.innerHeight}px`),Q.setProperty("--app-top",`${lt?.offsetTop??0}px`)}function $(){E||(E=requestAnimationFrame(()=>{E=0,L()}))}fn(()=>{n=Sne(()=>{t.value=!0,s.clearDangerousBypassAuth()}),s.load(),ce(),L(),window.visualViewport?.addEventListener("resize",$),window.visualViewport?.addEventListener("scroll",$),window.addEventListener("resize",$),document.addEventListener("keydown",w,!0)}),xn(()=>{document.removeEventListener("keydown",w,!0),window.visualViewport?.removeEventListener("resize",$),window.visualViewport?.removeEventListener("scroll",$),window.removeEventListener("resize",$),E&&(cancelAnimationFrame(E),E=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function w(lt){lt.key==="Escape"&&(Pt.value||Hs()&&(lt.stopPropagation(),lt.preventDefault()))}const M=X(null),N=X(!1);Ze(s.activeSessionId,()=>{N.value=!0,pt(()=>{N.value=!1})});const{previewTarget:F,previewFile:S,previewLoading:I,previewError:B,previewDownloadUrl:R,previewExternalActions:P,openFilePreview:z,openMediaPreview:W,closeFilePreview:ee,openPreviewInEditor:U,revealPreviewFile:Y}=nxe({client:s,detailTarget:M}),ue=D(()=>M.value!==null),{SIDEBAR_WIDTH_KEY:fe,SIDEBAR_DEFAULT:oe,SIDEBAR_MIN:Z,sidebarMax:te,sessionColWidth:ae,sidebarCollapsed:He,sidebarDragging:he,sideWidth:K,loadSidebarCollapsed:ce,toggleSidebarCollapse:ge}=txe({previewOpen:ue}),{PREVIEW_WIDTH_KEY:q,PREVIEW_MIN:se,previewDefaultWidth:ye,previewMax:de,previewWidth:ke,previewPanelWidth:j,thinkingPanelText:ne,thinkingVisible:ve,openThinkingPanel:Ae,closeThinkingPanel:$e,compactionPanelText:Oe,compactionPanelVisible:pe,openCompactionPanel:Ie,closeCompactionPanel:Xe,agentPanelMember:it,openAgentPanel:At,closeAgentPanel:bt,toolDiffTarget:wt,openToolDiff:qt,closeToolDiff:yt,detailDiffMode:Kt,detailDiffPath:gs,openDiffDetail:En,closeDiffDetail:Jt,selectDiffFile:wn,btwVisible:vs,openSideChatTab:st,closeSideChat:Bn,sidePanelVisible:Es,panelDragging:Dn,closeOpenSidePanel:Hs}=Qbe({client:s,sideWidth:K,detailTarget:M,closeFilePreview:ee}),Ws=X(null),Qn=X(!1),Tn=X(!1),yn=X(!1),jn=X(!1),ds=X(!1),Gn=X(!1),Nn=X(null),Pn=X(null),Pt=D(()=>dc.value>0||Qn.value||Tn.value||yn.value||jn.value||ds.value||Gn.value||g.value||a.value||c.value),Ye=X(!1),qe=X(!1),Lt=X(!1),Ht=X(!1),sn=X(!1);async function Zt(){Ye.value=!0,qe.value=!1,Qn.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{qe.value=!0}finally{Ye.value=!1}}async function _n(){Lt.value=!0,Ht.value=!1,Tn.value=!0;try{await s.loadProviders()}catch{Ht.value=!0}finally{Lt.value=!1}}function on(){yn.value=!0}async function Et(lt){Qn.value=!1,await ns(lt)}async function ns(lt){await s.setModel(lt)&<!==s.defaultModel.value&&s.updateConfig({defaultModel:lt})}async function ss(lt){await s.addProvider(lt)}async function io(lt){await s.deleteProvider(lt)}async function Hn(lt){await s.refreshProvider(lt)}async function os(lt){sn.value=!0;try{await s.updateConfig(lt)&&await s.checkAuth()}finally{sn.value=!1}}async function oi(){return s.startOAuthLogin()}async function Ls(){return s.pollOAuthLogin()}async function ii(){return s.cancelOAuthLogin()}async function Co(){yn.value=!1,await s.checkAuth(),await s.load()}async function Di(lt){await s.undo(1),await pt(),Ws.value?.loadComposerForEdit(lt.text,lt.images)}function ri(lt){if(lt==="/compact"||lt.startsWith("/compact ")){s.compact(lt.slice(8).trim()||void 0);return}if(lt==="/swarm"||lt.startsWith("/swarm ")){const Q=lt.slice(6).trim();Q==="on"?s.setSwarmMode(!0):Q==="off"?s.setSwarmMode(!1):Q?(s.setSwarmMode(!0),s.sendPrompt(Q)):s.toggleSwarmMode();return}if(lt==="/goal"||lt.startsWith("/goal ")){const Q=lt.slice(5).trim();Q==="pause"||Q==="resume"||Q==="cancel"?s.controlGoal(Q):Q?s.createGoal(Q):s.toggleGoalMode();return}if(lt==="/btw"||lt.startsWith("/btw ")){const Q=lt.slice(4).trim();!Q&&s.sideChatVisible.value?Bn():st(Q||void 0);return}switch(lt){case"/new":case"/clear":Os();break;case"/fork":s.forkSession();break;case"/export":s.exportSession();break;case"/undo":s.undo();break;case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(b(s.thinking.value));break;case"/status":ds.value=!0;break;case"/login":on();break;default:{const Q=lt.indexOf(" "),me=jie((Q===-1?lt:lt.slice(0,Q)).slice(1)),Je=Q===-1?void 0:lt.slice(Q+1).trim()||void 0;if(!me)break;!s.activeSessionId.value&&s.activeWorkspaceId.value?s.startSessionAndActivateSkill(s.activeWorkspaceId.value,me,Je):s.activateSkill(me,Je);break}}}function ys(lt){s.unqueue(lt)}function Ao(lt){s.unqueue(lt)}function or(lt){s.reorderQueue(lt.from,lt.to)}async function Pi(lt){const Q=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&Q){await s.startSessionAndSendPrompt(Q,lt.text,lt.attachments);return}if(!s.activeSessionId.value&&!Q){Nn.value=lt,jn.value=!0;return}s.sendPrompt(lt.text,lt.attachments)}async function fs(lt){if(Pn.value=null,!await s.addWorkspaceByPath(lt)){Pn.value=i("workspace.addFailed");return}jn.value=!1;const me=Nn.value;Nn.value=null;const Je=s.activeWorkspaceId.value;me&&Je&&await s.startSessionAndSendPrompt(Je,me.text,me.attachments)}function Fs(){Nn.value=null,Pn.value=null,jn.value=!1}function ro(){pt(()=>{Ws.value?.focusComposer()})}function Os(){const lt=s.activeWorkspaceId.value;lt?s.openWorkspaceDraft(lt):s.clearActiveSession(),ro()}function Mo(lt){s.openWorkspaceDraft(lt),ro()}function Vn(lt){lt&&window.open(lt,"_blank","noopener")}return(lt,Q)=>(x(),T("div",mxe,[o.value?(x(),xe(dxe,{key:0})):le("",!0),C(p)?(x(),T("section",gxe,[_("div",vxe,[(x(),T("svg",{ref_key:"authLogoRef",ref:h,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:Q[0]||(Q[0]=kt(()=>{},["prevent"])),onClick:Q[1]||(Q[1]=(...me)=>C(m)&&C(m)(...me))},[...Q[98]||(Q[98]=[_y('<defs data-v-4ca5d4da><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-4ca5d4da><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-4ca5d4da></rect><g class="ch-eyes" fill="#000" data-v-4ca5d4da><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-4ca5d4da></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-4ca5d4da></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-4ca5d4da></rect>',2)])],544)),_("div",yxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),re(Rt,{class:"auth-page-btn",variant:"primary",onClick:on},{default:Ee(()=>[re(je,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(x(),T("div",{key:2,class:Pe(["app",{mobile:C(l),"sidebar-collapsed":C(He)&&!C(l),"macos-desktop":C(Lc)}]),style:Gt({"--preview-w":C(j)+"px"})},[C(l)?(x(),xe(bke,{key:1,workspace:C(s).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:C(s).status.value.branch,"session-count":d.value,onOpenSwitcher:Q[19]||(Q[19]=me=>a.value=!0),onOpenSettings:Q[20]||(Q[20]=me=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),T(Be,{key:0},[re(qB,{collapsed:C(He),dragging:C(he),"col-width":C(K),"active-workspace":C(s).visibleWorkspace.value,"active-workspace-id":C(s).activeWorkspaceId.value,sessions:C(s).sessionsForView.value,groups:C(s).workspaceGroups.value,"active-id":C(s).activeSessionId.value,"attention-by-session":C(s).attentionBySession.value,"pending-by-session":C(s).pendingBySession.value,"unread-by-session":C(s).unreadBySession.value,"workspace-sort-mode":C(s).workspaceSortMode.value,backend:C(s).backend.value,onSelect:Q[2]||(Q[2]=me=>C(s).selectSession(me)),onCreate:Os,onCreateInWorkspace:Q[3]||(Q[3]=me=>Mo(me)),onSelectWorkspace:Q[4]||(Q[4]=me=>C(s).openWorkspace(me)),onAddWorkspace:Q[5]||(Q[5]=me=>jn.value=!0),onRename:Q[6]||(Q[6]=(me,Je)=>C(s).renameSession(me,Je)),onArchive:Q[7]||(Q[7]=me=>C(s).archiveSession(me)),onFork:Q[8]||(Q[8]=me=>C(s).forkSession(me)),onExport:Q[9]||(Q[9]=me=>C(s).exportSession(me)),onRenameWorkspace:Q[10]||(Q[10]=(me,Je)=>C(s).renameWorkspace(me,Je)),onDeleteWorkspace:Q[11]||(Q[11]=me=>C(s).deleteWorkspace(me)),onReorderWorkspaces:Q[12]||(Q[12]=me=>C(s).reorderWorkspaces(me)),onSetWorkspaceSortMode:Q[13]||(Q[13]=me=>C(s).setWorkspaceSortMode(me)),onLoadMoreSessions:Q[14]||(Q[14]=me=>void C(s).loadMoreSessions(me)),onLoadAllSessions:Q[15]||(Q[15]=me=>void C(s).loadAllSessions()),onOpenSettings:Q[16]||(Q[16]=me=>Gn.value=!0),onCollapse:C(ge)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),On(re(aw,{class:"side-handle","storage-key":C(fe),"default-width":C(oe),min:C(Z),max:C(te),"onUpdate:width":Q[17]||(Q[17]=me=>ae.value=me),"onUpdate:dragging":Q[18]||(Q[18]=me=>he.value=me)},null,8,["storage-key","default-width","min","max"]),[[yi,!C(He)]])],64)),re(nue,{ref_key:"conversationPaneRef",ref:Ws,mobile:C(l),turns:C(s).turns.value,"session-id":C(s).activeSessionId.value,approvals:C(s).pendingApprovals.value,changes:C(s).changes.value,"git-info":C(s).gitInfo.value,tasks:C(s).tasks.value,todos:C(s).todos.value,goal:C(s).goal.value,"activation-badges":C(s).activationBadges.value,status:C(s).status.value,thinking:C(s).thinking.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"goal-mode":C(s).goalMode.value,models:C(s).models.value,"starred-ids":C(s).starredModelIds.value,skills:C(s).skills.value,questions:C(s).questions.value,"pending-question-actions":C(s).pendingQuestionActions,"pending-approval-actions":C(s).pendingApprovalActions,running:f.value,queued:C(s).queued.value,"search-files":C(s).searchFiles,"upload-image":C(s).uploadImage,sending:C(s).isSending.value,starting:C(s).isStartingFirstPrompt.value,"fast-moon":C(s).fastMoon.value,"file-reload-key":C(s).activeSessionId.value,"session-loading":C(s).sessionLoading.value,compaction:C(s).compaction.value,"has-more-messages":C(s).hasMoreMessages.value,"loading-more":C(s).loadingMoreMessages.value,"loading-more-error":C(s).loadMoreMessagesError.value,"load-older-messages":C(s).loadOlderMessages,"workspace-name":C(s).visibleWorkspace.value?.name,"workspace-root":C(s).visibleWorkspace.value?.root??C(s).status.value.cwd,"git-diff-stats":C(s).gitDiffStats.value,workspaces:C(s).workspacesView.value,"active-workspace-id":C(s).activeWorkspaceId.value,"session-title":u.value,pr:C(s).activePullRequest.value,"conversation-toc":C(s).conversationToc.value,onOpenChanges:Q[21]||(Q[21]=me=>C(En)()),onSelectWorkspace:Q[22]||(Q[22]=me=>Mo(me)),onAddWorkspace:Q[23]||(Q[23]=me=>jn.value=!0),onOpenPr:Vn,onSubmit:Q[24]||(Q[24]=me=>Pi(me)),onSteer:Q[25]||(Q[25]=me=>C(s).steerPrompt(me.text,me.attachments)),onApproval:Q[26]||(Q[26]=(me,Je)=>C(s).respondApproval(me,Je)),onCancelTask:Q[27]||(Q[27]=me=>C(s).cancelTask(me)),onAnswer:Q[28]||(Q[28]=(me,Je)=>C(s).respondQuestion(me,Je)),onDismiss:Q[29]||(Q[29]=me=>C(s).dismissQuestion(me)),onCommand:ri,onInterrupt:Q[30]||(Q[30]=me=>C(s).abortCurrentPrompt()),onUnqueue:ys,onEditQueued:Ao,onReorderQueue:or,onSetPermission:Q[31]||(Q[31]=me=>C(s).setPermission(me)),onSetThinking:Q[32]||(Q[32]=me=>C(s).setThinking(me)),onTogglePlan:Q[33]||(Q[33]=me=>C(s).togglePlanMode()),onToggleSwarm:Q[34]||(Q[34]=me=>C(s).toggleSwarmMode()),onToggleGoal:Q[35]||(Q[35]=me=>C(s).toggleGoalMode()),onCreateGoal:Q[36]||(Q[36]=me=>C(s).createGoal(me)),onControlGoal:Q[37]||(Q[37]=me=>C(s).controlGoal(me)),onRefreshGitStatus:Q[38]||(Q[38]=me=>C(s).activeSessionId.value&&C(s).loadGitStatus(C(s).activeSessionId.value)),onRenameSession:Q[39]||(Q[39]=(me,Je)=>C(s).renameSession(me,Je)),onForkSession:Q[40]||(Q[40]=me=>C(s).forkSession(me)),onArchiveSession:Q[41]||(Q[41]=me=>C(s).archiveSession(me)),onExportSession:Q[42]||(Q[42]=me=>C(s).exportSession(me)),onCompact:Q[43]||(Q[43]=me=>C(s).compact()),onPickModel:Q[44]||(Q[44]=me=>Zt()),onSelectModel:Q[45]||(Q[45]=me=>ns(me)),onOpenFile:Q[46]||(Q[46]=me=>C(z)(me)),onOpenMedia:Q[47]||(Q[47]=me=>C(W)(me)),onOpenThinking:Q[48]||(Q[48]=me=>C(Ae)(me)),onOpenCompaction:Q[49]||(Q[49]=me=>C(Ie)(me)),onOpenAgent:Q[50]||(Q[50]=me=>C(At)(me)),onOpenToolDiff:Q[51]||(Q[51]=me=>C(qt)(me)),onEditMessage:Di},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","queued","search-files","upload-image","sending","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(l)&&(C(Lc)||C(He))?(x(),xe(qn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(He)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(ge)},{default:Ee(()=>[re(je,{name:C(He)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):le("",!0),C(Es)&&!C(l)?(x(),xe(aw,{key:3,class:"preview-handle","storage-key":C(q),"default-width":C(ye),min:C(se),max:C(de),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":Q[52]||(Q[52]=me=>ke.value=me),"onUpdate:dragging":Q[53]||(Q[53]=me=>Dn.value=me)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(l)||C(Es)?(x(),T("aside",{key:4,class:Pe(["global-preview",{open:C(Es),mobile:C(l),"no-anim":C(Dn)||N.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Es)},[M.value==="thinking"&&C(ve)?(x(),xe(WC,{key:0,text:C(ne)??"",onClose:C($e)},null,8,["text","onClose"])):M.value==="compaction"&&C(pe)?(x(),xe(WC,{key:1,text:C(Oe)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(Xe)},null,8,["text","subtitle","onClose"])):M.value==="agent"&&C(it)?(x(),xe(_de,{key:2,member:C(it),onClose:C(bt)},null,8,["member","onClose"])):M.value==="btw"&&C(vs)?(x(),xe(qde,{key:3,turns:C(s).sideChatTurns.value,running:C(s).sideChatRunning.value,sending:C(s).sideChatSending.value,onSend:Q[54]||(Q[54]=me=>C(s).sendSideChatPrompt(me)),onClose:C(Bn)},null,8,["turns","running","sending","onClose"])):M.value==="diff"?(x(),xe(yfe,{key:4,mode:C(Kt),changes:C(s).changes.value,"git-info":C(s).gitInfo.value,"file-diff":C(s).fileDiff.value,"selected-diff-path":C(s).selectedDiffPath.value,"file-diff-loading":C(s).fileDiffLoading.value,closable:"",onOpen:C(wn),onBack:Q[55]||(Q[55]=me=>{Kt.value="list",gs.value=null,C(s).clearFileDiff()}),onClose:C(Jt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):M.value==="toolDiff"&&C(wt)?(x(),xe(Rde,{key:5,target:C(wt),onClose:C(yt)},null,8,["target","onClose"])):M.value==="file"?(x(),xe(ode,{key:6,file:C(S),loading:C(I),error:C(B),line:C(F)?.line,"download-url":C(R),closable:"","external-actions":C(P),"open-file":C(z),onClose:C(ee),onOpenExternal:C(U),onReveal:C(Y)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,kxe)):le("",!0),re(pxe,{class:"internal-build-fab"}),Qn.value?(x(),xe(Bfe,{key:5,models:C(s).models.value,current:C(s).status.value.modelId,"starred-ids":C(s).starredModelIds.value,loading:Ye.value,unavailable:qe.value,onSelect:Q[56]||(Q[56]=me=>Et(me)),onToggleStar:Q[57]||(Q[57]=me=>C(s).toggleStarModel(me)),onClose:Q[58]||(Q[58]=me=>Qn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),Gn.value?(x(),xe(Qve,{key:6,"color-scheme":C(s).colorScheme.value,accent:C(s).accent.value,"ui-font-size":C(s).uiFontSize.value,"auth-ready":C(s).authReady.value,"account-model":C(s).defaultModel.value,notify:C(s).notifyOnComplete.value,"notify-question":C(s).notifyOnQuestion.value,"notify-approval":C(s).notifyOnApproval.value,"notify-permission":C(s).notifyPermission.value,sound:C(s).soundOnComplete.value,"conversation-toc":C(s).conversationToc.value,config:C(s).config.value,models:C(s).models.value,"config-saving":sn.value,"server-version":C(s).serverVersion.value,backend:C(s).backend.value,onSetColorScheme:Q[59]||(Q[59]=me=>C(s).setColorScheme(me)),onSetAccent:Q[60]||(Q[60]=me=>C(s).setAccent(me)),onSetUiFontSize:Q[61]||(Q[61]=me=>C(s).setUiFontSize(me)),onSetNotify:Q[62]||(Q[62]=me=>C(s).setNotifyOnComplete(me)),onSetNotifyQuestion:Q[63]||(Q[63]=me=>C(s).setNotifyOnQuestion(me)),onSetNotifyApproval:Q[64]||(Q[64]=me=>C(s).setNotifyOnApproval(me)),onSetSound:Q[65]||(Q[65]=me=>C(s).setSoundOnComplete(me)),onSetConversationToc:Q[66]||(Q[66]=me=>C(s).setConversationToc(me)),onUpdateConfig:Q[67]||(Q[67]=me=>os(me)),onLogin:Q[68]||(Q[68]=()=>{Gn.value=!1,on()}),onLogout:C(s).logout,onOpenOnboarding:Q[69]||(Q[69]=()=>{Gn.value=!1,k()}),onOpenProviders:Q[70]||(Q[70]=()=>{Gn.value=!1,_n()}),onClose:Q[71]||(Q[71]=me=>Gn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):le("",!0),Tn.value?(x(),xe(ahe,{key:7,providers:C(s).providers.value,loading:Lt.value,unavailable:Ht.value,onAdd:Q[72]||(Q[72]=me=>ss(me)),onRefresh:Q[73]||(Q[73]=me=>Hn(me)),onDelete:Q[74]||(Q[74]=me=>io(me)),onOpenLogin:Q[75]||(Q[75]=()=>{Tn.value=!1,on()}),onClose:Q[76]||(Q[76]=me=>Tn.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),ds.value?(x(),xe(Jye,{key:8,status:C(s).status.value,thinking:v.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"cost-usd":C(s).sessionCost.value,onClose:Q[77]||(Q[77]=me=>ds.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),jn.value?(x(),xe(Bye,{key:9,"browse-fs":C(s).browseFs,"get-fs-home":C(s).getFsHome,"default-path":C(s).visibleWorkspace.value?.root??C(s).status.value.cwd,error:Pn.value,onAdd:Q[78]||(Q[78]=me=>fs(me)),onClose:Fs},null,8,["browse-fs","get-fs-home","default-path","error"])):le("",!0),re(Tl,{name:"gload-fade"},{default:Ee(()=>[C(s).initialized.value?le("",!0):(x(),xe(mbe,{key:0,issue:C(s).connectIssue.value},null,8,["issue"]))]),_:1}),C(s).initialized.value&&g.value&&!C(p)?(x(),xe(abe,{key:10,onComplete:y,onSkip:y})):le("",!0),re(dke,{warnings:C(s).warnings.value,onDismiss:C(s).dismissWarning},null,8,["warnings","onDismiss"]),C(r)?(x(),xe(jbe,{key:11})):le("",!0),re(Wye),C(l)?(x(),xe(Uke,{key:12,modelValue:a.value,"onUpdate:modelValue":Q[79]||(Q[79]=me=>a.value=me),groups:C(s).workspaceGroups.value,"active-workspace-id":C(s).activeWorkspaceId.value,"active-id":C(s).activeSessionId.value,"attention-by-session":C(s).attentionBySession.value,"attention-by-workspace":C(s).attentionByWorkspace.value,onSelect:Q[80]||(Q[80]=me=>C(s).selectSession(me)),onCreate:Os,onCreateInWorkspace:Q[81]||(Q[81]=me=>Mo(me)),onAddWorkspace:Q[82]||(Q[82]=me=>jn.value=!0),onRename:Q[83]||(Q[83]=(me,Je)=>C(s).renameSession(me,Je)),onArchive:Q[84]||(Q[84]=me=>C(s).archiveSession(me)),onDeleteWorkspace:Q[85]||(Q[85]=me=>C(s).deleteWorkspace(me)),onLoadMore:Q[86]||(Q[86]=me=>void C(s).loadMoreSessions(me))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(l)?(x(),xe(Z2e,{key:13,modelValue:c.value,"onUpdate:modelValue":Q[87]||(Q[87]=me=>c.value=me),status:C(s).status.value,thinking:C(s).thinking.value,models:C(s).models.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"color-scheme":C(s).colorScheme.value,"ui-font-size":C(s).uiFontSize.value,"auth-ready":C(s).authReady.value,"conversation-toc":C(s).conversationToc.value,"server-version":C(s).serverVersion.value,onPickModel:Q[88]||(Q[88]=me=>Zt()),onSetThinking:Q[89]||(Q[89]=me=>C(s).setThinking(me)),onTogglePlan:Q[90]||(Q[90]=me=>C(s).togglePlanMode()),onToggleSwarm:Q[91]||(Q[91]=me=>C(s).toggleSwarmMode()),onSetPermission:Q[92]||(Q[92]=me=>C(s).setPermission(me)),onSetColorScheme:Q[93]||(Q[93]=me=>C(s).setColorScheme(me)),onSetUiFontSize:Q[94]||(Q[94]=me=>C(s).setUiFontSize(me)),onSetConversationToc:Q[95]||(Q[95]=me=>C(s).setConversationToc(me)),onLogin:Q[96]||(Q[96]=()=>{c.value=!1,on()}),onLogout:C(s).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):le("",!0)],6)),yn.value?(x(),xe(Phe,{key:3,"on-start-o-auth-login":oi,"on-poll-o-auth-login":Ls,"on-cancel-o-auth-login":ii,onSuccess:Co,onClose:Q[97]||(Q[97]=me=>yn.value=!1)})):le("",!0)]))}}),xxe=ct(bxe,[["__scopeId","data-v-4ca5d4da"]]);Ote();Zh(xxe).use(Cn).mount("#app");export{_E as $,K4 as A,hT as B,_s as C,bwe as D,d4 as E,Be as F,_y as G,Qe as H,re as I,VE as J,jxe as K,Ii as L,Ge as M,P9 as N,Yxe as O,Zxe as P,Jxe as Q,$h as R,Ic as S,im as T,Qxe as U,Cy as V,Gxe as W,wwe as X,Xxe as Y,mwe as Z,_xe as _,H4 as a,Ks as a$,Qs as a0,ly as a1,Ixe as a2,hy as a3,c9 as a4,gn as a5,Jc as a6,Bxe as a7,Cwe as a8,Wxe as a9,j4 as aA,ST as aB,NT as aC,fn as aD,TT as aE,ET as aF,ay as aG,MT as aH,xn as aI,my as aJ,QE as aK,x as aL,R9 as aM,Oxe as aN,Ln as aO,T4 as aP,Fxe as aQ,Bh as aR,Ps as aS,Fh as aT,X as aU,cwe as aV,t7 as aW,nt as aX,Rn as aY,$T as aZ,Vxe as a_,qxe as aa,Uxe as ab,zxe as ac,dwe as ad,Awe as ae,Vt as af,m9 as ag,sm as ah,xl as ai,Br as aj,hs as ak,uwe as al,Zo as am,El as an,ht as ao,nwe as ap,swe as aq,kn as ar,pt as as,b9 as at,Pe as au,wxe as av,Gt as aw,_T as ax,AT as ay,ps as az,Lxe as b,uX as b$,ywe as b0,hd as b1,Uh as b2,gwe as b3,Ml as b4,zE as b5,Cxe as b6,Ia as b7,oT as b8,vwe as b9,So as bA,yi as bB,g9 as bC,hwe as bD,Ze as bE,rT as bF,Dxe as bG,lT as bH,iwe as bI,Ee as bJ,ewe as bK,On as bL,Xi as bM,fwe as bN,kt as bO,Rxe as bP,vn as bQ,go as bR,Rwe as bS,JX as bT,LM as bU,Dwe as bV,EQ as bW,gk as bX,Bwe as bY,mv as bZ,qwe as b_,Sxe as ba,O as bb,ah as bc,Kxe as bd,nn as be,Exe as bf,Mxe as bg,E4 as bh,awe as bi,Axe as bj,C as bk,Hd as bl,Swe as bm,xwe as bn,W9 as bo,Pxe as bp,rwe as bq,iT as br,_we as bs,twe as bt,Hxe as bu,P4 as bv,Yh as bw,Z9 as bx,$3 as by,Wg as bz,pwe as c,cX as c0,hk as c1,aX as c2,Lwe as c3,xQ as c4,$we as c5,bp as c6,Twe as c7,lX as c8,MM as c9,Uwe as ca,Nwe as cb,Vwe as cc,xv as cd,wc as ce,kv as cf,Kwe as cg,jwe as ch,Owe as ci,Ko as cj,Iwe as ck,Fwe as cl,NQ as cm,zwe as cn,bv as co,yv as cp,Wwe as cq,Ewe as cr,Hwe as cs,Pwe as ct,je as cu,Mwe as cv,ct as cw,lwe as d,wl as e,Txe as f,Tl as g,q9 as h,Nxe as i,$xe as j,Si as k,Bd as l,$s as m,Yp as n,Dr as o,kwe as p,D as q,Zh as r,xe as s,le as t,T as u,_ as v,e9 as w,owe as x,JT as y,n7 as z};
|