@moonshot-ai/kimi-code 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +427 -206
- package/dist-web/assets/{CodeBlockNode-C3v9L5tu.js → CodeBlockNode-EM_kCY-N.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-OER_lgTH.js → CodeBlockShell.vue_vue_type_style_index_0_lang-CRgIOeOQ.js} +1 -1
- package/dist-web/assets/DesignSystemView-CHgJ_72D.css +1 -0
- package/dist-web/assets/DesignSystemView-CcrMrQZg.js +12 -0
- package/dist-web/assets/{Tooltip-C12yteht.js → Tooltip-CzU8Fz35.js} +1 -1
- package/dist-web/assets/{arc-06Rz4VQ-.js → arc-DJW0hKnH.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-SukqShtR.js → architectureDiagram-3BPJPVTR-BugvyD1E.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-BNJEVQuc.js → blockDiagram-GPEHLZMM-CYo-sII1.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-C9SPPZVL.js → c4Diagram-AAUBKEIU-D5-N6MBf.js} +1 -1
- package/dist-web/assets/channel-CC7oTf8I.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-BzX0gLZp.js → chunk-2J33WTMH-B3rIAyxG.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-2tV0t7rP.js → chunk-4BX2VUAB-BqE5MO-d.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-0TgNLC_z.js → chunk-55IACEB6-CLF660V6.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-BSFCho5K.js → chunk-727SXJPM-B0BhWK0K.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-XiSvZi9j.js → chunk-AQP2D5EJ-DPjMnAJ0.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-C_jrUP7r.js → chunk-FMBD7UC4-D5PTPUwg.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-B6mTBYIB.js → chunk-ND2GUHAM-kAaY_4Vl.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-DSY_ClX7.js → chunk-QZHKN3VN-C9evXZPa.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Khrb0akV.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Khrb0akV.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-BJEsiRfG.js → cose-bilkent-S5V4N54A-CLouiVVi.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-CBrTyMup.js → dagre-BM42HDAG-DzxOlw1n.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-C5TmGHID.js → diagram-2AECGRRQ-BByJ2hb_.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DNiKwHCr.js → diagram-5GNKFQAL-IRsTcFso.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-Dd35hxfq.js → diagram-KO2AKTUF-OnKw1-KB.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-WrOo32AA.js → diagram-LMA3HP47-BDxe5igX.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-DR3kJpcY.js → diagram-OG6HWLK6-C8HfQ_tC.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-BmSLh1fo.js → erDiagram-TEJ5UH35-9GqhMJHB.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-zQFT0Hxs.js → flowDiagram-I6XJVG4X-BxnUU20J.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-CG2RzgSV.js → ganttDiagram-6RSMTGT7-BvvI2pVg.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-FepYh7HV.js → gitGraphDiagram-PVQCEYII-B7iu5op7.js} +1 -1
- package/dist-web/assets/{index-CMuCGyH1.js → index-BCLn8KKh.js} +2 -2
- package/dist-web/assets/{index-BUWl4lsr.js → index-Bi8oHSIr.js} +1 -1
- package/dist-web/assets/{index-_6Mhj8Rj.css → index-D-9xA0Nc.css} +1 -1
- package/dist-web/assets/index-e04Pgjfa.js +290 -0
- package/dist-web/assets/{index10-09ZlQIpo.js → index10-CCuAby3p.js} +1 -1
- package/dist-web/assets/{index11-C8YlETLm.js → index11-Dfvs1Rhd.js} +1 -1
- package/dist-web/assets/{index5-Dvc9jUB7.js → index5-iCBVHj23.js} +1 -1
- package/dist-web/assets/{index6-UocCE6Lj.js → index6-pl4U4MZe.js} +1 -1
- package/dist-web/assets/{index7-E3VgrKiQ.js → index7-DHIAb9rr.js} +1 -1
- package/dist-web/assets/{index8-Bxb-Xjem.js → index8-f7_g7Sdt.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-BbI2KCTX.js → infoDiagram-5YYISTIA-CyYBC3kA.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BzZLnVVK.js → ishikawaDiagram-YF4QCWOH-Jlcx9xTb.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-1f5fa5m5.js → journeyDiagram-JHISSGLW-CL5Yb_5k.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BQhnYXtD.js → kanban-definition-UN3LZRKU-BqnauHAF.js} +1 -1
- package/dist-web/assets/{linear-CPygMVCd.js → linear-CMWGjNOi.js} +1 -1
- package/dist-web/assets/{mermaid.core-DzyMX8Ld.js → mermaid.core-KmcIQ1Ur.js} +66 -66
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-B35GhhQo.js → mindmap-definition-RKZ34NQL-CVr19Hb0.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-BxCyeEvP.js → pieDiagram-4H26LBE5-DJkmgpkl.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-C-sg-PQj.js → quadrantDiagram-W4KKPZXB-Q6FJUxUg.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-RGkLcART.js → requirementDiagram-4Y6WPE33-CQTp7wfD.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-ZDy9_EXn.js → sankeyDiagram-5OEKKPKP-CyNSPnTi.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-9faAsd9D.js → sequenceDiagram-3UESZ5HK-DoC6yllg.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-JM7V6DDb.js → stateDiagram-AJRCARHV-DJPyh7eE.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-D6D0vb-i.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DBNxjfbt.js → timeline-definition-PNZ67QCA-C3cofncr.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-DHTh4JLY.js → vennDiagram-CIIHVFJN-D9J8WcHA.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-Cuefls6q.js → vue.runtime.esm-bundler-C14m1nnd.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-D70FWw9B.js → wardley-L42UT6IY-DkNDXFdt.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BPHoDdFV.js → wardleyDiagram-YWT4CUSO-BHgVdx4X.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-U3-Pc0An.js → xychartDiagram-2RQKCTM6-eziUIMuM.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +5 -5
- package/dist-web/assets/DesignSystemView-Bm5-sKT3.js +0 -12
- package/dist-web/assets/DesignSystemView-CxzrbiS1.css +0 -1
- package/dist-web/assets/channel-8SRtyypN.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-BICc9PAJ.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BICc9PAJ.js +0 -1
- package/dist-web/assets/index-BCQoQ7Uo.js +0 -292
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-B_V1QY7S.js +0 -1
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Bm5-sKT3.js","assets/DesignSystemView-CxzrbiS1.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-C3v9L5tu.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-OER_lgTH.js","assets/index8-Bxb-Xjem.js","assets/index11-C8YlETLm.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 Gt={},Ka=[],ni=()=>{},xC=()=>!1,sd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Xp=e=>e.startsWith("onUpdate:"),kn=Object.assign,Q1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ME=Object.prototype.hasOwnProperty,cn=(e,t)=>ME.call(e,t),_t=Array.isArray,Ga=e=>yc(e)==="[object Map]",Jl=e=>yc(e)==="[object Set]",ub=e=>yc(e)==="[object Date]",EE=e=>yc(e)==="[object RegExp]",It=e=>typeof e=="function",An=e=>typeof e=="string",Fo=e=>typeof e=="symbol",un=e=>e!==null&&typeof e=="object",X1=e=>(un(e)||It(e))&&It(e.then)&&It(e.catch),AC=Object.prototype.toString,yc=e=>AC.call(e),IE=e=>yc(e).slice(8,-1),Zp=e=>yc(e)==="[object Object]",Jp=e=>An(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Fl=Qp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),eh=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},$E=/-\w/g,vs=eh(e=>e.replace($E,t=>t.slice(1).toUpperCase())),NE=/\B([A-Z])/g,vo=eh(e=>e.replace(NE,"-$1").toLowerCase()),th=eh(e=>e.charAt(0).toUpperCase()+e.slice(1)),xf=eh(e=>e?`on${th(e)}`:""),$s=(e,t)=>!Object.is(e,t),Ya=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},TC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},nh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Vf=e=>{const t=An(e)?Number(e):NaN;return isNaN(t)?e:t};let db;const sh=()=>db||(db=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),LE="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",OE=Qp(LE);function Xt(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=An(s)?BE(s):Xt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(An(e)||un(e))return e}const PE=/;(?![^(]*\))/g,RE=/:([^]+)/,DE=/\/\*[^]*?\*\//g;function BE(e){const t={};return e.replace(DE,"").split(PE).forEach(n=>{if(n){const s=n.split(RE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Re(e){let t="";if(An(e))t=e;else if(_t(e))for(let n=0;n<e.length;n++){const s=Re(e[n]);s&&(t+=s+" ")}else if(un(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function mme(e){if(!e)return null;let{class:t,style:n}=e;return t&&!An(t)&&(e.class=Re(t)),n&&(e.style=Xt(n)),e}const FE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",HE=Qp(FE);function MC(e){return!!e||e===""}function WE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=rr(e[s],t[s]);return n}function rr(e,t){if(e===t)return!0;let n=ub(e),s=ub(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Fo(e),s=Fo(t),n||s)return e===t;if(n=_t(e),s=_t(t),n||s)return n&&s?WE(e,t):!1;if(n=un(e),s=un(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||!rr(e[r],t[r]))return!1}}return String(e)===String(t)}function oh(e,t){return e.findIndex(n=>rr(n,t))}const EC=e=>!!(e&&e.__v_isRef===!0),O=e=>An(e)?e:e==null?"":_t(e)||un(e)&&(e.toString===AC||!It(e.toString))?EC(e)?O(e.value):JSON.stringify(e,IC,2):String(e),IC=(e,t)=>EC(t)?IC(e,t.value):Ga(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Vm(s,i)+" =>"]=o,n),{})}:Jl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Vm(n))}:Fo(t)?Vm(t):un(t)&&!_t(t)&&!Zp(t)?String(t):t,Vm=(e,t="")=>{var n;return Fo(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function zE(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 gs;class $C{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&&gs&&(gs.active?(this.parent=gs,this.index=(gs.scopes||(gs.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=gs;try{return gs=this,t()}finally{gs=n}}}on(){++this._on===1&&(this.prevScope=gs,gs=this)}off(){if(this._on>0&&--this._on===0){if(gs===this)gs=this.prevScope;else{let t=gs;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 UE(e){return new $C(e)}function Z1(){return gs}function J1(e,t=!1){gs&&gs.cleanups.push(e)}let Rn;const Km=new WeakSet;class Kf{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,gs&&(gs.active?gs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Km.has(this)&&(Km.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||LC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,fb(this),OC(this);const t=Rn,n=vi;Rn=this,vi=!0;try{return this.fn()}finally{PC(this),Rn=t,vi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)n0(t);this.deps=this.depsTail=void 0,fb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Km.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Cv(this)&&this.run()}get dirty(){return Cv(this)}}let NC=0,uu,du;function LC(e,t=!1){if(e.flags|=8,t){e.next=du,du=e;return}e.next=uu,uu=e}function e0(){NC++}function t0(){if(--NC>0)return;if(du){let t=du;for(du=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;uu;){let t=uu;for(uu=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 OC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function PC(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),n0(s),jE(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Cv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(RC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function RC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Iu)||(e.globalVersion=Iu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Cv(e))))return;e.flags|=2;const t=e.dep,n=Rn,s=vi;Rn=e,vi=!0;try{OC(e);const o=e.fn(e._value);(t.version===0||$s(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Rn=n,vi=s,PC(e),e.flags&=-3}}function n0(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)n0(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function gme(e,t){e.effect instanceof Kf&&(e=e.effect.fn);const n=new Kf(e);t&&kn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function vme(e){e.effect.stop()}let vi=!0;const DC=[];function lr(){DC.push(vi),vi=!1}function ar(){const e=DC.pop();vi=e===void 0?!0:e}function fb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Rn;Rn=void 0;try{t()}finally{Rn=n}}}let Iu=0;class qE{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 ih{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(!Rn||!vi||Rn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Rn)n=this.activeLink=new qE(Rn,this),Rn.deps?(n.prevDep=Rn.depsTail,Rn.depsTail.nextDep=n,Rn.depsTail=n):Rn.deps=Rn.depsTail=n,BC(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=Rn.depsTail,n.nextDep=void 0,Rn.depsTail.nextDep=n,Rn.depsTail=n,Rn.deps===n&&(Rn.deps=s)}return n}trigger(t){this.version++,Iu++,this.notify(t)}notify(t){e0();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{t0()}}}function BC(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)BC(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Gf=new WeakMap,Hl=Symbol(""),xv=Symbol(""),$u=Symbol("");function Ws(e,t,n){if(vi&&Rn){let s=Gf.get(e);s||Gf.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new ih),o.map=s,o.key=n),o.track()}}function Zi(e,t,n,s,o,i){const r=Gf.get(e);if(!r){Iu++;return}const l=a=>{a&&a.trigger()};if(e0(),t==="clear")r.forEach(l);else{const a=_t(e),c=a&&Jp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===$u||!Fo(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get($u)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Hl)),Ga(e)&&l(r.get(xv)));break;case"delete":a||(l(r.get(Hl)),Ga(e)&&l(r.get(xv)));break;case"set":Ga(e)&&l(r.get(Hl));break}}t0()}function VE(e,t){const n=Gf.get(e);return n&&n.get(t)}function Sa(e){const t=en(e);return t===e?t:(Ws(t,"iterate",$u),Lo(e)?t:t.map(yi))}function rh(e){return Ws(e=en(e),"iterate",$u),e}function $i(e,t){return cr(e)?ac(qr(e)?yi(t):t):yi(t)}const KE={__proto__:null,[Symbol.iterator](){return Gm(this,Symbol.iterator,e=>$i(this,e))},concat(...e){return Sa(this).concat(...e.map(t=>_t(t)?Sa(t):t))},entries(){return Gm(this,"entries",e=>(e[1]=$i(this,e[1]),e))},every(e,t){return Ui(this,"every",e,t,void 0,arguments)},filter(e,t){return Ui(this,"filter",e,t,n=>n.map(s=>$i(this,s)),arguments)},find(e,t){return Ui(this,"find",e,t,n=>$i(this,n),arguments)},findIndex(e,t){return Ui(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ui(this,"findLast",e,t,n=>$i(this,n),arguments)},findLastIndex(e,t){return Ui(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ui(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ym(this,"includes",e)},indexOf(...e){return Ym(this,"indexOf",e)},join(e){return Sa(this).join(e)},lastIndexOf(...e){return Ym(this,"lastIndexOf",e)},map(e,t){return Ui(this,"map",e,t,void 0,arguments)},pop(){return qc(this,"pop")},push(...e){return qc(this,"push",e)},reduce(e,...t){return pb(this,"reduce",e,t)},reduceRight(e,...t){return pb(this,"reduceRight",e,t)},shift(){return qc(this,"shift")},some(e,t){return Ui(this,"some",e,t,void 0,arguments)},splice(...e){return qc(this,"splice",e)},toReversed(){return Sa(this).toReversed()},toSorted(e){return Sa(this).toSorted(e)},toSpliced(...e){return Sa(this).toSpliced(...e)},unshift(...e){return qc(this,"unshift",e)},values(){return Gm(this,"values",e=>$i(this,e))}};function Gm(e,t,n){const s=rh(e),o=s[t]();return s!==e&&!Lo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const GE=Array.prototype;function Ui(e,t,n,s,o,i){const r=rh(e),l=r!==e&&!Lo(e),a=r[t];if(a!==GE[t]){const d=a.apply(e,i);return l?yi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,$i(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 pb(e,t,n,s){const o=rh(e),i=o!==e&&!Lo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=$i(e,c)),n.call(this,c,$i(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?$i(e,a):a}function Ym(e,t,n){const s=en(e);Ws(s,"iterate",$u);const o=s[t](...n);return(o===-1||o===!1)&&ch(n[0])?(n[0]=en(n[0]),s[t](...n)):o}function qc(e,t,n=[]){lr(),e0();const s=en(e)[t].apply(e,n);return t0(),ar(),s}const YE=Qp("__proto__,__v_isRef,__isVue"),FC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Fo));function QE(e){Fo(e)||(e=String(e));const t=en(this);return Ws(t,"has",e),t.hasOwnProperty(e)}class HC{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?VC:qC:i?jC:UC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=_t(t);if(!o){let a;if(r&&(a=KE[n]))return a;if(n==="hasOwnProperty")return QE}const l=Reflect.get(t,n,ns(t)?t:s);if((Fo(n)?FC.has(n):YE(n))||(o||Ws(t,"get",n),i))return l;if(ns(l)){const a=r&&Jp(n)?l:l.value;return o&&un(a)?Yf(a):a}return un(l)?o?Yf(l):Os(l):l}}class WC extends HC{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=_t(t)&&Jp(n);if(!this._isShallow){const c=cr(i);if(!Lo(s)&&!cr(s)&&(i=en(i),s=en(s)),!r&&ns(i)&&!ns(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:cn(t,n),a=Reflect.set(t,n,s,ns(t)?t:o);return t===en(o)&&(l?$s(s,i)&&Zi(t,"set",n,s):Zi(t,"add",n,s)),a}deleteProperty(t,n){const s=cn(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Zi(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Fo(n)||!FC.has(n))&&Ws(t,"has",n),s}ownKeys(t){return Ws(t,"iterate",_t(t)?"length":Hl),Reflect.ownKeys(t)}}class zC extends HC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const XE=new WC,ZE=new zC,JE=new WC(!0),eI=new zC(!0),Av=e=>e,Ud=e=>Reflect.getPrototypeOf(e);function tI(e,t,n){return function(...s){const o=this.__v_raw,i=en(o),r=Ga(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Av:t?ac:yi;return!t&&Ws(i,"iterate",a?xv:Hl),kn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function jd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nI(e,t){const n={get(o){const i=this.__v_raw,r=en(i),l=en(o);e||($s(o,l)&&Ws(r,"get",o),Ws(r,"get",l));const{has:a}=Ud(r),c=t?Av:e?ac:yi;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&&Ws(en(o),"iterate",Hl),o.size},has(o){const i=this.__v_raw,r=en(i),l=en(o);return e||($s(o,l)&&Ws(r,"has",o),Ws(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=en(l),c=t?Av:e?ac:yi;return!e&&Ws(a,"iterate",Hl),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return kn(n,e?{add:jd("add"),set:jd("set"),delete:jd("delete"),clear:jd("clear")}:{add(o){const i=en(this),r=Ud(i),l=en(o),a=!t&&!Lo(o)&&!cr(o)?l:o;return r.has.call(i,a)||$s(o,a)&&r.has.call(i,o)||$s(l,a)&&r.has.call(i,l)||(i.add(a),Zi(i,"add",a,a)),this},set(o,i){!t&&!Lo(i)&&!cr(i)&&(i=en(i));const r=en(this),{has:l,get:a}=Ud(r);let c=l.call(r,o);c||(o=en(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?$s(i,u)&&Zi(r,"set",o,i):Zi(r,"add",o,i),this},delete(o){const i=en(this),{has:r,get:l}=Ud(i);let a=r.call(i,o);a||(o=en(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Zi(i,"delete",o,void 0),c},clear(){const o=en(this),i=o.size!==0,r=o.clear();return i&&Zi(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=tI(o,e,t)}),n}function lh(e,t){const n=nI(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(cn(n,o)&&o in s?n:s,o,i)}const sI={get:lh(!1,!1)},oI={get:lh(!1,!0)},iI={get:lh(!0,!1)},rI={get:lh(!0,!0)},UC=new WeakMap,jC=new WeakMap,qC=new WeakMap,VC=new WeakMap;function lI(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Os(e){return cr(e)?e:ah(e,!1,XE,sI,UC)}function aI(e){return ah(e,!1,JE,oI,jC)}function Yf(e){return ah(e,!0,ZE,iI,qC)}function yme(e){return ah(e,!0,eI,rI,VC)}function ah(e,t,n,s,o){if(!un(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=lI(IE(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function qr(e){return cr(e)?qr(e.__v_raw):!!(e&&e.__v_isReactive)}function cr(e){return!!(e&&e.__v_isReadonly)}function Lo(e){return!!(e&&e.__v_isShallow)}function ch(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function Wr(e){return!cn(e,"__v_skip")&&Object.isExtensible(e)&&TC(e,"__v_skip",!0),e}const yi=e=>un(e)?Os(e):e,ac=e=>un(e)?Yf(e):e;function ns(e){return e?e.__v_isRef===!0:!1}function J(e){return KC(e,!1)}function ea(e){return KC(e,!0)}function KC(e,t){return ns(e)?e:new cI(e,t)}class cI{constructor(t,n){this.dep=new ih,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:yi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Lo(t)||cr(t);t=s?t:en(t),$s(t,n)&&(this._rawValue=t,this._value=s?t:yi(t),this.dep.trigger())}}function kme(e){e.dep&&e.dep.trigger()}function C(e){return ns(e)?e.value:e}function GC(e){return It(e)?e():C(e)}const uI={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return ns(o)&&!ns(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function YC(e){return qr(e)?e:new Proxy(e,uI)}class dI{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ih,{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 fI(e){return new dI(e)}function bme(e){const t=_t(e)?new Array(e.length):{};for(const n in e)t[n]=QC(e,n);return t}class pI{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Fo(n)?n:String(n),this._raw=en(t);let o=!0,i=t;if(!_t(t)||Fo(this._key)||!Jp(this._key))do o=!ch(i)||Lo(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&&ns(this._raw[this._key])){const n=this._object[this._key];if(ns(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return VE(this._raw,this._key)}}class hI{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 _me(e,t,n){return ns(e)?e:It(e)?new hI(e):un(e)&&arguments.length>1?QC(e,t,n):J(e)}function QC(e,t,n){return new pI(e,t,n)}class mI{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ih(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Iu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Rn!==this)return LC(this,!0),!0}get value(){const t=this.dep.track();return RC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function gI(e,t,n=!1){let s,o;return It(e)?s=e:(s=e.get,o=e.set),new mI(s,o,n)}const wme={GET:"get",HAS:"has",ITERATE:"iterate"},Sme={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},qd={},Qf=new WeakMap;let Pr;function Cme(){return Pr}function vI(e,t=!1,n=Pr){if(n){let s=Qf.get(n);s||Qf.set(n,s=[]),s.push(e)}}function yI(e,t,n=Gt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Lo(y)||o===!1||o===0?Ji(y,1):Ji(y);let u,d,f,h,p=!1,m=!1;if(ns(e)?(d=()=>e.value,p=Lo(e)):qr(e)?(d=()=>c(e),p=!0):_t(e)?(m=!0,p=e.some(y=>qr(y)||Lo(y)),d=()=>e.map(y=>{if(ns(y))return y.value;if(qr(y))return c(y);if(It(y))return a?a(y,2):y()})):It(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){lr();try{f()}finally{ar()}}const y=Pr;Pr=u;try{return a?a(e,3,[h]):e(h)}finally{Pr=y}}:d=ni,t&&o){const y=d,T=o===!0?1/0:o;d=()=>Ji(y(),T)}const _=Z1(),k=()=>{u.stop(),_&&_.active&&Q1(_.effects,u)};if(i&&t){const y=t;t=(...T)=>{y(...T),k()}}let g=m?new Array(e.length).fill(qd):qd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const T=u.run();if(o||p||(m?T.some((P,N)=>$s(P,g[N])):$s(T,g))){f&&f();const P=Pr;Pr=u;try{const N=[T,g===qd?void 0:m&&g[0]===qd?[]:g,h];g=T,a?a(t,3,N):t(...N)}finally{Pr=P}}}else u.run()};return l&&l(v),u=new Kf(d),u.scheduler=r?()=>r(v,!1):v,h=y=>vI(y,!1,u),f=u.onStop=()=>{const y=Qf.get(u);if(y){if(a)a(y,4);else for(const T of y)T();Qf.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function Ji(e,t=1/0,n){if(t<=0||!un(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ns(e))Ji(e.value,t,n);else if(_t(e))for(let s=0;s<e.length;s++)Ji(e[s],t,n);else if(Jl(e)||Ga(e))e.forEach(s=>{Ji(s,t,n)});else if(Zp(e)){for(const s in e)Ji(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ji(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 XC=[];function kI(e){XC.push(e)}function bI(){XC.pop()}function xme(e,t){}const Ame={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"},_I={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 od(e,t,n,s){try{return s?e(...s):e()}catch(o){kc(o,t,n)}}function ii(e,t,n,s){if(It(e)){const o=od(e,t,n,s);return o&&X1(o)&&o.catch(i=>{kc(i,t,n)}),o}if(_t(e)){const o=[];for(let i=0;i<e.length;i++)o.push(ii(e[i],t,n,s));return o}}function kc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Gt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){lr(),od(i,null,10,[e,a,c]),ar();return}}wI(e,n,o,s,r)}function wI(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Js=[];let Mi=-1;const Qa=[];let Rr=null,$a=0;const ZC=Promise.resolve();let Xf=null;function gt(e){const t=Xf||ZC;return e?t.then(this?e.bind(this):e):t}function SI(e){let t=Mi+1,n=Js.length;for(;t<n;){const s=t+n>>>1,o=Js[s],i=Nu(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function s0(e){if(!(e.flags&1)){const t=Nu(e),n=Js[Js.length-1];!n||!(e.flags&2)&&t>=Nu(n)?Js.push(e):Js.splice(SI(t),0,e),e.flags|=1,JC()}}function JC(){Xf||(Xf=ZC.then(ex))}function Zf(e){_t(e)?Qa.push(...e):Rr&&e.id===-1?Rr.splice($a+1,0,e):e.flags&1||(Qa.push(e),e.flags|=1),JC()}function hb(e,t,n=Mi+1){for(;n<Js.length;n++){const s=Js[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Js.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Jf(e){if(Qa.length){const t=[...new Set(Qa)].sort((n,s)=>Nu(n)-Nu(s));if(Qa.length=0,Rr){Rr.push(...t);return}for(Rr=t,$a=0;$a<Rr.length;$a++){const n=Rr[$a];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Rr=null,$a=0}}const Nu=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ex(e){try{for(Mi=0;Mi<Js.length;Mi++){const t=Js[Mi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),od(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Mi<Js.length;Mi++){const t=Js[Mi];t&&(t.flags&=-2)}Mi=-1,Js.length=0,Jf(),Xf=null,(Js.length||Qa.length)&&ex()}}let Na,Vd=[];function tx(e,t){var n,s;Na=e,Na?(Na.enabled=!0,Vd.forEach(({event:o,args:i})=>Na.emit(o,...i)),Vd=[]):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=>{tx(i,t)}),setTimeout(()=>{Na||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Vd=[])},3e3)):Vd=[]}let Ps=null,uh=null;function Lu(e){const t=Ps;return Ps=e,uh=e&&e.type.__scopeId||null,t}function Tme(e){uh=e}function Mme(){uh=null}const Eme=e=>_e;function _e(e,t=Ps,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&op(-1);const i=Lu(t);let r;try{r=e(...o)}finally{Lu(i),s._d&&op(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Sn(e,t){if(Ps===null)return e;const n=ad(Ps),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Gt]=t[o];i&&(It(i)&&(i={mounted:i,updated:i}),i.deep&&Ji(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Ei(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&&(lr(),ii(a,n,8,[e.el,l,e,t]),ar())}}function $n(e,t){if(Ns){let n=Ns.provides;const s=Ns.parent&&Ns.parent.provides;s===n&&(n=Ns.provides=Object.create(s)),n[e]=t}}function Ut(e,t,n=!1){const s=Rs();if(s||Wl){let o=Wl?Wl._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&&It(t)?t.call(s&&s.proxy):t}}function Ime(){return!!(Rs()||Wl)}const CI=Symbol.for("v-scx"),xI=()=>Ut(CI);function AI(e,t){return id(e,null,t)}function $me(e,t){return id(e,null,{flush:"post"})}function TI(e,t){return id(e,null,{flush:"sync"})}function Ve(e,t,n){return id(e,t,n)}function id(e,t,n=Gt){const{immediate:s,deep:o,flush:i,once:r}=n,l=kn({},n),a=t&&s||!t&&i!=="post";let c;if(Gl){if(i==="sync"){const h=xI();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=ni,h.resume=ni,h.pause=ni,h}}const u=Ns;l.call=(h,p,m)=>ii(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{rs(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():s0(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=yI(e,t,l);return Gl&&(c?c.push(f):a&&f()),f}function MI(e,t,n){const s=this.proxy,o=An(e)?e.includes(".")?nx(s,e):()=>s[e]:e.bind(s,s);let i;It(t)?i=t:(i=t.handler,n=t);const r=bc(this),l=id(o,i.bind(s),n);return r(),l}function nx(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 Lr=new WeakMap,sx=Symbol("_vte"),ox=e=>e.__isTeleport,$l=e=>e&&(e.disabled||e.disabled===""),EI=e=>e&&(e.defer||e.defer===""),mb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,gb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Tv=(e,t)=>{const n=e&&e.to;return An(n)?t?t(n):null:n},II={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:_,parentNode:k}}=c,g=$l(t.props);let{dynamicChildren:v}=t;const y=(N,b,M)=>{N.shapeFlag&16&&u(N.children,b,M,o,i,r,l,a)},T=(N=t)=>{const b=$l(N.props),M=N.target=Tv(N.props,p),I=Mv(M,N,m,h);M&&(r!=="svg"&&mb(M)?r="svg":r!=="mathml"&&gb(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),b||(y(N,M,I),nu(N,!1)))},P=N=>{const b=()=>{if(Lr.get(N)===b){if(Lr.delete(N),$l(N.props)){const M=k(N.el)||n;y(N,M,N.anchor),nu(N,!0)}T(N)}};Lr.set(N,b),rs(b,i)};if(e==null){const N=t.el=m(""),b=t.anchor=m("");if(h(N,n,s),h(b,n,s),EI(t.props)||i&&i.pendingBranch){P(t);return}g&&(y(t,n,b),nu(t,!0)),T()}else{t.el=e.el;const N=t.anchor=e.anchor,b=Lr.get(e);if(b){b.flags|=8,Lr.delete(e),P(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,I=t.targetAnchor=e.targetAnchor,L=$l(e.props),S=L?n:M,E=L?N:I;if(r==="svg"||mb(M)?r="svg":(r==="mathml"||gb(M))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),h0(e,t,!0)):a||d(e,t,S,E,o,i,r,l,!1),g)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Kd(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Tv(t.props,p);R&&Kd(t,R,null,c,0)}else L&&Kd(t,M,I,c,1);nu(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||!$l(f),p=Lr.get(e);if(p&&(p.flags|=8,Lr.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,h,!!_.dynamicChildren)}},move:Kd,hydrate:$I};function Kd(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),!Lr.has(e)&&(!d||$l(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function $I(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(_,k){k.anchor=d(r(_),k,l(_),n,s,o,i)}const p=t.target=Tv(t.props,a),m=$l(t.props);if(p){const _=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,_),t.targetAnchor||Mv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,_),t.targetAnchor||Mv(p,t,u,c),d(_&&r(_),t,p,n,s,o,i))),nu(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const dh=II;function nu(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 Mv(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[sx]=r,e&&(s(i,e,o),s(r,e,o)),r}const Xo=Symbol("_leaveCb"),Vc=Symbol("_enterCb");function ix(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return bn(()=>{e.isMounted=!0}),ds(()=>{e.isUnmounting=!0}),e}const Vo=[Function,Array],rx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Vo,onEnter:Vo,onAfterEnter:Vo,onEnterCancelled:Vo,onBeforeLeave:Vo,onLeave:Vo,onAfterLeave:Vo,onLeaveCancelled:Vo,onBeforeAppear:Vo,onAppear:Vo,onAfterAppear:Vo,onAppearCancelled:Vo},lx=e=>{const t=e.subTree;return t.component?lx(t.component):t},NI={name:"BaseTransition",props:rx,setup(e,{slots:t}){const n=Rs(),s=ix();return()=>{const o=t.default&&o0(t.default(),!0),i=o&&o.length?ax(o):n.subTree?re():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(s.isLeaving)return Qm(i);const a=vb(i);if(!a)return Qm(i);let c=Ou(a,r,s,n,d=>c=d);a.type!==as&&Qr(a,c);let u=n.subTree&&vb(n.subTree);if(u&&u.type!==as&&!pi(u,a)&&lx(n).type!==as){let d=Ou(u,r,s,n);if(Qr(u,d),l==="out-in"&&a.type!==as)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Qm(i);l==="in-out"&&a.type!==as?d.delayLeave=(f,h,p)=>{const m=cx(s,u);m[String(u.key)]=u,f[Xo]=()=>{h(),f[Xo]=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 ax(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==as){t=n;break}}return t}const LI=NI;function cx(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 Ou(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:_,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),T=cx(n,e),P=(M,I)=>{M&&ii(M,s,9,I)},N=(M,I)=>{const L=I[1];P(M,I),_t(M)?M.every(S=>S.length<=1)&&L():M.length<=1&&L()},b={mode:r,persisted:l,beforeEnter(M){let I=a;if(!n.isMounted)if(i)I=_||a;else return;M[Xo]&&M[Xo](!0);const L=T[y];L&&pi(e,L)&&L.el[Xo]&&L.el[Xo](),P(I,[M])},enter(M){if(T[y]===e)return;let I=c,L=u,S=d;if(!n.isMounted)if(i)I=k||c,L=g||u,S=v||d;else return;let E=!1;M[Vc]=D=>{E||(E=!0,D?P(S,[M]):P(L,[M]),b.delayedLeave&&b.delayedLeave(),M[Vc]=void 0)};const R=M[Vc].bind(null,!1);I?N(I,[M,R]):R()},leave(M,I){const L=String(e.key);if(M[Vc]&&M[Vc](!0),n.isUnmounting)return I();P(f,[M]);let S=!1;M[Xo]=R=>{S||(S=!0,I(),R?P(m,[M]):P(p,[M]),M[Xo]=void 0,T[L]===e&&delete T[L])};const E=M[Xo].bind(null,!1);T[L]=e,h?N(h,[M,E]):E()},clone(M){const I=Ou(M,t,n,s,o);return o&&o(I),I}};return b}function Qm(e){if(rd(e))return e=ur(e),e.children=null,e}function vb(e){if(!rd(e))return ox(e.type)&&e.children?ax(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&It(n.default))return n.default()}}function Qr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Qr(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 o0(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===Pe?(r.patchFlag&128&&o++,s=s.concat(o0(r.children,t,l))):(t||r.type!==as)&&s.push(l!=null?ur(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function qe(e,t){return It(e)?kn({name:e.name},t,{setup:e}):e}function Nme(){const e=Rs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function i0(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Lme(e){const t=Rs(),n=ea(null);if(t){const o=t.refs===Gt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function yb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ep=new WeakMap;function Xa(e,t,n,s,o=!1){if(_t(e)){e.forEach((m,_)=>Xa(m,t&&(_t(t)?t[_]:t),n,s,o));return}if(or(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Xa(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?ad(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Gt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Gt?xC:m=>yb(u,m)?!1:cn(f,m),p=(m,_)=>!(_&&yb(u,_));if(c!=null&&c!==a){if(kb(t),An(c))u[c]=null,h(c)&&(d[c]=null);else if(ns(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(It(a))od(a,l,12,[r,u]);else{const m=An(a),_=ns(a);if(m||_){const k=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)_t(g)&&Q1(g,i);else if(_t(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):_&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),ep.delete(e)};g.id=-1,ep.set(e,g),rs(g,n)}else kb(e),k()}}}function kb(e){const t=ep.get(e);t&&(t.flags|=8,ep.delete(e))}let bb=!1;const Ca=()=>{bb||(console.error("Hydration completed but contains mismatches."),bb=!0)},OI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",PI=e=>e.namespaceURI.includes("MathML"),Gd=e=>{if(e.nodeType===1){if(OI(e))return"svg";if(PI(e))return"mathml"}},Ha=e=>e.nodeType===8;function RI(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),Jf(),y._vnode=v;return}d(y.firstChild,v,null,null,null),Jf(),y._vnode=v},d=(v,y,T,P,N,b=!1)=>{b=b||!!y.dynamicChildren;const M=Ha(v)&&v.data==="[",I=()=>m(v,y,T,P,N,M),{type:L,ref:S,shapeFlag:E,patchFlag:R}=y;let D=v.nodeType;y.el=v,R===-2&&(b=!1,y.dynamicChildren=null);let F=null;switch(L){case Vr:D!==3?y.children===""?(a(y.el=o(""),r(v),v),F=v):F=I():(v.data!==y.children&&(Ca(),v.data=y.children),F=i(v));break;case as:g(v)?(F=i(v),k(y.el=v.content.firstChild,v,T)):D!==8||M?F=I():F=i(v);break;case Ja:if(M&&(v=i(v),D=v.nodeType),D===1||D===3){F=v;const U=!y.children.length;for(let G=0;G<y.staticCount;G++)U&&(y.children+=F.nodeType===1?F.outerHTML:F.data),G===y.staticCount-1&&(y.anchor=F),F=i(F);return M?i(F):F}else I();break;case Pe:M?F=p(v,y,T,P,N,b):F=I();break;default:if(E&1)(D!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?F=I():F=f(v,y,T,P,N,b);else if(E&6){y.slotScopeIds=N;const U=r(v);if(M?F=_(v):Ha(v)&&v.data==="teleport start"?F=_(v,v.data,"teleport end"):F=i(v),t(y,U,null,T,P,Gd(U),b),or(y)&&!y.type.__asyncResolved){let G;M?(G=ie(Pe),G.anchor=F?F.previousSibling:U.lastChild):G=v.nodeType===3?Ue(""):ie("div"),G.el=v,y.component.subTree=G}}else E&64?D!==8?F=I():F=y.type.hydrate(v,y,T,P,N,b,e,h):E&128&&(F=y.type.hydrate(v,y,T,P,Gd(r(v)),N,b,e,d))}return S!=null&&Xa(S,null,P,y),F},f=(v,y,T,P,N,b)=>{b=b||!!y.dynamicChildren;const{type:M,props:I,patchFlag:L,shapeFlag:S,dirs:E,transition:R}=y,D=M==="input"||M==="option";if(D||L!==-1){E&&Ei(y,null,T,"created");let F=!1;if(g(v)){F=Mx(null,R)&&T&&T.vnode.props&&T.vnode.props.appear;const G=v.content.firstChild;if(F){const Y=G.getAttribute("class");Y&&(G.$cls=Y),R.beforeEnter(G)}k(G,v,T),y.el=v=G}if(S&16&&!(I&&(I.innerHTML||I.textContent))){let G=h(v.firstChild,y,v,T,P,N,b);for(G&&!Yd(v,1)&&Ca();G;){const Y=G;G=G.nextSibling,l(Y)}}else if(S&8){let G=y.children;G[0]===`
|
|
15
|
-
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(G=G.slice(1));const{textContent:Y}=v;Y!==G&&Y!==G.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Yd(v,0)||Ca(),v.textContent=y.children)}if(I){if(D||!b||L&48){const G=v.tagName.includes("-");for(const Y in I)(D&&(Y.endsWith("value")||Y==="indeterminate")||sd(Y)&&!Fl(Y)||Y[0]==="."||G&&!Fl(Y))&&s(v,Y,null,I[Y],void 0,T)}else if(I.onClick)s(v,"onClick",null,I.onClick,void 0,T);else if(L&4&&qr(I.style))for(const G in I.style)I.style[G]}let U;(U=I&&I.onVnodeBeforeMount)&&ho(U,T,y),E&&Ei(y,null,T,"beforeMount"),((U=I&&I.onVnodeMounted)||E||F)&&Nx(()=>{U&&ho(U,T,y),F&&R.enter(v),E&&Ei(y,null,T,"mounted")},P)}return v.nextSibling},h=(v,y,T,P,N,b,M)=>{M=M||!!y.dynamicChildren;const I=y.children,L=I.length;let S=!1;for(let E=0;E<L;E++){const R=M?I[E]:I[E]=go(I[E]),D=R.type===Vr;v?(D&&!M&&E+1<L&&go(I[E+1]).type===Vr&&(a(o(v.data.slice(R.children.length)),T,i(v)),v.data=R.children),v=d(v,R,P,N,b,M)):D&&!R.children?a(R.el=o(""),T):(S||(S=!0,Yd(T,1)||Ca()),n(null,R,T,null,P,N,Gd(T),b))}return v},p=(v,y,T,P,N,b)=>{const{slotScopeIds:M}=y;M&&(N=N?N.concat(M):M);const I=r(v),L=h(i(v),y,I,T,P,N,b);return L&&Ha(L)&&L.data==="]"?i(y.anchor=L):(Ca(),a(y.anchor=c("]"),I,L),L)},m=(v,y,T,P,N,b)=>{if(Yd(v.parentElement,1)||Ca(),y.el=null,b){const L=_(v);for(;;){const S=i(v);if(S&&S!==L)l(S);else break}}const M=i(v),I=r(v);return l(v),n(null,y,I,M,T,P,Gd(I),N),T&&(T.vnode.el=y.el,hh(T,y.el)),M},_=(v,y="[",T="]")=>{let P=0;for(;v;)if(v=i(v),v&&Ha(v)&&(v.data===y&&P++,v.data===T)){if(P===0)return i(v);P--}return v},k=(v,y,T)=>{const P=y.parentNode;P&&P.replaceChild(v,y);let N=T;for(;N;)N.vnode.el===y&&(N.vnode.el=N.subTree.el=v),N=N.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const _b="data-allow-mismatch",DI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Yd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(_b);)e=e.parentElement;const n=e&&e.getAttribute(_b);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(DI[t])}}const BI=sh().requestIdleCallback||(e=>setTimeout(e,1)),FI=sh().cancelIdleCallback||(e=>clearTimeout(e)),Ome=(e=1e4)=>t=>{const n=BI(t,{timeout:e});return()=>FI(n)};function HI(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 Pme=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(HI(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Rme=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Dme=(e=[])=>(t,n)=>{An(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 WI(e,t){if(Ha(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Ha(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const or=e=>!!e.type.__asyncLoader;function hi(e){It(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((_,k)=>{a(m,()=>_(f()),()=>k(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 qe({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,_){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||_()},v=i?()=>{const y=i(g,T=>WI(p,T));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Ns;if(i0(p),u)return()=>Qd(u,p);const m=v=>{c=null,kc(v,p,13,!s)};if(l&&p.suspense||Gl)return h().then(v=>()=>Qd(v,p)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const _=J(!1),k=J(),g=J(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),h().then(()=>{_.value=!0,p.parent&&rd(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(_.value&&u)return Qd(u,p);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return Qd(n,p)}}})}function Qd(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const rd=e=>e.type.__isKeepAlive,zI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Rs(),s=n.ctx;if(!s.renderer)return()=>{const 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,v,y,T,P)=>{const N=g.component;c(g,v,y,0,l),a(N.vnode,g,v,y,N,l,T,g.slotScopeIds,P),rs(()=>{N.isDeactivated=!1,N.a&&Ya(N.a);const b=g.props&&g.props.onVnodeMounted;b&&ho(b,N.parent,g)},l)},s.deactivate=g=>{const v=g.component;np(v.m),np(v.a),c(g,f,null,1,l),rs(()=>{v.da&&Ya(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&ho(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Xm(g),u(g,n,l,!0)}function p(g){o.forEach((v,y)=>{const T=Dv(or(v)?v.type.__asyncResolved||{}:v.type);T&&!g(T)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!pi(v,r))?h(v):r&&Xm(r),o.delete(g),i.delete(g)}Ve(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>su(g,y)),v&&p(y=>!su(v,y))},{flush:"post",deep:!0});let _=null;const k=()=>{_!=null&&(sp(n.subTree.type)?rs(()=>{o.set(_,Xd(n.subTree))},n.subTree.suspense):o.set(_,Xd(n.subTree)))};return bn(k),r0(k),ds(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,T=Xd(v);if(g.type===T.type&&g.key===T.key){Xm(T);const P=T.component.da;P&&rs(P,y);return}h(g)})}),()=>{if(_=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Xr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Xd(v);if(y.type===as)return r=null,y;const T=y.type,P=Dv(or(y)?y.type.__asyncResolved||{}:T),{include:N,exclude:b,max:M}=e;if(N&&(!P||!su(N,P))||b&&P&&su(b,P))return y.shapeFlag&=-257,r=y,v;const I=y.key==null?T:y.key,L=o.get(I);return y.el&&(y=ur(y),v.shapeFlag&128&&(v.ssContent=y)),_=I,L?(y.el=L.el,y.component=L.component,y.transition&&Qr(y,y.transition),y.shapeFlag|=512,i.delete(I),i.add(I)):(i.add(I),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,sp(v.type)?v:y}}},Bme=zI;function su(e,t){return _t(e)?e.some(n=>su(n,t)):An(e)?e.split(",").includes(t):EE(e)?(e.lastIndex=0,e.test(t)):!1}function UI(e,t){ux(e,"a",t)}function jI(e,t){ux(e,"da",t)}function ux(e,t,n=Ns){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(fh(t,s,n),n){let o=n.parent;for(;o&&o.parent;)rd(o.parent.vnode)&&qI(s,t,n,o),o=o.parent}}function qI(e,t,n,s){const o=fh(t,e,s,!0);Tn(()=>{Q1(s[t],o)},n)}function Xm(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Xd(e){return e.shapeFlag&128?e.ssContent:e}function fh(e,t,n=Ns,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{lr();const l=bc(n),a=ii(t,n,e,r);return l(),ar(),a});return s?o.unshift(i):o.push(i),i}}const fr=e=>(t,n=Ns)=>{(!Gl||e==="sp")&&fh(e,(...s)=>t(...s),n)},VI=fr("bm"),bn=fr("m"),dx=fr("bu"),r0=fr("u"),ds=fr("bum"),Tn=fr("um"),KI=fr("sp"),GI=fr("rtg"),YI=fr("rtc");function QI(e,t=Ns){fh("ec",e,t)}const l0="components",XI="directives";function ZI(e,t){return a0(l0,e,!0,t)||e}const fx=Symbol.for("v-ndc");function zs(e){return An(e)?a0(l0,e,!1)||e:e||fx}function Fme(e){return a0(XI,e)}function a0(e,t,n=!0,s=!1){const o=Ps||Ns;if(o){const i=o.type;if(e===l0){const l=Dv(i,!1);if(l&&(l===t||l===vs(t)||l===th(vs(t))))return i}const r=wb(o[e]||i[e],t)||wb(o.appContext[e],t);return!r&&s?i:r}}function wb(e,t){return e&&(e[t]||e[vs(t)]||e[th(vs(t))])}function tt(e,t,n,s){let o;const i=n&&n[s],r=_t(e);if(r||An(e)){const l=r&&qr(e);let a=!1,c=!1;l&&(a=!Lo(e),c=cr(e),e=rh(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?ac(yi(e[u])):yi(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(un(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 c0(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(_t(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 Ln(e,t,n={},s,o){if(Ps.ce||Ps.parent&&or(Ps.parent)&&Ps.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ye(Pe,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&u0(i(n)),l=n.key||r&&r.key,a=ye(Pe,{key:(l&&!Fo(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 u0(e){return e.some(t=>Xr(t)?!(t.type===as||t.type===Pe&&!u0(t.children)):!0)?e:null}function Hme(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:xf(s)]=e[s];return n}const Ev=e=>e?Dx(e)?ad(e):Ev(e.parent):null,fu=kn(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=>Ev(e.parent),$root:e=>Ev(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>d0(e),$forceUpdate:e=>e.f||(e.f=()=>{s0(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>MI.bind(e)}),Zm=(e,t)=>e!==Gt&&!e.__isScriptSetup&&cn(e,t),Iv={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(Zm(s,t))return r[t]=1,s[t];if(o!==Gt&&cn(o,t))return r[t]=2,o[t];if(cn(i,t))return r[t]=3,i[t];if(n!==Gt&&cn(n,t))return r[t]=4,n[t];$v&&(r[t]=0)}}const c=fu[t];let u,d;if(c)return t==="$attrs"&&Ws(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Gt&&cn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,cn(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Zm(o,t)?(o[t]=n,!0):s!==Gt&&cn(s,t)?(s[t]=n,!0):cn(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!==Gt&&l[0]!=="$"&&cn(e,l)||Zm(t,l)||cn(i,l)||cn(s,l)||cn(fu,l)||cn(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:cn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},JI=kn({},Iv,{get(e,t){if(t!==Symbol.unscopables)return Iv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!OE(t)}});function Wme(){return null}function zme(){return null}function Ume(e){}function jme(e){}function qme(){return null}function Vme(){}function Kme(e,t){return null}function Gme(){return px().slots}function ld(){return px().attrs}function px(e){const t=Rs();return t.setupContext||(t.setupContext=Hx(t))}function Pu(e){return _t(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Yme(e,t){const n=Pu(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?_t(o)||It(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 Qme(e,t){return!e||!t?e||t:_t(e)&&_t(t)?e.concat(t):kn({},Pu(e),Pu(t))}function Xme(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Zme(e){const t=Rs(),n=Gl;let s=e();Du(),n&&ec(!1);const o=()=>{bc(t),n&&ec(!0)},i=()=>{Rs()!==t&&t.scope.off(),Du(),n&&ec(!1)};return X1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let $v=!0;function e$(e){const t=d0(e),n=e.proxy,s=e.ctx;$v=!1,t.beforeCreate&&Sb(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:_,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:T,renderTracked:P,renderTriggered:N,errorCaptured:b,serverPrefetch:M,expose:I,inheritAttrs:L,components:S,directives:E,filters:R}=t;if(c&&t$(c,s,null),r)for(const U in r){const G=r[U];It(G)&&(s[U]=G.bind(n))}if(o){const U=o.call(n,n);un(U)&&(e.data=Os(U))}if($v=!0,i)for(const U in i){const G=i[U],Y=It(G)?G.bind(n,n):It(G.get)?G.get.bind(n,n):ni,q=!It(G)&&It(G.set)?G.set.bind(n):ni,ae=B({get:Y,set:q});Object.defineProperty(s,U,{enumerable:!0,configurable:!0,get:()=>ae.value,set:de=>ae.value=de})}if(l)for(const U in l)hx(l[U],s,n,U);if(a){const U=It(a)?a.call(n):a;Reflect.ownKeys(U).forEach(G=>{$n(G,U[G])})}u&&Sb(u,e,"c");function F(U,G){_t(G)?G.forEach(Y=>U(Y.bind(n))):G&&U(G.bind(n))}if(F(VI,d),F(bn,f),F(dx,h),F(r0,p),F(UI,m),F(jI,_),F(QI,b),F(YI,P),F(GI,N),F(ds,g),F(Tn,y),F(KI,M),_t(I))if(I.length){const U=e.exposed||(e.exposed={});I.forEach(G=>{Object.defineProperty(U,G,{get:()=>n[G],set:Y=>n[G]=Y,enumerable:!0})})}else e.exposed||(e.exposed={});T&&e.render===ni&&(e.render=T),L!=null&&(e.inheritAttrs=L),S&&(e.components=S),E&&(e.directives=E),M&&i0(e)}function t$(e,t,n=ni){_t(e)&&(e=Nv(e));for(const s in e){const o=e[s];let i;un(o)?"default"in o?i=Ut(o.from||s,o.default,!0):i=Ut(o.from||s):i=Ut(o),ns(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Sb(e,t,n){ii(_t(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function hx(e,t,n,s){let o=s.includes(".")?nx(n,s):()=>n[s];if(An(e)){const i=t[e];It(i)&&Ve(o,i)}else if(It(e))Ve(o,e.bind(n));else if(un(e))if(_t(e))e.forEach(i=>hx(i,t,n,s));else{const i=It(e.handler)?e.handler.bind(n):t[e.handler];It(i)&&Ve(o,i,e)}}function d0(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=>tp(a,c,r,!0)),tp(a,t,r)),un(t)&&i.set(t,a),a}function tp(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&tp(e,i,n,!0),o&&o.forEach(r=>tp(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=n$[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const n$={data:Cb,props:xb,emits:xb,methods:ou,computed:ou,beforeCreate:Ys,created:Ys,beforeMount:Ys,mounted:Ys,beforeUpdate:Ys,updated:Ys,beforeDestroy:Ys,beforeUnmount:Ys,destroyed:Ys,unmounted:Ys,activated:Ys,deactivated:Ys,errorCaptured:Ys,serverPrefetch:Ys,components:ou,directives:ou,watch:o$,provide:Cb,inject:s$};function Cb(e,t){return t?e?function(){return kn(It(e)?e.call(this,this):e,It(t)?t.call(this,this):t)}:t:e}function s$(e,t){return ou(Nv(e),Nv(t))}function Nv(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ys(e,t){return e?[...new Set([].concat(e,t))]:t}function ou(e,t){return e?kn(Object.create(null),e,t):t}function xb(e,t){return e?_t(e)&&_t(t)?[...new Set([...e,...t])]:kn(Object.create(null),Pu(e),Pu(t??{})):t}function o$(e,t){if(!e)return t;if(!t)return e;const n=kn(Object.create(null),e);for(const s in t)n[s]=Ys(e[s],t[s]);return n}function mx(){return{app:null,config:{isNativeTag:xC,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 i$=0;function r$(e,t){return function(s,o=null){It(s)||(s=kn({},s)),o!=null&&!un(o)&&(o=null);const i=mx(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:i$++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:R$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&It(u.install)?(r.add(u),u.install(c,...d)):It(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||ie(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,ad(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(ii(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Wl;Wl=c;try{return u()}finally{Wl=d}}};return c}}let Wl=null;function Jme(e,t,n=Gt){const s=Rs(),o=vs(t),i=vo(t),r=gx(e,o),l=fI((a,c)=>{let u,d=Gt,f;return TI(()=>{const h=e[o];$s(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(!$s(p,u)&&!(d!==Gt&&$s(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),$s(h,p)&&$s(h,d)&&!$s(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Gt:l,done:!1}:{done:!0}}}},l}const gx=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${vs(t)}Modifiers`]||e[`${vo(t)}Modifiers`];function l$(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Gt;let o=n;const i=t.startsWith("update:"),r=i&&gx(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>An(u)?u.trim():u)),r.number&&(o=n.map(nh)));let l,a=s[l=xf(t)]||s[l=xf(vs(t))];!a&&i&&(a=s[l=xf(vo(t))]),a&&ii(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,ii(c,e,6,o)}}const a$=new WeakMap;function vx(e,t,n=!1){const s=n?a$:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!It(e)){const a=c=>{const u=vx(c,t,!0);u&&(l=!0,kn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(un(e)&&s.set(e,null),null):(_t(i)?i.forEach(a=>r[a]=null):kn(r,i),un(e)&&s.set(e,r),r)}function ph(e,t){return!e||!sd(t)?!1:(t=t.slice(2).replace(/Once$/,""),cn(e,t[0].toLowerCase()+t.slice(1))||cn(e,vo(t))||cn(e,t))}function Af(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,_=Lu(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,T=y;k=go(c.call(T,y,u,d,h,f,p)),g=l}else{const y=t;k=go(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:u$(l)}}catch(y){pu.length=0,kc(y,e,1),k=ie(as)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:T}=v;y.length&&T&7&&(i&&y.some(Xp)&&(g=d$(g,i)),v=ur(v,g,!1,!0))}return n.dirs&&(v=ur(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Qr(v,n.transition),k=v,Lu(_),k}function c$(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Xr(o)){if(o.type!==as||o.children==="v-if"){if(n)return;n=o}}else return}return n}const u$=e=>{let t;for(const n in e)(n==="class"||n==="style"||sd(n))&&((t||(t={}))[n]=e[n]);return t},d$=(e,t)=>{const n={};for(const s in e)(!Xp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function f$(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?Ab(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(yx(r,s,f)&&!ph(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Ab(s,r,c):!0:!!r;return!1}function Ab(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(yx(t,e,i)&&!ph(n,i))return!0}return!1}function yx(e,t,n){const s=e[n],o=t[n];return n==="style"&&un(s)&&un(o)?!rr(s,o):s!==o}function hh({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 kx={},bx=()=>Object.create(kx),_x=e=>Object.getPrototypeOf(e)===kx;function p$(e,t,n,s=!1){const o={},i=bx();e.propsDefaults=Object.create(null),wx(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:aI(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function h$(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=en(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(ph(e.emitsOptions,f))continue;const h=t[f];if(a)if(cn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=vs(f);o[p]=Lv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{wx(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!cn(t,d)&&((u=vo(d))===d||!cn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Lv(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!cn(t,d))&&(delete i[d],c=!0)}c&&Zi(e.attrs,"set","")}function wx(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Fl(a))continue;const c=t[a];let u;o&&cn(o,u=vs(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:ph(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=en(n),c=l||Gt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Lv(o,a,d,c[d],e,!cn(c,d))}}return r}function Lv(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=cn(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&It(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=bc(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===vo(n))&&(s=!0))}return s}const m$=new WeakMap;function Sx(e,t,n=!1){const s=n?m$:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!It(e)){const u=d=>{a=!0;const[f,h]=Sx(d,t,!0);kn(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 un(e)&&s.set(e,Ka),Ka;if(_t(i))for(let u=0;u<i.length;u++){const d=vs(i[u]);Tb(d)&&(r[d]=Gt)}else if(i)for(const u in i){const d=vs(u);if(Tb(d)){const f=i[u],h=r[d]=_t(f)||It(f)?{type:f}:kn({},f),p=h.type;let m=!1,_=!0;if(_t(p))for(let k=0;k<p.length;++k){const g=p[k],v=It(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=It(p)&&p.name==="Boolean";h[0]=m,h[1]=_,(m||cn(h,"default"))&&l.push(d)}}const c=[r,l];return un(e)&&s.set(e,c),c}function Tb(e){return e[0]!=="$"&&!Fl(e)}const f0=e=>e==="_"||e==="_ctx"||e==="$stable",p0=e=>_t(e)?e.map(go):[go(e)],g$=(e,t,n)=>{if(t._n)return t;const s=_e((...o)=>p0(t(...o)),n);return s._c=!1,s},Cx=(e,t,n)=>{const s=e._ctx;for(const o in e){if(f0(o))continue;const i=e[o];if(It(i))t[o]=g$(o,i,s);else if(i!=null){const r=p0(i);t[o]=()=>r}}},xx=(e,t)=>{const n=p0(t);e.slots.default=()=>n},Ax=(e,t,n)=>{for(const s in t)(n||!f0(s))&&(e[s]=t[s])},v$=(e,t,n)=>{const s=e.slots=bx();if(e.vnode.shapeFlag&32){const o=t._;o?(Ax(s,t,n),n&&TC(s,"_",o,!0)):Cx(t,s)}else t&&xx(e,t)},y$=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Gt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Ax(o,t,n):(i=!t.$stable,Cx(t,o)),r=t}else t&&(xx(e,t),r={default:1});if(i)for(const l in o)!f0(l)&&r[l]==null&&delete o[l]},rs=Nx;function k$(e){return Tx(e)}function b$(e){return Tx(e,RI)}function Tx(e,t){const n=sh();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=ni,insertStaticContent:p}=e,m=(W,Z,ue,le=null,me=null,j=null,ee=void 0,pe=null,ke=!!Z.dynamicChildren)=>{if(W===Z)return;W&&!pi(W,Z)&&(le=je(W),de(W,me,j,!0),W=null),Z.patchFlag===-2&&(ke=!1,Z.dynamicChildren=null);const{type:Te,ref:Ie,shapeFlag:fe}=Z;switch(Te){case Vr:_(W,Z,ue,le);break;case as:k(W,Z,ue,le);break;case Ja:W==null&&g(Z,ue,le,ee);break;case Pe:S(W,Z,ue,le,me,j,ee,pe,ke);break;default:fe&1?T(W,Z,ue,le,me,j,ee,pe,ke):fe&6?E(W,Z,ue,le,me,j,ee,pe,ke):(fe&64||fe&128)&&Te.process(W,Z,ue,le,me,j,ee,pe,ke,z)}Ie!=null&&me?Xa(Ie,W&&W.ref,j,Z||W,!Z):Ie==null&&W&&W.ref!=null&&Xa(W.ref,null,j,W,!0)},_=(W,Z,ue,le)=>{if(W==null)s(Z.el=l(Z.children),ue,le);else{const me=Z.el=W.el;Z.children!==W.children&&c(me,Z.children)}},k=(W,Z,ue,le)=>{W==null?s(Z.el=a(Z.children||""),ue,le):Z.el=W.el},g=(W,Z,ue,le)=>{[W.el,W.anchor]=p(W.children,Z,ue,le,W.el,W.anchor)},v=({el:W,anchor:Z},ue,le)=>{let me;for(;W&&W!==Z;)me=f(W),s(W,ue,le),W=me;s(Z,ue,le)},y=({el:W,anchor:Z})=>{let ue;for(;W&&W!==Z;)ue=f(W),o(W),W=ue;o(Z)},T=(W,Z,ue,le,me,j,ee,pe,ke)=>{if(Z.type==="svg"?ee="svg":Z.type==="math"&&(ee="mathml"),W==null)P(Z,ue,le,me,j,ee,pe,ke);else{const Te=W.el&&W.el._isVueCE?W.el:null;try{Te&&Te._beginPatch(),M(W,Z,me,j,ee,pe,ke)}finally{Te&&Te._endPatch()}}},P=(W,Z,ue,le,me,j,ee,pe)=>{let ke,Te;const{props:Ie,shapeFlag:fe,transition:Me,dirs:Ge}=W;if(ke=W.el=r(W.type,j,Ie&&Ie.is,Ie),fe&8?u(ke,W.children):fe&16&&b(W.children,ke,null,le,me,Jm(W,j),ee,pe),Ge&&Ei(W,null,le,"created"),N(ke,W,W.scopeId,ee,le),Ie){for(const kt in Ie)kt!=="value"&&!Fl(kt)&&i(ke,kt,null,Ie[kt],j,le);"value"in Ie&&i(ke,"value",null,Ie.value,j),(Te=Ie.onVnodeBeforeMount)&&ho(Te,le,W)}Ge&&Ei(W,null,le,"beforeMount");const lt=Mx(me,Me);lt&&Me.beforeEnter(ke),s(ke,Z,ue),((Te=Ie&&Ie.onVnodeMounted)||lt||Ge)&&rs(()=>{try{Te&&ho(Te,le,W),lt&&Me.enter(ke),Ge&&Ei(W,null,le,"mounted")}finally{}},me)},N=(W,Z,ue,le,me)=>{if(ue&&h(W,ue),le)for(let j=0;j<le.length;j++)h(W,le[j]);if(me){let j=me.subTree;if(Z===j||sp(j.type)&&(j.ssContent===Z||j.ssFallback===Z)){const ee=me.vnode;N(W,ee,ee.scopeId,ee.slotScopeIds,me.parent)}}},b=(W,Z,ue,le,me,j,ee,pe,ke=0)=>{for(let Te=ke;Te<W.length;Te++){const Ie=W[Te]=pe?Qi(W[Te]):go(W[Te]);m(null,Ie,Z,ue,le,me,j,ee,pe)}},M=(W,Z,ue,le,me,j,ee)=>{const pe=Z.el=W.el;let{patchFlag:ke,dynamicChildren:Te,dirs:Ie}=Z;ke|=W.patchFlag&16;const fe=W.props||Gt,Me=Z.props||Gt;let Ge;if(ue&&wl(ue,!1),(Ge=Me.onVnodeBeforeUpdate)&&ho(Ge,ue,Z,W),Ie&&Ei(Z,W,ue,"beforeUpdate"),ue&&wl(ue,!0),(fe.innerHTML&&Me.innerHTML==null||fe.textContent&&Me.textContent==null)&&u(pe,""),Te?I(W.dynamicChildren,Te,pe,ue,le,Jm(Z,me),j):ee||G(W,Z,pe,null,ue,le,Jm(Z,me),j,!1),ke>0){if(ke&16)L(pe,fe,Me,ue,me);else if(ke&2&&fe.class!==Me.class&&i(pe,"class",null,Me.class,me),ke&4&&i(pe,"style",fe.style,Me.style,me),ke&8){const lt=Z.dynamicProps;for(let kt=0;kt<lt.length;kt++){const bt=lt[kt],Et=fe[bt],Rt=Me[bt];(Rt!==Et||bt==="value")&&i(pe,bt,Et,Rt,me,ue)}}ke&1&&W.children!==Z.children&&u(pe,Z.children)}else!ee&&Te==null&&L(pe,fe,Me,ue,me);((Ge=Me.onVnodeUpdated)||Ie)&&rs(()=>{Ge&&ho(Ge,ue,Z,W),Ie&&Ei(Z,W,ue,"updated")},le)},I=(W,Z,ue,le,me,j,ee)=>{for(let pe=0;pe<Z.length;pe++){const ke=W[pe],Te=Z[pe],Ie=ke.el&&(ke.type===Pe||!pi(ke,Te)||ke.shapeFlag&198)?d(ke.el):ue;m(ke,Te,Ie,null,le,me,j,ee,!0)}},L=(W,Z,ue,le,me)=>{if(Z!==ue){if(Z!==Gt)for(const j in Z)!Fl(j)&&!(j in ue)&&i(W,j,Z[j],null,me,le);for(const j in ue){if(Fl(j))continue;const ee=ue[j],pe=Z[j];ee!==pe&&j!=="value"&&i(W,j,pe,ee,me,le)}"value"in ue&&i(W,"value",Z.value,ue.value,me)}},S=(W,Z,ue,le,me,j,ee,pe,ke)=>{const Te=Z.el=W?W.el:l(""),Ie=Z.anchor=W?W.anchor:l("");let{patchFlag:fe,dynamicChildren:Me,slotScopeIds:Ge}=Z;Ge&&(pe=pe?pe.concat(Ge):Ge),W==null?(s(Te,ue,le),s(Ie,ue,le),b(Z.children||[],ue,Ie,me,j,ee,pe,ke)):fe>0&&fe&64&&Me&&W.dynamicChildren&&W.dynamicChildren.length===Me.length?(I(W.dynamicChildren,Me,ue,me,j,ee,pe),(Z.key!=null||me&&Z===me.subTree)&&h0(W,Z,!0)):G(W,Z,ue,Ie,me,j,ee,pe,ke)},E=(W,Z,ue,le,me,j,ee,pe,ke)=>{Z.slotScopeIds=pe,W==null?Z.shapeFlag&512?me.ctx.activate(Z,ue,le,ee,ke):R(Z,ue,le,me,j,ee,ke):D(W,Z,ke)},R=(W,Z,ue,le,me,j,ee)=>{const pe=W.component=Rx(W,le,me);if(rd(W)&&(pe.ctx.renderer=z),Bx(pe,!1,ee),pe.asyncDep){if(me&&me.registerDep(pe,F,ee),!W.el){const ke=pe.subTree=ie(as);k(null,ke,Z,ue),W.placeholder=ke.el}}else F(pe,W,Z,ue,me,j,ee)},D=(W,Z,ue)=>{const le=Z.component=W.component;if(f$(W,Z,ue))if(le.asyncDep&&!le.asyncResolved){U(le,Z,ue);return}else le.next=Z,le.update();else Z.el=W.el,le.vnode=Z},F=(W,Z,ue,le,me,j,ee)=>{const pe=()=>{if(W.isMounted){let{next:fe,bu:Me,u:Ge,parent:lt,vnode:kt}=W;{const qt=Ex(W);if(qt){fe&&(fe.el=kt.el,U(W,fe,ee)),qt.asyncDep.then(()=>{rs(()=>{W.isUnmounted||Te()},me)});return}}let bt=fe,Et;wl(W,!1),fe?(fe.el=kt.el,U(W,fe,ee)):fe=kt,Me&&Ya(Me),(Et=fe.props&&fe.props.onVnodeBeforeUpdate)&&ho(Et,lt,fe,kt),wl(W,!0);const Rt=Af(W),vt=W.subTree;W.subTree=Rt,m(vt,Rt,d(vt.el),je(vt),W,me,j),fe.el=Rt.el,bt===null&&hh(W,Rt.el),Ge&&rs(Ge,me),(Et=fe.props&&fe.props.onVnodeUpdated)&&rs(()=>ho(Et,lt,fe,kt),me)}else{let fe;const{el:Me,props:Ge}=Z,{bm:lt,m:kt,parent:bt,root:Et,type:Rt}=W,vt=or(Z);if(wl(W,!1),lt&&Ya(lt),!vt&&(fe=Ge&&Ge.onVnodeBeforeMount)&&ho(fe,bt,Z),wl(W,!0),Me&&oe){const qt=()=>{W.subTree=Af(W),oe(Me,W.subTree,W,me,null)};vt&&Rt.__asyncHydrate?Rt.__asyncHydrate(Me,W,qt):qt()}else{Et.ce&&Et.ce._hasShadowRoot()&&Et.ce._injectChildStyle(Rt,W.parent?W.parent.type:void 0);const qt=W.subTree=Af(W);m(null,qt,ue,le,W,me,j),Z.el=qt.el}if(kt&&rs(kt,me),!vt&&(fe=Ge&&Ge.onVnodeMounted)){const qt=Z;rs(()=>ho(fe,bt,qt),me)}(Z.shapeFlag&256||bt&&or(bt.vnode)&&bt.vnode.shapeFlag&256)&&W.a&&rs(W.a,me),W.isMounted=!0,Z=ue=le=null}};W.scope.on();const ke=W.effect=new Kf(pe);W.scope.off();const Te=W.update=ke.run.bind(ke),Ie=W.job=ke.runIfDirty.bind(ke);Ie.i=W,Ie.id=W.uid,ke.scheduler=()=>s0(Ie),wl(W,!0),Te()},U=(W,Z,ue)=>{Z.component=W;const le=W.vnode.props;W.vnode=Z,W.next=null,h$(W,Z.props,le,ue),y$(W,Z.children,ue),lr(),hb(W),ar()},G=(W,Z,ue,le,me,j,ee,pe,ke=!1)=>{const Te=W&&W.children,Ie=W?W.shapeFlag:0,fe=Z.children,{patchFlag:Me,shapeFlag:Ge}=Z;if(Me>0){if(Me&128){q(Te,fe,ue,le,me,j,ee,pe,ke);return}else if(Me&256){Y(Te,fe,ue,le,me,j,ee,pe,ke);return}}Ge&8?(Ie&16&&Oe(Te,me,j),fe!==Te&&u(ue,fe)):Ie&16?Ge&16?q(Te,fe,ue,le,me,j,ee,pe,ke):Oe(Te,me,j,!0):(Ie&8&&u(ue,""),Ge&16&&b(fe,ue,le,me,j,ee,pe,ke))},Y=(W,Z,ue,le,me,j,ee,pe,ke)=>{W=W||Ka,Z=Z||Ka;const Te=W.length,Ie=Z.length,fe=Math.min(Te,Ie);let Me;for(Me=0;Me<fe;Me++){const Ge=Z[Me]=ke?Qi(Z[Me]):go(Z[Me]);m(W[Me],Ge,ue,null,me,j,ee,pe,ke)}Te>Ie?Oe(W,me,j,!0,!1,fe):b(Z,ue,le,me,j,ee,pe,ke,fe)},q=(W,Z,ue,le,me,j,ee,pe,ke)=>{let Te=0;const Ie=Z.length;let fe=W.length-1,Me=Ie-1;for(;Te<=fe&&Te<=Me;){const Ge=W[Te],lt=Z[Te]=ke?Qi(Z[Te]):go(Z[Te]);if(pi(Ge,lt))m(Ge,lt,ue,null,me,j,ee,pe,ke);else break;Te++}for(;Te<=fe&&Te<=Me;){const Ge=W[fe],lt=Z[Me]=ke?Qi(Z[Me]):go(Z[Me]);if(pi(Ge,lt))m(Ge,lt,ue,null,me,j,ee,pe,ke);else break;fe--,Me--}if(Te>fe){if(Te<=Me){const Ge=Me+1,lt=Ge<Ie?Z[Ge].el:le;for(;Te<=Me;)m(null,Z[Te]=ke?Qi(Z[Te]):go(Z[Te]),ue,lt,me,j,ee,pe,ke),Te++}}else if(Te>Me)for(;Te<=fe;)de(W[Te],me,j,!0),Te++;else{const Ge=Te,lt=Te,kt=new Map;for(Te=lt;Te<=Me;Te++){const Vt=Z[Te]=ke?Qi(Z[Te]):go(Z[Te]);Vt.key!=null&&kt.set(Vt.key,Te)}let bt,Et=0;const Rt=Me-lt+1;let vt=!1,qt=0;const dn=new Array(Rt);for(Te=0;Te<Rt;Te++)dn[Te]=0;for(Te=Ge;Te<=fe;Te++){const Vt=W[Te];if(Et>=Rt){de(Vt,me,j,!0);continue}let fn;if(Vt.key!=null)fn=kt.get(Vt.key);else for(bt=lt;bt<=Me;bt++)if(dn[bt-lt]===0&&pi(Vt,Z[bt])){fn=bt;break}fn===void 0?de(Vt,me,j,!0):(dn[fn-lt]=Te+1,fn>=qt?qt=fn:vt=!0,m(Vt,Z[fn],ue,null,me,j,ee,pe,ke),Et++)}const os=vt?_$(dn):Ka;for(bt=os.length-1,Te=Rt-1;Te>=0;Te--){const Vt=lt+Te,fn=Z[Vt],Ds=Z[Vt+1],nt=Vt+1<Ie?Ds.el||Ix(Ds):le;dn[Te]===0?m(null,fn,ue,nt,me,j,ee,pe,ke):vt&&(bt<0||Te!==os[bt]?ae(fn,ue,nt,2):bt--)}}},ae=(W,Z,ue,le,me=null)=>{const{el:j,type:ee,transition:pe,children:ke,shapeFlag:Te}=W;if(Te&6){ae(W.component.subTree,Z,ue,le);return}if(Te&128){W.suspense.move(Z,ue,le);return}if(Te&64){ee.move(W,Z,ue,z);return}if(ee===Pe){s(j,Z,ue);for(let fe=0;fe<ke.length;fe++)ae(ke[fe],Z,ue,le);s(W.anchor,Z,ue);return}if(ee===Ja){v(W,Z,ue);return}if(le!==2&&Te&1&&pe)if(le===0)pe.persisted&&!j[Xo]?s(j,Z,ue):(pe.beforeEnter(j),s(j,Z,ue),rs(()=>pe.enter(j),me));else{const{leave:fe,delayLeave:Me,afterLeave:Ge}=pe,lt=()=>{W.ctx.isUnmounted?o(j):s(j,Z,ue)},kt=()=>{const bt=j._isLeaving||!!j[Xo];j._isLeaving&&j[Xo](!0),pe.persisted&&!bt?lt():fe(j,()=>{lt(),Ge&&Ge()})};Me?Me(j,lt,kt):kt()}else s(j,Z,ue)},de=(W,Z,ue,le=!1,me=!1)=>{const{type:j,props:ee,ref:pe,children:ke,dynamicChildren:Te,shapeFlag:Ie,patchFlag:fe,dirs:Me,cacheIndex:Ge,memo:lt}=W;if(fe===-2&&(me=!1),pe!=null&&(lr(),Xa(pe,null,ue,W,!0),ar()),Ge!=null&&(Z.renderCache[Ge]=void 0),Ie&256){Z.ctx.deactivate(W);return}const kt=Ie&1&&Me,bt=!or(W);let Et;if(bt&&(Et=ee&&ee.onVnodeBeforeUnmount)&&ho(Et,Z,W),Ie&6)he(W.component,ue,le);else{if(Ie&128){W.suspense.unmount(ue,le);return}kt&&Ei(W,null,Z,"beforeUnmount"),Ie&64?W.type.remove(W,Z,ue,z,le):Te&&!Te.hasOnce&&(j!==Pe||fe>0&&fe&64)?Oe(Te,Z,ue,!1,!0):(j===Pe&&fe&384||!me&&Ie&16)&&Oe(ke,Z,ue),le&&ne(W)}const Rt=lt!=null&&Ge==null;(bt&&(Et=ee&&ee.onVnodeUnmounted)||kt||Rt)&&rs(()=>{Et&&ho(Et,Z,W),kt&&Ei(W,null,Z,"unmounted"),Rt&&(W.el=null)},ue)},ne=W=>{const{type:Z,el:ue,anchor:le,transition:me}=W;if(Z===Pe){X(ue,le);return}if(Z===Ja){y(W);return}const j=()=>{o(ue),me&&!me.persisted&&me.afterLeave&&me.afterLeave()};if(W.shapeFlag&1&&me&&!me.persisted){const{leave:ee,delayLeave:pe}=me,ke=()=>ee(ue,j);pe?pe(W.el,j,ke):ke()}else j()},X=(W,Z)=>{let ue;for(;W!==Z;)ue=f(W),o(W),W=ue;o(Z)},he=(W,Z,ue)=>{const{bum:le,scope:me,job:j,subTree:ee,um:pe,m:ke,a:Te}=W;np(ke),np(Te),le&&Ya(le),me.stop(),j&&(j.flags|=8,de(ee,W,Z,ue)),pe&&rs(pe,Z),rs(()=>{W.isUnmounted=!0},Z)},Oe=(W,Z,ue,le=!1,me=!1,j=0)=>{for(let ee=j;ee<W.length;ee++)de(W[ee],Z,ue,le,me)},je=W=>{if(W.shapeFlag&6)return je(W.component.subTree);if(W.shapeFlag&128)return W.suspense.next();const Z=f(W.anchor||W.el),ue=Z&&Z[sx];return ue?f(ue):Z};let it=!1;const ce=(W,Z,ue)=>{let le;W==null?Z._vnode&&(de(Z._vnode,null,null,!0),le=Z._vnode.component):m(Z._vnode||null,W,Z,null,null,null,ue),Z._vnode=W,it||(it=!0,hb(le),Jf(),it=!1)},z={p:m,um:de,m:ae,r:ne,mt:R,mc:b,pc:G,pbc:I,n:je,o:e};let Q,oe;return t&&([Q,oe]=t(z)),{render:ce,hydrate:Q,createApp:r$(ce,Q)}}function Jm({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 wl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Mx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function h0(e,t,n=!1){const s=e.children,o=t.children;if(_t(s)&&_t(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]=Qi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&h0(r,l)),l.type===Vr&&(l.patchFlag===-1&&(l=o[i]=Qi(l)),l.el=r.el),l.type===as&&!l.el&&(l.el=r.el)}}function _$(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 Ex(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ex(t)}function np(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ix(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ix(t.subTree):null}const sp=e=>e.__isSuspense;let Ov=0;const w$={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)S$(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}C$(e,t,n,s,o,r,l,a,c)}},hydrate:x$,normalize:A$},ege=w$;function Ru(e,t){const n=e.props&&e.props[t];It(n)&&n()}function S$(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=$x(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?(Ru(e,"onPending"),Ru(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Za(f,e.ssFallback)):f.resolve(!1,!0)}function C$(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:_,isHydrating:k}=d;if(m)d.pendingBranch=f,pi(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(k||(a(p,h,n,s,o,null,i,r,l),Za(d,h)))):(d.pendingId=Ov++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(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),Za(d,h))):p&&pi(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&&pi(p,f))a(p,f,n,s,o,d,i,r,l),Za(d,f);else if(Ru(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Ov++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function $x(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:_}}=c;let k;const g=T$(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?Vf(e.props.timeout):void 0,y=i,T={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Ov++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(P=!1,N=!1){const{vnode:b,activeBranch:M,pendingBranch:I,pendingId:L,effects:S,parentComponent:E,container:R,isInFallback:D}=T;let F=!1;if(T.isHydrating)T.isHydrating=!1;else if(!P){F=M&&I.transition&&I.transition.mode==="out-in";let Y=!1;F&&(M.transition.afterLeave=()=>{L===T.pendingId&&(f(I,R,i===y&&!Y?p(M):i,0),Zf(S),D&&b.ssFallback&&(b.ssFallback.el=null))}),M&&!T.isFallbackMountPending&&(m(M.el)===R&&(i=p(M),Y=!0),h(M,E,T,!0),!F&&D&&b.ssFallback&&rs(()=>b.ssFallback.el=null,T)),F||f(I,R,i,0)}T.isFallbackMountPending=!1,Za(T,I),T.pendingBranch=null,T.isInFallback=!1;let U=T.parent,G=!1;for(;U;){if(U.pendingBranch){U.effects.push(...S),G=!0;break}U=U.parent}!G&&!F&&Zf(S),T.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),Ru(b,"onResolve")},fallback(P){if(!T.pendingBranch)return;const{vnode:N,activeBranch:b,parentComponent:M,container:I,namespace:L}=T;Ru(N,"onFallback");const S=p(b),E=()=>{T.isFallbackMountPending=!1,T.isInFallback&&(d(null,P,I,S,M,null,L,l,a),Za(T,P))},R=P.transition&&P.transition.mode==="out-in";R&&(T.isFallbackMountPending=!0,b.transition.afterLeave=E),T.isInFallback=!0,h(b,M,null,!0),R||E()},move(P,N,b){T.activeBranch&&f(T.activeBranch,P,N,b),T.container=P},next(){return T.activeBranch&&p(T.activeBranch)},registerDep(P,N,b){const M=!!T.pendingBranch;M&&T.deps++;const I=P.vnode.el;P.asyncDep.catch(L=>{kc(L,P,0)}).then(L=>{if(P.isUnmounted||T.isUnmounted||T.pendingId!==P.suspenseId)return;Du(),P.asyncResolved=!0;const{vnode:S}=P;Pv(P,L,!1),I&&(S.el=I);const E=!I&&P.subTree.el;N(P,S,m(I||P.subTree.el),I?null:p(P.subTree),T,r,b),E&&(S.placeholder=null,_(E)),hh(P,S.el),M&&--T.deps===0&&T.resolve()})},unmount(P,N){T.isUnmounted=!0,T.activeBranch&&h(T.activeBranch,n,P,N),T.pendingBranch&&h(T.pendingBranch,n,P,N)}};return T}function x$(e,t,n,s,o,i,r,l,a){const c=t.suspense=$x(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 A$(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Mb(s?n.default:n),e.ssFallback=s?Mb(n.fallback):ie(as)}function Mb(e){let t;if(It(e)){const n=Kl&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=Us,Lx())}return _t(e)&&(e=c$(e)),e=go(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function Nx(e,t){t&&t.pendingBranch?_t(e)?t.effects.push(...e):t.effects.push(e):Zf(e)}function Za(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,hh(s,o))}function T$(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Vr=Symbol.for("v-txt"),as=Symbol.for("v-cmt"),Ja=Symbol.for("v-stc"),pu=[];let Us=null;function w(e=!1){pu.push(Us=e?null:[])}function Lx(){pu.pop(),Us=pu[pu.length-1]||null}let Kl=1;function op(e,t=!1){Kl+=e,e<0&&Us&&t&&(Us.hasOnce=!0)}function Ox(e){return e.dynamicChildren=Kl>0?Us||Ka:null,Lx(),Kl>0&&Us&&Us.push(e),e}function $(e,t,n,s,o,i){return Ox(x(e,t,n,s,o,i,!0))}function ye(e,t,n,s,o){return Ox(ie(e,t,n,s,o,!0))}function Xr(e){return e?e.__v_isVNode===!0:!1}function pi(e,t){return e.type===t.type&&e.key===t.key}function tge(e){}const Px=({key:e})=>e??null,Tf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?An(e)||ns(e)||It(e)?{i:Ps,r:e,k:t,f:!!n}:e:null);function x(e,t=null,n=null,s=0,o=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Px(t),ref:t&&Tf(t),scopeId:uh,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:Ps};return l?(g0(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=An(n)?8:16),Kl>0&&!r&&Us&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Us.push(a),a}const ie=M$;function M$(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===fx)&&(e=as),Xr(e)){const l=ur(e,t,!0);return n&&g0(l,n),Kl>0&&!i&&Us&&(l.shapeFlag&6?Us[Us.indexOf(e)]=l:Us.push(l)),l.patchFlag=-2,l}if(O$(e)&&(e=e.__vccOpts),t){t=E$(t);let{class:l,style:a}=t;l&&!An(l)&&(t.class=Re(l)),un(a)&&(ch(a)&&!_t(a)&&(a=kn({},a)),t.style=Xt(a))}const r=An(e)?1:sp(e)?128:ox(e)?64:un(e)?4:It(e)?2:0;return x(e,t,n,s,o,r,i,!0)}function E$(e){return e?ch(e)||_x(e)?kn({},e):e:null}function ur(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?vn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Px(c),ref:t&&t.ref?n&&i?_t(i)?i.concat(Tf(t)):[i,Tf(t)]:Tf(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ur(e.ssContent),ssFallback:e.ssFallback&&ur(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Qr(u,a.clone(u)),u}function Ue(e=" ",t=0){return ie(Vr,null,e,t)}function m0(e,t){const n=ie(Ja,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(w(),ye(as,null,e)):ie(as,null,e)}function go(e){return e==null||typeof e=="boolean"?ie(as):_t(e)?ie(Pe,null,e.slice()):Xr(e)?Qi(e):ie(Vr,null,String(e))}function Qi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ur(e)}function g0(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_t(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),g0(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!_x(t)?t._ctx=Ps:o===3&&Ps&&(Ps.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else It(t)?(t={default:t,_ctx:Ps},n=32):(t=String(t),s&64?(n=16,t=[Ue(t)]):n=8);e.children=t,e.shapeFlag|=n}function vn(...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=Re([t.class,s.class]));else if(o==="style")t.style=Xt([t.style,s.style]);else if(sd(o)){const i=t[o],r=s[o];r&&i!==r&&!(_t(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Xp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function ho(e,t,n,s=null){ii(e,t,7,[n,s])}const I$=mx();let $$=0;function Rx(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||I$,i={uid:$$++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $C(!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:Sx(s,o),emitsOptions:vx(s,o),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:s.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=l$.bind(null,i),e.ce&&e.ce(i),i}let Ns=null;const Rs=()=>Ns||Ps;let ip,ec;{const e=sh(),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)}};ip=t("__VUE_INSTANCE_SETTERS__",n=>Ns=n),ec=t("__VUE_SSR_SETTERS__",n=>Gl=n)}const bc=e=>{const t=Ns;return ip(e),e.scope.on(),()=>{e.scope.off(),ip(t)}},Du=()=>{Ns&&Ns.scope.off(),ip(null)};function Dx(e){return e.vnode.shapeFlag&4}let Gl=!1;function Bx(e,t=!1,n=!1){t&&ec(t);const{props:s,children:o}=e.vnode,i=Dx(e);p$(e,s,i,t),v$(e,o,n||t);const r=i?N$(e,t):void 0;return t&&ec(!1),r}function N$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Iv);const{setup:s}=n;if(s){lr();const o=e.setupContext=s.length>1?Hx(e):null,i=bc(e),r=od(s,e,0,[e.props,o]),l=X1(r);if(ar(),i(),(l||e.sp)&&!or(e)&&i0(e),l){if(r.then(Du,Du),t)return r.then(a=>{Pv(e,a,t)}).catch(a=>{kc(a,e,0)});e.asyncDep=r}else Pv(e,r,t)}else Fx(e,t)}function Pv(e,t,n){It(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:un(t)&&(e.setupState=YC(t)),Fx(e,n)}let rp,Rv;function nge(e){rp=e,Rv=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,JI))}}const sge=()=>!rp;function Fx(e,t,n){const s=e.type;if(!e.render){if(!t&&rp&&!s.render){const o=s.template||d0(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=kn(kn({isCustomElement:i,delimiters:l},r),a);s.render=rp(o,c)}}e.render=s.render||ni,Rv&&Rv(e)}{const o=bc(e);lr();try{e$(e)}finally{ar(),o()}}}const L$={get(e,t){return Ws(e,"get",""),e[t]}};function Hx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,L$),slots:e.slots,emit:e.emit,expose:t}}function ad(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(YC(Wr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in fu)return fu[n](e)},has(t,n){return n in t||n in fu}})):e.proxy}function Dv(e,t=!0){return It(e)?e.displayName||e.name:e.name||t&&e.__name}function O$(e){return It(e)&&"__vccOpts"in e}const B=(e,t)=>gI(e,t,Gl);function mn(e,t,n){try{op(-1);const s=arguments.length;return s===2?un(t)&&!_t(t)?Xr(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Xr(n)&&(n=[n]),ie(e,t,n))}finally{op(1)}}function oge(){}function ige(e,t,n,s){const o=n[s];if(o&&P$(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function P$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if($s(n[s],t[s]))return!1;return Kl>0&&Us&&Us.push(e),!0}const R$="3.5.35",rge=ni,lge=_I,age=Na,cge=tx,D$={createComponentInstance:Rx,setupComponent:Bx,renderComponentRoot:Af,setCurrentRenderingInstance:Lu,isVNode:Xr,normalizeVNode:go,getComponentPublicInstance:ad,ensureValidVNode:u0,pushWarningContext:kI,popWarningContext:bI},uge=D$,dge=null,fge=null,pge=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Bv;const Eb=typeof window<"u"&&window.trustedTypes;if(Eb)try{Bv=Eb.createPolicy("vue",{createHTML:e=>e})}catch{}const Wx=Bv?e=>Bv.createHTML(e):e=>e,B$="http://www.w3.org/2000/svg",F$="http://www.w3.org/1998/Math/MathML",Vi=typeof document<"u"?document:null,Ib=Vi&&Vi.createElement("template"),H$={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"?Vi.createElementNS(B$,e):t==="mathml"?Vi.createElementNS(F$,e):n?Vi.createElement(e,{is:n}):Vi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Vi.createTextNode(e),createComment:e=>Vi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Vi.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{Ib.innerHTML=Wx(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Ib.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]}},Cr="transition",Kc="animation",cc=Symbol("_vtc"),zx={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},Ux=kn({},rx,zx),W$=e=>(e.displayName="Transition",e.props=Ux,e),Zr=W$((e,{slots:t})=>mn(LI,jx(e),t)),Sl=(e,t=[])=>{_t(e)?e.forEach(n=>n(...t)):e&&e(...t)},$b=e=>e?_t(e)?e.some(t=>t.length>1):e.length>1:!1;function jx(e){const t={};for(const S in e)S in zx||(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=z$(o),m=p&&p[0],_=p&&p[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:T,onBeforeAppear:P=k,onAppear:N=g,onAppearCancelled:b=v}=t,M=(S,E,R,D)=>{S._enterCancelled=D,Or(S,E?u:l),Or(S,E?c:r),R&&R()},I=(S,E)=>{S._isLeaving=!1,Or(S,d),Or(S,h),Or(S,f),E&&E()},L=S=>(E,R)=>{const D=S?N:g,F=()=>M(E,S,R);Sl(D,[E,F]),Nb(()=>{Or(E,S?a:i),Ti(E,S?u:l),$b(D)||Lb(E,s,m,F)})};return kn(t,{onBeforeEnter(S){Sl(k,[S]),Ti(S,i),Ti(S,r)},onBeforeAppear(S){Sl(P,[S]),Ti(S,a),Ti(S,c)},onEnter:L(!1),onAppear:L(!0),onLeave(S,E){S._isLeaving=!0;const R=()=>I(S,E);Ti(S,d),S._enterCancelled?(Ti(S,f),Fv(S)):(Fv(S),Ti(S,f)),Nb(()=>{S._isLeaving&&(Or(S,d),Ti(S,h),$b(y)||Lb(S,s,_,R))}),Sl(y,[S,R])},onEnterCancelled(S){M(S,!1,void 0,!0),Sl(v,[S])},onAppearCancelled(S){M(S,!0,void 0,!0),Sl(b,[S])},onLeaveCancelled(S){I(S),Sl(T,[S])}})}function z$(e){if(e==null)return null;if(un(e))return[eg(e.enter),eg(e.leave)];{const t=eg(e);return[t,t]}}function eg(e){return Vf(e)}function Ti(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[cc]||(e[cc]=new Set)).add(t)}function Or(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[cc];n&&(n.delete(t),n.size||(e[cc]=void 0))}function Nb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let U$=0;function Lb(e,t,n,s){const o=e._endId=++U$,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=qx(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 qx(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${Cr}Delay`),i=s(`${Cr}Duration`),r=Ob(o,i),l=s(`${Kc}Delay`),a=s(`${Kc}Duration`),c=Ob(l,a);let u=null,d=0,f=0;t===Cr?r>0&&(u=Cr,d=r,f=i.length):t===Kc?c>0&&(u=Kc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Cr:Kc:null,f=u?u===Cr?i.length:a.length:0);const h=u===Cr&&/\b(?:transform|all)(?:,|$)/.test(s(`${Cr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Ob(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Pb(n)+Pb(e[s])))}function Pb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Fv(e){return(e?e.ownerDocument:document).body.offsetHeight}function j$(e,t,n){const s=e[cc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const lp=Symbol("_vod"),Vx=Symbol("_vsh"),$o={name:"show",beforeMount(e,{value:t},{transition:n}){e[lp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Gc(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),Gc(e,!0),s.enter(e)):s.leave(e,()=>{Gc(e,!1)}):Gc(e,t))},beforeUnmount(e,{value:t}){Gc(e,t)}};function Gc(e,t){e.style.display=t?e[lp]:"none",e[Vx]=!t}function q$(){$o.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Kx=Symbol("");function hge(e){const t=Rs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ap(i,o))},s=()=>{const o=e(t.proxy);t.ce?ap(t.ce,o):Hv(t.subTree,o),n(o)};dx(()=>{Zf(s)}),bn(()=>{Ve(s,ni,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Tn(()=>o.disconnect())})}function Hv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Hv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ap(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Hv(n,t));else if(e.type===Ja){let{el:n,anchor:s}=e;for(;n&&(ap(n,t),n!==s);)n=n.nextSibling}}function ap(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=zE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[Kx]=s}}const V$=/(?:^|;)\s*display\s*:/;function K$(e,t,n){const s=e.style,o=An(n);let i=!1;if(n&&!o){if(t)if(An(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&iu(s,l,"")}else for(const r in t)n[r]==null&&iu(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?Y$(e,r,!An(t)&&t?t[r]:void 0,l)||iu(s,r,l):iu(s,r,"")}}else if(o){if(t!==n){const r=s[Kx];r&&(n+=";"+r),s.cssText=n,i=V$.test(n)}}else t&&e.removeAttribute("style");lp in e&&(e[lp]=i?s.display:"",e[Vx]&&(s.display="none"))}const Rb=/\s*!important$/;function iu(e,t,n){if(_t(n))n.forEach(s=>iu(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=G$(e,t);Rb.test(n)?e.setProperty(vo(s),n.replace(Rb,""),"important"):e[s]=n}}const Db=["Webkit","Moz","ms"],tg={};function G$(e,t){const n=tg[t];if(n)return n;let s=vs(t);if(s!=="filter"&&s in e)return tg[t]=s;s=th(s);for(let o=0;o<Db.length;o++){const i=Db[o]+s;if(i in e)return tg[t]=i}return t}function Y$(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&An(s)&&n===s}const Bb="http://www.w3.org/1999/xlink";function Fb(e,t,n,s,o,i=HE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Bb,t.slice(6,t.length)):e.setAttributeNS(Bb,t,n):n==null||i&&!MC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Fo(n)?String(n):n)}function Hb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Wx(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=MC(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 Q$(e,t,n,s){e.removeEventListener(t,n,s)}const Wb=Symbol("_vei");function X$(e,t,n,s,o=null){const i=e[Wb]||(e[Wb]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=Z$(t);if(s){const c=i[t]=t6(s,o);er(e,l,c,a)}else r&&(Q$(e,l,r,a),i[t]=void 0)}}const zb=/(?:Once|Passive|Capture)$/;function Z$(e){let t;if(zb.test(e)){t={};let s;for(;s=e.match(zb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):vo(e.slice(2)),t]}let ng=0;const J$=Promise.resolve(),e6=()=>ng||(J$.then(()=>ng=0),ng=Date.now());function t6(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(_t(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&&ii(c,t,5,l)}}else ii(o,t,5,[s])};return n.value=e,n.attached=e6(),n}const Ub=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,n6=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?j$(e,s,r):t==="style"?K$(e,n,s):sd(t)?Xp(t)||X$(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):s6(e,t,s,r))?(Hb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Fb(e,t,s,r,i,t!=="value")):e._isVueCE&&(o6(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!An(s)))?Hb(e,vs(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Fb(e,t,s,r))};function s6(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ub(t)&&It(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Ub(t)&&An(n)?!1:t in e}function o6(e,t){const n=e._def.props;if(!n)return!1;const s=vs(t);return Array.isArray(n)?n.some(o=>vs(o)===s):Object.keys(n).some(o=>vs(o)===s)}const jb={};function i6(e,t,n){let s=qe(e,t);Zp(s)&&(s=kn({},s,t));class o extends v0{constructor(r){super(s,r,n)}}return o.def=s,o}const mge=((e,t)=>i6(e,t,w6)),r6=typeof HTMLElement<"u"?HTMLElement:class{};class v0 extends r6{constructor(t,n={},s=dp){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!==dp?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kn({},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 v0){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let 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&&!_t(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Vf(this._props[a])),(l||(l=Object.create(null)))[vs(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)cn(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=_t(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(vs))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):jb;const o=vs(t);n&&this._numberProps&&this._numberProps[o]&&(s=Vf(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===jb?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(vo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(vo(t),n+""):n||this.removeAttribute(vo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),_6(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,kn(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,Zp(r[0])?kn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),vo(i)!==i&&o(vo(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 l6(e){const t=Rs(),n=t&&t.ce;return n||null}function gge(){const e=l6();return e&&e.shadowRoot}function vge(e="$style"){{const t=Rs();if(!t)return Gt;const n=t.type.__cssModules;if(!n)return Gt;const s=n[e];return s||Gt}}const Gx=new WeakMap,Yx=new WeakMap,cp=Symbol("_moveCb"),qb=Symbol("_enterCb"),a6=e=>(delete e.props.mode,e),c6=a6({name:"TransitionGroup",props:kn({},Ux,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Rs(),s=ix();let o,i;return r0(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!h6(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(d6),o.forEach(f6);const l=o.filter(p6);Fv(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ti(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[cp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[cp]=null,Or(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=en(e),l=jx(r);let a=r.tag||Pe;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),Qr(u,Ou(u,l,s,n)),Gx.set(u,Qx(u.el)))}i=t.default?o0(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Qr(u,Ou(u,l,s,n))}return ie(a,null,i)}}}),u6=c6;function d6(e){const t=e.el;t[cp]&&t[cp](),t[qb]&&t[qb]()}function f6(e){Yx.set(e,Qx(e.el))}function p6(e){const t=Gx.get(e),n=Yx.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 Qx(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function h6(e,t,n){const s=e.cloneNode(),o=e[cc];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}=qx(s);return i.removeChild(s),r}const Jr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _t(t)?n=>Ya(t,n):t};function m6(e){e.target.composing=!0}function Vb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const si=Symbol("_assign");function Kb(e,t,n){return t&&(e=e.trim()),n&&(e=nh(e)),e}const ao={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[si]=Jr(o);const i=s||o.props&&o.props.type==="number";er(e,t?"change":"input",r=>{r.target.composing||e[si](Kb(e.value,n,i))}),(n||i)&&er(e,"change",()=>{e.value=Kb(e.value,n,i)}),t||(er(e,"compositionstart",m6),er(e,"compositionend",Vb),er(e,"change",Vb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[si]=Jr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?nh(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)}},up={deep:!0,created(e,t,n){e[si]=Jr(n),er(e,"change",()=>{const s=e._modelValue,o=uc(e),i=e.checked,r=e[si];if(_t(s)){const l=oh(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(Jl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(Zx(e,i))})},mounted:Gb,beforeUpdate(e,t,n){e[si]=Jr(n),Gb(e,t,n)}};function Gb(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(_t(t))o=oh(t,s.props.value)>-1;else if(Jl(t))o=t.has(s.props.value);else{if(t===n)return;o=rr(t,Zx(e,!0))}e.checked!==o&&(e.checked=o)}const Xx={created(e,{value:t},n){e.checked=rr(t,n.props.value),e[si]=Jr(n),er(e,"change",()=>{e[si](uc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[si]=Jr(s),t!==n&&(e.checked=rr(t,s.props.value))}},Wv={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Jl(t);er(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?nh(uc(r)):uc(r));e[si](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[si]=Jr(s)},mounted(e,{value:t}){Yb(e,t)},beforeUpdate(e,t,n){e[si]=Jr(n)},updated(e,{value:t}){e._assigning||Yb(e,t)}};function Yb(e,t){const n=e.multiple,s=_t(t);if(!(n&&!s&&!Jl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=uc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=oh(t,l)>-1}else r.selected=t.has(l);else if(rr(uc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function uc(e){return"_value"in e?e._value:e.value}function Zx(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const g6={created(e,t,n){Zd(e,t,n,null,"created")},mounted(e,t,n){Zd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Zd(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Zd(e,t,n,s,"updated")}};function Jx(e,t){switch(e){case"SELECT":return Wv;case"TEXTAREA":return ao;default:switch(t){case"checkbox":return up;case"radio":return Xx;default:return ao}}}function Zd(e,t,n,s,o){const r=Jx(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function v6(){ao.getSSRProps=({value:e})=>({value:e}),Xx.getSSRProps=({value:e},t)=>{if(t.props&&rr(t.props.value,e))return{checked:!0}},up.getSSRProps=({value:e},t)=>{if(_t(e)){if(t.props&&oh(e,t.props.value)>-1)return{checked:!0}}else if(Jl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},g6.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Jx(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const y6=["ctrl","shift","alt","meta"],k6={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)=>y6.some(n=>e[`${n}Key`]&&!t.includes(n))},yt=(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=k6[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},b6={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},mi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=vo(o.key);if(t.some(r=>r===i||b6[r]===i))return e(o)}))},eA=kn({patchProp:n6},H$);let hu,Qb=!1;function tA(){return hu||(hu=k$(eA))}function nA(){return hu=Qb?hu:b$(eA),Qb=!0,hu}const _6=((...e)=>{tA().render(...e)}),yge=((...e)=>{nA().hydrate(...e)}),dp=((...e)=>{const t=tA().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=oA(s);if(!o)return;const i=t._component;!It(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,sA(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),w6=((...e)=>{const t=nA().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=oA(s);if(o)return n(o,!0,sA(o))},t});function sA(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function oA(e){return An(e)?document.querySelector(e):e}let Xb=!1;const kge=()=>{Xb||(Xb=!0,v6(),q$())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function S6(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const fp=typeof window<"u",il=(e,t=!1)=>t?Symbol.for(e):Symbol(e),C6=(e,t,n)=>x6({l:e,k:t,s:n}),x6=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),us=e=>typeof e=="number"&&isFinite(e),iA=e=>k0(e)==="[object Date]",dc=e=>k0(e)==="[object RegExp]",mh=e=>Qt(e)&&Object.keys(e).length===0,fs=Object.assign,A6=Object.create,xn=(e=null)=>A6(e);let Zb;const Rl=()=>Zb||(Zb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:xn());function Jb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function T6(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const M6=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,E6=/^(?:href|src|action|formaction)$/i;function y0(e){return M6.test(e)}function I6(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+=y0(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function e_(e,t){if(E6.test(e)&&y0(t))return"about:blank";const n=e.toLowerCase()==="style"?I6(t):t;return T6(n)}function $6(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${e_(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${e_(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)=>y0(o)?`${s}about:blank`:n),e}const N6=Object.prototype.hasOwnProperty;function ti(e,t){return N6.call(e,t)}const Zn=Array.isArray,Wn=e=>typeof e=="function",mt=e=>typeof e=="string",on=e=>typeof e=="boolean",rn=e=>e!==null&&typeof e=="object",L6=e=>rn(e)&&Wn(e.then)&&Wn(e.catch),rA=Object.prototype.toString,k0=e=>rA.call(e),Qt=e=>k0(e)==="[object Object]",O6=e=>e==null?"":Zn(e)||Qt(e)&&e.toString===rA?JSON.stringify(e,null,2):String(e);function b0(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Jd=e=>!rn(e)||Zn(e);function Mf(e,t){if(Jd(e)||Jd(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__"&&(rn(s[i])&&!rn(o[i])&&(o[i]=Array.isArray(s[i])?[]:xn()),Jd(o[i])||Jd(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 P6(e,t,n){return{line:e,column:t,offset:n}}function zv(e,t,n){return{start:e,end:t}}const hn={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},R6=17;function gh(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 D6(e){throw e}const xi=" ",B6="\r",Fs=`
|
|
29
|
-
`,F6="\u2028",H6="\u2029";function W6(e){const t=e;let n=0,s=1,o=1,i=0;const r=N=>t[N]===B6&&t[N+1]===Fs,l=N=>t[N]===Fs,a=N=>t[N]===H6,c=N=>t[N]===F6,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=N=>r(N)||a(N)||c(N)?Fs:t[N],_=()=>m(n),k=()=>m(n+i);function g(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function T(N=0){i=N}function P(){const N=n+i;for(;N!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:_,currentPeek:k,next:g,peek:v,reset:y,resetPeek:T,skipToPeek:P}}const ji=void 0,z6=".",t_="'",U6="tokenizer";function j6(e,t={}){const n=t.location!==!1,s=W6(e),o=()=>s.index(),i=()=>P6(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,ee,pe,...ke){const Te=c();if(ee.column+=pe,ee.offset+=pe,u){const Ie=n?zv(Te.startLoc,ee):null,fe=gh(j,Ie,{domain:U6,args:ke});u(fe)}}function f(j,ee,pe){j.endLoc=i(),j.currentType=ee;const ke={type:ee};return n&&(ke.loc=zv(j.startLoc,j.endLoc)),pe!=null&&(ke.value=pe),ke}const h=j=>f(j,13);function p(j,ee){return j.currentChar()===ee?(j.next(),ee):(d(hn.EXPECTED_TOKEN,i(),0,ee),"")}function m(j){let ee="";for(;j.currentPeek()===xi||j.currentPeek()===Fs;)ee+=j.currentPeek(),j.peek();return ee}function _(j){const ee=m(j);return j.skipToPeek(),ee}function k(j){if(j===ji)return!1;const ee=j.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee===95}function g(j){if(j===ji)return!1;const ee=j.charCodeAt(0);return ee>=48&&ee<=57}function v(j,ee){const{currentType:pe}=ee;if(pe!==2)return!1;m(j);const ke=k(j.currentPeek());return j.resetPeek(),ke}function y(j,ee){const{currentType:pe}=ee;if(pe!==2)return!1;m(j);const ke=j.currentPeek()==="-"?j.peek():j.currentPeek(),Te=g(ke);return j.resetPeek(),Te}function T(j,ee){const{currentType:pe}=ee;if(pe!==2)return!1;m(j);const ke=j.currentPeek()===t_;return j.resetPeek(),ke}function P(j,ee){const{currentType:pe}=ee;if(pe!==7)return!1;m(j);const ke=j.currentPeek()===".";return j.resetPeek(),ke}function N(j,ee){const{currentType:pe}=ee;if(pe!==8)return!1;m(j);const ke=k(j.currentPeek());return j.resetPeek(),ke}function b(j,ee){const{currentType:pe}=ee;if(!(pe===7||pe===11))return!1;m(j);const ke=j.currentPeek()===":";return j.resetPeek(),ke}function M(j,ee){const{currentType:pe}=ee;if(pe!==9)return!1;const ke=()=>{const Ie=j.currentPeek();return Ie==="{"?k(j.peek()):Ie==="@"||Ie==="|"||Ie===":"||Ie==="."||Ie===xi||!Ie?!1:Ie===Fs?(j.peek(),ke()):L(j,!1)},Te=ke();return j.resetPeek(),Te}function I(j){m(j);const ee=j.currentPeek()==="|";return j.resetPeek(),ee}function L(j,ee=!0){const pe=(Te=!1,Ie="")=>{const fe=j.currentPeek();return fe==="{"||fe==="@"||!fe?Te:fe==="|"?!(Ie===xi||Ie===Fs):fe===xi?(j.peek(),pe(!0,xi)):fe===Fs?(j.peek(),pe(!0,Fs)):!0},ke=pe();return ee&&j.resetPeek(),ke}function S(j,ee){const pe=j.currentChar();return pe===ji?ji:ee(pe)?(j.next(),pe):null}function E(j){const ee=j.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee>=48&&ee<=57||ee===95||ee===36}function R(j){return S(j,E)}function D(j){const ee=j.charCodeAt(0);return ee>=97&&ee<=122||ee>=65&&ee<=90||ee>=48&&ee<=57||ee===95||ee===36||ee===45}function F(j){return S(j,D)}function U(j){const ee=j.charCodeAt(0);return ee>=48&&ee<=57}function G(j){return S(j,U)}function Y(j){const ee=j.charCodeAt(0);return ee>=48&&ee<=57||ee>=65&&ee<=70||ee>=97&&ee<=102}function q(j){return S(j,Y)}function ae(j){let ee="",pe="";for(;ee=G(j);)pe+=ee;return pe}function de(j){let ee="";for(;;){const pe=j.currentChar();if(pe==="\\"){const ke=j.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(ee+=pe+ke,j.next(),j.next()):(j.resetPeek(),ee+=pe,j.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===xi||pe===Fs)if(L(j))ee+=pe,j.next();else{if(I(j))break;ee+=pe,j.next()}else ee+=pe,j.next()}}return ee}function ne(j){_(j);let ee="",pe="";for(;ee=F(j);)pe+=ee;const ke=j.currentChar();if(ke&&ke!=="}"&&ke!==ji&&ke!==xi&&ke!==Fs&&ke!==" "){const Te=z(j);return d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+Te),pe+Te}return j.currentChar()===ji&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function X(j){_(j);let ee="";return j.currentChar()==="-"?(j.next(),ee+=`-${ae(j)}`):ee+=ae(j),j.currentChar()===ji&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),ee}function he(j){return j!==t_&&j!==Fs}function Oe(j){_(j),p(j,"'");let ee="",pe="";for(;ee=S(j,he);)ee==="\\"?pe+=je(j):pe+=ee;const ke=j.currentChar();return ke===Fs||ke===ji?(d(hn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===Fs&&(j.next(),p(j,"'")),pe):(p(j,"'"),pe)}function je(j){const ee=j.currentChar();switch(ee){case"\\":case"'":return j.next(),`\\${ee}`;case"u":return it(j,ee,4);case"U":return it(j,ee,6);default:return d(hn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,ee),""}}function it(j,ee,pe){p(j,ee);let ke="";for(let Te=0;Te<pe;Te++){const Ie=q(j);if(!Ie){d(hn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${ee}${ke}${j.currentChar()}`);break}ke+=Ie}return`\\${ee}${ke}`}function ce(j){return j!=="{"&&j!=="}"&&j!==xi&&j!==Fs}function z(j){_(j);let ee="",pe="";for(;ee=S(j,ce);)pe+=ee;return pe}function Q(j){let ee="",pe="";for(;ee=R(j);)pe+=ee;return pe}function oe(j){const ee=pe=>{const ke=j.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===xi?pe:(pe+=ke,j.next(),ee(pe))};return ee("")}function W(j){_(j);const ee=p(j,"|");return _(j),ee}function Z(j,ee){let pe=null;switch(j.currentChar()){case"{":return ee.braceNest>=1&&d(hn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),pe=f(ee,2,"{"),_(j),ee.braceNest++,pe;case"}":return ee.braceNest>0&&ee.currentType===2&&d(hn.EMPTY_PLACEHOLDER,i(),0),j.next(),pe=f(ee,3,"}"),ee.braceNest--,ee.braceNest>0&&_(j),ee.inLinked&&ee.braceNest===0&&(ee.inLinked=!1),pe;case"@":return ee.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=ue(j,ee)||h(ee),ee.braceNest=0,pe;default:{let Te=!0,Ie=!0,fe=!0;if(I(j))return ee.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(ee,1,W(j)),ee.braceNest=0,ee.inLinked=!1,pe;if(ee.braceNest>0&&(ee.currentType===4||ee.currentType===5||ee.currentType===6))return d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),ee.braceNest=0,le(j,ee);if(Te=v(j,ee))return pe=f(ee,4,ne(j)),_(j),pe;if(Ie=y(j,ee))return pe=f(ee,5,X(j)),_(j),pe;if(fe=T(j,ee))return pe=f(ee,6,Oe(j)),_(j),pe;if(!Te&&!Ie&&!fe)return pe=f(ee,12,z(j)),d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),_(j),pe;break}}return pe}function ue(j,ee){const{currentType:pe}=ee;let ke=null;const Te=j.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&(Te===Fs||Te===xi)&&d(hn.INVALID_LINKED_FORMAT,i(),0),Te){case"@":return j.next(),ke=f(ee,7,"@"),ee.inLinked=!0,ke;case".":return _(j),j.next(),f(ee,8,".");case":":return _(j),j.next(),f(ee,9,":");default:return I(j)?(ke=f(ee,1,W(j)),ee.braceNest=0,ee.inLinked=!1,ke):P(j,ee)||b(j,ee)?(_(j),ue(j,ee)):N(j,ee)?(_(j),f(ee,11,Q(j))):M(j,ee)?(_(j),Te==="{"?Z(j,ee)||ke:f(ee,10,oe(j))):(pe===7&&d(hn.INVALID_LINKED_FORMAT,i(),0),ee.braceNest=0,ee.inLinked=!1,le(j,ee))}}function le(j,ee){let pe={type:13};if(ee.braceNest>0)return Z(j,ee)||h(ee);if(ee.inLinked)return ue(j,ee)||h(ee);switch(j.currentChar()){case"{":return Z(j,ee)||h(ee);case"}":return d(hn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(ee,3,"}");case"@":return ue(j,ee)||h(ee);default:{if(I(j))return pe=f(ee,1,W(j)),ee.braceNest=0,ee.inLinked=!1,pe;if(L(j))return f(ee,0,de(j));break}}return pe}function me(){const{currentType:j,offset:ee,startLoc:pe,endLoc:ke}=a;return a.lastType=j,a.lastOffset=ee,a.lastStartLoc=pe,a.lastEndLoc=ke,a.offset=o(),a.startLoc=i(),s.currentChar()===ji?f(a,13):le(s,a)}return{nextToken:me,currentOffset:o,currentPosition:i,context:c}}const q6="parser",V6=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,K6=/\\([\\@{}|])/g;function G6(e,t){return t}function Y6(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 Q6(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,g,v,y,...T){const P=k.currentPosition();if(P.offset+=y,P.column+=y,n){const N=t?zv(v,P):null,b=gh(g,N,{domain:q6,args:T});n(b)}}function o(k,g,v){const y={type:k};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(k,g,v,y){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(K6,G6),i(y,k.currentOffset(),k.currentPosition()),y}function l(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(5,y,T);return P.index=parseInt(g,10),k.nextToken(),i(P,k.currentOffset(),k.currentPosition()),P}function a(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(4,y,T);return P.key=g,k.nextToken(),i(P,k.currentOffset(),k.currentPosition()),P}function c(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(9,y,T);return P.value=g.replace(V6,Y6),k.nextToken(),i(P,k.currentOffset(),k.currentPosition()),P}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:y,lastStartLoc:T}=v,P=o(8,y,T);return g.type!==11?(s(k,hn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),P.value="",i(P,y,T),{nextConsumeToken:g,node:P}):(g.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ai(g)),P.value=g.value||"",i(P,k.currentOffset(),k.currentPosition()),{node:P})}function d(k,g){const v=k.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,k.currentOffset(),k.currentPosition()),y}function f(k){const g=k.context(),v=o(6,g.offset,g.startLoc);let y=k.nextToken();if(y.type===8){const T=u(k);v.modifier=T.node,y=T.nextConsumeToken||k.nextToken()}switch(y.type!==9&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(y)),y=k.nextToken(),y.type===2&&(y=k.nextToken()),y.type){case 10:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(y)),v.key=d(k,y.value||"");break;case 4:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(y)),v.key=a(k,y.value||"");break;case 5:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(y)),v.key=l(k,y.value||"");break;case 6:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(y)),v.key=c(k,y.value||"");break;default:{s(k,hn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const T=k.context(),P=o(7,T.offset,T.startLoc);return P.value="",i(P,T.offset,T.startLoc),v.key=P,i(v,T.offset,T.startLoc),{nextConsumeToken:y,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function h(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,T=o(2,v,y);T.items=[];let P=null;do{const M=P||k.nextToken();switch(P=null,M.type){case 0:M.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(M)),T.items.push(r(k,M.value||""));break;case 5:M.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(M)),T.items.push(l(k,M.value||""));break;case 4:M.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(M)),T.items.push(a(k,M.value||""));break;case 6:M.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ai(M)),T.items.push(c(k,M.value||""));break;case 7:{const I=f(k);T.items.push(I.node),P=I.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const N=g.currentType===1?g.lastOffset:k.currentOffset(),b=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(T,N,b),T}function p(k,g,v,y){const T=k.context();let P=y.items.length===0;const N=o(1,g,v);N.cases=[],N.cases.push(y);do{const b=h(k);P||(P=b.items.length===0),N.cases.push(b)}while(T.currentType!==13);return P&&s(k,hn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(N,k.currentOffset(),k.currentPosition()),N}function m(k){const g=k.context(),{offset:v,startLoc:y}=g,T=h(k);return g.currentType===13?T:p(k,v,y,T)}function _(k){const g=j6(k,fs({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=k),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(k)),v.currentType!==13&&s(g,hn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:_}}function Ai(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 X6(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function n_(e,t){for(let n=0;n<e.length;n++)_0(e[n],t)}function _0(e,t){switch(e.type){case 1:n_(e.cases,t),t.helper("plural");break;case 2:n_(e.items,t);break;case 6:{_0(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 Z6(e,t={}){const n=X6(e);n.helper("normalize"),e.body&&_0(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function J6(e){const t=e.body;return t.type===2?s_(t):t.cases.forEach(n=>s_(n)),e}function s_(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=b0(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 La(e){switch(e.t=e.type,e.type){case 0:{const t=e;La(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++)La(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++)La(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;La(t.key),t.k=t.key,delete t.key,t.modifier&&(La(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 eN(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,_){r.code+=m}function c(m,_=!0){const k=_?s:"";a(o?k+" ".repeat(m):k)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function tN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),fc(e,t.key),t.modifier?(e.push(", "),fc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function nN(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&&(fc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function sN(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&&(fc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function oN(e,t){t.body?fc(e,t.body):e.push("null")}function fc(e,t){const{helper:n}=e;switch(t.type){case 0:oN(e,t);break;case 1:sN(e,t);break;case 2:nN(e,t);break;case 6:tN(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 iN=(e,t={})=>{const n=mt(t.mode)?t.mode:"normal",s=mt(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=eN(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${b0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),fc(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 rN(e,t={}){const n=fs({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=Q6(n).parse(e);return s?(i&&J6(l),o&&La(l),{ast:l,code:""}):(Z6(l,n),iN(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function lN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Rl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Rl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ni(e){return rn(e)&&w0(e)===0&&(ti(e,"b")||ti(e,"body"))}const lA=["b","body"];function aN(e){return rl(e,lA)}const aA=["c","cases"];function cN(e){return rl(e,aA,[])}const cA=["s","static"];function uN(e){return rl(e,cA)}const uA=["i","items"];function dN(e){return rl(e,uA,[])}const dA=["t","type"];function w0(e){return rl(e,dA)}const fA=["v","value"];function ef(e,t){const n=rl(e,fA);if(n!=null)return n;throw Bu(t)}const pA=["m","modifier"];function fN(e){return rl(e,pA)}const hA=["k","key"];function pN(e){const t=rl(e,hA);if(t)return t;throw Bu(6)}function rl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(ti(e,o)&&e[o]!=null)return e[o]}return n}const mA=[...lA,...aA,...cA,...uA,...hA,...pA,...fA,...dA];function Bu(e){return new Error(`unhandled node type: ${e}`)}function sg(e){return n=>hN(n,e)}function hN(e,t){const n=aN(t);if(n==null)throw Bu(0);if(w0(n)===1){const i=cN(n);return e.plural(i.reduce((r,l)=>[...r,o_(e,l)],[]))}else return o_(e,n)}function o_(e,t){const n=uN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=dN(t).reduce((o,i)=>[...o,Uv(e,i)],[]);return e.normalize(s)}}function Uv(e,t){const n=w0(t);switch(n){case 3:return ef(t,n);case 9:return ef(t,n);case 4:{const s=t;if(ti(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ti(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Bu(n)}case 5:{const s=t;if(ti(s,"i")&&us(s.i))return e.interpolate(e.list(s.i));if(ti(s,"index")&&us(s.index))return e.interpolate(e.list(s.index));throw Bu(n)}case 6:{const s=t,o=fN(s),i=pN(s);return e.linked(Uv(e,i),o?Uv(e,o):void 0,e.type)}case 7:return ef(t,n);case 8:return ef(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const mN=e=>e;let tf=xn();function gN(e,t={}){let n=!1;const s=t.onError||D6;return t.onError=o=>{n=!0,s(o)},{...rN(e,t),detectError:n}}function vN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&mt(e)){on(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||mN)(e),o=tf[s];if(o)return o;const{ast:i,detectError:r}=gN(e,{...t,location:!1,jit:!0}),l=sg(i);return r?l:tf[s]=l}else{const n=e.cacheKey;if(n){const s=tf[n];return s||(tf[n]=sg(e))}else return sg(e)}}let Fu=null;function yN(e){Fu=e}function kN(e,t,n){Fu&&Fu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const bN=_N("function:translate");function _N(e){return t=>Fu&&Fu.emit(e,t)}const tr={INVALID_ARGUMENT:R6,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},wN=24;function nr(e){return gh(e,null,void 0)}function S0(e,t){return t.locale!=null?i_(t.locale):i_(e.locale)}let og;function i_(e){if(mt(e))return e;if(Wn(e)){if(e.resolvedOnce&&og!=null)return og;if(e.constructor.name==="Function"){const t=e();if(L6(t))throw nr(tr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return og=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,...Zn(t)?t:rn(t)?Object.keys(t):mt(t)?[t]:[n]])]}function jv(e,t,n){const s=mt(n)?n:Hu,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Zn(r);)r=r_(i,r,t);const l=Zn(t)||!Qt(t)?t:t.default?t.default:null;r=mt(l)?[l]:l,Zn(r)&&r_(i,r,!1),o.__localeChainCache.set(s,i)}return i}function r_(e,t,n){let s=!0;for(let o=0;o<t.length&&on(s);o++){const i=t[o];mt(i)&&(s=CN(e,t[o],n))}return s}function CN(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=xN(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function xN(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),(Zn(n)||Qt(n))&&n[o]&&(s=n[o])}return s}const ll=[];ll[0]={w:[0],i:[3,0],"[":[4],o:[7]};ll[1]={w:[1],".":[2],"[":[4],o:[7]};ll[2]={w:[2],i:[3,0],0:[3,0]};ll[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};ll[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};ll[5]={"'":[4,0],o:8,l:[5,0]};ll[6]={'"':[4,0],o:8,l:[6,0]};const AN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function TN(e){return AN.test(e)}function MN(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 EN(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 IN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:TN(t)?MN(t):"*"+t}function $N(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=IN(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=EN(i),d=ll[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 l_=new Map;function NN(e,t){return rn(e)?e[t]:null}function LN(e,t){if(!rn(e))return null;let n=l_.get(t);if(n||(n=$N(t),n&&l_.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(mA.includes(r)&&Ni(o)||!rn(o)||!ti(o,r))return null;const l=o[r];if(l===void 0||Wn(o))return null;o=l,i++}return o}const ON="11.4.5",vh=-1,Hu="en-US",pp="",a_=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function PN(){return{upper:(e,t)=>t==="text"&&mt(e)?e.toUpperCase():t==="vnode"&&rn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&mt(e)?e.toLowerCase():t==="vnode"&&rn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&mt(e)?a_(e):t==="vnode"&&rn(e)&&"__v_isVNode"in e?a_(e.children):e}}let gA;function RN(e){gA=e}let vA;function DN(e){vA=e}let yA;function BN(e){yA=e}let kA=null;const FN=e=>{kA=e},HN=()=>kA;let bA=null;const c_=e=>{bA=e},WN=()=>bA;let u_=0;function zN(e={}){const t=Wn(e.onWarn)?e.onWarn:S6,n=mt(e.version)?e.version:ON,s=mt(e.locale)||Wn(e.locale)?e.locale:Hu,o=Wn(s)?Hu:s,i=Zn(e.fallbackLocale)||Qt(e.fallbackLocale)||mt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Qt(e.messages)?e.messages:ig(o),l=Qt(e.datetimeFormats)?e.datetimeFormats:ig(o),a=Qt(e.numberFormats)?e.numberFormats:ig(o),c=fs(xn(),e.modifiers,PN()),u=e.pluralRules||xn(),d=Wn(e.missing)?e.missing:null,f=on(e.missingWarn)||dc(e.missingWarn)?e.missingWarn:!0,h=on(e.fallbackWarn)||dc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,_=Wn(e.postTranslation)?e.postTranslation:null,k=Qt(e.processor)?e.processor:null,g=on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Wn(e.messageCompiler)?e.messageCompiler:gA,T=Wn(e.messageResolver)?e.messageResolver:vA||NN,P=Wn(e.localeFallbacker)?e.localeFallbacker:yA||SN,N=rn(e.fallbackContext)?e.fallbackContext:void 0,b=e,M=rn(b.__datetimeFormatters)?b.__datetimeFormatters:new Map,I=rn(b.__numberFormatters)?b.__numberFormatters:new Map,L=rn(b.__meta)?b.__meta:{};u_++;const S={version:n,cid:u_,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:_,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:T,localeFallbacker:P,fallbackContext:N,onWarn:t,__meta:L};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=M,S.__numberFormatters=I,__INTLIFY_PROD_DEVTOOLS__&&kN(S,n,L),S}const ig=e=>({[e]:xn()});function C0(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return mt(l)?l:t}else return t}function Yc(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function UN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function jN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(UN(e,t[s]))return!0;return!1}function d_(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!mt(t[0])&&!iA(t[0])&&!us(t[0]))return pp;const[a,c,u,d]=qv(...t),f=on(u.missingWarn)?u.missingWarn:e.missingWarn;on(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=S0(e,u),m=r(e,o,p);if(!mt(a)||a===""){const P=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?P.formatToParts(c):P.format(c)}let _={},k,g=null;const v="datetime format";for(let P=0;P<m.length&&(k=m[P],_=n[k]||{},g=_[a],!Qt(g));P++)C0(e,a,k,f,v);if(!Qt(g)||!mt(k))return s?vh:a;let y=`${k}__${a}`;mh(d)||(y=`${y}__${JSON.stringify(d)}`);let T=l.get(y);return T||(T=new Intl.DateTimeFormat(k,fs({},g,d)),l.set(y,T)),h?T.formatToParts(c):T.format(c)}const _A=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function qv(...e){const[t,n,s,o]=e,i=xn();let r=xn(),l;if(mt(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(iA(t)){if(isNaN(t.getTime()))throw nr(tr.INVALID_DATE_ARGUMENT);l=t}else if(us(t))l=t;else throw nr(tr.INVALID_ARGUMENT);return mt(n)?i.key=n:Qt(n)&&Object.keys(n).forEach(a=>{_A.includes(a)?r[a]=n[a]:i[a]=n[a]}),mt(s)?i.locale=s:Qt(s)&&(r=s),Qt(o)&&(r=o),[i.key||"",l,i,r]}function f_(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function p_(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!us(t[0]))return pp;const[a,c,u,d]=Vv(...t),f=on(u.missingWarn)?u.missingWarn:e.missingWarn;on(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=S0(e,u),m=r(e,o,p);if(!mt(a)||a===""){const P=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?P.formatToParts(c):P.format(c)}let _={},k,g=null;const v="number format";for(let P=0;P<m.length&&(k=m[P],_=n[k]||{},g=_[a],!Qt(g));P++)C0(e,a,k,f,v);if(!Qt(g)||!mt(k))return s?vh:a;let y=`${k}__${a}`;mh(d)||(y=`${y}__${JSON.stringify(d)}`);let T=l.get(y);return T||(T=new Intl.NumberFormat(k,fs({},g,d)),l.set(y,T)),h?T.formatToParts(c):T.format(c)}const wA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Vv(...e){const[t,n,s,o]=e,i=xn();let r=xn();if(!us(t))throw nr(tr.INVALID_ARGUMENT);const l=t;return mt(n)?i.key=n:Qt(n)&&Object.keys(n).forEach(a=>{wA.includes(a)?r[a]=n[a]:i[a]=n[a]}),mt(s)?i.locale=s:Qt(s)&&(r=s),Qt(o)&&(r=o),[i.key||"",l,i,r]}function h_(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const qN=e=>e,VN=e=>"",KN="text",GN=e=>e.length===0?"":b0(e),YN=O6;function rg(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function QN(e){const t=us(e.pluralIndex)?e.pluralIndex:-1;return us(e.named?.count)?e.named.count:us(e.named?.n)?e.named.n:t}function XN(e={}){const t=e.locale,n=QN(e),s=mt(t)&&Wn(e.pluralRules?.[t])?e.pluralRules[t]:rg,o=s===rg?void 0:rg,i=k=>k[s(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||xn();us(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=Wn(e.messages)?e.messages(k,!!g):rn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):VN)}const d=k=>e.modifiers?e.modifiers[k]:qN,f=Wn(e.processor?.normalize)?e.processor.normalize:GN,h=Wn(e.processor?.interpolate)?e.processor.interpolate:YN,p=mt(e.processor?.type)?e.processor.type:KN,_={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,y]=g;let T="text",P="";g.length===1?rn(v)?(P=v.modifier||P,T=v.type||T):mt(v)&&(P=v||P):g.length===2&&(mt(v)&&(P=v||P),mt(y)&&(T=y||T));const N=u(k,!0)(_),b=N===""||N===void 0?k:N,M=T==="vnode"&&Zn(b)&&P?b[0]:b;return P?d(P)(M,T):M},message:u,type:p,interpolate:h,normalize:f,values:fs(xn(),r,a)};return _}const m_=()=>"",Zo=e=>Wn(e);function g_(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Kv(...t),u=on(c.missingWarn)?c.missingWarn:e.missingWarn,d=on(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=on(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=mt(c.default)||on(c.default)?on(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(mt(p)||Wn(p)),_=S0(e,c);f&&ZN(c);let[k,g,v]=h?[a,_,l[_]||xn()]:SA(e,a,_,r,d,u),y=k,T=a;if(!h&&!(mt(y)||Ni(y)||Zo(y))&&m&&(y=p,T=y),!h&&(!(mt(y)||Ni(y)||Zo(y))||!mt(g)))return o?vh:a;let P=!1;const N=()=>{P=!0},b=Zo(y)?y:CA(e,a,g,y,T,N);if(P)return y;const M=t5(e,g,v,c),I=XN(M),L=JN(e,b,I);let S=s?s(L,a):L;if(f&&mt(S)&&(S=$6(S)),__INTLIFY_PROD_DEVTOOLS__){const E={timestamp:Date.now(),key:mt(a)?a:Zo(y)?y.key:"",locale:g||(Zo(y)?y.locale:""),format:mt(y)?y:Zo(y)?y.source:"",message:S};E.meta=fs({},e.__meta,HN()||{}),bN(E)}return S}function ZN(e){Zn(e.list)?e.list=e.list.map(t=>mt(t)?Jb(t):t):rn(e.named)&&Object.keys(e.named).forEach(t=>{mt(e.named[t])&&(e.named[t]=Jb(e.named[t]))})}function SA(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=xn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||xn(),(h=a(d,t))===null&&(h=d[t]),!(mt(h)||Ni(h)||Zo(h)));m++)if(!jN(f,u)){const _=C0(e,t,f,i,p);_!==t&&(h=_)}return[h,f,d]}function CA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Zo(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,e5(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function JN(e,t,n){return t(n)}function Kv(...e){const[t,n,s]=e,o=xn();if(!mt(t)&&!us(t)&&!Zo(t)&&!Ni(t))throw nr(tr.INVALID_ARGUMENT);const i=us(t)?String(t):(Zo(t),t);return us(n)?o.plural=n:mt(n)?o.default=n:Qt(n)&&!mh(n)?o.named=n:Zn(n)&&(o.list=n),us(s)?o.plural=s:mt(s)?o.default=s:Qt(s)&&fs(o,s),[i,o]}function e5(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>C6(t,n,r)}}function t5(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[_,,k]=SA(u||e,h,t,l,a,c);m=_??r(k,h)}if(mt(m)||Ni(m)){let _=!1;const g=CA(e,h,t,m,h,()=>{_=!0});return _?m_:g}else return Zo(m)?m:m_}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),us(s.plural)&&(f.pluralIndex=s.plural),f}lN();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const n5="11.4.5";function s5(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Rl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Rl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Rl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Rl().__INTLIFY_PROD_DEVTOOLS__=!1)}const no={UNEXPECTED_RETURN_TYPE:wN,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 yo(e,...t){return gh(e,null,void 0)}const Gv=il("__translateVNode"),Yv=il("__datetimeParts"),Qv=il("__numberParts"),xA=il("__setPluralRules"),AA=il("__injectWithOption"),Wa=il("__dispose");function Wu(e){if(!rn(e)||Ni(e))return e;for(const t in e)if(ti(e,t))if(!t.includes("."))rn(e[t])&&Wu(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]]=xn()),!rn(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Ni(o)?mA.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Ni(o)){const r=o[n[s]];rn(r)&&Wu(r)}}return e}function x0(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Qt(n)?n:Zn(s)?xn():{[e]:xn()};if(Zn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||xn(),Mf(c,r[a])):Mf(c,r)}else mt(l)&&Mf(JSON.parse(l),r)}),o==null&&i)for(const l in r)ti(r,l)&&Wu(r[l]);return r}function TA(e){return e.type}function MA(e,t,n){let s=rn(t.messages)?t.messages:xn();"__i18nGlobal"in n&&(s=x0(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(rn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(rn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function v_(e){return ie(Vr,null,e,0)}function zu(){return Rs()}const y_="__INTLIFY_META__",k_=()=>[],o5=()=>!1;let b_=0;function __(e){return((t,n,s,o)=>e(n,s,zu()||void 0,o))}const i5=()=>{const e=zu();let t=null;return e&&(t=TA(e)[y_])?{[y_]:t}:null};function hp(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=fp?J:ea;let r=on(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:mt(e.locale)?e.locale:Hu),a=i(t&&r?t.fallbackLocale.value:mt(e.fallbackLocale)||Zn(e.fallbackLocale)||Qt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(x0(l.value,e)),u=i(Qt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Qt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:on(e.missingWarn)||dc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:on(e.fallbackWarn)||dc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:on(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=Wn(e.missing)?e.missing:null,k=Wn(e.missing)?__(e.missing):null,g=Wn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const T=t?t.modifiers:Qt(e.modifiers)?e.modifiers:{};let P=e.pluralRules||t&&t.pluralRules,N;N=(()=>{s&&c_(null);const fe={version:n5,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:T,pluralRules:P,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};fe.datetimeFormats=u.value,fe.numberFormats=d.value,fe.__datetimeFormatters=Qt(N)?N.__datetimeFormatters:void 0,fe.__numberFormatters=Qt(N)?N.__numberFormatters:void 0;const Me=zN(fe);return s&&c_(Me),Me})(),Yc(N,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const I=B({get:()=>l.value,set:fe=>{N.locale=fe,l.value=fe}}),L=B({get:()=>a.value,set:fe=>{N.fallbackLocale=fe,a.value=fe,Yc(N,l.value,fe)}}),S=B(()=>c.value),E=B(()=>u.value),R=B(()=>d.value);function D(){return Wn(g)?g:null}function F(fe){g=fe,N.postTranslation=fe}function U(){return _}function G(fe){fe!==null&&(k=__(fe)),_=fe,N.missing=k}const Y=(fe,Me,Ge,lt,kt,bt)=>{M();let Et;try{__INTLIFY_PROD_DEVTOOLS__,s||(N.fallbackContext=t?WN():void 0),Et=fe(N)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(N.fallbackContext=void 0)}if(Ge!=="translate exists"&&us(Et)&&Et===vh||Ge==="translate exists"&&!Et){const[Rt,vt]=Me();return t&&p?lt(t):kt(Rt)}else{if(bt(Et))return Et;throw yo(no.UNEXPECTED_RETURN_TYPE)}};function q(...fe){return Y(Me=>Reflect.apply(g_,null,[Me,...fe]),()=>Kv(...fe),"translate",Me=>Reflect.apply(Me.t,Me,[...fe]),Me=>Me,Me=>mt(Me))}function ae(...fe){const[Me,Ge,lt]=fe;if(lt&&!rn(lt))throw yo(no.INVALID_ARGUMENT);return q(Me,Ge,fs({resolvedMessage:!0},lt||{}))}function de(...fe){return Y(Me=>Reflect.apply(d_,null,[Me,...fe]),()=>qv(...fe),"datetime format",Me=>Reflect.apply(Me.d,Me,[...fe]),()=>pp,Me=>mt(Me)||Zn(Me))}function ne(...fe){return Y(Me=>Reflect.apply(p_,null,[Me,...fe]),()=>Vv(...fe),"number format",Me=>Reflect.apply(Me.n,Me,[...fe]),()=>pp,Me=>mt(Me)||Zn(Me))}function X(fe){return fe.map(Me=>mt(Me)||us(Me)||on(Me)?v_(String(Me)):Me)}const Oe={normalize:X,interpolate:fe=>fe,type:"vnode"};function je(...fe){return Y(Me=>{let Ge;const lt=Me;try{lt.processor=Oe,Ge=Reflect.apply(g_,null,[lt,...fe])}finally{lt.processor=null}return Ge},()=>Kv(...fe),"translate",Me=>Me[Gv](...fe),Me=>[v_(Me)],Me=>Zn(Me))}function it(...fe){return Y(Me=>Reflect.apply(p_,null,[Me,...fe]),()=>Vv(...fe),"number format",Me=>Me[Qv](...fe),k_,Me=>mt(Me)||Zn(Me))}function ce(...fe){return Y(Me=>Reflect.apply(d_,null,[Me,...fe]),()=>qv(...fe),"datetime format",Me=>Me[Yv](...fe),k_,Me=>mt(Me)||Zn(Me))}function z(fe){P=fe,N.pluralRules=P}function Q(fe,Me){return Y(()=>{if(!fe)return!1;const Ge=mt(Me)?Me:l.value,lt=mt(Me)?[Ge]:jv(N,a.value,Ge);for(let kt=0;kt<lt.length;kt++){const bt=Z(lt[kt]);let Et=N.messageResolver(bt,fe);if(Et===null&&(Et=bt[fe]),Ni(Et)||Zo(Et)||mt(Et))return!0}return!1},()=>[fe],"translate exists",Ge=>Reflect.apply(Ge.te,Ge,[fe,Me]),o5,Ge=>on(Ge))}function oe(fe){let Me=null;const Ge=jv(N,a.value,l.value);for(let lt=0;lt<Ge.length;lt++){const kt=c.value[Ge[lt]]||{},bt=N.messageResolver(kt,fe);if(bt!=null){Me=bt;break}}return Me}function W(fe){const Me=oe(fe);return Me??(t?t.tm(fe)||{}:{})}function Z(fe){return c.value[fe]||{}}function ue(fe,Me){if(o){const Ge={[fe]:Me};for(const lt in Ge)ti(Ge,lt)&&Wu(Ge[lt]);Me=Ge[fe]}c.value[fe]=Me,N.messages=c.value}function le(fe,Me){c.value[fe]=c.value[fe]||{};const Ge={[fe]:Me};if(o)for(const lt in Ge)ti(Ge,lt)&&Wu(Ge[lt]);Me=Ge[fe],Mf(Me,c.value[fe]),N.messages=c.value}function me(fe){return u.value[fe]||{}}function j(fe,Me){u.value[fe]=Me,N.datetimeFormats=u.value,f_(N,fe,Me)}function ee(fe,Me){u.value[fe]=fs(u.value[fe]||{},Me),N.datetimeFormats=u.value,f_(N,fe,Me)}function pe(fe){return d.value[fe]||{}}function ke(fe,Me){d.value[fe]=Me,N.numberFormats=d.value,h_(N,fe,Me)}function Te(fe,Me){d.value[fe]=fs(d.value[fe]||{},Me),N.numberFormats=d.value,h_(N,fe,Me)}b_++,t&&fp&&(Ve(t.locale,fe=>{r&&(l.value=fe,N.locale=fe,Yc(N,l.value,a.value))}),Ve(t.fallbackLocale,fe=>{r&&(a.value=fe,N.fallbackLocale=fe,Yc(N,l.value,a.value))}));const Ie={id:b_,locale:I,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(fe){r=fe,fe&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Yc(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return T},get pluralRules(){return P||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(fe){f=fe,N.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(fe){h=fe,N.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(fe){p=fe},get fallbackFormat(){return m},set fallbackFormat(fe){m=fe,N.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(fe){v=fe,N.warnHtmlMessage=fe},get escapeParameter(){return y},set escapeParameter(fe){y=fe,N.escapeParameter=fe},t:q,getLocaleMessage:Z,setLocaleMessage:ue,mergeLocaleMessage:le,getPostTranslationHandler:D,setPostTranslationHandler:F,getMissingHandler:U,setMissingHandler:G,[xA]:z};return Ie.datetimeFormats=E,Ie.numberFormats=R,Ie.rt=ae,Ie.te=Q,Ie.tm=W,Ie.d=de,Ie.n=ne,Ie.getDateTimeFormat=me,Ie.setDateTimeFormat=j,Ie.mergeDateTimeFormat=ee,Ie.getNumberFormat=pe,Ie.setNumberFormat=ke,Ie.mergeNumberFormat=Te,Ie[AA]=n,Ie[Gv]=je,Ie[Yv]=ce,Ie[Qv]=it,Ie}function r5(e){const t=mt(e.locale)?e.locale:Hu,n=mt(e.fallbackLocale)||Zn(e.fallbackLocale)||Qt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Wn(e.missing)?e.missing:void 0,o=on(e.silentTranslationWarn)||dc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=on(e.silentFallbackWarn)||dc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=on(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Qt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Wn(e.postTranslation)?e.postTranslation:void 0,d=mt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=on(e.sync)?e.sync:!0;let p=e.messages;if(Qt(e.sharedMessages)){const T=e.sharedMessages;p=Object.keys(T).reduce((N,b)=>{const M=N[b]||(N[b]={});return fs(M,T[b]),N},p||{})}const{__i18n:m,__root:_,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:g,numberFormats:v,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:_,__injectWithOption:k}}function Xv(e={}){const t=hp(r5(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 on(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=on(o)?!o:o},get silentFallbackWarn(){return on(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=on(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 l5(e,t,n){return{beforeCreate(){const s=zu();if(!s)throw yo(no.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=w_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Xv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=w_(e,o);else{this.$i18n=Xv({__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&&MA(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=zu();if(!s)throw yo(no.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 w_(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[xA](t.pluralizationRules||e.pluralizationRules);const n=x0(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 A0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function a5({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Pe?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},xn())}function EA(){return Pe}const c5=qe({name:"i18n-t",props:fs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>us(e)||!isNaN(e)}},A0),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=xn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=mt(e.plural)?+e.plural:e.plural);const u=a5(t,a);return o[Gv](e.keypath,u,c)},r=fs(xn(),s),l=mt(e.tag)||rn(e.tag)?e.tag:EA();return rn(l)?mn(l,r,{default:i}):mn(l,r,i())}}}),S_=c5;function u5(e){return Zn(e)&&!mt(e[0])}function IA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=xn();e.locale&&(c.locale=e.locale),mt(e.format)?c.key=e.format:rn(e.format)&&(mt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?fs(xn(),h,{[p]:e.format[p]}):h,xn()));const d=s(e.value,c,u);let f=[c.key];return Zn(d)?f=d.map((h,p)=>{const m=o[h.type],_=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return u5(_)&&(_[0].key=`${h.type}-${p}`),_}):mt(d)&&(f=[d]),f},l=fs(xn(),i),a=mt(e.tag)||rn(e.tag)?e.tag:EA();return rn(a)?mn(a,l,{default:r}):mn(a,l,r())}}const d5=qe({name:"i18n-n",props:fs({value:{type:Number,required:!0},format:{type:[String,Object]}},A0),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return IA(e,t,wA,(...s)=>n[Qv](...s))}}),C_=d5;function f5(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 p5(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw yo(no.UNEXPECTED_ERROR);const c=f5(e,l.$),u=x_(a);return[Reflect.apply(c.t,c,[...A_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);fp&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{fp&&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=x_(l);r.textContent=Reflect.apply(a.t,a,[...A_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function x_(e){if(mt(e))return{path:e};if(Qt(e)){if(!("path"in e))throw yo(no.REQUIRED_VALUE,"path");return e}else throw yo(no.INVALID_VALUE)}function A_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return mt(n)&&(r.locale=n),us(o)&&(r.plural=o),us(i)&&(r.plural=i),[t,l,r]}function h5(e,t,...n){const s=Qt(n[0])?n[0]:{};(on(s.globalInstall)?s.globalInstall:!0)&&([S_.name,"I18nT"].forEach(i=>e.component(i,S_)),[C_.name,"I18nN"].forEach(i=>e.component(i,C_)),[E_.name,"I18nD"].forEach(i=>e.component(i,E_))),e.directive("t",p5(t))}const m5=il("global-vue-i18n");function g5(e={}){const t=__VUE_I18N_LEGACY_API__&&on(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=on(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=v5(e,t),r=il("");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),Qt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=C5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&h5(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(l5(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 Tt(e={}){const t=zu();if(t==null)throw yo(no.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw yo(no.NOT_INSTALLED);const n=y5(t),s=b5(n),o=TA(t),i=k5(e,o);if(i==="global")return MA(s,e,o),s;if(i==="parent"){let a=T_(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw yo(no.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=fs({},e),u=T_(n,t);c.__root=u||s;const d=hp(c);return a.__composerExtend&&(d[Wa]=a.__composerExtend(d)),Z1()&&J1(()=>{const h=d[Wa];h&&(h(),delete d[Wa])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=fs({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=hp(a),r.__composerExtend&&(l[Wa]=r.__composerExtend(l)),w5(r,t,l),r.__setInstance(t,l)}return l}function v5(e,t){const n=UE(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Xv(e)):n.run(()=>hp(e));if(s==null)throw yo(no.UNEXPECTED_ERROR);return[n,s]}function y5(e){const t=Ut(e.isCE?m5:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw yo(e.isCE?no.NOT_INSTALLED_WITH_PROVIDE:no.UNEXPECTED_ERROR);return t}function k5(e,t){return mh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function b5(e){return e.mode==="composition"?e.global:e.global.__composer}function T_(e,t,n=!1){let s=null;const o=t.root;let i=_5(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[AA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function _5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function w5(e,t,n){bn(()=>{},t),Tn(()=>{const s=n;e.__deleteInstance(t);const o=s[Wa];o&&(o(),delete s[Wa])},t)}const S5=["locale","fallbackLocale","availableLocales"],M_=["t","rt","d","n","tm","te"];function C5(e,t){const n=Object.create(null);return S5.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw yo(no.UNEXPECTED_ERROR);const r=ns(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,M_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw yo(no.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,M_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const x5=qe({name:"i18n-d",props:fs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},A0),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return IA(e,t,_A,(...s)=>n[Yv](...s))}}),E_=x5;s5();RN(vN);DN(LN);BN(jv);if(__INTLIFY_PROD_DEVTOOLS__){const e=Rl();e.__INTLIFY__=!0,yN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const A5="modulepreload",T5=function(e){return"/"+e},I_={},eo=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=T5(c),c in I_)return;I_[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":A5,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)})},$t={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",showWorkspacePaths:"kimi-web.show-workspace-paths",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function $_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function es(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ss(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function pc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function cd(e){const t=es(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function _c(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function T0(){const e=es($t.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 M0(e){const n={...T0()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ss($t.unread,JSON.stringify(n))}function M5(){const e=cd($t.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function lg(e){_c($t.collapsedWorkspaces,Array.from(e))}function E5(){return cd($t.showWorkspacePaths)===!0}function I5(e){_c($t.showWorkspacePaths,e)}function $5(){const e=cd($t.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function $A(e){_c($t.workspaceOrder,Array.from(e))}function nf(){const e=cd($t.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 N_(e){_c($t.workspaceNameOverrides,e)}function N5(){return es($t.workspaceSort)}function NA(e){ss($t.workspaceSort,e)}const L_=$t.clientId,L5="kimi-code-web",O5="web";function P5(){return{serverHttpUrl:D5(),clientId:W5(),clientName:L5,clientVersion:z5(),clientUiMode:O5}}function R5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function D5(e){const t=R5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function B5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function F5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return B5(e)}function mu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function H5(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 W5(){const e=es(L_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ss(L_,t),t}function z5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function js(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 U5(e)}function U5(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 j5(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 q5(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 V5(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 K5(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const G5={"&":"&","<":"<",">":">",'"':""","'":"'"};function O_(e){return e.replace(/[&<>"']/g,t=>G5[t]??t)}function Y5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q5(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 P_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return P_(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 P_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function ag(e,t){const n=O_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(Y5(O_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Oa=J(0),X5=["type","disabled","aria-label"],Z5=qe({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=J();return t({el:n}),(s,o)=>(w(),$("button",{ref_key:"el",ref:n,class:Re(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Ln(s.$slots,"default",{},void 0,!0)],10,X5))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Cn=dt(Z5,[["__scopeId","data-v-321e56e3"]]),J5=Object.freeze({left:0,top:0,width:16,height:16}),LA=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),OA=Object.freeze({...J5,...LA}),bge=Object.freeze({...OA,body:"",hidden:!1}),e8=Object.freeze({width:null,height:null}),t8=Object.freeze({...e8,...LA}),n8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,s8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function R_(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const s=e.split(n8);if(s===null||!s.length)return e;const o=[];let i=s.shift(),r=s8.test(i);for(;;){if(r){const l=parseFloat(i);isNaN(l)?o.push(i):o.push(Math.ceil(l*t*n)/n)}else o.push(i);if(i=s.shift(),i===void 0)return o.join("");r=!r}}function o8(e,t="defs"){let n="";const s=e.indexOf("<"+t);for(;s>=0;){const o=e.indexOf(">",s),i=e.indexOf("</"+t);if(o===-1||i===-1)break;const r=e.indexOf(">",i);if(r===-1)break;n+=e.slice(o+1,i).trim(),e=e.slice(0,s).trim()+e.slice(r+1)}return{defs:n,content:e}}function i8(e,t){return e?"<defs>"+e+"</defs>"+t:t}function r8(e,t,n){const s=o8(e);return i8(s.defs,t+s.content+n)}const l8=e=>e==="unset"||e==="undefined"||e==="none";function a8(e,t){const n={...OA,...e},s={...t8,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,s].forEach(m=>{const _=[],k=m.hFlip,g=m.vFlip;let v=m.rotate;k?g?v+=2:(_.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),_.push("scale(-1 1)"),o.top=o.left=0):g&&(_.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),_.push("scale(1 -1)"),o.top=o.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=o.height/2+o.top,_.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:_.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,_.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),_.length&&(i=r8(i,'<g transform="'+_.join(" ")+'">',"</g>"))});const r=s.width,l=s.height,a=o.width,c=o.height;let u,d;r===null?(d=l===null?"1em":l==="auto"?c:l,u=R_(d,a/c)):(u=r==="auto"?a:r,d=l===null?R_(u,c/a):l==="auto"?c:l);const f={},h=(m,_)=>{l8(_)||(f[m]=_.toString())};h("width",u),h("height",d);const p=[o.left,o.top,a,c];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:i}}const PA={plus:{body:'<path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/>',width:24,height:24},"chat-new":{body:'<path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/>',width:24,height:24},close:{body:'<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"/>',width:24,height:24},check:{body:'<path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/>',width:24,height:24},search:{body:'<path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/>',width:24,height:24},copy:{body:'<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"/>',width:24,height:24},link:{body:'<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"/>',width:24,height:24},"external-link":{body:'<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"/>',width:24,height:24},download:{body:'<path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/>',width:24,height:24},undo:{body:'<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"/>',width:24,height:24},send:{body:'<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"/>',width:24,height:24},image:{body:'<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"/>',width:24,height:24},settings:{body:'<path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},sliders:{body:'<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"/>',width:24,height:24},"log-in":{body:'<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"/>',width:24,height:24},"chevron-down":{body:'<path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/>',width:24,height:24},"chevron-right":{body:'<path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/>',width:24,height:24},"arrow-up":{body:'<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"/>',width:24,height:24},"arrow-down":{body:'<path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/>',width:24,height:24},"arrow-right":{body:'<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"/>',width:24,height:24},minus:{body:'<path fill="currentColor" d="M5 11v2h14v-2z"/>',width:24,height:24},"panel-collapse":{body:'<path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/>',width:24,height:24},"panel-expand":{body:'<path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/>',width:24,height:24},expand:{body:'<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"/>',width:24,height:24},collapse:{body:'<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"/>',width:24,height:24},list:{body:'<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"/>',width:24,height:24},sort:{body:'<path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/>',width:24,height:24},grip:{body:'<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"/>',width:24,height:24},folder:{body:'<path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/>',width:24,height:24},"folder-closed":{body:'<path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/>',width:24,height:24},"folder-plus":{body:'<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"/>',width:24,height:24},"folder-solid":{body:'<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"/>',width:24,height:24},file:{body:'<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"/>',width:24,height:24},"file-text":{body:'<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"/>',width:24,height:24},"file-plus":{body:'<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"/>',width:24,height:24},"file-off":{body:'<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"/>',width:24,height:24},"image-off":{body:'<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"/>',width:24,height:24},code:{body:'<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"/>',width:24,height:24},terminal:{body:'<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"/>',width:24,height:24},pencil:{body:'<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"/>',width:24,height:24},tool:{body:'<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"/>',width:24,height:24},glob:{body:'<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"/>',width:24,height:24},globe:{body:'<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"/>',width:24,height:24},"check-list":{body:'<path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},bolt:{body:'<path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/>',width:24,height:24},"git-pull-request":{body:'<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"/>',width:24,height:24},message:{body:'<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"/>',width:24,height:24},mail:{body:'<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"/>',width:24,height:24},user:{body:'<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"/>',width:24,height:24},info:{body:'<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"/>',width:24,height:24},"help-circle":{body:'<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"/>',width:24,height:24},"alert-triangle":{body:'<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"/>',width:24,height:24},clock:{body:'<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"/>',width:24,height:24},sparkles:{body:'<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"/>',width:24,height:24},play:{body:'<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"/>',width:24,height:24},stop:{body:'<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"/>',width:24,height:24},star:{body:'<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"/>',width:24,height:24},"star-outline":{body:'<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"/>',width:24,height:24},"dots-horizontal":{body:'<path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/>',width:24,height:24}},RA={sm:14,md:16,lg:20};function c8(e){return`0 0 ${e.width??24} ${e.height??24}`}const u8=Object.fromEntries(Object.entries(PA).map(([e,t])=>[e,{body:t.body,viewBox:c8(t),fill:!0}]));function d8(e){return u8[e]}function Pa(e,t="md"){const n=RA[t],s=a8(PA[e],{width:n,height:n}),o=s.attributes.viewBox;return`<svg class="kw-icon" width="${n}" height="${n}" viewBox="${o}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${s.body}</svg>`}const f8=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],p8=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Xe=qe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=B(()=>d8(t.name)),s=B(()=>RA[t.size]),o=B(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),$("svg",{key:0,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"currentColor","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,f8)):(w(),$("svg",{key:1,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,p8))}}),h8={key:0,class:"ui-dialog__head"},m8={class:"ui-dialog__titles"},g8={key:0,class:"ui-dialog__title"},v8={key:1,class:"ui-dialog__desc"},y8={class:"ui-dialog__body"},k8={key:1,class:"ui-dialog__foot"},b8='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',_8=qe({__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}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=J(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(b8)):[]}function a(u){if(!n.open)return;if(u.key==="Escape"&&n.closeOnEsc){u.preventDefault(),r();return}if(u.key!=="Tab")return;const d=l(),f=d[0],h=d[d.length-1];if(!f||!h){u.preventDefault(),o.value?.focus();return}const p=document.activeElement;u.shiftKey&&p===f?(u.preventDefault(),h.focus()):!u.shiftKey&&p===h&&(u.preventDefault(),f.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ve(()=>n.open,async u=>{u?(Oa.value+=1,i=document.activeElement,await gt(),(l()[0]??o.value)?.focus()):(Oa.value=Math.max(0,Oa.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),ds(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Oa.value=Math.max(0,Oa.value-1))}),(u,d)=>(w(),ye(dh,{to:"body"},[e.open?(w(),$("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[x("div",{ref_key:"panel",ref:o,class:Re(["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||u.$slots.head?(w(),$("div",h8,[Ln(u.$slots,"head",{},()=>[x("div",m8,[e.title?(w(),$("div",g8,O(e.title),1)):re("",!0),e.description?(w(),$("div",v8,O(e.description),1)):re("",!0)])],!0),ie(Cn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:_e(()=>[ie(Xe,{name:"close",size:"md"})]),_:1})])):re("",!0),x("div",y8,[Ln(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),$("div",k8,[Ln(u.$slots,"foot",{},void 0,!0)])):re("",!0)],2)],32)):re("",!0)]))}}),pr=dt(_8,[["__scopeId","data-v-7904ff48"]]),w8={class:"sd-head"},S8=["placeholder","aria-label"],C8=["aria-selected","onClick","onMousemove"],x8={class:"sd-meta"},A8=["innerHTML"],T8={class:"sd-time"},M8=["innerHTML"],E8=["innerHTML"],I8={key:1,class:"sd-empty"},$8={class:"sd-hint"},N8=200,L8=qe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=J(!0),r=J(""),l=J(null),a=J(null),c=B(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",T=v.lastPrompt??"",P=v.workspaceName??"",N=k.length>0&&y.toLowerCase().includes(k),b=k.length>0&&T.toLowerCase().includes(k),M=k.length>0&&P.toLowerCase().includes(k);if(!(k.length>0&&!N&&!b&&!M)&&(g.push({session:v,inTitle:N,inWorkspace:M,snippetText:T?Q5(T,r.value):""}),g.length>=N8))break}return g}),u=J(0);Ve(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(k){u.value=d(u.value+k),f()}function p(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&p(k.session.id)}function _(k){k.key==="ArrowDown"?(k.preventDefault(),h(1)):k.key==="ArrowUp"?(k.preventDefault(),h(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return bn(()=>{l.value?.focus()}),(k,g)=>(w(),ye(pr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:_e(()=>[x("div",w8,[ie(Xe,{class:"sd-search-icon",name:"search",size:"md"}),Sn(x("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_},null,40,S8),[[ao,r.value]])])]),foot:_e(()=>[x("span",$8,O(C(n)("sidebar.searchHint")),1)]),default:_e(()=>[x("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),$(Pe,{key:0},tt(c.value,(v,y)=>(w(),$("button",{key:v.session.id,class:Re(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:T=>p(v.session.id),onMousemove:T=>u.value=y},[x("span",x8,[ie(Xe,{class:"sd-folder",name:"folder-closed",size:"sm"}),x("span",{class:"sd-ws",innerHTML:C(ag)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,A8),x("span",T8,O(v.session.time),1)]),x("span",{class:"sd-title",innerHTML:C(ag)(v.session.title,v.inTitle?r.value:"")},null,8,M8),v.snippetText?(w(),$("span",{key:0,class:"sd-snippet",innerHTML:C(ag)(v.snippetText,r.value)},null,8,E8)):re("",!0)],42,C8))),128)):(w(),$("div",I8,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),O8=dt(L8,[["__scopeId","data-v-a678f802"]]),P8=["aria-label"],R8=qe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),$("span",{class:Re(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[x("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[x("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),x("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,P8))}}),ri=dt(R8,[["__scopeId","data-v-e5c5b17d"]]),D8={key:0,class:"ui-badge__dot","aria-hidden":"true"},B8=qe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),$("span",{class:Re(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),$("span",D8)):re("",!0),Ln(t.$slots,"default",{},void 0,!0)],2))}}),Ls=dt(B8,[["__scopeId","data-v-5bc5cd6d"]]),Uu=J(null);function DA(e){const t=Uu.value;t&&(Uu.value=null,t.resolve(e))}function F8(e){return Uu.value&&DA(!1),new Promise(t=>{Uu.value={...e,resolve:t}})}function al(){return{current:Uu,confirm:F8,settle:DA}}const H8=qe({__name:"Menu",setup(e,{expose:t}){const n=J();return t({el:n}),(s,o)=>(w(),$("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Ln(s.$slots,"default",{},void 0,!0)],512))}}),zl=dt(H8,[["__scopeId","data-v-60e6cd8d"]]),W8={key:0,class:"ui-menu-sep",role:"separator"},z8=["disabled"],U8=qe({__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?(w(),$("div",W8)):(w(),$("button",{key:1,class:Re(["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))},[Ln(t.$slots,"default",{},void 0,!0)],10,z8))}}),yn=dt(U8,[["__scopeId","data-v-eab8e277"]]),xr=6,Ar=8,j8=150,q8=qe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=J(),s=J(),o=J(!1),i=J(!1),r=J({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const _=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let T=t.placement;T==="top"&&_.top-xr-g<Ar?T="bottom":T==="bottom"&&_.bottom+xr+g>y-Ar?T="top":T==="left"&&_.left-xr-k<Ar?T="right":T==="right"&&_.right+xr+k>v-Ar&&(T="left");let P=0,N=0;T==="top"?(P=_.top-xr-g,N=_.left+_.width/2-k/2):T==="bottom"?(P=_.bottom+xr,N=_.left+_.width/2-k/2):T==="left"?(P=_.top+_.height/2-g/2,N=_.left-xr-k):(P=_.top+_.height/2-g/2,N=_.right+xr),N=Math.min(Math.max(N,Ar),v-Ar-k),P=Math.min(Math.max(P,Ar),y-Ar-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(P)}px`,left:`${Math.round(N)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},j8))}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 bn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const _=m.firstElementChild??null;_!==a&&(f(),p(_??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ds(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,_)=>(w(),$(Pe,null,[x("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Ln(m.$slots,"default",{},void 0,!0)],512),(w(),ye(dh,{to:"body"},[Sn(x("div",{ref_key:"bubble",ref:s,class:Re(["ui-tip__bubble",{positioned:i.value}]),style:Xt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[$o,o.value]])]))],64))}}),jt=dt(q8,[["__scopeId","data-v-4c261eb6"]]),V8={class:"row"},K8={class:"lead","aria-hidden":"true"},G8={key:1,class:"unread-dot"},Y8={class:"left"},Q8=["onKeydown"],X8={class:"act"},Z8={class:"ts"},J8={class:"menu-time"},eL=qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=Tt(),{confirm:o}=al(),i=e,r=n;function l(S){const E=new Date(S);if(Number.isNaN(E.getTime()))return S;const R=D=>String(D).padStart(2,"0");return`${E.getFullYear()}-${R(E.getMonth()+1)}-${R(E.getDate())} ${R(E.getHours())}:${R(E.getMinutes())}`}const a=B(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=J(!1),u=J(null),d=J(null),f=J({});function h(S){const E=S.target;d.value?.el?.contains(E)||u.value?.el?.contains(E)||_()}function p(){const S=u.value?.el;if(!S)return;const E=d.value?.el,R=S.getBoundingClientRect(),D=4,F=8,U=E?.offsetHeight??0,G=E?.offsetWidth??0;let Y=R.bottom+D;Y+U>window.innerHeight-F&&(Y=Math.max(F,R.top-U-D));let q=R.right-G;q<F&&(q=F),f.value={top:`${Math.round(Y)}px`,left:`${Math.round(q)}px`}}async function m(S){if(S.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",_),await gt(),p()}function _(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",_)}Tn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",_)});const k=J(!1),g=J(""),v=J(null);async function y(){_(),k.value=!0,g.value=i.session.title,await gt();try{v.value?.focus(),v.value?.select()}catch{}}function T(){const S=g.value.trim();S&&r("rename",i.session.id,S),k.value=!1}function P(){k.value=!1}const N=J(!1),b=J(!1);async function M(){const S=await js(i.session.id);N.value=S,b.value=!S,setTimeout(()=>{N.value=!1,b.value=!1,_()},1500)}function I(){_(),r("fork",i.session.id)}async function L(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(S,E)=>(w(),$("div",{class:Re(["se",{on:e.active}]),onClick:E[4]||(E[4]=R=>r("select",e.session.id))},[x("div",V8,[x("span",K8,[e.session.busy?(w(),ye(ri,{key:0,size:"sm"})):e.unread?(w(),$("span",G8)):re("",!0)]),x("div",Y8,[k.value?Sn((w(),$("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":E[0]||(E[0]=R=>g.value=R),class:"rename-input",onClick:E[1]||(E[1]=yt(()=>{},["stop"])),onKeydown:[mi(yt(T,["stop"]),["enter"]),mi(yt(P,["stop"]),["esc"])],onBlur:T},null,40,Q8)),[[ao,g.value]]):(w(),$("span",{key:1,class:"t",onDblclick:yt(y,["stop"])},O(e.session.title),33))]),ie(jt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:_e(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ye(Ls,{key:0,variant:"info",size:"sm"},{default:_e(()=>[Ue(O(C(s)("workspace.awaitingAnswer")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:_e(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ye(Ls,{key:0,variant:"warning",size:"sm"},{default:_e(()=>[Ue(O(C(s)("workspace.awaitingPermission")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(jt,{text:C(s)("workspace.abortedTitle")},{default:_e(()=>[!k.value&&e.session.status==="aborted"?(w(),ye(Ls,{key:0,variant:"danger",size:"sm"},{default:_e(()=>[Ue(O(C(s)("workspace.aborted")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),x("span",X8,[x("span",Z8,O(e.session.time),1),k.value?re("",!0):(w(),ye(Cn,{key:0,ref_key:"kebabRef",ref:u,class:Re(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:E[2]||(E[2]=yt(R=>m(R),["stop"]))},{default:_e(()=>[ie(Xe,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ye(dh,{to:"body"},[c.value?(w(),ye(zl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Xt(f.value),onClick:E[3]||(E[3]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{danger:b.value,onClick:M},{default:_e(()=>[Ue(O(b.value?C(s)("sidebar.copyFailed"):N.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(yn,{separator:""}),ie(yn,{onClick:y},{default:_e(()=>[Ue(O(C(s)("sidebar.rename")),1)]),_:1}),ie(yn,{onClick:I},{default:_e(()=>[Ue(O(C(s)("sidebar.fork")),1)]),_:1}),ie(yn,{danger:"",onClick:L},{default:_e(()=>[Ue(O(C(s)("sidebar.archive")),1)]),_:1}),ie(yn,{separator:""}),x("div",J8,O(a.value),1)]),_:1},8,["style"])):re("",!0)]))],2))}}),tL=dt(eL,[["__scopeId","data-v-08103df8"]]),nL={class:"gh-top"},sL={key:2,class:"gh-name"},oL={class:"gh-path"},iL=["inert"],rL=["disabled"],lL={class:"show-more-label"},aL={class:"show-more-label"},cL={key:2,class:"group-empty"},uL=qe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=B({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=B(()=>{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=B(()=>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)=>(w(),$("div",{class:Re(["group",{dragging:e.dragging}])},[x("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:h[7]||(h[7]=yt(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"))},[x("div",nL,[e.isCollapsed(e.group.workspace.id)?(w(),ye(Xe,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ye(Xe,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),$("span",sL,O(e.group.workspace.name),1)):Sn((w(),$("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]=mi(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=mi(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=yt(()=>{},["stop"]))},null,544)),[[ao,i.value]]),ie(Cn,{class:Re(["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]=yt(p=>o("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:_e(()=>[ie(Xe,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),ie(Cn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=yt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:_e(()=>[ie(Xe,{name:"chat-new"})]),_:1},8,["label"])]),ie(jt,{text:e.group.workspace.root},{default:_e(()=>[x("div",oL,O(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),x("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),$(Pe,null,tt(r.value,p=>(w(),ye(tL,{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,_)=>o("renameSession",m,_)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),$("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[14]||(h[14]=yt(p=>o("loadMore",e.group.workspace.id),["stop"]))},[h[16]||(h[16]=x("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),x("span",lL,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,rL)):re("",!0),l.value?(w(),$("button",{key:1,class:"show-more",onClick:h[15]||(h[15]=yt(p=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=x("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),x("span",aL,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):re("",!0),e.group.sessions.length===0?(w(),$("div",cL,O(C(n)("sidebar.noSessions")),1)):re("",!0)],10,iL)],2))}}),dL=dt(uL,[["__scopeId","data-v-fd1b0444"]]),fL="kimi_desktop",pL="platform",D_="kimi-desktop",B_="kimi-desktop-platform";function hL(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(fL)?(sessionStorage.setItem(D_,"1"),e=!0):e=e||sessionStorage.getItem(D_)==="1";const s=n.get(pL);s?(sessionStorage.setItem(B_,s),t=s):t=sessionStorage.getItem(B_)}catch{}return{isDesktop:e,platform:t}}const Zv=hL(),mL=Zv.isDesktop,BA=Zv.isDesktop&&Zv.platform==="darwin",gL=["aria-label"],vL=qe({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=mL;return(s,o)=>C(n)?(w(),$("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=x("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"},[x("path",{d:"M8 2 14 13H2L8 2Z"}),x("path",{d:"M8 6v3.5"}),x("path",{d:"M8 11.5h.01"})],-1)),x("span",null,O(C(t)("app.internalBuildBanner")),1)],8,gL)):re("",!0)}}),yL=dt(vL,[["__scopeId","data-v-b5e70a09"]]),kL={class:"ch"},bL={class:"ch-brand"},_L={class:"ch-name"},wL={key:0,class:"ch-endpoint"},SL={class:"search-input"},CL={key:0,class:"empty"},xL={class:"side-section-label"},AL={class:"side-section-title"},TL={class:"side-section-actions"},ML=["onDragover","onDrop"],EL={class:"section-menu-check"},IL={class:"section-menu-check"},$L={class:"section-menu-check"},NL=1e3,LL=qe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=al(),o=!1,i="",r=e,l=t,a=J(!1),c=f()?"⌘K":"Ctrl K";function u(){l("loadAllSessions"),a.value=!0}function d(Ke){(Ke.metaKey||Ke.ctrlKey)&&Ke.key.toLowerCase()==="k"&&(Ke.preventDefault(),u())}bn(()=>window.addEventListener("keydown",d)),ds(()=>window.removeEventListener("keydown",d));function f(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Ke=navigator.userAgentData;return Ke?.platform==="macOS"||Ke?.platform==="iOS"}const h=J(!1);function p(Ke){h.value=Ke.target.scrollTop>0}const m=J(new Set(M5()));function _(Ke){return m.value.has(Ke)}function k(Ke){const Qe=new Set(m.value);Qe.has(Ke)?Qe.delete(Ke):Qe.add(Ke),m.value=Qe,lg(Qe)}function g(){const Ke=new Set(r.groups.map(Qe=>Qe.workspace.id));m.value=Ke,lg(Ke)}function v(){const Ke=new Set;m.value=Ke,lg(Ke)}const y=B(()=>r.groups.length>0&&r.groups.every(Ke=>m.value.has(Ke.workspace.id))),T=J(new Set);function P(Ke){return T.value.has(Ke)}function N(Ke){const Qe=new Set(T.value);Qe.has(Ke)?Qe.delete(Ke):Qe.add(Ke),T.value=Qe}function b(Ke){if(!T.value.has(Ke)){const Qe=new Set(T.value);Qe.add(Ke),T.value=Qe}l("loadMoreSessions",Ke)}const M=J(E5());function I(){M.value=!M.value,I5(M.value)}const L=J(null),S=J(null);function E(Ke){L.value=Ke}function R(){L.value=null,S.value=null}function D(Ke){const Qe=Ke.currentTarget.getBoundingClientRect();return Ke.clientY<Qe.top+Qe.height/2?"before":"after"}function F(Ke,Qe){L.value===null||L.value===Qe||(Ke.preventDefault(),Ke.dataTransfer&&(Ke.dataTransfer.dropEffect="move"),S.value={id:Qe,position:D(Ke)})}function U(Ke){const Qe=L.value,Dt=S.value?.id===Ke?S.value.position:"before";if(S.value=null,L.value=null,!Qe||Qe===Ke)return;const tn=V5(r.groups.map(ln=>ln.workspace.id),Qe,Ke,Dt);l("reorderWorkspaces",tn)}function G(Ke,Qe){Qe.target.closest(".gh-more, .gh-add")||k(Ke)}function Y(Ke){l("select",Ke)}const q=J(null),ae=J(""),de=J(null);function ne(){return de}function X(Ke,Qe){q.value=Ke,ae.value=Qe,gt().then(()=>de.value?.focus())}function he(){const Ke=q.value,Qe=ae.value.trim();Ke&&Qe&&l("renameWorkspace",Ke,Qe),q.value=null}function Oe(){q.value=null}function je(Ke){ae.value=Ke}const it=J(!1),ce=J(null),z=J({}),Q=J(null);function oe(Ke){Q.value?.el&&!Q.value.el.contains(Ke.target)&&Z()}function W(Ke,Qe){Qe.preventDefault(),Qe.stopPropagation(),ce.value=Ke,z.value={top:`${Qe.clientY}px`,left:`${Qe.clientX}px`},it.value=!0,document.addEventListener("mousedown",oe,!0)}function Z(){it.value=!1,document.removeEventListener("mousedown",oe,!0),ce.value=null}function ue(){ce.value&&js(ce.value.root),Z()}function le(){ce.value&&X(ce.value.id,ce.value.name),Z()}async function me(){const Ke=ce.value;Ke&&(Z(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ke.name}),variant:"danger"})&&l("deleteWorkspace",Ke.id))}const j=J(null),ee=J(null),pe=J({}),ke=J(null);function Te(Ke){const Qe=Ke.target;Qe.closest(".gh-more")||Qe.closest(".ws-menu")||fe()}async function Ie(Ke,Qe){if(j.value===Ke.id){fe();return}const Dt=Qe.currentTarget;ee.value=Ke,j.value=Ke.id,document.addEventListener("mousedown",Te),window.addEventListener("resize",fe),await gt();const tn=ke.value?.el,ln=Dt.getBoundingClientRect(),Zt=4,_n=8,xt=tn?.offsetHeight??0,Yn=tn?.offsetWidth??0;let Wt=ln.bottom+Zt;Wt+xt>window.innerHeight-_n&&(Wt=Math.max(_n,ln.top-xt-Zt));let ys=ln.right-Yn;ys<_n&&(ys=_n),pe.value={top:`${Math.round(Wt)}px`,left:`${Math.round(ys)}px`}}function fe(){j.value=null,ee.value=null,document.removeEventListener("mousedown",Te),window.removeEventListener("resize",fe)}function Me(Ke){js(Ke.root),fe()}function Ge(Ke){X(Ke.id,Ke.name),fe()}async function lt(Ke){fe(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ke.name}),variant:"danger"})&&l("deleteWorkspace",Ke.id)}const kt=J(!1),bt=J({}),Et=J(null);function Rt(Ke){const Qe=Ke.target;Qe.closest(".side-section-kebab")||Qe.closest(".section-menu")||qt()}async function vt(Ke){if(kt.value){qt();return}const Qe=Ke.currentTarget;kt.value=!0,document.addEventListener("mousedown",Rt),window.addEventListener("resize",qt),await gt();const Dt=Et.value?.el,tn=Qe.getBoundingClientRect(),ln=4,Zt=8,_n=Dt?.offsetHeight??0,xt=Dt?.offsetWidth??0;let Yn=tn.bottom+ln;Yn+_n>window.innerHeight-Zt&&(Yn=Math.max(Zt,tn.top-_n-ln));let Wt=tn.right-xt;Wt<Zt&&(Wt=Zt),bt.value={top:`${Math.round(Yn)}px`,left:`${Math.round(Wt)}px`}}function qt(){kt.value=!1,document.removeEventListener("mousedown",Rt),window.removeEventListener("resize",qt)}function dn(Ke){l("setWorkspaceSortMode",Ke),qt()}function os(){I(),qt()}ds(()=>{document.removeEventListener("mousedown",oe,!0),document.removeEventListener("mousedown",Te),document.removeEventListener("mousedown",Rt),window.removeEventListener("resize",fe),window.removeEventListener("resize",qt)});const Vt=J(null);let fn;function Ds(){const Ke=Vt.value;Ke&&(Ke.classList.remove("blink-now"),Ke.getBoundingClientRect(),Ke.classList.add("blink-now"),clearTimeout(fn),fn=setTimeout(()=>Ke.classList.remove("blink-now"),300))}const nt=hi(()=>eo(()=>import("./DesignSystemView-Bm5-sKT3.js"),__vite__mapDeps([0,1]))),Dn=J(!1);let is,Vn=!1;function Kn(Ke){Vn=!1,clearTimeout(is),Ke.currentTarget.setPointerCapture?.(Ke.pointerId),is=setTimeout(()=>{Vn=!0,Dn.value=!0},NL)}function Yt(Ke){clearTimeout(is);const Qe=Ke.currentTarget;Qe.hasPointerCapture?.(Ke.pointerId)&&Qe.releasePointerCapture(Ke.pointerId)}function Gn(){if(Vn){Vn=!1;return}Ds()}return ds(()=>{clearTimeout(is)}),(Ke,Qe)=>(w(),$("aside",{class:Re(["side",{"macos-desktop":C(BA)}])},[x("div",{class:"col",style:Xt({width:e.colWidth+"px"})},[x("div",kL,[x("div",bL,[(w(),$("svg",{ref_key:"logoRef",ref:Vt,class:Re(["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:Gn,onPointerdown:Kn,onPointerup:Yt,onPointercancel:Yt},[...Qe[21]||(Qe[21]=[m0('<defs data-v-23df25c5><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-23df25c5><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-23df25c5></rect><g class="ch-eyes" fill="#000" data-v-23df25c5><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-23df25c5></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-23df25c5></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-23df25c5></rect>',2)])],34)),x("span",_L,[Qe[22]||(Qe[22]=Ue("Kimi Code",-1)),C(o)?(w(),$("span",wL," · "+O(C(i)),1)):re("",!0)]),ie(yL)]),ie(Cn,{size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Qe[0]||(Qe[0]=yt(Dt=>l("collapse"),["stop"]))},{default:_e(()=>[ie(Xe,{name:"panel-collapse"})]),_:1},8,["label"]),ie(Cn,{size:"sm",label:C(n)("settings.title"),onClick:Qe[1]||(Qe[1]=yt(Dt=>l("openSettings"),["stop"]))},{default:_e(()=>[ie(Xe,{name:"settings"})]),_:1},8,["label"])]),x("button",{class:"search",type:"button",onClick:u},[ie(Xe,{class:"search-icon",name:"search"}),x("span",SL,O(C(n)("sidebar.searchShortcut",{shortcut:C(c)})),1)]),x("div",{class:Re(["btn-wrap",{"btn-wrap--scrolled":h.value}])},[x("button",{class:"btn-new-chat",type:"button",onClick:Qe[2]||(Qe[2]=yt(Dt=>l("create"),["stop"]))},[ie(Xe,{name:"chat-new"}),x("span",null,O(C(n)("sidebar.newChat")),1)]),re("",!0)],2),x("div",{class:"sessions",onScroll:p},[e.groups.length===0?(w(),$("div",CL,O(C(n)("workspace.noWorkspace")),1)):(w(),$(Pe,{key:1},[x("div",xL,[x("span",AL,O(C(n)("sidebar.workspaces")),1),x("div",TL,[ie(Cn,{class:"side-section-toggle",size:"sm",label:y.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Qe[4]||(Qe[4]=yt(Dt=>y.value?v():g(),["stop"]))},{default:_e(()=>[y.value?(w(),ye(Xe,{key:0,name:"expand"})):(w(),ye(Xe,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Cn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":kt.value,onClick:Qe[5]||(Qe[5]=yt(Dt=>vt(Dt),["stop"]))},{default:_e(()=>[ie(Xe,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),$(Pe,null,tt(e.groups,Dt=>(w(),$("div",{key:Dt.workspace.id,class:Re(["ws-drop-target",{"drop-before":S.value?.id===Dt.workspace.id&&S.value.position==="before","drop-after":S.value?.id===Dt.workspace.id&&S.value.position==="after"}]),onDragover:tn=>F(tn,Dt.workspace.id),onDrop:tn=>U(Dt.workspace.id)},[ie(dL,{group:Dt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":ae.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":j.value,dragging:L.value===Dt.workspace.id,"is-collapsed":_,"is-expanded":P,"show-path":M.value,onGroupClick:G,onGroupContextmenu:W,onToggleWsMenu:Ie,onCreateInWorkspace:Qe[6]||(Qe[6]=tn=>l("createInWorkspace",tn)),onSelectSession:Y,onRenameSession:Qe[7]||(Qe[7]=(tn,ln)=>l("rename",tn,ln)),onArchiveSession:Qe[8]||(Qe[8]=tn=>l("archive",tn)),onForkSession:Qe[9]||(Qe[9]=tn=>l("fork",tn)),onLoadMore:b,onToggleExpand:N,onConfirmRename:he,onCancelRename:Oe,onUpdateRenameValue:je,onWsDragstart:E,onWsDragend:R},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,ML))),128))],64))],32)],4),it.value?(w(),ye(zl,{key:0,ref_key:"ghMenuRef",ref:Q,class:"gh-menu",style:Xt(z.value),onClick:Qe[10]||(Qe[10]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{onClick:ue},{default:_e(()=>[Ue(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(yn,{onClick:le},{default:_e(()=>[Ue(O(C(n)("sidebar.rename")),1)]),_:1}),ie(yn,{danger:"",onClick:me},{default:_e(()=>[Ue(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),j.value!==null&&ee.value?(w(),ye(zl,{key:1,ref_key:"wsMenuRef",ref:ke,class:"ws-menu",style:Xt(pe.value),onClick:Qe[14]||(Qe[14]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{onClick:Qe[11]||(Qe[11]=Dt=>Me(ee.value))},{default:_e(()=>[Ue(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(yn,{separator:""}),ie(yn,{onClick:Qe[12]||(Qe[12]=Dt=>Ge(ee.value))},{default:_e(()=>[Ue(O(C(n)("sidebar.rename")),1)]),_:1}),ie(yn,{separator:""}),ie(yn,{danger:"",onClick:Qe[13]||(Qe[13]=Dt=>lt(ee.value))},{default:_e(()=>[Ue(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),kt.value?(w(),ye(zl,{key:2,ref_key:"sectionMenuRef",ref:Et,class:"section-menu",style:Xt(bt.value),onClick:Qe[18]||(Qe[18]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{onClick:Qe[15]||(Qe[15]=Dt=>dn("manual"))},{default:_e(()=>[x("span",EL,[e.workspaceSortMode==="manual"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),Ue(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),ie(yn,{onClick:Qe[16]||(Qe[16]=Dt=>dn("recent"))},{default:_e(()=>[x("span",IL,[e.workspaceSortMode==="recent"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),Ue(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1}),ie(yn,{separator:""}),ie(yn,{onClick:Qe[17]||(Qe[17]=Dt=>os())},{default:_e(()=>[x("span",$L,[M.value?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),Ue(" "+O(C(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):re("",!0),a.value?(w(),ye(O8,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:Y,onClose:Qe[19]||(Qe[19]=Dt=>a.value=!1)},null,8,["sessions","active-id"])):re("",!0),(w(),ye(dh,{to:"body"},[Dn.value?(w(),ye(C(nt),{key:0,onClose:Qe[20]||(Qe[20]=Dt=>Dn.value=!1)})):re("",!0)]))],2))}}),OL=dt(LL,[["__scopeId","data-v-23df25c5"]]);function PL(e){try{const t=es(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function RL(e,t){try{ss(e,String(t))}catch{}}function DL(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(GC(o),Math.max(s,Math.round(k))):n}const l=J(r(PL(t)??n)),a=J(!1);function c(k){const g=r(k);l.value=g,RL(t,g)}let u=0,d=0,f=null,h=-1;function p(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function _(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,h=k.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 ds(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const BL=["aria-label"],FL=qe({__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}=Tt(),{width:i,dragging:r,onPointerDown:l}=DL({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ve(i,a=>s("update:width",a)),Ve(r,a=>s("update:dragging",a)),(a,c)=>(w(),$("div",{class:Re(["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]=[x("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,BL))}}),F_=dt(FL,[["__scopeId","data-v-ad762f1c"]]),HL={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},WL={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",internalBuildBanner:"Internal testing only"},zL={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions ({shortcut})",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},UL={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},jL={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},qL={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},VL={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},KL={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"},GL={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"},YL={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"},QL={justNow:"just now"},XL={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"},ZL={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},JL={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"},eO={panelTitle:"Thinking",close:"Close"},tO={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"},nO={},sO={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"}},oO={searching:"Searching…",noMatch:"No matches"},iO={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."}},rO={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},lO={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},aO={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},cO={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"},uO={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},dO={preview:"预览",confirm:"确认",cancel:"取消"},fO={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},pO={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 ({shortcut})",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},hO={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},mO={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},gO={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},vO={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},yO={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 后重试"},kO={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 关闭"},bO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},_O={justNow:"刚刚"},wO={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:"拒绝并退出"},SO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},CO={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:"展开"},xO={panelTitle:"思考过程",close:"关闭"},AO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},TO={},MO={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:"无法读取这个文件"}},EO={searching:"搜索中…",noMatch:"无匹配"},IO={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:"目标描述太长了,请精简后重试。"}},$O={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},NO={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},LO={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},OO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},PO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},RO={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"},DO={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},BO={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},FO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},HO={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive"},WO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},zO={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"},UO={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},jO={en:{common:HL,app:WL,sidebar:zL,workspace:UL,conversation:jL,status:qL,composer:VL,login:KL,providers:GL,model:YL,sessions:QL,approval:XL,question:ZL,tasks:JL,thinking:eO,diff:tO,fileTree:nO,filePreview:sO,mention:oO,warnings:iO,commands:rO,tools:lO,layout:aO,mobile:cO,theme:uO,onboarding:RO,settings:BO,header:HO,sideChat:zO},zh:{common:dO,app:fO,sidebar:pO,workspace:hO,conversation:mO,status:gO,composer:vO,login:yO,providers:kO,model:bO,sessions:_O,approval:wO,question:SO,tasks:CO,thinking:xO,diff:AO,fileTree:TO,filePreview:MO,mention:EO,warnings:IO,commands:$O,tools:NO,layout:LO,mobile:OO,theme:PO,onboarding:DO,settings:FO,header:WO,sideChat:UO}},FA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function qO(){const e=es($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Bn=g5({legacy:!1,locale:qO(),fallbackLocale:"en",messages:jO});function HA(e){Bn.global.locale.value=e,ss($t.locale,e)}const tc=Bn.global.t,VO={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"},KO={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function ta(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return KO[t]??t}function na(e){const t=VO[ta(e)];return t?tc(t):e}const GO={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"};function yh(e){const t=ta(e);let n=GO[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Pa(n,"sm")}const WA=80;function YO(e,t=WA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function QO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function XO(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 an(e){return typeof e=="string"&&e.length>0?e:void 0}function Cl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ZO(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 cg(e){return an(e.path)??an(e.file_path)??an(e.filePath)??an(e.filename)}const JO=64;function ju(e,t,n=!1){const s=(o,i=WA)=>n?o.trim():YO(o,i);try{const o=XO(t);if(!n&&QO(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(ta(e)){case"read":{const r=cg(o);if(!r)return i();const l=Cl(o.offset)??Cl(o.line_start)??Cl(o.start_line),a=Cl(o.limit)??Cl(o.length),c=Cl(o.line_end)??Cl(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=cg(o);return r?s(`${r} ${tc("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=cg(o);return r?s(r):i()}case"bash":{const r=an(o.command)??an(o.cmd)??an(o.script);return r?s(r,JO):i()}case"grep":case"search":{const r=an(o.pattern)??an(o.query)??an(o.regex),l=an(o.path)??an(o.glob)??an(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=an(o.pattern)??an(o.glob)??an(o.query),l=an(o.path)??an(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):an(o.path)?s(an(o.path)):i()}case"ls":{const r=an(o.path)??an(o.dir)??an(o.directory)??an(o.cwd);return r?s(r):i()}case"web_fetch":{const r=an(o.url)??an(o.uri);return r?s(ZO(r)):i()}case"todo":case"task":{const r=an(o.description)??an(o.title)??an(o.prompt)??an(o.name)??an(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(tc("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function eP(e){try{switch(ta(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return tc("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 tc("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?tc("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const tP=qe({__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=B(()=>n(t.status));return(o,i)=>(w(),$("span",{class:Re(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),qu=dt(tP,[["__scopeId","data-v-e36198e5"]]),nP=["innerHTML"],sP={class:"a"},oP={key:0,class:"p"},iP={class:"rt"},rP=["aria-label"],lP={key:0,class:"tm"},aP=["inert"],cP={class:"bb-pad"},uP=qe({__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=Ut("pinScroll",()=>{}),o=J(null);function i(){n("toggle");const r=o.value;r&>(()=>s(r))}return(r,l)=>(w(),$("div",{class:Re(["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"}])},[x("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(w(),$("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,nP)):re("",!0),x("span",sP,O(e.name),1),ie(jt,{text:e.arg},{default:_e(()=>[e.arg?(w(),$("span",oP,O(e.arg),1)):re("",!0)]),_:1},8,["text"]),x("span",iP,[x("span",{class:Re(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ye(Xe,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ye(qu,{key:2,status:"suspended"})):(w(),ye(qu,{key:3,status:"running"}))],10,rP),Ln(r.$slots,"trailing"),e.time?(w(),$("span",lP,O(e.time),1)):re("",!0)]),e.expandable?(w(),ye(Xe,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):re("",!0)],512),x("div",{class:Re(["bb",{open:e.open}]),inert:!e.open},[x("div",cP,[Ln(r.$slots,"default")])],10,aP)],2))}}),kh=dt(uP,[["__scopeId","data-v-8cb516d8"]]),dP={key:0,class:"at-type"},fP={key:1,class:"at-task"},pP={key:2,class:"bb-code"},hP=qe({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=B(()=>i(s.tool.arg)),l=B(()=>!!s.tool.output&&s.tool.output.length>0),a=B(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=J(s.tool.defaultExpanded===!0&&a.value),u=B(()=>s.tool.status),d=B(()=>na(s.tool.name)),f=B(()=>yh(s.tool.name)),h=B(()=>r.value.description||r.value.subagentType||""),p=Ut("resolveAgentTaskId"),m=B(()=>p?p(s.tool.id)!==void 0:!0);function _(){a.value&&(c.value=!c.value)}return Ve(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(w(),ye(kh,{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:_},{trailing:_e(()=>[m.value?(w(),$("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=yt(v=>o("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):re("",!0)]),default:_e(()=>[r.value.subagentType?(w(),$("div",dP,O(r.value.subagentType),1)):re("",!0),r.value.prompt?(w(),$("div",fP,O(r.value.prompt),1)):re("",!0),l.value?(w(),$("div",pP,[(w(!0),$(Pe,null,tt(e.tool.output??[],(v,y)=>(w(),$("div",{key:y},O(v),1))),128))])):re("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),mP=dt(hP,[["__scopeId","data-v-14ef8750"]]);function gP(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 sf={recognized:!1,answers:{},note:""};function vP(e){const t=e?.[0];if(!t)return sf;let n;try{n=JSON.parse(t)}catch{return sf}if(!n||typeof n!="object"||Array.isArray(n))return sf;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return sf;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 yP(e,t,n){return e[t]??e[`q_${n}`]}const kP=/^opt_\d+_(\d+)$/;function bP(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=kP.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const _P={key:0,class:"chip"},wP={key:0,class:"au-dismissed"},SP={key:1,class:"au-list"},CP={class:"au-q"},xP={key:0,class:"au-hdr"},AP={class:"au-qtext"},TP={class:"au-opts"},MP={class:"au-glyph"},EP={class:"au-label"},IP={key:0,class:"au-desc"},$P={key:0,class:"au-opt sel"},NP={class:"au-glyph"},LP={class:"au-label"},OP={key:1,class:"au-opt sel"},PP={class:"au-label"},RP={key:2,class:"au-raw"},DP=80,BP=qe({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Tt();function s(N,b=DP){const M=N.trim();return M.length>b?M.slice(0,b-1)+"…":M}const o=B(()=>gP(t.tool.arg)),i=B(()=>vP(t.tool.output)),r=B(()=>i.value.recognized),l=B(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=B(()=>o.value.map((N,b)=>bP(yP(i.value.answers,N.question,b),N.options))),c=B(()=>Object.keys(i.value.answers).length);function u(N,b){return a.value[N]?.selected.has(b)??!1}function d(N){return a.value[N]?.otherText??""}function f(N){return a.value[N]?.indeterminate??!1}function h(N,b){return N?b?"■":"□":b?"●":"○"}const p=B(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const N=o.value[0]?.question??"",b=s(N);return o.value.length<=1?b:`${b} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=B(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),_=B(()=>!!t.tool.output&&t.tool.output.length>0),k=B(()=>r.value&&(o.value.length>0||l.value)||_.value),g=J(t.tool.defaultExpanded===!0&&k.value),v=B(()=>t.tool.status),y=B(()=>na(t.tool.name)),T=B(()=>yh(t.tool.name));function P(){k.value&&(g.value=!g.value)}return Ve(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),(N,b)=>(w(),ye(kh,{status:v.value,icon:T.value,name:y.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:P},{trailing:_e(()=>[m.value?(w(),$("span",_P,O(m.value),1)):re("",!0)]),default:_e(()=>[l.value?(w(),$("div",wP,O(i.value.note),1)):r.value?(w(),$("div",SP,[(w(!0),$(Pe,null,tt(o.value,(M,I)=>(w(),$("div",{key:I,class:"au-block"},[x("div",CP,[M.header?(w(),$("span",xP,O(M.header),1)):re("",!0),x("span",AP,O(M.question),1)]),x("div",TP,[(w(!0),$(Pe,null,tt(M.options,(L,S)=>(w(),$("div",{key:S,class:Re(["au-opt",{sel:u(I,S)}])},[x("span",MP,O(h(M.multiSelect,u(I,S))),1),x("span",EP,O(L.label),1),L.description?(w(),$("span",IP,O(L.description),1)):re("",!0)],2))),128)),d(I)?(w(),$("div",$P,[x("span",NP,O(h(M.multiSelect,!0)),1),x("span",LP,O(d(I)),1)])):re("",!0),f(I)?(w(),$("div",OP,[b[0]||(b[0]=x("span",{class:"au-glyph"},"●",-1)),x("span",PP,O(C(n)("tools.ask.answered")),1)])):re("",!0)])]))),128))])):(w(),$("div",RP,[(w(!0),$(Pe,null,tt(e.tool.output??[],(M,I)=>(w(),$("div",{key:I},O(M),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),FP=dt(BP,[["__scopeId","data-v-a9a0f259"]]),HP=1e6,H_=5e3;function W_(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function WP(e,t){const n=W_(e),s=W_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>H_||i>H_||(o+1)*(i+1)>HP)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 zP(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 zA(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 UA(e){const t=ta(e.name);if(t!=="edit"&&t!=="write")return null;const n=zA(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:WP(s,o)}return null}function UP(e){const t=zA(e);return t&&typeof t.path=="string"?t.path:void 0}function jP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const qP={key:0,class:"chip"},VP={key:0,class:"bb-summary"},KP={class:"bb-code"},GP={key:0,class:"bb-empty"},YP=qe({__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=B(()=>n.tool.status),i=B(()=>na(n.tool.name)),r=B(()=>yh(n.tool.name)),l=B(()=>ju(n.tool.name,n.tool.arg)),a=B(()=>ju(n.tool.name,n.tool.arg,!0)),c=B(()=>UA(n.tool)),u=B(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:_,removed:k}=zP(m);if(_||k)return`+${_} −${k}`}return""}),d=B(()=>!!n.tool.output&&n.tool.output.length>0),f=J(!1),h=B(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,_)=>(w(),ye(kh,{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:_e(()=>[u.value?(w(),$("span",qP,O(u.value),1)):re("",!0)]),default:_e(()=>[a.value?(w(),$("div",VP,O(a.value),1)):re("",!0),x("div",KP,[d.value?re("",!0):(w(),$("div",GP,"Waiting for output…")),(w(!0),$(Pe,null,tt(e.tool.output??[],(k,g)=>(w(),$("div",{key:g},O(k),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),QP=dt(YP,[["__scopeId","data-v-69861679"]]),XP={key:0,class:"chip"},ZP={key:0,class:"bb-summary"},JP={class:"bb-code"},eR={key:0,class:"bb-empty"},tR=qe({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=B(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=B(()=>!!t.tool.output&&t.tool.output.length>0),o=B(()=>s.value||n.value),i=J(t.tool.defaultExpanded===!0&&o.value),r=B(()=>t.tool.status),l=B(()=>na(t.tool.name)),a=B(()=>yh(t.tool.name)),c=B(()=>ju(t.tool.name,t.tool.arg)),u=B(()=>ju(t.tool.name,t.tool.arg,!0)),d=B(()=>eP({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 Ve(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(w(),ye(kh,{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:_e(()=>[d.value?(w(),$("span",XP,O(d.value),1)):re("",!0)]),default:_e(()=>[u.value?(w(),$("div",ZP,O(u.value),1)):re("",!0),x("div",JP,[s.value?re("",!0):(w(),$("div",eR,"Waiting for output…")),(w(!0),$(Pe,null,tt(e.tool.output??[],(m,_)=>(w(),$("div",{key:_},O(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),nR=dt(tR,[["__scopeId","data-v-f3c4ee38"]]),sR={class:"media-title"},oR=["src","alt"],iR=["src"],rR=["src"],lR=qe({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=B(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=B(()=>{const c=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?(w(),$("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[ie(jt,{text:o.value.path||l.value},{default:_e(()=>[x("div",sR,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(w(),ye(jt,{key:0,text:o.value.path||l.value},{default:_e(()=>[x("button",{type:"button",class:"media-image-button",onClick:a},[x("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,oR)])]),_:1},8,["text"])):o.value.kind==="video"?(w(),$("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,iR)):(w(),$("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,rR))],2)):re("",!0)}}),aR=dt(lR,[["__scopeId","data-v-bec13b73"]]),cR=/<summary>([\s\S]*?)<\/summary>/,uR=/<resume_hint>([\s\S]*?)<\/resume_hint>/,ug=/<subagent\b([^>]*)>|<\/subagent>/g,dR="</subagent>",z_=/(completed|failed|aborted):\s*(\d+)/g,U_=/([a-z_]+)="([^"]*)"/g;function fR(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function pR(e){const t={};U_.lastIndex=0;let n;for(;(n=U_.exec(e))!==null;)t[n[1]]=fR(n[2]);return t}function hR(e){const t={completed:0,failed:0,aborted:0};z_.lastIndex=0;let n;for(;(n=z_.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function mR(e,t){const n=pR(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function gR(e){const t=[],n=[];ug.lastIndex=0;let s;for(;(s=ug.exec(e))!==null;)if(s[0]===dR){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(mR(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:ug.lastIndex}):n.push(null);return t}function vR(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
40
|
-
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=cR.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=hR(n),r=uR.exec(t)?.[1]?.trim(),l=gR(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 j_(e){return e?e.split(`
|
|
41
|
-
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function yR(e){return e.suspendedReason||j_(e.text)||j_(e.outputLines?.join(`
|
|
42
|
-
`))||e.summary||""}function kR(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
43
|
-
`):e.summary??""}function bR(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function q_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
44
|
-
`)[0]??"",phase:bR(e.outcome),body:e.body}}function _R(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function wR(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:yR(o),phase:o.phase,body:kR(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>_R(i,o))).map((o,i)=>q_(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>q_(o,i))}const SR=["aria-expanded"],CR={class:"title"},xR={key:0,class:"meta"},AR={key:1,class:"sum-txt"},TR={class:"rt"},MR={class:"status"},ER={key:0,class:"chip"},IR={key:1,class:"tm"},$R={class:"body"},NR={class:"overview"},LR={class:"overview-line"},OR={class:"big"},PR={key:0,class:"lbl"},RR={key:1,class:"lbl"},DR={key:2,class:"lbl"},BR={key:0,class:"seg","aria-hidden":"true"},FR={key:1,class:"legend"},HR=["aria-expanded","onClick"],WR={class:"mname"},zR={class:"mact"},UR={class:"mphase"},jR={key:1,class:"fallback-output"},qR={key:2,class:"waiting"},VR=qe({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Tt(),n=e;function s(I){if(!I)return{};try{const L=JSON.parse(I),S=Array.isArray(L.items)?L.items:void 0;return{description:typeof L.description=="string"?L.description:void 0,itemCount:S?.length}}catch{return{}}}const o=Ut("resolveSwarmMembers"),i=B(()=>s(n.tool.arg)),r=B(()=>na(n.tool.name)),l=B(()=>i.value.description??""),a=B(()=>o?.(n.tool.id)??[]),c=B(()=>vR(n.tool.output)),u=B(()=>n.tool.status),d=B(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=B(()=>wR(a.value,c.value)),h=B(()=>{const I={completed:0,working:0,suspended:0,queued:0,failed:0};for(const L of f.value)I[L.phase]++;return I}),p=B(()=>f.value.length||i.value.itemCount||0),m=B(()=>h.value.completed+h.value.failed),_=B(()=>h.value.working+h.value.suspended+h.value.queued),k=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=B(()=>k.map(({phase:I,cls:L})=>({phase:I,count:h.value[I],cls:L})).filter(I=>I.count>0)),v=J(!1);function y(){v.value=!v.value}const T=B(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
45
|
-
`).trim()),P=J(new Set);function N(I){const L=new Set(P.value);L.has(I)?L.delete(I):L.add(I),P.value=L}function b(I){return P.value.has(I)}function M(I){return t(`tools.swarm.phase${I[0].toUpperCase()}${I.slice(1)}`)}return(I,L)=>(w(),$("div",{class:Re(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[x("button",{class:"head",type:"button","aria-expanded":v.value,onClick:y},[ie(Xe,{class:"ic",name:"git-pull-request",size:"sm"}),x("span",CR,O(r.value),1),l.value?(w(),$("span",xR,"·")):re("",!0),l.value?(w(),$("span",AR,O(l.value),1)):re("",!0),x("span",TR,[x("span",MR,[d.value==="ok"?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):d.value==="error"?(w(),ye(Xe,{key:1,name:"close",size:"sm"})):(w(),ye(qu,{key:2,status:"running"}))]),m.value>0||p.value>0?(w(),$("span",ER,O(m.value)+" / "+O(p.value),1)):re("",!0),e.tool.timing?(w(),$("span",IR,O(e.tool.timing),1)):re("",!0)]),ie(Xe,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,SR),Sn(x("div",$R,[x("div",NR,[x("div",LR,[x("span",OR,O(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(w(),$("span",PR,O(C(t)("tools.swarm.runningSub",{count:_.value})),1)):c.value?(w(),$("span",RR,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(w(),$("span",DR,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(w(),$("div",BR,[(w(!0),$(Pe,null,tt(g.value,S=>(w(),$("span",{key:S.phase,class:Re(S.cls),style:Xt({flex:S.count})},null,6))),128))])):re("",!0),g.value.length>1?(w(),$("div",FR,[(w(!0),$(Pe,null,tt(g.value,S=>(w(),$("span",{key:S.phase},[x("i",{class:Re(["lg-dot",S.cls])},null,2),Ue(O(M(S.phase))+" "+O(S.count),1)]))),128))])):re("",!0)]),f.value.length>0?(w(!0),$(Pe,{key:0},tt(f.value,S=>(w(),$("div",{key:S.id,class:Re(["member",[`phase-${S.phase}`,{open:b(S.id)}]])},[x("button",{class:"member-head",type:"button","aria-expanded":b(S.id),onClick:E=>N(S.id)},[ie(qu,{class:"row-dot",status:S.phase},null,8,["status"]),ie(jt,{text:S.name},{default:_e(()=>[x("span",WR,O(S.name),1)]),_:2},1032,["text"]),S.activity?(w(),ye(jt,{key:0,text:S.activity},{default:_e(()=>[x("span",zR,O(S.activity),1)]),_:2},1032,["text"])):re("",!0),x("span",UR,O(M(S.phase)),1),ie(Xe,{class:"mcar",name:b(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,HR),Sn(x("div",{class:"member-body"},O(S.body),513),[[$o,b(S.id)]])],2))),128)):T.value?(w(),$("div",jR,O(T.value),1)):(w(),$("div",qR,O(C(t)("tools.swarm.waiting")),1))],512),[[$o,v.value]])],2))}}),KR=dt(VR,[["__scopeId","data-v-3b95ba79"]]);function GR(e){if(e.media&&e.status==="ok")return aR;const t=ta(e.name);return t==="edit"||t==="write"||t==="multi_edit"?QP:t==="task"?mP:t==="agentswarm"?KR:t==="askuserquestion"?FP:nR}const jA=qe({__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=B(()=>GR(n.tool));return(i,r)=>(w(),ye(zs(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,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"]))}});function V_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function YR(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 bh(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 QR(e){return!(e.tool.status==="ok"&&e.tool.media)}function XR(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function ZR(e){const t=bh(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(QR(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}):i.kind==="cron"&&n.push({kind:"cron",text:i.text,cron:i.cron,sourceIndex:r})}),o(),n}function JR(e){return bh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
46
|
-
|
|
47
|
-
`)}function e7(e){const t=[];for(const n of bh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
48
|
-
> ${n.thinking.split(`
|
|
49
|
-
`).join(`
|
|
50
|
-
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const s=n.tool.output.join(`
|
|
51
|
-
`);t.push(`\`\`\`
|
|
52
|
-
[${n.tool.name}]
|
|
53
|
-
${s}
|
|
54
|
-
\`\`\``)}return t.join(`
|
|
55
|
-
|
|
56
|
-
`)}function qA(e){return e.tool.id||`tool-${e.sourceIndex}`}function t7(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?qA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const n7=["aria-expanded"],s7={class:"tg-title"},o7={class:"tg-meta"},i7=["inert"],r7={class:"tool-group-body-inner"},l7=qe({__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=J(!0),i=B(()=>n.tools.length),r=B(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=B(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){o.value=!o.value}const u=Ut("pinScroll",()=>{}),d=J(null);function f(){c();const h=d.value;h&>(()=>u(h))}return(h,p)=>(w(),$("div",{class:Re(["tool-group",{open:o.value}])},[x("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[ie(qu,{status:r.value},null,8,["status"]),ie(Xe,{class:"tg-ic",name:"list",size:"sm"}),x("span",s7,O(C(l)("tools.group.title",i.value)),1),x("span",o7,"· "+O(a.value),1),ie(Xe,{class:"tg-car",name:"chevron-right",size:"sm"})],8,n7),x("div",{class:Re(["tool-group-body",{open:o.value}]),inert:!o.value},[x("div",r7,[(w(!0),$(Pe,null,tt(e.tools,(m,_)=>(w(),ye(jA,{key:C(qA)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(XR)(_,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=k=>s("openMedia",k)),onOpenFile:p[1]||(p[1]=k=>s("openFile",k)),onOpenToolDiff:p[2]||(p[2]=k=>s("openToolDiff",k)),onOpenAgent:p[3]||(p[3]=k=>s("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,i7)],2))}}),a7=dt(l7,[["__scopeId","data-v-37eb334f"]]);var c7=Object.create,E0=Object.defineProperty,u7=Object.getOwnPropertyDescriptor,VA=Object.getOwnPropertyNames,d7=Object.getPrototypeOf,f7=Object.prototype.hasOwnProperty,KA=(e,t)=>function(){return t||(0,e[VA(e)[0]])((t={exports:{}}).exports,t),t.exports},GA=e=>{let t={};for(var n in e)E0(t,n,{get:e[n],enumerable:!0});return t},p7=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=VA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!f7.call(e,l)&&l!==n&&E0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=u7(t,l))||s.enumerable});return e},YA=(e,t,n)=>(n=e!=null?c7(d7(e)):{},p7(E0(n,"default",{value:e,enumerable:!0}),e));function h7(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 m7(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function g7(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 v7(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
57
|
-
`:`<hr class="footnotes-sep">
|
|
58
|
-
`)+`<section class="footnotes">
|
|
59
|
-
<ol class="footnotes-list">
|
|
60
|
-
`}function y7(){return`</ol>
|
|
61
|
-
</section>
|
|
62
|
-
`}function k7(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 b7(){return`</li>
|
|
63
|
-
`}function _7(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 w7(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=g7,e.renderer.rules.footnote_block_open=v7,e.renderer.rules.footnote_block_close=y7,e.renderer.rules.footnote_open=k7,e.renderer.rules.footnote_close=b7,e.renderer.rules.footnote_anchor=_7,e.renderer.rules.footnote_caption=m7,e.renderer.rules.footnote_anchor_name=h7;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 _=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let P=T;for(;h<f;){const b=l.src.charCodeAt(h);if(n(b))b===9?P+=4-P%4:P++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=P-T,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=v,l.blkIndent-=4,l.tShift[a]=k,l.sCount[a]=g,l.bMarks[a]=_;const N=new l.Token("footnote_reference_close","",-1);return N.level=--l.level,l.tokens.push(N),!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 _=new l.Token("footnote_open","",1);if(_.meta={id:p,label:h[p].label},l.tokens.push(_),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const y=new l.Token("inline","",0);y.children=h[p].tokens,y.content=h[p].content,a.push(y);const T=new l.Token("paragraph_close","p",-1);T.block=!0,a.push(T)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:p,subId:v,label:h[p].label},l.tokens.push(y)}k&&l.tokens.push(k),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",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 S7(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 C7(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 x7=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function A7(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(x7,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function T7(e){e.inline.ruler.after("emphasis","sub",A7)}const M7=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function E7(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(M7,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function I7(e){e.inline.ruler.after("emphasis","sup",E7)}var $7=KA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,_,k.Token),v+=1,n(g[y-2],"class",_.liClass),n(g[s(g,y-2)],"class",_.ulClass))})};function n(m,_,k){var g=m.attrIndex(_),v=[_,k];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,_){for(var k=m[_].level-1,g=_-1;g>=0;g--)if(m[g].level===k)return g;return-1}function o(m,_){return d(m[_])&&f(m[_-1])&&h(m[_-2])&&p(m[_])}function i(m,_,k,g){var v=k.idPrefix+_;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,_,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,_){var k=new _("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,_){var k=new _("checkbox_open","div",0);return k.attrs=[["class",m.divClass]],k}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),N7=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))),L7=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),dg;const O7=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]]),P7=(dg=String.fromCodePoint)!==null&&dg!==void 0?dg: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 R7(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=O7.get(e))!==null&&t!==void 0?t:e}var Ss;(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"})(Ss||(Ss={}));const D7=32;var zr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(zr||(zr={}));function Jv(e){return e>=Ss.ZERO&&e<=Ss.NINE}function B7(e){return e>=Ss.UPPER_A&&e<=Ss.UPPER_F||e>=Ss.LOWER_A&&e<=Ss.LOWER_F}function F7(e){return e>=Ss.UPPER_A&&e<=Ss.UPPER_Z||e>=Ss.LOWER_A&&e<=Ss.LOWER_Z||Jv(e)}function H7(e){return e===Ss.EQUALS||F7(e)}var ws;(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"})(ws||(ws={}));var Fr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Fr||(Fr={}));var W7=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ws.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Fr.Strict}startEntity(e){this.decodeMode=e,this.state=ws.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ws.EntityStart:return e.charCodeAt(t)===Ss.NUM?(this.state=ws.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ws.NamedEntity,this.stateNamedEntity(e,t));case ws.NumericStart:return this.stateNumericStart(e,t);case ws.NumericDecimal:return this.stateNumericDecimal(e,t);case ws.NumericHex:return this.stateNumericHex(e,t);case ws.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|D7)===Ss.LOWER_X?(this.state=ws.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ws.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(Jv(s)||B7(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(Jv(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===Ss.SEMI)this.consumed+=1;else if(this.decodeMode===Fr.Strict)return 0;return this.emitCodePoint(R7(this.result),this.consumed),this.errors&&(e!==Ss.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&zr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=z7(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Fr.Attribute&&(o===0||H7(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&zr.VALUE_LENGTH)>>14,o!==0){if(i===Ss.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Fr.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]&zr.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]&~zr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case ws.NamedEntity:return this.result!==0&&(this.decodeMode!==Fr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ws.NumericDecimal:return this.emitNumericEntity(0,2);case ws.NumericHex:return this.emitNumericEntity(0,3);case ws.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ws.EntityStart:return 0}}};function QA(e){let t="";const n=new W7(e,s=>t+=P7(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 z7(e,t,n,s){const o=(t&zr.BRANCH_LENGTH)>>7,i=t&zr.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 U7=QA(N7);QA(L7);function I0(e,t=Fr.Legacy){return U7(e,t)}var j7=YA($7());const K_={};function q7(e){let t=K_[e];if(t)return t;t=K_[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 _h(e,t){typeof t!="string"&&(t=_h.defaultChars);const n=q7(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})}_h.defaultChars=";/?:@&=+$,#";_h.componentChars="";var e1=_h;const G_={};function V7(e){let t=G_[e];if(t)return t;t=G_[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 wh(e,t,n){typeof t!="string"&&(n=t,t=wh.defaultChars),typeof n>"u"&&(n=!0);const s=V7(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}wh.defaultChars=";/?:@&=+$,-_.!~*'()#";wh.componentChars="-_.!~*'()";var XA=wh;function $0(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 mp(){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 K7=/^([a-z0-9.+-]+:)/i,G7=/:[0-9]*$/,Y7=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Q7=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
64
|
-
`," "]),X7=["'"].concat(Q7),Y_=["%","/","?",";","#"].concat(X7),Q_=["/","?","#"],Z7=255,X_=/^[+a-z0-9A-Z_-]{0,63}$/,J7=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Z_={javascript:!0,"javascript:":!0},J_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function eD(e,t){if(e&&e instanceof mp)return e;const n=new mp;return n.parse(e,t),n}mp.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=Y7.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=K7.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&&Z_[r])&&(i=i.substr(2),this.slashes=!0)),!Z_[r]&&(o||r&&!J_[r])){let c=-1;for(let p=0;p<Q_.length;p++)s=i.indexOf(Q_[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<Y_.length;p++)s=i.indexOf(Y_[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,_=p.length;m<_;m++){const k=p[m];if(k&&!k.match(X_)){let g="";for(let v=0,y=k.length;v<y;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(X_)){const v=p.slice(0,m),y=p.slice(m+1),T=k.match(J7);T&&(v.push(T[1]),y.unshift(T[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>Z7&&(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),J_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};mp.prototype.parseHost=function(e){let t=G7.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 N0=eD,ZA=GA({decode:()=>e1,encode:()=>XA,format:()=>$0,parse:()=>N0}),JA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,eT=/[\0-\x1F\x7F-\x9F]/,tD=/[\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]/,tT=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,nD=/[\$\+<->\^`\|~\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]/,nT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,sD=GA({Any:()=>JA,Cc:()=>eT,Cf:()=>tD,P:()=>tT,S:()=>nD,Z:()=>nT}),oD=Object.defineProperty,sT=e=>{let t={};for(var n in e)oD(t,n,{get:e[n],enumerable:!0});return t},cs=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}`}},iD=sT({arrayReplaceAt:()=>fD,assign:()=>uD,countLines:()=>Xn,escapeHtml:()=>_D,escapeRE:()=>SD,fromCodePoint:()=>Ku,has:()=>cD,isMdAsciiPunct:()=>yp,isPunctChar:()=>vp,isPunctCode:()=>t1,isSpace:()=>dD,isString:()=>lD,isValidEntityCode:()=>Ch,isWhiteSpace:()=>Vu,lib:()=>CD,mdurl:()=>ZA,normalizeReference:()=>Sh,ucmicro:()=>gp,unescapeAll:()=>Gu,unescapeMd:()=>gD});const gp=sD;function rD(e){return Object.prototype.toString.call(e)}function lD(e){return rD(e)==="[object String]"}const aD=Object.prototype.hasOwnProperty;function cD(e,t){return aD.call(e,t)}function uD(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 dD(e){return e===9||e===32}function Vu(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 vp(e){return gp.P.test(e)||gp.S.test(e)}const ew=new Map;function t1(e){if(yp(e))return!0;const t=ew.get(e);if(t!==void 0)return t;const n=vp(String.fromCharCode(e));return ew.set(e,n),n}function yp(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 Sh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function fD(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ch(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 Ku(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 oT=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,pD=new RegExp(`${oT.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),hD=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function mD(e,t){if(t.charCodeAt(0)===35&&hD.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ch(s)?Ku(s):e}const n=I0(e);return n!==e?n:e}function gD(e){return e.includes("\\")?e.replace(oT,"$1"):e}function Gu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(pD,(t,n,s)=>n||mD(t,s))}const vD=/[&<>"]/,yD=/[&<>"]/g,kD={"&":"&","<":"<",">":">",'"':"""};function bD(e){return kD[e]}function _D(e){return vD.test(e)?e.replace(yD,bD):e}const wD=/[.?*+^$[\]\\(){}|-]/g;function SD(e){return e.replace(wD,"\\$&")}const CD={mdurl:ZA,ucmicro:gp};function Xn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
65
|
-
`,n+1))!==-1;)t++;return t}const xD=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,AD=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,TD=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,L0=["references","footnotes","abbreviations","abbr","abbrs"],O0=Symbol.for("markdown-it-ts.global-state"),P0=Object.prototype.hasOwnProperty;function tw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function gi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Kr(e){if(Array.isArray(e))return e.map(t=>Kr(t));if(gi(e)){const t={};for(const n of Object.keys(e))t[n]=Kr(e[n]);return t}return e}function kp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):gi(e)?Object.keys(e):[]}function n1(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(!n1(e[n],t[n]))return!1;return!0}if(gi(e)||gi(t)){if(!gi(e)||!gi(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(!P0.call(t,o)||!n1(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function iT(e,t){if(Array.isArray(e))return e[Number(t)];if(gi(e))return e[t]}function MD(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Kr(t[n]);return e}if(gi(e)&&gi(t)){for(const n of Object.keys(e))P0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Kr(t[n]);return e}return Kr(t)}function ED(e,t,n){const s=n.ownedKeys??[],o=e[t];if(gi(o)||Array.isArray(o)){const i=new Set(kp(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=Kr(iT(n.value,r)):delete o[r];!n.existed&&kp(o).length===0&&delete e[t];return}n.existed?e[t]=Kr(n.value):delete e[t]}function R0(e){const t=e[O0];return tw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&tw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function ID(e,t){Object.defineProperty(e,O0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function mo(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:xD.test(e)?"footnote-definition":AD.test(e)?"abbreviation-definition":TD.test(e)?"reference-definition":null}function ud(e){return R0(e)?.reason??null}function nc(e,t,n){if(ud(e)&&dr(e),!t)return n();D0(e,t);try{const s=n();return B0(e),s}catch(s){throw dr(e),s}}function D0(e,t){try{dr(e);const n={};for(const s of L0)n[s]=P0.call(e,s)?{existed:!0,value:Kr(e[s])}:{existed:!1};ID(e,{reason:t,snapshot:n})}catch{}}function B0(e){const t=R0(e);if(t)for(const n of L0){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!gi(o)&&!Array.isArray(o))continue;const i=new Set(kp(s.existed?s.value:void 0));s.ownedKeys=kp(o).filter(r=>i.has(r)?!n1(o[r],iT(s.value,r)):!0)}}function dr(e){const t=R0(e);if(t){for(const n of L0){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){ED(e,n,s);continue}s.existed?e[n]=MD(e[n],s.value):delete e[n]}delete e[O0]}}const s1=Symbol.for("markdown-it-ts.diagnostics");function xh(e,t){if(e)try{const n=e[s1];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[s1]=s,s}catch{return}}function Ki(e){return xh(e,!1)}function $D(e){if(e)try{const t=e[s1];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function Qs(e){$D(e)}function ls(e,t){const n=xh(e,!0);n&&(n.strategy=t)}function fg(e,t){const n=xh(e,!0);n&&(n.chunk=t)}function rT(e,t){const n=xh(e,!0);n&&(n.unbounded=t)}function ND(e){const t={};e=e||{},t.src_Any=JA.source,t.src_Cc=eT.source,t.src_Z=nT.source,t.src_P=tT.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 o1(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Ah(e){return Object.prototype.toString.call(e)}function LD(e){return Ah(e)==="[object String]"}function OD(e){return Ah(e)==="[object Object]"}function PD(e){return Ah(e)==="[object RegExp]"}function nw(e){return Ah(e)==="[object Function]"}function RD(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const lT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function DD(e){return Object.keys(e||{}).reduce(function(t,n){return t||lT.hasOwnProperty(n)},!1)}const BD={"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}}},FD="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]",HD="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function WD(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function sw(){return function(e,t){t.normalize(e)}}function bp(e){const t=e.re=ND(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(FD),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,OD(a)){PD(a.validate)?c.validate=WD(a.validate):nw(a.validate)?c.validate=a.validate:i(l,a),nw(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=sw();return}if(LD(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:sw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(RD).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 aT(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 Ho(e,t){if(!(this instanceof Ho))return new Ho(e,t);t||DD(e)&&(t=e,e={}),this.__opts__=o1({},lT,t),this.__schemas__=o1({},BD,e),this.__compiled__={},this.__tlds__=HD,this.__tlds_replaced__=!1,this.re={},bp(this)}Ho.prototype.add=function(t,n){return this.__schemas__[t]=n,bp(this),this};Ho.prototype.set=function(t){return this.__opts__=o1(this.__opts__,t),this};Ho.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)};Ho.prototype.pretest=function(t){return this.re.pretest.test(t)};Ho.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Ho.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 aT(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};Ho.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 aT(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};Ho.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(),bp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,bp(this),this)};Ho.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Ho.prototype.onCompile=function(){};var cT=Ho,zD=KA({"../../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,_=Math.floor,k=String.fromCharCode;function g(D){throw new RangeError(p[D])}function v(D,F){const U=[];let G=D.length;for(;G--;)U[G]=F(D[G]);return U}function y(D,F){const U=D.split("@");let G="";U.length>1&&(G=U[0]+"@",D=U[1]),D=D.replace(h,".");const Y=v(D.split("."),F).join(".");return G+Y}function T(D){const F=[];let U=0;const G=D.length;for(;U<G;){const Y=D.charCodeAt(U++);if(Y>=55296&&Y<=56319&&U<G){const q=D.charCodeAt(U++);(q&64512)==56320?F.push(((Y&1023)<<10)+(q&1023)+65536):(F.push(Y),U--)}else F.push(Y)}return F}const P=D=>String.fromCodePoint(...D),N=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},b=function(D,F){return D+22+75*(D<26)-((F!=0)<<5)},M=function(D,F,U){let G=0;for(D=U?_(D/700):D>>1,D+=_(D/F);D>m*26>>1;G+=36)D=_(D/m);return _(G+(m+1)*D/(D+38))},I=function(D){const F=[],U=D.length;let G=0,Y=128,q=72,ae=D.lastIndexOf("-");ae<0&&(ae=0);for(let de=0;de<ae;++de)D.charCodeAt(de)>=128&&g("not-basic"),F.push(D.charCodeAt(de));for(let de=ae>0?ae+1:0;de<U;){const ne=G;for(let he=1,Oe=36;;Oe+=36){de>=U&&g("invalid-input");const je=N(D.charCodeAt(de++));je>=36&&g("invalid-input"),je>_((2147483647-G)/he)&&g("overflow"),G+=je*he;const it=Oe<=q?1:Oe>=q+26?26:Oe-q;if(je<it)break;const ce=36-it;he>_(2147483647/ce)&&g("overflow"),he*=ce}const X=F.length+1;q=M(G-ne,X,ne==0),_(G/X)>2147483647-Y&&g("overflow"),Y+=_(G/X),G%=X,F.splice(G++,0,Y)}return String.fromCodePoint(...F)},L=function(D){const F=[];D=T(D);const U=D.length;let G=128,Y=0,q=72;for(const ne of D)ne<128&&F.push(k(ne));const ae=F.length;let de=ae;for(ae&&F.push("-");de<U;){let ne=2147483647;for(const he of D)he>=G&&he<ne&&(ne=he);const X=de+1;ne-G>_((2147483647-Y)/X)&&g("overflow"),Y+=(ne-G)*X,G=ne;for(const he of D)if(he<G&&++Y>2147483647&&g("overflow"),he===G){let Oe=Y;for(let je=36;;je+=36){const it=je<=q?1:je>=q+26?26:je-q;if(Oe<it)break;const ce=Oe-it,z=36-it;F.push(k(b(it+ce%z,0))),Oe=_(ce/z)}F.push(k(b(Oe,0))),q=M(Y,X,de===ae),Y=0,++de}++Y,++G}return F.join("")},R={version:"2.3.1",ucs2:{decode:T,encode:P},decode:I,encode:L,toASCII:function(D){return y(D,function(F){return f.test(F)?"xn--"+L(F):F})},toUnicode:function(D){return y(D,function(F){return d.test(F)?I(F.slice(4).toLowerCase()):F})}};t.exports=R})}),uT=YA(zD());function F0(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=Gu(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=Gu(e.slice(t,o)),i.pos=o,i.ok=!0),i}var dT=F0;const Ef=-2;function UD(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 Ef}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Ef;if(r===91){o++,i++;continue}i++}return-1}function H0(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=UD(l,t,a,n);if(f!==Ef)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 _p=H0;function W0(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+=Gu(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+=Gu(e.slice(t,i)),r}var fT=W0;function Th(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 z0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function jD(e,t,n){const s=Th(e,t),o=[t,n];s<0?z0(e,o):e.attrs[s]=o}function qD(e,t){const n=Th(e,t);return n>=0?e.attrs[n][1]:null}function VD(e,t,n){const s=Th(e,t);s<0?z0(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var KD=sT({attrGet:()=>qD,attrIndex:()=>Th,attrJoin:()=>VD,attrPush:()=>z0,attrSet:()=>jD,parseLinkDestination:()=>F0,parseLinkLabel:()=>H0,parseLinkTitle:()=>W0});function GD(e){return e.includes("\r")||e.includes("\0")}function pT(e){return typeof e=="string"?e:e.toString()}function YD(e){if(e.inlineMode){const t=new cs("inline","",0);t.content=pT(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 QD=/^([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])?)*)$/,XD=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ZD(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(XD.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(QD.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 JD=ZD;function e9(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(`
|
|
66
|
-
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var t9=e9;function ow(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 n9(e){const t=e.tokens_meta,n=e.tokens_meta.length;ow(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&ow(t[s].delimiters)}var s9=n9;function o9(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 iw(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 i9(e){const t=e.tokens_meta,n=e.tokens_meta.length;iw(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&iw(e,t[s].delimiters)}const rw={tokenize:o9,postProcess:i9};function hT(e){return I0(e)}function U0(e){return e>=48&&e<=57}function r9(e){const t=e|32;return U0(e)||t>=97&&t<=102}function mT(e){const t=e|32;return t>=97&&t<=122}function l9(e){return mT(e)||U0(e)}function a9(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?r9(l):U0(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function c9(e,t,n){let s=t+1;if(s>=n||!mT(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&l9(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 hT(o)!==o?o:null}function u9(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=a9(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=Ch(i)?Ku(i):Ku(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=c9(e.src,n,s);if(o){const i=hT(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 d9=u9;const gT=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),i1=new Array(128),vT=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);i1[e]=`\\${t}`,vT[e]=gT[e]?t:i1[e]}function lw(e,t,n){e.pending&&e.pushPending();const s=new cs("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 f9(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):(lw(e,vT[i],i1[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 lw(e,i<256&&gT[i]?r:l,l),e.pos=n+1,!0}var p9=f9;function h9(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 m9=h9;const yT=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,kT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",g9=new RegExp(`^(?:${yT}|${kT}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),v9=new RegExp(`^(?:${yT}|${kT})`);function bT(e){return e===32||e===9||e===10||e===12||e===13}function y9(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||bT(t)}function k9(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(!bT(n))return!1}return!1}function b9(e){const t=e|32;return t>=97&&t<=122}function _9(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&&!b9(i))return!1;const r=o.slice(s).match(g9);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,y9(l)&&e.linkLevel++,k9(l)&&e.linkLevel--}return e.pos+=l.length,!0}var w9=_9;function S9(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=_p(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=dT(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=fT(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=_p(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[Sh(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 _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=s,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var C9=S9;function x9(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=_p(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=dT(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=fT(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=_p(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[Sh(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),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var A9=x9;function _T(e){const t=e|32;return t>=97&&t<=122}function T9(e){return e>=48&&e<=57}function M9(e){return _T(e)||T9(e)||e===43||e===45||e===46}function E9(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&M9(e.charCodeAt(t));)t--;return t++,t>=e.length||!_T(e.charCodeAt(t))?null:e.slice(t)}function I9(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 $9(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=E9(e.pending);if(!o)return!1;const i=I9(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 N9(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 L9=N9;function O9(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 aw(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 P9(e){const t=e.delimiters;aw(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&aw(e,n[s].delimiters)}const cw={tokenize:O9,postProcess:P9};function uw(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 R9(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||uw(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!uw(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var D9=R9;function j0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function B9(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 F9(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 wT(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:j0(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function sc(e,t,n,s,o,i){const r=wT(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=F9(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=j0()}function H9(e){const t=wT(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=B9(o.samples)}return t.completedAt=j0(),t}var dw=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}},ST=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 cs("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 cs(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 cs(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=Vu(l),u=Vu(a),d=t1(l),f=t1(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}}};ST.prototype.Token=cs;const W9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function CT(e){return!W9.test(e)}var z9=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new dw,this.ruler2=new dw,this.ruler.push("text",D9),this.ruler.push("linkify",$9),this.ruler.push("newline",L9),this.ruler.push("escape",p9),this.ruler.push("backticks",t9),this.ruler.push("strikethrough",cw.tokenize),this.ruler.push("emphasis",rw.tokenize),this.ruler.push("link",A9),this.ruler.push("image",C9),this.ruler.push("autolink",JD),this.ruler.push("html_inline",w9),this.ruler.push("entity",d9),this.ruler2.push("balance_pairs",s9),this.ruler2.push("strikethrough",cw.postProcess),this.ruler2.push("emphasis",rw.postProcess),this.ruler2.push("fragments_join",m9),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(sc(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<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(sc(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()&&CT(e)){const a=new cs("text","",0);a.content=e,s.push(a);return}const o=new ST(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();sc(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 U9(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&&CT(i.content)){const r=new cs("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const j9=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,q9=/[0-9a-z]/i;function V9(e){return/^<a[>\s]/i.test(e)}function K9(e){return/^<\/a\s*>/i.test(e)}function G9(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(!j9.test(s)||!q9.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 Y9(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"&&(V9(l.content)&&i>0&&i--,K9(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=>G9(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 _=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const k=p.index;if(k>f){const T=new cs("text","",0);T.content=a.slice(f,k),T.level=d,u.push(T)}const g=new cs("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new cs("text","",0);v.content=_,v.level=d,u.push(v);const y=new cs("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new cs("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const Q9=/\r\n?|\n/g,X9=/\0/g;function Z9(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(Q9,`
|
|
67
|
-
`)),s&&(o=o.replace(X9,"�")),e.src=o}const xT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,J9=/\((?:c|tm|r)\)/i,eB=/\((c|tm|r)\)/gi,tB={c:"©",r:"®",tm:"™"};function nB(e,t){return tB[t.toLowerCase()]}function sB(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(eB,nB)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function oB(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&xT.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 iB(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(""):"");J9.test(s)&&sB(n.children||[]),xT.test(s)&&oB(n.children||[])}}var rB=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 lB=/['"]/,fw=/['"]/g,pw="’";function of(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function aB(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;){fw.lastIndex=c;const d=fw.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 _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const k=yp(m)||vp(String.fromCharCode(m)),g=yp(_)||vp(String.fromCharCode(_)),v=Vu(m),y=Vu(_);if(y?f=!1:g&&(v||k||(f=!1)),v?h=!1:k&&(y||g||(h=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=k,h=g),!f&&!h){p&&(r.content=of(r.content,d.index,pw));continue}if(h)for(n=s.length-1;n>=0;n--){let T=s[n];if(s[n].level<l)break;if(T.single===p&&s[n].level===l){T=s[n];let P,N;p?(P=o[2]||"‘",N=o[3]||"’"):(P=o[0]||"“",N=o[1]||"”"),r.content=of(r.content,d.index,N),e[T.token].content=of(e[T.token].content,T.pos,P),c+=N.length-1,T.token===i&&(c+=P.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=of(r.content,d.index,pw))}}}function cB(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("");!lB.test(s)||!n.children||aB(n.children,e)}}function uB(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 dB=/^(?:vbscript|javascript|file|data):/,fB=/^data:image\/(?:gif|png|jpeg|webp);/,AT=["http:","https:","mailto:"];function TT(e){const t=e.trim().toLowerCase();return dB.test(t)?fB.test(t):!0}function MT(e){const t=N0(e,!0);if(t.hostname&&(!t.protocol||AT.includes(t.protocol)))try{t.hostname=uT.default.toASCII(t.hostname)}catch{}return XA($0(t))}function ET(e){const t=N0(e,!0);if(t.hostname&&(!t.protocol||AT.includes(t.protocol)))try{t.hostname=uT.default.toUnicode(t.hostname)}catch{}return e1($0(t),`${e1.defaultChars}%`)}function pB(e){switch(e){case 9:case 32:return!0}return!1}function hB(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=[],_=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const M=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!M){let L=a[y]+1,S,E;o.charCodeAt(u)===32?(u++,L++,E=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[y]+L)%4===3?(u++,L++,E=!1):E=!0):S=!1;let R=L;for(h.push(i[y]),i[y]=u;u<d;){const D=o.charCodeAt(u);if(pB(D))D===9?R+=4-(R+c[y]+(E?1:0))%4:R++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=R-L,_.push(l[y]),l[y]=u-i[y];continue}if(v)break;let I=!1;for(let L=0,S=k.length;L<S;L++)if(k[L](e,y,n,!0)){I=!0;break}if(I){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const T=e.blkIndent;e.blkIndent=0;const P=e.push("blockquote_open","blockquote",1);P.markup=">";const N=[t,0];P.map=N,e.md.block.tokenize(e,t,y);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=f,e.parentType=g,N[1]=e.line;for(let M=0;M<_.length;M++)i[M+t]=h[M],l[M+t]=_[M],a[M+t]=m[M],c[M+t]=p[M];return e.blkIndent=T,!0}function mB(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)}
|
|
68
|
-
`,i.map=[t,e.line],!0}function gB(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 hw=["","h1","h2","h3","h4","h5","h6"],mw=["","#","##","###","####","#####","######"];function gw(e){switch(e){case 9:case 32:return!0}return!1}function vB(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&&!gw(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&gw(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",hw[d],1);h.markup=mw[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",hw[d],-1);return m.markup=mw[d],!0}function yB(e){switch(e){case 9:case 32:return!0}return!1}function kB(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&&!yB(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 xa=[[/^<(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(`${v9.source}\\s*$`),/^$/,!1]];function bB(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<xa.length&&!xa[l][0].test(r);l++);if(l===xa.length)return!1;if(s)return xa[l][2];let a=t+1;if(!xa[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),xa[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 vw(e){switch(e){case 9:case 32:return!0}return!1}const gu={Pipe:1,ParagraphTerminator:2};function _B(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 IT=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|=gu.Pipe|gu.ParagraphTerminator),!a)if(vw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,_B(f)&&(c|=gu.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 cs(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new cs(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,_=this.bsCount,k=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+_[u])%4:p++;else if(f-d<k[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 _=i.charCodeAt(p);if(vw(_))_===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("")}};IT.prototype.Token=cs;function wB(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function $T(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function NT(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&gu.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:wB(n,s,o)}const yw=["","h1","h2"];function SB(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=$T(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 y=i[p]+r[p],T=l[p];if(y>=T)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(y),h===45||h===61)){let N=y+1,b=N;for(;N<T&&o.charCodeAt(N)===h;)N++;for(b=N;N<T;){const M=o.charCodeAt(N);if(M!==9&&M!==32)break;N++}if(N>=T){f=h===61?1:2;break}if(b-y>1)continue}if(a[p]<0||u&&!NT(e,p,o,y,T))continue;let P=!1;for(let N=0,b=s.length;N<b;N++)if(s[N](e,p,n,!0)){P=!0;break}if(P)break}if(!f)return!1;let m;if(p===t+1){const y=i[t]+r[t];let T=l[t];for(;T>y;){const P=o.charCodeAt(T-1);if(P!==9&&P!==32)break;T--}m=o.slice(y,T)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const _=h===61?"=":"-",k=e.push("heading_open",yw[f],1);k.markup=_,k.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",yw[f],-1);return v.markup=_,e.parentType=d,!0}function LT(e){switch(e){case 9:case 32:return!0}return!1}function kw(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&&!LT(i.charCodeAt(l))?-1:l}function bw(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),!LT(c))?-1:a}function CB(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 xB=["0","1","2","3","4","5","6","7","8","9"];function AB(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 TB(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,_=e.eMarks,k=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=_[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=bw(e,l),f<0||(u=!0,r=v,d=CB(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=kw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=_[l])return!1;if(s)return!0;const T=h.charCodeAt(f-1),P=String.fromCharCode(T);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 N=[l,0];e.tokens[e.tokens.length-1].map=N,e.tokens[e.tokens.length-1].markup=P;let b=!1;const M=e.tokens.length-1,I=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=f,o=_[l];const S=k[l]+f-(p[l]+m[l]);let E=S;for(;i<o;){const X=h.charCodeAt(i);if(X===9)E+=4-(E+g[l])%4;else if(X===32)E++;else break;i++}const R=i;let D;R>=o?D=1:D=E-S,D>4&&(D=1);const F=S+D,U=e.push("list_item_open","li",1);U.markup=P;const G=[l,0];U.map=G,u&&(U.info=f-r-1===1?xB[h.charCodeAt(r)-48]:h.slice(r,f-1));const Y=e.tight,q=e.tShift[l],ae=e.sCount[l],de=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=R-p[l],e.sCount[l]=E,R>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||b)&&(a=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=de,e.tShift[l]=q,e.sCount[l]=ae,e.tight=Y,e.push("list_item_close","li",-1).markup=P,l=e.line,G[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let ne=!1;for(let X=0,he=I.length;X<he;X++)if(I[X](e,l,n,!0)){ne=!0;break}if(ne)break;if(u){if(f=bw(e,l),f<0)break;r=p[l]+m[l]}else if(f=kw(e,l),f<0)break;if(T!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=P:e.push("bullet_list_close","ul",-1).markup=P,N[1]=l,e.line=l,e.parentType=L,a&&AB(e,M),!0}function _w(e){return e===9||e===32}function MB(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=$T(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 v=r[f]+l[f],y=a[f];if(v<y){const T=i.charCodeAt(v);if(T===42||T===45||T===43){if(v+1>=y||_w(i.charCodeAt(v+1)))break}else if(T>=48&&T<=57&&v+1<y){let P=v+1;for(;;){if(P>=y){P=-1;break}const N=i.charCodeAt(P++);if(N>=48&&N<=57){if(P-v>=10){P=-1;break}continue}if((N===41||N===46)&&(P>=y||_w(i.charCodeAt(P))))break;P=-1;break}if(P>=0)break}}}const _=r[f]+l[f],k=a[f];if(d&&!NT(e,f,i,_,k))continue;let g=!1;for(let v=0,y=s.length;v<y;v++)if(s[v](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 rf(e){switch(e){case 9:case 32:return!0}return!1}function EB(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let T=!1;if(e.sCount[v]-e.blkIndent>3&&(T=!0),e.sCount[v]<0&&(T=!0),!T){const b=e.parentType;e.parentType="reference";let M=!1;for(let I=0,L=l.length;I<L;I++)if(l[I](e,v,y,!0)){M=!0;break}if(e.parentType=b,M)return null}const P=e.bMarks[v]+e.tShift[v],N=e.eMarks[v];return e.src.slice(P,N+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const v=c.charCodeAt(o);if(v===91)return!1;if(v===93){u=o;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!rf(v))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 v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!rf(v))break}let _=e.md.helpers.parseLinkTitle(c,o,i);for(;_.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,o,i,_)}let k;for(o<i&&m!==o&&_.ok?(k=_.str,o=_.pos):(k="",o=h,r=p);o<i&&rf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&k)for(k="",o=h,r=p;o<i&&rf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=Sh(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:k,href:f}),e.line=r),!0):!1}function pg(e){switch(e){case 9:case 32:return!0}return!1}const IB=65536;function hg(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function $B(e,t){if(e.lineFlags)return(e.lineFlags[t]&gu.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 ww(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 NB(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&&!pg(l)||r===45&&pg(l)||!$B(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!pg(y))return!1;i++}let a=hg(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const T=c[y].trim();if(!T){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(T))return!1;T.charCodeAt(T.length-1)===58?u.push(T.charCodeAt(0)===58?"center":"right"):T.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=hg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=ww(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 _=e.push("thead_open","thead",1);_.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let y=0;y<c.length;y++){const T=e.push("th_open","th",1);u[y]&&(T.attrs=[["style",`text-align:${u[y]}`]]);const P=e.push("inline","",0);P.content=c[y].trim(),P.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let P=0,N=h.length;P<N;P++)if(h[P](e,o,n,!0)){y=!0;break}if(y||(a=hg(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=ww(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>IB))break;if(o===t+2){const P=e.push("tbody_open","tbody",1);P.map=g=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let P=0;P<d;P++){const N=e.push("td_open","td",1);u[P]&&(N.attrs=[["style",`text-align:${u[P]}`]]);const b=e.push("inline","",0);b.content=c[P]?c[P].trim():"",b.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=f,e.line=o,!0}var LB=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 sc(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 lf=[["table",NB,["paragraph","reference"]],["code",mB],["fence",gB,["paragraph","reference","blockquote","list"]],["blockquote",hB,["paragraph","reference","blockquote","list"]],["hr",kB,["paragraph","reference","blockquote","list"]],["list",TB,["paragraph","reference","blockquote"]],["reference",EB],["html_block",bB,["paragraph","reference","blockquote"]],["heading",vB,["paragraph","reference","blockquote"]],["lheading",SB],["paragraph",MB]];var OB=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new LB;for(let e=0;e<lf.length;e++)this.ruler.push(lf[e][0],lf[e][1],{alt:(lf[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 _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(sc(e.env,"block",f[m].name,k-_,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 IT(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}},OT=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}};OT.prototype.Token=cs;const Sw=[["normalize",Z9],["block",YD],["inline",U9],["linkify",Y9],["replacements",iB],["smartquotes",cB],["text_join",uB]],PB={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},RB={parseLinkLabel:H0,parseLinkDestination:F0,parseLinkTitle:W0};function DB(){return{...PB}}function BB(){return{...RB}}var FB=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new OB,this.inline=new z9,this.ruler=new rB;for(let e=0;e<Sw.length;e++){const[t,n]=Sw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:DB(),helpers:BB(),normalizeLink:MT,normalizeLinkText:ET,validateLink:TT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new cT),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 OT(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();sc(e.env,"core",t[n].name,o-s,!0,!1)}H9(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&GD(e))return this.parse(pT(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 HB=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function wp(e){return!HB.test(e)}function ru(e,t){const n=e.indexOf(`
|
|
69
|
-
`,t);return n===-1?e.length:n}function If(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 Cw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function mg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function WB(e){if(e.length>3)return wp(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 zB=["","h1","h2","h3","h4","h5","h6"],UB=["","#","##","###","####","#####","######"],xw=0,gg=1,vg=2;function No(e,t,n,s){const o=new cs(e,t,n);return o.level=s,o.block=!0,o}function PT(e,t,n){const s=No("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new cs("text","",0);return o.content=e,s.children=[o],s}function jB(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(!wp(u))return!1;const d=zB[i],f=UB[i],h=No("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(PT(u,o,1));const p=No("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function qB(e,t,n){const s=No("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(PT(t,n,1)),e.push(No("paragraph_close","p",-1,0))}function VB(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function yg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function KB(e,t){const n=No("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function GB(e,t,n){const s=No("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=No("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=No("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new cs("text","",0);r.content=t,i.children=[r],e.push(i);const l=No("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=No("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function YB(e){const t=No("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function QB(e,t,n,s){if(!Cw(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=ru(e,l);if(Cw(e,l,c)&&If(e,l+3,c)){const u=No("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 XB(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?xw:vg,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=ru(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(!If(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!jB(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=yg(e,h),l+=1+r-h;continue}if(c===45){if(!mg(e,r,a))return null;const h=l;let p=r,m=l,_=null,k=null;for(;p<e.length;){const y=ru(e,p);if(!mg(e,p,y))break;const T=p+2,P=y===T+1?e[T]:e.slice(T,y);if(!WB(P))return null;_===null&&(_=KB(t,h)),k=GB(t,P,m),p=y<e.length?y+1:y,m++}if(_===null||k===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=ru(e,g);if(!If(e,g,y)){if(mg(e,g,y))return null;break}g=y<e.length?y+1:y,v++}_.map[1]=v,k.map[1]=v,YB(t),r=g,l=v;continue}if(c===96){const h=QB(e,r,a,l);if(!h)return null;t.push(h.token),r=yg(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=VB(e,r,a);let d;if(n===vg?d=wp(u):n===gg&&u===s?d=o:(d=wp(u),n===xw?(i&&(n=u===s?gg:vg),s=u,o=d,i=!0):n===gg&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!If(e,f,ru(e,f)))return null;qB(t,u,l),r=yg(e,f),l+=1+r-f}return t}const ZB=/[&<>"]/,Aw=/[&<>"]/g,JB=/&/g,eF=/[<>"]/g,tF={"&":"&","<":"<",">":">",'"':"""};function kg(e){return tF[e]||e}function Nn(e){if(e.length===0)return"";if(e.length<32)return ZB.test(e)?e.replace(Aw,kg):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(JB,"&"):t?e.replace(Aw,kg):e.replace(eF,kg)}const nF=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),sF=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function RT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(nF,(t,n,s)=>{if(n)return n;if(sF.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return Ch(i)?Ku(i):"�"}const o=I0(t);return o!==t?o:t})}const oF=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,iF=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,rF=/"/g;function za(e,t){const n=e.indexOf(`
|
|
70
|
-
`,t);return n===-1?e.length:n}function Sp(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 af(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function lF(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Sp(e,t,za(e,t))}function Tw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function aF(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function q0(e){return iF.test(e)?oF.test(e)?null:e.replace(rF,"""):e}function cF(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=q0(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
|
|
71
|
-
`}function Mw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function uF(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
72
|
-
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
73
|
-
`}function dF(e,t,n){const s=t+2;if(n===s+1)return uF(e,s);const o=q0(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
|
|
74
|
-
`}function fF(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 pF(e,t,n,s){if(!Tw(e,t,n))return null;const o=fF(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=za(e,l);if(Tw(e,l,a)&&Sp(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-${Nn(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${Nn(c)}</code></pre>
|
|
75
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function Ew(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=za(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!Sp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=cF(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=af(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=za(e,m);if(!Mw(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const _=e.slice(t,m);let k;if(_===r)k=l;else{let v=t;for(k=`<ul>
|
|
76
|
-
`;v<m;){const y=za(e,v),T=dF(e,v,y);if(T===null)return null;k+=T,v=y<e.length?y+1:y}k+=`</ul>
|
|
77
|
-
`,r=_,l=k}let g=af(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=za(e,g);if(!Sp(e,g,v)){if(Mw(e,g,v))return null;break}g=v<e.length?v+1:v}s?o.push(k):n+=k,t=g;continue}if(d===96){const m=pF(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=af(e,m.nextPos);continue}const f=aF(e,t,u);let h;if(f===a)h=c;else{const m=q0(f);if(m===null)return null;h=`<p>${m}</p>
|
|
78
|
-
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&lF(e,p))return null;s?o.push(h):n+=h,t=af(e,p)}return s?o.join(""):n}const hF={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Cp(e,t,n={},s){Qs(n);const o={...hF,...s||{}},i=mo(t);if(o.fallbackOnGlobalState!==!1&&i)return fg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),nc(n,i,()=>e.core.parse(t,n,e).tokens);let r=$f(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=yF(r,o.maxChunks)),Nf(t,r))return fg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),nc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return fg(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),nc(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&&gF(f,l),vF(a,f),l+=u.lineCount}return a})}function $f(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(`
|
|
79
|
-
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=kF(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const y=e.charCodeAt(g);if(y===32||y===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let y=g;for(;y<h&&e[y]===v;)y++;const T=y-g;T>=3&&(u?u.marker===v&&T>=u.length&&(u=null):u={marker:v,length:T})}}const _=p-f;o+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const k=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),s}function Nf(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!mF(e,t[o].end))return!0;return!1}function mF(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 gF(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 vF(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function yF(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 kF(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 DT=4e6,BT=8e4,bF=1e4,_F=200,wF=1e4,SF=200;function FT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function CF(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 Tr(e){return e.length===0?0:Xn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function xF(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 AF(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
80
|
-
`,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 TF(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 xF(e,n+1,e.length-1)?!AF(e,t):!1}function MF(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??wF:e.options.fullChunkSizeChars??bF),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??SF:e.options.fullChunkSizeLines??_F);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 dd=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=Tr(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=$f(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Nf(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,Tr(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!TF(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Tr(this.pending)),null;const n=$f(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Tr(this.pending)),null;const s=Nf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Tr(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=$f(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Nf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Tr(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:Tr(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Tr(this.pending);return MF(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(ud(e)&&dr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=mo(t);n&&(D0(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&&CF(r,a),this.options.retainTokens!==!1&&FT(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&&B0(t),n}catch(s){throw this.markedGlobalStateReason&&(dr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){rT(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 EF(e,t,n={},s={}){Qs(n);const o=new dd(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function IF(e,t,n={},s={}){Qs(n);const o=new dd(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function $F(e,t,n,s={},o={}){Qs(s);const i=new dd(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 NF(e,t,n,s={},o={}){Qs(s);const i=new dd(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 HT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??DT,o=e.options.autoUnboundedThresholdLines??BT;return t>=s||n>=o}function WT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??DT))return"yes";const s=e.options.autoUnboundedThresholdLines??BT;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function vu(e,t,n={},s={}){Qs(n);const o=mo(t);if(ud(n)&&dr(n),s.fallbackOnGlobalState!==!1&&o)return rT(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Xn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),nc(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new dd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){FT(i,l)}});if(o&&D0(n,o),r.feed(t),r.flushForce(n),o&&(B0(n),s.fallbackOnGlobalState===!1)){const l=Ki(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const oc=(e,t,n)=>e<t?t:e>n?n:e;function zT(e){return e.experimental?{...e,...e.experimental}:e}const Iw=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],$w=[{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 UT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function LF(e,t=Math.max(0,e/40|0),n={}){const s=zT(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Iw.length;l++){const a=Iw[l];if(e<=a.max){if(a.strategy!=="adaptive")return UT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:oc(Math.ceil(e/i),8e3,64e3),maxChunkLines:oc(Math.ceil(t/i),150,700),maxChunks:oc(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function Nw(e,t=Math.max(0,e/40|0),n={}){const s=zT(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<$w.length;l++){const a=$w[l];if(e<=a.max){if(a.strategy!=="adaptive")return UT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:oc(Math.ceil(e/i),8e3,64e3),maxChunkLines:oc(Math.ceil(t/i),150,700),maxChunks:oc(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var OF={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"]}}},PF={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},RF={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 Mh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Lf(e,t){if(Mh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const Lw=e=>Mh(e)?e:Promise.resolve(e);function yu(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 Nn(e)}}function el(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${yu(t[0])}="${Nn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${yu(o[0])}="${Nn(o[1])}"`}return n}function jT(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 ku(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
81
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Nn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
82
|
-
`;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${el(r)}>${t}</code></pre>
|
|
83
|
-
`}return`<pre><code${el(e.attrs)}>${t}</code></pre>
|
|
84
|
-
`}function xp(e){return!e.attrs||e.attrs.length===0?`<code>${Nn(e.content)}</code>`:`<code${el(e.attrs)}>${Nn(e.content)}</code>`}function r1(e){const t=Nn(e.content);return e.attrs?`<pre${el(e.attrs)}><code>${t}</code></pre>
|
|
85
|
-
`:`<pre><code>${t}</code></pre>
|
|
86
|
-
`}function DF(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="${Nn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Nn(n[0][1])}">`}return null}function Ow(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${yu(t[0][0])}="${Nn(t[0][1])}">`:t.length===2?`<a ${yu(t[0][0])}="${Nn(t[0][1])}" ${yu(t[1][0])}="${Nn(t[1][1])}">`:`<a${el(t)}>`}function BF(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 Pw(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 Ap(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+el(n);return s===0&&t&&(i+=" /"),`${i}>`}const FF={langPrefix:"language-",xhtmlOut:!1,breaks:!1},cf=Object.prototype.hasOwnProperty,En={code_inline(e,t){return xp(e[t])},code_block(e,t){return r1(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?RT(i.info).trim():"",{langName:l,langAttrs:a}=jT(r),c=n.highlight,u=Nn(i.content);if(!c)return ku(i,u,r,l,n);const d=c(i.content,l,a);return Mh(d)?d.then(f=>ku(i,f||u,r,l,n)):ku(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]],Ap(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
87
|
-
`:`<br>
|
|
88
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
89
|
-
`:`<br>
|
|
90
|
-
`:`
|
|
91
|
-
`},text(e,t){return Nn(e[t].content)},text_special(e,t){return Nn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Rw(e,t,n){const s=e.info?RT(e.info).trim():"",{langName:o,langAttrs:i}=jT(s),r=t.highlight,l=Nn(e.content);if(!r)return ku(e,l,s,o,t);const a=r(e.content,o,i);if(Mh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return ku(e,a||l,s,o,t)}function uf(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===En.text)return l.content.length===0?"":Nn(l.content);break;case"text_special":if(o.text_special===En.text_special)return l.content.length===0?"":Nn(l.content);break;case"softbreak":if(o.softbreak===En.softbreak)return r;break;case"hardbreak":if(o.hardbreak===En.hardbreak)return i;break;case"html_inline":if(o.html_inline===En.html_inline)return l.content;break;case"code_inline":if(o.code_inline===En.code_inline)return xp(l);break}const a=o[l.type];if(!a)return Ap(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Lf(c,l.type)}var HF=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...En}}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,_="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,y=k>0&&e[k-1].hidden?`
|
|
92
|
-
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const N=e[k+1],b=e[k+2],M=e[k+3];if(N.type==="paragraph_open"&&N.hidden&&b.type==="inline"&&M.type==="paragraph_close"&&M.hidden){_+=`${y}<li>${this.renderInlineTokens(b.children||[],s,o)}`,k+=3;continue}}if(k+2<e.length){const N=e[k+1],b=e[k+2];if(N.type==="inline"&&b.nesting===-1&&b.tag===g.tag&&!b.hidden){const M=DF(g,y);if(M!==null){_+=`${M+this.renderInlineTokens(N.children||[],s,o)}</${g.tag}>
|
|
93
|
-
`,k+=2;continue}}}if(v==="inline"){const N=g.children||[];if(N.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
94
|
-
`:`<br>
|
|
95
|
-
`,p=s.breaks?h:`
|
|
96
|
-
`,m=!0);const b=N[0];switch(b.type){case"text":if(l===En.text){_+=Nn(b.content);continue}break;case"text_special":if(a===En.text_special){_+=Nn(b.content);continue}break;case"softbreak":if(c===En.softbreak){_+=p;continue}break;case"hardbreak":if(u===En.hardbreak){_+=h;continue}break;case"html_inline":if(d===En.html_inline){_+=b.content;continue}break;case"code_inline":if(f===En.code_inline){_+=xp(b);continue}break}}_+=this.renderInlineTokens(N,s,o);continue}const T=i[v];if(!T){const N=g.attrs;if(!g.hidden){if(!N||N.length===0)switch(v){case"hr":_+=r?`<hr />
|
|
97
|
-
`:`<hr>
|
|
98
|
-
`;continue;case"heading_open":_+=`<${g.tag}>`;continue;case"heading_close":_+=`</${g.tag}>
|
|
99
|
-
`;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
|
|
100
|
-
`;continue;case"list_item_open":{const b=e[k+1];_+=y+(b&&(b.type==="inline"||b.hidden||b.nesting===-1&&b.tag==="li")?"<li>":`<li>
|
|
101
|
-
`);continue}case"list_item_close":_+=`</li>
|
|
102
|
-
`;continue;case"bullet_list_open":_+=`${y}<ul>
|
|
103
|
-
`;continue;case"bullet_list_close":_+=`</ul>
|
|
104
|
-
`;continue;case"blockquote_open":_+=y+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
105
|
-
`);continue;case"blockquote_close":_+=`</blockquote>
|
|
106
|
-
`;continue;case"ordered_list_open":_+=`${y}<ol>
|
|
107
|
-
`;continue;case"ordered_list_close":_+=`</ol>
|
|
108
|
-
`;continue;case"table_open":_+=`${y}<table>
|
|
109
|
-
`;continue;case"table_close":_+=`</table>
|
|
110
|
-
`;continue;case"thead_open":_+=`${y}<thead>
|
|
111
|
-
`;continue;case"thead_close":_+=`</thead>
|
|
112
|
-
`;continue;case"tbody_open":_+=`${y}<tbody>
|
|
113
|
-
`;continue;case"tbody_close":_+=`</tbody>
|
|
114
|
-
`;continue;case"tr_open":_+=`${y}<tr>
|
|
115
|
-
`;continue;case"tr_close":_+=`</tr>
|
|
116
|
-
`;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
|
|
117
|
-
`;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
|
|
118
|
-
`;continue}else if(N.length===1){const b=N[0];if(v==="ordered_list_open"&&b[0]==="start"){_+=`${y}<ol start="${Nn(b[1])}">
|
|
119
|
-
`;continue}if(v==="td_open"&&b[0]==="style"){_+=`${y}<td style="${Nn(b[1])}">`;continue}if(v==="th_open"&&b[0]==="style"){_+=`${y}<th style="${Nn(b[1])}">`;continue}}}_+=this.renderToken(e,k,s);continue}if(v==="code_block"&&T===En.code_block){_+=r1(g);continue}if(v==="fence"&&T===En.fence){_+=Rw(g,s);continue}if(v==="html_block"&&T===En.html_block){_+=g.content;continue}const P=T(e,k,s,o,this);typeof P=="string"?_+=P:_+=Lf(P,g.type)}return _}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 Lw(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 el(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?`
|
|
120
|
-
`:"",u=a?`>
|
|
121
|
-
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+el(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(cf.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),cf.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(cf.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(cf.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...FF,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===En.code_block)return r1(t);if(i==="html_block"&&o.html_block===En.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):Ap(t,r.xhtmlOut===!0);if(i==="fence"&&a===En.fence)return Rw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Lf(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,_=t.xhtmlOut===!0,k=_?`<br />
|
|
122
|
-
`:`<br>
|
|
123
|
-
`,g=t.breaks?k:`
|
|
124
|
-
`;if(e.length===1)return uf(e,t,n,this,s,k,g);let v="";for(let y=0;y<e.length;y++){const T=e[y];if(T.type==="link_open"&&!u&&!d&&y+2<e.length){const b=e[y+1];if(e[y+2].type==="link_close"&&BF(b)){const M=`${Ow(T)+uf([b],t,n,this,s,k,g)}</a>`;if(r===En.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=M+g,y+=3;continue}v+=M,y+=2;continue}}if(T.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${Ow(T)}</a>`,y+=1;continue}if(T.type==="em_open"&&!f&&!h&&y+2<e.length){const b=e[y+1];if(e[y+2].type==="em_close"&&Pw(b)){v+=`<em>${uf([b],t,n,this,s,k,g)}</em>`,y+=2;continue}}if(T.type==="strong_open"&&!p&&!m&&y+2<e.length){const b=e[y+1];if(e[y+2].type==="strong_close"&&Pw(b)){v+=`<strong>${uf([b],t,n,this,s,k,g)}</strong>`,y+=2;continue}}switch(T.type){case"text":if(o===En.text){const b=T.content.length===0?"":Nn(T.content);if(a===En.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=b+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=b;continue}break;case"text_special":if(i===En.text_special){T.content.length!==0&&(v+=Nn(T.content));continue}break;case"softbreak":if(r===En.softbreak){v+=g;continue}break;case"hardbreak":if(l===En.hardbreak){v+=k;continue}break;case"html_inline":if(a===En.html_inline){for(v+=T.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===En.code_inline){v+=xp(T);continue}break}const P=s[T.type];if(!P){v+=T.block?this.renderToken(e,y,t):Ap(T,_);continue}const N=P(e,y,t,n,this);typeof N=="string"?v+=N:v+=Lf(N,T.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await Lw(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+=`
|
|
125
|
-
`;break}}return s}},WF=HF;const zF=[],bg=4096;function UF(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
|
|
126
|
-
`,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 jF(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 qF(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(!qT(e[n],t[n]))return!1;return!0}function qT(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||!jF(e.attrs,t.attrs)||!qF(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function Dw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var VF=class{core;cache=null;stats=Dw();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=Dw(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Qs(s??o?.env),!o||s&&s!==o.env){const E=s??{},R=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,F=!!n.options?.streamChunkedFallback,U=!R&&D,G=F||U,Y=n.options?.streamChunkAdaptive!==!1,q=n.options?.streamChunkTargetChunks??8,ae=n.options?.streamChunkSizeChars,de=n.options?.streamChunkSizeLines,ne=n.options?.streamChunkMaxChunks,X=!!n.__explicitStreamChunkConfig,he=n.options?.autoTuneChunks!==!1,Oe=n.options?.streamChunkFenceAware??!0,je=n.options?.streamLargeCachePolicy??"retain",it=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ce=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let z,Q=!1;if(je==="skip"&&(Q=e.length>=it,!Q&&ce!==void 0&&(z=Xn(e),Q=z>=ce)),Q){const W=this.parseFullDocument(e,E,n,z,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(E,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Ki(E)?.unbounded}),W.tokens}else if(G){const W=(pe,ke,Te)=>pe<ke?ke:pe>Te?Te:pe;z===void 0&&(z=Xn(e));const Z=he&&!X?Nw(e.length,z,n.options):null,ue=Z?.maxChunkChars??(Y?W(Math.ceil(e.length/q),8e3,64e3):ae??1e4),le=Z?.maxChunkLines??(Y?W(Math.ceil(z/q),150,700):de??200),me=Z?.maxChunks??(Y?W(Math.ceil(e.length/64e3),q,32):ne),j=e.length>0&&e.charCodeAt(e.length-1)===10,ee=U&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Z?.strategy!=="plain";if((F||ee)&&(e.length>=ue*2||z>=le*2)&&j){const pe=Cp(n,e,E,{maxChunkChars:ue,maxChunkLines:le,fenceAware:Z?.fenceAware??Oe,maxChunks:me});return this.cache={src:e,tokens:pe,env:E,lineCount:z,lastSegment:void 0,globalStateReason:mo(e)},this.updateCacheLineCount(this.cache,z),this.recordChunkedParseResult(E,F?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const oe=this.parseFullDocument(e,E,n,z);return z=oe.lineCount,this.cache={src:e,tokens:oe.tokens,env:E,lineCount:z,lastSegment:void 0,globalStateReason:mo(e)},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(E,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Ki(E)?.unbounded}),oe.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ls(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=mo(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):mo(e),a=r||l;if(a){const E=s??o.env;dr(E);const R=mo(e),D=this.parseFullDocument(e,E,n),F=D.tokens,U=D.lineCount;return this.cache={src:e,tokens:F,env:E,lineCount:U,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(E,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Ki(E)?.unbounded}),F}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 E=s??o.env,R=this.parseFullDocument(e,E,n),D=R.tokens,F=R.lineCount;return this.cache={src:e,tokens:D,env:E,lineCount:F,lastSegment:void 0,globalStateReason:mo(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(E,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Ki(E)?.unbounded}),D}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const E=o.lineCount??Xn(o.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,E);let D=null;const F=n.options?.streamContextParseStrategy??"chars",U=n.options?.streamContextParseMinChars??200,G=n.options?.streamContextParseMinLines??2;let Y;const q=()=>(Y===void 0&&(Y=Xn(u)),Y),ae=this.canDirectlyParseAppend(o),de=ae&&this.shouldUseUnboundedAppend(e,o,u);let ne=!1;if(!ae)switch(F){case"lines":ne=q()>=G;break;case"constructs":if(u.length>=U){ne=!0;break}if(UF(u)){ne=!0;break}ne=q()>=G;break;case"chars":default:ne=u.length>=U}if(R>0&&ne){const Oe=this.getTailLines(o.src,R)+u;try{const je=this.core.parse(Oe,o.env,n).tokens,it=je.findIndex(ce=>ce.map&&typeof ce.map[1]=="number"&&ce.map[1]>R);if(it!==-1){const ce=je.slice(it),z=E-R;z!==0&&this.shiftTokenLines(ce,z),D={tokens:ce}}}catch{D=null}}else D=null;if(!D){const Oe=E;if(de)D={tokens:vu(n,u,o.env,{mode:"stream"})},Oe>0&&this.shiftTokenLines(D.tokens,Oe);else{const je=this.core.parse(u,o.env,n);Oe>0&&this.shiftTokenLines(je.tokens,Oe),D=je}}let X=0;if(o.tokens.length>0&&D.tokens.length>0){const Oe=o.tokens[o.tokens.length-1],je=D.tokens[0];try{Oe.type==="inline"&&je.type==="inline"&&(je.children&&je.children.length>0&&(Oe.children||(Oe.children=[]),this.appendTokens(Oe.children,je.children)),Oe.content=(Oe.content||"")+(je.content||""),X=1)}catch{X=0}}const he=o.tokens.length;if(D.tokens.length>X){const Oe=o.tokens,je=D.tokens,it=Math.min(Oe.length,je.length-X);let ce=0;for(let z=it;z>0;z--){let Q=!0;for(let oe=0;oe<z;oe++){const W=Oe[Oe.length-z+oe],Z=je[X+oe];if(!qT(W,Z)){Q=!1;break}}if(Q){ce=z;break}}ce>0&&(X+=ce),je.length>X&&this.appendTokens(o.tokens,je,X)}if(o.src=e,o.globalStateReason=null,o.lineCount=E+(Y??q()),o.tokens.length>he){const Oe=this.getLastSegment(o.tokens,e,he,o.tokens.length,e.length-u.length,E);Oe?o.lastSegment=Oe:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,de&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ls(o.env,{area:"stream",path:de?"stream-unbounded-append":"stream-append",reason:de?"large-delta":"safe-append",unbounded:de}),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",ls(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,_=!h&&!u&&p,k=m||_,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,P=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,b=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let I=u&&o.lineCount!==void 0?o.lineCount+Xn(u):void 0;if(k){I===void 0&&(I=Xn(e));const E=(q,ae,de)=>q<ae?ae:q>de?de:q,R=b&&!N?Nw(e.length,I,n.options):null,D=R?.maxChunkChars??(g?E(Math.ceil(e.length/v),8e3,64e3):y??1e4),F=R?.maxChunkLines??(g?E(Math.ceil(I/v),150,700):T??200),U=R?.maxChunks??(g?E(Math.ceil(e.length/64e3),v,32):P),G=e.length>0&&e.charCodeAt(e.length-1)===10,Y=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((m||Y)&&(e.length>=D*2||I>=F*2)&&G){const q=Cp(n,e,d,{maxChunkChars:D,maxChunkLines:F,fenceAware:R?.fenceAware??M,maxChunks:U});return this.cache={src:e,tokens:q,env:d,lineCount:I,lastSegment:void 0,globalStateReason:mo(e)},this.updateCacheLineCount(this.cache,I),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),q}}const L=this.parseFullDocument(e,d,n,I),S=L.tokens;return I=L.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:I,lastSegment:void 0,globalStateReason:mo(e)},this.updateCacheLineCount(this.cache,I),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Ki(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=Ki(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",ls(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!Ki(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ls(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=mo(e);ud(t)&&dr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?WT(n,e.length,s):"no";if(r==="yes"){const a=vu(n,e,t);return ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Xn(e):0)}}let l=s;if(r==="need-lines"&&(l=Xn(e),HT(n,e.length,l))){const a=vu(n,e,t);return ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Xn(e):0),{tokens:nc(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:Xn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
127
|
-
`))return null;const 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(`
|
|
128
|
-
`);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+Xn(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(`
|
|
129
|
-
`,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??zF}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??Xn(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(-bg))+t,s=mo(n);return e.globalStateCarry=n.length>bg?n.slice(n.length-bg):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(`
|
|
130
|
-
`,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(`
|
|
131
|
-
`,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??Xn(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+Xn(i);t.lineCount=m;const _=this.getDocLineCount(e,m);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,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 _=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??Xn(t.src);t.tokens.splice(_,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=k+Xn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const y=t.tokens[h.tbodyOpenIndex];y?.map&&(y.map[1]=v)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
132
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
133
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,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=Xn(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 Bw={default:PF,zero:RF,commonmark:OF};function KF(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function GF(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 Fw(e){return e.experimental?{...e,...e.experimental}:e}function Yo(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 Hw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(Yo(t,o)||Yo(e,o))return!0}return!1}function Ww(e,t,n){return Yo(t,n)||Yo(e,n)}function zw(e,t){const n=Ki(e)?.chunk;if(n?.fallback){ls(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}ls(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function YF(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=Bw[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=Fw(n),typeof n.quotes=="string"){const b=n.quotes;b.length>=4?n.quotes=[b[0],b[1],b[2],b[3]]:n.quotes=["“","”","‘","’"]}let r=Hw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Hw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Ww(i?.options,o,"fullChunkedFallback"),c=Ww(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new FB;let p=null;const m=()=>(p||(p=new WF(n)),p);let _=null;const k=()=>(_||(_=new VF(h)),_);let g=null;const v=()=>(g||(g=new cT),g),y=b=>!u&&!!d&&!GF(b,d),T=(b,M)=>s==="default"&&!u&&p===null&&f!==null&&b.parse===f&&y(b)&&!b.stream.enabled&&M<(b.options.autoUnboundedThresholdChars??4e6)&&b.options.html===!1&&b.options.xhtmlOut===!1&&b.options.breaks===!1&&b.options.langPrefix==="language-"&&b.options.linkify===!1&&b.options.typographer===!1&&b.options.highlight===null,P=(b,M)=>s==="default"&&!u&&y(b)&&!b.stream.enabled&&!b.options.fullChunkedFallback&&M<(b.options.autoUnboundedThresholdChars??4e6)&&b.options.html===!1&&b.options.linkify===!1&&b.options.typographer===!1,N={core:h,block:h.block,inline:h.inline,get linkify(){const b=v();return Object.defineProperty(this,"linkify",{value:b,writable:!0,configurable:!0}),b},get renderer(){const b=m();return Object.defineProperty(this,"renderer",{value:b,writable:!0,configurable:!0}),b},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(b){const M=Fw(b);return this.options={...this.options,...M},(Yo(b,"fullChunkSizeChars")||Yo(b,"fullChunkSizeLines")||Yo(b,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Yo(b,"streamChunkSizeChars")||Yo(b,"streamChunkSizeLines")||Yo(b,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Yo(b,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Yo(b,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,_&&(_.reset(),_.resetStats())),this},configure(b){const M=typeof b=="string"?Bw[b]:b;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const I=M.components;I.core?.rules&&this.core.ruler.enableOnly(I.core.rules),I.block?.rules&&this.block.ruler.enableOnly(I.block.rules),I.inline?.rules&&this.inline.ruler.enableOnly(I.inline.rules),I.inline2?.rules&&this.inline.ruler2.enableOnly(I.inline2.rules)}return this},enable(b,M){const I=Array.isArray(b)?b:[b],L=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const E of L){if(!E)continue;const R=E.enable(I,!0);for(let D=0;D<R.length;D++)S.add(R[D])}if(!M){const E=I.filter(R=>!S.has(R));if(E.length)throw new Error(`Rules manager: invalid rule name ${E.join(", ")}`)}return this},disable(b,M){const I=Array.isArray(b)?b:[b],L=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const E of L){if(!E)continue;const R=E.disable(I,!0);for(let D=0;D<R.length;D++)S.add(R[D])}if(!M){const E=I.filter(R=>!S.has(R));if(E.length)throw new Error(`Rules manager: invalid rule name ${E.join(", ")}`)}return this},use(b,...M){const I=typeof b=="function"?b:b&&typeof b.default=="function"?b.default:void 0;if(!I)throw new TypeError("MarkdownIt.use: plugin must be a function");const L=[this,...M],S=b;return u=!0,I.apply(S,L),this},render(b,M){if(T(this,b.length)){M!==void 0&&Qs(M);const S=Ew(b);if(S!==null)return M!==void 0&&ls(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const I=M??{},L=this.parse(b,I);return m().render(L,this.options,I)},async renderAsync(b,M){if(T(this,b.length)){M!==void 0&&Qs(M);const S=Ew(b);if(S!==null)return M!==void 0&&ls(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const I=M??{},L=this.parse(b,I);return m().renderAsync(L,this.options,I)},renderIterable(b,M={}){const I=this.parseIterable(b,M);return m().render(I,this.options,M)},async renderAsyncIterable(b,M={}){const I=await this.parseAsyncIterable(b,M);return m().renderAsync(I,this.options,M)},renderInline(b,M={}){const I=this.parseInline(b,M);return m().render(I,this.options,M)},validateLink:TT,normalizeLink:MT,normalizeLinkText:ET,utils:iD,helpers:{...KD},parse(b,M){if(typeof b!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&Qs(M),P(this,b.length)){const E=XB(b);if(E!==null)return M!==void 0&&ls(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),E}const I=M??{};let L;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const E=WT(this,b.length);if(E==="yes"){const R=vu(this,b,I);return ls(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}E==="need-lines"&&(L=Xn(b))}if(!this.stream.enabled){const E=b.length,R=this.options.autoTuneChunks!==!1,D=r,F=!a&&y(this),U=!!this.options.fullChunkedFallback,G=F&&E>=2e5;let Y;(U||G||L!==void 0)&&(Y=L??Xn(b));const q=(U||G)&&R&&!D?LF(E,Y,this.options):null;if(U||G){const ae=Y??0;if(U?E>=(this.options.fullChunkThresholdChars??2e4)||ae>=(this.options.fullChunkThresholdLines??400):G){if(q&&q.strategy!=="plain"){const de=Cp(this,b,I,{maxChunkChars:q.maxChunkChars,maxChunkLines:q.maxChunkLines,fenceAware:q.fenceAware,maxChunks:q.maxChunks});return M&&zw(M,U?"explicit-full-chunk":"default-large-string"),de}if(U){const de=(Q,oe,W)=>Q<oe?oe:Q>W?W:Q,ne=this.options.fullChunkAdaptive!==!1,X=this.options.fullChunkTargetChunks??8,he=de(Math.ceil(E/X),8e3,64e3),Oe=de(Math.ceil(ae/X),150,700),je=ne?he:this.options.fullChunkSizeChars??1e4,it=ne?Oe:this.options.fullChunkSizeLines??200,ce=ne?de(Math.ceil(E/64e3),X,32):this.options.fullChunkMaxChunks,z=Cp(this,b,I,{maxChunkChars:je,maxChunkLines:it,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ce});return M&&zw(M,"explicit-full-chunk"),z}}}if(L!==void 0&&y(this)&&HT(this,E,Y??L)){const ae=vu(this,b,I);return ls(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ae}}const S=mo(b);return ls(M,{area:"parse",path:"plain",reason:"default-plain"}),nc(I,S,()=>h.parse(b,I,this).tokens)},parseIterable(b,M={}){return Qs(M),EF(this,b,M)},parseAsyncIterable(b,M={}){return Qs(M),IF(this,b,M)},parseIterableToSink(b,M,I={}){return Qs(I),$F(this,b,M,I)},parseAsyncIterableToSink(b,M,I={}){return Qs(I),NF(this,b,M,I)},parseInline(b,M={}){if(typeof b!="string")throw new TypeError("Input data should be a String");Qs(M),ud(M)&&dr(M);const I=h.createState(b,M,this);return I.inlineMode=!0,h.process(I),I.tokens}};if(N.stream={enabled:!!n.stream,parse(b,M){return N.stream.enabled?k().parse(b,M,N):N.parse(b,M??{})},reset(){k().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const b=i.components;b.core?.rules&&N.core.ruler.enableOnly(b.core.rules),b.block?.rules&&N.block.ruler.enableOnly(b.block.rules),b.inline?.rules&&N.inline.ruler.enableOnly(b.inline.rules),b.inline2?.rules&&N.inline.ruler2.enableOnly(b.inline2.rules)}return d=KF(N),f=N.parse,N}var QF=YF;const VT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],XF=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],KT=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],ZF=["svg","g","path"],JF=["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"],eH=["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"],tH=["action","data","href","src","srcset","poster","xlink:href","formaction"],nH=["script"],sH=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],sa=new Set(VT),oH=new Set(KT),Yu=new Set([...VT,...XF,...KT,...ZF]),GT=new Set([...Yu,...JF]),iH=new Set(eH),rH=new Set(tH),fd=new Set(nH),YT=new Set(sH);function QT(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 lH={amp:"&",bsol:"\\",colon:":",newline:`
|
|
134
|
-
`,sol:"/",tab:" "};function XT(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 lH[String(o??"").toLowerCase()]??t})}const df=new Set(["http","https","mailto","tel"]),aH=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),xl=new Set(["http","https"]);function ZT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function cH(e,t,n){if(!bu(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function bu(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function uH(e,t){return t==="href"||t==="xlink:href"?bu(e,t)?df:xl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?xl:(bu(e,t),df)}function Ul(e,t={}){const n=QT(XT(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=ZT(n);return i?i==="file"?!cH(n,s,o):bu(s,o)?aH.has(i):!uH(s,o).has(i):!1}function dH(e){const t=XT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=ZT(QT(t).toLowerCase());return n==="http"||n==="https"}function fH(e,t={}){const n=String(e??"").trim();return n?Ul(n,t)?"":n:""}function Uw(e){return fH(e,{tagName:"img",attrName:"src"})}function pH(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,_){return f[h].nesting===1&&f[h].attrJoin("class",t),_.renderToken(f,h,p,m,_)}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 _,k=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);const y=Math.floor((_-g)/a);if(y<i)return!1;_-=(_-g)%a;const T=f.src.slice(g,_),P=f.src.slice(_,v);if(!c(P,T))return!1;if(m)return!0;let N=h;for(;N++,!(N>=p||(g=f.bMarks[N]+f.tShift[N],v=f.eMarks[N],g<v&&f.sCount[N]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[N]-f.blkIndent>=4)){for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);if(!(Math.floor((_-g)/a)<y)&&(_-=(_-g)%a,_=f.skipSpaces(_),!(_<v))){k=!0;break}}const b=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=N;const I=f.push("container_"+t+"_open","div",1);I.markup=T,I.block=!0,I.info=P,I.map=[h,N],f.md.block.tokenize(f,h+1,N);const L=f.push("container_"+t+"_close","div",-1);return L.markup=f.src.slice(g,_),L.block=!0,f.parentType=b,f.lineMax=M,f.line=N+(k?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function hH(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 _=0;_<a.length;_++){const k=a[_];if(k==="\\"){_++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=_;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 mH(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(pH,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
135
|
-
`}})}),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 T=0,P=-1;for(let N=0;N<m.length;N++)if(m[N]==="{"?T++:m[N]==="}"&&T--,T===0){P=N+1;break}P>0&&(h=m.slice(0,P))}h||(f=d||void 0)}if(o)return!0;const _=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=s;){const T=i.bMarks[k]+i.tShift[k],P=i.eMarks[k];if(i.src.slice(T,P).trim()===":::"){g=!0;break}k++}g||(k=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!_},f&&v.attrSet("data-args",f),h)try{const T=JSON.parse(h);for(const[P,N]of Object.entries(T)){const b=N!=null&&typeof N=="object";v.attrSet(`data-${P}`,b?JSON.stringify(N):String(N))}}catch{const T=hH(h);if(T)for(const[P,N]of Object.entries(T)){const b=N!=null&&typeof N=="object";v.attrSet(`data-${P}`,b?JSON.stringify(N):String(N))}else v.attrSet("data-attrs",h)}const y=[];for(let T=n+1;T<k;T++){const P=i.bMarks[T]+i.tShift[T],N=i.eMarks[T];y.push(i.src.slice(P,N))}if(y.some(T=>T.trim().length>0)){let T=y.join(`
|
|
136
|
-
`);T.endsWith(`
|
|
137
|
-
`)||(T+=`
|
|
138
|
-
`),T.endsWith(`
|
|
139
|
-
|
|
140
|
-
`)||(T+=`
|
|
141
|
-
`);const P=i.tokens[i.tokens.length-1];P&&(P.raw=T);const N=[];i.md.block.parse(T,i.md,i.env,N),i.tokens.push(...N)}return g&&i.push("vmr_container_close","div",-1),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Oo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jn(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 Eh(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 gH=/^[a-z][a-z0-9_-]*$/;function jw(e){return gH.test(String(e??"").trim().toLowerCase())}function li(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return jw(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)?"":jw(o)?o:""}function wc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=li(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function vH(...e){const t=new Set,n=[];for(const s of e)for(const o of wc(s))t.has(o)||(t.add(o),n.push(o));return n}function yH(e){const t=wc(e);return{key:t.join(","),tags:t}}function JT(e){return li(e)}function kH(e,t){const n=String(e??""),s=li(t);if(!s)return!1;const o=Oo(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 eM(e,t){const n=li(t);return!!n&&!Yu.has(n)&&!kH(e,n)}function bH(e,t){const n=String(e??""),s=li(t);if(!s)return n;const o=Oo(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 tM=sa,_H=Yu,nM=new Set(oH);nM.delete("details");const wH=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,SH=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,l1=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,CH=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Tp(e){return(e.match(l1)?.[1]??"").toLowerCase()}function V0(e){return/^\s*<\s*\//.test(e)}function K0(e,t){return tM.has(t)||/\/\s*>\s*$/.test(e)}function xH(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=Tp(i);if(r===t){if(V0(i)){if(n===0)return s;n--;continue}K0(i,r)||n++}}return-1}function AH(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=Tp(o);if(i===t){if(V0(o)){n>0&&n--;continue}K0(o,i)||n++}}return n}function qw(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Oo(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 TH(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Oo(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 Mp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function MH(e){const t=e;return t.meta||(t.meta={}),t.meta}function _g(e,t,n){const s=MH(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function EH(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Oo(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(`
|
|
142
|
-
`),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();_g(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*${Oo(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const _=m??(h.type==="html_inline"?Tp(p):"");if(!(_&&t.has(_))){r(p);return}const k=V0(p),g=!k&&K0(p,_);if(k){if(!s.length||s[s.length-1].tag!==_){r(p);return}c(p);return}if(r(p),g){_g(h,p,"");return}s.push({tag:_,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,_=!0;for(const k of h.children){const g=Mp(k),v=k.type==="html_inline"?Tp(g):"",y=v&&t.has(v);let T=g;if(_&&p&&g&&(s.length||y)){const P=p.indexOf(g,m);if(P!==-1)a(p.slice(m,P)),T=p.slice(P,P+g.length),m=P+g.length;else{if(s.length&&!y)continue;_=!1}}f(k,T,v)}_&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=Mp(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
|
|
143
|
-
`:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)_g(h.token,h.raw,h.inner)}function IH(e){return/^\s*<\s*[!?]/.test(e)}function $H(e){const t=new Set(_H);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 Vw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function NH(e,t){let n=null;for(const i of e.matchAll(wH)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Vw(l,t)&&jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(SH)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Vw(l,t)&&jn(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 LH(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function OH(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(LH(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(l1);if(!h){i("<",c),u=d+1;continue}const p=jn(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),_=(h[1]??"").toLowerCase();t.has(_)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=NH(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+=Mp(a),o=s.buffer;const c=jn(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=Mp(a),u=(c.match(l1)?.[1]??"").toLowerCase();if(u&&t.has(u)&&jn(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 PH=["a","span","strong","em","b","i","u"];function RH(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=li(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 v of m){const y=li(String(v??""));y&&p.add(y)}const _=$H(Array.from(p)),k=new Set(PH);for(const v of p)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:_,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!_.has(v)||nM.has(v)}},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 _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[_]},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 _ of h){const k=_;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=OH(v,p);if(k.children=y.children,y.pendingBuffer){const T=g.lastIndexOf(y.pendingBuffer);if(T!==-1){const P=g.slice(0,T);k.content=P,typeof k.raw=="string"&&(k.raw=P)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}EH(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:_}=s(f),k=[];for(let g=0;g<h.length;g++){const v=h[g];if(k.length>0){const[T,P]=k[k.length-1];if(g!==P){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const N=String(v.content??v.raw??"");if(N){const b=h[P],M=`${String(b.content||"")}
|
|
144
|
-
${N}`,I=jn(M),L=I===-1?null:qw(M,T,I+1);if(L){const S=M.slice(0,L.end),E=M.slice(L.end);b.content=S,b.loading=!1,h.splice(g,1),k.pop();const R=d(b,E)?[]:c(E,u(h,g,"paragraph"));R.length&&h.splice(g,0,...R),g--;continue}b.content=M,b.loading!==!1&&(b.loading=!0)}h.splice(g,1),g--;continue}}const y=o(v);if(y){if(IH(y))continue;const T=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),P=/^\s*<\s*\//.test(y);if(!T||!_(T))continue;if(i(v,y),!P)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(y)&&TH(y,T)>0&&k.push([T,g]);else if(k.length>0&&T&&k[k.length-1][0]===T){const[,N]=k[k.length-1],b=h[N];b.content=`${String(b.content||"")}
|
|
145
|
-
${y}`,b.loading=!1,k.pop(),h.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const T=v.content||"",P=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(T);if(T){const[,N]=k[k.length-1],b=h[N];b.content=`${b.content||""}
|
|
146
|
-
${T}`,b.loading!==!1&&(b.loading=!P)}P&&k.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=N=>{let b=g.get(N);return b||(b=new RegExp(`<\\s*${N}\\b`,"i"),g.set(N,b)),b},T=N=>{let b=v.get(N);return b||(b=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),v.set(N,b)),b},P=[];for(let N=0;N<h.length;N++){const b=h[N],M=String(b.content??"");if(P.length>0){const L=P[P.length-1],S=h[L.index],E=b.type==="html_block"?T(L.tag).exec(M):null;if(E){const F=E.index+E[0].length,U=M.slice(0,F),G=M.slice(F);S.content=`${String(S.content??"")}
|
|
147
|
-
${U}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),P.pop();const Y=d(S,G)?[]:c(G,u(h,N,"paragraph"));Y.length?h.splice(N,1,...Y):(h.splice(N,1),N--);continue}if(b.type!=="inline")continue;const R=Array.isArray(b.children)?b.children:[],D=xH(R,L.tag);if(D!==-1){const F=R.slice(0,D+1),U=R.slice(D+1),G=F.map(Y=>String(Y?.content??Y?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
148
|
-
${G}`,Array.isArray(S.children)&&S.children.push(...F),U.length){const Y=U.map(q=>String(q.content??q.raw??"")).join("");if(Y.trim()){const q=Y.replace(/^\s+/,"");if(d(S,Y))h.splice(N,1),N--;else if(q.startsWith("<"))h.splice(N,1,{type:"html_block",content:q});else{const ae=c(Y,u(h,N,"paragraph"));h.splice(N,1,...ae)}}else h.splice(N,1),N--}else h.splice(N,1),N--;P.pop();continue}S.content=`${String(S.content??"")}
|
|
149
|
-
${M}`,Array.isArray(S.children)&&S.children.push(...R),h.splice(N,1),N--;continue}if(b.type!=="inline")continue;const I=Array.isArray(b.children)?b.children:[];for(const L of m)if((I.length?AH(I,L):y(L).test(M)&&!T(L).test(M)?1:0)>0){P.push({tag:L,index:N});break}}}{let g=0;for(let v=0;v<h.length;v++){const y=h[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const b=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(b.startsWith("!")||b.startsWith("?")){v.loading=!1;continue}if(m.has(b)){const D=String(v.content??""),F=jn(D),U=F===-1?null:qw(D,b,F+1);v.loading=U?!1:v.loading!==void 0?v.loading:!0;const G=U?.start??-1,Y=U?U.end-U.start:0;if(G!==-1){const q=D.slice(0,G+Y);let ae="";F!==-1&&F<G&&(ae=D.slice(F+1,G)),v.children=[{type:b,content:ae,raw:q,attrs:[],tag:b,loading:!1}],v.content=q,v.raw=q;const de=c(D.slice(G+Y)||"","text");de.length&&h.splice(g+1,0,...de)}else v.children=[{type:b,content:"",raw:D,attrs:[],tag:b,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(b))continue;v.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let I;for(;(I=M.exec(v.content||""))!==null;)I[1],I[2]||I[3]||I[4];const L=String(v.content??""),S=new RegExp(`<\\/\\s*${b}\\s*>`,"i").exec(L),E=S?S.index:-1,R=S?S[0].length:0;if(E!==-1){const D=L.slice(0,E+R),F=(L.slice(E+R)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:D,tag:b,loading:!1}],v.content=D,v.raw=D,F&&h.splice(g+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else v.children=[{type:"html_block",content:v.content,tag:b,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const b=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=v.children[1],I=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&I===b)continue;p.has(b)?(v.children[0].loading=!0,v.children[0].tag=b,v.children.push({type:"html_inline",tag:b,loading:!0,content:`</${b}>`})):v.children=[{type:"html_block",loading:!0,tag:b,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const b=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(b))continue;v.children=[{type:"html_block",loading:!1,tag:b,content:v.children.map(M=>M.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),T=v,P=T.children[0];if(P?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(T.children.length=0);continue}const N=String(P.content??y).match(CH)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(y)||tM.has(N)){T.children=[{type:"html_inline",content:y}];continue}T.children.length=0}}})}function DH(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 BH(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&&!DH(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 sM=/\.([a-z0-9]{1,15})$/i,FH=/[_()[\]{}<>]/u,HH=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,WH=/[?#@]/u,zH=/[\\/]/u,UH=/^[\p{L}\p{N}./\\-]+$/u,jH=/^[A-Za-z0-9-]{1,63}$/u,qH=/^xn--[a-z0-9-]{2,59}$/i,VH=/^(?:[A-Z]{1,6}|\d{1,8})$/u,KH=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,GH=/文件名\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,YH=/文件名\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,QH=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,XH=new Set(["ai","md","py","rs","sh","zip"]),oM=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),ZH=new Set([...oM,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),JH=new Set(["com","dev","io","page","site"]),eW=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),tW=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 Qu(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function wg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Qu(n)?n:void 0}function Kw(e,t){if(!Qu(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 Gw(e){const t=pd(e);return Qu(t)?t:void 0}function nW(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Yw(e,t){if(!Qu(t))return;const n=String(e??"").trim().split(/\s+/u).map(nW).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>Ep(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>Ep(o,{marketTicker:!0}))&&(s.marketTicker=!0),Qu(s)?s:void 0}function cl(e,t=!1){let n;return{options(s){return t||s==null?Kw(e,n):Kw(e,wg(Gw(s),Yw(s,n)))},remember(s){const o=Gw(s);n=t?wg(n,o):wg(o,Yw(s,n))},reset(){n=void 0}}}function Qw(e){return jH.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function sW(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Qw(n)||qH.test(n)?t.every(Qw):!1}function iM(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function oW(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function iW(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function rM(e,t,n){const s=oW(t);return iM(e)&&iW(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function pd(e){const t=String(e??"");return{explicitFilename:GH.test(t),filename:YH.test(t),marketTicker:QH.test(t)}}function rW(e){return sW(e.split(/[\\/]/)[0]??"")}function lW(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function aW(e){if(FH.test(e)||!UH.test(e))return!0;if(zH.test(e))return!rW(e);const t=e.replace(sM,"");return iM(t)?!0:t.split(".").filter(Boolean).some(lW)}function cW(e,t,n){if(!(n?ZH:oM).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?KH:VH).test(s)}function Ep(e,t={}){if(!e||HH.test(e)||WH.test(e))return!1;const n=e.match(sM);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return cW(e,s,t.marketTicker===!0)?!0:tW.has(s)?!XH.has(s)||t.filename?!0:aW(e):!!(t.explicitFilename&&JH.has(s)||t.filename&&eW.has(s))}const Xw=["!"];function po(e){return{type:"text",content:e,raw:e}}function Al(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Tl(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Mr(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 uW(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(po(t))}}function Zw(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 dW(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function fW(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 pW(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 hW(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=mW(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function mW(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=pd(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=pW(e,s,i),l=dW(o);if(o.markup==="linkify"&&r&&!rM(r,l,t)&&Ep(r,n)){e.splice(s,i-s+1,po(r));continue}const a=Zw(l,Xw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Zw(u.content,Xw);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let k=c+1;k<i;k++){const g=e[k];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 _=l;if(a!==-1)_=l.slice(0,a);else if(p){const k=encodeURI(p);if(k&&l.endsWith(k))_=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(_=l.slice(0,v))}}_!==l&&fW(o,_),p&&e.splice(i+1,0,po(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(po(r));const c=i[1],u=l[1].length;Al(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(Mr(c,d,!e[s+4]?.content?.startsWith(")"))),Tl(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(po(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(po(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=""),Al(a,f),a.push(Mr(c,h,!e[s+4]?.content?.startsWith(")"))),Tl(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(po(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(Mr(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(po(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(Mr(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(po(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;Al(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,_=e[p];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const 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;Tl(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(po(l)),Al(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(Mr(a,c,u)),Tl(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(po(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(po(r)),Al(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(Mr(l,a,c)),Tl(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(po(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(po(r)),Al(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(Mr(a,c,d)),Tl(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=[];Al(a,2),a.push(Mr(r,l,!1)),Tl(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;uW(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function gW(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=vW(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function vW(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 yW(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=kW(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function kW(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 _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const k=e[_];h==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.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 _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const k=e[_];h==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.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=bW(l),l}function bW(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=_W(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 _W(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 wW(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=MW(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 Jw(){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 eS(){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 tS(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 lM(e,t){if(!e.startsWith("|")||e.includes(`
|
|
150
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function Sg(e){return lM(e)!==null}function aM(e){return/^:?-+:?$/.test(e.trim())}function SW(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aM)}function CW(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function xW(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(aM)&&CW(n)}function AW(e){return e==="|"||e==="|:"}function TW(e){const t=lM(e);return t!==null&&t.every(n=>!n.includes(":"))}function MW(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(`
|
|
151
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
152
|
-
`),d=!t&&!r.includes(`
|
|
153
|
-
`)&&/\r?\n$/.test(n)&&Sg(r);if(!t&&(r.includes(`
|
|
154
|
-
`)&&u.length===0&&Sg(a)&&xW(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>tS(p)),h=[...Jw(),...f,...eS()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
155
|
-
`)&&u.length===0&&Sg(a)&&SW(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>tS(p)),h=[...Jw(),...f,...eS()];s.splice(o-1,3,...h)}else r.includes(`
|
|
156
|
-
`)&&u.length===0&&TW(a)&&AW(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function EW(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 IW=EW;const $W=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Ip=$W.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),NW=/\\[a-z]+/i,cM="(?:\\\\|\\u0008)",LW=new RegExp(String.raw`${cM}(?:${Ip})\s*\{[^}]+\}`,"i"),OW=new RegExp(String.raw`(?:${cM})?(?:${Ip})\s*\{`,"i"),PW=/\\(?:text|frac|left|right|times)/,RW=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,DW=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,BW=/[A-Z]+\s*\([^)]+\)/i,FW=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,HW=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,WW=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,zW={"\b":"\\b","\v":"\\v","\f":"\\f"};function UW(e){let t="";for(const n of e)t+=zW[n]??n;return t}function Ua(e){if(!e)return!1;const t=UW(e),n=t.trim();if(WW.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=NW.test(t),o=LW.test(t),i=OW.test(t),r=PW.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=RW.test(t)&&!DW.test(t),c=BW.test(t),u=FW.test(n),d=HW.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 uM="__markstreamMathPluginApplied",a1=80,dM=2e4,nS=dM+4096;function fM(e){return!!e[uM]}function jW(e){e[uM]=!0}const pM=["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"],qW=["cdot","mathbf{","partial","mu_{"],hM=pM.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),mM="[ \r\b\f\v]",VW=new RegExp(`([^\\\\])(${qW.map(e=>e).join("|")})+`,"g"),KW=/span\{([^}]+)\}/,GW=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,YW=/(^|[^\\])\\\r?\n/g,QW=/(^|[^\\])\\$/g,XW=new RegExp(`(${mM})|(${hM})\\b`,"g"),sS=new Map,oS=new Map;function ZW(e){if(!e)return XW;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=sS.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${mM})|(${o})\\b`,"g");return sS.set(n,i),i}function JW(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=oS.get(s);if(o)return o;const i=e?[Ip,hM].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Ip].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return oS.set(s,r),r}const iS={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function rS(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function lS(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 Er(e,t){const n=t?.commands??pM,s=t?.escapeExclamation??!0,o=t?.commands==null,i=ZW(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&iS[u]!==void 0)return`\\${iS[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=JW(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(KW,"span\\{$1\\}").replace(GW,"\\operatorname{span}\\{$1\\}"),l=l.replace(YW,`$1\\\\
|
|
157
|
-
`),l=l.replace(QW,"$1\\\\"),l=l.replace(VW,"$1\\$2"),l}function aS(e){const t=e.trim();return!(!Ua(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 gM(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 $p(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function ez(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 hd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function c1(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(hd(e,s)){n=s+1;continue}return s}return-1}function Cg(e,t){let n=t;for(;n<e.length;){const s=c1(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 lu(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(!hd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function cS(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=$p(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}hd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function G0(e,t,n){const s=Zu(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!Zu(s.slice(0,o)).trim()||hd(s,o))return-1;const i=gM(s);if($p(i,o))return-1;const r=cS(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>cS(s,n,0,o,i))return-1;return o}function Xu(e){return e===" "||e===" "}function Zu(e){let t=e.length;for(;t>0&&Xu(e[t-1]);)t--;return e.slice(0,t)}function uS(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
158
|
-
`&&t++;return t}function dS(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function tz(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(!Xu(o))return!1}return n>=3}function nz(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 sz(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(nz)}function oz(e){let t=0;if(!dS(e[t]))return!1;for(;dS(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Xu(e[t+1])}function vM(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&&Xu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Xu(t[1])||oz(t)||tz(t)||sz(t))}function fS(e,t){return e?t?`${e}
|
|
159
|
-
${t}`:e:t}function u1(e){const t=String(e??"").trim();return t?Ua(t):!1}function pS(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function yM(e){if(e.length<=nS)return{source:e,lineOffset:0};let t=e.length-nS;const n=e.indexOf(`
|
|
160
|
-
`,t);return n===-1?{source:"",lineOffset:uS(e)}:(t=n+1,{source:e.slice(t),lineOffset:uS(e.slice(0,t))})}function kM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=yM(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-a1-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=Zu(s[r]);if(l&&!vM(l)){for(const[a,c]of i)if(G0(l,a,c)!==-1)return!0}}return!1}function iz(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=yM(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-a1-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=Zu(o[l]);for(const[c,u]of r){const d=G0(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>a1){h=!0;break}const m=o[p],_=lu(m,u);if(_!==-1){const k=fS(f,m.slice(0,_));if(!u1(k)){h=!0;break}const g=m.slice(_+u.length),v=g.trim()?`suffix:${pS(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,_,pS(k),v].join(":")}if(vM(m)){h=!0;break}if(f=fS(f,m),f.length>dM){h=!0;break}}if(!h&&u1(f))return["pending",c,s+l,d].join(":")}}return null}function xg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function rz(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 Ag(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function lz(e,t){jW(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,v)=>{let y=v;for(;y<g.length&&(g[y]===" "||g[y]===" ");)y++;if(y===v||!(g[y]===`
|
|
161
|
-
`||g[y]==="\r"&&g[y+1]===`
|
|
162
|
-
`))return v;const T=g.slice(v,y),P=a.push("text","",0);return P.content=T,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const T=a.push("text","",0);return T.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,_=p;const k=p;for(const[g,v]of f){const y=a.src,T=gM(y),P=ez(y,u);let N=!1;g==="$$"&&m!==k&&(m=k);let b=-1,M=-1,I=0;const L=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const F=c1(S,D);if(F===-1){const Oe=S.slice(D);if(Oe){const je=a.push("text","",0);je.content=Oe,a.pos=a.pos+Oe.length,m=a.pos}break}if(F>0&&S[F-1]==="$"||F+1<S.length&&S[F+1]==="$"){const Oe=S.slice(D,F+1);if(Oe){const je=a.push("text","",0);je.content=Oe,a.pos=a.pos+Oe.length,m=a.pos}D=F+1;continue}const U=S.slice(D,F);if(U){const Oe=a.push("text","",0);Oe.content=U,a.pos=a.pos+U.length,m=a.pos}const G=Cg(S,F+1);if(G===-1){const Oe=S.slice(F),je=a.push("text","",0);je.content=Oe,a.pos=a.pos+Oe.length,m=a.pos;break}const Y=S.slice(F+1,G),q=Y.includes("`"),ae=!Y||!Y.trim(),de=S[G+1],ne=xg(Y,de),X=Ag(Y);if(!q&&!ae&&!ne&&!X){const Oe=a.push("math_inline","math",0);Oe.content=Er(Y,t),Oe.markup="$",Oe.raw=`$${Y}$`,Oe.loading=!1,a.pos=a.pos+(G-F+1),m=a.pos,D=G+1;continue}const he=a.push("text","",0);he.content="$",a.pos=a.pos+1,m=a.pos,D=F+1}return}const E=S.indexOf("![");if(E!==-1){if(E>0){const U=S.slice(0,E),G=a.push("text","",0);G.content=U,a.pos=a.pos+U.length,m=a.pos}const D=S.slice(E).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,U,G]=D,Y=G.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),q=Y?Y[1]:G,ae=Y&&Y[2]?Y[2]:null,de=a.push("image","img",0);de.attrs=[["src",q],["alt",U]],ae&&de.attrs.push(["title",ae]),de.content=U,de.children=[{type:"text",content:U,tag:""}],a.pos=a.pos+D[0].length,m=a.pos;const ne=S.slice(E+D[0].length);ne&&L(ne);return}const F=a.push("text","",0);F.content=S,a.pos=a.pos+S.length,m=a.pos;return}const R=a.push("text","",0);R.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(hd(y,S)){m=S+Math.max(1,g.length);continue}const E=$p(T,S);if(E){m=E[1];continue}const R=$p(P,S);if(R){m=R[1];continue}if(S===b&&m===M){if(I++,I>2){m=S+Math.max(1,g.length);continue}}else I=0,b=S,M=m;if(g==="("&&S>0){let ne=S-1;for(;ne>=0&&y[ne]===" ";)ne--;if(ne>=0&&y[ne]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const D=g==="$"?Cg(y,S+g.length):IW(y,S+g.length,g,v);if(D===-1){const ne=y.slice(S+g.length);if(ne.includes(g)){m=y.indexOf(g,S+g.length);continue}if(D===-1){const X=g==="$"&&rz(ne);if(u&&!c&&!X&&Ua(ne)&&!ne.includes("`")){if(m=S+g.length,N=!0,!l){a.pending="";const he=_?y.slice(_,m):y.slice(0,m),Oe=rS(he)%2===1;if(_)L(y.slice(_,m));else{let je=y.slice(0,m);je.endsWith(g)&&(je=je.slice(0,je.length-g.length)),L(je)}if(Oe){const je=lS(he)?.marker??"**",it=a.push("strong_open","",0);it.markup=je;const ce=a.push("math_inline","math",0);ce.content=Er(ne,t),ce.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ce.raw=`${g}${ne}${v}`,ce.loading=!0,it.content=ne,a.push("strong_close","",0)}else{const je=a.push("math_inline","math",0);je.content=Er(ne,t),je.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",je.raw=`${g}${ne}${v}`,je.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const F=y.slice(S+g.length,D),U=F.includes("`"),G=!F||!F.trim(),Y=g==="$",q=y[D+v.length],ae=Y&&xg(F,q),de=Y&&Ag(F);if(c?U||G||ae||de:U||G||ae||de||!Y&&!Ua(F)){m=D+v.length;const ne=y.slice(a.pos,m);a.pending||(L(ne),_=m);continue}if(N=!0,!l){const ne=y.slice(a.pos-(a.pending??"").length,S);let X=y.slice(0,m)?y.slice(_,S):ne;const he=rS(X)%2===1;S!==a.pos&&he&&(X=a.pending+y.slice(a.pos,S));const Oe=he?lS(X):null,je=Oe?.marker??"**";if(a.pending!==X)if(a.pending="",he)if(Oe){const it=X.slice(Oe.index+je.length);L(X.slice(0,Oe.index));const ce=a.push("strong_open","",0);ce.markup=je;const z=a.push("text","",0);z.content=it,a.push("strong_close","",0)}else L(X);else L(X);if(he){const it=a.push("strong_open","",0);it.markup=je;const ce=a.push("math_inline","math",0);ce.content=Er(F,t),ce.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ce.raw=`${g}${F}${v}`,ce.loading=!1;const z=y.slice(D+v.length).startsWith(je);return z&&a.push("strong_close","",0),a.pos=d(y,D+v.length),m=a.pos,_=m,z||a.push("strong_close","",0),!0}else{const it=a.push("math_inline","math",0);it.content=Er(F,t),it.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",it.raw=`${g}${F}${v}`,it.loading=!1}}return m=d(y,D+v.length),_=m,a.pos=m,!0}if(N){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const E=c1(y,S);if(E===-1)break;if(E+1<y.length&&y[E+1]==="$"){S=E+2;continue}if(E>0&&y[E-1]==="$"){S=E+1;continue}const R=Cg(y,E+1);if(R===-1)break;const D=y.slice(E+1,R),F=D.includes("`"),U=!D||!D.trim(),G=y[R+1],Y=xg(D,G),q=Ag(D);if(!F&&!U&&!Y&&!q){const ae=y.slice(m,E);ae&&L(ae);const de=a.push("math_inline","math",0);de.content=Er(D,t),de.markup="$",de.raw=`$${D}$`,de.loading=!1,m=R+1,S=R+1}else L("$"),S=E+1}S<y.length&&L(y.slice(S))}else m<y.length&&L(y.slice(m));a.pos=y.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(),_=!1,k="",g="",v=!1,y="",T=!1;for(const[ae,de]of h)if(m.startsWith(ae))if(ae.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,k=ae,g=de;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,k=ae,g=de;break}continue}else{const ne=u.tokens[u.tokens.length-1];if(ne&&ne.type==="list_item_open"&&ne.mark==="-"&&m.slice(ae.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const X=m.indexOf("]");if(m.slice(X).trim()!=="]")continue;const he=m.slice(ae.length,X);if(ae==="["?aS(he):Ua(he)){_=!0,k=ae,g=de;break}continue}}else{_=!0,k=ae,g=de;break}else if((ae==="$$"||ae==="\\[")&&m.endsWith(ae)&&l+1<a){const ne=G0(m,ae,de);if(ne===-1)continue;y=Zu(m.slice(0,ne)),T=!0;const X=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(X,u.eMarks[l+1]).trim(),v=!0,_=!0,k=ae,g=de;break}if(!_)return!1;if(c&&!T)return!0;const P=m.indexOf(k),N=P+k.length,b=!f&&k==="["?m.indexOf("\\]",N):-1,M=b>=0?"\\]":g,I=b>=0?b:lu(m,g,N);if(!v&&I>k.length){const ae=m.slice(P+k.length,I),de=u.push("math_block","math",0);de.content=Er(ae),de.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",de.map=[l,l+1],de.raw=`${k}${ae}${M}`,de.block=!0,de.loading=!1,u.line=l+1;const ne=m.slice(I+M.length);return ne.trim()&&n(u,ne,l),!0}let L=l,S="",E=!1,R="",D=l;const F=v?m:m===k?"":m.slice(k.length),U=!f&&k==="\\["?"]":"",G=lu(F,g);if(G!==-1){const ae=G;S=F.slice(0,ae),R=F.slice(ae+g.length),D=v?l+1:l,E=!0,L=D}else for(F&&!v&&(S=F),L=l+1;L<a;L++){const ae=u.bMarks[L]+u.tShift[L],de=u.eMarks[L],ne=u.src.slice(ae,de),X=ne.trim();if(!f&&k==="["&&X==="\\]"){g="\\]",E=!0;break}if(U&&ne.trim()===U){g=U,E=!0;break}if(X===g){E=!0;break}else if(!f&&k==="["&&ne.includes("\\]")){E=!0;const he=ne.indexOf("\\]");g="\\]";const Oe=ne.slice(0,he);Oe&&(S+=(S?`
|
|
163
|
-
`:"")+Oe),R=ne.slice(he+g.length),D=L;break}else if(lu(ne,g)!==-1){E=!0;const he=lu(ne,g),Oe=ne.slice(0,he);Oe&&(S+=(S?`
|
|
164
|
-
`:"")+Oe),R=ne.slice(he+g.length),D=L;break}S+=(S?`
|
|
165
|
-
`:"")+ne}if((!d||f)&&!E)return!1;const Y=/^\s*!\[/.test(S);if(!(T?!Y&&u1(S):k==="$$"?!Y:k==="["?aS(S):Ua(S)))return!1;if(c)return!0;y&&n(u,y,l);const q=u.push("math_block","math",0);return q.content=Er(S),q.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",q.raw=`${k}${S}${S.startsWith(`
|
|
166
|
-
`)?`
|
|
167
|
-
`:""}${g}`,q.map=[l,L+1],q.block=!0,q.loading=!E,u.line=L+1,R.trim()&&n(u,R,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1: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 az(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 cz(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 QF({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!Ul(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&lz(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&mH(i),e.enableFixIndentedCodeBlock!==!1&&BH(i),hW(i),yW(i),gW(i),wW(i),az(i),RH(i,{customHtmlTags:e.customHtmlTags}),i}function jl(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>jl(n))),t}function uz(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function dz(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 fz(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function ff(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(...qn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const hS=/\r?\n[ \t]*`+\s*$/,bM=["diff ","index ","--- ","+++ ","@@ "],pz=/\r?\n/;function hz(e){const t=String(e??"");return t?bM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function mS(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function mz(e,t){const n=[],s=[],o=[],i=[],r=e.split(pz),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!bM.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{mS(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&&hz(p)||c(p)}(t||o.length>0||i.length>0)&&mS(n,s,o,i);const d=n.join(`
|
|
168
|
-
`),f=s.join(`
|
|
169
|
-
`);return{original:t&&l&&d?`${d}
|
|
170
|
-
`:d,updated:t&&l&&f?`${f}
|
|
171
|
-
`:f}}function Y0(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(hS.test(a)&&(a=a.replace(hS,"")),r){const{original:c,updated:u}=mz(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 gz(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function vz(){return{type:"hardbreak",raw:`\\
|
|
172
|
-
`}}function yz(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(...qn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let Tg=null;const Mg=new WeakMap;function gS(){return Tg||(Tg={customTagSet:null,allowedTagSet:Nh()}),Tg}function _M(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function wM(e){return/^<\s*\//.test(e)}function SM(e,t){return/\/\s*>\s*$/.test(t)||sa.has(e)}function kz(e){if(!e||e.length===0)return gS();const t=Mg.get(e);if(t)return t;const n=e.map(li).filter(Boolean);if(!n.length){const o=gS();return Mg.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Nh({customHtmlTags:e})};return Mg.set(e,s),s}function CM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function bz(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Np(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 _z(e,t,n){const s=e.slice();return Np(s,"href")||s.push(["href",t]),n!=null&&!Np(s,"title")&&s.push(["title",n]),s}function d1(e){return e.map(CM).join("")}function Of(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:Of(s.children)});continue}t.push(s)}return t}function wz(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=_M(r),a=wM(r),c=SM(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function Eg(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?wz(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:d1(s),innerTokens:o,nextIndex:i}}function Sz(e,t,n,s,o,i,r){const l=String(e.content??""),a=_M(l),{customTagSet:c,allowedTagSet:u}=kz(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Eg(t,n,a).closed){const T=CM(e);return[{type:"text",content:T,raw:T},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=wM(l),f=SM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const T=Eg(t,n,a),P=Eh(l),N=T.innerTokens,b=String(Np(P,"href")??""),M=Np(P,"title"),I=M==null?null:String(M),L=_z(P,b,I),S=Of(N.length?s(N,o,i,r):[]),E=N.length?d1(N):b||"";return!S.length&&E&&S.push({type:"text",content:E,raw:E}),[{type:"link",href:b,title:I,text:E,attrs:L,children:S,loading:!T.closed,raw:T.html||l},T.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=Eg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Of(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=Of(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,_=!h.closed,k=!1;if(!h.closed){const T=`</${a}>`;m.toLowerCase().includes(T.toLowerCase())||(m+=T),k=!0,_=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const T=y[1],P=y[2]||y[3]||y[4]||"";g.push([T,P])}if(c?.has(a)){const T=bz(e);return[{type:a,tag:a,attrs:g,content:T?T.inner:h.innerTokens.length?d1(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:T?.raw??m,loading:e.loading||_,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:_,autoClosed:k},h.nextIndex]}function xM(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=>xM(t)).join(""):String(e.content??"")}function Cz(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xM(t)).join("")}function vS(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=Cz(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 xz(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function Az(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(...qn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function Tz(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 Lp(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 Mz(e,t,n){const s=e.slice();return Lp(s,"href")||s.push(["href",t]),n!=null&&!Lp(s,"title")&&s.push(["title",n]),s}function pf(e,t,n){const s=e[t],o=Tz(s.attrs),i=String(Lp(o,"href")??""),r=Lp(o,"title"),l=r==null?null:String(r),a=Mz(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(_=>_.type==="strong_open")){const _=String(h.content??""),k=String(h.raw??_),g=jl(h);g.content=_.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=qn(f,void 0,void 0,n),m=p.map(_=>{const k=_;return"content"in _?String(k.content??""):String(k.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 yS(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 Ez(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function kS(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(...qn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const Iz=/\\([\\()[\]`$|*_\-!])/g;function $z(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(Iz,"$1")===t))return n}function Qc(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(...qn(l,$z(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function Nz(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(...qn(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 Lz(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(...qn(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 Oz(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const Pz=/[^~]*~{2,}[^~]+/,Rz=/\*\*/,Dz=/[[_*^~]/,Bz=/\\([\\()[\]`$|*_\-!])/g,Q0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),Fz=/\s/u,Hz=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,Wz=/\p{P}/u,zz=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,Uz=/:\/\//;function jz(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 AM(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&&Q0.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function tl(e){return!!e&&Fz.test(e)}function nl(e){return!!e&&(Hz.test(e)||Wz.test(e))}function qz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||tl(s)?!1:!(nl(s)&&n&&!tl(n)&&!nl(n))}function Vz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||tl(n)?!1:!(nl(n)&&s&&!tl(s)&&!nl(s))}function Kz(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?AM(e,s):t.indexOf("*",s);if(i===-1)break;if(Vz(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function Gz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||tl(s)?!1:!(nl(s)&&n&&!tl(n)&&!nl(n))}function Yz(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||tl(n)?!1:!(nl(n)&&s&&!tl(s)&&!nl(s))}function Qz(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(Yz(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function Xz(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&&Q0.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function Zz(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&Q0.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function Jz(e,t,n){const s=Zz(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 eU=/[\p{L}\p{N}]/u,tU=/^[\p{L}\p{N}]+$/u;function f1(e){return e?eU.test(e):!1}function TM(e){return e?tU.test(e):!1}function _u(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:f1(s)&&f1(o)}}function nU(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=_u(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(!TM(e.slice(s.end,o.start)))return o.end}return-1}function sU(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function oU(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=_u(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function iU(e){return e?zz.test(e)||Uz.test(e):!1}function rU(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function qn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=pd(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(z,Q){const oe=e.length===1?t:String(Q.content??""),W=[],Z=nU(z);if(Z!==-1){T(z.slice(0,Z),z.slice(0,Z));const le=z.slice(Z);return le&&(I({type:"text",content:le,raw:le}),u--),u++,!0}if(Pz.test(z)){const le=z.indexOf("~~");le!==-1&&W.push({type:"strikethrough",index:le})}if(Rz.test(z)){const le=z.indexOf("**");le!==-1&&W.push({type:"strong",index:le})}if(/[^*]*\*[^*]+/.test(z)){const le=oe?AM(oe,0):z.indexOf("*");if(oe&&le===-1)return!1;le!==-1&&W.push({type:"emphasis",index:le})}W.sort((le,me)=>le.index!==me.index?le.index-me.index:le.type===me.type?0:le.type==="strong"?-1:me.type==="strong"?1:0);const ue=W[0];if(!ue)return!1;if(ue.type==="strikethrough"){const le=ue.index,me=le>-1?z.slice(0,le):"";if(me&&T(me,me),le===-1)return u++,!0;const j=z.indexOf("~~",le+2),ee=j===-1?z.slice(le+2):z.slice(le+2,j),pe=j===-1?"":z.slice(j+2),{node:ke}=kS([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ee,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),y(ke),pe&&(I({type:"text",content:pe,raw:pe}),u--),u++,!0}if(ue.type==="strong"){const le=ue.index,me=le>-1?z.slice(0,le):"";if(me&&T(me,me),le===-1)return u++,!0;if(t&&le===0){let Ie=!1,fe=0;for(;fe<z.length&&z[fe]==="*";)fe++;if(t.startsWith("\\*")&&(Ie=!0),Ie){let Me=0,Ge=0;for(;Ge<t.length&&Me<fe;)if(t[Ge]==="\\"&&Ge+1<t.length&&t[Ge+1]==="*")Me+=1,Ge+=2;else{if(t[Ge]==="*")break;Ge++}if(Me>=2)return T(z,z),u++,!0}}if(t&&(z.match(/\*/g)||[]).length>jz(t))return T(z.slice(me.length),z.slice(me.length)),u++,!0;const j=_u(z,le);if(j.len>=3){const Ie=oU(z,le+j.len);if(Ie!==-1){const fe=z.slice(le+j.len,Ie);if(sU(fe)){const{node:Me}=Qc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:fe,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(),y(Me);const Ge=z.slice(Ie+3);return Ge&&(I({type:"text",content:Ge,raw:Ge}),u--),u++,!0}}}if(!Gz(z,le)){const Ie=z.slice(le,le+j.len);T(Ie,Ie);const fe=z.slice(le+j.len);return fe&&(I({type:"text",content:fe,raw:fe}),u--),u++,!0}const ee=Qz(z,le+2);let pe="",ke="";if(ee.index!==-1){pe=z.slice(le+2,ee.index),ke=z.slice(ee.index+2);const Ie=ee.index,fe=_u(z,Ie);if(j.intraword&&fe.intraword&&!TM(pe)||!pe&&j.len>=4&&j.intraword)return T(z.slice(me.length),z.slice(me.length)),u++,!0}else{if(d||ee.sawInvalidClose||j.intraword)return T(z.slice(me.length),z.slice(me.length)),u++,!0;pe=z.slice(le+2),ke=""}if(!pe&&/^\*+$/.test(ke))return T(z,z),u++,!0;const{node:Te}=Qc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),y(Te),ke&&(I({type:"text",content:ke,raw:ke}),u--),u++,!0}if(ue.type==="emphasis"){let le=ue.index;le===-1&&(le=0);const me=z.slice(0,le);if(me&&T(me,me),!qz(z,le)){T(z[le],z[le]);const Ie=z.slice(le+1);return Ie&&(I({type:"text",content:Ie,raw:Ie}),u--),u++,!0}const j=_u(z,le),ee=Kz(oe,z,le+1),pe=ee.index,ke=e[u+1];if(s?.final&&ke?.type==="em_open"&&pe!==-1&&z.slice(le+1,pe).trim()!==z.slice(le+1,pe)||pe===-1&&(ee.sawInvalidClose||s?.final||j.intraword||!f1(z[le+1])))return T(z.slice(le),z.slice(le)),u++,!0;const{node:Te}=ff([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe>-1?z.slice(le+1,pe):z.slice(le+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),y(Te),pe!==-1&&pe<z.length-1){const Ie=z.slice(pe+1);Ie&&(I({type:"text",content:Ie,raw:Ie}),u--)}return u++,!0}return!1}function _(z,Q){if(!z.includes("`"))return!1;const W=(ke=>{for(let Te=0;Te<ke.length;Te++){if(ke[Te]!=="`")continue;let Ie=0;for(let fe=Te-1;fe>=0&&ke[fe]==="\\";fe--)Ie++;if(Ie%2===0)return Te}return-1})(z);if(W===-1)return!1;let Z=1;for(let ke=W+1;ke<z.length&&z[ke]==="`";ke++)Z++;const ue="`".repeat(Z),le=W+Z,me=z.indexOf(ue,le);if(me===-1){if(Z===1){const Te=z.slice(0,W),Ie=z.slice(W+1);return Te&&(m(Te,Q)?u--:T(Te,Te)),g({type:"inline_code",code:Ie,raw:String(Ie)}),u++,!0}let ke=z;for(let Te=u+1;Te<e.length;Te++)ke+=String((e[Te].content??"")+(e[Te].markup??""));return u=e.length-1,T(ke,ke),u++,!0}p();const j=z.slice(0,W),ee=z.slice(W+Z,me),pe=z.slice(me+Z);return j&&(m(j,Q)?u--:T(j,j)),g({type:"inline_code",code:ee,raw:String(ee??"")}),pe&&(I({type:"text",content:pe,raw:pe}),u--),u++,!0}function k(z){const Q=l?.__markdownIt;if(!Q||e.length<=1||!e.some(ue=>ue?.type==="math_inline")||!Dz.test(z))return null;const oe=Q.parseInline(z,{__markstreamFinal:!!s?.final});if(!Array.isArray(oe)||oe.length===0)return null;const W=(oe.find(ue=>ue?.type==="inline")?.children??[]).filter(ue=>!(ue?.type==="text"&&String(ue.content??"")===""));if(!W.length||!W.some(ue=>ue?.type!=="text")||W.length===1&&W[0]?.type==="text"&&String(W[0].content??"")===z)return null;const Z=qn(W,z,n,s);return Z.length?Z:null}function g(z){p(),a.push(z)}function v(z){p();const Q=jl(z);a.push(Q)}function y(z){g(z)}function T(z,Q){c?(c.content+=z,c.raw+=Q??z):(c={type:"text",content:String(z??""),raw:String(Q??z??"")},a.push(c))}function P(z,Q){if(!z)return;const oe=qn([{...Q,type:"text",content:z,raw:z}],z,n,s);if(oe.length===1&&oe[0]?.type==="text"){const W=oe[0];T(String(W.content??""),String(W.raw??W.content??""));return}for(const W of oe)y(W)}function N(z,Q){return String(z.markup??"").startsWith(Q)}function b(z){return z.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(z,Q){let oe=z;const W=String(Q.content??"");return oe.endsWith("\\")&&!N(Q,"\\\\")&&!W.endsWith("\\\\")&&(oe=oe.slice(0,-1)),oe.endsWith("(")&&!N(Q,"\\(")&&!W.endsWith("\\(")&&(oe=oe.slice(0,-1)),/\*+$/.test(oe)&&!N(Q,"\\*")&&!W.endsWith("\\*")&&(oe=oe.replace(/\*+$/,"")),oe}for(;u<e.length;){const z=e[u];I(z)}function I(z){switch(z.type){case"text":S(z);break;case"softbreak":c?(c.content+=`
|
|
173
|
-
`,c.raw+=`
|
|
174
|
-
`):(c={type:"text",content:`
|
|
175
|
-
`,raw:`
|
|
176
|
-
`},a.push(c)),u++;break;case"code_inline":y(xz(z)),u++;break;case"html_inline":{const[Q,oe]=Sz(z,e,u,qn,t,n,s);y(Q),u=oe;break}case"link_open":E(z);break;case"image":ne(z)||(p(),y(vS(z)),u++);break;case"strong_open":{p();const{node:Q,nextIndex:oe}=Qc(e,u,z.content,s);y(Q),u=oe;break}case"em_open":{p();const{node:Q,nextIndex:oe}=ff(e,u,s);y(Q),u=oe;break}case"s_open":{p();const{node:Q,nextIndex:oe}=kS(e,u,s);y(Q),u=oe;break}case"mark_open":{p();const{node:Q,nextIndex:oe}=yz(e,u,s);y(Q),u=oe;break}case"ins_open":{p();const{node:Q,nextIndex:oe}=Az(e,u,s);y(Q),u=oe;break}case"sub_open":{p();const{node:Q,nextIndex:oe}=Nz(e,u,s);y(Q),u=oe;break}case"sup_open":{p();const{node:Q,nextIndex:oe}=Lz(e,u,s);y(Q),u=oe;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`~${String(z.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`^${String(z.content??"")}^`}),u++;break;case"emoji":{p();const Q=e[u-1];Q?.type==="text"&&/\|:-+/.test(String(Q.content??""))?T("",""):y(fz(z)),u++;break}case"checkbox":p(),y(uz(z)),u++;break;case"checkbox_input":p(),y(dz(z)),u++;break;case"footnote_ref":p(),y(gz(z)),u++;break;case"footnote_anchor":{p();const Q=z.meta??{};g({type:"footnote_anchor",id:String(Q.label??z.content??""),raw:String(z.content??"")}),u++;break}case"hardbreak":p(),y(vz()),u++;break;case"fence":p(),y(Y0(e[u])),u++;break;case"math_inline":p(),!z.content&&z.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(yS({...z,content:e[u+1].content})),u+=2):y(yS(z)),u++;break;case"reference":D(z);break;case"text_special":T(String(z.content??""),String(z.content??"")),u++;break;default:{const Q=z;if(z.type==="link"&&Q.href!=null&&s?.validateLink&&!s.validateLink(String(Q.href))){p();const oe=String(Q.text??"");T(oe,oe),u++}else X(z)||U(z)||Y(z)||F(z)||v(z),u++;break}}}function L(z,Q,oe,W){const Z=Oz({...Q,content:z});if(c){c.content+=M(Z.content,Q),c.raw+=Z.raw;return}const ue=oe?.tag==="br"&&e[u-2]?.content==="[";W||(Z.content=M(Z.content,Q)),c=Z,c.center=ue,a.push(c)}function S(z){const Q=String(z.content??""),oe=e.length===1&&Q.includes("\\")&&typeof t=="string"?String(t):"";let W=oe?Xz(oe):Q.replace(Bz,"$1");if(z.content==="<"||W==="1"&&e[u-1]?.tag==="br"){u++;return}const Z=W.indexOf("$");Z!==-1&&Z===W.lastIndexOf("$")&&W.endsWith("$")&&(W=W.slice(0,-1)),W.endsWith("undefined")&&!t?.endsWith("undefined")&&(W=W.slice(0,-9));let ue=a.length,le="";for(let pe=a.length-1;pe>=0;pe--){const ke=a[pe];if(ke.type!=="text")break;ue=pe,le=String(ke.content??"")+le}ue<a.length&&(W.startsWith(le)?(c=null,a.length=ue):c=a[a.length-1]);const me=e[u+1];if((W==="`"||W==="|"||W==="$")&&!N(z,`\\${W}`)||/^\*+$/.test(W)&&!N(z,"\\*")){u++;return}if(!me&&/[^\]]\s*\(\s*$/.test(W)&&(W=W.replace(/\(\s*$/,"")),!W){u++;return}if(de(W)||he(W))return;if(!(W.includes("*")||W.includes("_")||W.includes("~")||W.includes("`")||W.includes("[")||W.includes("!")||W.includes("$")||W.includes("|")||W.includes("("))){L(W,z,e[u-1],me),u++;return}if(ce(W))return;const j=e[u-1];if(W==="["&&!me?.markup?.includes("*")&&!N(z,"\\[")||W==="]"&&!j?.markup?.includes("*")&&!N(z,"\\]")){u++;return}if(_(Q,z)||it(W)||(e[u+1]?.type!=="link_open"||b(W))&&je(W,z))return;const ee=k(Q);if(ee){p();for(const pe of ee)y(pe);u++;return}m(W,z)||(L(W,z,j,me),u++)}function E(z){if(R(z))return;if(Oe()){const{node:me,nextIndex:j}=pf(e,u,s),ee=String(me.text||me.href||"");T(ee,ee),u=j;return}p();const{node:Q,nextIndex:oe}=pf(e,u,s);u=oe;const W=Q.text||Q.href||"";if(z.markup==="linkify"&&!rM(W,Q.href,t)&&Ep(W,l?.__linkifyDemotionContext)){T(W,W);return}const Z=Q.children.length===1&&Q.children[0]?.type==="text";if(Q.loading&&t&&Q.text===Q.href&&Z){const me=rU(t,Q.href);me&&(Q.text=me,Q.children=[{type:"text",content:me,raw:me}],Q.raw=`[${me}](${Q.href}${Q.title?` "${Q.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(Q.href)){T(Q.text,Q.text);return}const ue=z.attrs?.find(([me])=>me==="href")?.[1],le=String(ue??"");if(t&&le){const me=t.indexOf("](");if(me!==-1){const j=t.indexOf(")",me+2);j===-1?Q.loading=!0:Q.loading&&t.slice(me+2,j).includes(le)&&(Q.loading=!1)}}F(Q)||g(Q)}function R(z){if(z.markup!=="linkify")return!1;const{node:Q,nextIndex:oe}=pf(e,u,s);return G(Q,oe)?(u=oe,!0):!1}function D(z){p(),y(Ez(z)),u++}function F(z){if(z.type!=="link")return!1;const Q=a[a.length-1];if(!Q||Q.type!=="text")return!1;const oe=String(Q.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!oe)return!1;const W=z,Z=String(W.href??""),ue=String(W.text??""),le=String(oe[2]??""),me=Z.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Z||!(ue===Z||ue===me||iU(ue)))return!1;const j=String(oe[1]??"");return j?(Q.content=j,Q.raw=j):a.pop(),g({...z,text:le,children:[{type:"text",content:le,raw:le}],raw:`[${le}](${Z}${W.title?` "${W.title}"`:""})`}),!0}function U(z){if(z.type!=="link")return!1;const Q=z,oe=String(Q.href??"");return oe?G({href:oe,title:Q.title==null||Q.title===""?null:String(Q.title),loading:!!Q.loading},u+1):!1}function G(z,Q){const oe=a[a.length-1];if(oe?.type!=="image"||oe.src||!oe.loading||!String(oe.raw??"").endsWith("]("))return!1;const W=e[Q],Z=String(W?.content??"");if(W?.type!=="text"||!Z.startsWith(")"))return!1;a.pop(),c=null;const ue=String(oe.alt??"");g({type:"image",src:z.href,alt:ue,title:z.title,raw:``,loading:!!z.loading});const le=Z.slice(1),me=jl(W);return me.content=le,me.raw=le,h()[Q]=me,!0}function Y(z){if(z.type!=="link")return!1;const Q=a[a.length-1],oe=e[u-1];if(!Q||Q.type!=="text"||oe?.type!=="text")return!1;const W=String(Q.content??""),Z=String(oe.content??"");if(!W.endsWith("!")||!Z.endsWith("!")||N(oe,"\\!"))return!1;const ue=W.slice(0,-1);ue?(Q.content=ue,Q.raw=ue,c=Q):(a.pop(),c=null);const le=z,me=String(le.text??le.children?.map(pe=>String(pe?.content??pe?.raw??"")).join("")??""),j=String(le.href??""),ee=le.title==null||le.title===""?null:String(le.title);return g({type:"image",src:j,alt:me,title:ee,raw:``,loading:!!le.loading}),!0}function q(z,Q="",oe=null){const W=String(z.alt??z.raw??"");return{type:"link",href:Q,title:oe,text:W,children:[z],raw:`[${W}](${Q}${oe?` "${oe}"`:""})`,loading:!0}}function ae(z){const Q=z.startsWith(";return{type:"image",src:"",alt:W===-1?oe.replace(/\]$/,""):oe.slice(0,W),title:null,raw:Q,loading:!0}}function de(z){const Q=z.indexOf("[![");if(Q===-1||typeof t=="string"&&e.length===1&&Jz(t,Q,"["))return!1;const oe=z.slice(0,Q);return oe&&T(oe,oe),g(q(ae(z.slice(Q+1)))),u++,!0}function ne(z){if(s?.final)return!1;const Q=e[u-1];if(Q?.type!=="text"||!String(Q.content??"").endsWith("[")||N(Q,"\\["))return!1;const oe=a[a.length-1];if(oe?.type==="text"&&oe.content.endsWith("[")){const W=oe.content.slice(0,-1);W?(oe.content=W,oe.raw=W,c=oe):(a.pop(),c=null)}return g(q(vS(z))),u++,!0}function X(z){if(z.type!=="link")return!1;const Q=z,oe=String(Q.raw??""),W=String(Q.text??"");if(!oe.startsWith("[![")&&!W.startsWith("!["))return!1;const Z=Q.title==null||Q.title===""?null:String(Q.title);return g(q({type:"image",src:String(Q.href??""),alt:W.replace(/^!\[/,"").replace(/\]$/,""),title:Z,raw:oe.startsWith("[)return!1;const Q=e[u-2];if(Q?.type==="text"&&String(Q.content??"").endsWith("[")&&N(Q,"\\["))return!1;const oe=a[a.length-1];if(oe?.type!=="image"&&oe?.type!=="link")return!1;const W=oe,Z=oe?.type==="link"&&Array.isArray(W.children)&&W.children.length===1&&W.children[0]?.type==="image"?a.pop():null,ue=Z?Z.children[0]:a.pop();if(!ue||ue.type!=="image")return!1;const le=e[u+1];let me=String(Z?.href??""),j=Z?.title==null?null:String(Z.title),ee=!0;if(le?.type==="link_open"){const{node:ke,nextIndex:Te}=pf(e,u+1,s);me=ke.href,j=ke.title,ee=!0,u=Te}else{if(me=z.slice(2),me.includes('"')){const ke=me.split('"');me=String(ke[0]??"").trim(),j=ke[1]==null?null:String(ke[1]).trim()}u++}const pe=q(ue,me,j);return pe.loading=ee,g(pe),!0}function Oe(){const z=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&z?.type==="text"&&String(z.content??"").endsWith("[")&&N(z,"\\[")}function je(z,Q){const oe=z.indexOf("[");if(oe===-1)return!1;let W=z.slice(0,oe);const Z=z.indexOf("](",oe);if(Z!==-1){const ue=e[u+2];let le=z.slice(oe+1,Z);if(le.includes("[")){const Ie=le.indexOf("[");W+=z.slice(0,oe+Ie+1);const fe=oe+Ie+1;le=z.slice(fe+1,Z)}const me=e[u+1];if(z.endsWith("](")&&me?.type==="link_open"&&ue){const Ie=e[u+4];let fe=4,Me=!0;if(Ie?.type==="text"){const lt=String(Ie.content??"");if(lt.startsWith(")")){Me=!1;const kt=lt.slice(1);if(kt){const bt=jl(Ie);bt.content=kt,bt.raw=kt,h()[u+4]=bt}else fe++}else lt==="."&&fe++}P(W,Q);const Ge=String(ue.content??"");return s?.validateLink&&!s.validateLink(Ge)?T(le,le):g({type:"link",href:Ge,title:null,text:le,children:[{type:"text",content:le,raw:le}],loading:Me}),u+=fe,!0}const j=z.indexOf(")",Z),ee=j!==-1?z.slice(Z+2,j):"",pe=j===-1;let ke=W.match(/\*+$/);if(ke&&(W=W.replace(/\*+$/,"")),P(W,Q),ke||(ke=le.match(/^\*+/)),!d&&ke){const Ie=ke[0].length;le=le.replace(/^\*+/,"").replace(/\*+$/,"");const fe=[];if(Ie===1?fe.push({type:"em_open",tag:"em",nesting:1}):Ie===2?fe.push({type:"strong_open",tag:"strong",nesting:1}):Ie===3&&(fe.push({type:"strong_open",tag:"strong",nesting:1}),fe.push({type:"em_open",tag:"em",nesting:1})),fe.push({type:"link",href:ee,title:null,text:le,children:[{type:"text",content:le,raw:le}],loading:pe}),Ie===1){fe.push({type:"em_close",tag:"em",nesting:-1});const{node:Me}=ff(fe,0,s);y(Me)}else if(Ie===2){fe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Me}=Qc(fe,0,void 0,s);y(Me)}else if(Ie===3){fe.push({type:"em_close",tag:"em",nesting:-1}),fe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Me}=Qc(fe,0,void 0,s);y(Me)}else{const{node:Me}=ff(fe,0,s);y(Me)}}else s?.validateLink&&!s.validateLink(ee)?T(le,le):g({type:"link",href:ee,title:null,text:le,children:[{type:"text",content:le,raw:le}],loading:pe});const Te=j!==-1?z.slice(j+1):"";return Te&&(I({type:"text",content:Te,raw:Te}),u--),u++,!0}return!1}function it(z){const Q=z.indexOf("![");if(Q===-1)return!1;const oe=z.slice(0,Q);return oe&&!c?c={type:"text",content:oe,raw:oe}:oe&&c&&(c.content+=oe),c&&(a.push(c),c=null),g(ae(z.slice(Q))),u++,!0}function ce(z){if(!(z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Q=z.slice(1).match(/[^\s\]]/);if(Q===null)return u++,!0;if(Q&&/x/i.test(Q[0])){const oe=Q[0]==="x"||Q[0]==="X";return g({type:"checkbox_input",checked:oe,raw:oe?"[x]":"[ ]"}),u++,!0}return!1}return a}function lU(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 aU(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 cU(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Sc(e,t,n){const s=e[t],o=[],i=cl(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=cU(c)?jl(c):c,d=e[a-1];u!==c&&(aU(u),lU(u));const f=String(u.content??"");l.push({type:"paragraph",children:qn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Cc(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]=Sc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Z0(e,a,i.options(),X0);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(`
|
|
177
|
-
`)},r+1]}function uU(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=cl(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:qn(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]=Sc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Cc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Ih(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}
|
|
178
|
-
${r.map(c=>c.raw).join(`
|
|
179
|
-
`)}
|
|
180
|
-
:::`},a+1]}const dU=new Set(["warning","info","note","tip","danger","caution"]);function fU(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 dU.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function pU(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=fU(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=cl(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 _=f[m];if(_.type==="text"&&/:+/.test(_.content)){h=m;break}}const p={type:"paragraph",children:qn((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]=Sc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Cc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Ih(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}
|
|
181
|
-
${l.map(d=>d.raw).join(`
|
|
182
|
-
`)}
|
|
183
|
-
:::`},c+1]}const hU=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function mU(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=hU.exec(String(s.info??""));return o?uU(e,t,o,n):null}const X0={parseContainer:(e,t,n)=>pU(e,t,n),matchAdmonition:mU};function Cc(e,t,n){const s=[],o=cl(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:qn(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]=Sc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Cc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=Z0(e,i,o.options(),X0);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(`
|
|
184
|
-
`)},i+1]}function gU(e){if(e.info?.startsWith("diff"))return Y0(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 vU(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=cl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=qn(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:qn(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(`
|
|
185
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
186
|
-
`)},o+1]}function yU(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=cl(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:qn(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(`
|
|
187
|
-
`)}`},l+1]}function kU(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:qn(a.children||[],c,void 0,n),raw:c}}function bU(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=jn(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=jn(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 MM(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=jn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=sa.has(n),l=Eh(o),a=(s===-1?-1:bU(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
188
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function _U(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 wU(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 EM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function IM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return EM(n)?n:void 0}function SU(e,t,n){const s=IM(pd(t),n);if(!EM(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 CU(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=wU(e[c].attrs),_=a.length,k=!f&&!r,g=k?o?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:qn(h.children||[],p,void 0,SU(n,g,k?u:void 0)),raw:p,align:m}),k&&(u=IM(u,pd(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(`
|
|
189
|
-
`)},s+1]}function xU(){return{type:"thematic_break",raw:"---"}}let Ig=null;const $g=new WeakMap;function bS(){return Ig||(Ig={allowedTagSet:Nh(),customTagSet:null}),Ig}function AU(e){if(!e||e.length===0)return bS();const t=$g.get(e);if(t)return t;const n=e.map(li).filter(Boolean);if(!n.length){const o=bS();return $g.set(e,o),o}const s={allowedTagSet:Nh({customHtmlTags:e}),customTagSet:new Set(n)};return $g.set(e,s),s}function TU(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=cl(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:qn(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]=Sc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=Cc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Ih(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+=`
|
|
190
|
-
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
191
|
-
`),f+=`
|
|
192
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function MU(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function EU(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function IU(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Oo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Oo(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=jn(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=jn(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 $U(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=jn(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 _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(p)){const m=jn(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 p1(e){return Number.isFinite(e)&&e>0?e:0}function NU(e,t){const n=p1(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
193
|
-
`&&(s++,s===n))return o+1;return e.length}function Ih(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[kU(e,t,n),t+3];case"code_block":return[gU(s),t+1];case"fence":return[Y0(s),t+1];case"math_block":return[_U(s),t+1];case"html_block":{const o=MM(s),i=o.tag?AU(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)?NU(l,Number(s.map?.[0]??0)):0,u=$U(l,r,Math.max(p1(a),p1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=jn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:IU(d,r,f+1),_=m?.start??-1;let k="";f!==-1&&(_!==-1&&f<_?k=d.slice(f+1,_):k=d.slice(f+1)),_===-1&&(k=EU(k,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const P=y[1];if(!P||P.toLowerCase()===r)continue;const N=y[2]||y[3]||y[4]||"";g.push([P,N])}const T=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:MU(k),raw:String(u?.raw??o.raw??d),loading:T,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=CU(e,t,n);return[o,i]}case"dl_open":{const[o,i]=vU(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=yU(e,t,n);return[o,i]}case"hr":return[xU(),t+1]}return null}function Z0(e,t,n,s){const o=Ih(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 TU(e,t,n)}return null}function LU(){return{type:"hardbreak",raw:`\\
|
|
194
|
-
`}}function OU(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:qn(s.children||[],o,void 0,n),raw:o}}const _S=new WeakMap,$h=new WeakMap,PU=["$$","\\["];function hc(){return typeof performance<"u"?performance.now():Date.now()}function J0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function $M(e){return e.__timing}function Ng(e,t,n){return t&&J0(t,"parseMarkdownToStructureTotalMs",hc()-n),e}function wS(e,t,n){if(!n)return IS(e,t);const s=hc(),o=IS(e,t);return J0(n,"processTokensMs",hc()-s),o}function RU(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=wc(t);return n.length?new Set(n):null}function DU(e,t){const n=e;let s=_S.get(n);s||(s=new Map,_S.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 BU(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function hf(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]=Nl(o.value,n))}}function Nl(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(Nl(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Nl(l,t),Nl(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Nl(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),hf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),hf(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),hf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!BU(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),hf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Nl(i[r],t);return o}function NM(e,t=!0){if(!t)return jl(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=>NM(a,t)):t&&r&&typeof r=="object"&&(l=Nl(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function SS(e,t=!0){return e.map(n=>NM(n,t))}function LM(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 FU(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 HU(e){$h.delete(e)}function WU(e,t,n){$h.set(e,{source:t,key:n,pendingCandidate:n===null&&kM(t)})}function zU(e){return e.endsWith("$")||e.endsWith("\\")}function UU(e){const t=Math.max(e.lastIndexOf(`
|
|
195
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return PU.some(s=>n.endsWith(s))}function jU(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||UU(e)&&/[\r\n]/.test(t)):!1}function qU(e,t){if(!fM(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=$h.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&&!jU(o.source,l)&&!zU(t)){o.source=t;return}}const i=iz(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),WU(e,t,i)}function VU(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function KU(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 Lg(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&&KU(e,t)}function CS(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function GU(e){for(let t=0;t+5<e.length;t++)if(CS(e,t)&&CS(e,t+3)&&Lg(e[t],e[t+3])&&Lg(e[t+1],e[t+4])&&Lg(e[t+2],e[t+5]))return!0;return!1}function YU(e,t,n){return fM(e)&&kM(t)&&GU(n)}function QU(e){const t=$h.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function xS(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!LM(e,s)||(qU(e,t),QU(e)))return e.parse(t,n);const o=e.stream.parse(t,DU(e,n));if(YU(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!VU(s))return o;const i=$M(s);if(!i)return SS(o,!0);const r=hc(),l=SS(o,!0);return J0(i,"tokenCloneMs",hc()-r),l}function Nh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Yu;const n=new Set(Yu);for(const s of wc(t))s&&n.add(s);return n}function XU(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 AS(e){return{type:"paragraph",children:e,raw:e.map(XU).join("")}}function TS(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=RU(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(AS(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(AS(c)),a}function ZU(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 wu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function JU(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*${Oo(t)}\s*>\s*$`,"i").test(n)}function ey(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Oo(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=jn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(sa.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*${Oo(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Oo(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=jn(e.slice(p));if(m===-1)return null;u--;const _=p+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(p)){const m=jn(e.slice(p));if(m===-1)return null;const _=e.slice(p,p+m+1);/\/\s*>$/.test(_)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function ej(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]===`
|
|
196
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function tj(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
197
|
-
</${t}>`}function MS(e){return e.replace(/\r\n/g,`
|
|
198
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function nj(e,t,n){return n?e.includes(n,t)?!0:MS(e.slice(Math.max(0,t))).includes(MS(n)):!1}function sj(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
199
|
-
`&&n++,n):e[n]===`
|
|
200
|
-
`?n+1:t}function ES(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function oj(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function ty(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Oo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function OM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const ij=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),rj=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function lj(e){return/\n\s*\n/.test(e)||rj.test(e)}function aj(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>ij.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(!lj(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function cj(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"||YT.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=jn(l);if(a===-1)return o;const c=ty(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Su(u,t,OM(n,s));return aj(u,d)?{...o,children:d}:o})}function Su(e,t,n){return e.trim()?RM(e,t,{...n,__disableStreamParse:!0}):[]}function uj(e,t,n){const s=Su(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function dj(e,t,n){const s=MM({content:e}),o=jn(e),i=ty(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=uj(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function fj(e,t,n){const s=jn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=ey(o,"summary",0);if(!i)return Su(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Su(r,t,n),dj(i.raw,t,n),...Su(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=wu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!ES(c)){r.push(c);continue}const f=String(c.raw??wu(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 Y=a+1;Y<e.length;Y++){const q=e[Y];if(ES(q)){p++;continue}if(oj(q)&&(p--,p===0)){m=Y;break}}const _=ey(t,"details",h),k=m===-1&&_?.closed===!0,g=k?(()=>{const Y=ty(f,"details");return Y!==-1?f.slice(0,Y):f})():f,[v]=PM(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),y=fj(g,n,OM(s,o)),T=m===-1?"</details>":String(e[m].raw??wu(e[m])??"</details>"),P=k||m!==-1&&_?.closed===!0,N=T.replace(/[\t\r\n ]+$/,""),b=P?(()=>{const Y=(_?.raw??"").lastIndexOf(N);return Y===-1?t.length:h+Y})():t.length,M=jn(f),I=k&&M!==-1?h+M+1:h+f.length,L=t.slice(I,b===-1?t.length:b),S=n.parse(L,{__markstreamFinal:o}),E=n.renderer.render(S,n.options,{__markstreamFinal:o}),R=b+N.length,D=P?Math.max(b+T.length,sj(t,R)):t.length,F=P?t.slice(b,D):T,U=P?t.slice(h,D):t.slice(h),G=k&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:Eh(f.slice(0,M+1)),raw:U,content:`${G}${E}${F}`,children:[...y,...v],loading:!o&&!P}),l=P?D:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function pj(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=wu(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=ey(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=tj(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,_=jn(u.raw),k=_===-1?"":u.raw.slice(0,_+1),g=k?Eh(k):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=ej(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&JU(s[y],c)){s.splice(y,1);continue}const T=wu(s[y]);if(!T)break;const P=u.raw.indexOf(T,v);if(P===-1){if(nj(n,u.end,T))break;s.splice(y,1);continue}v=P+T.length,s.splice(y,1)}}return s}function hj(e){const t=l=>l===" "||l===" "||l===`
|
|
201
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",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 _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")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 v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let T=v;for(;T<g.length&&g[T]===y;)T++;const P=T-v;return P<3?null:{markerChar:y,markerLen:P,rest:g.slice(T)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&f(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const y=p(g);return y==null?null:h(y)};let _=0;const k=l.split(/\r?\n/);for(const g of k){const v=_,y=_+g.length;if(a<v)break;const T=m(g);if(T){const P=T.markerChar,N=T.markerLen;c?P===u&&N>=d&&/^\s*$/.test(T.rest)&&(c=!1,u="",d=0):(c=!0,u=P,d=N)}if(a<=y)break;_=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
202
|
-
`||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]===`
|
|
203
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function mj(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 _=0;_<p.length;_++){const k=p[_];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=p=>{let m=!1,_=!1;for(let k=0;k<p.length;k++){const g=p[k];if(g==="\\"){k++;continue}if(!_&&g==="'"){m=!m;continue}if(!m&&g==='"'){_=!_;continue}if(!m&&!_&&g===">")return k}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const _=p[m];if(_!=="`"&&_!=="~")return null;let k=m;for(;k<p.length&&p[k]===_;)k++;const g=k-m;return g<3?null:{markerChar:_,markerLen:g,rest:p.slice(k)}},a=(p,m)=>{if(i(p))return-1;const _=p.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let k=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(k=!0),g++;continue}const y=r(p.slice(g));if(y===-1){k=!0,g++;continue}const T=p.slice(g,g+y+1);let P=1;for(;P<T.length&&s(T[P]);)P++;if(P>=T.length){k=!0,g++;continue}const N=T[P];if(N==="!"||N==="?"){k=!0,g+=y+1;continue}if(N==="/"){k=!0,g+=y+1;continue}const b=P;for(;P<T.length&&o(T[P]);)P++;if(P===b){k=!0,g++;continue}const M=T.slice(b,P).toLowerCase(),I=T[P];if(I&&I!==" "&&I!==" "&&I!==">"&&I!=="/"){k=!0,g++;continue}const L=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),S=/\/\s*>$/.test(T),E=L.test(p.slice(g+y+1)),R=L.test(e.slice(m+g+y+1)),D=/[\r\n]/.test(e.slice(m+g+y+1));if(k&&n.has(M)&&!S&&!E&&(R||D))return g;k=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
204
|
-
`,h),m=p!==-1,_=m&&p>h&&e[p-1]==="\r",k=m?_?p-1:p:e.length,g=e.slice(h,k),v=m?_?`\r
|
|
205
|
-
`:`
|
|
206
|
-
`:"",y=l(g);let T=g;if(!c&&!y){const P=a(g,h);if(P!==-1){const N=v||`
|
|
207
|
-
`;T=`${g.slice(0,P).replace(/[ \t]+$/,"")}${N}${N}${g.slice(P).replace(/^[ \t]+/,"")}`}}f+=T,f+=v,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),h=m?p+1:e.length}return f}function gj(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 _=m+1;for(;_<d.length&&s(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&s(d[_]);)_++;if(_+p.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<p.length;v++){const y=d[_+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=_+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 _=f+m;if(l(d,_+1,p))return d;const k=i(d.slice(_+1));return k?`${d.slice(0,_+1)}
|
|
208
|
-
${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
209
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
210
|
-
`:`
|
|
211
|
-
`,u=d+1}return c}function vj(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 _=m-h;return _<3?null:{markerChar:p,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
212
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,_=e.slice(d,m),k=h?p?`\r
|
|
213
|
-
`:`
|
|
214
|
-
`:"",g=o(_),v=g?.prefix??"",y=g?.content??_,T=i(y);T&&(l?T.markerChar===a&&T.markerLen>=c&&/^\s*$/.test(T.rest)&&(l=!1,a="",c=0):(l=!0,a=T.markerChar,c=T.markerLen));let P=y;if(!l&&P.includes("</"))for(const N of r)P=P.replace(N,(b,M,I,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return b;const S=L.slice(0,I).replace(/^[\t ]+/,"");if(S.length>0){const E=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!E||!R||E!==R)return b}return`${M}
|
|
215
|
-
|
|
216
|
-
`});if(v){const N=v+P.split(`
|
|
217
|
-
`).join(`
|
|
218
|
-
${v}`);u+=N}else u+=P;u+=k,d=h?f+1:e.length}return u}function yj(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 E=0;for(let R=0;R<S.length;R++){const D=S[R];if(D===" "){if(E++,E>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const E=S.charCodeAt(0);return E>=65&&E<=90||E>=97&&E<=122||E>=48&&E<=57||S==="_"||S==="-"||S===":"},r=S=>{let E=0;for(;E<S.length&&s(S[E]);)E++;return S.slice(E)},l=S=>{let E=0,R=!1,D=0;for(;E<S.length;){for(;E<S.length&&s(S[E]);)E++;if(E>=S.length||S[E]!==">")break;for(R=!0,E++;E<S.length&&s(S[E]);)E++;D=E}if(!R)return null;const F=S.slice(0,D);return{prefix:F,key:F.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let E=0;E<S.length;E++){const R=S[E];if(R!==" "&&R!==" ")return!1}return!0},u=S=>{if(o(S))return"";const E=r(S);if(!E.startsWith("<"))return"";let R=1;for(;R<E.length&&s(E[R]);)R++;if(R>=E.length||E[R]==="/"||E[R]==="!"||E[R]==="?")return"";const D=R;for(;R<E.length&&i(E[R]);)R++;if(R===D)return"";const F=E.slice(D,R).toLowerCase();if(!n.has(F))return"";const U=E[R];return U&&U!==" "&&U!==" "&&U!==">"&&U!=="/"?"":F},d=S=>{if(o(S))return null;const E=r(S);if(!E.startsWith("<"))return null;let R=1;for(;R<E.length&&s(E[R]);)R++;if(R>=E.length)return null;const D=E[R]==="/";if(D)for(R++;R<E.length&&s(E[R]);)R++;const F=E[R];if(!F||F==="!"||F==="?")return null;const U=R;for(;R<E.length&&i(E[R]);)R++;if(R===U)return null;const G=E.slice(U,R).toLowerCase();if(!n.has(G))return null;const Y=E[R];if(Y&&Y!==" "&&Y!==" "&&Y!==">"&&Y!=="/")return null;if(D)return{type:"close",name:G};if(/\/\s*>\s*$/.test(E))return{type:"open",name:G,complete:!0};const q=E.indexOf(">",R);if(q!==-1){const ae=E.slice(q+1);if(new RegExp(`<\\s*\\/\\s*${G}\\s*>`,"i").test(ae))return{type:"open",name:G,complete:!0}}return{type:"open",name:G,complete:!1}},f=S=>{if(o(S))return null;const E=r(S).replace(/[ \t]+$/,"");if(!E.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(E))return null;const R=E.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const D=E.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const F=D[1].toLowerCase();return F===D[2].toLowerCase()?F:null};let h=!1,p="",m=0;const _=S=>{let E=0;for(;E<S.length&&s(S[E]);)E++;const R=S[E];if(R!=="`"&&R!=="~")return null;let D=E;for(;D<S.length&&S[D]===R;)D++;const F=D-E;return F<3?null:{markerChar:R,markerLen:F,rest:S.slice(D)}},k=S=>_(S),g=S=>{const E=r(S);return E?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(E):!1},v=(S,E,R)=>{let D=S,F=0;for(;D<e.length;){const U=e.indexOf(`
|
|
219
|
-
`,D),G=U!==-1,Y=G&&U>D&&e[U-1]==="\r",q=G?Y?U-1:U:e.length,ae=e.slice(D,q),de=l(ae),ne=de?.key??"";if(F>0&&E&&ne!==E)break;const X=de?.content??ae,he=d(X);if(he?.name===R){if(he.type==="open")he.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(c(X)||g(X)))return!0;if(G)D=U+1;else break}return!1};let y="",T=0,P=!0,N=!1,b=!1,M=`
|
|
220
|
-
`;const I=[];let L="";for(;T<e.length;){const S=e.indexOf(`
|
|
221
|
-
`,T),E=S!==-1,R=E&&S>T&&e[S-1]==="\r",D=E?R?S-1:S:e.length,F=e.slice(T,D),U=E?R?`\r
|
|
222
|
-
`:`
|
|
223
|
-
`:"",G=l(F),Y=G?.key??"",q=G?.content??F,ae=k(q);ae&&(h?ae.markerChar===p&&ae.markerLen>=m&&/^\s*$/.test(ae.rest)&&(h=!1,p="",m=0):(h=!0,p=ae.markerChar,m=ae.markerLen));const de=I.length>0;if(!h&&!de){const X=u(q),he=!!X&&!P&&N&&b&&v(T,Y,X);X&&!P&&(!N||he)&&(Y&&L&&Y===L?y+=`${Y}${M}`:Y||(y+=M))}if(y+=F,y+=U,U&&(M=U),!h){const X=d(q);if(X){if(X.type==="open")X.complete||I.push(X.name);else for(let he=I.length-1;he>=0;he--)if(I[he]===X.name){I.length=he;break}}}const ne=c(q);P=ne,N=!ne&&a(q),b=!ne&&!!f(q),L=Y,T=E?S+1:e.length}return y}function RM(e,t,n={}){const s=$M(n),o=s?hc():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(FU(t,n)&&(t.stream.reset(),HU(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
|
|
224
|
-
`)?`
|
|
225
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
|
|
226
|
-
`)?`
|
|
227
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.startsWith(`
|
|
228
|
-
`)?`
|
|
229
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
230
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,_=>_.startsWith(`
|
|
231
|
-
`)?`
|
|
232
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,k,g)=>`${k}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
|
|
233
|
-
`)?`
|
|
234
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
235
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const _=wc(n.customHtmlTags);if(_.length&&(r=mj(r,_),r=gj(r,_),r=yj(r,_),r=vj(r,_),r.includes("</")))for(const k of _){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${k}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=hj(r));const l=ZU(r);if(l){const _=n.preTransformTokens,k=n.postTransformTokens;if(LM(t,n)||typeof _=="function"||typeof k=="function"){const g=xS(t,r,{__markstreamFinal:i},n),v=typeof _=="function"&&_(g)||g;typeof k=="function"&&k(v)}return Ng(l,s,o)}const a=xS(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Ng([],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=wS(d,p,s);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const k=_[0],g=k?.type;k&&typeof g=="string"?m=wS(_,void 0,s):m=_}}if(m=pj(m,i,r),m=PM(m,r,t,n,i)[0],m=cj(m,t,n,i),i){const _=new WeakSet,k=g=>{if(!g||typeof g!="object"||_.has(g))return;if(_.add(g),Array.isArray(g)){for(const y of g)k(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))k(y)};k(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Ng(m,s,o)}function IS(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=cl(t);let o=0;for(;o<e.length;){const i=Z0(e,o,s.options(),X0);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=OU(e,o,s.options(l)),c=TS(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]=Sc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=Cc(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(LU()),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=qn(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=TS(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const kj=new Set([...fd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),bj=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"]),$S=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function NS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _j(e){return typeof e=="string"?e:e==null?"":String(e)}function DM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Hr(e){return _j(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function BM(e){return Hr(e).replace(/`/g,"`")}function Lh(e){return String(e??"").trim().toLowerCase()}function ny(e,t="safe"){const n=Lh(e);return n?t==="escape"?!0:t==="trusted"?fd.has(n):!bj.has(n):!1}function FM(e,t="safe"){const n=Lh(e);return n?t==="escape"?!0:t==="trusted"?fd.has(n):kj.has(n):!1}function LS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${BM(s)}"`).join("")}function wj(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||Ul(o,{tagName:t,attrName:"srcset"})})}function HM(e,t,n,s){return iH.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?wj(t,s):!!(rH.has(e)&&t&&Ul(t,{tagName:s,attrName:e}))}function Ll(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function WM(e,t,n,s=!1){if(t!=="safe"||Lh(n)!=="a")return e;const o=Ll(e,"href");if(s&&(!o||!e[o])){const a=Ll(e,"target"),c=Ll(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Ll(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Ll(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||!DM(r)||HM(l,i,t,n)||(s[r]=i)}return WM(s,t,n,!!Ll(e,"href"))}function zM(e,t){const n=e.toLowerCase();return GT.has(n)?!1:NS(t,n)||NS(t,e)}function sy(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!DM(r)||HM(l,i,t,n)||(s[r]=i)}return WM(s,t,n,!!Ll(e,"href"))}function Op(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 h1(e,t="safe",n){const s=sy(Op(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function Sj(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 Cj(e){const t={};for(const[n,s]of Object.entries(e))t[n]=Sj(s,n);return t}function PS(e){return e.trim().length>0}function xj(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);PS(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);PS(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||sa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function Aj(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||sa.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function Tj(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Hr(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Hr(s)}`:` ${Hr(s)}="${BM(o)}"`).join("");return e.type==="self_closing"?`<${Hr(t)}${n} />`:`<${Hr(t)}${n}>`}function Mj(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;$S.lastIndex=0;let n;for(;(n=$S.exec(e))!==null;)if(zM(n[1],t))return!0;return!1}function ic(e,t="safe"){if(!e)return"";if(t==="escape")return Hr(e);const n=Aj(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Hr(r.content??""));continue}const l=Lh(r.tagName);if(!l)continue;if(FM(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"&&ny(l,t)){o.push(Tj(r));continue}if(r.type==="self_closing"){o.push(`<${l}${LS(OS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${LS(OS(r.attrs??{},t,l))}>`),sa.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 Ej=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],RS="http://www.w3.org/2000/svg",Ij=new Set(["script","style","iframe","object","embed","link","meta"]),$j=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"]),Nj=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Lj=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Oj=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Pj(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Rj(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Dj(e){const t=e.nodeName.toLowerCase();return t==="use"?Pj(e):t==="image"?Rj(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Oj.has(t)}function Bj(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 Fj(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")?Ul(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?Ul(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":Ul(i,{tagName:s,attrName:o})?"":i:""}function Hj(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 UM(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 jM(e){const t=UM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=Hj(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function DS(e){const t=UM(e);return Ej.some(n=>n.test(t))||jM(t)}function Wj(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 mf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function qM(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(!Ij.has(s)){if(s==="br"){t.push(`
|
|
236
|
-
`);return}for(const o of Array.from(n.childNodes))qM(o,t)}}function zj(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];qM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=mf(t.getAttribute("width")),i=mf(t.getAttribute("height")),r=mf(t.getAttribute("x")),l=mf(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 Uj(e){zj(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!$j.has(s)){n.remove();continue}if(s==="style"&&DS(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&&DS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(Nj.has(r)&&i.value){const l=Fj(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(Lj.has(r)&&i.value&&jM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=Bj(i.value);l!==i.value&&n.setAttribute(i.name,l)}}Wj(n)}}function _ge(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 Uj(n),jj(n)?null:n}catch{return null}}function jj(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){Dj(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 BS=[];function Og(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qj(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function Vj(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function FS(e=`editor-${Date.now()}`,t={}){const n=cz(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(BS.length)for(const f of BS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(T7),n.use(I7),n.use(C7);const i=j7,r=i.default??i;n.use(r),n.use(S7),n.use(w7),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,_=p.split(/\r?\n/);for(const k of h.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,T=y[0],P=y.length,N=_[Math.max(0,v-1)]??"";let b=0;for(;b<N.length&&(N[b]===" "||N[b]===" ");)b++;let M=0;for(;b+M<N.length&&N[b+M]===T;)M++;let I=b+M;for(;I<N.length&&(N[I]===" "||N[I]===" ");)I++;const L=m?!0:v>g+1&&M>=P&&I===N.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!L,S.meta.closed=!!L}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const _=p.src[m-1],k=p.src[m+1];if(/\d/.test(_)&&/\d/.test(k)){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(),_=String(p.content??""),k=btoa(unescape(encodeURIComponent(_))),g=qj(m),v=Og(g),y=Vj(`editor-${e}-${h}-${g}`),T=Og(o("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
|
|
237
|
-
<div class="code-header">
|
|
238
|
-
<span class="code-lang">${Og(g.toUpperCase())}</span>
|
|
239
|
-
<button class="copy-button" data-code="${k}">${T}</button>
|
|
240
|
-
</div>
|
|
241
|
-
<div class="code-editor"></div>
|
|
242
|
-
</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 _=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const k=p.src.slice(p.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!h){const g=m[1],v=p.push("reference","span",0);v.content=g,v.markup=m[0],v.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 Kj({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 VM({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}:Kj({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const HS=new WeakMap;function Gj(e){let t=HS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},HS.set(e,t)),t}function WS(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 oy(e){return!!(e.themes?.length||e.langs?.length)}function KM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function Yj(e,t){return!t?.length||e.registeredAllLangs?!0:KM(e.registeredLangs,t)}function Pg(e,t){return oy(t)&&KM(e.registeredThemes,t.themes)&&Yj(e,t.langs)}function Qj(e,t){if(!oy(t))return t;const n=WS(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:WS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const Xj={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 Zj(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function GM(e){const t=Zj(e);return Xj[t]??t}function YM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>GM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function QM(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 Jj(e){return QM(e)?.join("\0")??""}function XM(e,t){const n=QM(e),s=YM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Pp(e,t){return`${Jj(e)}\0\0${YM(t)?.join("\0")??""}`}function wge(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=XM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Pp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Sge(e,t={},n){if(!e)return"ready";const s=XM(t.themes,t.langs),o=Pp(s.themes,s.langs),i=n&&n===o?n:o,r=Gj(e);if(r.completed.has(i))return"ready";if(Pg(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)||Pg(r,s))return r.completed.add(i),"ready";const c=Qj(r,s),u=Pp(c.themes,c.langs);return r.completed.has(u)||Pg(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(oy(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 Aa(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function zS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var eq=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=US();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=US();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,_=oq(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=sq(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond: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=Aa(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Aa(s,1e3,1)),this.normalizedTargetLatencyMs=Aa(o,900,1),this.normalizedCatchUpLatencyMs=Aa(i,350,1),this.normalizedCatchUpThreshold=zS(r,600),this.normalizedStartDelayMs=zS(a,80),this.maxCommitFps=Math.trunc(Aa(l,30,1)),this.maxCharsPerCommit=Math.trunc(Aa(c,80,1)),this.flushOnFinish=u,this.segmenter=nq(),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 tq(e={},t){const n=new eq(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 nq(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function sq(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 US(){return typeof performance<"u"?performance.now():Date.now()}function oq(e,t,n){return Math.min(n,Math.max(t,e))}var iq=(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 m1=Symbol.for("markstream-vue:node-lifecycle"),jS='<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>',qS='<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>',rq={id:"material",core:{"":qS,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:qS,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:jS,csharp:jS,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:()=>eo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},g1=new Map;let VS="material";const ja=new Map,KS=new Map;let v1=null;function lq(e){g1.set(e.id,e)}function aq(e){return iq(this,null,function*(){var t,n,s;if(ja.has(e.id))return(t=ja.get(e.id))!=null?t:null;let o=KS.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(ja.set(e.id,i),v1?.(),i)).catch(()=>(ja.set(e.id,null),null)),KS.set(e.id,o)),o})}const cq=ea(0);v1=()=>{cq.value++},lq(rq);const uq={"":"",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 iy(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=uq[n])!=null?t:n}function Cge(e){const t=iy(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function xge(e){return(function(s){const o=g1.get(VS);if(!o)return;const i=o.core[s];if(i)return i;const r=ja.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!ja.has(o.id)&&aq(o)})(iy(e))||((n=(t=g1.get(VS))==null?void 0:t.fallback)!=null?n:"");var t,n}const Age={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 ZM=!1;function Tge(){return ZM}function Mge(){ZM=!0}var Oh=(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 Io=null,Pf=!1,Ph=ly;function Rh(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function ry(){try{const e=globalThis;return Rh(e?.katex)}catch{return null}}function ly(){return Oh(null,null,function*(){const e=ry();if(e)return e;const t=yield eo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield eo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Rh(t)})}function dq(e){Ph=e,Io=null,Pf=!1}function fq(e){dq(ly)}function JM(){return typeof Ph=="function"}function Ege(){var e;const t=Ph;if(!t||t===ly)return null;if(Io)return Io;const n=ry();if(n)return Io=n,Io;try{const s=t();return s&&typeof s?.then!="function"?(Io=(e=Rh(s))!=null?e:s,Io):null}catch{return null}}function ay(){return Oh(this,null,function*(){var e;const t=ry();if(t)return Io=t,Io;if(Io)return Io;if(Pf)return null;const n=Ph;if(!n)return Pf=!0,null;try{const s=yield n();if(s)return Io=(e=Rh(s))!=null?e:s,Io}catch{}return Pf=!0,null})}function e3(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Ur=null,Dr=null;const Jo=new Map,sr=new Map;let Rp=5;const Dl=new Set;function Ju(){if(Jo.size<Rp&&Dl.size){const e=Array.from(Dl);Dl.clear();for(const t of e)try{t()}catch{}}}function pq(e){Ur=e,Dr=null,Ur.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=Jo.get(n);if(i)if(Jo.delete(n),clearTimeout(i.timeoutId),Ju(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(sr.set(a,s),sr.size>200){const c=sr.keys().next().value;sr.delete(c)}}i.resolve(s)}},Ur.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of Jo.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));Jo.clear(),Ju()}}function hq(){var e;Ur&&((e=Ur.terminate)==null||e.call(Ur)),Ur=null,Dr=null}function mq(e,t=!0,n=2e3,s){return Oh(this,null,function*(){performance.now();const o=e3(e);if(!JM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Dr)return Promise.reject(Dr);const i=`${t?"d":"i"}:${o}`,r=sr.get(i);if(r)return Promise.resolve(r);const l=Ur||(Dr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Dr.name="WorkerInitError",Dr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Dr);if(Jo.size>=Rp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Jo.size,a.max=Rp,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(()=>{Jo.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Ju()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),Jo.has(u)&&Jo.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Ju()},{once:!0});const f=a,h=c;Jo.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function Ige(e,t=!0,n){const s=`${t?"d":"i"}:${e3(e)}`;if(sr.set(s,n),sr.size>200){const o=sr.keys().next().value;sr.delete(o)}}const gq="WORKER_BUSY";function vq(e=2e3,t){return Jo.size<Rp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Dl.delete(r),n())};if(Dl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Dl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Ju()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Dl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Xc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function $ge(e){return Oh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!JM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Xc.timeout,c=(i=s.waitTimeout)!=null?i:Xc.waitTimeout,u=(r=s.backoffMs)!=null?r:Xc.backoffMs,d=(l=s.maxRetries)!=null?l:Xc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Xc.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!==gq||p>=f)throw m;if(p++,yield vq(c,h).catch(()=>{}),h?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*p)))}}})}function qa(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function yq(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 y1(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=yq(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 k1(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 t3(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function b1(e,t=360,n=500){return t3(e,t,n)}function _1(e,t=360,n=500){return t3(e,t,n)}var kq=Object.defineProperty,bq=Object.defineProperties,_q=Object.getOwnPropertyDescriptors,GS=Object.getOwnPropertySymbols,wq=Object.prototype.hasOwnProperty,Sq=Object.prototype.propertyIsEnumerable,YS=(e,t,n)=>t in e?kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n3=(e,t)=>{for(var n in t||(t={}))wq.call(t,n)&&YS(e,n,t[n]);if(GS)for(var n of GS(t))Sq.call(t,n)&&YS(e,n,t[n]);return e},cy=(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 uy=()=>eo(()=>import("./mermaid.core-DzyMX8Ld.js").then(e=>e.bn),[]);let qi=null,dy=uy;function Cq(e){dy=e,qi=null}function xq(e){Cq(uy)}function Aq(){return typeof dy=="function"}function QS(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=n3({},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},bq(n,_q(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=n3({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 Nge(){return cy(this,null,function*(){if(qi)return qi;const e=(function(){try{const s=globalThis;return QS(s?.mermaid)}catch{return null}})();if(e)return qi=e,XS(qi),qi;const t=dy;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===uy?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(qi=QS(n),XS(qi),qi):null})}let Zs=null,Br=null;const Is=new Map;let ZS=5,JS=!1;const Tq="WORKER_BUSY",Mq="MERMAID_DISABLED";function Eq(e){Zs=e,Br=null;const t=e;Zs.onmessage=n=>{if(Zs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Is.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Zs.onerror=n=>{var s,o;if(Zs===t)if(Is.size!==0){try{JS?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 Is.entries())r.reject(new Error(`Worker error: ${n.message}`));Is.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Zs.onmessageerror=n=>{var s,o;if(Zs===t)if(Is.size!==0){try{JS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Is.entries())r.reject(new Error("Worker messageerror"));Is.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function Iq(){var e;if(Zs)try{for(const[t,n]of Is.entries())n.reject(new Error("Worker cleared"));Is.clear(),(e=Zs.terminate)==null||e.call(Zs)}catch{}Zs=null,Br=null}function s3(e,t,n=1400){if(!Aq()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=Mq,Promise.reject(o)}if(Br)return Promise.reject(Br);const s=Zs||(Br=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Br.name="WorkerInitError",Br.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Br);if(Is.size>=ZS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=Tq,o.inFlight=Is.size,o.max=ZS,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),Is.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Is.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Is.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=Is.get(r);f&&f.reject(d)},n)})}function Lge(e,t,n=1400){return cy(this,null,function*(){try{return yield s3("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Oge(e,t,n=1400){return cy(this,null,function*(){try{return yield s3("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Pge(){if(Zs)try{for(const[e,t]of Is.entries())t.reject(new Error("Worker terminated"));Is.clear(),Zs.terminate()}finally{Zs=null}}var $q=Object.defineProperty,Nq=Object.defineProperties,Lq=Object.getOwnPropertyDescriptors,e2=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Pq=Object.prototype.propertyIsEnumerable,t2=(e,t,n)=>t in e?$q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))Oq.call(t,n)&&t2(e,n,t[n]);if(e2)for(var n of e2(t))Pq.call(t,n)&&t2(e,n,t[n]);return e},Ot=(e,t)=>Nq(e,Lq(t)),Un=(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 Rq="__global__",Rg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",w1=(()=>{const e=globalThis;if(e[Rg])return e[Rg];const t={scopedCustomComponents:{},revision:ea(0)};return e[Rg]=t,t})(),n2=w1.revision,Dq=Symbol("markstreamCustomComponents"),Bq=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 md(e){return Bq.has(String(e).trim().toLowerCase())}function Fq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Dg(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([li(n),li(Fq(n))]))!o||md(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function ps(e){const t=Ut(Dq,null);return B(()=>{var n;return n2.value,(function(s,o={}){return n2.value,rt(rt(rt({},Dg(w1.scopedCustomComponents[Rq]||{})),Dg(o)),Dg((function(i){return i&&w1.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const Hq=["aria-label"],Wq={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"},zq={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"},gn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Po=gn(qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),$("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),$("svg",zq,[...n[1]||(n[1]=[x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),x("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),$("svg",Wq,[...n[0]||(n[0]=[x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,Hq))}),[["__scopeId","data-v-be21ab83"]]);Po.install=e=>{e.component(Po.__name,Po)};const Uq={class:"emoji-node"},ko=gn(qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),$("span",Uq,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ko.install=e=>{e.component(ko.__name,ko)};const jq=["id"],qq=["title"],Ro=gn(qe({__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)=>(w(),$("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[x("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,qq)],8,jq))}}),[["__scopeId","data-v-c1463a29"]]);Ro.install=e=>{e.component(Ro.__name,Ro)};const o3=(()=>{try{return!1}catch{}return!1})();function Bg(e){o3&&console.warn(e)}function s2(e,t="safe",n){return sy(e,t,n)}function i3(e){return Cj(e)}function Fg(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function fy(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=h1((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Fg(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Fg(r.value)]):Object.entries(o).map(([r,l])=>[r,Fg(l)]):null,t,n);var o;if(!s)return;const i=i3(Op(s));return Object.keys(i).length>0?i:void 0}function o2(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 Zc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Hg(e,t,n,s,o,i,r=!1){const l=(function(d,f){return zM(d,f)})(e,s);if(fd.has(e.toLowerCase())||!l&&FM(e,i))return null;if(!l&&ny(e,i))return r?[o2(e,t,!0)]:[o2(e,t),...n,`</${e}>`];const a=sy(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=i3(a);return mn(d,Ot(rt({},f),{key:u}),n.length>0?n:void 0)}return mn(e,Ot(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function r3(e,t){return Mj(e,t)}function Dp(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=Hg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Zc(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=Hg(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Zc(c[c.length-1].children,m):Zc(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&Bg(`Auto-closing unclosed tag: <${p.tagName}>`)}else Bg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Hg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Zc(c[c.length-1].children,f):Zc(u,f),Bg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(xj(e),t,n)}catch(o){return s=o,o3&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const Vq=["innerHTML"],Do=gn(qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ps(()=>t.customId),i=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:ic(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Dp(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!r3(l,o.value))return{mode:"html",content:ic(l,s.value)};const a=Dp(l,o.value,s.value);return a===null?{mode:"html",content:ic(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),$("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ie(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),$("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),$("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,Vq))}}),[["__scopeId","data-v-d17f12b0"]]);Do.install=e=>{e.component(Do.__name,Do)};const Kq={class:"inline-code"},Gq={key:0},qs=gn(qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=ld(),s=Ut("markstreamFade",void 0),o=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=B(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=B(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=B(()=>!l.value),u=B(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=J(t.node.code),f=J("");let h=i?.value;const p=J(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([g,v,y,T])=>{const P=String(g??""),N=u.value,b=T!==h;h=T;const M=VM({nextContent:P,persistedContent:N?o?.get(N):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:b});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(p.value+=1),N&&o?.set(N,P)},{immediate:!0}),Ve(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),$("code",Kq,[c.value?(w(),$(Pe,{key:0},[Ue(O(a.value),1)],64)):(w(),$(Pe,{key:1},[d.value?(w(),$("span",Gq,O(d.value),1)):re("",!0),f.value?(w(),$("span",{key:1,class:Re(["inline-code-stream-delta",[k.value]]),onAnimationend:_},O(f.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);qs.install=e=>{e.component(qs.__name,qs)};const S1=J(!1),i2=J(""),r2=J("top"),Cu=J(null),xu=J(null),C1=J(null),x1=J(null),l2=J(null);let Rf=null,Df=null,A1=0;function l3(){Rf&&(clearTimeout(Rf),Rf=null),Df&&(clearTimeout(Df),Df=null)}let gf=!1,vf=null,a2=!1;function Yq(e,t,n="top",s=!1,o,i){if(!e)return;const r=++A1;l3();const l=()=>Un(null,null,function*(){var a,c;if(yield(function(){return Un(this,null,function*(){if(!gf&&!a2&&typeof document<"u"){vf!=null||(vf=Un(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([eo(()=>import("./vue.runtime.esm-bundler-Cuefls6q.js"),[]),eo(()=>import("./Tooltip-C12yteht.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:S1.value,"anchor-el":Cu.value,content:i2.value,placement:r2.value,id:xu.value,originX:C1.value,originY:x1.value,isDark:(p=l2.value)!=null?p:void 0})}}).mount(h),gf=!0}));try{yield vf}catch(u){gf=!1,vf=null,a2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),gf&&r===A1){xu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Cu.value=e,i2.value=t,r2.value=n,C1.value=(a=o?.x)!=null?a:null,x1.value=(c=o?.y)!=null?c:null,l2.value=typeof i=="boolean"?i:null,S1.value=!0;try{e.setAttribute("aria-describedby",xu.value)}catch{}}});s?l():Rf=setTimeout(l,80)}function Qq(e=!1){A1+=1,l3();const t=()=>{if(Cu.value&&xu.value)try{Cu.value.removeAttribute("aria-describedby")}catch{}S1.value=!1,Cu.value=null,xu.value=null,C1.value=null,x1.value=null};e?t():Df=setTimeout(t,120)}const T1={"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..."},M1=e=>{var t;return(t=T1[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 c2(e){return{t(t){if(e.te&&T1[t]&&!e.te(t))return M1(t);const n=e.t(t);return n===t&&T1[t]?M1(t):n}}}function Xq(){const e=(function(){var t,n;try{const s=Rs(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return c2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return c2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:M1}}function Zq(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 Jq=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],eV={key:1,class:"image-placeholder"},tV={key:1,class:"image-node__raw-text"},nV={key:0,class:"image-shimmer-overlay"},sV={key:1,class:"image-node__raw-text"},oV={key:2,class:"image-error"},Gr=gn(qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=J(!1),i=J(!1),r=J(""),l=J("primary"),a=J(null),c=ld(),u=Ut(m1,null);let d="",f=null;const h=B(()=>Uw(n.node.src)),p=B(()=>Uw(n.fallbackSrc)),m=B(()=>r.value),_=B(()=>!n.lazy),k=B(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=B(()=>l.value==="failed"),v=B(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=B(()=>Zq(n,c));function T(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function P(R=y.value){R&>(()=>{T(R)})}function N(){f&&(clearTimeout(f),f=null)}function b(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),N(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(P(R),M())},8e3)))}function M(){return Un(this,null,function*(){const R=d;R&&(N(),d="",yield gt(),T(R),u?.markSettled(R))})}function I(){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 P();l.value="failed",i.value=!0,s("error",r.value),P()}function L(){o.value=!0,i.value=!1,s("load",m.value),P()}function S(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,m.value])}const{t:E}=Xq();return Ve([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}),Ve([k,o,i,m,()=>n.lazy],([R,D,F,U,G])=>R&&U&&!F?D?(M(),void P()):G?(b(),void P()):void(D||F||b()):(M(),void P()),{flush:"post",immediate:!0}),ds(()=>{(function(){const R=d;R&&(N(),d="",u?.markSettled(R))})()}),(R,D)=>{var F,U,G,Y,q;return w(),$("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(w(),$("img",{key:0,src:m.value,alt:String((U=(F=n.node.alt)!=null?F:n.node.title)!=null?U:""),title:String((Y=(G=n.node.title)!=null?G:n.node.alt)!=null?Y:""),class:Re(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(q=n.node.alt)!=null?q:C(E)("image.preview"),onError:I,onLoad:L,onClick:S},null,42,Jq)):re("",!0),e.node.loading&&!i.value?(w(),$("span",eV,[n.usePlaceholder?Ln(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=x("span",{class:"image-shimmer"},null,-1))],!0):(w(),$("span",tV,O(e.node.raw),1))])):re("",!0),ie(Zr,{name:"shimmer-fade"},{default:_e(()=>[v.value&&!e.node.loading?(w(),$("span",nV,[n.usePlaceholder?Ln(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=x("span",{class:"image-shimmer"},null,-1))],!0):(w(),$("span",sV,O(e.node.raw),1))])):re("",!0)]),_:3}),g.value?(w(),$("span",oV,[Ln(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=x("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[x("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)),x("span",null,O(C(E)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Gr.install=e=>{e.component(Gr.__name,Gr)};const iV={key:2},Li=qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ps(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),i=B(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=B(()=>{var p,m;const _=(p=o?.value)!=null?p:{};return Ot(rt({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=hi({loader:()=>Promise.resolve().then(()=>ky),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!md(String(t.node.type)))),u=B(()=>c.value?fy(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=B(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(w(),ye(zs(a.value),vn({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:_e(()=>[d.value?(w(),ye(C(l),vn({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?(w(),ye(C(l),vn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ye(zs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),$("span",iV,O(h.value),1)):re("",!0)}}),rV=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],lV={key:0,translate:"no",class:"markstream-pre__diff-code"},aV={class:"markstream-pre__diff-number","aria-hidden":"true"},cV={class:"markstream-pre__diff-content"},uV={class:"markstream-pre__diff-content-inner"},dV={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},fV=["textContent"],Eo=qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=B(()=>{var S,E,R;const D=String((E=(S=t.node)==null?void 0:S.language)!=null?E:"");return String((R=String(D).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=B(()=>`language-${n.value}`),o=B(()=>{var S,E,R,D,F;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(E=t.node)==null?void 0:E.code)!=null?R:""):(function(U,G){const Y=String(U??"");return G?Y:Y.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((F=t.node)==null?void 0:F.loading)===!0)}),i=B(()=>o.value.split(/\r\n|\n|\r/)),r=B(()=>Array.from({length:Math.max(1,i.value.length)},(S,E)=>E+1)),l=B(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=B(()=>l.value&&t.diffInline===!0),c=B(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const E=`${Math.ceil(S)}px`;return{height:E,minHeight:E,maxHeight:E,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,E="context",R={}){const D=u(S);return{code:S,kind:D&&E!=="hunk"&&!R.preserveBlankKind?"context":E,empty:D}}function f(S){const E=String(S??"");return E?E.split(/\r\n|\n|\r/):[]}function h(S,E){return!u(S[E])||E<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function _(S,E){const R=f(S),D=f(E),F=(function(de,ne){const X=de.length,he=ne.length;if((X+1)*(he+1)>15e5)return null;const Oe=he+1,je=new Uint32Array((X+1)*(he+1));for(let Q=1;Q<=X;Q++)for(let oe=1;oe<=he;oe++){const W=Q*Oe+oe;if(de[Q-1]===ne[oe-1])je[W]=je[(Q-1)*Oe+(oe-1)]+1;else{const Z=je[(Q-1)*Oe+oe],ue=je[Q*Oe+(oe-1)];je[W]=Z>=ue?Z:ue}}const it=[];let ce=X,z=he;for(;ce>0&&z>0;)de[ce-1]===ne[z-1]?(it.push({originalIndex:ce-1,modifiedIndex:z-1}),ce--,z--):je[(ce-1)*Oe+z]>=je[ce*Oe+(z-1)]?ce--:z--;return it.reverse(),it})(R,D);if(F){const de=[];let ne=0,X=0;for(const he of F){for(;ne<he.originalIndex;)de.push(Ot(rt({},d(R[ne],"removed",{preserveBlankKind:h(R,ne)})),{key:`inline-removed-source-${ne}`,number:""})),ne++;for(;X<he.modifiedIndex;)de.push(Ot(rt({},d(D[X],"added",{preserveBlankKind:h(D,X)})),{key:`inline-added-source-${X}`,number:X+1})),X++;de.push(Ot(rt({},d(D[he.modifiedIndex])),{key:`inline-context-source-${he.originalIndex}-${he.modifiedIndex}`,number:he.modifiedIndex+1})),ne=he.originalIndex+1,X=he.modifiedIndex+1}for(;ne<R.length;)de.push(Ot(rt({},d(R[ne],"removed",{preserveBlankKind:h(R,ne)})),{key:`inline-removed-source-${ne}`,number:""})),ne++;for(;X<D.length;)de.push(Ot(rt({},d(D[X],"added",{preserveBlankKind:h(D,X)})),{key:`inline-added-source-${X}`,number:X+1})),X++;return de}const U=[];let G=0,Y=R.length-1,q=D.length-1;for(;G<=Y&&G<=q&&R[G]===D[G];)U.push(Ot(rt({},d(D[G])),{key:`inline-prefix-${G}`,number:G+1})),G++;const ae=[];for(;Y>=G&&q>=G&&R[Y]===D[q];)ae.unshift(Ot(rt({},d(D[q])),{key:`inline-suffix-${q}`,number:q+1})),Y--,q--;for(let de=G;de<=Y;de++)U.push(Ot(rt({},d(R[de],"removed",{preserveBlankKind:h(R,de)})),{key:`inline-removed-source-${de}`,number:""}));for(let de=G;de<=q;de++)U.push(Ot(rt({},d(D[de],"added",{preserveBlankKind:h(D,de)})),{key:`inline-added-source-${de}`,number:de+1}));return U.concat(ae)}const k=B(()=>{var S,E,R,D;const F=(function(q){const ae=q.some(ne=>p(ne)),de=q.some(ne=>m(ne));return ae&&de||(function(){var ne,X,he,Oe;if(n.value==="diff")return!0;const je=(Oe=(he=String((X=(ne=t.node)==null?void 0:ne.raw)!=null?X:"").split(/\r?\n/,1)[0])==null?void 0:he.trim())!=null?Oe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(je)})()&&(ae||de)})(i.value),U=(function(){var q,ae;return((q=t.node)==null?void 0:q.originalCode)!=null||((ae=t.node)==null?void 0:ae.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:F?(function(q){const ae=[];let de=1;for(const[ne,X]of q.entries())if(X.startsWith("@@"))ae.push(Ot(rt({},d(X,"hunk")),{key:`inline-hunk-${ne}`,number:""}));else if(p(X))ae.push(Ot(rt({},d(X.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ne}`,number:""}));else if(m(X))ae.push(Ot(rt({},d(X.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${ne}`,number:de++}));else{const he=X.startsWith(" ")?X.slice(1):X;ae.push(Ot(rt({},d(he)),{key:`inline-context-${ne}`,number:de})),de++}return ae})(i.value):_((S=t.node)==null?void 0:S.originalCode,(E=t.node)==null?void 0:E.updatedCode)}];if(!F&&U){const q=f((R=t.node)==null?void 0:R.originalCode),ae=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:q.map((de,ne)=>{const X=ae[ne]===de?"context":"removed";return Ot(rt({},d(de,X,{preserveBlankKind:h(q,ne)})),{key:`original-${ne}`,number:ne+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ae.map((de,ne)=>{const X=q[ne]===de?"context":"added";return Ot(rt({},d(de,X,{preserveBlankKind:h(ae,ne)})),{key:`modified-${ne}`,number:ne+1})})}]}const G=[],Y=[];for(const q of i.value)if(q.startsWith("@@"))G.push(d(q,"hunk")),Y.push(d(q,"hunk"));else if(q.startsWith("-")&&!q.startsWith("---"))G.push(d(q.slice(1),"removed",{preserveBlankKind:!0}));else if(q.startsWith("+")&&!q.startsWith("+++"))Y.push(d(q.slice(1),"added",{preserveBlankKind:!0}));else{const ae=q.startsWith(" ")?q.slice(1):q;G.push(d(ae)),Y.push(d(ae))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:G.map((q,ae)=>Ot(rt({},q),{key:`original-${ae}`,number:ae+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Y.map((q,ae)=>Ot(rt({},q),{key:`modified-${ae}`,number:ae+1}))}]}),g=B(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=J(null),y=J([]);let T=null,P=null;function N(S){const E=Number.parseFloat(String(S??""));return Number.isFinite(E)&&E>0?E:0}function b(S,E){var R;if(!S)return E;const D=S.querySelector(".markstream-pre__diff-content"),F=D?.getBoundingClientRect(),U=(R=F?.height)!=null?R:0;return Math.max(E,Math.ceil(U))}function M(){typeof window<"u"&&(T!=null&&window.cancelAnimationFrame(T),T=window.requestAnimationFrame(()=>{(function(){var S,E;T=null;const R=v.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(de){const ne=window.getComputedStyle(de),X=N(ne.getPropertyValue("--markstream-pre-diff-line-height"));if(X>0)return X;const he=N(ne.lineHeight);return he>0?he:18})(R),F=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),U=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),G=Math.max(F.length,U.length),Y=[];for(let de=0;de<G;de++){const ne=b((S=F[de])!=null?S:null,D),X=b((E=U[de])!=null?E:null,D),he=Math.max(D,ne,X);Y.push({rowHeight:he,originalHeight:ne,modifiedHeight:X})}var q,ae;q=y.value,ae=Y,q.length===ae.length&&q.every((de,ne)=>{const X=ae[ne];return X&&Math.abs(de.rowHeight-X.rowHeight)<=.5&&Math.abs(de.originalHeight-X.originalHeight)<=.5&&Math.abs(de.modifiedHeight-X.modifiedHeight)<=.5})||(y.value=Y)})()}))}function I(S){P?.disconnect(),P=null,S&&l.value&&typeof ResizeObserver<"u"&&(P=new ResizeObserver(()=>{M()}),P.observe(S))}function L(S,E){const R=y.value[S];if(!R)return;const D=E==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ve(v,S=>{I(S),gt(()=>M())},{flush:"post"}),Ve([l,k],()=>{I(v.value),gt(()=>M())},{flush:"post",immediate:!0}),ds(()=>{T!=null&&(window.cancelAnimationFrame(T),T=null),P?.disconnect(),P=null}),(S,E)=>(w(),$("pre",{ref_key:"preRef",ref:v,style:Xt(c.value),class:Re([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?(w(),$("code",lV,[(w(!0),$(Pe,null,tt(k.value,R=>(w(),$("span",{key:R.key,class:Re(["markstream-pre__diff-pane",R.className])},[(w(!0),$(Pe,null,tt(R.lines,(D,F)=>(w(),$("span",{key:D.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Xt(L(F,R.key))},[E[0]||(E[0]=x("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),x("span",aV,O(D.number),1),x("span",cV,[x("span",uV,O(D.code),1)])],6))),128))],2))),128))])):(w(),$(Pe,{key:1},[t.showLineNumbers?(w(),$("span",dV,[(w(!0),$(Pe,null,tt(r.value,R=>(w(),$("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):re("",!0),x("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,fV)],64))],14,rV))}});Eo.install=e=>{e.component(Eo.__name,Eo)};const Wg=ea(!1);let u2=null;const pV={key:0},Jn=gn(qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(u2||(u2=ay().then(k=>{Wg.value=!!k}).catch(()=>{Wg.value=!1})),Yf(Wg)),s=ld(),o=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=B(()=>{const k=s.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=B(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=B(()=>{var k;const g=(k=s["index-key"])!=null?k:s.indexKey;return g==null||g===""?"":String(g)}),u=J(t.node.content),d=J("");let f=r?.value;const h=J(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const T=String(k??""),P=c.value,N=y!==f;f=y;const b=VM({nextContent:T,persistedContent:P?i?.get(P):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:N});u.value=b.settledContent,d.value=b.streamedDelta,b.appended&&(h.value+=1),P&&i?.set(P,T)},{immediate:!0}),Ve(a,k=>{var g;k||(g=p(),u.value=g,d.value="")});const _=B(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(w(),$("span",{class:Re([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),$("span",pV,O(u.value),1)):re("",!0),d.value?(w(),$("span",{key:1,class:Re(["text-node-stream-delta",[_.value]]),onAnimationend:m},O(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Jn.install=e=>{e.component(Jn.__name,Jn)};const a3=qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return mn(Eo,Ot(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"}))}}}),zg=hi({loader:()=>Un(null,null,function*(){try{return(yield eo(()=>import("./CodeBlockNode-C3v9L5tu.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),Eo}}),loadingComponent:a3,delay:0,suspensible:!1}),ki=hi(()=>Un(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 mn(Jn,Ot(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 ay())return(yield eo(()=>import("./index6-UocCE6Lj.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 mn(Jn,Ot(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:""}$`}}))}})),c3=hi(()=>Un(null,null,function*(){try{if(yield ay())return(yield eo(()=>import("./index5-Dvc9jUB7.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 mn(Jn,Ot(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:""}$$`}}))}})),so=gn(qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),$("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"]]);so.install=e=>{e.component(so.__name,so)};const hV={class:"superscript-node"},bo=gn(qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,strong:oo,emphasis:lo,footnote_reference:Ro,strikethrough:io,highlight:Bo,insert:wo,subscript:_o,emoji:ko,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("sup",hV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);bo.install=e=>{e.component(bo.__name,bo)};const mV={class:"subscript-node"},_o=gn(qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,strong:oo,emphasis:lo,footnote_reference:Ro,strikethrough:io,highlight:Bo,insert:wo,superscript:bo,emoji:ko,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("sub",mV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);_o.install=e=>{e.component(_o.__name,_o)};const gV={class:"strong-node"},oo=gn(qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,emphasis:lo,strikethrough:io,highlight:Bo,insert:wo,subscript:_o,superscript:bo,emoji:ko,footnote_reference:Ro,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("strong",gV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);oo.install=e=>{e.component(oo.__name,oo)};const vV={class:"strikethrough-node"},io=gn(qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,strong:oo,emphasis:lo,highlight:Bo,insert:wo,subscript:_o,superscript:bo,emoji:ko,footnote_reference:Ro,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("del",vV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);io.install=e=>{e.component(io.__name,io)};const yV=["href","title","aria-label","aria-hidden","target","rel"],kV=["aria-hidden"],bV={class:"link-text-wrapper relative inline-flex"},_V={class:"leading-[normal] link-text"},ro=gn(qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),s=B(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=B(()=>{var k,g,v,y,T;const P=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(k=t.animationOpacity)!=null?k:.35,b=Math.max(.12,Math.min(.5*N,N)),M={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":P,"--underline-opacity":String(N),"--underline-rest-opacity":String(b),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=ps(()=>t.customId),r=B(()=>rt({text:Jn,strong:oo,strikethrough:io,emphasis:lo,image:Gr,html_inline:Do,inline_code:qs},i.value)),l=ld(),a=B(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const T of v)Array.isArray(T)&&T[0]&&(y[String(T[0])]=String((g=T[1])!=null?g:""));else for(const[T,P]of Object.entries(v))T&&P!=null&&P!==!1&&(y[T]=P===!0?"":String(P));return s2(y,"safe","a")}),c=B(()=>rt(rt({},l),a.value)),u=B(()=>{var k,g;return s2({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(dH(u.value)?"_blank":void 0)}),f=B(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=B(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=B(()=>{const k=rt({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&Qq()}const _=B(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,y;return e.node.loading?(w(),$("span",vn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[x("span",bV,[x("span",_V,[ie(C(Jn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=x("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,kV)):(w(),$("a",vn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=T=>(function(P){var N,b,M,I;if(!s.value)return;const L=P,S=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,E=((N=t.node)==null?void 0:N.title)||((b=u.value)!=null&&b.includes("xn--")&&((I=(M=t.node)==null?void 0:M.text)!=null&&I.includes("://"))?t.node.text:u.value)||"";Yq(P.currentTarget,E,"top",!1,S)})(T)),onMouseleave:m}),[(w(!0),$(Pe,null,tt(e.node.children,(T,P)=>(w(),ye(C(Li),{key:`${e.indexKey||"emphasis"}-${P}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${P}`},null,8,["components","node","custom-id","index-key"]))),128))],16,yV))}}}),[["__scopeId","data-v-367e6ca4"]]);ro.install=e=>{e.component(ro.__name,ro)};const wV={class:"insert-node"},wo=gn(qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,strong:oo,emphasis:lo,strikethrough:io,highlight:Bo,subscript:_o,superscript:bo,emoji:ko,footnote_reference:Ro,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("ins",wV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);wo.install=e=>{e.component(wo.__name,wo)};const SV={class:"highlight-node"},Bo=gn(qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,strong:oo,emphasis:lo,strikethrough:io,insert:wo,subscript:_o,superscript:bo,emoji:ko,footnote_reference:Ro,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("mark",SV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);Bo.install=e=>{e.component(Bo.__name,Bo)};const CV={class:"emphasis-node"},lo=gn(qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>rt({text:Jn,inline_code:qs,link:ro,html_inline:Do,strong:oo,strikethrough:io,highlight:Bo,insert:wo,subscript:_o,superscript:bo,emoji:ko,footnote_reference:Ro,math_inline:ki,reference:so},n.value));return(o,i)=>(w(),$("em",CV,[(w(!0),$(Pe,null,tt(e.node.children,(r,l)=>(w(),ye(C(Li),{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"]]);lo.install=e=>{e.component(lo.__name,lo)};const xV={class:"hard-break"},Yr=gn(qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),$("br",xV))}),[["__scopeId","data-v-50c58f70"]]);Yr.install=e=>{e.component(Yr.__name,Yr)};const ed=qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wr({checkbox:Po,checkbox_input:Po,emoji:ko,emphasis:lo,hardbreak:Yr,highlight:Bo,inline_code:qs,insert:wo,link:ro,reference:so,strikethrough:io,strong:oo,subscript:_o,superscript:bo,text:Jn}),s=ps(()=>t.customId),o=B(()=>{const i=s.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(w(!0),$(Pe,null,tt(e.nodes,(l,a)=>(w(),ye(C(Li),{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 E1(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(E1)}function Bp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(E1))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(E1)?o:null}function mc(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 AV=["cite"],TV={key:0,dir:"auto",class:"paragraph-node"},MV=["custom-id"],Bf=gn(qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ps(()=>t.customId),s=B(()=>!!n.value.paragraph),o=B(()=>!!n.value.text),i=B(()=>Bp(t.node.children,!s.value)),r=B(()=>t.fade!==!1||o.value?null:mc(i.value));return $n("markstreamShowTooltips",B(()=>t.showTooltips)),$n("markstreamFade",B(()=>t.fade)),(l,a)=>(w(),$("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),$("p",TV,[r.value!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,MV)):(w(),ye(C(ed),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ye(C(So),{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,AV))}}),[["__scopeId","data-v-abfecebc"]]);Bf.install=e=>{e.component(Bf.__name,Bf)};const EV={class:"definition-list"},IV={class:"definition-term"},$V={class:"definition-desc"},Ff=gn(qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),$("dl",EV,[(w(!0),$(Pe,null,tt(t.node.items,(o,i)=>(w(),$(Pe,{key:i},[x("dt",IV,[ie(C(So),{"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"])]),x("dd",$V,[ie(C(So),{"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"]]);Ff.install=e=>{e.component(Ff.__name,Ff)};const NV=["href","title"],Au=gn(qe({__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)=>(w(),$("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,NV))}}),[["__scopeId","data-v-e1eb37b6"]]);Au.install=e=>{e.component(Au.__name,Au)};const LV=["id"],OV={class:"flex-1"},Hf=qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),$("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[x("div",OV,[ie(C(So),{"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,LV))}});Hf.install=e=>{e.component(Hf.__name,Hf)};const PV=["custom-id"],I1=gn(qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ps(()=>t.customId),s=Ut("markstreamFade",void 0),o=B(()=>s?.value!==!1||n.value.text?null:mc(t.node.children)),i=B(()=>rt({text:Jn,inline_code:qs,link:ro,image:Gr,strong:oo,emphasis:lo,strikethrough:io,highlight:Bo,insert:wo,subscript:_o,superscript:bo,emoji:ko,checkbox:Po,checkbox_input:Po,footnote_reference:Ro,hardbreak:Yr,math_inline:ki,reference:so},n.value));return(r,l)=>(w(),ye(zs(`h${e.node.level}`),vn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:_e(()=>[o.value!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,PV)):(w(!0),$(Pe,{key:1},tt(e.node.children,(a,c)=>(w(),ye(C(Li),{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"]]),Fp=I1;Fp.install=e=>{e.component(I1.__name,I1)};const RV={key:0,dir:"auto",class:"paragraph-node"},DV=["custom-id"],BV={dir:"auto",class:"paragraph-node"},FV=["custom-id"],rc=gn(qe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var h;return(h=t.node)!=null?h:t.item}),s=ps(()=>t.customId),o=B(()=>!!s.value.paragraph),i=B(()=>!!s.value.text),r=B(()=>{var h;return Bp((h=n.value)==null?void 0:h.children,!o.value)}),l=B(()=>{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 _=p.slice(1);if(!_.every(g=>g?.type==="list"))return null;const k=Bp([m]);return k?{paragraphChildren:k,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?mc(r.value):null),u=B(()=>{var h;return a()?mc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return $n("markstreamShowTooltips",B(()=>t.showTooltips)),$n("markstreamFade",B(()=>t.fade)),(h,p)=>{var m,_;return w(),$("li",vn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),$("p",RV,[c.value!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,DV)):(w(),ye(C(ed),{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?(w(),$(Pe,{key:1},[x("p",BV,[u.value!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,FV)):(w(),ye(C(ed),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),$(Pe,null,tt(l.value.nestedLists,(k,g)=>(w(),ye(C(So),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ye(C(So),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);rc.install=e=>{e.component(rc.__name,rc)};const lc=gn(qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ps(()=>e.customId),n=B(()=>t.value.list_item||rc);return(s,o)=>(w(),ye(zs(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:_e(()=>[(w(!0),$(Pe,null,tt(e.node.items,(i,r)=>{var l;return w(),ye(zs(n.value),vn({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"]]);lc.install=e=>{e.component(lc.__name,lc)};const u3=Symbol("ViewportPriority");function HV(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?J(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 v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()}}function _(){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&&_())},{timeout:1200}))}Ve(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const k=(g,v)=>{const y=J(!1);let T,P=!1;const N=new Promise(I=>{T=()=>{P||(P=!0,I())}}),b=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return y.value=!0,T(),{isVisible:y,whenVisible:N,destroy:b};const M=(function(I,L){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,F){var U,G,Y;return{root:(U=e?.(D??null))!=null?U:null,rootMargin:(G=F?.rootMargin)!=null?G:"300px",threshold:(Y=F?.threshold)!=null?Y:0}})(I,L);if(a&&(R=S,(E=c)&&E.root===R.root&&E.rootMargin===R.rootMargin&&E.threshold===R.threshold))return a;var E,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const F of D)(F.isIntersecting||F.intersectionRatio>0)&&m(F.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return M?(u.set(g,{resolve:T,visible:y}),M.observe(g),d.add(g),_(),{isVisible:y,whenVisible:N,destroy:b}):(y.value=!0,T(),{isVisible:y,whenVisible:N,destroy:b})};return $n(u3,k),k}function WV(){var e,t;const n=Ut(u3,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=J(!1);let p,m=!1;const _=new Promise(v=>{p=()=>{m||(m=!0,v())}}),k=()=>{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(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.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:_,destroy:k}):(h.value=!0,p(),{isVisible:h,whenVisible:_,destroy:k})}}const zV={key:2,class:"html-block-node__raw"},UV=["innerHTML"],jV={key:1,class:"html-block-node__placeholder"},Tu=gn(qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),o=B(()=>{var P,N;return(N=(P=t.htmlPolicy)!=null?P:n?.value)!=null?N:"safe"}),i=B(()=>{var P,N;const b=(P=s?.value)!=null?P:{};return Ot(rt({},b),{customId:(N=t.customId)!=null?N:b.customId,htmlPolicy:o.value})}),r=hi({loader:()=>Promise.resolve().then(()=>ky),suspensible:!1}),l=B(()=>{const P=h1(t.node.attrs,o.value);if(!P)return;const N=Op(P);return Object.keys(N).length>0?N:void 0}),a=B(()=>{const P=String(t.node.tag||"").trim(),N=h1(t.node.attrs,o.value,P);if(!N)return;const b=Op(N);return Object.keys(b).length>0?b:void 0}),c=ps(()=>t.customId),u=qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=J(null),f=J(typeof window>"u"),h=J(t.node.content),p=B(()=>Array.isArray(t.node.children)?t.node.children:[]),m=B(()=>String(t.node.tag||"div")),_=B(()=>{const P=m.value.trim().toLowerCase();return YT.has(P)||ny(P,o.value)}),k=B(()=>p.value.length>0&&!!t.node.tag&&!_.value),g=B(()=>{var P,N,b;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(P=h.value)!=null?P:""};const M=(N=h.value)!=null?N:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:ic(M,o.value)};if(t.node.loading){const L=Dp(M,c.value,o.value);return L===null?{mode:"text",content:(b=t.node.raw)!=null?b:M}:{mode:"dynamic",nodes:L}}if(!r3(M,c.value))return{mode:"html",content:ic(M,o.value)};const I=Dp(M,c.value,o.value);return I===null?{mode:"html",content:ic(M,o.value)}:{mode:"dynamic",nodes:I}}),v=WV(),y=J(null),T=!!t.node.loading;return typeof window<"u"?(Ve(d,P=>{var N,b;if((b=(N=y.value)==null?void 0:N.destroy)==null||b.call(N),y.value=null,!T)return f.value=!0,void(h.value=t.node.content);if(!P)return void(f.value=!1);const M=v(P,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ve(()=>t.node.content,P=>{T&&!f.value||(h.value=P)})):f.value=!0,ds(()=>{var P,N;(N=(P=y.value)==null?void 0:P.destroy)==null||N.call(P),y.value=null}),(P,N)=>(w(),ye(zs(k.value?m.value:"div"),vn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:_e(()=>[f.value?(w(),$(Pe,{key:0},[g.value.mode==="structured"?(w(),ye(C(r),vn({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"?(w(),ye(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),$("pre",zV,O(g.value.content),1)):(w(),$("div",vn({key:3},l.value,{innerHTML:g.value.content}),null,16,UV))],64)):(w(),$("div",jV,[Ln(P.$slots,"placeholder",{node:e.node},()=>[N[0]||(N[0]=x("span",{class:"html-block-node__placeholder-bar"},null,-1)),N[1]||(N[1]=x("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),N[2]||(N[2]=x("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Tu.install=e=>{e.component(Tu.__name,Tu)};const qV={dir:"auto",class:"paragraph-node"},VV=["custom-id"],ql=gn(qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ps(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=B(()=>{var b;return(b=s?.value)!=null?b:"safe"}),c=B(()=>{var b;return(b=t.parseOptions)!=null?b:i?.value}),u=B(()=>{var b;return(b=t.customMarkdownIt)!=null?b:r?.value}),d=B(()=>{var b,M;return(M=t.customHtmlTags)!=null?M:(b=l?.value)==null?void 0:b.customHtmlTags}),f=B(()=>{var b,M;const I=(b=l?.value)!=null?b:{};return Ot(rt({},I),{customId:(M=t.customId)!=null?M:I.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=hi({loader:()=>Promise.resolve().then(()=>ky),suspensible:!1});function p(b){var M;return b.type==="text"&&String((M=b.content)!=null?M:"").trim()===""}const m=B(()=>t.node.children.filter(b=>!p(b))),_=B(()=>m.value.length>0&&m.value.every(b=>b.type==="image"||(function(M){var I;const L=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(E=>!p(E)):[]})(M);return L.length===1&&((I=L[0])==null?void 0:I.type)==="image"})(b))),k=B(()=>new Set(wc(d.value))),g=B(()=>{if(!_.value||m.value.length<=1)return t.node.children;const b=[];for(let M=0;M<t.node.children.length;M++){const I=t.node.children[M];if(!p(I)){b.push(I);continue}const L=b.length>0,S=t.node.children.slice(M+1).some(E=>!p(E));L&&S&&b.push(Ot(rt({},I),{content:" ",raw:" "}))}return b}),v=B(()=>o?.value===!1&&!n.value.text),y=B(()=>v.value?mc(g.value):null);function T(b,M){return{node:b,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const P=B(()=>rt({inline_code:qs,image:Gr,link:ro,hardbreak:Yr,emphasis:lo,strong:oo,strikethrough:io,highlight:Bo,insert:wo,subscript:_o,superscript:bo,html_inline:Do,html_block:Tu,emoji:ko,checkbox:Po,math_inline:ki,checkbox_input:Po,reference:so,footnote_anchor:Au,footnote_reference:Ro,text:Jn},n.value)),N=B(()=>g.value.map((b,M)=>{var I;const L=(function(S){var E,R,D,F;if(S.type==="html_block"||S.type==="html_inline"){const U=String((E=S.tag)!=null?E:"").trim().toLowerCase()||JT(S.content);if(U&&!k.value.has(U)&&eM((R=S.content)!=null?R:S.raw,U)){const G=String((F=(D=S.content)!=null?D:S.raw)!=null?F:"");return{child:{type:"text",content:G,raw:G},component:Jn,isCustomComponent:!1}}}return{child:S,component:P.value[S.type],isCustomComponent:!!(n.value[S.type]&&!md(String(S.type)))}})(b);return Ot(rt({},L),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:L.isCustomComponent?fy(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String((I=L.child.content)!=null?I:""),originalChild:b})}));return(b,M)=>(w(),$("p",qV,[y.value!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,VV)):(w(!0),$(Pe,{key:1},tt(N.value,I=>{return w(),$(Pe,{key:I.key},[_.value&&p(I.originalChild)?(w(),$(Pe,{key:0},[Ue(O((L=I.originalChild,String((S=L.content)!=null?S:""))),1)],64)):I.isCustomComponent?(w(),ye(zs(I.component),vn({key:1,ref_for:!0},I.customAttrs,{node:I.child,loading:I.child.loading,"index-key":I.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:_e(()=>[I.hasSlotChildren?(w(),ye(C(h),vn({key:0,ref_for:!0},f.value,{nodes:I.child.children,"index-key":I.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):I.slotContent?(w(),ye(C(h),vn({key:1,ref_for:!0},f.value,{content:I.slotContent,final:!I.child.loading,"index-key":`${I.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ye(zs(I.component),vn({key:2,ref_for:!0},T(I.child,I.index)),null,16))],64);var L,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ql.install=e=>{e.component(ql.__name,ql)};const KV={class:"table-node-wrapper"},GV=["aria-busy"],YV={key:0},QV=["custom-id"],XV=["aria-label","onPointerdown"],ZV=["custom-id"],JV={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Mu=gn(qe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var k;return(k=t.node.loading)!=null&&k}),s=B(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=J(null),i=J([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=B(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);$n("markstreamShowTooltips",B(()=>t.showTooltips)),$n("markstreamFade",B(()=>t.fade));const u=ps(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),h=new WeakMap;function p(k){const g=t.fade===!1&&!d.value,v=!f.value,y=h.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const T=Bp(k.children,v,!0),P={simpleChildren:T,plainText:T&&g?mc(T):null};return h.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:P}),P}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),T=[...r.widths];T[r.index]=y,T[r.index+1]=g-y,i.value=T}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ve(l,()=>{_(),i.value=[]}),ds(_),(k,g)=>(w(),$("div",KV,[x("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),$("colgroup",YV,[(w(!0),$(Pe,null,tt(e.node.header.cells,(v,y)=>(w(),$("col",{key:y,style:Xt(c.value[y])},null,4))),128))])):re("",!0),x("thead",null,[x("tr",null,[(w(!0),$(Pe,null,tt(e.node.header.cells,(v,y)=>(w(),$("th",{key:y,dir:"auto",class:Re([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(p(v).plainText),9,QV)):p(v).simpleChildren?(w(),ye(C(ed),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ye(C(So),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=T=>k.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(w(),$("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:T=>(function(P,N){if(N.button!==0)return;const b=(function(){var L;const S=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(S??[],E=>Math.round(E.getBoundingClientRect().width))})(),M=b[P],I=b[P+1];M&&I&&(N.preventDefault(),r={index:P,startX:N.clientX,startWidth:M,nextStartWidth:I,widths:b},i.value=b,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,T)},null,40,XV)):re("",!0)],2))),128))])]),x("tbody",null,[(w(!0),$(Pe,null,tt(s.value,(v,y)=>(w(),$("tr",{key:y},[(w(!0),$(Pe,null,tt(v.cells,(T,P)=>(w(),$("td",{key:P,class:Re([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(T).plainText!==null?(w(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(p(T).plainText),9,ZV)):p(T).simpleChildren?(w(),ye(C(ed),{key:1,nodes:p(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${P}`},null,8,["nodes","custom-id","index-key"])):(w(),ye(C(So),{key:2,nodes:T.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]=N=>k.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,GV),ie(Zr,{name:"table-node-fade"},{default:_e(()=>[n.value?(w(),$("div",JV,[Ln(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=x("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=x("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Mu.install=e=>{e.component(Mu.__name,Mu)};const eK={class:"hr-node"},Wf=gn({},[["render",function(e,t){return w(),$("hr",eK)}],["__scopeId","data-v-39b2349c"]]);Wf.install=e=>{e.component(Wf.__name,Wf)};const tK={class:"unknown-node"},$1=qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),$("div",tK,O(e.node.raw),1))}),zf=gn(qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),s=ps(()=>t.customId),o=B(()=>rt({text:Jn,paragraph:ql,heading:Fp,inline_code:qs,link:ro,image:Gr,strong:oo,emphasis:lo,strikethrough:io,insert:wo,subscript:_o,superscript:bo,checkbox:Po,checkbox_input:Po,hardbreak:Yr,math_inline:ki,reference:so,list:lc,math_block:c3,table:Mu},s.value));return(i,r)=>(w(),$("div",vn({class:n.value},e.node.attrs),[(w(!0),$(Pe,null,tt(e.node.children,(l,a)=>{return w(),ye(zs((c=l.type,o.value[c]||$1)),{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"]]);zf.install=e=>{e.component(zf.__name,zf)};const nK=["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"],d2=[[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 sK(e){if(e<=255)return nK[e];let t=0,n=d2.length-1;for(;t<=n;){const s=t+n>>1,o=d2[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const oK=/[ \t\n\r\f]+/g,iK=/[\t\n\r\f]| {2,}|^ | $/;let Ug=null;const rK=new RegExp("\\p{Script=Arabic}","u"),Dh=new RegExp("\\p{M}","u"),d3=new RegExp("\\p{Nd}","u");function f2(e){return rK.test(e)}function p2(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 ir(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(p2(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(p2(n))return!0}}return!1}const lK=new Set([" "," ","","\uFEFF"]);function aK(e){return ir(e)}function N1(e){return!(function(t){const n=Hp(t);return n!==null&&(py.has(n)||Yl.has(n))})(e)&&!(function(t){const n=Hp(t);return n!==null&&lK.has(n)})(e)}const py=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Bh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),hy=new Set(["'","’"]),Yl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),cK=new Set([":",".","،","؛"]),uK=new Set(["၏"]),dK=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function fK(e){if(my(e))return!0;let t=!1;for(const n of e)if(Yl.has(n))t=!0;else if(!t||!Dh.test(n))return!1;return t}function pK(e){for(const t of e)if(!py.has(t)&&!Yl.has(t))return!1;return e.length>0}function hK(e){if(my(e))return!0;for(const t of e)if(!Bh.has(t)&&!hy.has(t)&&!Dh.test(t))return!1;return e.length>0}function my(e){let t=!1;for(const n of e)if(n!=="\\"&&!Dh.test(n)){if(!(Bh.has(n)||Yl.has(n)||hy.has(n)))return!1;t=!0}return t}function f3(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 Hp(e){if(e.length===0)return null;const t=f3(e,e.length);return e.slice(t)}function mK(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Dh.test(s))n--;else{if(!Bh.has(s)&&!hy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function gK(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function h2(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 m2(e,t){return e&&t!==null&&cK.has(t)}function vK(e){const t=Hp(e);return t!==null&&uK.has(t)}function yK(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 L1(e){let t=e.length;for(;t>0;){const n=f3(e,t),s=e.slice(n,t);if(dK.has(s))return!0;if(!Yl.has(s))return!1;t=n}return!1}function kK(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
243
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const bK=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Qo(e){return e.length===1?e[0]:e.join("")}function _K(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Qo(n)}function wK(e,t,n,s){if(!bK.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=kK(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:Qo(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:Qo(r),isWordLike:a,kind:i,start:l}),o}function jg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const SK=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function CK(e,t){const n=e.texts[t];return!!n.startsWith("www.")||SK.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function xK(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const AK=new Set([":","-","/","×",",",".","+","–","—"]),g2=/^[A-Za-z0-9_]+[,:;]*$/,v2=/[,:;]+$/;function y2(e){for(const t of e)if(d3.test(t))return!0;return!1}function Uf(e){if(e.length===0)return!1;for(const t of e)if(!d3.test(t)&&!AK.has(t))return!1;return!0}function k2(e,t,n){var s,o,i;const r=(Ug===null&&(Ug=new Intl.Segmenter(void 0,{granularity:"word"})),Ug);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],_=[],k=[],g=[],v=[];for(const b of r.segment(e))for(const M of wK(b.segment,(s=b.isWordLike)!=null&&s,b.index,n)){let I=function(){h[G]!==null&&(c[G]=[h2(a,h,p,G)],h[G]=null),c[G].push(M.text),u[G]=u[G]||M.isWordLike,m[G]=m[G]||E,_[G]=_[G]||R,k[G]=F,g[G]=U,v[G]=m2(_[G],D)};const L=M.kind==="text",S=gK(M.text,M.isWordLike,M.kind),E=ir(M.text),R=f2(M.text),D=Hp(M.text),F=L1(M.text),U=vK(M.text),G=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[G]==="text"&&E&&m[G]&&k[G]||L&&l>0&&d[G]==="text"&&pK(M.text)&&m[G]||L&&l>0&&d[G]==="text"&&g[G]?I():L&&l>0&&d[G]==="text"&&M.isWordLike&&R&&v[G]?(I(),u[G]=!0):S!==null&&l>0&&d[G]==="text"&&h[G]===S?p[G]=((o=p[G])!=null?o:1)+1:L&&!M.isWordLike&&l>0&&d[G]==="text"&&(fK(M.text)||M.text==="-"&&u[G])?I():(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]=E,_[l]=R,k[l]=F,g[l]=U,v[l]=m2(R,D),l++)}for(let b=0;b<l;b++)h[b]===null?a[b]=Qo(c[b]):a[b]=h2(a,h,p,b);for(let b=1;b<l;b++)d[b]==="text"&&!u[b]&&my(a[b])&&d[b-1]==="text"&&(a[b-1]+=a[b],u[b-1]=u[b-1]||u[b],a[b]="");const y=Array.from({length:l},()=>null);let T=-1;for(let b=l-1;b>=0;b--){const M=a[b];if(M.length!==0){if(d[b]==="text"&&!u[b]&&hK(M)&&T>=0&&d[T]==="text"){const I=(i=y[T])!=null?i:[];I.push(M),y[T]=I,f[T]=f[b],a[b]="";continue}T=b}}for(let b=0;b<l;b++){const M=y[b];M!=null&&(a[b]=_K(M,a[b]))}let P=0;for(let b=0;b<l;b++){const M=a[b];M.length!==0&&(P!==b&&(a[P]=M,u[P]=u[b],d[P]=d[b],f[P]=f[b]),P++)}a.length=P,u.length=P,d.length=P,f.length=P;const N=(function(b){const M=b.texts.slice(),I=b.isWordLike.slice(),L=b.kinds.slice(),S=b.starts.slice();for(let E=0;E<M.length-1;E++){if(L[E]!=="text"||L[E+1]!=="text"||!ir(M[E])||!ir(M[E+1]))continue;const R=mK(M[E]);R!==null&&(M[E]=R.head,M[E+1]=R.tail+M[E+1],S[E+1]=S[E]+R.head.length)}return{len:M.length,texts:M,isWordLike:I,kinds:L,starts:S}})((function(b){const M=[],I=[],L=[],S=[];for(let E=0;E<b.len;E++){const R=b.texts[E],D=b.kinds[E],F=b.isWordLike[E];if(D==="text"&&F&&g2.test(R)){const U=[R];let G=v2.test(R),Y=E+1;for(;G&&Y<b.len&&b.kinds[Y]==="text"&&b.isWordLike[Y]&&g2.test(b.texts[Y]);){const q=b.texts[Y];U.push(q),G=v2.test(q),Y++}M.push(Qo(U)),I.push(!0),L.push("text"),S.push(b.starts[E]),E=Y-1;continue}M.push(R),I.push(F),L.push(D),S.push(b.starts[E])}return{len:M.length,texts:M,isWordLike:I,kinds:L,starts:S}})((function(b){const M=[],I=[],L=[],S=[];for(let E=0;E<b.len;E++){const R=b.texts[E];if(b.kinds[E]==="text"&&R.includes("-")){const D=R.split("-");let F=D.length>1;for(let U=0;U<D.length;U++){const G=D[U];if(!F)break;G.length!==0&&y2(G)&&Uf(G)||(F=!1)}if(F){let U=0;for(let G=0;G<D.length;G++){const Y=D[G],q=G<D.length-1?`${Y}-`:Y;M.push(q),I.push(!0),L.push("text"),S.push(b.starts[E]+U),U+=q.length}continue}}M.push(R),I.push(b.isWordLike[E]),L.push(b.kinds[E]),S.push(b.starts[E])}return{len:M.length,texts:M,isWordLike:I,kinds:L,starts:S}})((function(b){const M=[],I=[],L=[],S=[];for(let E=0;E<b.len;E++){const R=b.texts[E],D=b.kinds[E];if(D==="text"&&Uf(R)&&y2(R)){const F=[R];let U=E+1;for(;U<b.len&&b.kinds[U]==="text"&&Uf(b.texts[U]);)F.push(b.texts[U]),U++;M.push(Qo(F)),I.push(!0),L.push("text"),S.push(b.starts[E]),E=U-1;continue}M.push(R),I.push(b.isWordLike[E]),L.push(D),S.push(b.starts[E])}return{len:M.length,texts:M,isWordLike:I,kinds:L,starts:S}})((function(b){const M=[],I=[],L=[],S=[];for(let E=0;E<b.len;E++){const R=b.texts[E];if(M.push(R),I.push(b.isWordLike[E]),L.push(b.kinds[E]),S.push(b.starts[E]),!xK(R))continue;const D=E+1;if(D>=b.len||jg(b.kinds[D]))continue;const F=[],U=b.starts[D];let G=D;for(;G<b.len&&!jg(b.kinds[G]);)F.push(b.texts[G]),G++;F.length>0&&(M.push(Qo(F)),I.push(!0),L.push("text"),S.push(U),E=G-1)}return{len:M.length,texts:M,isWordLike:I,kinds:L,starts:S}})((function(b){const M=b.texts.slice(),I=b.isWordLike.slice(),L=b.kinds.slice(),S=b.starts.slice();for(let R=0;R<b.len;R++){if(L[R]!=="text"||!CK(b,R))continue;const D=[M[R]];let F=R+1;for(;F<b.len&&!jg(L[F]);){D.push(M[F]),I[R]=!0;const U=M[F].includes("?");if(L[F]="text",M[F]="",F++,U)break}M[R]=Qo(D)}let E=0;for(let R=0;R<M.length;R++){const D=M[R];D.length!==0&&(E!==R&&(M[E]=D,I[E]=I[R],L[E]=L[R],S[E]=S[R]),E++)}return M.length=E,I.length=E,L.length=E,S.length=E,{len:E,texts:M,isWordLike:I,kinds:L,starts:S}})((function(b){const M=[],I=[],L=[],S=[];let E=0;for(;E<b.len;){const R=[b.texts[E]];let D=b.isWordLike[E],F=b.kinds[E],U=b.starts[E];if(F==="glue"){const G=[R[0]],Y=U;for(E++;E<b.len&&b.kinds[E]==="glue";)G.push(b.texts[E]),E++;const q=Qo(G);if(!(E<b.len&&b.kinds[E]==="text")){M.push(q),I.push(!1),L.push("glue"),S.push(Y);continue}R[0]=q,R.push(b.texts[E]),D=b.isWordLike[E],F="text",U=Y,E++}else E++;if(F==="text")for(;E<b.len&&b.kinds[E]==="glue";){const G=[];for(;E<b.len&&b.kinds[E]==="glue";)G.push(b.texts[E]),E++;const Y=Qo(G);E<b.len&&b.kinds[E]==="text"?(R.push(Y,b.texts[E]),D=D||b.isWordLike[E],E++):R.push(Y)}M.push(Qo(R)),I.push(D),L.push(F),S.push(U)}return{len:M.length,texts:M,isWordLike:I,kinds:L,starts:S}})({len:P,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let b=0;b<N.len-1;b++){const M=yK(N.texts[b]);M!==null&&(N.kinds[b]!=="space"&&N.kinds[b]!=="preserved-space"||N.kinds[b+1]!=="text"||!f2(N.texts[b+1])||(N.texts[b]=M.space,N.isWordLike[b]=!1,N.kinds[b]=N.kinds[b]==="preserved-space"?"preserved-space":"space",N.texts[b+1]=M.marks+N.texts[b+1],N.starts[b+1]=N.starts[b]+M.space.length))}return N}function TK(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 Ta=null;const b2=new Map;let Ma=null;const MK=new RegExp("\\p{Emoji_Presentation}","u"),EK=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let qg=null;const _2=new Map;function O1(){if(Ta!==null)return Ta;if(typeof OffscreenCanvas<"u")return Ta=new OffscreenCanvas(1,1).getContext("2d"),Ta;if(typeof document<"u")return Ta=document.createElement("canvas").getContext("2d"),Ta;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Ir(e,t){let n=t.get(e);return n===void 0&&(n={width:O1().measureText(e).width,containsCJK:ir(e)},t.set(e,n)),n}function Fh(){if(Ma!==null)return Ma;if(typeof navigator>"u")return Ma={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ma;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 Ma={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ma}function p3(){return qg===null&&(qg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),qg}function IK(e){return MK.test(e)||e.includes("️")}function Ml(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=p3();for(const a of l.segment(i))IK(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function $K(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 NK(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function w2(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Fh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,T=d,P=a){l++,a=0,c=!1,f=-1,h=0}function m(y,T){c=!0,u=y+1,d=0,a=T}function _(y,T,P){c=!0,u=y,d=T+1,a=P}function k(y,T){c?(a+=T,u=y+1,d=0):m(y,T)}function g(y,T){const P=i[y];for(let N=T;N<P.length;N++){const b=P[N];c?a+b>r?(p(),_(y,N,b)):(a+=b,u=y,d=N+1):_(y,N,b)}c&&u===y&&d===P.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=$K(e,v),!(v>=s.length)));){const y=s[v],T=o[v],P=T==="space"||T==="preserved-space"||T==="tab"||T==="zero-width-break"||T==="soft-hyphen";if(c)if(a+y>r){if(P){k(v,y),p(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(y>t&&i[v]!==null){p(),g(v,0),v++;continue}p()}else k(v,y),P&&(f=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),P&&(f=v+1,h=a-y),v++}return c&&p(),l}let Vg=null;function LK(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=L1(d),l=Bh.has(d)}function u(d,f){s.push(d),i=i||f;const h=L1(d);r=d.length===1&&Yl.has(d)&&r||h,l=!1}for(const d of(Vg===null&&(Vg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Vg).segment(e)){const f=d.segment,h=ir(f);s.length!==0?l||py.has(f)||Yl.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 OK(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=ir(e[0].text),i=N1(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=ir(a.text),u=N1(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 PK(e,t,n,s){const o=Fh(),{cache:i,emojiCorrection:r}=(function(N,b){O1().font=N;const M=(function(S){let E=b2.get(S);return E||(E=new Map,b2.set(S,E)),E})(N),I=(function(S){const E=S.match(/(\d+(?:\.\d+)?)\s*px/);return E?parseFloat(E[1]):16})(N),L=b?(function(S,E){let R=_2.get(S);if(R!==void 0)return R;const D=O1();D.font=S;const F=D.measureText("😀").width;if(R=0,F>E+.5&&typeof document<"u"&&document.body!==null){const U=document.createElement("span");U.style.font=S,U.style.display="inline-block",U.style.visibility="hidden",U.style.position="absolute",U.textContent="😀",document.body.appendChild(U);const G=U.getBoundingClientRect().width;document.body.removeChild(U),F-G>.5&&(R=F-G)}return _2.set(S,R),R})(N,I):0;return{cache:M,fontSize:I,emojiCorrection:L}})(t,(l=e.normalized,EK.test(l)));var l;const a=Ml("-",Ir("-",i),r),c=8*Ml(" ",Ir(" ",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,_=[],k=n?[]:null,g=Array.from({length:e.len});function v(N,b,M,I,L,S,E){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(p=!1),u.push(b),d.push(M),f.push(I),h.push(L),_.push(E),k!==null&&k.push(N)}function y(N,b,M,I,L){const S=Ir(N,i),E=Ml(N,S,r),R=b==="space"||b==="preserved-space"||b==="zero-width-break"?0:E,D=b==="space"||b==="zero-width-break"?0:E;if(L&&I&&N.length>1){let F="sum-graphemes";Uf(N)?F="pair-context":o.preferPrefixWidthsForBreakableRuns&&(F="segment-prefixes");const U=(function(G,Y,q,ae,de){if(Y.breakableFitAdvances!==void 0)return Y.breakableFitAdvances;const ne=p3(),X=[];for(const it of ne.segment(G))X.push(it.segment);if(X.length<=1)return Y.breakableFitAdvances=null,Y.breakableFitAdvances;if(de==="sum-graphemes"){const it=[];for(const ce of X){const z=Ir(ce,q);it.push(Ml(ce,z,ae))}return Y.breakableFitAdvances=it,Y.breakableFitAdvances}if(de==="pair-context"||X.length>96){const it=[];let ce=null,z=0;for(const Q of X){const oe=Ml(Q,Ir(Q,q),ae);if(ce===null)it.push(oe);else{const W=ce+Q,Z=Ir(W,q);it.push(Ml(W,Z,ae)-z)}ce=Q,z=oe}return Y.breakableFitAdvances=it,Y.breakableFitAdvances}const he=[];let Oe="",je=0;for(const it of X){Oe+=it;const ce=Ml(Oe,Ir(Oe,q),ae);he.push(ce-je),je=ce}return Y.breakableFitAdvances=he,Y.breakableFitAdvances})(N,S,i,r,F);return void v(N,E,R,D,b,M,U)}v(N,E,R,D,b,M,null)}for(let N=0;N<e.len;N++){g[N]=u.length;const b=e.texts[N],M=e.isWordLike[N],I=e.kinds[N],L=e.starts[N];if(I==="soft-hyphen"){v(b,0,a,a,I,L,null);continue}if(I==="hard-break"){v(b,0,0,0,I,L,null);continue}if(I==="tab"){v(b,0,0,0,I,L,null);continue}const S=Ir(b,i);if(I==="text"&&S.containsCJK){const E=LK(b,o),R=s==="keep-all"?OK(E):E;for(let D=0;D<R.length;D++){const F=R[D];y(F.text,"text",L+F.start,M,s==="keep-all"||!ir(F.text))}continue}y(b,I,L,M,!0)}const T=(function(N,b,M){const I=[];for(let L=0;L<N.length;L++){const S=N[L],E=S.startSegmentIndex<b.length?b[S.startSegmentIndex]:M,R=S.endSegmentIndex<b.length?b[S.endSegmentIndex]:M,D=S.consumedEndSegmentIndex<b.length?b[S.consumedEndSegmentIndex]:M;I.push({startSegmentIndex:E,endSegmentIndex:R,consumedEndSegmentIndex:D})}return I})(e.chunks,g,u.length),P=m===null?null:(function(N,b){const M=(function(L){const S=L.length;if(S===0)return null;const E=new Array(S);let R=!1;for(let q=0;q<S;){const ae=L.charCodeAt(q);let de=ae,ne=1;if(ae>=55296&&ae<=56319&&q+1<S){const he=L.charCodeAt(q+1);he>=56320&&he<=57343&&(de=he-56320+(ae-55296<<10)+65536,ne=2)}const X=sK(de);X!=="R"&&X!=="AL"&&X!=="AN"||(R=!0);for(let he=0;he<ne;he++)E[q+he]=X;q+=ne}if(!R)return null;let D=0;for(let q=0;q<S;q++){const ae=E[q];if(ae==="L"){D=0;break}if(ae==="R"||ae==="AL"){D=1;break}}const F=new Int8Array(S);for(let q=0;q<S;q++)F[q]=D;const U=1&D?"R":"L",G=U;let Y=G;for(let q=0;q<S;q++)E[q]==="NSM"?E[q]=Y:Y=E[q];Y=G;for(let q=0;q<S;q++){const ae=E[q];ae==="EN"?E[q]=Y==="AL"?"AN":"EN":ae!=="R"&&ae!=="L"&&ae!=="AL"||(Y=ae)}for(let q=0;q<S;q++)E[q]==="AL"&&(E[q]="R");for(let q=1;q<S-1;q++)E[q]==="ES"&&E[q-1]==="EN"&&E[q+1]==="EN"&&(E[q]="EN"),E[q]!=="CS"||E[q-1]!=="EN"&&E[q-1]!=="AN"||E[q+1]!==E[q-1]||(E[q]=E[q-1]);for(let q=0;q<S;q++){if(E[q]!=="EN")continue;let ae;for(ae=q-1;ae>=0&&E[ae]==="ET";ae--)E[ae]="EN";for(ae=q+1;ae<S&&E[ae]==="ET";ae++)E[ae]="EN"}for(let q=0;q<S;q++){const ae=E[q];ae!=="WS"&&ae!=="ES"&&ae!=="ET"&&ae!=="CS"||(E[q]="ON")}Y=G;for(let q=0;q<S;q++){const ae=E[q];ae==="EN"?E[q]=Y==="L"?"L":"EN":ae!=="R"&&ae!=="L"||(Y=ae)}for(let q=0;q<S;q++){if(E[q]!=="ON")continue;let ae=q+1;for(;ae<S&&E[ae]==="ON";)ae++;const de=(q>0?E[q-1]:G)!=="L"?"R":"L";if(de===((ae<S?E[ae]:G)!=="L"?"R":"L"))for(let ne=q;ne<ae;ne++)E[ne]=de;q=ae-1}for(let q=0;q<S;q++)E[q]==="ON"&&(E[q]=U);for(let q=0;q<S;q++){const ae=E[q];1&F[q]?ae!=="L"&&ae!=="AN"&&ae!=="EN"||F[q]++:ae==="R"?F[q]++:ae!=="AN"&&ae!=="EN"||(F[q]+=2)}return F})(N);if(M===null)return null;const I=new Int8Array(b.length);for(let L=0;L<b.length;L++)I[L]=M[b[L]];return I})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:P,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:T,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:P,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:T}}function RK(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return PK((function(c,u,d="normal",f="normal"){const h=(function(_){const k=_??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
|
|
244
|
-
`).replace(/[\r\f]/g,`
|
|
245
|
-
`):_.replace(/\r\n/g,`
|
|
246
|
-
`)})(c):(function(_){if(!iK.test(_))return _;let k=_.replace(oK," ");return k.charCodeAt(0)===32&&(k=k.slice(1)),k.length>0&&k.charCodeAt(k.length-1)===32&&(k=k.slice(0,-1)),k})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const k=[],g=[],v=[],y=[];let T=null,P=!1,N=0,b=!1,M=!1;function I(){T!==null&&(k.push(Qo(T)),g.push(P),v.push("text"),y.push(N),T=null)}for(let L=0;L<_.len;L++){const S=_.texts[L],E=_.kinds[L],R=_.isWordLike[L],D=_.starts[L];if(E==="text"){const F=aK(S),U=N1(S);if(T!==null&&b&&M){T.push(S),P=P||R,b=b||F,M=U;continue}I(),T=[S],P=R,N=D,b=F,M=U;continue}I(),k.push(S),g.push(R),v.push(E),y.push(D)}return I(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(k2(p,u,h)):k2(p,u,h);return rt({normalized:p,chunks:TK(m,h)},m)})(s,Fh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Kg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",ms=(()=>{const e=globalThis;if(e[Kg])return e[Kg];const t={configs:{},controllers:{},revision:ea(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Kg]=t,t})();let Jc=null;const S2=ms.revision;function C2(e){var t;return e&&(t=ms.configs[e])!=null?t:null}function x2(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function DK(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Gg(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!DK(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+=`
|
|
247
|
-
`)}return o.length>0?o:null}function Yg(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Jc!=null)return Jc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Jc=!!((i=r.getContext)!=null&&i.call(r,"2d")),Jc}catch{return Jc=!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=ms.blockEstimateCache.get(r);if(l)return ms.blockEstimateCache.delete(r),ms.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 _=`${m}\0${p}\0${h}`,k=ms.preparedCache.get(_);if(k)return ms.preparedCache.delete(_),ms.preparedCache.set(_,k),k.prepared;const g=RK(h,p,{whiteSpace:m});for(ms.preparedCache.set(_,{prepared:g});ms.preparedCache.size>240;){const v=ms.preparedCache.keys().next().value;if(!v)break;ms.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const _=(function(k,g){return k.simpleLineWalkFastPath?w2(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return w2(v,y);const{widths:T,lineEndFitAdvances:P,lineEndPaintAdvances:N,kinds:b,breakableFitAdvances:M,discretionaryHyphenWidth:I,tabStopAdvance:L,chunks:S}=v;if(T.length===0||S.length===0)return 0;const E=Fh(),R=E.lineFitEpsilon,D=y+R;let F=0,U=0,G=!1,Y=0,q=0,ae=-1,de=0,ne=0,X=null;function he(){ae=-1,de=0,ne=0,X=null}function Oe(Z=Y,ue=q,le=U){F++,U=0,G=!1,he()}function je(Z,ue){G=!0,Y=Z+1,q=0,U=ue}function it(Z,ue,le){G=!0,Y=Z,q=ue+1,U=le}function ce(Z,ue){G?(U+=ue,Y=Z+1,q=0):je(Z,ue)}function z(Z,ue,le,me){if(!ue)return;const j=Z==="tab"?0:P[le],ee=Z==="tab"?me:N[le];ae=le+1,de=U-me+j,ne=U-me+ee,X=Z}function Q(Z,ue){const le=M[Z];for(let me=ue;me<le.length;me++){const j=le[me];G?U+j>D?(Oe(),it(Z,me,j)):(U+=j,Y=Z,q=me+1):it(Z,me,j)}G&&Y===Z&&q===le.length&&(Y=Z+1,q=0)}function oe(Z){if(X!=="soft-hyphen")return!1;const ue=M[Z];if(ue==null)return!1;const{fitCount:le,fittedWidth:me}=(function(j,ee,pe,ke,Te){let Ie=0,fe=ee;for(;Ie<j.length;){const Me=fe+j[Ie];if((Ie+1<j.length?Me+Te:Me)>pe+ke)break;fe=Me,Ie++}return{fitCount:Ie,fittedWidth:fe}})(ue,U,y,R,I);return le!==0&&(U=me,Y=Z,q=le,he(),le===ue.length?(Y=Z+1,q=0,!0):(Oe(Z,le,me+I),Q(Z,le),!0))}function W(Z){F++,he()}for(let Z=0;Z<S.length;Z++){const ue=S[Z];if(ue.startSegmentIndex===ue.endSegmentIndex){W();continue}G=!1,U=0,ue.startSegmentIndex,Y=ue.startSegmentIndex,q=0,he();let le=ue.startSegmentIndex;for(;le<ue.endSegmentIndex;){const me=b[le],j=me==="space"||me==="preserved-space"||me==="tab"||me==="zero-width-break"||me==="soft-hyphen",ee=me==="tab"?NK(U,L):T[le];if(me!=="soft-hyphen")if(G){if(U+ee>D){const pe=U+(me==="tab"?0:P[le]),ke=U+(me==="tab"?ee:N[le]);if(X==="soft-hyphen"&&E.preferEarlySoftHyphenBreak&&de<=D){Oe(ae,0,ne);continue}if(X==="soft-hyphen"&&oe(le)){le++;continue}if(j&&pe<=D){ce(le,ee),Oe(le+1,0,ke),le++;continue}if(ae>=0&&de<=D){if(Y>ae||Y===ae&&q>0){Oe();continue}const Te=ae;Oe(Te,0,ne),le=Te;continue}if(ee>y&&M[le]!==null){Oe(),Q(le,0),le++;continue}Oe();continue}ce(le,ee),z(me,j,le,ee),le++}else ee>y&&M[le]!==null?Q(le,0):je(le,ee),z(me,j,le,ee),le++;else G&&(Y=le+1,q=0,ae=le+1,de=U+I,ne=U+I,X=me),le++}if(G){const me=ae===ue.consumedEndSegmentIndex?ne:U;Oe(ue.consumedEndSegmentIndex,0,me)}}return F})(k,g)})(h,p);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ms.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ms.blockEstimateCache.size>4e3;){const h=ms.blockEstimateCache.keys().next().value;if(!h)break;ms.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function h3(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Gg(e.children);return i&&n.paragraph?Yg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Gg(e.children),l=n.headings[i];return r&&l?Yg(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=Gg((o=i[0])==null?void 0:o.children);return r?Yg(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=h3(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 yf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function BK(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(yf(String((d=u.originalCode)!=null?d:"")),yf(String((f=u.updatedCode)!=null?f:"")),yf(String((h=u.code)!=null?h:""))):yf((function(p,m){const _=String(p??"");return m?_:_.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,_;if(!p)return 0;const k=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((_=h?.padding)==null?void 0:_.bottom)=="number"?h.padding.bottom:22;return Math.max(0,k)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else 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 FK(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Qg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=x2(s.lineHeight,1.5*x2(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:FK(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const HK=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function A2(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))HK.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const WK=!1;function Rge(){return WK}function T2(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 m3=Symbol("MarkstreamMathBlockMinHeightCache");function Dge(){return Ut(m3,null)}const zK=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],UK=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],jK=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),g3=["raw","content","code","originalCode","updatedCode"],M2=new WeakMap,E2=new WeakMap;let qK=1;function di(){return typeof performance<"u"?performance.now():Date.now()}function I2(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ei(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=M2.get(t);return n||(n=qK++,M2.set(t,n)),String(n)}function $2(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:ei(t),customMarkdownIt:ei(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ei(e.validateLink),preTransformTokens:ei(e.preTransformTokens),postTransformTokens:ei(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function N2(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
248
|
-
`,t-1)+1;return e.slice(n,t).trim()}function L2(e){const t=v3(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function v3(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function y3(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 gy(e){const t=String(e??"");return`${t.length}:${y3(t)}`}function P1(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?gy(r):`${r.length}:${y3(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ei(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:${ei(s)}`;const i=ei(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>P1(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}:${P1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Wp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function k3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Wp(s)?sl(s,t,n+1):k3(s,t,n+1)).join(",")}`:Wp(e)?sl(e,t,n):P1(e,t,n)}function VK(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!g3.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${gy(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${ei(o)}`:jK.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${k3(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${ei(o)}`:""}).filter(Boolean).join(";")}function KK(e){return g3.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${gy(n)}`:""}).filter(Boolean).join(";")}function sl(e,t=new WeakMap,n=0){const s=E2.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}:${ei(o)}`;const r=ei(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=>sl(p,c,u+1)).join("|"):"";return[a.type,KK(d),VK(d,c,u),f.length,h].join(":")})(e,t,n);return E2.set(o,l),l}function b3(e,t){return sl(e)===sl(t)}function vy(e,t,n){const s=di(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=di()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function O2(e,t,n){return vy(t,n,()=>sl(e))}function _3(e,t,n){return O2(e,n,"stabilizeSignatureMs")===O2(t,n,"stabilizeSignatureMs")}function Xg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function P2(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function GK(e,t){return e.length===t.length&&e===t}function yy(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"||!GK(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(!Wp(d)||!Wp(f))return null;const h=yy(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function YK(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=yy(e,t);return n??b3(e,t)}function QK(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return vy(n,"stabilizeSignatureMs",()=>{s=yy(e,t)}),s??_3(e,t,n)}function XK(e,t){const n={};for(const s of zK){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function ZK(e,t){var n;const s=FS(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=J(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=di();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),p=di()}Ve([t.renderContent,t.effectiveFinal,i],([M,I,L])=>{r.value!==M&&(!L||I||(function(S,E){if(!S&&E||E.length<=80||E.length<S.length||!E.startsWith(S))return!0;const R=E.slice(S.length);return!!R&&(!!L2(N2(E))||!(!R.includes(`
|
|
249
|
-
|
|
250
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
251
|
-
`)&&!(function(D){const F=N2(D);if(L2(F))return!1;const U=v3(F);return U.length>=2&&U.some(G=>G.trim())})(E))})(r.value,M)?_():(function(){if(h+=1,l)return;const S=Math.max(0,(function(E){const R=E.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(di()-p));S<=0?_():l=setTimeout(_,S)})())},{flush:"sync",immediate:!0}),J1(m);const k=B(()=>{var M,I,L,S;return vH(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(S=(L=(I=t.customComponentsMap)==null?void 0:I.value)!=null?L:{},Object.entries(S).map(([E,R])=>{const D=li(E);return R==null||!D||md(D)||GT.has(D)||fd.has(D)?"":D}).filter(Boolean)))}),g=B(()=>{const{key:M,tags:I}=yH(k.value);if(!M)return s;const L=o.get(M);if(L)return L;const S=FS(t.instanceMsgId,{customHtmlTags:I});return o.set(M,S),S}),v=B(()=>{const M=g.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=B(()=>{var M,I;const L=(M=e.parseOptions)!=null?M:{},S=t.effectiveFinal.value,E=k.value,R=S!=null,D=E.length>0;return R||D||L.streamParse==null?rt(rt(Ot(rt({},L),{streamParse:(I=L.streamParse)==null||I}),R?{final:S}:{}),D?{customHtmlTags:E}:{}):L}),T=B(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map(I=>String(I).trim().toLowerCase()).filter(Boolean))}),P=B(()=>$2(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),N=B(()=>$2(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ve([P,N],([M,I],[L,S])=>{L&&(M===L&&I===S||(_(),I!==S&&(a=[],d="")))},{flush:"sync"});const b=B(()=>{var M,I,L,S,E,R,D,F;if((M=e.nodes)!=null&&M.length)return a=[],d="",Wr(e.nodes.slice());const U=r.value;if(!U)return a=[],d="",[];const G=t.debugPerformanceEnabled.value,Y=G?di():0,q=v.value,ae=P.value,de=N.value;c&&ae!==c&&(function(ue){var le,me;(me=(le=ue.stream)==null?void 0:le.reset)==null||me.call(le)})(q),u&&de!==u&&(a=[],d="");const ne=a.length>0&&U.startsWith(d)&&de===u,X=G?I2(q):null,he=G?{}:void 0,Oe=he?Ot(rt({},y.value),{__timing:he}):y.value,je=RM(U,q,Oe),it=G?di():0,ce=G?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let z,Q=G?Xg(je.length):void 0,oe=0,W=0;if(ne){const ue=G?di():0;if(ce){const le=(function(me,j,ee){if(!j.length)return{nodes:me,metrics:Xg(me.length)};const pe=(function(Ie,fe,Me){const Ge=Math.min(Ie.length,fe.length);for(let lt=0;lt<Ge;lt++)if(!QK(fe[lt],Ie[lt],Me))return lt;return Ie.length===fe.length?-1:Ge})(me,j,ee);if(pe<0)return{nodes:j,metrics:{reusedNodeCount:me.length,dirtyStartIndex:pe,stablePrefixNodeCount:me.length,dirtyTailNodeCount:0}};const ke=me.slice();let Te=pe;for(let Ie=0;Ie<pe;Ie++)ke[Ie]=j[Ie];for(let Ie=pe;Ie<me.length;Ie++){const fe=j[Ie],Me=me[Ie];fe&&_3(fe,Me,ee)&&(ke[Ie]=fe,Te+=1)}return{nodes:ke,metrics:{reusedNodeCount:Te,dirtyStartIndex:pe,stablePrefixNodeCount:pe,dirtyTailNodeCount:P2(pe,me,j)}}})(je,a,ce);z=le.nodes,Q=le.metrics}else{const le=(function(me,j){if(!j.length)return{nodes:me,metrics:Xg(me.length)};const ee=(function(Te,Ie){const fe=Math.min(Te.length,Ie.length);for(let Me=0;Me<fe;Me++)if(!YK(Ie[Me],Te[Me]))return Me;return Te.length===Ie.length?-1:fe})(me,j);if(ee<0)return{nodes:j,metrics:{reusedNodeCount:me.length,dirtyStartIndex:ee,stablePrefixNodeCount:me.length,dirtyTailNodeCount:0}};const pe=me.slice();let ke=ee;for(let Te=0;Te<ee;Te++)pe[Te]=j[Te];for(let Te=ee;Te<me.length;Te++){const Ie=j[Te],fe=me[Te];Ie&&b3(Ie,fe)&&(pe[Te]=Ie,ke+=1)}return{nodes:pe,metrics:{reusedNodeCount:ke,dirtyStartIndex:ee,stablePrefixNodeCount:ee,dirtyTailNodeCount:P2(ee,me,j)}}})(je,a);z=le.nodes,Q=le.metrics}oe=G?di()-ue:0,W=Q?.dirtyStartIndex==null||Q.dirtyStartIndex<0?z.length:Q.dirtyStartIndex}else z=je;ce?(function(ue,le,me=0){for(let j=Math.max(0,me);j<ue.length;j++)vy(le,"primeSignatureMs",()=>sl(ue[j]))})(z,ce,W):(function(ue,le=0){for(let me=Math.max(0,le);me<ue.length;me++)sl(ue[me])})(z,W);const Z=G?di()-it:0;if(f+=1,d=U,c=ae,u=de,a=z,G){const ue=I2(q),le=typeof ue?.total=="number"&&ue.total>((I=X?.total)!=null?I:0);t.logPerf(le?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(di()-Y),nodes:z.length,contentLength:U.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Z,signatureMs:(L=ce?.signatureMs)!=null?L:0,stabilizeSignatureMs:(S=ce?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(E=ce?.primeSignatureMs)!=null?E:0,signatureCallCount:(R=ce?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(D=ce?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(F=ce?.primeSignatureCallCount)!=null?F:0,stabilizeMs:oe},Q??{}),he?Object.fromEntries(UK.map(me=>{var j;return[me,(j=he[me])!=null?j:0]})):{}),ue?{streamMode:ue.lastMode,streamDelta:XK(ue,X),streamStats:ue}:{}))}return Wr(z)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:T,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:b}}function JK(e){const{isClient:t}=e,n=J(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 _=n.value,k=_.has(f);if(h){if(k)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(_);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 eG(e={}){const t=J(""),n=J(""),s=J(!1),o=tq(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=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>s.value&&a.value);return Z1()&&J1(()=>{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 R2=/auto|scroll|overlay/i;function tG(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return R2.test(t)||R2.test(n)}function nG(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 sG=qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,s;return _1((s=qa(e.estimatedPreviewHeightPx))!=null?s:k1(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),mn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),mn("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},()=>mn("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,mn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"absolute inset-0"},[mn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),oG=qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,s;return b1((s=qa(e.estimatedPreviewHeightPx))!=null?s:y1(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),mn("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},()=>mn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[mn("span",{class:"action-icon block"})])))]):null,mn("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)"}},[mn("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"}})])])}}),iG=["data-custom-id"],rG={class:"m-0 p-0"},lG=["data-probe"],aG=["data-node-index","data-node-type"],w3=gn(qe(Ot(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=Rs(),r=Ut("markstreamNestedRendererProps",void 0);function l(A){var H,V;const K=s[A];return(function(te){const ge=i?.vnode.props;return!!ge&&(Object.prototype.hasOwnProperty.call(ge,te)||Object.prototype.hasOwnProperty.call(ge,String(te).replace(/[A-Z]/g,Se=>`-${Se.toLowerCase()}`)))})(A)?K:(V=(H=r?.value)==null?void 0:H[A])!=null?V:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=B(()=>{return(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=B(()=>{const A=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return A===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:A===!1||c.value==="docs"?"monaco":"pre"}),d=B(()=>a[c.value]),f=B(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),h=B(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),p=B(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=B(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),_=B(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),k=B(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),g=B(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),v=B(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),y=B(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),T=B(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),P=B(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),N=B(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),b={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 _.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return T.value},get liveNodeBuffer(){return P.value},get nodeVirtual(){return N.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function M(A){o("height-change",A)}function I(A){o("virtual-state-change",A)}function L(A){o("anchor-change",A)}const S=J(),E=J(null),R=J(null),D=J(null),F=Os({1:null,2:null,3:null,4:null,5:null,6:null}),U=J(!1),G=new Map,Y=J(0),q=J(0),ae=J({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function de(){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 ne(typeof V=="function"?V():V)}function ne(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?ne(A.value):typeof A=="object"&&"$el"in A?ne(A.$el):null:null}const{isClient:X,renderAsFragment:he,debugPerformanceEnabled:Oe,resolvedShowTooltips:je,resolvedHtmlPolicy:it,inheritedSmoothStreaming:ce,ownsTypewriterCursor:z}=(function(A){const H=typeof window<"u",V=ld(),K=Ut("markstreamHtmlPolicy",void 0),te=Ut("markstreamTypewriterCursor",void 0),ge=Ut("markstreamSmoothStreaming",void 0),Se=B(()=>A.renderAsFragment===!0),xe=B(()=>!!(A.debugPerformance&&H&&typeof console<"u")),Be=B(()=>{var He;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Ne=(He=V.showTooltips)!=null?He:V["show-tooltips"];return Ne===""||Ne===!0||Ne==="true"||Ne!==!1&&Ne!=="false"&&void 0}),$e=B(()=>{var He,Ne;return(Ne=(He=A.htmlPolicy)!=null?He:K?.value)!=null?Ne:"safe"}),ze=B(()=>te?.value!==!0);return{isClient:H,renderAsFragment:Se,debugPerformanceEnabled:xe,resolvedShowTooltips:Be,resolvedHtmlPolicy:$e,inheritedSmoothStreaming:ge,inheritedTypewriterCursor:te,ownsTypewriterCursor:ze}})(b),{resolveViewportRoot:Q,resolveScrollContainer:oe,isReverseFlexScrollRoot:W,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:ue}=(function(A,H){function V(){var xe,Be;return(Be=(xe=H.scrollRoot)==null?void 0:xe.call(H))!=null?Be:null}function K(xe){if(typeof window>"u")return null;const Be=V();if(Be)return Be;const $e=xe??A.value;if(!$e)return null;const ze=$e.ownerDocument||document,He=ze.scrollingElement||ze.documentElement;let Ne=$e;for(;Ne&&Ne!==ze.body&&Ne!==He;){if(tG(window.getComputedStyle(Ne))&&nG(Ne))return Ne;Ne=Ne.parentElement}return null}function te(xe){if(!H.isClient)return!1;try{const Be=window.getComputedStyle(xe);return!!(Be.display||"").toLowerCase().includes("flex")&&(Be.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ge(xe,Be,$e){var ze,He;if($e)return Se(Be);const Ne=xe.scrollTop;if(!te(xe))return Ne;const We=Ne<0?-Ne:Ne;return Math.max(0,((ze=xe.scrollHeight)!=null?ze:0)-((He=xe.clientHeight)!=null?He:0))-We}function Se(xe){var Be,$e,ze,He,Ne;const We=Number((Be=xe.scrollingElement)==null?void 0:Be.scrollTop),Ze=Number((ze=($e=xe.documentElement)==null?void 0:$e.scrollTop)!=null?ze:0),Je=Number((Ne=(He=xe.body)==null?void 0:He.scrollTop)!=null?Ne:0);return Math.max(0,Number.isFinite(We)?We:0,Number.isFinite(Ze)?Ze:0,Number.isFinite(Je)?Je:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(xe){var Be,$e,ze,He;const Ne=V();if(Ne)return Ne;const We=K((Be=xe??A.value)!=null?Be:null);if(We)return We;const Ze=(He=(ze=xe?.ownerDocument)!=null?ze:($e=A.value)==null?void 0:$e.ownerDocument)!=null?He:typeof document<"u"?document:null;return Ze?.scrollingElement||Ze?.documentElement||null},isReverseFlexScrollRoot:te,getNormalizedScrollTop:ge,getOffsetTopWithinRoot:function(xe,Be){const $e=Be.ownerDocument||xe.ownerDocument||document;if((function(We,Ze){return We===Ze.documentElement||We===Ze.body||We===Ze.scrollingElement})(Be,$e))return xe.getBoundingClientRect().top+Se($e);const ze=Be.getBoundingClientRect(),He=xe.getBoundingClientRect(),Ne=ge(Be,$e,!1);return He.top-ze.top+Ne}}})(S,{isClient:X,scrollRoot:de});$n("markstreamShowTooltips",je),$n("markstreamHtmlPolicy",it),$n("markstreamTypewriter",B(()=>b.typewriter!==!1)),$n("markstreamFade",B(()=>b.fade!==!1)),$n("markstreamTypewriterCursor",B(()=>!0)),$n("markstreamTextStreamState",G),$n("markstreamStreamVersion",Y),$n("markstreamParseOptions",B(()=>b.parseOptions)),$n("markstreamCustomMarkdownIt",B(()=>b.customMarkdownIt));const{smoothStreamingEnabled:le,renderContent:me,effectiveFinal:j}=(function(A,H){const V=eG(A.smoothStreamingOptions),K=B(()=>{var $e,ze,He;return A.smoothStreaming!==!1&&!(($e=A.nodes)!=null&&$e.length)&&(A.smoothStreaming===!0||!((ze=H.inheritedSmoothStreaming)!=null&&ze.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((He=A.maxLiveNodes)!=null?He:0)<=0)}),te=J(!H.isClient||A.smoothStreaming===!0);bn(()=>{te.value=!0});const ge=B(()=>te.value&&K.value),Se=B(()=>{var $e;return ge.value?V.visible.value:($e=A.content)!=null?$e:""}),xe=B(()=>{var $e,ze;const He=($e=A.parseOptions)!=null?$e:{};return(ze=A.final)!=null?ze:He.final}),Be=B(()=>{const $e=xe.value;return ge.value&&$e!=null?!!$e&&V.caughtUp.value:$e});return Ve([()=>A.content,()=>A.nodes,ge,xe],([$e,ze,He,Ne])=>{if(ze?.length)return void V.reset("");const We=$e??"";if(!He)return V.reset(We),void(Ne&&V.finish({flush:!0}));const Ze=V.source.value;We?We===Ze||(We.startsWith(Ze)?V.enqueue(We.slice(Ze.length)):V.reset(We)):V.reset(""),Ne&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:ge,renderContent:Se,requestedFinal:xe,effectiveFinal:Be}})(b,{isClient:X,inheritedSmoothStreaming:ce});$n("markstreamSmoothStreaming",le);const ee=J(!1);let pe="",ke=!1,Te=null;function Ie(){X&&Te!=null&&(window.clearTimeout(Te),Te=null)}function fe(){ee.value=!1,Ie()}function Me(A,H){if(!Oe.value)return;const V=(function(){if(!Oe.value)return null;const K=Et(Ge),te=Et(lt),ge=Math.max(bt,te);if(K<=0&&ge<=0)return null;const Se={total:K,maxPerFrame:ge,byLabel:(xe=Ge,Object.fromEntries(Array.from(xe.entries()).sort((Be,$e)=>$e[1]-Be[1]||Be[0].localeCompare($e[0]))))};var xe;return Ge.clear(),lt.clear(),bt=0,Se})();console.info(`[markstream-vue][perf] ${A}`,V?Ot(rt({},H),{layoutReads:V}):H)}Ve([me,()=>s.nodes,j],([A,H,V])=>{const K=A??"";return H?.length||V===!0?(fe(),pe=K,void(ke=!0)):ke?(pe&&K.length>pe.length&&K.startsWith(pe)?(ee.value=!0,X&&(Ie(),Te=window.setTimeout(()=>{var te;Te=null,j.value===!0||(te=s.nodes)!=null&&te.length||(va(),ee.value=!1,Bi())},1200))):(K.length<pe.length||!K.startsWith(pe))&&fe(),void(pe=K)):(pe=K,void(ke=!0))},{flush:"sync",immediate:!0});const Ge=new Map,lt=new Map;let kt=!1,bt=0;function Et(A){let H=0;for(const V of A.values())H+=V;return H}function Rt(){bt=Math.max(bt,Et(lt)),lt.clear(),kt=!1}function vt(A,H){return(function(V){var K,te;Oe.value&&(Ge.set(V,((K=Ge.get(V))!=null?K:0)+1),lt.set(V,((te=lt.get(V))!=null?te:0)+1),kt||(kt=!0,X&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Rt):typeof queueMicrotask!="function"?setTimeout(Rt,0):queueMicrotask(Rt)))})(A),H()}const qt=b.customId?`renderer-${b.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,dn=(function(A){const H=new Map;return{scope:A,cache:H,clear:()=>H.clear()}})(qt),os=B(()=>`${qt}:${Y.value}`);$n(m3,dn);const Vt=ps(()=>b.customId),{effectiveCustomHtmlTagsSet:fn,mergedParseOptions:Ds,parsedNodes:nt}=ZK(b,{instanceMsgId:qt,renderContent:me,effectiveFinal:j,smoothStreamingEnabled:le,debugPerformanceEnabled:Oe,customComponentsMap:Vt,logPerf:Me});Ve(nt,()=>{dn.clear(),Y.value+=1},{immediate:!0});const Dn=B(()=>({customId:b.customId,customHtmlTags:Ds.value.customHtmlTags,parseOptions:b.parseOptions,customMarkdownIt:b.customMarkdownIt,htmlPolicy:it.value,viewportPriority:b.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:b.codeBlockStream,codeBlockDarkTheme:b.codeBlockDarkTheme,codeBlockLightTheme:b.codeBlockLightTheme,codeBlockMonacoOptions:b.codeBlockMonacoOptions,renderCodeBlocksAsPre:b.renderCodeBlocksAsPre,codeBlockMinWidth:b.codeBlockMinWidth,codeBlockMaxWidth:b.codeBlockMaxWidth,codeBlockProps:b.codeBlockProps,mermaidProps:b.mermaidProps,d2Props:b.d2Props,infographicProps:b.infographicProps,showTooltips:je.value,themes:b.themes,langs:b.langs,isDark:b.isDark,typewriter:b.typewriter,smoothStreamingOptions:b.smoothStreamingOptions,parseCoalesceMs:b.parseCoalesceMs,fade:b.fade}));$n("markstreamNestedRendererProps",Dn);const is=B(()=>nt.value),Vn=B(()=>nt.value.length),Kn=J(null),Yt=J(null),Gn=J(null),Ke=J(null),Qe=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),Dt=!Qe&&b.customId?C2(b.customId):null,tn=B(()=>Dt?(S2.value,C2(b.customId)):null),ln=B(()=>{var A;return!!(X&&!he.value&&b.customId&&!Qe&&((A=tn.value)!=null&&A.enabled))}),Zt=B(()=>{var A;return!!(!he.value&&((A=s.virtualScroll)!=null&&A.enabled))}),_n=J(!1);bn(()=>{_n.value=!0});const xt=B(()=>!!(X&&Zt.value));$n("markstreamHostScrollManaged",xt);const Yn=B(()=>!!(_n.value&&xt.value)),Wt=B(()=>ln.value||xt.value),ys=B(()=>ln.value||Yn.value),Cs=B(()=>{var A;return Wt.value&&((A=tn.value)==null?void 0:A.textEstimation)!==!1}),Co=B(()=>{var A;return Wt.value&&((A=tn.value)==null?void 0:A.codeBlockEstimation)!==!1});function Vs(){const A=q.value||vt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const co=B(()=>{const A=Vs();return A>0?Math.max(1,Math.round(A)):640}),uo=B(()=>{var A;return Math.max(1,(A=b.maxLiveNodes)!=null?A:320)}),Lt=B(()=>{var A;return!he.value&&b.nodeVirtual!==!1&&!(((A=b.maxLiveNodes)!=null?A:0)<=0)&&(b.nodeVirtual===!0?nt.value.length>0:nt.value.length>uo.value)}),Wo=B(()=>Lt.value||ln.value||xt.value),zo=B(()=>b.viewportPriority!==!1&&!U.value),Ye=HV(A=>{var H;return Q((H=A??S.value)!=null?H:null)},zo),{requestFrame:et,cancelFrame:st,hasIdleCallback:Bt,isTestEnv:Uo}=(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,K=A.isClient&&typeof window.requestIdleCallback=="function",te=(function(){var ge;if(typeof globalThis>"u"||!("process"in globalThis))return;const Se=(ge=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ge.value;return Se?.env})();return{requestFrame:H,cancelFrame:V,hasIdleCallback:K,isTestEnv:te?.NODE_ENV==="test"}})({isClient:X}),{resolvedBatchSize:Oi,resolvedInitialBatch:Ee,batchingEnabled:Ae,incrementalRenderingActive:Fe,renderedCount:Nt,previousRenderContext:zt,adaptiveBatchSize:ts,previousBatchConfig:Qn}=(function(A,H){var V;const K=B(()=>{var He;const Ne=Math.trunc((He=A.renderBatchSize)!=null?He:80);return Number.isFinite(Ne)?Math.max(0,Ne):0}),te=B(()=>{var He;const Ne=Math.trunc((He=A.initialRenderBatchSize)!=null?He:K.value);return Number.isFinite(Ne)?Math.max(0,Ne):K.value}),ge=B(()=>!H.renderAsFragment.value&&A.batchRendering!==!1&&K.value>0&&H.isClient&&!H.isTestEnv),Se=J(0),xe=J({key:A.indexKey,total:0}),Be=J(Math.max(1,K.value||1)),$e=B(()=>{var He;return ge.value&&((He=A.maxLiveNodes)!=null?He:0)<=0}),ze=J({batchSize:K.value,initial:te.value,delay:(V=A.renderBatchDelay)!=null?V:16,enabled:$e.value});return{resolvedBatchSize:K,resolvedInitialBatch:te,batchingEnabled:ge,incrementalRenderingActive:$e,renderedCount:Se,previousRenderContext:xe,adaptiveBatchSize:Be,previousBatchConfig:ze}})(b,{isClient:X,isTestEnv:Uo,renderAsFragment:he}),Fn=new Map,ft=new Map,ve=new WeakMap;let Le=null;const Mn=new WeakMap,xs=new Map,ia=J(0),xc=B(()=>(ia.value,Array.from(Fn.entries()).sort((A,H)=>A[0]-H[0]))),ai=J(null),Ks=J(null);let Pi=null,se=0,we=null;const{activeRestoreAnchor:Ce,getRelativeScrollTopWithinContainer:De,setRelativeScrollTopWithinContainer:ot,resolveAnchorOffset:at,clearRestoreReconcile:Mt,scheduleRestoreReconcile:nn,captureRestoreAnchor:Jt,restoreAnchor:As,getAnchorDrift:hr}=(function(A){const{isClient:H,containerRef:V,parsedNodeCount:K,requestFrame:te,cancelFrame:ge,resolveScrollContainer:Se,getNormalizedScrollTop:xe,getOffsetTopWithinRoot:Be,isReverseFlexScrollRoot:$e,estimateIndexForOffset:ze,estimateHeightRange:He,getFallbackNodeHeight:Ne,clamp:We}=A,Ze=J(null);let Je=null,wt=[];function ct(){const At=Se(),Ht=V.value;if(!At||!Ht)return null;const Ft=At.ownerDocument||Ht.ownerDocument||document;if(At===Ft.documentElement||At===Ft.body||At===Ft.scrollingElement){const pn=Ht.getBoundingClientRect();return Math.max(0,-pn.top)}return Math.max(0,xe(At,Ft,!1)-Be(Ht,At))}function ut(At){var Ht;const Ft=Se(),pn=V.value;if(!Ft||!pn)return;const Mo=Math.max(0,At),Gs=Ft.ownerDocument||pn.ownerDocument||document,ci=Gs.defaultView||(typeof window<"u"?window:null);if(Ft===Gs.documentElement||Ft===Gs.body||Ft===Gs.scrollingElement){const br=xe(Ft,Gs,!0)+pn.getBoundingClientRect().top;return void((Ht=ci?.scrollTo)==null||Ht.call(ci,0,Math.max(0,br+Mo)))}T2(Ft,Gs,Be(pn,Ft)+Mo,{isReverseFlexScrollRoot:br=>{var _r;return(_r=$e?.(br))!=null&&_r},getNormalizedScrollTop:xe})}function Ct(At){const Ht=K.value,Ft=We(At.nodeIndex,0,Math.max(0,Ht-1));return He(0,Ft)+Math.max(0,At.offsetWithinNodePx)}function St(){if(Je!=null&&(ge?.(Je),Je=null),H)for(const At of wt)window.clearTimeout(At);wt=[]}function sn(At){const Ht=Ct(At),Ft=ct();Ft!=null&&Math.abs(Ft-Ht)<=.5||ut(Ht)}return{activeRestoreAnchor:Ze,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:ut,resolveAnchorOffset:Ct,clearRestoreReconcile:St,applyRestoreAnchor:sn,scheduleRestoreReconcile:function(){Ze.value&&H&&Je==null&&(Je=te?te(()=>{Je=null,Ze.value&&sn(Ze.value)}):null,Je==null&&Ze.value&&sn(Ze.value))},captureRestoreAnchor:function(){const At=ct(),Ht=K.value;if(At==null||Ht<=0)return null;const Ft=We(ze(At+1),0,Ht-1),pn=He(0,Ft),Mo=Ne(Ft);return{nodeIndex:Ft,offsetWithinNodePx:We(At-pn,0,Math.max(0,Mo-1))}},restoreAnchor:function(At){const Ht=K.value;if(Ze.value={nodeIndex:We(At.nodeIndex,0,Math.max(0,Ht-1)),offsetWithinNodePx:Math.max(0,At.offsetWithinNodePx)},St(),sn(Ze.value),H)for(const Ft of[0,120,280,480])wt.push(window.setTimeout(()=>{Ze.value&&sn(Ze.value)},Ft))},getAnchorDrift:function(At){const Ht=ct();return Ht==null?null:Ht-Ct(At)}}})({isClient:X,containerRef:S,parsedNodeCount:Vn,requestFrame:et,cancelFrame:st,resolveScrollContainer:()=>ai.value||oe(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:ue,isReverseFlexScrollRoot:W,estimateIndexForOffset:Lm,estimateHeightRange:kr,getFallbackNodeHeight:Md,clamp:Es}),{nodeHeights:Kt,heightStats:wn,heightTreeSize:On,heightSumTree:ks,heightKnownTree:bs,averageNodeHeight:Ts,resetHeightMeasurements:ra,pruneHeightMeasurements:Qh,rebuildHeightTrees:kd,recordNodeHeight:W4,removeNodeHeights:z4,exportHeightCache:U4,importHeightCache:j4,fenwickRangeSum:bd}=(function(A={}){const H=Os({}),V=Os({total:0,count:0}),K=J(0),te=J([]),ge=J([]);function Se(){for(const Ne of Object.keys(H))delete H[Number(Ne)];V.total=0,V.count=0,K.value=0,te.value=[],ge.value=[]}function xe(Ne,We,Ze){for(let Je=We+1;Je<Ne.length;Je+=Je&-Je)Ne[Je]+=Ze}function Be(Ne,We){let Ze=0;for(let Je=We+1;Je>0;Je-=Je&-Je)Ze+=Ne[Je];return Ze}function $e(Ne){K.value=Ne;const We=new Array(Ne+1).fill(0),Ze=new Array(Ne+1).fill(0);for(const[Je,wt]of Object.entries(H)){const ct=Number(Je),ut=Number(wt);!Number.isFinite(ct)||ct<0||ct>=Ne||!Number.isFinite(ut)||ut<=0||(xe(We,ct,ut),xe(Ze,ct,1))}te.value=We,ge.value=Ze}function ze(Ne){if(!Number.isInteger(Ne)||Ne<0)return!1;const We=H[Ne];if(!Number.isFinite(We)||We<=0)return!1;if(delete H[Ne],V.total=Math.max(0,V.total-We),V.count=Math.max(0,V.count-1),K.value>Ne){const Ze=te.value,Je=ge.value;Ze.length&&Je.length&&(xe(Ze,Ne,-We),xe(Je,Ne,-1))}return!0}const He=B(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:H,heightStats:V,heightTreeSize:K,heightSumTree:te,heightKnownTree:ge,averageNodeHeight:He,resetHeightMeasurements:Se,pruneHeightMeasurements:function(Ne){if(Ne<=0)return void Se();let We=0,Ze=0;for(const[Je,wt]of Object.entries(H)){const ct=Number(Je),ut=Number(wt);!Number.isFinite(ct)||ct<0||ct>=Ne||!Number.isFinite(ut)||ut<=0?delete H[ct]:(We+=ut,Ze++)}V.total=We,V.count=Ze},rebuildHeightTrees:$e,recordNodeHeight:function(Ne,We,Ze={}){(function(Je,wt,ct={}){var ut;if(!Number.isFinite(wt)||wt<=0)return!1;const Ct=H[Je];if(Ct&&(ct.allowShrink===!1&&wt<Ct||Math.abs(wt-Ct)<=1))return!1;if(H[Je]=wt,Ct?V.total+=wt-Ct:(V.total+=wt,V.count++),K.value>Je){const St=te.value,sn=ge.value;if(St.length&&sn.length)if(Ct){const At=wt-Ct;At!==0&&xe(St,Je,At)}else xe(St,Je,wt),xe(sn,Je,1)}ct.notify!==!1&&((ut=A.onHeightRecorded)==null||ut.call(A))})(Ne,We,Ot(rt({},Ze),{notify:!0}))},removeNodeHeight:function(Ne,We={}){var Ze;const Je=ze(Ne);return Je&&We.notify!==!1&&((Ze=A.onHeightRecorded)==null||Ze.call(A)),Je},removeNodeHeights:function(Ne,We={}){var Ze;let Je=0;for(const wt of Ne)ze(Number(wt))&&Je++;return Je>0&&We.notify!==!1&&((Ze=A.onHeightRecorded)==null||Ze.call(A)),Je},exportHeightCache:function(){return Object.entries(H).map(([Ne,We])=>({index:Number(Ne),height:Number(We)})).filter(Ne=>Number.isFinite(Ne.index)&&Ne.index>=0&&Number.isFinite(Ne.height)&&Ne.height>0).sort((Ne,We)=>Ne.index-We.index)},importHeightCache:function(Ne,We={}){var Ze;if(!Array.isArray(Ne))return;const Je=K.value;let wt=!1;if(We.mode!=="merge"){const ct=Object.keys(H);if(ct.length>0){for(const ut of ct)delete H[Number(ut)];wt=!0}}for(const ct of Ne){const ut=Number(ct.index),Ct=Number(ct.height);if(!Number.isInteger(ut)||ut<0||Je>0&&ut>=Je||!Number.isFinite(Ct)||Ct<=0)continue;const St=H[ut];St&&Math.abs(St-Ct)<=1||(H[ut]=Ct,wt=!0)}wt&&((function(){let ct=0,ut=0;const Ct=K.value;for(const[St,sn]of Object.entries(H)){const At=Number(St),Ht=Number(sn);!Number.isFinite(At)||At<0||Ct>0&&At>=Ct||!Number.isFinite(Ht)||Ht<=0?delete H[At]:(ct+=Ht,ut++)}V.total=ct,V.count=ut})(),Je>0&&$e(Je),(Ze=A.onHeightRecorded)==null||Ze.call(A))},fenwickRangeSum:function(Ne,We,Ze){if(Ze<=We)return 0;const Je=Be(Ne,Ze-1);return We<=0?Je:Je-Be(Ne,We-1)}}})({onHeightRecorded:()=>{qo(),xt.value&&Wc(),Ce.value&&nn(),Ks.value&&ha(),Pn("node-resize")}});function _d(){ra(),xs.clear()}function jy(A){!Number.isInteger(A)||A<0||A>=nt.value.length||xs.set(A,Ic(A))}function qy(A,H,V={}){const K=Kt[A];W4(A,H,V);const te=Kt[A];te&&te>0?jy(A):K&&xs.delete(A)}function Vy(A,H){const V=vt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,te;return(te=(K=Fn.get(A))==null?void 0:K.offsetHeight)!=null?te:0});return V>0?V:vt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Ky(A,H={}){j4(A,H),Cm()}const mr=B(()=>{var A;return!he.value&&b.deferNodesUntilVisible!==!1&&!(((A=b.maxLiveNodes)!=null?A:0)<=0)&&!Lt.value&&!(nt.value.length>900)&&zo.value}),Gy=B(()=>!!Ye&&(mr.value||Lt.value)),Yy=B(()=>Lt.value||xt.value),{liveNodeBufferResolved:Ac,focusIndex:jo,liveRange:Ms,updateLiveRange:dl}=(function(A,H){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:te,clamp:ge}=H,Se=B(()=>{var $e;return Math.max(0,($e=A.liveNodeBuffer)!=null?$e:60)}),xe=J(0),Be=Os({start:0,end:0});return{liveNodeBufferResolved:Se,focusIndex:xe,liveRange:Be,updateLiveRange:function(){const $e=V.value;if(!K.value||$e===0)return Be.start=0,void(Be.end=$e);const ze=Math.min(te.value,$e),He=Se.value,Ne=ge(xe.value-He,0,Math.max(0,$e-ze));Be.start=Ne,Be.end=Math.min($e,Ne+ze)}}})(b,{parsedNodeCount:Vn,virtualizationEnabled:Lt,maxLiveNodesResolved:uo,clamp:Es}),_i=new Map,fl=new Map,gr=new Map,wd=[],Ri=new Map,vr=new Set,Qy=J(0);let Xh=!1;const Xy=B(()=>(Qy.value,vr.size)),xo=new Map,wi=new Map,Zy=J(0),Zh=B(()=>{Zy.value;let A=0;for(const H of xo.values())A+=Math.max(0,H);return A});let Ao=null,Jh=!0,Jy=[0],ek="";function qo(){Jh=!0}const Sd=B(()=>{if(!Lt.value)return nt.value.length;const A=Ac.value,H=Math.max(Ms.end+A,Ee.value),V=Math.min(nt.value.length,H);return Math.max(Nt.value,V)});function Cd(){Xh||(Xh=!0,queueMicrotask(()=>{Xh=!1,Qy.value+=1}))}function tk(A,H,V="node-resize"){if(!X||typeof window>"u")return null;const K=window.setTimeout(()=>{vr.delete(K)&&Cd();try{H()}finally{Pn(V)}},Math.max(0,A));return vr.add(K),Cd(),K}function xd(A){X&&A!=null&&(vr.delete(A)&&Cd(),window.clearTimeout(A))}function nk(){if(X&&typeof window<"u")for(const A of vr)window.clearTimeout(A);vr.size&&(vr.clear(),Cd()),wd.length=0,gr.clear()}function q4(A){var H,V;return(V=(H=Ke.value)==null?void 0:H[A])!=null?V:null}const{cancelScheduledFocusSync:em,scheduleFocusSync:Si}=(function(A){const{isClient:H,containerRef:V,virtualizationEnabled:K,requestFrame:te,cancelFrame:ge,syncFocusToScroll:Se}=A;let xe=null;function Be(){var ze,He,Ne;return(Ne=(He=(ze=V.value)==null?void 0:ze.ownerDocument)==null?void 0:He.defaultView)!=null?Ne:typeof window<"u"?window:null}function $e(){if(!xe)return;const ze=Be();xe.viaTimeout?ze?ze.clearTimeout(xe.id):clearTimeout(xe.id):ge?.(xe.id),xe=null}return{cancelScheduledFocusSync:$e,scheduleFocusSync:function(ze={}){if(!K.value)return;if(!H)return void Se(!0);if(ze.immediate)return $e(),void Se(!0);if(xe)return;const He=()=>{xe=null,Se()};if(te)return void(xe={id:te(He),viaTimeout:!1});const Ne=Be();xe={id:Ne?Ne.setTimeout(He,16):setTimeout(He,16),viaTimeout:!0}}}})({isClient:X,containerRef:S,virtualizationEnabled:Lt,requestFrame:et,cancelFrame:st,syncFocusToScroll:function(A=!1){var H;if(!Lt.value)return;const V=ai.value||oe();if(!V)return;const K=V.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,te=K?.defaultView||(typeof window<"u"?window:null),ge=V===K?.documentElement||V===K?.body,Se=nt.value.length;if(!ge&&Se>0&&W(V)){const Ze=vt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Je=vt("syncFocusToScroll.scrollTop",()=>V.scrollTop),wt=Je<0?-Je:Je,ct=(function(Ct){var St,sn;const At=nt.value;if(!At.length)return 0;if(Ct<=0)return Math.max(0,At.length-1);if(Wt.value){const Ft=(St=im()[At.length])!=null?St:0;return uk(Math.max(0,Ft-Ct))}if(On.value===At.length){const Ft=kr(0,At.length);return Lm(Math.max(0,Ft-Ct))}let Ht=Ct;for(let Ft=At.length-1;Ft>=0;Ft--){const pn=(sn=Kt[Ft])!=null?sn:Ts.value;if(Ht<=pn)return Ft;Ht-=pn}return 0})(Math.max(0,wt)+.5*Math.max(0,Ze)),ut=Es(ct,0,Math.max(0,Se-1));return void((A||Math.abs(ut-jo.value)>1)&&(jo.value=ut,dl()))}const xe=ge?null:vt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Be=ge?0:xe.top,$e=ge?vt("syncFocusToScroll.viewport.clientHeight",()=>{var Ze,Je;return(Je=(Ze=te?.innerHeight)!=null?Ze:V.clientHeight)!=null?Je:0}):xe.bottom,ze=xc.value;let He=null,Ne=null;for(const[Ze,Je]of ze){if(!Je)continue;const wt=vt("syncFocusToScroll.slot.getBoundingClientRect",()=>Je.getBoundingClientRect());wt.bottom<=Be||wt.top>=$e||(He==null&&(He=Ze),Ne=Ze)}if(He==null||Ne==null){const Ze=S.value;if(!Ze)return;const Je=ge?{top:0}:vt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),wt=vt("syncFocusToScroll.fallback.scrollTop",()=>Z(V,K,ge)),ct=ge?(()=>{const St=vt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ze.getBoundingClientRect()),sn=(ge?0:Je.top)-St.top;return Math.max(0,sn)})():(()=>{const St=ue(Ze,V);return Math.max(0,wt-St)})(),ut=ge?vt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var St,sn,At,Ht;return(Ht=(At=(sn=te?.innerHeight)!=null?sn:(St=K?.documentElement)==null?void 0:St.clientHeight)!=null?At:V.clientHeight)!=null?Ht:0}):vt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),Ct=Lm(ct+.5*Math.max(0,ut));return jo.value=Es(Ct,0,Math.max(0,nt.value.length-1)),void dl()}const We=Math.round((He+Ne)/2);!A&&Math.abs(We-jo.value)<=1||(jo.value=Es(We,0,Math.max(0,nt.value.length-1)),dl())}}),{visibleNodeIndices:tm,nodeVisibilityHandles:la,nodeVisibilityWatchStops:Ad,nodeVisibilityFallbackTimers:sk,clearVisibilityFallback:Td,markNodeVisible:yr,cleanupNodeVisibility:V4,destroyNodeVisibilityState:nm}=JK({isClient:X,shouldTrackVisibleNodeIndices:()=>mr.value,shouldCleanupNodeVisibility:()=>Lt.value,onNodeMarkedVisible:A=>{Lt.value?Si():jo.value=Es(A,0,Math.max(0,nt.value.length-1))},onNodeVisibilityCleaned:A=>{Fn.delete(A)&&Nk()}}),{cleanupScrollListener:ok,setupScrollListener:K4}=(function(A){const{isClient:H,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:te,resolveScrollContainer:ge,scheduleFocusSync:Se,onScroll:xe}=A;let Be=null,$e=null;function ze(){Be&&(Be(),Be=null),$e=null,te.value=null}function He(Ne){const We=A.getScrollTop?A.getScrollTop(Ne):Ne.scrollTop;return Math.max(0,Number.isFinite(We)?Math.abs(We):0)}return{cleanupScrollListener:ze,setupScrollListener:function(){if(!H)return;if(!((Ne=K?.value)!=null?Ne:V.value))return void ze();var Ne;const We=ge();if(!We)return void ze();if(te.value===We&&Be)return;ze(),$e=He(We);const Ze=()=>{if(xe?.(),V.value){const Je=(function(wt){const ct=He(wt),ut=$e;$e=ct;const Ct=Math.max(480,.75*(wt.clientHeight||0));return ut==null?ct>Ct?{immediate:!0}:void 0:Math.abs(ct-ut)>Ct?{immediate:!0}:void 0})(We);Je?Se(Je):Se()}};We.addEventListener("scroll",Ze,{passive:!0}),te.value=We,Be=()=>{We.removeEventListener("scroll",Ze)}}}})({isClient:X,virtualizationEnabled:Lt,listenerEnabled:Yy,scrollRootElement:ai,resolveScrollContainer:oe,scheduleFocusSync:Si,onScroll:function(){const A=Ks.value;if(!A)return;const H=Ec();if(!H||(function(K){if(Pc()>=se)return we=null,!1;const te=we;if(te==null)return!0;const ge=Math.abs(K.scrollTop-te)<=2;return ge||(we=null),ge})(H))return;const V=kk(H);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,A.distanceFromBottomPx))>32)&&pa("restore"):pa("restore")},getScrollTop:A=>{var H;const V=A.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,K=A===V.documentElement||A===V.body||A===V.scrollingElement;return vt("scrollListener.getScrollTop",()=>Z(A,V,K))}});function Es(A,H,V){return Math.min(Math.max(A,H),V)}function sm(A){return A?.firstElementChild}function ik(A,H){var V;return A?(V=A.matches)!=null&&V.call(A,H)?A:A.querySelector(H):null}function rk(){if(!Wt.value)return void(q.value=0);const A=vt("updateExperimentContainerWidth.clientWidth",()=>{var H,V;return(V=(H=S.value)==null?void 0:H.clientWidth)!=null?V:0});q.value=A>0?A:0}let Tc=null;function om(){Tc?.disconnect(),Tc=null}const lk=hi({loader:()=>Un(null,null,function*(){return(yield eo(()=>import("./index8-Bxb-Xjem.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:a3,delay:0,suspensible:!1});function ak(A){return A===lk}const ck=B(()=>u.value==="pre"?Eo:u.value==="shiki"?lk:zg),pl=B(()=>{const A=nt.value;if(!A.length||!Wt.value)return A.map(()=>null);const H=q.value||vt("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,K)=>{const te=Kt[K],ge=typeof te=="number"&&te>0;if(Cs.value&&!ge){const xe=h3(V,H,ae.value);if(xe)return xe}if(Co.value&&V.type==="code_block"){const xe=(function(Be){if(Be.type!=="code_block")return null;const $e=qk(Be,Pd(Be));return ak($e)?"markdown":$e===Eo?"pre":$e===ck.value||$e===zg?"monaco":null})(V);if(xe==="monaco"||xe==="markdown"||xe==="pre")return BK(V,{rendererKind:xe,monacoOptions:b.codeBlockMonacoOptions,showHeader:((Se=b.codeBlockProps)==null?void 0:Se.showHeader)!==!1})}var Se;return null})});function Md(A){var H;const V=Kt[A];if(Number.isFinite(V)&&V>0)return V;const K=(H=pl.value[A])==null?void 0:H.height;return Number.isFinite(K)&&K>0?K:Math.max(Ts.value,(function(te){var ge,Se,xe,Be,$e,ze,He,Ne,We,Ze,Je,wt,ct;const ut=nt.value[te];if(!ut||typeof ut!="object")return 32;const Ct=String((ge=ut.type)!=null?ge:""),St=Vs()||640;switch(Ct){case"heading":return 44;case"paragraph":return aa(String((xe=(Se=ut.raw)!=null?Se:ut.content)!=null?xe:""),St,34);case"list":{const sn=Array.isArray(ut.items)?ut.items.length:1;return Math.max(48,30*sn+12)}case"list_item":return aa(String(($e=(Be=ut.raw)!=null?Be:ut.content)!=null?$e:""),St,34);case"blockquote":return aa(String((He=(ze=ut.raw)!=null?ze:ut.content)!=null?He:""),St,56);case"table":{const sn=Array.isArray(ut.rows)?ut.rows.length:Array.isArray(ut.children)?ut.children.length:3;return Math.max(120,38*sn+48)}case"code_block":return aa(String((We=(Ne=ut.code)!=null?Ne:ut.raw)!=null?We:""),St,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return aa(String((Je=(Ze=ut.raw)!=null?Ze:ut.content)!=null?Je:""),St,96);case"thematic_break":return 24;default:return aa(String((ct=(wt=ut.raw)!=null?wt:ut.content)!=null?ct:""),St,40)}})(A))}function aa(A,H,V,K=22){const te=String(A??"");if(!te)return V;const ge=Math.max(18,Math.floor(Math.max(320,H)/8)),Se=te.split(/\r?\n/).length,xe=Math.ceil(te.length/ge),Be=Math.max(1,Se,xe);return Math.max(V,Math.ceil(Be*K+12))}function Mc(A){const H=Number(A);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function im(){var A,H;const V=nt.value.length,K=Mc(q.value||vt("getFallbackHeightPrefix.clientWidth",()=>{var xe;return((xe=S.value)==null?void 0:xe.clientWidth)||0})),te=((A=s.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(s.virtualScroll.measurementKey),ge=[V,wn.count,Math.round(wn.total),Math.round(100*Ts.value),te,K,Wt.value?1:0,S2.value,Y.value].join(":");if(!Jh&&ek===ge)return Jy;const Se=new Array(V+1);Se[0]=0;for(let xe=0;xe<V;xe++)Se[xe+1]=Se[xe]+(Wt.value?Md(xe):(H=Kt[xe])!=null?H:Ts.value);return Jy=Se,ek=ge,Jh=!1,Se}function uk(A){var H,V;const K=nt.value.length;if(K<=0||A<=0)return 0;const te=im();if(A>=((H=te[K])!=null?H:0))return K-1;let ge=0,Se=K-1,xe=K-1;for(;ge<=Se;){const Be=ge+Se>>1;((V=te[Be+1])!=null?V:0)>=A?(xe=Be,Se=Be-1):ge=Be+1}return xe}function kr(A,H){var V,K;if(A>=H)return 0;if(Wt.value)return(function(Se,xe){var Be,$e;const ze=nt.value.length,He=Es(Math.trunc(Se),0,ze),Ne=Es(Math.trunc(xe),He,ze);if(He>=Ne)return 0;const We=im();return((Be=We[Ne])!=null?Be:0)-(($e=We[He])!=null?$e:0)})(A,H);if(On.value!==nt.value.length){let Se=0;for(let xe=A;xe<H;xe++)Se+=(V=Kt[xe])!=null?V:Ts.value;return Se}const te=ks.value,ge=bs.value;if(!te.length||!ge.length){let Se=0;for(let xe=A;xe<H;xe++)Se+=(K=Kt[xe])!=null?K:Ts.value;return Se}return bd(te,A,H)+(H-A-bd(ge,A,H))*Ts.value}Ve(()=>nt.value.length,A=>{qo(),A<=0?_d():(A<On.value&&Qh(A),A!==On.value&&kd(A))},{immediate:!0});const G4=B(()=>{if(!Lt.value)return nt.value.map((K,te)=>({node:K,index:te}));const A=nt.value.length,H=Es(Ms.start,0,A),V=Es(Ms.end,H,A);return nt.value.slice(H,V).map((K,te)=>({node:K,index:H+te}))}),rm=B(()=>Lt.value?kr(0,Math.min(Ms.start,nt.value.length)):0),lm=B(()=>{if(!Lt.value)return 0;const A=nt.value.length;return kr(Math.min(Ms.end,A),A)});function dk(){if(!Wt.value)return 0;let A=0;const H=pl.value;for(let V=0;V<H.length;V++){if(!H[V])continue;const K=Kt[V];Number.isFinite(K)&&K>0||A++}return A}function fk(){const A=nt.value.length;return{totalNodes:A,measuredCount:wn.count,estimatedCount:dk(),averageNodeHeight:Ts.value,topSpacerHeight:rm.value,bottomSpacerHeight:lm.value,estimatedTotalHeight:kr(0,A),width:hl()}}function Y4(){const A=nt.value,H=fk();return Ot(rt({},H),{probe:{paragraphReady:!!ae.value.paragraph,listItemReady:!!ae.value.listItem,listWrapperOverhead:ae.value.listWrapperOverhead,headingReadyLevels:Object.entries(ae.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:A.map((V,K)=>{var te,ge,Se,xe,Be,$e,ze,He,Ne;return{index:K,type:V.type,estimateKind:(ge=(te=pl.value[K])==null?void 0:te.kind)!=null?ge:null,rendererKind:(xe=(Se=pl.value[K])==null?void 0:Se.rendererKind)!=null?xe:null,estimatedHeight:($e=(Be=pl.value[K])==null?void 0:Be.height)!=null?$e:null,estimatedContentHeight:(He=(ze=pl.value[K])==null?void 0:ze.contentHeight)!=null?He:null,measuredHeight:(Ne=Kt[K])!=null?Ne:null}})})}function am(){return s.indexKey!=null?String(s.indexKey):Zt.value?`virtual-${Hn()}`:"markdown-renderer"}function pk(A){const H=String(A),V=`${am()}-`;if(!H.startsWith(V))return null;const K=H.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const te=Number(K[1]);return!Number.isInteger(te)||te<0||te>=nt.value.length?null:te}function Hn(){var A,H,V;const K=(A=s.virtualScroll)==null?void 0:A.sessionKey;return String(K!=null&&K!==""?K:(V=(H=s.indexKey)!=null?H:b.customId)!=null?V:qt)}function hs(){var A;const H=(A=s.virtualScroll)==null?void 0:A.threadKey;return H==null||H===""?void 0:String(H)}function cm(A){var H;return(A??"")===((H=hs())!=null?H:"")}function Q4(){var A;const H=(A=s.virtualScroll)==null?void 0:A.measurementKey;return H==null?"":String(H)}function X4(){var A,H;const V=u.value,K=V==="monaco"?b.codeBlockMonacoOptions:void 0,te=b.codeBlockProps,ge=V==="shiki";return[b.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",b.codeBlockStream===!1?"code-static":"code-stream",_s(b.codeBlockMinWidth),_s(b.codeBlockMaxWidth),...ge?[Pp((A=te?.themes)!=null?A:b.themes,(H=te?.langs)!=null?H:b.langs)]:[],_s(K?.fontSize),_s(K?.lineHeight),_s(K?.fontFamily),_s(K?.tabSize),_s(K?.MAX_HEIGHT),_s(K?.wordWrap),_s(K?.wrappingIndent),_s(K?.padding),_s(te?.showHeader),_s(te?.showCopyButton),_s(te?.showExpandButton),_s(te?.showPreviewButton),_s(te?.showCollapseButton),_s(te?.showFontSizeButtons)].join("\0")}function Di(){return[Q4(),X4()].join("\0")}function hl(){return Vs()}const Ed=B(()=>Mc(hl())),To=B(()=>[Di(),Ed.value].join("\0")),Z4=B(()=>{var A;return Zt.value?["virtual",(A=hs())!=null?A:"",Hn(),To.value].join("\0"):s.indexKey});function ca(){Zy.value+=1}function um(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=nt.value.length||A.sessionKey!==Hn()||A.threadKey!==hs()||A.layoutEpochKey!==To.value)}function hk(A){const H=String(A),V=wi.get(H);return V?um(V)?V.index:null:pk(H)}function mk(A="async-node"){(xo.size||wi.size)&&(xo.clear(),wi.clear(),ca(),Pn(A))}const ua=Ut(m1,null),dm={reportHeight(A,H){if(!xt.value)return;const V=hk(A);if(V==null)return;const K=_i.get(V);if(!K)return;const te=Number(H),ge=Vy(V,K);qy(V,Number.isFinite(te)&&te>0?Math.max(te,ge||0):ge)},markPending(A){if(!xt.value)return;const H=pk(A);H!=null&&(function(V,K){var te;const ge=wi.get(V);if(ge&&um(ge))return xo.set(V,Math.max(0,(te=xo.get(V))!=null?te:0)+1),ca(),void Pn("async-node");xo.set(V,1),wi.set(V,(function(Se){return{index:Se,sessionKey:Hn(),threadKey:hs(),layoutEpochKey:To.value}})(K)),ca(),Pn("async-node")})(String(A),H)},markSettled(A){if(!xt.value)return;const H=String(A),V=hk(A);(V!=null||(function(K){return xo.has(String(K))})(H))&&(function(K){var te;const ge=(te=xo.get(K))!=null?te:0;return!(ge<=0||(ge<=1?(xo.delete(K),wi.delete(K)):xo.set(K,ge-1),ca(),ge===1&&Pn("async-node"),0))})(H)&&V!=null&&Bi()}};function J4(){let A=0;for(const H of _i.values())A+=vt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=H?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,A))}$n(m1,{reportHeight(A,H){dm.reportHeight(A,H),ua?.reportHeight(A,H)},markPending(A){dm.markPending(A),ua?.markPending(A)},markSettled(A){dm.markSettled(A),ua?.markSettled(A)}});let fm,pm=null,da=null;function Id(A){return A!==!1&&A!=null&&A!==""}function gk(){return Lt.value?(function(){if(!Lt.value)return!0;const A=nt.value.length,H=Es(Ms.start,0,A),V=Es(Ms.end,H,A);if(H>=V)return!0;for(let K=H;K<V;K++)if(!Fn.has(K)||Om(K)&&!_i.has(K))return!1;return!0})():Nt.value>=Sd.value}function hm(){return j.value===!0&&!ee.value&&Zh.value===0&&vr.size===0&&Ri.size===0&&Ao==null&&gk()}function vk(){var A,H;if(((A=s.virtualScroll)==null?void 0:A.settleMode)!=="manual"||pm===Hn()&&fm===hs())return!0;const V=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!Id(V)&&da===zc(V)}function mm(){return hm()&&vk()}function eE(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 ml(A="manual",H){const V=fk(),K=(function(te){return te||(j.value!==!0?nt.value.length>0?"streaming":"estimating":!gk()||Ri.size>0||Ao!=null?"measuring":mm()?"settled":"settling")})(H);return{sessionKey:Hn(),threadKey:hs(),phase:K,nodeCount:V.totalNodes,liveRange:{start:Ms.start,end:Ms.end},renderedCount:Nt.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:J4(),totalHeight:yk(),width:V.width,final:j.value===!0,stable:mm(),confidence:eE(K,V),reason:A}}function Ec(){const A=ai.value||oe(),H=S.value;if(!A||!H)return null;const V=A.ownerDocument||H.ownerDocument||document,K=A===V.documentElement||A===V.body||A===V.scrollingElement,te=vt("getScrollBox.scrollTop",()=>Z(A,V,K)),ge=vt("getScrollBox.scrollHeight",()=>{var xe,Be,$e,ze,He;return K?Math.max((Be=(xe=V.documentElement)==null?void 0:xe.scrollHeight)!=null?Be:0,(ze=($e=V.body)==null?void 0:$e.scrollHeight)!=null?ze:0,(He=A.scrollHeight)!=null?He:0):A.scrollHeight}),Se=vt("getScrollBox.clientHeight",()=>{var xe;return K?((xe=V.documentElement)==null?void 0:xe.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:V,isViewportRoot:K,scrollTop:te,scrollHeight:ge,clientHeight:Se}}function yk(){const A=nt.value.length,H=Math.max(0,kr(0,A)),V=vt("getRendererLogicalHeight.offsetHeight",()=>{var te,ge;return(ge=(te=S.value)==null?void 0:te.offsetHeight)!=null?ge:0}),K=Math.max(0,V>0?V:vt("getRendererLogicalHeight.scrollHeight",()=>{var te,ge;return(ge=(te=S.value)==null?void 0:te.scrollHeight)!=null?ge:0}));return A<=0?Math.ceil(V):Lt.value?H>0?Math.max(1,Math.ceil(H),(function(){let te=rm.value+lm.value;for(const ge of Fn.values())ge&&(te+=Math.max(0,vt("getVirtualizedDomLogicalHeight.offsetHeight",()=>ge.offsetHeight||0)));return Math.ceil(Math.max(0,te))})(),(function(te,ge){return te<=0||ge<=0?0:ge<=te+Math.max(512,.05*te)?Math.ceil(ge):0})(H,K)):Math.max(1,Math.ceil(K)):xt.value?H>0||wn.count>0||dk()>0?(Fe.value&&Nt.value,Math.max(1,Math.ceil(K),Math.ceil(H))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(H))}function kk(A){const H=S.value;if(!H)return null;const V=vt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(te){return te.isViewportRoot?te.clientHeight:vt("getViewportBottomInRoot.getBoundingClientRect",()=>te.root.getBoundingClientRect().bottom)})(A)-V.bottom}function tE(A={}){const H=A.requireViewport!==!1,V=(function(ge=64){const Se=Ec(),xe=S.value;if(!Se||!xe)return!1;const Be=(function(ze){if(ze.isViewportRoot)return{top:0,bottom:ze.clientHeight};const He=vt("getVirtualViewportRect.getBoundingClientRect",()=>ze.root.getBoundingClientRect());return{top:He.top,bottom:He.bottom}})(Se),$e=vt("isRendererNearVirtualViewport.getBoundingClientRect",()=>xe.getBoundingClientRect());return $e.bottom>=Be.top-ge&&$e.top<=Be.bottom+ge})();if(H&&!V)return null;const K=(function(){const ge=Ec(),Se=S.value;if(!ge||!Se||Math.max(0,ge.scrollHeight-ge.scrollTop-ge.clientHeight)>64)return null;const xe=kk(ge);return xe==null?null:xe>=-8&&xe<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,xe)}:null})();if(K)return{anchor:K,captured:!0};const te=Jt();if(te)return{anchor:{type:"node",nodeIndex:te.nodeIndex,offsetWithinNodePx:te.offsetWithinNodePx},captured:V};if(A.allowFallback===!0){const ge=(function(){const Se=nt.value.length;return Se<=0?null:{type:"node",nodeIndex:Es(jo.value,0,Math.max(0,Se-1)),offsetWithinNodePx:0}})();return ge?{anchor:ge,captured:!1}:null}return null}function gm(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 nE(A,H){let V=A;for(let K=0;K<H.length;K++)V^=H.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const sE=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function $d(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(K){const te=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${gm(te)}`})(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 $e=[];for(let ze=0;ze<A.length;ze++)$e.push($d(A[ze],H,V+1));return`a:${A.length}:${$e.join(",")}`}const ge=[],Se=[],xe=Math.max(0,A.length-32);let Be=2166136261;for(let $e=0;$e<A.length;$e++){const ze=$d(A[$e],H,V+1);Be=nE(Be,ze),$e<32&&ge.push(ze),$e>=xe&&Se.push(ze)}return[`a:${A.length}`,`h=${ge.join(",")}`,`t=${Se.join(",")}`,`all=${(Be>>>0).toString(36)}`].join(":")}const K=A,te=Object.keys(K).filter(ge=>{const Se=K[ge];return ge!=="parent"&&ge!=="el"&&ge!=="component"&&(Se==null||typeof Se=="string"||typeof Se=="number"||typeof Se=="boolean"||sE.has(ge))}).sort();return`o:${te.length}:${te.map(ge=>`${ge}=${$d(K[ge],H,V+1)}`).join(";")}`}finally{H.delete(A)}}let bk=-1,vm="";function Ic(A){const H=nt.value[A];return H?gm($d(H)):""}function ym(){const A=Y.value;if(bk===A)return vm;let H=2166136261;for(let V=0;V<nt.value.length;V++){const K=Ic(V);for(let te=0;te<K.length;te++)H^=K.charCodeAt(te),H=Math.imul(H,16777619)}return vm=(H>>>0).toString(36),bk=A,vm}function fa(A,H={}){var V;const K=H.includeHeightCache===!0,te=(V=H.includeContentHash)!=null?V:K,ge=K?(function(xe){const Be=(function(){var Je,wt;const ct=Number((wt=(Je=s.virtualScroll)==null?void 0:Je.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(Be)||xe.length<=Be)return xe;const $e=new Map,ze=Je=>{!Je||$e.size>=Be||$e.set(Je.index,Je)},He=nt.value.length,Ne=Es(Ms.start-2*Ac.value,0,He),We=Es(Ms.end+2*Ac.value,Ne,He);for(const Je of xe)Je.index>=Ne&&Je.index<We&&ze(Je);const Ze=Math.max(1,Math.ceil(xe.length/Be));for(let Je=0;Je<xe.length&&$e.size<Be;Je+=Ze)ze(xe[Je]);for(let Je=xe.length-1;Je>=0&&$e.size<Be;Je-=Ze)ze(xe[Je]);return Array.from($e.values()).sort((Je,wt)=>Je.index-wt.index).slice(0,Be)})(U4().map(xe=>{var Be;const $e=nt.value[xe.index];return $e?Ot(rt({},xe),{nodeType:String((Be=$e.type)!=null?Be:""),signature:Ic(xe.index)}):null}).filter(xe=>!!xe)):[],Se=tE({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Se||ge.length||H.includeEmptyState===!0?Ot(rt({sessionKey:A.sessionKey,threadKey:A.threadKey},Se?{anchor:Se.anchor,anchorCaptured:Se.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:te?ym():void 0,measurementKey:Di()||void 0,heightCache:ge.length?ge:void 0}):null}function km(A){var H,V;const K=Ec();if(!K)return;const te=(function(xe){const Be=S.value;if(!Be)return null;const $e=ue(Be,xe.root),ze=nt.value.length,He=vt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Be.offsetHeight||0),Ne=Math.max(0,He>0?He:ze>0?vt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Be.scrollHeight||0):0),We=yk();return $e+Math.max(Ne,We)})(K);if(te==null)return;const ge=Math.max(0,A.distanceFromBottomPx),Se=Math.max(0,te-K.clientHeight-ge);(function(xe){se=Pc()+120,we=xe})(Se),K.isViewportRoot?(V=(H=K.doc.defaultView)==null?void 0:H.scrollTo)==null||V.call(H,0,Se):T2(K.root,K.doc,Se,{isReverseFlexScrollRoot:W,getNormalizedScrollTop:Z})}const bm=[];function _k(){if(X)for(Pi!=null&&(st?.(Pi),Pi=null);bm.length;){const A=bm.pop();A!=null&&window.clearTimeout(A)}}function pa(A){const H=!!Ks.value;Ks.value=null,se=0,we=null,_k(),H&&A&&Pn(A)}function ha(){if(!Ks.value||!X||Pi!=null)return;const A=()=>{Pi=null;const H=Ks.value;H&&km(H)};Pi=et?et(A):null,Pi==null&&A()}function wk(A,H={}){const V=nt.value.length;return V<=0?[]:A.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(H.requireSignature&&!K.signature)&&!(H.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(te){var ge;const Se=nt.value[te.index];return!(!Se||te.nodeType&&te.nodeType!==String((ge=Se.type)!=null?ge:"")||te.signature&&te.signature!==Ic(te.index))})(K))}function Sk(A){const H=Mc(hl()),V=Mc(A);return H!==-1&&V!==-1&&H===V}function _m(A){var H;const V=Number(A?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((H=A?.metrics)==null?void 0:H.width);return Number.isFinite(K)&&K>0?K:null}function Ck(A){var H;return A.sessionKey===Hn()&&!!cm(A.threadKey)&&((H=A.measurementKey)!=null?H:"")===Di()&&!!Sk(_m(A))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(xk(V)?K.some(te=>!!(te.nodeType||te.signature)):K.some(te=>!!te.signature))})(A)}function xk(A){return!!(A.contentHash&&A.contentHash===ym())}function oE(A){return!xk(A)}let gl=null,vl=null,Nd=null,$c=null,Nc=null;function wm(A){var H;const V=A.map(te=>{var ge,Se;return[te.index,Math.round(10*te.height),(ge=te.nodeType)!=null?ge:"",(Se=te.signature)!=null?Se:""].join("")}).join(""),K=Mc(hl());return[(H=hs())!=null?H:"",Hn(),Di(),nt.value.length,K,A.length,gm(V)].join(":")}function Ak(A=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!xt.value||!A?.length||nt.value.length<=0||!Sk((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const V=wk(A,{requireSignature:!0});if(!V.length)return!1;const K=wm(V);return K===gl?(vl="standalone",!0):(Ky(V,{mode:"merge"}),qo(),gl=K,vl="standalone",Dc(),Pn("restore"),!0)}function Sm(A,H={}){var V,K,te;if(!xt.value||!A||A.sessionKey!==Hn()||!cm(A.threadKey)||nt.value.length<=0)return!1;const ge=!!((V=A.heightCache)!=null&&V.length)&&!Ld(),Se=!A.anchor||A.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:A.anchor,xe=H.restoreAnchor===!0&&!!Se&&!Ld()&&Number(_m(A))>0;let Be=!1;if((K=A.heightCache)!=null&&K.length&&Ck(A)){const ze=wk(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:oE(A)});ze.length&&(Ky(ze,{mode:"merge"}),qo(),gl=wm(ze),vl="restore",Dc(),Be=!0)}if(ge||xe)return!1;if(!H.restoreAnchor||!Se)return Be&&Pn("restore"),!0;const $e=(function(ze,He){var Ne;const We=ze.anchor,Ze=We?We.type==="bottom"?`bottom:${Math.round(We.distanceFromBottomPx)}`:`node:${We.nodeIndex}:${Math.round(We.offsetWithinNodePx)}`:"none";return[(Ne=hs())!=null?Ne:"",Hn(),Di(),Ed.value,He,Ze].join(":")})(A,(te=H.restoreToken)!=null?te:"imperative");return Nd===$e?(Be&&Pn("restore"),!0):(Nd=$e,(function(ze){const He=()=>{if(ze.type==="node")return pa(),void As({nodeIndex:ze.nodeIndex,offsetWithinNodePx:ze.offsetWithinNodePx});if(Mt(),Ce.value=null,Ks.value=ze,_k(),km(ze),X)for(const Ne of[0,120,280,480])bm.push(window.setTimeout(()=>{const We=Ks.value;We&&km(We)},Ne))};(function(Ne){if(!Lt.value)return!1;const We=nt.value.length;return!(We<=0||(jo.value=Ne.type==="node"?Es(Ne.nodeIndex,0,We-1):We-1,dl(),0))})(ze)?gt(He):He()})(Se),Pn("restore"),!0)}function Ld(){const A=hl();return Number.isFinite(A)&&A>0}function Tk(A){var H;return A.sessionKey===Hn()&&!!cm(A.threadKey)&&(nt.value.length<=0||!(!((H=A.heightCache)!=null&&H.length)||Ld())||!(!(A.anchor&&Number(_m(A))>0)||Ld()))}function Cm(){xs.clear();for(const A of Object.keys(Kt)){const H=Number(A);Number.isInteger(H)&&H>=0&&H<nt.value.length&&jy(H)}}function Lc(){Ao!=null&&(st?.(Ao),Ao=null),Pm()}function Mk(){return!X||Uo?Promise.resolve():new Promise(A=>{let H=!1,V=null;const K=()=>{H||(H=!0,V!=null&&window.clearTimeout(V),A())};if(et)return et(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function xm(A,H=hs(),V=To.value){return Hn()===A&&hs()===H&&To.value===V}function Am(){return Un(this,arguments,function*(A={}){var H,V,K,te,ge;const Se=Hn(),xe=hs(),Be=To.value,$e=(H=A.frames)!=null?H:2,ze=(V=A.timeoutMs)!=null?V:120,He=(K=A.reason)!=null?K:"manual",Ne=A.expectedSettledTokenKey,We=A.flushPendingTimers===!0,Ze=ml(He),Je=()=>Ot(rt({},Ze),{phase:Ze.final?"settling":Ze.phase,stable:!1,confidence:Ze.confidence==="final"?"mixed":Ze.confidence,reason:He}),wt=()=>xm(Se,xe,Be)&&(Ne==null||Rc()===Ne);for(let St=0;St<$e;St++){if(yield gt(),!wt()||(yield Mk(),!wt()))return Je();Bi(),Lc()}if(yield(function(St){return!X||St<=0?Promise.resolve():new Promise(sn=>window.setTimeout(sn,St))})(ze),!wt()||(We&&nk(),Bi(),Lc(),!wt()))return Je();const ct=hm();ct&&(pm=Se,fm=xe,((te=s.virtualScroll)==null?void 0:te.settleMode)==="manual"&&Ne!=null&&Id((ge=s.virtualScroll)==null?void 0:ge.settledToken)&&Rc()===Ne&&(da=zc(s.virtualScroll.settledToken)));const ut=wt()&&ct&&vk(),Ct=ml(He,ut?"final":void 0);return $m(Ct,!0),Ct})}let Tm="content",yl=null,kl=null,Mm=0,Oc=null,ma=null,Em=null,Im=null;function Pc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Ek(A){var H,V;const K=Oc;if(!K)return!0;const te=(V=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?V:1;return Math.abs(A.totalHeight-K.totalHeight)>te||A.sessionKey!==K.sessionKey||A.phase!==K.phase||A.stable!==K.stable||A.final!==K.final||A.threadKey!==K.threadKey||A.nodeCount!==K.nodeCount||A.measuredCount!==K.measuredCount||A.width!==K.width}function _s(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 Rc(A=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return _s(A)}function Ik(A,H){var V,K;return[A,H.sessionKey,(V=H.threadKey)!=null?V:"",Di(),ym(),_s((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Dc(){Em=null,Im=null,ma=null}function iE(A){const H=A.heightCache;return H?.length?wm(H):""}function Bc(A){var H,V,K;const te=A.metrics,ge=A.anchor?(Se=A.anchor).type==="bottom"?`bottom:${Math.round(Se.distanceFromBottomPx)}`:`node:${Se.nodeIndex}:${Math.round(Se.offsetWithinNodePx)}`:"none";var Se;return[A.sessionKey,(H=A.threadKey)!=null?H:"",(V=A.measurementKey)!=null?V:Di(),(K=A.contentHash)!=null?K:"",iE(A),ge,A.anchorCaptured?1:0,te.liveRange.start,te.liveRange.end,te.renderedCount,te.nodeCount,Math.round(te.totalHeight),Math.round(te.width),te.phase,te.stable?1:0].join("\0")}function $m(A,H=!1){if(!xt.value||(function(Se=!1){return!Se&&Zt.value&&!Yn.value})(H))return;const V=H||Ek(A),K=(function(Se,xe=!1){return xe||Se.stable||Se.phase==="final"?{state:fa(Se,{includeHeightCache:!0})}:{state:fa(Se)}})(A,H),te=K.state,ge=!!(te&&(V||(function(Se,xe=!1){return!!xe||Bc(Se)!==ma})(te,H)));if(V&&(M(A),Oc=A,Mm=Pc()),te&&ge&&(I(te),te.anchor&&L(te.anchor),ma=Bc(te)),A.stable){const Se=Ik("settled",A);if(Se!==Em){Em=Se;const xe=fa(A,{includeHeightCache:!0});xe&&(I(xe),ma=Bc(xe)),(function(Be){o("render-settled",Be)})(A)}}if(A.phase==="final"){const Se=Ik("final",A);if(Se!==Im){Im=Se;const xe=fa(A,{includeHeightCache:!0});xe&&(I(xe),ma=Bc(xe)),(function(Be){o("render-final",Be)})(A)}}}function Nm(){yl!=null&&(st?.(yl),yl=null),kl!=null&&X&&(window.clearTimeout(kl),kl=null)}function $k(){yl=null,kl=null,(function(A){if(Ri.size>0||Ao!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Tm)&&(Bi(),Lc()),$m(ml(Tm))}function Pn(A){var H,V;if(!xt.value||(Tm=A,yl!=null||kl!=null))return;const K=Math.max(0,(V=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?V:32),te=Math.max(0,K-(Pc()-Mm)),ge=()=>{kl=null,yl=et?et($k):null,yl==null&&$k()};X&&te>0?kl=window.setTimeout(ge,te):ge()}function Lm(A){var H;if(A<=0)return 0;const V=nt.value;if(Wt.value)return uk(A);if(On.value===V.length&&ks.value.length&&bs.value.length){const te=Ts.value,ge=ks.value,Se=bs.value,xe=He=>He<=0?0:bd(ge,0,He)+(He-bd(Se,0,He))*te;let Be=0,$e=V.length-1,ze=V.length-1;for(;Be<=$e;){const He=Be+$e>>1;xe(He+1)>=A?(ze=He,$e=He-1):Be=He+1}return ze}let K=A;for(let te=0;te<V.length;te++){const ge=(H=Kt[te])!=null?H:Ts.value;if(K<=ge)return te;K-=ge}return Math.max(0,V.length-1)}function Nk(){ia.value+=1}function Om(A){return!(Fe.value&&A>=Nt.value)&&(!mr.value||A<Ee.value||tm.value.has(A))}function ga(A){const H=Ad.get(A);H&&(H(),Ad.delete(A));const V=la.get(A);V&&(V.destroy(),la.delete(A)),Td(A)}function Lk(A,H){let V=!1;if(H){const ge=Fn.get(A);Fn.set(A,H),ge!==H&&(V=!0)}else Fn.delete(A)&&(V=!0);if(V&&Nk(),H||Td(A),!Gy.value||!Ye||!Lt.value&&mr.value&&!U.value&&la.size>=640&&(U.value||(U.value=!0,nm()),!Gy.value||!Ye))return ga(A),void(H&&yr(A,!0));if(A<Ee.value&&!Lt.value||tm.value.has(A))return ga(A),void yr(A,!0);if(!H)return void ga(A);ga(A);const K=Ye(H,{rootMargin:"400px"});if(!K)return;la.set(A,K),yr(A,K.isVisible.value),mr.value&&(function(ge){if(!X||!mr.value)return;Td(ge);const Se=ge%17*23,xe=window.setTimeout(()=>{if(sk.delete(ge),!mr.value||tm.value.has(ge))return;const Be=Fn.get(ge);if(!Be)return;const $e=oe(Be),ze=Be.ownerDocument||document,He=ze.defaultView||window,Ne=!$e||$e===ze.documentElement||$e===ze.body,We=!Ne&&$e?vt("nodeVisibilityFallback.root.getBoundingClientRect",()=>$e.getBoundingClientRect()):null,Ze=Ne?0:We.top,Je=Ne?vt("nodeVisibilityFallback.clientHeight",()=>{var ct,ut;return(ut=(ct=He.innerHeight)!=null?ct:$e?.clientHeight)!=null?ut:0}):We.bottom,wt=vt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Be.getBoundingClientRect());wt.bottom>=Ze-500&&wt.top<=Je+500&&yr(ge,!0)},1800+Se);sk.set(ge,xe)})(A);let te=null;te=Ve(()=>K.isVisible.value,ge=>{if(ge){Td(A),yr(A,!0),te?.(),Ad.delete(A),la.get(A)===K&&la.delete(A);try{K.destroy()}catch{}}},{immediate:!0}),Ad.set(A,te),Lt.value&&Si()}function Pm(){Ao=null;for(const[A,H]of Ri)Ri.delete(A),_i.get(A)===H.el&&fl.get(A)===H.version&&qy(A,H.height,{allowShrink:H.allowShrink})}function va(){Ao!=null&&(st?.(Ao),Ao=null),Ri.clear()}function Od(A,H){(function(V,K,te){var ge;if(!Number.isFinite(te)||te<=0||_i.get(V)!==K)return;const Se=fl.get(V);if(Se==null)return;const xe=nt.value[V],Be=ee.value&&j.value!==!0&&!((ge=s.nodes)!=null&&ge.length)&&V>=nt.value.length-2,$e=!(xe?.loading===!0||Be),ze=Ri.get(V),He=ze?ze.allowShrink&&$e:$e,Ne=ze&&!He?Math.max(ze.height,te):te;Ri.set(V,{height:Ne,allowShrink:He,version:Se,el:K}),Ao==null&&(Ao=et?et(Pm):null,Ao==null&&Pm())})(A,H,Vy(A,H))}function Bi(){for(const[A,H]of _i)H&&Od(A,H)}function Ok(){Le?.disconnect(),Le=null,ft.clear()}function Rm(){for(;wd.length;)xd(wd.pop())}Ve(Yn,A=>{A&&Pn("content")},{flush:"post"}),t({getVirtualMetrics:ml,captureVirtualState:function(A={}){var H;return fa(ml("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,K=H.restoreToken==null?"imperative":String(H.restoreToken);$c=A,Nc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!Sm(A,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&Tk(A)||($c=null,Nc=null)},forceMeasure:function(A="manual"){return Un(this,null,function*(){yield gt(),yield Mk(),Bi(),Lc(),yield gt();const H=ml(A);return $m(H,!0),H})},settle:Am,scrollToNode:function(A,H="start"){pa(),Mt();const V=nt.value.length;if(V<=0)return;const K=Es(A,0,V-1),te=()=>{var ge;const Se=at({nodeIndex:K,offsetWithinNodePx:0}),xe=Md(K),Be=Ec(),$e=(ge=Be?.clientHeight)!=null?ge:0,ze=De();let He=Se;if(H==="center")He=Se-$e/2+xe/2;else if(H==="end")He=Se-$e+xe;else if(H==="nearest"&&ze!=null){if(Se>=ze&&Se+xe<=ze+$e)return;He=Se<ze?Se:Se-$e+xe}ot(Math.max(0,He)),Si({immediate:!0}),Lt.value&&(jo.value=K,dl())};if(Lt.value)return jo.value=K,dl(),void gt(te);te()}}),Ve(()=>Wo.value,A=>{if(!A){Ok();for(const H of gr.values())for(const V of H)xd(V);gr.clear(),fl.clear(),Rm(),va()}},{immediate:!0}),Ve(j,A=>{A&&(function(){if(X&&j.value&&_i.size){Rm();for(const H of[80,240,640]){const V=tk(H,()=>{for(const[K,te]of _i)te&&Od(K,te)},"final");V!=null&&wd.push(V)}}})(),Pn(A?"final":"content")}),Ve([()=>nt.value.length,()=>Nt.value],()=>{Ks.value&&ha(),Pn("content")},{flush:"post",immediate:!0}),Ve([()=>Ms.start,()=>Ms.end],()=>{Pn("batch")},{flush:"post"});const{cleanupBatchScheduler:rE}=(function(A){const{props:H,isClient:V,isTestEnv:K,parsedNodesIdentity:te,parsedNodeCount:ge,desiredRenderedCount:Se,datasetKey:xe,batchingEnabled:Be,incrementalRenderingActive:$e,resolvedBatchSize:ze,resolvedInitialBatch:He,renderedCount:Ne,adaptiveBatchSize:We,previousRenderContext:Ze,previousBatchConfig:Je,requestFrame:wt,cancelFrame:ct,hasIdleCallback:ut,cleanupNodeVisibility:Ct,onDatasetKeyChanged:St,onDatasetChanged:sn}=A;let At=null,Ht=null,Ft=!1,pn=null,Mo=null,Gs=0,ci=!1,br=!1;const _r=new Set,_l=new Set;function Zk(){if(V){At!=null&&(ct?.(At),At=null),Ht!=null&&(window.clearTimeout(Ht),Ht=null),Mo!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Mo),Mo=null),Gs+=1;for(const Bs of _r)ct?.(Bs);_r.clear();for(const Bs of _l)window.clearTimeout(Bs);_l.clear(),Ft=!1,pn=null,ci=!1,br=!1}}function Wd(){return typeof performance<"u"?performance.now():Date.now()}function Jk(Bs){(function(Fi){var wr;if(!$e.value)return;const Hi=Math.max(2,(wr=H.renderBatchBudgetMs)!=null?wr:6),Wi=Math.max(1,ze.value||1),ui=Math.max(1,Math.floor(Wi/4));Fi>1.2*Hi?We.value=Math.max(ui,Math.floor(.7*We.value)):Fi<.5*Hi&&We.value<Wi&&(We.value=Math.min(Wi,Math.ceil(1.2*We.value)))})(Bs),ci=!1;const fo=br||Ne.value<Se.value;br=!1,fo&&nb()}function eb(Bs,fo={}){var Fi,wr;if(!$e.value)return;const Hi=Se.value;if(Ne.value>=Hi)return;const Wi=Math.max(1,Bs),ui=()=>{const ba=Wd();let _a=0;At=null,Ht=null,Mo=null,Ft=!1;const wa=pn??Wi;pn=null;const jm=Wd();Ne.value=Math.min(Hi,Ne.value+wa),Ct(Ne.value),_a=Wd()-jm,(function(qm,sb){if(!V)return void Jk(sb);ci=!0;const ob=++Gs;gt().then(()=>{var ib;if(ob!==Gs)return;const AE=Wd(),TE=Math.max(sb,AE-qm),rb=()=>{ob===Gs&&Jk(TE)};if(wt){let ab=!1,zi=null;const cb=()=>{ab||(ab=!0,rb())},zd=wt(()=>{_r.delete(zd),zi!=null&&(window.clearTimeout(zi),_l.delete(zi),zi=null),cb()});return _r.add(zd),zi=window.setTimeout(()=>{zi!=null&&_l.delete(zi),zi=null,ct?.(zd),_r.delete(zd),cb()},Math.max(32,(ib=H.renderBatchIdleTimeoutMs)!=null?ib:120)),void _l.add(zi)}const lb=window.setTimeout(()=>{_l.delete(lb),rb()},0);_l.add(lb)})})(ba,_a)};if(!V||fo.immediate)return void ui();const Sr=Math.max(0,(Fi=H.renderBatchDelay)!=null?Fi:16);if(pn=pn!=null?Math.max(pn,Wi):Wi,!Ft){if(Ft=!0,!K&&ut&&window.requestIdleCallback){const ba=Math.max(0,(wr=H.renderBatchIdleTimeoutMs)!=null?wr:120);return void(Mo=window.requestIdleCallback(()=>ui(),{timeout:ba}))}wt&&!K?At=wt(()=>{Sr!==0?Ht=window.setTimeout(()=>ui(),Sr):ui()}):Ht=window.setTimeout(()=>ui(),Sr)}}function tb(Bs,fo={}){ci?br=!0:Bs==null?nb():eb(Bs,fo)}function nb(){$e.value&&eb(Be.value?Math.max(1,Math.round(We.value)):Math.max(1,ze.value))}return Ve([te,ge,xe,$e,ze,He,()=>H.renderBatchDelay],()=>{var Bs;const fo=ge.value,Fi=Ze.value,wr=xe.value,Hi=!Object.is(wr,Fi.key),Wi=fo!==Fi.total,ui=Hi||Wi;Ze.value={key:wr,total:fo};const Sr=Je.value,ba=(Bs=H.renderBatchDelay)!=null?Bs:16,_a=Sr.batchSize!==ze.value||Sr.initial!==He.value||Sr.delay!==ba||Sr.enabled!==$e.value;Je.value={batchSize:ze.value,initial:He.value,delay:ba,enabled:$e.value},Hi&&St(fo),(ui||_a||!$e.value)&&Zk(),(ui||_a)&&(We.value=Math.max(1,ze.value||1)),ui&&sn();const wa=Se.value;if(!fo)return Ne.value=0,void Ct(0);if(!$e.value)return Ne.value=wa,void Ct(Ne.value);const jm=Hi||Fi.total===0;Ne.value=jm||_a?Math.min(wa,He.value):Math.min(Ne.value,wa);const qm=Math.max(1,He.value||ze.value||fo);Ne.value<wa?tb(qm,{immediate:!V}):Ct(Ne.value)},{immediate:!0}),Ve(Se,(Bs,fo)=>{$e.value&&(typeof fo=="number"&&Bs<=fo||Bs>Ne.value&&tb())}),{cleanupBatchScheduler:Zk}})({props:b,isClient:X,isTestEnv:Uo,parsedNodesIdentity:is,parsedNodeCount:Vn,desiredRenderedCount:Sd,datasetKey:Z4,batchingEnabled:Ae,incrementalRenderingActive:Fe,resolvedBatchSize:Oi,resolvedInitialBatch:Ee,renderedCount:Nt,adaptiveBatchSize:ts,previousRenderContext:zt,previousBatchConfig:Qn,requestFrame:et,cancelFrame:st,hasIdleCallback:Bt,cleanupNodeVisibility:V4,onDatasetKeyChanged:A=>{va(),_d(),qo(),Dc(),A>0&&kd(A)},onDatasetChanged:()=>{Lt.value&&Si({immediate:!0})}});Ve([Yy,Lt,()=>S.value,()=>de()],([A,H])=>{if(!A)return ok(),void em();K4(),H?Si({immediate:!0}):em()},{flush:"post",immediate:!0}),Ve([()=>nt.value.length,()=>Lt.value],A=>Un(null,[A],function*([H,V]){V&&H&&X&&(yield gt(),Si({immediate:!0}))}),{flush:"post"}),Ve(Wt,A=>{A&&(function(){var H;if(Kn.value&&Yt.value&&Gn.value&&((H=Ke.value)!=null&&H[1]))return;const V=Wr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Wr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),te=Wr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});Kn.value=V,Yt.value=K,Gn.value=te;const ge={1:null,2:null,3:null,4:null,5:null,6:null};for(let Se=1;Se<=6;Se++)ge[Se]=Wr({type:"heading",level:Se,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Se)} Probe heading`});Ke.value=ge})()},{immediate:!0}),Ve([()=>S.value,Wt],()=>{if(!Wt.value)return om(),void(q.value=0);rk(),om(),Wt.value&&S.value&&typeof ResizeObserver<"u"&&(Tc=new ResizeObserver(()=>{rk(),Ce.value&&nn(),Ks.value&&ha(),Pn("resize")}),Tc.observe(S.value))},{immediate:!0}),Ve([Wt,co,To],()=>Un(null,null,function*(){if(!Wt.value)return ae.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void qo();yield gt(),(function(){if(!Wt.value||typeof window>"u")return ae.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void qo();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=ik(sm(E.value),".paragraph-node");A.paragraph=Qg(E.value,H,"pre-wrap");const V=sm(R.value),K=V?.querySelector(".paragraph-node");A.listItem=Qg(R.value,K,"pre-wrap");const te=vt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Se,xe;return(xe=(Se=D.value)==null?void 0:Se.offsetHeight)!=null?xe:0}),ge=vt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Se,xe;return(xe=(Se=R.value)==null?void 0:Se.offsetHeight)!=null?xe:0});A.listWrapperOverhead=Math.max(0,te-ge);for(let Se=1;Se<=6;Se++){const xe=ik(sm(F[Se]),`h${Se}`);A.headings[Se]=Qg(F[Se],xe,"pre-wrap")}ae.value=A,qo()})()}),{flush:"post",immediate:!0}),Ve(()=>nt.value.length,()=>{Lt.value&&Si({immediate:!0})}),Ve([Wt,q],()=>{qo(),Lt.value&&Si({immediate:!0}),Ce.value&&nn(),Ks.value&&ha(),Pn("resize")},{immediate:!1}),Ve(()=>mr.value,A=>{if(A)for(const[H,V]of Fn)Lk(H,V);else{nm();for(const[H,V]of Fn)V&&yr(H,!0)}},{immediate:!1}),Ve([()=>b.viewportPriority,()=>nt.value.length],([A,H])=>{A!==!1?U.value&&H<=200&&(U.value=!1):U.value=!1}),Ve(()=>Nt.value,()=>{Lt.value&&Si({immediate:!0})}),Ve([jo,uo,Ac,()=>nt.value.length,Lt],()=>{dl()},{immediate:!0});let Fc=null,Hc=!1,ya=null;function Wc(){Fc=null,pm=null,fm=void 0,da=null,Dc()}function Dm(){va(),_d(),qo(),xs.clear();const A=nt.value.length;A>0&&kd(A),Cm()}function Bm(){Nm(),nk(),Oc=null,gl=null,vl=null,Nd=null,$c=null,Nc=null,Hc=!1,Wc(),mk("restore"),Mt(),pa()}function zc(A){var H;return[(H=hs())!=null?H:"",Hn(),Di(),Ed.value,Rc(A),nt.value.length,Math.round(kr(0,nt.value.length)),Math.round(hl()),wn.count,Math.round(wn.total)].join(":")}function Pk(){return Un(this,null,function*(){var A,H,V,K;const te=(A=s.virtualScroll)==null?void 0:A.settledToken,ge=Rc(te),Se=Hn(),xe=hs(),Be=To.value;if(xt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&Id(te))if(hm()){if(zc(te)!==da&&!Hc){Hc=!0;try{const $e=yield Am({reason:"manual",expectedSettledTokenKey:ge}),ze=Rc()===ge;xm(Se,xe,Be)&&$e.sessionKey===Se&&$e.threadKey===xe&&ze&&$e.stable&&$e.phase==="final"&&(da=zc((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{Hc=!1,yield gt();const $e=(K=s.virtualScroll)==null?void 0:K.settledToken,ze=Id($e)?zc($e):"";xm(Se,xe,Be)&&ze&&da!==ze&&Pk()}}}else Pn("manual")})}Ve(xt,(A,H)=>{if(A!==H){if(!A)return Bm(),void Nm();Bm(),Dm(),ya=To.value,Pn("content")}},{flush:"post"}),Ve([xt,To],([A,H])=>{A?ya!=null?ya!==H&&(ya=H,(function(V="resize"){va(),_d(),qo(),xs.clear();const K=nt.value.length;K>0&&kd(K),Cm(),gl=null,vl=null,Nd=null,Oc=null,Hc=!1,Wc(),Ak(),gt(()=>{Bi(),Ce.value&&nn(),Ks.value&&ha(),Pn(V)})})("resize")):ya=H:ya=null},{flush:"post",immediate:!0}),Ve([xt,()=>Hn(),()=>hs()],([A])=>{A&&(Bm(),Dm(),mk("content"),Pn("content"))}),Ve([xt,()=>Hn(),()=>hs(),To,()=>nt.value.length],([A])=>{A&&(function(H="async-node"){let V=!1;for(const[K,te]of Array.from(wi.entries()))um(te)||(wi.delete(K),xo.delete(K),V=!0);V&&(ca(),Pn(H))})("async-node")},{flush:"post"}),Ve([xt,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>s.indexKey,()=>Y.value],([A])=>{A&&(Dc(),(function(H="content"){if(!xt.value)return;const V=[],K=nt.value.length;for(const te of Array.from(xs.keys())){if(te>=K){V.push(te);continue}const ge=Ic(te),Se=xs.get(te);Se!=null&&Se!==ge&&V.push(te),xs.set(te,ge)}for(const te of Array.from(xs.keys()))te>=K&&xs.delete(te);V.length&&((function(te,ge={}){const Se=Array.from(te,Number);z4(Se,ge)>0&&(function(Be){for(const $e of Be)xs.delete($e)})(Se)})(V,{notify:!1}),qo(),Wc(),Ce.value&&nn(),Ks.value&&ha(),Pn(H))})("content"))},{flush:"post",immediate:!0}),Ve([xt,()=>nt.value.length,()=>Hn(),()=>hs()],([A,H,V,K],[te,ge,Se,xe])=>{A&&te&&V===Se&&K===xe&&H!==ge&&Wc()},{flush:"post"}),Ve([xt,()=>{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},()=>nt.value.length,()=>Hn(),q],()=>{Ak()},{flush:"post",immediate:!0}),Ve([xt,()=>{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},()=>nt.value.length,()=>Hn(),q],A=>Un(null,[A],function*([H,V]){if(!H||!V)return;yield gt();const K=(function(){var te;const ge=(te=s.virtualScroll)==null?void 0:te.restoreAnchor;return ge==null||ge===!1?null:ge===!0?"true":String(ge)})();Sm(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ve([xt,q,()=>{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&&gl&&vl==="restore"&&(Ck(V)||(Dm(),gl=null,vl=null,Pn("resize")))},{flush:"post"}),Ve([xt,()=>nt.value.length,()=>Hn(),q],A=>Un(null,[A],function*([H]){var V;const K=$c,te=Nc;H&&K&&(yield gt(),!Sm(K,{restoreAnchor:te?.restoreAnchor===!0,restoreToken:(V=te?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:te?.allowUncapturedAnchor===!0})&&Tk(K)||($c=null,Nc=null))}),{flush:"post",immediate:!0}),Ve([xt,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>Hn(),()=>hs(),To,Zh,Xy,()=>Nt.value,Sd,()=>wn.count,()=>wn.total],([A,H,V])=>{if(!A||H!==!0||V==="manual"||!mm())return;const K=(function(){var te;const ge=nt.value.length;return[(te=hs())!=null?te:"",Hn(),Di(),Ed.value,ge,Math.round(kr(0,ge)),Math.round(hl()),wn.count,Math.round(wn.total)].join(":")})();Fc!==K&&(Fc=K,Am({reason:"final"}).then(te=>{te.stable||Fc!==K||(Fc=null)}))},{flush:"post",immediate:!0}),Ve([xt,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settledToken},()=>Hn(),()=>hs(),To,Zh,Xy,()=>Nt.value,Sd,()=>nt.value.length,()=>wn.count,()=>wn.total],()=>{Pk()},{flush:"post",immediate:!0}),Ve([()=>nt.value.length,Lt,uo,Ac,()=>Ms.start,()=>Ms.end],([A,H,V,K,te,ge])=>{Oe.value&&Me("virtualization",{nodes:A,virtualization:H,maxLiveNodes:V,buffer:K,focusIndex:jo.value,scroll:H?(()=>{const Se=ai.value||oe();return Se?{reverse:W(Se),scrollTop:Math.round(Se.scrollTop),scrollTopAbs:Math.round(Math.abs(Se.scrollTop)),scrollHeight:Math.round(Se.scrollHeight),clientHeight:Math.round(Se.clientHeight)}:null})():null,liveRange:{start:te,end:ge},rendered:Nt.value})}),Ve([()=>b.customId],([A],H,V)=>{if(!A||Qe)return;const K=(function(te,ge){return te?(ms.controllers[te]=ge,()=>{ms.controllers[te]===ge&&delete ms.controllers[te]}):()=>{}})(A,{captureRestoreAnchor:Jt,restoreAnchor:As,getAnchorDrift:hr,getReport:Y4});V(()=>{K()})},{immediate:!0}),ds(()=>{(function(){if(xt.value)try{Bi(),Lc();const A=ml("manual");Ek(A)&&(M(A),Oc=A,Mm=Pc());const H=fa(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(I(H),H.anchor&&L(H.anchor),ma=Bc(H))}catch{}})(),rE(),nm(),Ie(),Ok();for(const A of gr.values())for(const H of A)xd(H);gr.clear(),fl.clear(),xs.clear(),Rm(),va(),om(),Mt(),pa(),Nm(),ok(),em()});const lE=hi({loader:()=>Un(null,null,function*(){try{return(yield eo(()=>import("./index11-C8YlETLm.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),Eo}}),loadingComponent:oG,delay:0}),aE=hi({loader:()=>Un(null,null,function*(){try{return(yield eo(()=>import("./index10-09ZlQIpo.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),Eo}}),loadingComponent:sG,delay:0}),cE=hi(()=>Un(null,null,function*(){try{return(yield eo(()=>import("./index7-E3VgrKiQ.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),Eo}})),Rk={text:Jn,paragraph:ql,heading:Fp,code_block:zg,list:lc,list_item:rc,blockquote:Bf,table:Mu,definition_list:Ff,footnote:Hf,footnote_reference:Ro,footnote_anchor:Au,admonition:jf,vmr_container:zf,hardbreak:Yr,link:ro,image:Gr,thematic_break:Wf,math_inline:ki,math_block:c3,strong:oo,emphasis:lo,strikethrough:io,highlight:Bo,insert:wo,subscript:_o,superscript:bo,emoji:ko,checkbox:Po,checkbox_input:Po,inline_code:qs,html_inline:Do,reference:so,html_block:Tu},uE=B(()=>am()),Dk=B(()=>A2(b.codeBlockProps)),dE=B(()=>A2(b.codeBlockProps,{omit:["langs"]})),Bk=B(()=>rt(rt({stream:b.codeBlockStream,darkTheme:b.codeBlockDarkTheme,lightTheme:b.codeBlockLightTheme,monacoOptions:b.codeBlockMonacoOptions,themes:b.themes,langs:u.value==="shiki"?b.langs:void 0,minWidth:b.codeBlockMinWidth,maxWidth:b.codeBlockMaxWidth},typeof je.value=="boolean"?{showTooltips:je.value}:{}),dE.value)),Fk=B(()=>rt(Ot(rt({},Bk.value),{langs:b.langs}),Dk.value));function Hk(A){return typeof A=="boolean"?A:void 0}const fE=B(()=>{const A=b.codeBlockProps||{},H={},V=Hk(A.showLineNumbers);V!==void 0&&(H.showLineNumbers=V);const K=Hk(A.diffInline);K!==void 0&&(H.diffInline=K);const te=(function(ge){const Se=Number(ge);return Number.isFinite(Se)&&Se>0?Se:void 0})(A.reservedHeightPx);return te!==void 0&&(H.reservedHeightPx=te),H}),pE=B(()=>rt(rt({stream:b.codeBlockStream,darkTheme:b.codeBlockDarkTheme,lightTheme:b.codeBlockLightTheme,themes:b.themes,langs:b.langs,minWidth:b.codeBlockMinWidth,maxWidth:b.codeBlockMaxWidth},typeof je.value=="boolean"?{showTooltips:je.value}:{}),Dk.value)),hE=B(()=>rt({},b.mermaidProps||{})),Wk=B(()=>rt({},b.d2Props||{})),mE=B(()=>rt({},b.infographicProps||{})),Uc=B(()=>({typewriter:b.typewriter,fade:b.fade,customHtmlTags:Ds.value.customHtmlTags})),gE=B(()=>rt(rt({},Uc.value),typeof je.value=="boolean"?{showTooltip:je.value}:{})),vE=B(()=>rt(rt({},Uc.value),typeof je.value=="boolean"?{showTooltips:je.value}:{})),yE=B(()=>rt(rt({},Uc.value),typeof je.value=="boolean"?{showTooltips:je.value}:{})),kE=B(()=>rt(rt({},Uc.value),typeof je.value=="boolean"?{showTooltips:je.value}:{}));function bE(A){return Array.isArray(A.children)&&A.children.length>0}const Fm=B(()=>G4.value.map(A=>{var H,V,K,te,ge,Se,xe,Be;let $e=(function(ct){var ut,Ct,St,sn,At,Ht,Ft;if(ct.type!=="code_block")return ct;const pn=ct,Mo=[String((ut=pn.language)!=null?ut:""),String((Ct=pn.loading)!=null?Ct:""),String((St=pn.diff)!=null?St:""),String((sn=pn.code)!=null?sn:""),String((At=pn.originalCode)!=null?At:""),String((Ht=pn.updatedCode)!=null?Ht:""),String((Ft=pn.raw)!=null?Ft:"")].join("\0"),Gs=Mn.get(pn);if(Gs&&Gs.signature===Mo)return Gs.node;const ci=rt({},pn);return Mn.set(pn,{signature:Mo,node:ci}),ci})(A.node);const ze=Pd($e);let He=qk($e,ze);if(($e.type==="html_block"||$e.type==="html_inline")&&He===Rk[$e.type]){const ct=$e,ut=String((H=ct.tag)!=null?H:"").trim().toLowerCase()||JT(ct.content);if(ut){const Ct=Vt.value[ut];if(fn.value.has(ut)&&Ct)He=Ct,$e=Ot(rt({},ct),{type:ut,tag:ut,content:bH(ct.content,ut)});else if(eM((V=ct.content)!=null?V:ct.raw,ut)){const St=String((te=(K=ct.content)!=null?K:ct.raw)!=null?te:"");$e.type==="html_inline"?(He=Jn,$e={type:"text",content:St,raw:St}):(He=ql,$e={type:"paragraph",children:[{type:"text",content:St,raw:St}],raw:St})}}}const Ne=$e.type==="code_block"&&u.value==="pre"&&He===Eo&&!Hm(Vt.value,ze);let We=rt({},(function(ct,ut,Ct){const St=ut??Pd(ct);if(ct.type==="code_block"){const sn=St?Hm(Vt.value,St):void 0;if(Ct&&u.value==="pre"&&!sn&&Ct===Eo)return fE.value;if(Ct&&St&&Ct===sn)return St==="mermaid"?Uk(ct):St==="infographic"?jk(ct):St==="d2"||St==="d2lang"?Wk.value:Fk.value;if(Ct&&Ct===Vt.value.code_block)return Fk.value;if(ak(Ct))return pE.value}return St==="mermaid"?Uk(ct):St==="infographic"?jk(ct):St==="d2"||St==="d2lang"?Wk.value:ct.type==="link"?gE.value:ct.type==="list"?vE.value:ct.type==="blockquote"?yE.value:ct.type==="table"?kE.value:ct.type==="code_block"?Bk.value:Uc.value})($e,ze,He));const Ze=pl.value[A.index];$e.type==="code_block"&&Ze?.kind==="code-block"&&(We=Ot(rt({},We),Ne?{reservedHeightPx:(ge=Ze.height)!=null?ge:Ze.contentHeight}:{estimatedHeightPx:Ze.height,estimatedContentHeightPx:Ze.contentHeight})),Ne||$e.type!=="code_block"||ze!=="mermaid"||qa(We.estimatedPreviewHeightPx)!=null||(We=Ot(rt({},We),{estimatedPreviewHeightPx:b1(y1(String((Se=$e.code)!=null?Se:"")))})),Ne||$e.type!=="code_block"||ze!=="infographic"||qa(We.estimatedPreviewHeightPx)!=null||(We=Ot(rt({},We),{estimatedPreviewHeightPx:_1(k1(String((xe=$e.code)!=null?xe:"")))})),$e.type==="math_block"&&(We=Ot(rt({},We),{cacheScope:os.value}));const Je=(function(ct,ut){const Ct=String(ct.type);return!md(Ct)&&Vt.value[Ct]===ut})($e,He),wt=Je?fy($e,it.value):void 0;return Ot(rt({},A),{node:$e,component:He,bindings:We,customBindings:rt(rt({},wt??{}),We),rendersCustomNode:Je,hasSlotChildren:bE($e),slotContent:String((Be=$e.content)!=null?Be:""),isCodeBlock:$e.type==="code_block",indexKey:`${uE.value}-${A.index}`})}));function Pd(A){var H;return A?.type==="code_block"?String((H=A.language)!=null?H:"").trim().toLowerCase():""}function Hm(A,H){const V=H.trim().toLowerCase();if(V)for(const K of[V,iy(V),GM(V)]){const te=K&&A[K];if(te)return te}}function zk(A,H,V,K){var te,ge;const Se=rt({},A.value);return qa(Se.estimatedPreviewHeightPx)==null&&(Se.estimatedPreviewHeightPx=K(V(String((te=H?.code)!=null?te:"")),void 0,Se.maxHeight==="none"?null:(ge=qa(Se.maxHeight))!=null?ge:void 0)),Se}function Uk(A){return zk(hE,A,y1,b1)}function jk(A){return zk(mE,A,k1,_1)}function qk(A,H){if(!A)return $1;const V=Vt.value,K=V[String(A.type)];if(A.type==="code_block"){const te=H??Pd(A),ge=te?Hm(V,te):void 0;return ge||(u.value==="pre"?V.code_block||Eo:te==="mermaid"?V.mermaid||lE:te==="infographic"?V.infographic||aE:te==="d2"||te==="d2lang"?V.d2||cE:K||V.code_block||ck.value)}return K||Rk[String(A.type)]||$1}function Wm(A){o("click",A)}function _E(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",A)}function wE(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",A)}function Vk(A){o("mouseover",A)}function Kk(A){o("mouseout",A)}const bl=J(null),Ci=J(!1);let jc,ka=null,zm=0,Rd=0,Dd=0;const Gk=["code_block","admonition","table","math_block","html_block","image","thematic_break"],SE=new Set(Gk),Yk=[".typewriter-cursor",".height-estimation-probes",...Gk.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function Qk(A){if(!A||typeof A!="object")return!1;const H=A.type;return typeof H=="string"&&SE.has(H)}function Bd(A){var H,V;if(!A||typeof A!="object")return 0;const K=A,te=(V=(H=K.raw)!=null?H:K.content)!=null?V:K.code;if(typeof te=="string")return te.length;const ge=K.children;if(Array.isArray(ge))return ge.reduce((xe,Be)=>xe+Bd(Be),0);const Se=K.items;return Array.isArray(Se)?Se.reduce((xe,Be)=>xe+Bd(Be),0):0}function Fd(){jc&&(clearTimeout(jc),jc=void 0)}function Xk(){zm+=1,ka!=null&&(st?.(ka),ka=null)}function Hd(){Xk(),bl.value&&(bl.value.style.visibility="hidden")}function CE(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(Yk)}function xE(A){let H=A.lastChild;for(;H;){if(CE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const V=H;if(!V.matches(Yk)&&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 Um(){if(!X||!Ci.value||ka!=null)return;const A=zm,H=()=>{ka=null,A===zm&&(function(){var V,K;if(!(X&&Ci.value&&S.value&&bl.value))return;const te=S.value,ge=bl.value;ge.style.visibility="hidden";const Se=(function(){const He=Fm.value;for(let Ne=He.length-1;Ne>=0;Ne--){const We=He[Ne];if(!We||Qk(We.node)||!Om(We.index))continue;const Ze=Fn.get(We.index);if(!Ze)continue;const Je=xE(Ze);if(Je)return Je}return null})();if(!Se)return;let xe=0,Be=0,$e=20,ze=!1;if(Se?.textContent){const He=Se.textContent.length,Ne=document.createRange();Ne.setStart(Se,Math.max(0,He-1)),Ne.setEnd(Se,He);const We=typeof Ne.getClientRects=="function"?Ne.getClientRects():void 0,Ze=(K=We?.[We.length-1])!=null?K:(V=Se.parentElement)==null?void 0:V.getBoundingClientRect();if(Ze){const Je=vt("typewriterCursor.root.getBoundingClientRect",()=>te.getBoundingClientRect());xe=Ze.right-Je.left+te.scrollLeft,Be=Ze.top-Je.top+te.scrollTop,$e=Ze.height||$e,ze=!0}Ne.detach()}ze&&(ge.style.transform=`translate(${Math.max(0,xe)}px, ${Math.max(0,Be)}px)`,ge.style.height=`${$e}px`,ge.style.visibility="visible")})()};et?ka=et(H):H()}return Ve([me,()=>s.content,()=>s.nodes,()=>b.typewriter,j],()=>Un(null,null,function*(){var A,H;if(!X||he.value||!z.value)return;if(j.value)return Ci.value=!1,Fd(),void Hd();if((A=s.nodes)!=null&&A.length)return Ci.value=!1,Fd(),Hd(),Rd=((H=s.content)!=null?H:"").length,void(Dd=me.value.length);const V=(function(){var xe,Be;return(xe=s.nodes)!=null&&xe.length?s.nodes.reduce(($e,ze)=>$e+Bd(ze),0):((Be=s.content)!=null?Be:"").length})(),K=(function(){var xe;return(xe=s.nodes)!=null&&xe.length?s.nodes.reduce((Be,$e)=>Be+Bd($e),0):me.value.length})(),te=!Qk(nt.value[nt.value.length-1]),ge=V>Rd,Se=K>Dd;if(b.typewriter===!1||!te||!ge&&!Se)return b.typewriter!==!1&&te||(Ci.value=!1,Hd()),Rd=V,void(Dd=K);Rd=V,Dd=K,Ci.value=!0,bl.value&&(bl.value.style.visibility="hidden"),Fd(),yield gt(),Um(),jc=setTimeout(()=>{jc=void 0,Ci.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(Ci,A=>Un(null,null,function*(){A?(yield gt(),Um()):Hd()}),{flush:"post"}),Ve([()=>Nt.value,()=>Ms.start,()=>Ms.end],()=>Un(null,null,function*(){X&&!he.value&&z.value&&Ci.value&&(yield gt(),Um())}),{flush:"post"}),ds(()=>{Fd(),Xk(),dn.clear()}),(A,H)=>{const V=ZI("NodeRenderer",!0);return C(he)?(w(!0),$(Pe,{key:0},tt(Fm.value,K=>(w(),$(Pe,{key:K.index},[K.rendersCustomNode?(w(),ye(zs(K.component),vn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onClick:Wm,onMouseover:Vk,onMouseout:Kk,onCopy:H[0]||(H[0]=te=>o("copy",te)),onHandleArtifactClick:H[1]||(H[1]=te=>o("handleArtifactClick",te))}),{default:_e(()=>[K.hasSlotChildren?(w(),ye(V,vn({key:0,ref_for:!0},Dn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ye(V,vn({key:1,ref_for:!0},Dn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(zs(K.component),vn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onClick:Wm,onMouseover:Vk,onMouseout:Kk,onCopy:H[2]||(H[2]=te=>o("copy",te)),onHandleArtifactClick:H[3]||(H[3]=te=>o("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),$("div",{key:1,ref_key:"containerRef",ref:S,class:Re(["markstream-vue markdown-renderer",[{dark:b.isDark},{virtualized:Lt.value},{"virtual-scroll-coordinated":Yn.value}]]),"data-custom-id":b.customId,onClick:Wm,onMouseover:_E,onMouseout:wE},[ys.value||Lt.value?(w(),$(Pe,{key:0},[ys.value?(w(),$("div",{key:0,class:"height-estimation-probes",style:Xt({width:`${co.value}px`}),"aria-hidden":"true"},[x("div",{ref_key:"paragraphProbeWrapperRef",ref:E,class:"node-content","data-probe":"paragraph"},[ie(C(ql),{node:Kn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),x("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[x("ul",rG,[ie(C(rc),{node:Yt.value,"index-key":"probe-list-item"},null,8,["node"])])],512),x("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[ie(C(lc),{node:Gn.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),$(Pe,null,tt(6,K=>x("div",{key:`probe-heading-${K}`,ref_for:!0,ref:te=>(function(ge,Se){ge<1||ge>6||(F[ge]=Se)})(K,te),class:"node-content","data-probe":`heading-${K}`},[ie(C(Fp),{node:q4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,lG)),64))],4)):re("",!0),Lt.value?(w(),$("div",{key:1,class:"node-spacer",style:Xt({height:`${rm.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(w(!0),$(Pe,null,tt(Fm.value,K=>(w(),$("div",{key:K.index,ref_for:!0,ref:te=>Lk(K.index,te),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Om(K.index)?(w(),$("div",{key:0,ref_for:!0,ref:te=>(function(ge,Se){var xe;Se||(function(He){const Ne=`${am()}-${He}`;let We=!1;for(const Ze of Array.from(xo.keys())){const Je=wi.get(Ze);(Je?.index===He||Ze===Ne||Ze.startsWith(`${Ne}-`))&&(xo.delete(Ze),wi.delete(Ze),We=!0)}We&&(ca(),Pn("async-node"))})(ge),Ri.delete(ge),(function(He){var Ne;const We=((Ne=fl.get(He))!=null?Ne:0)+1;fl.set(He,We)})(ge);const Be=gr.get(ge);if(Be){for(const He of Be)xd(He);gr.delete(ge)}if((function(He){const Ne=ft.get(He);Ne&&(Le?.unobserve(Ne),ve.delete(Ne),ft.delete(He))})(ge),!Se||!Wo.value)return _i.delete(ge),void fl.delete(ge);_i.set(ge,Se);const $e=()=>{Od(ge,Se)};queueMicrotask($e);const ze=(Le||typeof ResizeObserver>"u"||(Le=new ResizeObserver(He=>{if(He.length)for(const Ne of He){const We=ve.get(Ne.target),Ze=ft.get(We??-1);We!=null&&Ze&&Od(We,Ze)}else Bi()})),Le);if(ze&&(ft.set(ge,Se),ve.set(Se,ge),ze.observe(Se)),typeof window<"u"){const He=((xe=nt.value[ge])==null?void 0:xe.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(He.length){const Ne=He.map(We=>tk(We,$e,"node-resize")).filter(We=>We!=null);Ne.length&&gr.set(ge,Ne)}}})(K.index,te),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ye(zs(K.component),vn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[8]||(H[8]=te=>o("copy",te)),onHandleArtifactClick:H[9]||(H[9]=te=>o("handleArtifactClick",te))}),{default:_e(()=>[K.hasSlotChildren?(w(),ye(V,vn({key:0,ref_for:!0},Dn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ye(V,vn({key:1,ref_for:!0},Dn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(zs(K.component),vn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[10]||(H[10]=te=>o("copy",te)),onHandleArtifactClick:H[11]||(H[11]=te=>o("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(Zr,{key:0,name:"fade",css:b.fade!==!1,appear:b.fade!==!1},{default:_e(()=>[K.rendersCustomNode?(w(),ye(zs(K.component),vn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[4]||(H[4]=te=>o("copy",te)),onHandleArtifactClick:H[5]||(H[5]=te=>o("handleArtifactClick",te))}),{default:_e(()=>[K.hasSlotChildren?(w(),ye(V,vn({key:0,ref_for:!0},Dn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ye(V,vn({key:1,ref_for:!0},Dn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ye(zs(K.component),vn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onCopy:H[6]||(H[6]=te=>o("copy",te)),onHandleArtifactClick:H[7]||(H[7]=te=>o("handleArtifactClick",te))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),$("div",{key:1,class:"node-placeholder",style:Xt({height:`${Md(K.index)}px`})},null,4))],8,aG))),128)),Ci.value?(w(),$("span",{key:1,ref_key:"typewriterCursorRef",ref:bl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),Lt.value?(w(),$("div",{key:2,class:"node-spacer",style:Xt({height:`${lm.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,iG))}}})),[["__scopeId","data-v-2e8e6e17"]]),So=w3;So.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",So.__name,So.name].filter(n=>!!n));for(const n of t)e.component(n,w3)};const ky=Object.freeze(Object.defineProperty({__proto__:null,default:So},Symbol.toStringTag,{value:"Module"})),cG={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"},uG={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"},dG={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"},fG={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"},pG={class:"admonition-title"},hG=["aria-expanded","aria-controls"],mG=["id"],jf=gn(qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=B(()=>{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=J(!!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)=>(w(),$("div",{class:Re(["admonition",[`admonition-${s.node.kind}`]])},[x("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(w(),$("svg",cG,[...u[1]||(u[1]=[x("circle",{cx:"12",cy:"12",r:"10"},null,-1),x("path",{d:"M12 16v-4"},null,-1),x("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(w(),$("svg",uG,[...u[2]||(u[2]=[x("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),x("path",{d:"M9 18h6"},null,-1),x("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(w(),$("svg",dG,[...u[3]||(u[3]=[x("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),x("path",{d:"M12 9v4"},null,-1),x("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(w(),$("svg",fG,[...u[4]||(u[4]=[x("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),x("path",{d:"M12 8v4"},null,-1),x("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),x("span",pG,O(i.value),1),s.node.collapsible?(w(),$("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),$("svg",{style:Xt({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]=[x("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,hG)):re("",!0)]),Sn(x("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(So),{"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,mG),[[$o,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);jf.install=e=>{e.component(jf.__name,jf)};const S3=()=>eo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let kf=null,gG=S3;function Bge(){return Un(this,null,function*(){if(kf)return kf;const e=gG;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===S3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(kf=(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),kf):null})}function Fge(){return!1}function Hge(){return Un(this,null,function*(){return null})}const bf=J(!1);let D2=!1;function Zg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function vG(){return!D2&&typeof window<"u"&&typeof document<"u"&&(D2=!0,bf.value=Zg(),new MutationObserver(()=>{bf.value=Zg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{bf.value=Zg()})),bf}const C3=["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"],yG=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),R1=[...C3].sort((e,t)=>t.length-e.length).join("|"),Jg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${R1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${R1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),x3=/[),.;!?,。;!?)]+$/;function kG(e){const t=e.toLowerCase();return C3.some(n=>t.endsWith(`.${n}`))}function bG(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${R1}))["']`,"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 _G(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(x3,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=yG.has(i),a=kG(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 wG(e,t={}){const n=[];Jg.lastIndex=0;let s;for(;(s=Jg.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(x3,""),u=a.length-c.length;a=c;const d=_G(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&&(Jg.lastIndex-=u)}return n}const SG=12e4,CG=6e4,xG=32,AG=3e4,B2=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function TG(e){let t=0,n=0,s=0;B2.lastIndex=0;let o;for(;(o=B2.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=SG||n>=CG||t>=xG||s>=AG?"pre":"shiki",codeFenceCount:t,codeChars:n}}function MG(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function EG(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const IG={key:1,class:"diff-wrap"},$G={class:"diff-bar"},NG=["aria-label","onClick"],LG={class:"diff-pre"},OG={key:0,class:"diff-sign"},PG={class:"diff-text"},RG="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",F2="github-light",H2="github-dark",DG=qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){fq(),xq(),hq(),Iq(),pq(new MG),Eq(new EG);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Tt(),s=Ut("resolveImage"),o=J(null),i=e,r=B(()=>!i.streaming),l=B(()=>bG(i.text??"")),a=B(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:TG(i.text??"")),c=vG(),u=B(()=>!i.streaming),d=Os(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 _(R){if(!s)return;const D=[];for(const F of[h,p]){F.lastIndex=0;let U;for(;(U=F.exec(R))!==null;)D.push(U[2]??"")}for(const F of D)!F||!m(F)||d.has(F)||f.has(F)||(f.add(F),s(F).then(U=>{d.set(F,U!==F?U:"")}).catch(()=>{d.set(F,"")}).finally(()=>{f.delete(F)}))}function k(R){if(!s)return R;const D=F=>{if(!m(F))return null;const U=d.get(F);return U===void 0?RG:U===""?null:U};return R.replace(h,(F,U,G,Y)=>{const q=D(G);return q===null?F:`${U}${q}${Y}`}).replace(p,(F,U,G,Y)=>{const q=D(G);return q===null?F:`${U}${q}${Y}`})}Ve(()=>i.text,R=>_(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),D=[];let F=R.nextNode();for(;F;){const U=F,G=U.parentElement;G&&!G.closest("a, pre, .md-file-link, svg")&&U.data.trim().length>0&&D.push(U),F=R.nextNode()}for(const U of D){const G=wG(U.data,{aliases:l.value});if(G.length===0||!U.parentNode)continue;const Y=document.createDocumentFragment();let q=0;for(const ae of G){ae.start>q&&Y.append(document.createTextNode(U.data.slice(q,ae.start)));const de=document.createElement("button");de.type="button",de.className="md-file-link",de.textContent=ae.text,de.title=ae.line?`${ae.path}:${ae.line}`:ae.path,de.addEventListener("click",ne=>{ne.preventDefault(),ne.stopPropagation(),i.openFile?.({path:ae.path,line:ae.line})}),Y.append(de),q=ae.end}q<U.data.length&&Y.append(document.createTextNode(U.data.slice(q))),U.parentNode.replaceChild(Y,U)}}function v(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let D=R.length;for(const F of["#","?"]){const U=R.indexOf(F);U!==-1&&U<D&&(D=U)}return R.slice(0,D)}function T(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const D of R){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const F=D.getAttribute("href")??"";v(F)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",U=>{U.preventDefault(),U.stopPropagation(),i.openFile?.({path:y(F)})}))}}function P(){gt().then(()=>{g(),T()})}Ve(()=>i.text,P),Ve(()=>i.streaming,P);let N=null;bn(()=>{P(),o.value&&(N=new MutationObserver(P),N.observe(o.value,{childList:!0,subtree:!0}))}),Tn(()=>{N?.disconnect()});const b={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},M=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,I=B(()=>{const R=k(i.text??""),D=[];let F=0;M.lastIndex=0;let U;for(;(U=M.exec(R))!==null;){const Y=U[1]??"",q=R.slice(F,U.index)+(Y||"");q.trim()&&D.push({kind:"md",text:q}),D.push({kind:"diff",code:U[2]??""}),F=M.lastIndex}const G=R.slice(F);return(G.trim()||D.length===0)&&D.push({kind:"md",text:G}),D});function L(R){return R.split(`
|
|
252
|
-
`).map(D=>D.startsWith("@@")?{type:"hunk",sign:"",text:D}:/^\+(?!\+\+)/.test(D)?{type:"add",sign:"+",text:D.slice(1)}:/^-(?!--)/.test(D)?{type:"del",sign:"-",text:D.slice(1)}:D.startsWith(" ")?{type:"ctx",sign:"",text:D.slice(1)}:{type:"ctx",sign:"",text:D})}const S=J(null);function E(R,D){js(R).then(F=>{F&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(R,D)=>(w(),$("div",{ref_key:"mdRef",ref:o,class:"md"},[(w(!0),$(Pe,null,tt(I.value,(F,U)=>(w(),$(Pe,{key:U},[F.kind==="md"?(w(),ye(C(So),{key:0,content:F.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":F2,"code-block-dark-theme":H2,themes:[F2,H2],"code-block-props":b,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),$("div",IG,[x("div",$G,[D[0]||(D[0]=x("span",{class:"diff-lang"},"diff",-1)),ie(jt,{text:C(n)("filePreview.copyCode")},{default:_e(()=>[x("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:G=>E(F.code,U)},[ie(Xe,{name:S.value===U?"check":"copy",size:"sm"},null,8,["name"])],8,NG)]),_:2},1032,["text"])]),x("pre",LG,[x("code",null,[(w(!0),$(Pe,null,tt(L(F.code),(G,Y)=>(w(),$("span",{key:Y,class:Re(["diff-line",`diff-${G.type}`])},[G.type!=="hunk"?(w(),$("span",OG,O(G.sign),1)):re("",!0),x("span",PG,O(G.text),1)],2))),128))])])]))],64))),128))],512))}}),Hh=dt(DG,[["__scopeId","data-v-6678a5da"]]),BG={class:"tc-anim"},FG={class:"prev-anim"},HG={class:"prev"},WG=qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=B(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=B(()=>n.foldable&&o.value.length>1),r=B(()=>n.streaming||!i.value),l=B(()=>o.value.at(-1)??""),a=J(null);return bn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ve(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),$("div",{class:Re(["think",{mob:e.mobile}])},[i.value?(w(),$("div",{key:0,class:Re(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[x("div",BG,[x("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),x("div",FG,[x("span",HG,O(l.value),1)])],2)):(w(),$("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),zG=dt(WG,[["__scopeId","data-v-88e1c4c6"]]),UG={class:"activity-notice",role:"status"},jG={"aria-hidden":"true"},qG={class:"an-label"},VG=qe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),$("div",UG,[x("span",jG,[ie(ri,{size:"sm"})]),x("span",qG,O(e.label),1)]))}}),KG=dt(VG,[["__scopeId","data-v-0d497074"]]);function GG(e){return e.length===1?`0${e}`:e}function YG(e,t){return`${String(Number(e))}:${GG(t)}`}const W2=e=>/^\d+$/.test(e);function QG(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(W2(s)&&W2(o)&&c){const f=YG(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}function XG(e,t=120){const n=e.split(`
|
|
253
|
-
`)[0]??"",s=e.includes(`
|
|
254
|
-
`)||e.length>t;return{text:n.length>t?`${n.slice(0,t).trimEnd()}…`:n,hasMore:s}}const ZG=["data-turn-id"],JG={class:"cn-head"},eY={class:"cn-icon","aria-hidden":"true"},tY={class:"cn-title"},nY={key:0,class:"cn-badge"},sY=["title"],oY={key:0,class:"cn-status"},iY={key:1,class:"cn-prompt"},rY=qe({__name:"CronNotice",props:{text:{},cron:{},turnId:{}},setup(e){const t=e,{t:n}=Tt(),s=B(()=>t.cron),o=B(()=>s.value?.missedCount!==void 0),i=B(()=>s.value?.stale===!0||o.value),r=B(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),l=B(()=>{const p=s.value?.cron;return p?QG(p,n):""}),a=B(()=>{const p=s.value;if(!p)return"";const m=[];return p.recurring===!1&&m.push(n("conversation.cron.oneShot")),typeof p.coalescedCount=="number"&&p.coalescedCount>1&&m.push(n("conversation.cron.coalesced",{n:p.coalescedCount})),p.missedCount!==void 0&&m.push(n("conversation.cron.missedCount",{n:p.missedCount})),p.stale===!0&&m.push(n("conversation.cron.finalDelivery")),m.join(" · ")}),c=J(!1),u=B(()=>t.text??""),d=B(()=>XG(u.value)),f=B(()=>d.value.hasMore),h=B(()=>c.value?u.value:d.value.text);return(p,m)=>(w(),$("div",{class:Re(["cron-notice",{"is-warning":i.value,"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[x("div",JG,[x("span",eY,[ie(Xe,{name:"clock",size:"sm"})]),x("span",tY,O(r.value),1),l.value?(w(),$("span",nY,O(l.value),1)):re("",!0),s.value?.jobId?(w(),$("span",{key:1,class:"cn-job",title:C(n)("conversation.cron.job",{id:s.value.jobId})},O(s.value.jobId),9,sY)):re("",!0)]),a.value?(w(),$("div",oY,O(a.value),1)):re("",!0),u.value?(w(),$("div",iY,O(h.value),1)):re("",!0),u.value&&f.value?(w(),$("button",{key:2,type:"button",class:"cn-toggle",onClick:m[0]||(m[0]=_=>c.value=!c.value)},O(c.value?C(n)("conversation.cron.collapse"):C(n)("conversation.cron.expand")),1)):re("",!0)],10,ZG))}}),z2=dt(rY,[["__scopeId","data-v-5cb848c1"]]);function A3(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 D1(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 lY(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 fi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:D1(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:A3(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 Eu(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 U2(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 by(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:U2(e.source)};case"video":return{type:"video",source:U2(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 B1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(by),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function aY(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 cY(e){return{content:e.content.map(aY),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 uY(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function T3(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 dY(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function fY(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(dY),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function M3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(fY),createdAt:e.created_at}}function pY(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 hY(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=pY(s);return{answers:t,method:e.method,note:e.note}}function F1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function j2(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 $r(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ea(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ko(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function mY(e){if(!e||typeof e!="object")return null;const t=e,n=$r(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:$r(t,"goalId")??$r(t,"goal_id")??"goal",objective:$r(t,"objective")??"",completionCriterion:$r(t,"completionCriterion")??$r(t,"completion_criterion"),status:n,turnsUsed:Ea(t,"turnsUsed")??Ea(t,"turns_used")??0,tokensUsed:Ea(t,"tokensUsed")??Ea(t,"tokens_used")??0,wallClockMs:Ea(t,"wallClockMs")??Ea(t,"wall_clock_ms")??0,terminalReason:$r(t,"terminalReason")??$r(t,"terminal_reason"),budget:{tokenBudget:Ko(o,"tokenBudget")??Ko(o,"token_budget"),remainingTokens:Ko(o,"remainingTokens")??Ko(o,"remaining_tokens"),turnBudget:Ko(o,"turnBudget")??Ko(o,"turn_budget"),remainingTurns:Ko(o,"remainingTurns")??Ko(o,"remaining_turns"),wallClockBudgetMs:Ko(o,"wallClockBudgetMs")??Ko(o,"wall_clock_budget_ms"),remainingWallClockMs:Ko(o,"remainingWallClockMs")??Ko(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function gY(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:fi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:fi(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:Eu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Eu(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:D1(t.payload.status),previousStatus:D1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:A3(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=mY(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:B1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(by),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:T3(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:M3(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:F1(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:H1(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 vY(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 q2(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 H1(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 yY(e){return e.session_id}function kY(e){return e.seq}const bY="main",_Y=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function Gi(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 wY(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 V2(){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 Xs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Il(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Go(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function SY(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=Xs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=Xs(t,"goalId")??Xs(t,"goal_id")??"goal",r=Xs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Xs(t,"completionCriterion")??Xs(t,"completion_criterion"),status:o,turnsUsed:Il(t,"turnsUsed")??Il(t,"turns_used")??0,tokensUsed:Il(t,"tokensUsed")??Il(t,"tokens_used")??0,wallClockMs:Il(t,"wallClockMs")??Il(t,"wall_clock_ms")??0,terminalReason:Xs(t,"terminalReason")??Xs(t,"terminal_reason"),budget:{tokenBudget:Go(s,"tokenBudget")??Go(s,"token_budget"),remainingTokens:Go(s,"remainingTokens")??Go(s,"remaining_tokens"),turnBudget:Go(s,"turnBudget")??Go(s,"turn_budget"),remainingTurns:Go(s,"remainingTurns")??Go(s,"remaining_turns"),wallClockBudgetMs:Go(s,"wallClockBudgetMs")??Go(s,"wall_clock_budget_ms"),remainingWallClockMs:Go(s,"remainingWallClockMs")??Go(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Va(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 CY(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Xs(t,"name")??Xs(t,"toolName")??"tool",s=na(xY(n)),o=AY(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=Xs(n,"text");if(o)return ev(o);const i=Xs(n,"message");if(i)return ev(i)}const s=Xs(t,"message");if(s)return ev(s)}return null}function xY(e){return e.replace(/_\d+$/,"")}const K2=2e3;function ev(e){return e.length>K2?`${e.slice(0,K2)}…`:e}function AY(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return ju(e,n)}function TY(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=Xs(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Va(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=CY(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Va(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 eu(e){return{...e,content:e.content.map(t=>({...t}))}}function G2(e,t,n){const s={id:Gi("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function MY(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 EY(e){return Array.isArray(e)?e.map(t=>by(t)):[]}function Y2(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 IY(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 $Y(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 Q2(e,t){e.messages.find(n=>n.id===t)}function NY(e,t,n,s,o,i){const r={id:Gi("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 tv(e,t){return e.messages.find(n=>n.id===t)}function X2(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 LY(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=V2(),e.set(u,d)),d}function s(u){e.set(u,V2())}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??Gi("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=G2(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 _=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:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:h},{type:"messageCreated",message:eu(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,_=[],k=m?.agentId;if(typeof k=="string"&&k!==bY){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(_Y.has(u))return TY(p,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=EY(m?.content);if(y.length===0)break;p.currentPromptId=g;const T=MY(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:eu(T)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??Gi("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Gi("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=G2(p,f,v);p.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:eu(y)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const y=a(p.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const T=Y2(p,g,"thinking",v);if(T<0)break;p.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:T,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const y=a(p.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const T=Y2(p,g,"text",v);if(T<0)break;p.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:T,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,y=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!y)break;const T=m?.toolCallId,P=m?.name??m?.toolName??"",N=m?.args??m?.input??{};IY(p,g,T,P,N);const b=tv(p,g);b&&b.content.length-1,p.toolStartTimes.set(T,Date.now()),b&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:b.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=$Y(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Gi("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=m?.toolCallId,T=m?.output,P=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const N=NY(p,f,y,T,P,v);_.push({type:"messageCreated",message:eu(N)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=wY(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){Q2(p,g);const y=tv(p,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(T=>({...T})),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),_.push({type:"sessionUsageUpdated",sessionId:f,usage:X2(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,v=m?.reason??"completed",y=Il(m??{},"durationMs");if(g){Q2(p,g);const N=tv(p,g);N&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:N.content.map(b=>({...b})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}p.turnCount++;const T=X2(p);_.push({type:"sessionUsageUpdated",sessionId:f,usage:T});const P=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:P,previousStatus:"running"}),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 v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Gi("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(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Va(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Va(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Va(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Va(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):Gi("task_"),T=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Bn.global.t("tasks.defaultDescription"),P=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:T,command:P,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:P!==void 0?`$ ${P}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.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}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=SY(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=Xs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:Gi("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(y),_.push({type:"messageCreated",message:eu(y)})}break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const OY=new Set(["server_hello","ack","ping","resync_required","error","pong"]),Z2=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),PY=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"]),RY=new Set(["assistant.delta","thinking.delta"]);function DY(e,t){if(OY.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return RY.has(s)?BY(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?PY.has(s)?{route:"protocol"}:Z2.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:Z2.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function BY(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 qf 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 Ra 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 ol(e){return e instanceof qf||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function E3(e){return e instanceof Ra||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const J2=1e3,nv=16384,sv=500,ov=50,FY=6,HY=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,WY=/^[A-Za-z0-9+/=_-]{200,}$/;let iv=null;function bi(){if(iv!==null)return iv;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=es($t.debug)==="1"),iv=e,e}const jr=[];let zY=1;const _y=J(0),au=ea(!1);function UY(){return jr}function jY(){jr.length=0,_y.value++}function ul(e){au.value||(jr.push({id:zY++,ts:Date.now(),...e}),jr.length>J2&&jr.splice(0,jr.length-J2),_y.value++)}function W1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return WY.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>sv?`${o.slice(0,sv)}… [+${o.length-sv} chars]`:o}if(n!=="object")return String(e);if(t>=FY)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,ov).map(i=>W1(i,t+1));return e.length>ov&&o.push(`[+${e.length-ov} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=HY.test(o)?"[redacted]":W1(i,t+1);return s}function oa(e){if(e===void 0)return;const t=W1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>nv)return{_truncated:`detail JSON was ${n.length} chars; first ${nv} kept`,preview:n.slice(0,nv)}}catch{return"[unserializable detail]"}return t}function rv(e){bi()&&ul({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:oa(e.body)}})}function _f(e){if(!bi())return;const t=e.code!==0;ul({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:oa(e.data)}})}function tu(e){bi()&&ul({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 Ia(e,t){bi()&&ul({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:oa(t)})}function qY(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;ul({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:oa(e)})}function VY(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);ul({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:oa(t.payload)})}const KY={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function lv(e,t,n){bi()&&ul({source:"client",kind:`client:${e}`,label:`${KY[e]} ${t}`,detail:oa(n)})}function Xi(e,t){bi()&&ul({source:"client",kind:"client:event",label:`· ${e}`,detail:oa(t)})}let eC=!1;function GY(){if(!(eC||!bi())){eC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{lv("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;lv("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{lv(e,n.map(YY).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function YY(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function I3(e=jr){if(typeof document>"u")return;const t=new Blob([QY(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function QY(e=jr){return e.map(t=>JSON.stringify(t)).join(`
|
|
255
|
-
`)}const wy="kimi-web.server-credential",XY="token";let td;const z1=new Set;function ZY(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(XY);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 JY(){try{return globalThis.sessionStorage?.getItem(wy)??void 0}catch{return}}function eQ(){const e=ZY();return e?(N3(e),!0):(td=JY(),td!==void 0)}function $3(){return td}function N3(e){td=e;try{globalThis.sessionStorage?.setItem(wy,e)}catch{}}function tQ(){td=void 0;try{globalThis.sessionStorage?.removeItem(wy)}catch{}}function nQ(e){return z1.add(e),()=>{z1.delete(e)}}function sQ(){tQ();for(const e of z1)try{e()}catch{}}const Da=3e4,L3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",tC=500,oQ=40101;function av(){try{return AbortSignal.timeout(Da)}catch{return}}function iQ(e,t){let n="",s=e;for(let o=0;o<t;o++)n=L3[s%32]+n,s=Math.floor(s/32);return n}function rQ(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=>L3[n%32]).join("")}function cv(){return`${iQ(Date.now(),10)}${rQ(16)}`}function lQ(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 nC(e){try{const t=await e.text();return t?t.length>tC?`${t.slice(0,tC)}...`:t:void 0}catch{return}}class aQ{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=mu(this.origin,t),s=cv(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();rv({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:av()})}catch(a){throw tu({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new Ra({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:Da,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return _f({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),_f({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 qf({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 postForm(t,n){const s=mu(this.origin,t),o=cv(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();rv({method:"POST",path:t,url:s,requestId:o,body:lQ(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:av()})}catch(u){throw tu({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new Ra({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:Da,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw tu({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Ra({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:Da,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await nC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(_f({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 qf({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=mu(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,_]of Object.entries(o))_!==void 0&&h.set(m,String(_));const p=h.toString();p&&(r=`${r}?${p}`)}const l=cv(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();rv({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:av()})}catch(h){throw tu({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new Ra({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Da,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw tu({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new Ra({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Da,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await nC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(_f({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 qf({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=$3();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===oQ)&&sQ()}}const cQ="kimi-code.bearer.",uQ=3e4;class dQ{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(),Ia("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=$3(),n=t!==void 0?[`${cQ}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Ia("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));VY(i),this.handleFrame(i)}catch(i){Ia("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Ia("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Ia("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,Ia("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=wf(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(wf(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(wf(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,uQ),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=wf(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=DY(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)),qY(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function wf(e,t){return`${e}\0${t}`}function uv(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 sC(e){return e==="auto_compact"||e==="manual_compact"}class fQ{http;config;constructor(t){this.config=t,this.http=new aQ(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?lY(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(fi),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 fi(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return fi(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 fi(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return fi(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(B1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:fi(n.session),messages:n.messages.items.map(B1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(T3),pendingQuestions:n.pending_questions.map(M3)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,cY(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return fi(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 fi(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(fi)}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)}`,uY(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)}`,hY(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(F1)}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 F1(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(uv)}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 uv(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return uv(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(j2)])):void 0;return{items:o.items.map(j2),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 mu(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(Eu)}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 Eu(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 Eu(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(vY)}async listProviders(){return(await this.http.get("/providers")).items.map(q2)}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 q2(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 dv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return dv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return dv(t)}async getConfig(){const t=await this.http.get("/config");return H1(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 H1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return mu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=H5(this.config.serverHttpUrl,this.config.clientId),s=LY(),o=new dQ(n,this.config.clientId,{onWireEvent:i=>{const r=yY(i),l=kY(i),a=gY(i);a.type==="historyCompacted"&&!sC(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)f.type==="historyCompacted"&&!sC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function dv(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 oC;function pt(){return oC??=new fQ(P5()),oC}const pQ=["src","controls","muted"],hQ=["src","alt"],fv=qe({__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=J(t.fileId?"":t.url),s=J(null),o=J(!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 pt().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 Ve(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),bn(()=>{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}),ds(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(w(),$("video",{key:0,ref_key:"mediaEl",ref:s,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,pQ)):(w(),$("img",{key:1,ref_key:"mediaEl",ref:s,class:Re(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,hQ))}}),mQ=["aria-label"],gQ=120,vQ=60,yQ=qe({__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*gQ}ms`,"--moon-frame-fast-delay":`${s*vQ}ms`}}return(s,o)=>(w(),$("span",{class:Re(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),$(Pe,null,tt(t,(i,r)=>x("span",{key:i,class:"ui-moon__frame",style:Xt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,mQ))}}),O3=dt(yQ,[["__scopeId","data-v-a6b7ec07"]]);function kQ(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 bQ={class:"chat"},_Q={key:0,class:"chat-loading"},wQ={class:"chat-loading-text"},SQ={key:1,class:"chat-empty"},CQ={key:1,class:"top-sentinel-text"},xQ={key:0,class:"u-turn"},AQ=["data-turn-id"],TQ={key:0,class:"u-imgs"},MQ=["aria-label","onClick"],EQ={key:1,class:"skill-act"},IQ={class:"skill-act-head"},$Q={key:0,class:"skill-act-args"},NQ={key:2,class:"skill-act"},LQ={class:"skill-act-head"},OQ={key:0,class:"skill-act-args"},PQ={key:3,class:"u-text"},RQ={key:0,class:"u-meta"},DQ=["aria-label","onClick"],BQ=["aria-label","onClick"],FQ=["onClick"],HQ=["data-turn-id"],WQ=["onClick"],zQ={class:"cd-view"},UQ={key:1,class:"cd-label"},jQ=["data-turn-id"],qQ={key:1,class:"msg"},VQ={key:0,class:"a-msg-ft"},KQ={key:0,class:"a-duration"},GQ=["aria-label","onClick"],YQ={key:4,class:"sending-placeholder"},QQ={key:5,class:"q-stack"},XQ={class:"q-head"},ZQ={class:"q-title"},JQ={class:"q-hint"},eX=["onDragover","onDrop"],tX={class:"u-bub q-bub"},nX=["title","onDragstart"],sX=["title","onClick"],oX={key:0,class:"u-text q-text"},iX={key:1,class:"q-text q-text-placeholder"},rX={key:0,class:"q-imgs"},lX={key:1,class:"q-tag q-tag-next"},aX={key:2,class:"q-tag q-tag-idx"},cX=["aria-label","onClick"],uX=2500,dX=qe({__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}=Tt(),{confirm:o}=al();Tn(()=>{X!==null&&(clearTimeout(X),X=null),U!==null&&(clearTimeout(U),U=null),M!==null&&(clearTimeout(M),M=null)});const i=e,r=J(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(ce=>{ce[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))}bn(a),Tn(()=>{l?.disconnect(),l=null}),Ve(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=B(()=>{if(!i.running||i.turns.length===0)return null;const ce=i.turns.at(-1);return ce.role==="assistant"?ce.id:null}),u=B(()=>i.sending||i.running),d=n,f=J(null),h=J(null);function p(ce){return(ce.attachments?.length??0)>0}function m(ce){d("editQueued",ce)}function _(ce,z){if(f.value=ce,!z.dataTransfer)return;z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",String(ce));const Q=z.currentTarget?.closest(".q-turn");Q&&z.dataTransfer.setDragImage(Q,24,24)}function k(ce,z){if(f.value===null)return;z.preventDefault(),z.dataTransfer&&(z.dataTransfer.dropEffect="move");const Q=z.currentTarget.getBoundingClientRect(),oe=z.clientY<Q.top+Q.height/2?"before":"after";h.value={index:ce,position:oe}}function g(ce,z){z.preventDefault();const Q=f.value,oe=h.value?.position??"before";if(f.value=null,h.value=null,Q===null)return;let W=oe==="before"?ce:ce+1;Q<W&&(W-=1),Q!==W&&d("reorderQueue",{from:Q,to:W})}function v(){f.value=null,h.value=null}const y=B(()=>{for(let ce=i.turns.length-1;ce>=0;ce--)if(i.turns[ce].role==="user")return i.turns[ce].id;return null});function T(ce){return ce.role==="user"&&ce.id===y.value&&!i.running&&!i.sending&&!ce.skillActivation&&!ce.pluginCommand}function P(ce){const z=ce.compaction,Q=z?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof z?.tokensBefore=="number"&&typeof z?.tokensAfter=="number"?Q+s("conversation.compactedTokens",{before:V_(z.tokensBefore),after:V_(z.tokensAfter)}):Q}const N=J(null),b=J(null);let M=null;const I=J(new Set);function L(ce){return I.value.has(ce)}function S(ce){const z=new Set(I.value);z.has(ce)?z.delete(ce):z.add(ce),I.value=z}function E(ce,z){if(L(z)){const Q=new Date(ce);if(Number.isNaN(Q.getTime()))return ce;const oe=W=>String(W).padStart(2,"0");return`${Q.getFullYear()}-${oe(Q.getMonth()+1)}-${oe(Q.getDate())} ${oe(Q.getHours())}:${oe(Q.getMinutes())}`}return kQ(ce,s("conversation.yesterday"))}async function R(ce){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&D(ce)}function D(ce){b.value===null&&(b.value=ce.id,d("editMessage",{text:ce.text,images:ce.images}),M=setTimeout(()=>{M=null,b.value=null},uX))}Ve(()=>i.turns,ce=>{b.value!==null&&(ce.some(z=>z.id===b.value)||(b.value=null,M!==null&&(clearTimeout(M),M=null)))},{flush:"post"});const F=J(!1);let U=null;function G(){if(i.turns.length===0)return;const ce=[];for(const Q of i.turns){if(Q.role==="compaction"||Q.role==="cron")continue;const oe=Q.role==="user"?"User":"Assistant",W=e7(Q);W.trim()&&ce.push(`**${oe}**
|
|
256
|
-
|
|
257
|
-
${W}`)}const z=ce.join(`
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
`);js(z).then(Q=>{Q&&(F.value=!0,d("copyConversationCopied"),U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,F.value=!1},2e3))}).catch(()=>{})}function Y(ce){const z=[];for(let Q=ce;Q>=0;Q--){const oe=i.turns[Q];if(!oe||oe.role!=="assistant")break;z.unshift(oe)}return z}function q(ce){return Y(ce).map(z=>JR(z)).filter(Boolean).join(`
|
|
262
|
-
|
|
263
|
-
`)}function ae(){for(let ce=i.turns.length-1;ce>=0;ce-=1)if(i.turns[ce]?.role==="assistant")return q(ce);return""}function de(){const ce=ae();ce.trim()&&js(ce).then(z=>{z&&(F.value=!0,d("copyConversationCopied"),U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,F.value=!1},2e3))}).catch(()=>{})}t({copyConversation:G,copyFinalSummary:de});function ne(ce){const z=i.turns[ce];if(!z||z.role!=="assistant")return!1;const Q=i.turns[ce+1];return!Q||Q.role!=="assistant"}let X=null;function he(ce){const z=i.turns[ce];if(!z)return;const Q=q(ce);Q.trim()&&js(Q).then(oe=>{oe&&(N.value=z.id,X!==null&&clearTimeout(X),X=setTimeout(()=>{X=null,N.value=null},1400))}).catch(()=>{})}function Oe(ce){const z=ce.text;z.trim()&&js(z).then(Q=>{Q&&(N.value=ce.id,X!==null&&clearTimeout(X),X=setTimeout(()=>{X=null,N.value=null},1400))}).catch(()=>{})}function je(ce){return{kind:"image",url:ce.url,path:ce.alt,fileId:ce.fileId}}function it(ce,z){return ce.id!==c.value?!1:z.sourceIndex===bh(ce).length-1}return(ce,z)=>(w(),$("div",bQ,[e.sessionLoading?(w(),$("div",_Q,[ie(ri,{size:"sm"}),x("span",wQ,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),$("div",SQ)):re("",!0),e.hasMoreMessages||e.loadingMore?(w(),$("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Re(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),$("span",CQ,[ie(ri,{size:"sm"}),Ue(" "+O(C(s)("conversation.loadingOlder")),1)])):(w(),$("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:z[0]||(z[0]=Q=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):re("",!0),(w(!0),$(Pe,null,tt(e.turns,(Q,oe)=>(w(),$(Pe,{key:Q.id},[Q.role==="user"?(w(),$("div",xQ,[x("div",{class:Re(["u-bub turn-anchor",{undoing:b.value===Q.id}]),"data-turn-id":Q.id},[Q.images&&Q.images.length>0?(w(),$("div",TQ,[(w(!0),$(Pe,null,tt(Q.images,(W,Z)=>(w(),$(Pe,{key:Z},[W.kind==="video"?(w(),ye(fv,{key:0,url:W.url,kind:"video","file-id":W.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(w(),$("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:ue=>d("openMedia",je(W))},[ie(fv,{url:W.url,kind:"image",alt:W.alt,"file-id":W.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,MQ))],64))),128))])):re("",!0),Q.skillActivation?(w(),$("div",EQ,[x("div",IQ,[z[9]||(z[9]=x("span",{class:"skill-act-arrow"},"▶",-1)),x("span",null,O(C(s)("conversation.activatedSkill",{name:Q.skillActivation.name})),1)]),Q.skillActivation.args?(w(),$("div",$Q,O(Q.skillActivation.args),1)):re("",!0)])):Q.pluginCommand?(w(),$("div",NQ,[x("div",LQ,[z[10]||(z[10]=x("span",{class:"skill-act-arrow"},"▶",-1)),x("span",null,"/"+O(Q.pluginCommand.pluginId)+":"+O(Q.pluginCommand.commandName),1)]),Q.pluginCommand.args?(w(),$("div",OQ,O(Q.pluginCommand.args),1)):re("",!0)])):(w(),$("div",PQ,O(Q.text),1))],10,AQ),Q.createdAt||T(Q)?(w(),$("div",RQ,[T(Q)?(w(),$("div",{key:0,class:Re(["u-edit-wrap",{undoing:b.value===Q.id}])},[x("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:W=>R(Q)},[ie(Xe,{name:"undo",size:"sm"})],8,DQ)],2)):re("",!0),Q.text.trim().length>0?(w(),$("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:yt(W=>Oe(Q),["stop"])},[N.value!==Q.id?(w(),ye(Xe,{key:0,name:"copy",size:"sm"})):(w(),ye(Xe,{key:1,name:"check",size:"sm"}))],8,BQ)):re("",!0),Q.createdAt?(w(),$("button",{key:2,type:"button",class:"u-time",onClick:yt(W=>S(Q.id),["stop"])},O(E(Q.createdAt,Q.id)),9,FQ)):re("",!0)])):re("",!0)])):Q.role==="compaction"?(w(),$("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":Q.id,role:"separator"},[z[11]||(z[11]=x("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Q.text?(w(),$("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:W=>d("openCompaction",{turnId:Q.id})},[x("span",null,O(P(Q)),1),x("span",zQ,O(C(s)("conversation.viewSummary")),1)],8,WQ)):(w(),$("span",UQ,O(P(Q)),1)),z[12]||(z[12]=x("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,HQ)):Q.role==="cron"?(w(),ye(z2,{key:2,text:Q.text,cron:Q.cron,"turn-id":Q.id},null,8,["text","cron","turn-id"])):(w(),$("div",{key:3,class:"a-msg turn-anchor","data-turn-id":Q.id},[(w(!0),$(Pe,null,tt(C(ZR)(Q),(W,Z)=>(w(),$(Pe,{key:C(t7)(W,Z)},[W.kind==="thinking"?(w(),ye(zG,{key:0,text:W.thinking,mobile:"",streaming:it(Q,W),onOpen:ue=>d("openThinking",{turnId:Q.id,blockIndex:W.sourceIndex})},null,8,["text","streaming","onOpen"])):W.kind==="text"&&W.text?(w(),$("div",qQ,[ie(Hh,{text:W.text,streaming:it(Q,W),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])])):W.kind==="tool-stack"?(w(),ye(a7,{key:2,tools:W.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:z[1]||(z[1]=ue=>d("openMedia",ue)),onOpenFile:z[2]||(z[2]=ue=>d("openFile",ue)),onOpenToolDiff:z[3]||(z[3]=ue=>d("openToolDiff",ue)),onOpenAgent:z[4]||(z[4]=ue=>d("openAgent",ue))},null,8,["tools","tool-diff-panel"])):W.kind==="tool"?(w(),ye(jA,{key:3,tool:W.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:z[5]||(z[5]=ue=>d("openMedia",ue)),onOpenFile:z[6]||(z[6]=ue=>d("openFile",ue)),onOpenToolDiff:z[7]||(z[7]=ue=>d("openToolDiff",ue)),onOpenAgent:z[8]||(z[8]=ue=>d("openAgent",ue))},null,8,["tool","tool-diff-panel"])):W.kind==="cron"?(w(),ye(z2,{key:4,text:W.text,cron:W.cron},null,8,["text","cron"])):re("",!0)],64))),128)),Q.id!==c.value&&ne(oe)&&(q(oe).trim().length>0||Q.durationMs!==void 0)?(w(),$("div",VQ,[ie(jt,{text:`${Q.durationMs} ms`},{default:_e(()=>[Q.durationMs!==void 0?(w(),$("span",KQ,O(C(YR)(Q.durationMs)),1)):re("",!0)]),_:2},1032,["text"]),q(oe).trim().length>0?(w(),$("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:W=>he(oe)},[N.value!==Q.id?(w(),ye(Xe,{key:0,name:"copy",size:"sm"})):(w(),ye(Xe,{key:1,name:"check",size:"sm"}))],8,GQ)):re("",!0)])):re("",!0)],8,jQ))],64))),128)),e.compaction?(w(),ye(KG,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(w(),$("div",YQ,[ie(O3,{fast:e.fastMoon},null,8,["fast"])])):re("",!0),e.queued.length>0?(w(),$("div",QQ,[x("div",XQ,[x("span",ZQ,[ie(Xe,{name:"mail",size:"sm"}),Ue(" "+O(C(s)("composer.queueLabel"))+" · ",1),x("b",null,O(e.queued.length),1)]),x("span",JQ,O(C(s)("composer.queueAutoDrain")),1)]),(w(!0),$(Pe,null,tt(e.queued,(Q,oe)=>(w(),$("div",{key:oe,class:Re(["u-turn q-turn",{"q-dragging":f.value===oe,"drop-before":h.value?.index===oe&&h.value.position==="before","drop-after":h.value?.index===oe&&h.value.position==="after"}]),onDragover:W=>k(oe,W),onDrop:W=>g(oe,W)},[x("div",tX,[x("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:W=>_(oe,W),onDragend:v},[ie(Xe,{name:"grip",size:"sm"})],40,nX),x("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:W=>m(oe)},[Q.text?(w(),$("span",oX,O(Q.text),1)):(w(),$("span",iX,[ie(Xe,{name:"image",size:"sm"}),Ue(" "+O(C(s)("composer.queuedImageOnly",{n:Q.attachments?.length??0})),1)]))],8,sX),p(Q)?(w(),$("div",rX,[(w(!0),$(Pe,null,tt(Q.attachments,(W,Z)=>(w(),ye(fv,{key:Z,url:W.url,kind:W.kind,"file-id":W.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):re("",!0),oe===0?(w(),$("span",lX,O(C(s)("composer.queueNext")),1)):(w(),$("span",aX,"#"+O(oe+1),1)),x("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:yt(W=>d("unqueue",oe),["stop"])},[ie(Xe,{name:"close",size:"sm"})],8,cX)])],42,eX))),128))])):re("",!0)]))}}),P3=dt(dX,[["__scopeId","data-v-d3e18be3"]]),fX={class:"ch-id"},pX={key:0,class:"ch-ws"},hX={key:1,class:"ch-sep"},mX=["onKeydown"],gX={class:"ch-ses"},vX={key:0,class:"ch-pill ch-sync-pill"},yX={key:0,class:"ch-ahead"},kX={key:1,class:"ch-behind"},bX={key:1,class:"ch-pill ch-diff-pill"},_X={key:0,class:"ch-add"},wX={key:1,class:"ch-del"},SX=qe({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=al(),o=e,i=t,r=B(()=>o.ahead??0),l=B(()=>o.behind??0),a=B(()=>o.gitDiffStats?.totalAdditions??0),c=B(()=>o.gitDiffStats?.totalDeletions??0),u=B(()=>a.value>0||c.value>0),d=J(!1),f=J(null),h=J(null),p=J({});function m(D){const F=D.target;h.value?.el?.contains(F)||f.value?.el?.contains(F)||g()}function _(){g()}async function k(D){if(D.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",_),await gt();const F=f.value?.el,U=h.value?.el;if(!F||!U)return;const G=F.getBoundingClientRect(),Y=4,q=8,ae=U.offsetWidth,de=U.offsetHeight;let ne=G.bottom+Y;ne+de>window.innerHeight-q&&(ne=Math.max(q,G.top-de-Y));let X=G.left;X+ae>window.innerWidth-q&&(X=Math.max(q,G.right-ae)),p.value={top:`${Math.round(ne)}px`,left:`${Math.round(X)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",_)}Tn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",_)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const T=J(!1);function P(){o.sessionId&&js(o.sessionId).then(D=>{D&&(T.value=!0,setTimeout(()=>{T.value=!1},1200))})}const N=J(!1),b=J(""),M=J(null);async function I(){if(g(),!!o.sessionId){N.value=!0,b.value=o.sessionTitle??"",await gt();try{M.value?.focus(),M.value?.select()}catch{}}}function L(){const D=b.value.trim();D&&o.sessionId&&D!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,D),N.value=!1}function S(){N.value=!1}function E(){o.sessionId&&(g(),i("forkSession",o.sessionId))}async function R(){o.sessionId&&(g(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(D,F)=>(w(),$("header",{class:Re(["chat-header",{"macos-desktop":C(BA)}])},[x("div",fX,[e.workspaceName?(w(),$("span",pX,O(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(w(),$("span",hX,"/")):re("",!0),N.value?Sn((w(),$("input",{key:2,ref_key:"renameInputRef",ref:M,"onUpdate:modelValue":F[0]||(F[0]=U=>b.value=U),class:"ch-rename",type:"text",onKeydown:[mi(yt(L,["stop"]),["enter"]),mi(yt(S,["stop"]),["esc"])],onBlur:L,onClick:F[1]||(F[1]=yt(()=>{},["stop"]))},null,40,mX)),[[ao,b.value]]):e.sessionTitle?(w(),ye(jt,{key:3,text:e.sessionTitle},{default:_e(()=>[x("span",gX,O(e.sessionTitle),1)]),_:1},8,["text"])):re("",!0)]),ie(Cn,{ref_key:"kebabRef",ref:f,class:Re(["ch-act-more",{open:d.value}]),label:C(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:F[2]||(F[2]=yt(U=>k(U),["stop"]))},{default:_e(()=>[ie(Xe,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),d.value?(w(),ye(zl,{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Xt(p.value),onClick:F[3]||(F[3]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{onClick:v},{default:_e(()=>[Ue(O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie(yn,{onClick:y},{default:_e(()=>[Ue(O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),$(Pe,{key:0},[ie(yn,{separator:""}),ie(yn,{onClick:P},{default:_e(()=>[Ue(O(T.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie(yn,{onClick:I},{default:_e(()=>[Ue(O(C(n)("header.renameSession")),1)]),_:1}),ie(yn,{onClick:E},{default:_e(()=>[Ue(O(C(n)("header.forkSession")),1)]),_:1}),ie(yn,{danger:"",onClick:R},{default:_e(()=>[Ue(O(C(n)("header.archiveSession")),1)]),_:1})],64)):re("",!0)]),_:1},8,["style"])):re("",!0),F[6]||(F[6]=x("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),$("button",{key:1,type:"button",class:"ch-git",onClick:F[4]||(F[4]=U=>i("openChanges"))},[x("span",{class:Re(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),r.value>0||l.value>0?(w(),$("span",vX,[r.value>0?(w(),$("span",yX,"↑"+O(r.value),1)):re("",!0),l.value>0?(w(),$("span",kX,"↓"+O(l.value),1)):re("",!0)])):re("",!0),u.value?(w(),$("span",bX,[a.value>0?(w(),$("span",_X,"+"+O(a.value),1)):re("",!0),c.value>0?(w(),$("span",wX,"-"+O(c.value),1)):re("",!0)])):re("",!0)])):re("",!0),e.pr?(w(),$("button",{key:2,type:"button",class:Re(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:F[5]||(F[5]=U=>e.pr&&i("openPr",e.pr.url))},[ie(Xe,{name:"git-pull-request",size:"sm"}),x("span",null,"PR #"+O(e.pr.number)+" · "+O(e.pr.state),1)],2)):re("",!0)],2))}}),CX=dt(SX,[["__scopeId","data-v-39760f19"]]),xX={key:0,class:"slash-menu",role:"listbox"},AX=["aria-selected","onMouseenter","onMousedown"],TX={class:"slash-name"},MX={class:"slash-desc"},EX=qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=J([]);return Ve(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),$("div",xX,[(w(!0),$(Pe,null,tt(e.items,(a,c)=>(w(),$("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Re(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:yt(u=>o("select",a),["prevent"])},[x("span",TX,O(a.name),1),x("span",MX,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,AX))),128))])):re("",!0)}}),IX=dt(EX,[["__scopeId","data-v-f60b70d9"]]),$X={class:"mention-menu",role:"listbox"},NX={key:0,class:"mention-state dim"},LX={key:1,class:"mention-state dim"},OX=["aria-selected","onMouseenter","onMousedown"],PX=["innerHTML"],RX={class:"mention-name"},DX={class:"mention-path"},BX=qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=Pa("folder","sm"),r=Pa("code","sm"),l=Pa("file-text","sm"),a=Pa("image","sm"),c=Pa("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const _=p.name||m.split("/").pop()||m,k=_.lastIndexOf("."),g=k>0?_.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(w(),$("div",$X,[n.loading?(w(),$("div",NX,O(C(o)("mention.searching")),1)):n.items.length===0?(w(),$("div",LX,O(C(o)("mention.noMatch")),1)):(w(!0),$(Pe,{key:2},tt(n.items,(_,k)=>(w(),$("div",{key:_.path,class:Re(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>s("hover",k),onMousedown:yt(g=>s("select",_),["prevent"])},[x("span",{class:"mention-icon",innerHTML:h(_),"aria-hidden":"true"},null,8,PX),x("span",RX,O(_.name),1),x("span",DX,O(_.path),1)],42,OX))),128))]))}}),FX=dt(BX,[["__scopeId","data-v-f4d6b958"]]),R3=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function HX(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function D3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...R3,...t]}function WX(e,t=R3){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 gd(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 Sy(e){return e?.supportEfforts??[]}function zX(e){return e[Math.floor(e.length/2)]}function U1(e){if(gd(e)==="unsupported")return"off";const t=Sy(e);return t.length>0?e?.defaultEffort??zX(t):"on"}function Cy(e){const t=Sy(e),n=gd(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function j1(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function UX(e){return e!=="off"}function Ql(e,t){if(e===void 0)return t;const n=gd(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?U1(e):"off";const s=Sy(e);return s.length>0?s.includes(t)?t:U1(e):"on"}function xy(e,t){return t==="off"?"off":t==="on"?U1(e):t}const zp=100;function jX(e){const t=cd($t.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>zp?n.slice(-zp):n,o={[e]:s};return _c($t.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function qX(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=J(jX(o())),r=B(()=>i.value[o()??""]??[]);let l=-1,a="";function c(k){const g=o();if(l=-1,!g)return;const v=k.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const T=[...y,v],P=T.length>zp?T.slice(-zp):T;i.value={...i.value,[g]:P},_c($t.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,gt(()=>{const g=n.value;if(!g)return;s();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function h(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return Ve(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:_}}function VX(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=J(!1),c=J([]),u=J(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=WX(h,D3(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} `,gt(()=>{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 KX(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=J(!1),r=J([]),l=J(0),a=J(!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 _=h.slice(m,p);return _.startsWith("@")?{token:_.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,gt(()=>{const _=n.value;if(!_)return;const k=p.start+h.path.length;_.setSelectionRange(k,k),_.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function GX(e){const{sessionId:t}=e;function n(c){return es($_(c))??""}function s(c,u){const d=$_(c);u?ss(d,u):pc(d)}const o=J(n(t())),i=J(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ve(o,c=>{gt(r),s(t(),c)}),Ve(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),gt(r))});function l(c){o.value=c,gt(()=>{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 YX(e){const{uploadImage:t,sessionId:n}=e,s=J({}),o=B(()=>s.value[n()??""]??[]),i=J(null),r=J(null),l=J(!1);let a=0;function c(){return`att_${++a}`}function u(L,S){s.value={...s.value,[L]:S}}function d(L){try{URL.revokeObjectURL(L.previewUrl)}catch{}}function f(L){return L.startsWith("image/")?"image":L.startsWith("video/")?"video":null}async function h(L){const S=t();if(!S)return;const E=n()??"",R=L.map(D=>({file:D,kind:f(D.type)})).filter(D=>D.kind!==null);if(R.length!==0)for(const{file:D,kind:F}of R){const U=c(),G=URL.createObjectURL(D),Y={localId:U,name:D.name,kind:F,previewUrl:G,uploading:!0};u(E,[...s.value[E]??[],Y]),S(D,D.name).then(q=>{const ae=s.value[E]??[];u(E,ae.map(de=>de.localId===U?{...de,uploading:!1,fileId:q?.fileId,error:q===null}:de))}).catch(()=>{const q=s.value[E]??[];u(E,q.map(ae=>ae.localId===U?{...ae,uploading:!1,error:!0}:ae))})}}function p(L){const S=n()??"",E=s.value[S]??[],R=E.find(D=>D.localId===L);i.value?.localId===L&&(i.value=null),R&&d(R),u(S,E.filter(D=>D.localId!==L))}function m(L){i.value=L}function _(){i.value=null}function k(){r.value?.click()}function g(L){const S=L.target,E=Array.from(S.files??[]);h(E),S.value=""}function v(L){if(!t())return;const S=L.clipboardData;if(!S)return;const E=[],R=new Set,D=(F,U)=>{const G=`${F.size}:${F.type}:${U}`;if(R.has(G))return;R.add(G);const Y=F.type.split("/")[1]??"png",q=U.includes(".")?U:`paste-${Date.now()}.${Y}`;E.push(F instanceof File?F:new File([F],q,{type:F.type}))};for(const F of Array.from(S.items))if(F.kind==="file"&&f(F.type)){const U=F.getAsFile();U&&D(U,U.name||`paste-${Date.now()}.${F.type.split("/")[1]??"png"}`)}for(const F of Array.from(S.files))f(F.type)&&D(F,F.name);E.length!==0&&(L.preventDefault(),h(E))}function y(L){!t()||!Array.from(L.dataTransfer?.items??[]).some(E=>E.kind==="file")||(L.preventDefault(),l.value=!0)}function T(){l.value=!1}function P(L){if(l.value=!1,!t())return;L.preventDefault();const S=Array.from(L.dataTransfer?.files??[]);h(S)}function N(){const L=n()??"";for(const S of s.value[L]??[])d(S);u(L,[])}function b(L,S,E){const R=s.value[L]??[];R.some(D=>D.localId===S)&&u(L,R.map(D=>D.localId===S?{...D,...E}:D))}function M(L){return fetch(L).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function I(L){const S=n()??"";for(const E of s.value[S]??[])d(E);u(S,[]);for(const E of L){const R=c(),D=/^data:/i.test(E.url),F=/^blob:/i.test(E.url),U=E.name??E.kind;if(E.fileId){const G={localId:R,name:U,kind:E.kind,previewUrl:E.url,uploading:!1,fileId:E.fileId};u(S,[...s.value[S]??[],G]),!D&&!F&&pt().getFileBlob(E.fileId).then(Y=>{const q=URL.createObjectURL(Y);if(!(s.value[S]??[]).some(de=>de.localId===R)){URL.revokeObjectURL(q);return}b(S,R,{previewUrl:q})}).catch(()=>{})}else{const G=t();if(!G)continue;const Y={localId:R,name:U,kind:E.kind,previewUrl:E.url,uploading:!0};u(S,[...s.value[S]??[],Y]),M(E.url).then(q=>{const ae=U.includes(".")?U:`${U}.${q.type.split("/")[1]??"bin"}`;return G(q,ae)}).then(q=>{if(q===null){const ae=s.value[S]??[];u(S,ae.filter(de=>de.localId!==R));return}b(S,R,{uploading:!1,fileId:q.fileId})}).catch(()=>{const q=s.value[S]??[];u(S,q.filter(ae=>ae.localId!==R))})}}}return Ve(n,()=>{i.value=null}),bn(()=>{document.addEventListener("paste",v)}),Tn(()=>{document.removeEventListener("paste",v);for(const L of Object.values(s.value))for(const S of L)d(S);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:k,handleFileInputChange:g,handleDragOver:y,handleDragLeave:T,handleDrop:P,clearAfterSubmit:N,loadAttachments:I}}const QX={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},XX=["stroke-dasharray","stroke-dashoffset"],pv=7,ZX=qe({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*pv;return(s,o)=>(w(),$("svg",QX,[x("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:pv,fill:"none","stroke-width":"2.5"}),x("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:pv,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,XX)]))}}),JX=dt(ZX,[["__scopeId","data-v-a364f1f1"]]),eZ={key:0,class:"att-strip"},tZ=["onClick"],nZ=["src"],sZ=["src","alt"],oZ={key:2,class:"att-video-badge","aria-hidden":"true"},iZ={class:"att-name"},rZ={class:"att-err-icon"},lZ=["onClick"],aZ={class:"att-lightbox-card"},cZ=["src"],uZ=["src","alt"],dZ={class:"att-lightbox-name"},fZ={class:"composer-card"},pZ={class:"cin-wrap"},hZ={class:"input-row"},mZ=["placeholder"],gZ=["aria-label"],vZ={class:"toolbar-left"},yZ=["onKeydown"],kZ=["onClick"],bZ={class:"pd-check"},_Z={class:"pd-info"},wZ={class:"pd-desc"},SZ={class:"mode-label"},CZ={key:0,class:"mode-tag"},xZ={key:1,class:"mode-tag"},AZ={key:2,class:"mode-tag"},TZ={class:"mode-row-name"},MZ={class:"mode-row-name"},EZ={class:"mode-row-name"},IZ={key:0,class:"mode-row-actions"},$Z={class:"toolbar-right"},NZ=["aria-label"],LZ={class:"ctx-num"},OZ=["onKeydown"],PZ={key:0,class:"think-suffix"},RZ=["aria-label"],DZ=["aria-label"],BZ={key:0,class:"md-section"},FZ=["onClick"],HZ={class:"md-check"},WZ={class:"md-name"},zZ={class:"md-provider"},UZ={key:1,class:"md-divider"},jZ={key:2,class:"md-section"},qZ=["onClick"],VZ={class:"md-check"},KZ={class:"md-name"},GZ={key:3,class:"md-divider"},YZ={class:"md-name"},QZ={key:0,class:"md-note"},XZ=["aria-label"],ZZ=["disabled","onClick"],JZ={class:"md-name"},iC=36,eJ=qe({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=B(()=>s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=Tt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=GX({sessionId:()=>s.sessionId}),f=J(!1);function h(){f.value=!f.value,gt(()=>{c(),k(),a.value?.focus()})}function p(){f.value&&(f.value=!1,gt(c))}function m(Ye){if(typeof getComputedStyle>"u")return iC;const et=Number.parseFloat(getComputedStyle(Ye).minHeight);return Number.isFinite(et)&&et>0?et:iC}const _=J(!1);function k(){const Ye=a.value;_.value=!!Ye&&Ye.scrollHeight>m(Ye)}Ve(l,()=>{gt(k)}),Ve(()=>s.sessionId,()=>{f.value=!1});const g=qX({text:l,textareaRef:a,autosize:c,sessionId:()=>s.sessionId}),{open:v,items:y,active:T,update:P,select:N}=VX({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>g.push(Ye),clearDraft:d}),{open:b,items:M,active:I,loading:L,update:S,select:E}=KX({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function R(){g.resetBrowsing(),P(),S()}const{attachments:D,previewAttachment:F,fileInputRef:U,isDragOver:G,removeAttachment:Y,openAttachmentPreview:q,closeAttachmentPreview:ae,openFilePicker:de,handleFileInputChange:ne,handleDragOver:X,handleDragLeave:he,handleDrop:Oe,clearAfterSubmit:je,loadAttachments:it}=YX({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});bn(()=>{l.value&>(()=>{c(),k()})}),Tn(()=>{document.removeEventListener("mousedown",xt),ue()});function ce(){a.value?.focus({preventScroll:!0})}function z(Ye){it(Ye)}t({loadForEdit:u,loadAttachmentsForEdit:z,focus:ce});function Q(){const Ye=l.value.trim();if(D.value.some(Bt=>Bt.uploading))return;const et=D.value.filter(Bt=>!Bt.uploading&&!Bt.error&&Bt.fileId);if(!Ye&&et.length===0)return;if(g.push(Ye),Ye){const Bt=HX(Ye),Uo=Bt?D3(s.skills).some(Oi=>Oi.name===Bt.cmd):!1;if(Bt&&Uo){l.value="",d(),v.value=!1,p(),i("command",Bt.arg?`${Bt.cmd} ${Bt.arg}`:Bt.cmd);return}}const st={text:Ye,attachments:et.map(Bt=>({fileId:Bt.fileId,kind:Bt.kind}))};F.value=null,je(),l.value="",d(),v.value=!1,b.value=!1,p(),i("submit",st)}function oe(){if(!s.running||D.value.some(Bt=>Bt.uploading))return;const Ye=l.value.trim(),et=D.value.filter(Bt=>!Bt.uploading&&!Bt.error&&Bt.fileId);if(!Ye&&et.length===0&&s.queued.length===0)return;const st={text:Ye,attachments:et.map(Bt=>({fileId:Bt.fileId,kind:Bt.kind}))};je(),g.push(Ye),l.value="",d(),v.value=!1,b.value=!1,p(),i("steer",st)}let W=!1,Z=null;function ue(){Z!==null&&(clearTimeout(Z),Z=null)}function le(){ue(),W=!0}function me(){ue(),Z=setTimeout(()=>{Z=null,W=!1},0)}function j(Ye){return W||Ye.isComposing||Ye.keyCode===229}function ee(Ye){if(!j(Ye)){if(Ye.key==="Escape"){if(Te.value){Ye.preventDefault(),Ge();return}if(Ie.value){Ye.preventDefault(),kt();return}}if(v.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),T.value=(T.value+1)%y.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),T.value=(T.value-1+y.value.length)%y.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const et=y.value[T.value];et&&N(et);return}if(Ye.key==="Escape"){Ye.preventDefault(),v.value=!1;return}}if(b.value&&!L.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),I.value=(I.value+1)%Math.max(1,M.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),I.value=(I.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const et=M.value[I.value];et&&E(et);return}if(Ye.key==="Escape"){Ye.preventDefault(),b.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){s.running&&(Ye.preventDefault(),oe());return}if(!f.value&&!v.value&&!b.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const et=g.isBrowsing();if(Ye.key==="ArrowUp"&&g.hasHistory()&&(et||g.caretAtTextStart())){Ye.preventDefault(),g.recallOlder();return}if(Ye.key==="ArrowDown"&&et){Ye.preventDefault(),g.recallNewer();return}}if(Ye.key==="Enter"&&!Ye.shiftKey){if(f.value&&!(Ye.metaKey||Ye.ctrlKey))return;Ye.preventDefault(),Q()}}}const pe=B(()=>r("composer.send")),ke=B(()=>!!s.uploadImage),Te=J(!1),Ie=J(!1),fe=J(null);function Me(){Te.value=!Te.value,Te.value?(Ie.value=!1,_n(),document.addEventListener("click",bt,!0)):document.removeEventListener("click",bt,!0)}function Ge(){Te.value=!1,Ie.value||document.removeEventListener("click",bt,!0)}function lt(){Ie.value=!Ie.value,Ie.value?(Te.value=!1,_n(),document.addEventListener("click",bt,!0)):document.removeEventListener("click",bt,!0)}function kt(){Ie.value=!1,Te.value||document.removeEventListener("click",bt,!0)}function bt(Ye){fe.value&&!fe.value.contains(Ye.target)&&(Ge(),kt())}Tn(()=>{document.removeEventListener("click",bt,!0)});const Et=Ye=>`${Math.round(Ye/1e3)}k`,Rt=B(()=>{const Ye=s.status?.ctxMax??0;return Ye<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ye*100)))}),vt=B(()=>{const Ye=(s.status?.ctxUsed??0).toLocaleString(),et=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:et,pct:Rt.value})}),qt=B(()=>Rt.value>=80),dn=B(()=>{const Ye=s.status?.modelId??s.status?.model??"";return s.models?.find(et=>et.id===Ye||et.model===Ye||et.displayName===s.status?.model)}),os=B(()=>gd(dn.value)),Vt=B(()=>Cy(dn.value)),fn=B(()=>Ql(dn.value,s.thinking??"off")),Ds=B(()=>{const Ye=Vt.value,et=fn.value;return Ye.includes(et)?et:Ye.includes("on")?"on":Ye[0]??"off"}),nt=B(()=>os.value==="always-on"?!0:os.value==="unsupported"?!1:UX(fn.value)),Dn=B(()=>os.value==="unsupported"||Vt.value.length<=1),is=B(()=>{if(!nt.value)return"";const Ye=(dn.value?.supportEfforts?.length??0)>0,et=fn.value;return Ye&&et!=="on"?r("composer.thinkingSuffixEffort",{level:et}):r("composer.thinkingSuffix")});function Vn(Ye){Dn.value||i("setThinking",xy(dn.value,Ye))}const Kn=B(()=>s.planMode===!0),Yt=B(()=>s.swarmMode===!0),Gn=B(()=>s.activationBadges?.goal!==null),Ke=B(()=>Gn.value||s.goalMode===!0),Qe=J(!1),Dt=J(null),tn=J(null),ln=J({}),Zt=B(()=>Kn.value||Yt.value||Ke.value);function _n(){Qe.value=!1,document.removeEventListener("mousedown",xt)}function xt(Ye){const et=Ye.target;Dt.value?.contains(et)||tn.value?.contains(et)||_n()}function Yn(){if(Qe.value){_n();return}Ge(),kt();const Ye=Dt.value?.getBoundingClientRect();Ye&&(ln.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),Qe.value=!0,setTimeout(()=>document.addEventListener("mousedown",xt),0)}const Wt=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function ys(Ye){i("setPermission",Ye),kt()}const Cs=B(()=>Wt.find(Ye=>Ye.mode===s.status?.permission)),Co=B(()=>Cs.value?r(Cs.value.labelKey):""),Vs=B(()=>dn.value?.provider??""),co=B(()=>!Vs.value||!s.models?.length?[]:s.models.filter(Ye=>Ye.provider===Vs.value)),uo=B(()=>new Set(s.starredIds??[]));function Lt(Ye){return uo.value.has(Ye)}const Wo=B(()=>s.models?.length?s.models.filter(Ye=>Lt(Ye.id)&&Ye.provider!==Vs.value):[]);function zo(Ye){i("selectModel",Ye),Ge()}return(Ye,et)=>(w(),$("div",{class:Re(["composer",{"drag-over":C(G),expanded:f.value}]),onDragover:et[17]||(et[17]=(...st)=>C(X)&&C(X)(...st)),onDragleave:et[18]||(et[18]=(...st)=>C(he)&&C(he)(...st)),onDrop:et[19]||(et[19]=(...st)=>C(Oe)&&C(Oe)(...st))},[C(D).length>0?(w(),$("div",eZ,[(w(!0),$(Pe,null,tt(C(D),st=>(w(),$("div",{key:st.localId,class:Re(["att-chip",{"att-error":st.error}])},[ie(jt,{text:C(r)("composer.previewAttachment",{name:st.name})},{default:_e(()=>[x("button",{type:"button",class:"att-preview",onClick:Bt=>C(q)(st)},[st.kind==="video"?(w(),$("video",{key:0,class:"att-thumb",src:st.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,nZ)):(w(),$("img",{key:1,class:"att-thumb",src:st.previewUrl,alt:st.name},null,8,sZ)),st.kind==="video"?(w(),$("span",oZ,[ie(Xe,{name:"play",size:"sm"})])):re("",!0)],8,tZ)]),_:2},1032,["text"]),x("span",iZ,O(st.name),1),st.uploading?(w(),ye(ri,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):st.error?(w(),ye(jt,{key:1,text:C(r)("composer.uploadFailed")},{default:_e(()=>[x("span",rZ,[ie(Xe,{name:"info",size:"sm"})])]),_:1},8,["text"])):re("",!0),ie(jt,{text:C(r)("composer.removeNamed",{name:st.name})},{default:_e(()=>[x("button",{class:"att-rm",onClick:Bt=>C(Y)(st.localId)},[ie(Xe,{name:"close",size:"sm"})],8,lZ)]),_:2},1032,["text"])],2))),128))])):re("",!0),C(F)?(w(),$("div",{key:1,class:"att-lightbox",onClick:et[1]||(et[1]=yt((...st)=>C(ae)&&C(ae)(...st),["self"]))},[x("div",aZ,[ie(jt,{text:C(r)("model.close")},{default:_e(()=>[x("button",{type:"button",class:"att-lightbox-close",onClick:et[0]||(et[0]=(...st)=>C(ae)&&C(ae)(...st))},"✕")]),_:1},8,["text"]),C(F).kind==="video"?(w(),$("video",{key:0,class:"att-lightbox-media",src:C(F).previewUrl,controls:"",playsinline:""},null,8,cZ)):(w(),$("img",{key:1,class:"att-lightbox-media",src:C(F).previewUrl,alt:C(F).name},null,8,uZ)),x("div",dZ,O(C(F).name),1)])])):re("",!0),x("div",fZ,[x("div",pZ,[C(v)?(w(),ye(IX,{key:0,items:C(y),"active-index":C(T),onSelect:C(N),onHover:et[2]||(et[2]=st=>T.value=st)},null,8,["items","active-index","onSelect"])):re("",!0),C(b)?(w(),ye(FX,{key:1,items:C(M),"active-index":C(I),loading:C(L),onSelect:C(E),onHover:et[3]||(et[3]=st=>I.value=st)},null,8,["items","active-index","loading","onSelect"])):re("",!0),x("div",hZ,[Sn(x("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":et[4]||(et[4]=st=>ns(l)?l.value=st:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:ee,onCompositionstart:le,onCompositionend:me,onInput:R},null,40,mZ),[[ao,C(l)]]),f.value||_.value?(w(),$("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:h},[f.value?(w(),ye(Xe,{key:0,name:"collapse",size:"sm"})):(w(),ye(Xe,{key:1,name:"expand",size:"sm"}))],8,gZ)):re("",!0)])]),ke.value?(w(),$("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:et[5]||(et[5]=(...st)=>C(ne)&&C(ne)(...st))},null,544)):re("",!0),x("div",{ref_key:"toolbarRef",ref:fe,class:"toolbar"},[x("div",vZ,[ke.value?(w(),ye(Cn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(de)},{default:_e(()=>[ie(Xe,{name:"image"})]),_:1},8,["label","onClick"])):re("",!0),e.status?(w(),$("span",{key:1,class:Re(["perm-pill",["perm-"+e.status.permission,{open:Ie.value}]]),role:"button",tabindex:"0",onClick:yt(lt,["stop"]),onKeydown:[mi(lt,["enter"]),mi(yt(lt,["prevent"]),["space"])]},O(Co.value),43,yZ)):re("",!0),Ie.value&&e.status?(w(),$("div",{key:2,class:"perm-dropdown",role:"menu",onClick:et[6]||(et[6]=yt(()=>{},["stop"]))},[(w(),$(Pe,null,tt(Wt,st=>x("button",{key:st.mode,class:Re(["pd-row",{"is-current":st.mode===e.status.permission}]),role:"menuitem",onClick:Bt=>ys(st.mode)},[x("span",bZ,[st.mode===e.status.permission?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),x("span",_Z,[x("span",{class:"pd-name",style:Xt({color:st.color})},O(C(r)(st.labelKey)),5),x("span",wZ,O(C(r)(st.descKey)),1)])],10,kZ)),64))])):re("",!0),e.status?(w(),$("div",{key:3,ref_key:"modesRef",ref:Dt,class:"modes"},[x("button",{type:"button",class:Re(["mode-pill",{on:Zt.value,open:Qe.value}]),onClick:yt(Yn,["stop"])},[x("span",SZ,O(C(r)("status.modesLabel")),1),Kn.value?(w(),$("span",CZ,O(C(r)("status.planLabel")),1)):re("",!0),Yt.value?(w(),$("span",xZ,O(C(r)("status.swarmLabel")),1)):re("",!0),Ke.value?(w(),$("span",AZ,O(C(r)("status.goalLabel")),1)):re("",!0)],2),Qe.value?(w(),$("div",{key:0,ref_key:"modesMenuRef",ref:tn,class:"modes-menu",style:Xt(ln.value)},[x("button",{type:"button",class:Re(["mode-row",{on:Kn.value}]),onClick:et[7]||(et[7]=st=>i("togglePlan"))},[x("span",TZ,O(C(r)("status.planLabel")),1),x("span",{class:Re(["mode-switch",{on:Kn.value}])},[...et[20]||(et[20]=[x("span",{class:"mode-knob"},null,-1)])],2)],2),x("button",{type:"button",class:Re(["mode-row",{on:Yt.value}]),onClick:et[8]||(et[8]=st=>i("toggleSwarm"))},[x("span",MZ,O(C(r)("status.swarmLabel")),1),x("span",{class:Re(["mode-switch",{on:Yt.value}])},[...et[21]||(et[21]=[x("span",{class:"mode-knob"},null,-1)])],2)],2),x("div",{class:Re(["mode-row mode-row-goal",{on:Gn.value||s.goalMode}])},[x("button",{type:"button",class:"mode-row-main",onClick:et[9]||(et[9]=st=>Gn.value?i("controlGoal","cancel"):i("toggleGoal"))},[x("span",EZ,O(C(r)("status.goalLabel")),1),Gn.value?re("",!0):(w(),$("span",{key:0,class:Re(["mode-switch",{on:s.goalMode}])},[...et[22]||(et[22]=[x("span",{class:"mode-knob"},null,-1)])],2))]),Gn.value?(w(),$("div",IZ,[x("button",{type:"button",class:"mode-row-action",onClick:et[10]||(et[10]=st=>i("controlGoal","pause"))},O(C(r)("status.goalPause")),1),x("button",{type:"button",class:"mode-row-action",onClick:et[11]||(et[11]=st=>i("controlGoal","resume"))},O(C(r)("status.goalResume")),1)])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),x("div",$Z,[qt.value?(w(),$("button",{key:0,class:"compact-chip",onClick:et[12]||(et[12]=yt(st=>i("compact"),["stop"]))},"/compact")):re("",!0),ie(jt,{text:vt.value},{default:_e(()=>[e.status&&!e.hideContext?(w(),$("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":vt.value},[ie(JX,{pct:Rt.value},null,8,["pct"]),x("span",LZ,O(Et(e.status.ctxUsed))+"/"+O(Et(e.status.ctxMax)),1)],8,NZ)):re("",!0)]),_:1},8,["text"]),e.status?(w(),$("span",{key:1,class:Re(["model-pill",{open:Te.value}]),role:"button",tabindex:"0",onClick:yt(Me,["stop"]),onKeydown:[mi(Me,["enter"]),mi(yt(Me,["prevent"]),["space"])]},[x("b",null,O(e.status.model),1),is.value?(w(),$("span",PZ,O(is.value),1)):re("",!0),ie(Xe,{class:"cv",name:"chevron-down",size:"sm"})],42,OZ)):re("",!0),e.running?(w(),ye(jt,{key:2,text:C(r)("composer.interruptTitle")},{default:_e(()=>[x("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:et[13]||(et[13]=st=>i("interrupt"))},[ie(Xe,{name:"stop",size:"sm"})],8,RZ)]),_:1},8,["text"])):re("",!0),x("button",{class:"send","aria-label":pe.value,onClick:et[14]||(et[14]=st=>Q())},[ie(Xe,{name:"send",size:"sm"})],8,DZ)]),Te.value&&e.status?(w(),$("div",{key:0,class:"model-dropdown",role:"menu",onClick:et[16]||(et[16]=yt(()=>{},["stop"]))},[Wo.value.length>0?(w(),$("div",BZ,O(C(r)("status.starredModels")),1)):re("",!0),(w(!0),$(Pe,null,tt(Wo.value,st=>(w(),$("button",{key:st.id,class:Re(["md-row",{"is-current":st.id===e.status.modelId}]),role:"menuitem",onClick:Bt=>zo(st.id)},[x("span",HZ,[st.id===e.status.model||st.model===e.status.model||st.displayName===e.status.model?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),x("span",WZ,O(st.displayName??st.model),1),x("span",zZ,O(st.provider),1),ie(Xe,{class:"md-star",name:"star",size:"sm"})],10,FZ))),128)),Wo.value.length>0?(w(),$("div",UZ)):re("",!0),co.value.length>0?(w(),$("div",jZ,O(Vs.value),1)):re("",!0),(w(!0),$(Pe,null,tt(co.value,st=>(w(),$("button",{key:st.id,class:Re(["md-row",{"is-current":st.id===e.status.modelId}]),role:"menuitem",onClick:Bt=>zo(st.id)},[x("span",VZ,[st.id===e.status.model||st.model===e.status.model||st.displayName===e.status.model?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),x("span",KZ,O(st.displayName??st.model),1),Lt(st.id)?(w(),ye(Xe,{key:0,class:"md-star",name:"star",size:"sm"})):re("",!0)],10,qZ))),128)),co.value.length>0?(w(),$("div",GZ)):re("",!0),x("div",{class:Re(["md-thinking",{"is-readonly":Dn.value}])},[x("span",YZ,O(C(r)("status.thinkingLabel")),1),os.value==="unsupported"?(w(),$("span",QZ,O(C(r)("status.modeNotSupported")),1)):(w(),$("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(w(!0),$(Pe,null,tt(Vt.value,st=>(w(),$("button",{key:st,type:"button",class:Re(["effort-seg",{"is-active":st===Ds.value}]),disabled:Dn.value,onClick:Bt=>Vn(st)},O(C(j1)(st)),11,ZZ))),128))],8,XZ))],2),et[23]||(et[23]=x("div",{class:"md-divider"},null,-1)),x("button",{class:"md-row md-row-more",role:"menuitem",onClick:et[15]||(et[15]=st=>{Ge(),i("pickModel")})},[x("span",JZ,O(C(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),B3=dt(eJ,[["__scopeId","data-v-62d29906"]]),tJ={key:0,class:"ui-card__head"},nJ={class:"ui-card__body"},sJ={key:1,class:"ui-card__foot"},oJ=qe({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),$("div",{class:Re(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),$("div",tJ,[Ln(t.$slots,"head",{},void 0,!0)])):re("",!0),x("div",nJ,[Ln(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),$("div",sJ,[Ln(t.$slots,"foot",{},void 0,!0)])):re("",!0)],2))}}),Ay=dt(oJ,[["__scopeId","data-v-9c9f9a9a"]]),iJ=["type","disabled"],rJ={class:"ui-button__content"},lJ=qe({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),$("button",{class:Re(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),ye(ri,{key:0,size:"sm",class:"ui-button__spinner"})):re("",!0),x("span",rJ,[Ln(t.$slots,"default",{},void 0,!0)])],10,iJ))}}),Pt=dt(lJ,[["__scopeId","data-v-e58393a8"]]),aJ={class:"goal-progress","aria-hidden":"true"},cJ={class:"goal-full"},uJ={key:0,class:"goal-criterion"},dJ={class:"goal-stats"},fJ={class:"goal-actions"},pJ=qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=J(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=B(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(w(),ye(Ay,{class:Re(["goal-strip",{expanded:i.value}])},c0({head:_e(()=>[x("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[4]||(c[4]=x("span",{class:"goal-kicker"},"Goal",-1)),x("span",{class:Re(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),ie(Ls,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:_e(()=>[Ue(O(e.goal.status),1)]),_:1},8,["variant"]),x("span",aJ,[x("span",{class:"goal-progress-fill",style:Xt({width:`${r.value}%`})},null,4)]),ie(Xe,{class:Re(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:_e(()=>[x("div",cJ,O(e.goal.objective),1),e.goal.completionCriterion?(w(),$("div",uJ,[c[5]||(c[5]=x("span",null,"Done when",-1)),x("p",null,O(e.goal.completionCriterion),1)])):re("",!0),x("div",dJ,[ie(Ls,{variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(e.goal.turnsUsed)+" turns",1)]),_:1}),ie(Ls,{variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),ie(Ls,{variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(w(),ye(Ls,{key:0,variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(r.value)+"% token budget",1)]),_:1})):re("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:_e(()=>[x("div",fJ,[e.goal.status!=="paused"?(w(),ye(Pt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=yt(u=>s("controlGoal","pause"),["stop"]))},{default:_e(()=>[Ue(O(C(o)("status.goalPause")),1)]),_:1})):re("",!0),e.goal.status==="paused"?(w(),ye(Pt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=yt(u=>s("controlGoal","resume"),["stop"]))},{default:_e(()=>[Ue(O(C(o)("status.goalResume")),1)]),_:1})):re("",!0),ie(Pt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=yt(u=>s("controlGoal","cancel"),["stop"]))},{default:_e(()=>[Ue(O(C(o)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),hJ=dt(pJ,[["__scopeId","data-v-eaeefe1e"]]),mJ={class:"qh"},gJ={class:"qtitle"},vJ={key:0,class:"qstep"},yJ={key:1,class:"qmin-peek"},kJ={class:"qbody"},bJ=["aria-label"],_J=["aria-selected","aria-label","onClick"],wJ={class:"qstep-num"},SJ={key:1,class:"qheader-chip"},CJ={class:"qtext"},xJ={class:"qopts"},AJ=["onClick"],TJ={class:"qopt-key"},MJ={class:"qopt-glyph"},EJ={key:0,class:"chk"},IJ={key:1,class:"rad"},$J={class:"qopt-text"},NJ={class:"qopt-label"},LJ={key:0,class:"qopt-desc"},OJ={class:"qopt-glyph"},PJ={key:0,class:"chk"},RJ={key:1,class:"rad"},DJ={class:"qopt-label"},BJ=["placeholder"],FJ={class:"qfoot"},HJ=qe({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Tt(),o=t,i=J(0),r=J(!1),l=B(()=>n.question.questions[i.value]),a=B(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(F){F>=0&&F<a.value&&(i.value=F)}function f(F){const U=p.value[F];return U?U.kind==="multi"?U.optionIds.length>0:U.kind==="multiWithOther"?U.optionIds.length>0||U.otherText.trim().length>0:U.kind==="other"?U.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=J({});function m(F){return F.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${F.label} ${F.description??""}`.toLowerCase())}function _(){const F={...p.value};let U=!1;for(const G of n.question.questions){if(F[G.id])continue;const Y=G.options.filter(m);Y.length!==0&&(F[G.id]=G.multiSelect?{kind:"multi",optionIds:Y.map(q=>q.id)}:{kind:"single",optionId:Y[0].id},U=!0)}U&&(p.value=F)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function k(F,U){const G=p.value[F];if(G&&G.kind==="single"&&G.optionId===U){const Y={...p.value};delete Y[F],p.value=Y}else p.value={...p.value,[F]:{kind:"single",optionId:U}}}function g(F,U){const G=p.value[F],Y=G&&(G.kind==="multi"||G.kind==="multiWithOther")?G.kind==="multi"?[...G.optionIds]:[...G.optionIds]:[],q=Y.indexOf(U);q>=0?Y.splice(q,1):Y.push(U);const ae=p.value[F],de=ae&&ae.kind==="multiWithOther"?ae.otherText:"";de?p.value={...p.value,[F]:{kind:"multiWithOther",optionIds:Y,otherText:de}}:p.value={...p.value,[F]:{kind:"multi",optionIds:Y}}}const v=J({}),y=J(null);function T(F){const U=n.question.questions.find(Y=>Y.id===F),G=v.value[F]??"";if(U.multiSelect){const Y=p.value[F],q=Y&&(Y.kind==="multi"||Y.kind==="multiWithOther")?Y.kind==="multi"?[...Y.optionIds]:[...Y.optionIds]:[];p.value={...p.value,[F]:{kind:"multiWithOther",optionIds:q,otherText:G}}}else p.value={...p.value,[F]:{kind:"other",text:G}}}function P(F){T(F),gt(()=>y.value?.focus())}function N(F,U){const G=p.value[F];return G?G.kind==="single"?G.optionId===U:G.kind==="multi"||G.kind==="multiWithOther"?G.optionIds.includes(U):!1:!1}function b(F){const U=p.value[F];return!!(U&&(U.kind==="other"||U.kind==="multiWithOther"))}function M(){return n.question.questions.every(F=>f(F.id))}const I=B(()=>n.busyKind==="answer"),L=B(()=>n.busyKind==="dismiss"),S=B(()=>!!n.busyKind);function E(){if(S.value||!M())return;const F={answers:p.value,method:"click"};o("answer",n.question.questionId,F)}function R(){S.value||o("dismiss",n.question.questionId)}function D(F){const U=(document.activeElement?.tagName??"").toLowerCase(),G=U==="input"||U==="textarea";if(S.value)return;if(F.key==="Enter"){if(F.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():M()&&E();return}if(G)return;if(F.key==="Escape"){F.preventDefault(),R();return}if(r.value)return;const Y=parseInt(F.key,10);if(!isNaN(Y)&&Y>=1&&Y<=9){F.preventDefault();const q=l.value,ae=Y-1,de=q.options[ae];de&&(q.multiSelect?g(q.id,de.id):k(q.id,de.id))}}return bn(()=>document.addEventListener("keydown",D)),Tn(()=>document.removeEventListener("keydown",D)),(F,U)=>(w(),ye(Ay,{class:Re(["qcard",{minimized:r.value}])},c0({head:_e(()=>[x("div",mJ,[U[5]||(U[5]=x("span",{class:"qh-ic"},"?",-1)),x("span",gJ,O(C(s)("question.title")),1),a.value>1&&!r.value?(w(),$("span",vJ,O(C(s)("question.step",{current:i.value+1,total:a.value})),1)):re("",!0),r.value?(w(),$("span",yJ,O(l.value.question),1)):re("",!0),ie(Cn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:U[0]||(U[0]=G=>r.value=!r.value)},{default:_e(()=>[r.value?(w(),ye(Xe,{key:0,name:"chevron-down",size:"md"})):(w(),ye(Xe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:_e(()=>[x("div",kJ,[a.value>1?(w(),$("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(w(!0),$(Pe,null,tt(n.question.questions,(G,Y)=>(w(),$("button",{key:G.id,type:"button",class:Re(["qstep-dot",{active:Y===i.value,answered:f(G.id)}]),"aria-selected":Y===i.value,"aria-label":C(s)("question.step",{current:Y+1,total:a.value}),onClick:q=>d(Y)},[x("span",wJ,O(Y+1),1)],10,_J))),128))],8,bJ)):re("",!0),l.value.header?(w(),$("div",SJ,[ie(Ls,{variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(l.value.header),1)]),_:1})])):re("",!0),x("div",CJ,O(l.value.question),1),l.value.body?(w(),ye(Hh,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),x("div",xJ,[(w(!0),$(Pe,null,tt(l.value.options,(G,Y)=>(w(),$("label",{key:G.id,class:Re(["qopt",{selected:N(l.value.id,G.id)}]),onClick:yt(q=>l.value.multiSelect?g(l.value.id,G.id):k(l.value.id,G.id),["prevent"])},[x("span",TJ,O(Y+1),1),x("span",MJ,[l.value.multiSelect?(w(),$("span",EJ,O(N(l.value.id,G.id)?"■":"□"),1)):(w(),$("span",IJ,O(N(l.value.id,G.id)?"●":"○"),1))]),x("span",$J,[x("span",NJ,O(G.label),1),G.description?(w(),$("span",LJ,O(G.description),1)):re("",!0)])],10,AJ))),128)),l.value.allowOther?(w(),$("label",{key:0,class:Re(["qopt",{selected:b(l.value.id)}]),onClick:U[4]||(U[4]=yt(G=>P(l.value.id),["prevent"]))},[U[6]||(U[6]=x("span",{class:"qopt-key"},null,-1)),x("span",OJ,[l.value.multiSelect?(w(),$("span",PJ,O(b(l.value.id)?"■":"□"),1)):(w(),$("span",RJ,O(b(l.value.id)?"●":"○"),1))]),x("span",DJ,O(l.value.otherLabel??C(s)("question.otherDefault")),1),Sn(x("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":U[1]||(U[1]=G=>v.value[l.value.id]=G),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:U[2]||(U[2]=G=>T(l.value.id)),onFocus:U[3]||(U[3]=G=>T(l.value.id))},null,40,BJ),[[ao,v.value[l.value.id]]])],2)):re("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:_e(()=>[x("div",FJ,[i.value<a.value-1?(w(),ye(Pt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:_e(()=>[Ue(O(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),ye(Pt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!M(),loading:I.value,onClick:E},{default:_e(()=>[Ue(O(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),ye(Pt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:_e(()=>[Ue(O(C(s)("question.back")),1)]),_:1},8,["disabled"])):re("",!0),ie(Pt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:L.value,disabled:S.value,onClick:R},{default:_e(()=>[Ue(O(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),WJ=dt(HJ,[["__scopeId","data-v-08fbd85e"]]),zJ={class:"ah"},UJ={class:"akind"},jJ={class:"apath"},qJ={class:"ah-path"},VJ={key:1,class:"diff"},KJ={class:"dg"},GJ={class:"dc"},YJ={key:2,class:"body-shell"},QJ={class:"shell-cmd"},XJ={key:0,class:"shell-cwd"},ZJ={key:1,class:"shell-danger"},JJ={key:3,class:"body-file"},eee={class:"file-bar"},tee={class:"file-lang"},nee={class:"file-content"},see={class:"file-ln"},oee={class:"file-text"},iee={key:4,class:"body-chip"},ree={class:"chip-label"},lee={class:"chip-value"},aee={key:0,class:"chip-detail"},cee={key:5,class:"body-chip"},uee={key:0,class:"chip-label"},dee={class:"chip-value"},fee={key:6,class:"body-chip"},pee={class:"chip-label"},hee={class:"chip-value"},mee={key:0,class:"chip-detail"},gee={key:7,class:"body-chip"},vee={class:"chip-label"},yee={class:"chip-value"},kee={key:0,class:"chip-detail"},bee={key:8,class:"body-todo"},_ee={class:"todo-glyph"},wee={key:9,class:"body-plan"},See={key:10,class:"body-generic"},Cee={class:"gen-text"},xee={key:11,class:"feedback-wrap"},Aee=["placeholder"],Tee={class:"feedback-hint"},Mee={key:0,class:"plan-actions"},Eee={class:"k"},Iee={key:0,class:"k"},$ee={key:0,class:"k"},Nee={key:1,class:"abtn"},Lee=qe({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=B(()=>{const I=n.block;return I.kind!=="plan_review"?null:{plan:I.plan,path:I.path,options:I.options??[]}}),r=J(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const I=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${I}`)}const c=J(!1),u=J(""),d=J(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const I=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:I||void 0}):k("feedback",{decision:"rejected",feedback:I||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(I){I.key==="Enter"&&!I.shiftKey?(I.preventDefault(),h()):I.key==="Escape"&&(I.preventDefault(),p())}const _=J(null);Ve(()=>n.busy,I=>{I||(_.value=null)});function k(I,L){n.busy||(_.value=I,s("decide",L))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function y(){k("reject",{decision:"rejected"})}function T(){k("approvePlan",{decision:"approved"})}function P(I){k(`option:${I}`,{decision:"approved",selectedLabel:I})}function N(){n.busy||f()}function b(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function M(I){const L=(document.activeElement?.tagName??"").toLowerCase();if(L==="input"||L==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){I.key==="1"?(I.preventDefault(),T()):I.key==="2"?(I.preventDefault(),N()):I.key==="3"&&(I.preventDefault(),b());return}I.key==="1"&&S.options[0]?(I.preventDefault(),P(S.options[0].label)):I.key==="2"&&S.options[1]?(I.preventDefault(),P(S.options[1].label)):I.key==="3"&&S.options[2]&&(I.preventDefault(),P(S.options[2].label));return}I.key==="1"?(I.preventDefault(),g()):I.key==="2"?(I.preventDefault(),v()):I.key==="3"?(I.preventDefault(),y()):I.key==="4"&&(I.preventDefault(),f())}return bn(()=>document.addEventListener("keydown",M)),Tn(()=>document.removeEventListener("keydown",M)),(I,L)=>(w(),ye(Ay,{class:Re(["appr",{minimized:r.value}])},c0({head:_e(()=>[x("div",zJ,[L[2]||(L[2]=x("span",{class:"ah-ic"},"!",-1)),x("span",UJ,O(a()),1),x("span",jJ,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),$(Pe,{key:0},[Ue(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),$(Pe,{key:1},[Ue(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),$(Pe,{key:2},[Ue(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),$(Pe,{key:3},[Ue(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),$(Pe,{key:4},[Ue(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),$(Pe,{key:5},[Ue(O(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!r.value?(w(),ye(Ls,{key:0,variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):re("",!0),r.value?re("",!0):(w(),ye(Ls,{key:1,variant:"warning",size:"sm",class:"aw"},{default:_e(()=>[Ue(O(C(o)("approval.required")),1)]),_:1})),ie(Cn,{class:"amin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:L[0]||(L[0]=S=>r.value=!r.value)},{default:_e(()=>[r.value?(w(),ye(Xe,{key:0,name:"chevron-down",size:"md"})):(w(),ye(Xe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:_e(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),ye(jt,{key:0,text:e.block.path},{default:_e(()=>[x("div",qJ,O(e.block.path),1)]),_:1},8,["text"])):re("",!0),e.block.kind==="diff"?(w(),$("div",VJ,[(w(!0),$(Pe,null,tt(e.block.diff,(S,E)=>(w(),$("div",{key:E,class:Re(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[x("span",KJ,O(S.gutter),1),x("span",GJ,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),$("div",YJ,[x("div",QJ,[L[3]||(L[3]=x("span",{class:"shell-dollar"},"$",-1)),Ue(" "+O(e.block.command),1)]),e.block.cwd?(w(),$("div",XJ,"cwd: "+O(e.block.cwd),1)):re("",!0),e.block.danger?(w(),$("div",ZJ,O(C(o)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(w(),$("div",JJ,[x("div",eee,[x("span",tee,O(e.block.language??""),1)]),x("div",nee,[(w(!0),$(Pe,null,tt(e.block.content.split(`
|
|
264
|
-
`),(S,E)=>(w(),$("div",{key:E,class:"file-line"},[x("span",see,O(E+1),1),x("span",oee,O(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),$("div",iee,[x("span",ree,O(e.block.op),1),x("span",lee,O(e.block.path),1),e.block.detail?(w(),$("span",aee,O(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(w(),$("div",cee,[e.block.method?(w(),$("span",uee,O(e.block.method),1)):re("",!0),x("span",dee,O(e.block.url),1)])):e.block.kind==="search"?(w(),$("div",fee,[x("span",pee,O(C(o)("approval.searchQueryLabel")),1),x("span",hee,O(e.block.query),1),e.block.scope?(w(),$("span",mee,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(w(),$("div",gee,[x("span",vee,O(e.block.kind2),1),x("span",yee,O(e.block.name),1),e.block.description?(w(),$("span",kee,O(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(w(),$("div",bee,[(w(!0),$(Pe,null,tt(e.block.items,(S,E)=>(w(),$("div",{key:E,class:"todo-item"},[x("span",_ee,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),x("span",{class:Re(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),$("div",wee,[ie(Hh,{text:e.block.plan},null,8,["text"])])):(w(),$("div",See,[x("span",Cee,O(e.block.summary),1)])),c.value?(w(),$("div",xee,[Sn(x("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":L[1]||(L[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Aee),[[ao,u.value]]),x("div",Tee,O(C(o)("approval.feedbackHint")),1)])):re("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:_e(()=>[i.value?(w(),$("div",Mee,[i.value.options.length>0?(w(!0),$(Pe,{key:0},tt(i.value.options,(S,E)=>(w(),ye(jt,{key:E,text:S.description},{default:_e(()=>[ie(Pt,{class:"kbtn",size:"sm",variant:"primary",loading:_.value===`option:${S.label}`,disabled:e.busy,onClick:R=>P(S.label)},{default:_e(()=>[Ue(O(S.label),1),x("span",Eee,"["+O(E+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),ye(Pt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approvePlan",disabled:e.busy,onClick:T},{default:_e(()=>[Ue(O(C(o)("approval.approvePlan")),1),L[4]||(L[4]=x("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),ie(Pt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:N},{default:_e(()=>[Ue(O(C(o)("approval.revise")),1),i.value.options.length===0?(w(),$("span",Iee,"[2]")):re("",!0)]),_:1},8,["disabled"]),ie(Pt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:_.value==="rejectAndExit",disabled:e.busy,onClick:b},{default:_e(()=>[Ue(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),$("span",$ee,"[3]")):re("",!0)]),_:1},8,["loading","disabled"])])):(w(),$("div",Nee,[ie(Pt,{class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approve",disabled:e.busy,onClick:g},{default:_e(()=>[Ue(O(C(o)("approval.approve")),1),L[5]||(L[5]=x("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),ie(Pt,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="approveSession",disabled:e.busy,onClick:v},{default:_e(()=>[Ue(O(C(o)("approval.approveSession")),1),L[6]||(L[6]=x("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),ie(Pt,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="reject",disabled:e.busy,onClick:y},{default:_e(()=>[Ue(O(C(o)("approval.reject")),1),L[7]||(L[7]=x("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),ie(Pt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:_e(()=>[Ue(O(C(o)("approval.feedback")),1),L[8]||(L[8]=x("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),Oee=dt(Lee,[["__scopeId","data-v-4c0c7bdb"]]),Pee=qe({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(w(),$("span",{class:Re(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),F3=dt(Pee,[["__scopeId","data-v-f595d935"]]),Ree={class:"taskspane"},Dee={class:"tp-head"},Bee={class:"tp-title"},Fee={class:"tp-count"},Hee={class:"tp-list"},Wee={key:0,class:"tp-empty"},zee=["role","onClick"],Uee={class:"tp-name"},jee={class:"tp-time"},qee=["onClick"],Vee={key:0,class:"tp-detail"},Kee={key:0,class:"tp-codebox"},Gee=["onClick"],Yee={class:"tp-pre"},Qee={class:"tp-cmd"},Xee={key:1,class:"tp-codebox"},Zee=["onClick"],Jee={class:"tp-pre"},ete=qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Tt(),o=Os(new Set),i=Os(new Set),r=Os(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,_){await js(p)&&(_.add(m),setTimeout(()=>_.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(`
|
|
265
|
-
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(w(),$("div",Ree,[x("div",Dee,[x("span",Bee,O(C(s)("tasks.tag")),1),x("span",Fee,O(e.tasks.length),1)]),x("div",Hee,[e.tasks.length===0?(w(),$("div",Wee,O(C(s)("tasks.emptyTasks")),1)):(w(!0),$(Pe,{key:1},tt(e.tasks,_=>(w(),$("div",{key:_.id,class:Re(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:c(_)}])},[x("div",{class:"tp-main",role:c(_)?"button":void 0,onClick:k=>a(_)},[ie(F3,{status:u(_.state)},null,8,["status"]),x("span",Uee,O(_.name),1),ie(Ls,{variant:"neutral",size:"sm"},{default:_e(()=>[Ue(O(_.kind),1)]),_:2},1024),x("span",jee,O(_.timing),1),_.state==="run"?(w(),$("button",{key:0,class:"tp-stop",onClick:yt(k=>n("cancel",_.id),["stop"])},O(C(s)("tasks.stop")),9,qee)):re("",!0),_.kind==="subagent"?(w(),ye(Xe,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(_)?(w(),ye(Xe,{key:2,class:Re(["tp-chevron",{open:o.has(_.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):re("",!0)],8,zee),o.has(_.id)&&l(_)?(w(),$("div",Vee,[_.meta?(w(),$("div",Kee,[x("button",{class:Re(["tp-copy",{copied:i.has(_.id)}]),onClick:yt(k=>f(_),["stop"])},O(i.has(_.id)?"已复制":"复制"),11,Gee),x("pre",Yee,[x("code",null,[x("span",Qee,O(_.meta),1)])])])):re("",!0),_.output&&_.output.length>0?(w(),$("div",Xee,[x("button",{class:Re(["tp-copy",{copied:r.has(_.id)}]),onClick:yt(k=>h(_),["stop"])},O(r.has(_.id)?"已复制":"复制"),11,Zee),x("pre",Jee,[x("code",null,[m[0]||(m[0]=Ue(`
|
|
266
|
-
`,-1)),(w(!0),$(Pe,null,tt(_.output,(k,g)=>(w(),$("span",{key:g,class:"tp-line"},O(k),1))),128)),m[1]||(m[1]=Ue(`
|
|
267
|
-
`,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),rC=dt(ete,[["__scopeId","data-v-28fd5fc0"]]),tte={class:"todo-card"},nte={key:0,class:"tc-empty"},ste={class:"tc-name"},ote=qe({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(w(),$("div",tte,[t.todos.length===0?(w(),$("div",nte,[i[0]||(i[0]=x("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"},[x("path",{d:"M9 11l2 2 4-4"}),x("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),x("span",null,O(C(n)("tasks.emptyTodo")),1)])):re("",!0),(w(!0),$(Pe,null,tt(t.todos,(r,l)=>(w(),$("div",{key:l,class:Re(["tc-row",`s-${r.status}`])},[ie(F3,{status:s(r.status)},null,8,["status"]),x("span",ste,O(r.title),1)],2))),128))]))}}),ite=dt(ote,[["__scopeId","data-v-01c65735"]]),rte=["disabled","aria-pressed"],lte=qe({__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?(w(),$("button",{key:0,class:Re(["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))},[Ln(t.$slots,"default",{},void 0,!0)],10,rte)):(w(),$("span",{key:1,class:Re(["ui-pill",{"is-active":e.active}])},[Ln(t.$slots,"default",{},void 0,!0)],2))}}),hv=dt(lte,[["__scopeId","data-v-317ace1a"]]),ate={class:"dock-work-head"},cte={key:0,class:"dock-work-tab static"},ute={key:1,class:"dock-work-tab static"},dte={key:2,class:"dock-work-tab static"},fte={class:"dock-work-body"},pte={class:"dw-count"},hte={class:"dw-count"},mte={class:"dw-count"},gte=qe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},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}=Tt(),r=J(null),l=J(null),a=J(null);function c(h){return r.value?(r.value.loadForEdit(h),!0):!1}function u(h){r.value?.loadAttachmentsForEdit(h)}function d(){r.value?.focus()}function f(h){if(!s.dockPanel)return;const p=h.target;p&&(l.value?.contains(p)||a.value?.contains(p)||o("close-dock-panel"))}return Ve(()=>s.dockPanel,h=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),h&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),Tn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(h,p)=>(w(),$("div",{class:Re(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:p[28]||(p[28]=yt(()=>{},["stop"]))},[ie(Zr,{name:"dock-panel"},{default:_e(()=>[e.dockPanel?(w(),$("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:p[3]||(p[3]=yt(()=>{},["stop"]))},[x("div",ate,[e.dockPanel==="bash"?(w(),$("span",cte,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),$("span",ute,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),$("span",dte,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):re("",!0)]),x("div",fte,[e.dockPanel==="bash"?(w(),ye(rC,{key:0,tasks:e.bashTasks,onCancel:p[0]||(p[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),ye(rC,{key:1,tasks:e.subagentTasks,onCancel:p[1]||(p[1]=m=>o("cancelTask",m)),onOpen:p[2]||(p[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),ye(ite,{key:2,todos:e.todos??[]},null,8,["todos"])):re("",!0)])],512)):re("",!0)]),_:1}),e.goal?(w(),ye(hJ,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:p[4]||(p[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(w(),$("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),ye(hv,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:p[5]||(p[5]=m=>o("toggle-dock-panel","bash"))},{default:_e(()=>[ie(Xe,{name:"clock",size:"md"}),x("span",null,O(C(i)("tasks.dockBash")),1),x("span",pte,[p[29]||(p[29]=Ue("(",-1)),x("b",null,O(e.bashTasks.length),1),p[30]||(p[30]=Ue(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),e.subagentTasks.length>0?(w(),ye(hv,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:p[6]||(p[6]=m=>o("toggle-dock-panel","subagent"))},{default:_e(()=>[ie(Xe,{name:"sparkles",size:"md"}),x("span",null,O(C(i)("tasks.dockSubagent")),1),x("span",hte,[p[31]||(p[31]=Ue("(",-1)),x("b",null,O(e.subagentTasks.length),1),p[32]||(p[32]=Ue(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),(e.todos?.length??0)>0?(w(),ye(hv,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:p[7]||(p[7]=m=>o("toggle-dock-panel","todos"))},{default:_e(()=>[ie(Xe,{name:"check-list",size:"md"}),x("span",null,O(C(i)("tasks.dockTodos")),1),x("span",mte,[p[33]||(p[33]=Ue("(",-1)),x("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),p[34]||(p[34]=Ue(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0)],512)):re("",!0),e.pendingQuestion?(w(),ye(WJ,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:p[8]||(p[8]=(m,_)=>o("answer",m,_)),onDismiss:p[9]||(p[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),ye(Oee,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:p[10]||(p[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(w(),ye(B3,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:p[11]||(p[11]=m=>o("submit",m)),onSteer:p[12]||(p[12]=m=>o("steer",m)),onCommand:p[13]||(p[13]=m=>o("command",m)),onInterrupt:p[14]||(p[14]=m=>o("interrupt")),onSetPermission:p[15]||(p[15]=m=>o("setPermission",m)),onSetThinking:p[16]||(p[16]=m=>o("setThinking",m)),onTogglePlan:p[17]||(p[17]=m=>o("togglePlan")),onToggleSwarm:p[18]||(p[18]=m=>o("toggleSwarm")),onToggleGoal:p[19]||(p[19]=m=>o("toggleGoal")),onOpenBtw:p[20]||(p[20]=m=>o("openBtw")),onCreateGoal:p[21]||(p[21]=m=>o("createGoal",m)),onControlGoal:p[22]||(p[22]=m=>o("controlGoal",m)),onFocusGoal:p[23]||(p[23]=m=>o("focusGoal")),onFocusSwarm:p[24]||(p[24]=m=>o("focusSwarm")),onCompact:p[25]||(p[25]=m=>o("compact")),onPickModel:p[26]||(p[26]=m=>o("pickModel")),onSelectModel:p[27]||(p[27]=m=>o("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),vte=dt(gte,[["__scopeId","data-v-1223755a"]]),yte=["aria-label","aria-hidden"],kte={class:"toc-scroll"},bte=["onClick"],_te={class:"toc-label"},wte=240,Ste=qe({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=J(null),r=J(!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>=wte}const c=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ve(c,u=>{l?.disconnect(),l=null,u&>(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ds(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),$("nav",{key:0,ref_key:"navRef",ref:i,class:Re(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[x("div",kte,[(w(!0),$(Pe,null,tt(e.items,f=>(w(),$("button",{key:f.id,type:"button",class:Re(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=x("span",{class:"toc-bar"},null,-1)),x("span",_te,O(f.title),1)],10,bte))),128))])],10,yte)):re("",!0)}}),Cte=dt(Ste,[["__scopeId","data-v-0a2a2a96"]]),xte=5;function Ate(e,t,n,s=xte){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 Tte={class:"chat-layout"},Mte={class:"empty-hint"},Ete={class:"empty-hint-title"},Ite={class:"empty-hint-text"},$te={key:0,class:"ws-pick"},Nte={class:"ws-pick-name"},Lte={key:1,class:"ws-pick-menu"},Ote=["onClick"],Pte={class:"ws-pick-item-name"},Rte={class:"ws-pick-item-path"},Dte=["aria-label"],Bte={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Fte={class:"abort-toast-text"},mv=80,lC=1e3,Hte=420,Wte=3e3,zte=qe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=J(!1),r=J(!1),l=B(()=>s.workspaces?.find(Ae=>Ae.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=B(()=>(s.workspaces?.length??0)>0),c=B(()=>Ate(s.workspaces??[],s.activeWorkspaceId,r.value)),u=B(()=>(s.workspaces?.length??0)-c.value.length);Ve(i,Ee=>{Ee||(r.value=!1)});function d(Ee){i.value=!1,Ee!==s.activeWorkspaceId&&o("selectWorkspace",Ee)}const{t:f}=Tt();pc($t.contentAlign);const h=J(null),p=J(null),m=J(null),_=J(!1),k=J(0);let g=null;function v(Ee,Ae){const Fe=m.value??p.value;return!Fe||Fe.loadForEdit(Ee)===!1?!1:(Fe.loadAttachmentsForEdit(Ae??[]),!0)}function y(){_.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,_.value=!1},2e3)}function T(){k.value++}const P=B(()=>s.tasks.filter(Ee=>Ee.kind!=="subagent")),N=B(()=>s.tasks.filter(Ee=>Ee.kind==="subagent"&&Ee.runInBackground)),b=B(()=>P.value.filter(Ee=>Ee.state==="run").length),M=B(()=>N.value.filter(Ee=>Ee.state==="run").length);function I(Ee){const Ae=s.tasks,Fe=Ae.find(zt=>zt.id===Ee)??Ae.find(zt=>zt.parentToolCallId===Ee);if(Fe)return Fe.id;const Nt=Ae.filter(zt=>zt.kind==="subagent"&&!zt.parentToolCallId);if(Nt.length===1)return Nt[0].id}$n("resolveAgentTaskId",I),$n("pinScroll",Ds);const L=B(()=>(s.todos??[]).filter(Ee=>Ee.status==="done").length),S=B(()=>P.value.length>0||N.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),E=J(null),R=B(()=>s.gitInfo?s.changes?.length??0:0);function D(Ee){E.value=E.value===Ee?null:Ee}function F(){E.value=null}Ve(S,Ee=>{Ee||F()});function U(Ee){if(Ee.role==="compaction")return f("conversation.compactedPlain");if(Ee.role==="user"){if(Ee.skillActivation)return`/${Ee.skillActivation.name}`;if(Ee.pluginCommand)return`/${Ee.pluginCommand.pluginId}:${Ee.pluginCommand.commandName}`;const Fe=Ee.text.trim().replaceAll(/\s+/g," ");return Fe.length>0?Fe:"user"}const Ae=(Ee.text||Ee.thinking||"").trim().replaceAll(/\s+/g," ");return Ae.length>0?Ae:(Ee.tools?.length??0)>0?`${Ee.tools.length} tools`:"kimi"}const G=B(()=>s.turns.filter(Ee=>Ee.role==="user").map((Ee,Ae)=>({id:Ee.id,role:Ee.role,no:Ae+1,title:U(Ee)}))),Y=J(null);function q(){const Ee=he.value;if(!Ee)return;const Ae=Ee.querySelectorAll(".turn-anchor[data-turn-id]");if(Ae.length===0)return;const Fe=G.value;if(Fe.length===0)return;const Nt=new Set(Fe.map(Fn=>Fn.id));if(le()<=mv){Y.value=Fe[Fe.length-1].id;return}const zt=Ee.getBoundingClientRect(),ts=zt.height/2;let Qn=null;Ae.forEach(Fn=>{const ft=Fn.dataset.turnId;if(!ft||!Nt.has(ft))return;Fn.getBoundingClientRect().top-zt.top<=ts&&(Qn=ft)}),Y.value=Qn??Fe[0].id}const ae=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),de=B(()=>{const Ee=ae.value;if(Ee)return s.pendingQuestionActions?.[Ee.questionId]}),ne=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),X=B(()=>{const Ee=ne.value;return Ee?!!s.pendingApprovalActions?.[Ee.approvalId]:!1}),he=J(null),Oe=J(null),je=J(0),it=J(0),ce=B(()=>({"--panes-scrollbar-width":`${je.value}px`}));function z(Ee){return Ee instanceof HTMLElement?Ee:Ee&&"$el"in Ee&&Ee.$el instanceof HTMLElement?Ee.$el:null}function Q(){const Ee=he.value;je.value=Ee?Math.max(0,Ee.offsetWidth-Ee.clientWidth):0,it.value=Oe.value?.offsetHeight??0}function oe(Ee){const Ae=z(Ee);he.value=Ae,Ae&&Lt()}function W(Ee){const Ae=z(Ee);Oe.value=Ae??null,Ee&&"loadForEdit"in Ee&&typeof Ee.loadForEdit=="function"&&"focus"in Ee&&typeof Ee.focus=="function"?m.value={loadForEdit:Ee.loadForEdit.bind(Ee),loadAttachmentsForEdit:"loadAttachmentsForEdit"in Ee&&typeof Ee.loadAttachmentsForEdit=="function"?Ee.loadAttachmentsForEdit.bind(Ee):()=>{},focus:Ee.focus.bind(Ee)}:m.value=null,uo()}const Z=J(!0),ue=J(!1);function le(){const Ee=he.value;return Ee?Ee.scrollHeight-Ee.scrollTop-Ee.clientHeight:0}let me=0,j=0,ee=0,pe=0,ke=0,Te=0;function Ie(){return Date.now()<j}function fe(){const Ee=he.value;if(!Ee)return;const Ae=Ee.scrollTop;if(fn()){me=Ae;return}if(performance.now()-ee<100){me=Ae;return}const Fe=le();if(Ie()){Z.value=!0,ue.value=!1,me=Ae;return}Ae<me-1&&Fe>1?(Z.value=!1,ue.value=!0):Fe<=mv&&Ae>me+1&&(Z.value=!0,ue.value=!1),me=Ae,q()}function Me(Ee=!1){const Ae=he.value;Z.value=!0,ue.value=!1,Ae&&(!Ee&&performance.now()<pe||(Ee&&typeof Ae.scrollTo=="function"?(ee=performance.now(),pe=performance.now()+Hte,Ae.scrollTo({top:Ae.scrollHeight,behavior:"smooth"})):Ae.scrollTop=Ae.scrollHeight,me=Ae.scrollTop))}function Ge(Ee,Ae){const Fe=Ee.querySelectorAll(".turn-anchor");for(const Nt of Fe)if(Nt.offsetTop>=Ae){const zt=Nt.dataset.turnId;if(zt)return{id:zt,top:Nt.offsetTop}}return null}async function lt(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ee=s.sessionId,Ae=he.value,Fe=Ae?.scrollTop??0,Nt=Ae?.scrollHeight??0,zt=Ae?Ge(Ae,Fe):null;Co.value=!0;try{await s.loadOlderMessages(Ee),await gt()}finally{Co.value=!1}if(s.sessionId!==Ee)return;const ts=he.value;if(!ts)return;let Qn=0;if(zt){const Fn=ts.querySelector(`.turn-anchor[data-turn-id="${kt(zt.id)}"]`);Fn&&(Qn=Fn.offsetTop-zt.top)}Qn===0&&(Qn=ts.scrollHeight-Nt),ts.scrollTop=Fe+Qn}function kt(Ee){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ee):Ee.replaceAll(/["\\]/g,"\\$&")}function bt(Ee){const Ae=he.value;if(!Ae)return;const Fe=Ae.querySelector(`.turn-anchor[data-turn-id="${kt(Ee)}"]`);Fe&&(Z.value=!1,ue.value=le()>mv,Fe.scrollIntoView({behavior:"smooth",block:"center"}))}function Et(){const Ee=he.value;if(!Ee)return"none";const Ae=Ee.firstElementChild,Fe=Ae instanceof HTMLElement?Ae.offsetHeight:0,Nt=Oe.value?.offsetHeight??0;return`${Ee.scrollHeight}:${Ee.clientHeight}:${Fe}:${Nt}`}function Rt(Ee){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ee):setTimeout(Ee,16)}function vt(Ee){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ee):clearTimeout(Ee)}let qt=0,dn=0,os=null,Vt=0;function fn(){return performance.now()<qt}function Ds(Ee,Ae=260){const Fe=he.value;if(!Fe||(os=Ee,Vt=Ee.getBoundingClientRect().top,qt=performance.now()+Ae,dn))return;const Nt=()=>{if(dn=0,performance.now()>=qt||!os){os=null;return}const zt=os.getBoundingClientRect().top-Vt;zt&&(Fe.scrollTop+=zt),dn=Rt(Nt)};dn=Rt(Nt)}function nt(Ee=36){if(!Z.value&&!Ie())return;const Ae=++Te;let Fe="",Nt=0,zt=0;ke&&(vt(ke),ke=0);const ts=()=>{if(ke=0,Ae!==Te||!Z.value&&!Ie())return;Me(!1);const Qn=Et();Nt=Qn===Fe?Nt+1:0,Fe=Qn,zt++,Nt<3&&zt<Ee&&(ke=Rt(ts))};ke=Rt(ts)}function Dn(Ee,Ae){return Ee!==void 0&&Ee.length>0&&Ae.length>=Ee.length&&Ee.firstId!==Ae.firstId&&Ee.lastId===Ae.lastId&&Ee.lastTextLen===Ae.lastTextLen&&Ee.lastThinkingLen===Ae.lastThinkingLen&&Ee.lastToolsLen===Ae.lastToolsLen&&Ee.approvalIds===Ae.approvalIds}const is=B(()=>{const Ee=(s.approvals??[]).map(ts=>ts.approvalId).join(","),Ae=s.turns,Fe=Ae.at(-1),Nt=Fe?.thinking?.length??0,zt=Fe?.tools?.reduce((ts,Qn)=>ts+Qn.name.length+(Qn.arg?.length??0)+(Qn.output?.join("").length??0),0)??0;return{length:Ae.length,firstId:Ae[0]?.id??"",lastId:Fe?.id??"",lastTextLen:Fe?.text.length??0,lastThinkingLen:Nt,lastToolsLen:zt,approvalIds:Ee}});Ve(is,async(Ee,Ae)=>{if(Co.value&&Dn(Ae,Ee)){q();return}await gt(),Z.value||Ie()?Me(Ee.length<Ae.length):ue.value=!0,q()}),Ve(Oe,()=>{uo()}),Ve(()=>s.mobile,async()=>{await gt(),Q()});const Vn=new Map;Ve(()=>s.fileReloadKey,async(Ee,Ae)=>{const Fe=he.value;Ae&&Fe&&Vn.set(String(Ae),{top:Fe.scrollTop,following:Z.value}),await gt();const Nt=he.value,zt=Ee?Vn.get(String(Ee)):void 0;zt&&Nt?(Z.value=zt.following,Nt.scrollTop=zt.top,me=zt.top,zt.following&&nt()):(Z.value=!0,me=0,Me(!1),nt()),q()}),Ve(()=>s.sessionLoading,async(Ee,Ae)=>{Ee||!Ae||(Z.value=!0,await gt(),nt(),q())}),Ve(()=>s.running,async(Ee,Ae)=>{Ee||!Ae||!Z.value&&!Ie()||(await gt(),nt(48),q())});function Kn(){Z.value=!0,ue.value=!1,j=Date.now()+lC,gt(()=>{Me(!0),nt(16)})}function Yt(Ee){Kn(),o("submit",Ee)}function Gn(Ee){Z.value=!0,ue.value=!1,j=Date.now()+lC,o("editMessage",Ee)}function Ke(Ee){const Ae=s.queued?.[Ee],Fe=Ae?.text??"";v(Fe,Ae?.attachments)&&o("editQueued",Ee)}function Qe(Ee){o("reorderQueue",Ee)}function Dt(Ee,Ae){Kn(),o("answer",Ee,Ae)}function tn(Ee,Ae){!Ee||!Ae||o("approval",Ee,Ae)}let ln=null,Zt=null,_n=null,xt=null,Yn=0,Wt=0,ys=0,Cs=!1;const Co=J(!1);function Vs(Ee){if(Co.value||(Cs=Cs||Ee,ys))return;ys=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Fe=>setTimeout(Fe,16))(()=>{ys=0;const Fe=Cs;Cs=!1,!fn()&&(Z.value||Ie()?Me(!1):Fe&&(ue.value=!0))})}function co(){if(!Zt)return;const Ee=he.value?.firstElementChild??null;Ee!==_n&&(_n&&Zt.unobserve(_n),_n=Ee,Ee&&Zt.observe(Ee))}function uo(){if(!Zt)return;const Ee=Oe.value;Ee!==xt&&(xt&&Zt.unobserve(xt),xt=Ee,Ee&&Zt.observe(Ee))}function Lt(){const Ee=he.value;Q(),ln&&(ln.disconnect(),Ee&&ln.observe(Ee,{childList:!0,subtree:!0,characterData:!0})),Zt&&(Zt.disconnect(),_n=null,xt=null,Ee&&Zt.observe(Ee),co(),uo()),Yn=Ee?.scrollHeight??0,Wt=Ee?.clientHeight??0}function Wo(){co(),Vs(!0)}function zo(){typeof document>"u"||document.visibilityState==="visible"&&Z.value&&nt()}const Ye=J(!1);let et=null;function st(){Ye.value=!0,et!==null&&clearTimeout(et),et=setTimeout(()=>{Ye.value=!1},Wte)}function Bt(){st(),o("interrupt")}function Uo(Ee){Ee.key==="Escape"&&(s.running||s.sending)&&(Ee.preventDefault(),Bt())}bn(()=>{gt(()=>{typeof MutationObserver=="function"&&(ln=new MutationObserver(Wo)),typeof ResizeObserver=="function"&&(Zt=new ResizeObserver(()=>{Q();const Ee=he.value;if(!Ee)return;const{scrollHeight:Ae,clientHeight:Fe}=Ee,Nt=Ae>Yn+1,zt=Fe<Wt-1;Yn=Ae,Wt=Fe,!fn()&&(Nt||zt)&&Vs(!1)})),Lt(),nt(48),q(),typeof document<"u"&&(document.addEventListener("visibilitychange",zo),document.addEventListener("keydown",Uo))})}),Tn(()=>{ln&&ln.disconnect(),Zt&&Zt.disconnect(),ys&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(ys),ke&&vt(ke),dn&&vt(dn),et!==null&&clearTimeout(et),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",zo),document.removeEventListener("keydown",Uo))});function Oi(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Oi}),(Ee,Ae)=>(w(),$("section",{class:Re(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),ye(CX,{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":R.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:_.value,onOpenChanges:Ae[0]||(Ae[0]=Fe=>o("openChanges")),onCopyAll:Ae[1]||(Ae[1]=Fe=>h.value?.copyConversation()),onCopyFinalSummary:Ae[2]||(Ae[2]=Fe=>h.value?.copyFinalSummary()),onOpenPr:Ae[3]||(Ae[3]=Fe=>e.pr&&o("openPr",e.pr.url)),onRenameSession:Ae[4]||(Ae[4]=(Fe,Nt)=>o("renameSession",Fe,Nt)),onForkSession:Ae[5]||(Ae[5]=Fe=>o("forkSession",Fe)),onArchiveSession:Ae[6]||(Ae[6]=Fe=>o("archiveSession",Fe))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),e.conversationToc?(w(),ye(Cte,{key:1,items:G.value,"active-turn-id":Y.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:bt},null,8,["items","active-turn-id","mobile","session-loading"])):re("",!0),x("div",Tte,[x("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:fe},[x("div",{class:Re(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),$(Pe,{key:0},[Ae[54]||(Ae[54]=x("div",{class:"empty-spacer"},null,-1)),x("div",Mte,[x("span",Ete,O(C(f)("composer.emptyConversationTitle")),1),x("span",Ite,O(C(f)("composer.emptyConversation")),1),a.value?(w(),$("div",$te,[ie(jt,{text:C(f)("conversation.switchWorkspace")},{default:_e(()=>[x("button",{type:"button",class:"ws-pick-btn",onClick:Ae[7]||(Ae[7]=yt(Fe=>i.value=!i.value,["stop"]))},[ie(Xe,{name:"folder",size:"sm"}),x("span",Nte,O(l.value),1),ie(Xe,{class:Re(["ws-pick-chev",{open:i.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),i.value?(w(),$("div",{key:0,class:"ws-pick-backdrop",onClick:Ae[8]||(Ae[8]=Fe=>i.value=!1)})):re("",!0),i.value?(w(),$("div",Lte,[(w(!0),$(Pe,null,tt(c.value,Fe=>(w(),$("button",{key:Fe.id,type:"button",class:Re(["ws-pick-item",{on:Fe.id===e.activeWorkspaceId}]),onClick:yt(Nt=>d(Fe.id),["stop"])},[x("span",Pte,O(Fe.name),1),x("span",Rte,O(Fe.shortPath),1)],10,Ote))),128)),u.value>0?(w(),$("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Ae[9]||(Ae[9]=yt(Fe=>r.value=!r.value,["stop"]))},[x("span",null,O(C(f)("conversation.moreWorkspaces",{count:u.value})),1)])):re("",!0),Ae[53]||(Ae[53]=x("div",{class:"ws-pick-divider"},null,-1)),x("button",{type:"button",class:"ws-pick-action",onClick:Ae[10]||(Ae[10]=yt(Fe=>{i.value=!1,o("addWorkspace")},["stop"]))},[ie(Xe,{name:"plus",size:"sm"}),x("span",null,O(C(f)("conversation.addWorkspace")),1)])])):re("",!0)])):(w(),$("button",{key:1,type:"button",class:"empty-add-workspace",onClick:Ae[11]||(Ae[11]=Fe=>o("addWorkspace"))},[ie(Xe,{name:"folder-plus",size:"sm"}),x("span",null,O(C(f)("conversation.addWorkspace")),1)]))]),ie(B3,{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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Yt,onSteer:Ae[12]||(Ae[12]=Fe=>o("steer",Fe)),onCommand:Ae[13]||(Ae[13]=Fe=>o("command",Fe)),onInterrupt:Bt,onUnqueue:Ae[14]||(Ae[14]=Fe=>o("unqueue",Fe)),onEditQueued:Ae[15]||(Ae[15]=Fe=>o("editQueued",Fe)),onSetPermission:Ae[16]||(Ae[16]=Fe=>o("setPermission",Fe)),onSetThinking:Ae[17]||(Ae[17]=Fe=>o("setThinking",Fe)),onTogglePlan:Ae[18]||(Ae[18]=Fe=>o("togglePlan")),onToggleSwarm:Ae[19]||(Ae[19]=Fe=>o("toggleSwarm")),onToggleGoal:Ae[20]||(Ae[20]=Fe=>o("toggleGoal")),onOpenBtw:Ae[21]||(Ae[21]=Fe=>o("command","/btw")),onCreateGoal:Ae[22]||(Ae[22]=Fe=>o("createGoal",Fe)),onControlGoal:Ae[23]||(Ae[23]=Fe=>o("controlGoal",Fe)),onFocusGoal:T,onCompact:Ae[24]||(Ae[24]=Fe=>o("compact")),onPickModel:Ae[25]||(Ae[25]=Fe=>o("pickModel")),onSelectModel:Ae[26]||(Ae[26]=Fe=>o("selectModel",Fe))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),Ae[55]||(Ae[55]=x("div",{class:"empty-spacer"},null,-1))],64)):(w(),ye(P3,{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":Z.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:Ae[27]||(Ae[27]=Fe=>o("openFile",Fe)),onOpenMedia:Ae[28]||(Ae[28]=Fe=>o("openMedia",Fe)),onCopyConversationCopied:y,onOpenThinking:Ae[29]||(Ae[29]=Fe=>o("openThinking",Fe)),onOpenCompaction:Ae[30]||(Ae[30]=Fe=>o("openCompaction",Fe)),onOpenAgent:Ae[31]||(Ae[31]=Fe=>o("openAgent",Fe)),onOpenToolDiff:Ae[32]||(Ae[32]=Fe=>o("openToolDiff",Fe)),onEditMessage:Gn,onLoadOlderMessages:lt,onUnqueue:Ae[33]||(Ae[33]=Fe=>o("unqueue",Fe)),onEditQueued:Ke,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)],32),e.turns.length===0&&!e.sessionLoading?re("",!0):(w(),ye(vte,{key:0,ref:W,style:Xt(ce.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":k.value,"dock-panel":E.value,"bash-tasks":P.value,"subagent-tasks":N.value,"bash-running":b.value,"subagent-running":M.value,"todo-done-count":L.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ae.value,"question-busy-kind":de.value,"pending-approval":ne.value,"approval-busy":X.value,mobile:e.mobile,onToggleDockPanel:Ae[34]||(Ae[34]=Fe=>D(Fe)),onCloseDockPanel:Ae[35]||(Ae[35]=Fe=>F()),onOpenAgent:Ae[36]||(Ae[36]=Fe=>o("openAgent",Fe)),onAnswer:Dt,onDismiss:Ae[37]||(Ae[37]=Fe=>o("dismiss",Fe)),onApproval:tn,onCancelTask:Ae[38]||(Ae[38]=Fe=>o("cancelTask",Fe)),onControlGoal:Ae[39]||(Ae[39]=Fe=>o("controlGoal",Fe)),onSubmit:Yt,onSteer:Ae[40]||(Ae[40]=Fe=>o("steer",Fe)),onCommand:Ae[41]||(Ae[41]=Fe=>o("command",Fe)),onInterrupt:Bt,onSetPermission:Ae[42]||(Ae[42]=Fe=>o("setPermission",Fe)),onSetThinking:Ae[43]||(Ae[43]=Fe=>o("setThinking",Fe)),onTogglePlan:Ae[44]||(Ae[44]=Fe=>o("togglePlan")),onToggleSwarm:Ae[45]||(Ae[45]=Fe=>o("toggleSwarm")),onToggleGoal:Ae[46]||(Ae[46]=Fe=>o("toggleGoal")),onOpenBtw:Ae[47]||(Ae[47]=Fe=>o("command","/btw")),onCreateGoal:Ae[48]||(Ae[48]=Fe=>o("createGoal",Fe)),onFocusGoal:T,onCompact:Ae[49]||(Ae[49]=Fe=>o("compact")),onPickModel:Ae[50]||(Ae[50]=Fe=>o("pickModel")),onSelectModel:Ae[51]||(Ae[51]=Fe=>o("selectModel",Fe))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ie(Zr,{name:"pill"},{default:_e(()=>[ue.value?(w(),$("button",{key:0,class:"newmsg-pill",style:Xt({bottom:`${it.value+12}px`}),"aria-label":C(f)("conversation.jumpToLatestAria"),onClick:Ae[52]||(Ae[52]=Fe=>Me(!0))},[ie(Xe,{class:"pill-chevron",name:"chevron-down",size:"md"}),Ue(" "+O(C(f)("conversation.newMessages")),1)],12,Dte)):re("",!0)]),_:1}),ie(Zr,{name:"abort-toast"},{default:_e(()=>[Ye.value?(w(),$("div",Bte,[x("span",Fte,O(C(f)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),Ute=dt(zte,[["__scopeId","data-v-f702e00f"]]),jte=["aria-selected","onClick"],qte=qe({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),$("div",{class:Re(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),$(Pe,null,tt(e.options,i=>(w(),$("button",{key:i.value,class:Re(["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,jte))),128))],2))}}),to=dt(qte,[["__scopeId","data-v-d1aaccd7"]]),Vte={class:"ui-panel-header__title"},Kte={key:0,class:"ui-panel-header__sub"},Gte=qe({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),$("div",{class:Re(["ui-panel-header",{wrap:e.wrap}])},[x("span",Vte,O(e.title),1),ie(jt,{text:e.subtitle},{default:_e(()=>[e.subtitle?(w(),$("span",Kte,O(e.subtitle),1)):re("",!0)]),_:1},8,["text"]),Ln(t.$slots,"default",{},void 0,!0),e.closable?(w(),ye(Cn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:_e(()=>[ie(Xe,{name:"close",size:"sm"})]),_:1},8,["label"])):re("",!0)],2))}}),Xl=dt(Gte,[["__scopeId","data-v-c47879ad"]]),Yte={key:0,class:"fp-empty fp-error"},Qte={key:1,class:"fp-empty"},Xte={key:2,class:"fp-loading"},Zte={class:"fp-path"},Jte={class:"fp-meta"},ene={key:0,class:"fp-lines"},tne={class:"fp-size"},nne={key:3,class:"fp-search"},sne=["placeholder"],one={key:0,class:"fp-search-count"},ine=["href","aria-label"],rne={key:1,class:"fp-code"},lne={class:"fp-line-table"},ane=["data-line"],cne={class:"fp-gutter"},une=["innerHTML"],dne={key:1,class:"fp-body fp-code"},fne={class:"fp-line-table"},pne=["data-line"],hne={class:"fp-gutter"},mne=["innerHTML"],gne={key:2,class:"fp-body"},vne=["srcdoc","title"],yne={key:1,class:"fp-code"},kne={class:"fp-line-table"},bne=["data-line"],_ne={class:"fp-gutter"},wne=["innerHTML"],Sne={key:3,class:"fp-body fp-pdf-wrap"},Cne=["src","title"],xne={key:1,class:"fp-binary-card"},Ane={class:"fp-binary-label"},Tne={key:4,class:"fp-body fp-table-wrap"},Mne={class:"fp-table"},Ene=["data-line"],Ine={key:5,class:"fp-body fp-image-wrap"},$ne=["src","alt"],Nne={key:1,class:"fp-binary-card"},Lne={class:"fp-binary-icon"},One={class:"fp-binary-label"},Pne={key:6,class:"fp-body fp-code"},Rne={class:"fp-line-table"},Dne=["data-line"],Bne={class:"fp-gutter"},Fne=["innerHTML"],Hne={key:7,class:"fp-body fp-binary-wrap"},Wne={class:"fp-binary-card"},zne={class:"fp-binary-icon"},Une={class:"fp-binary-label"},jne=qe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Tt();function s(ce,z){const Q=z?z.split("/").filter(Boolean):[];for(const oe of ce.split("/"))oe===""||oe==="."||(oe===".."?Q.pop():Q.push(oe));return Q.join("/")}const o=Ut("resolveImage",async ce=>ce),i=B(()=>{const ce=c.file?.path??"",z=ce.lastIndexOf("/");return z>0?ce.slice(0,z):""});function r(ce){if(/^(https?:|data:|blob:)/i.test(ce)||ce.startsWith("/"))return ce;const z=i.value;return z?s(ce,z):ce}async function l(ce){const z=r(ce);return o?o(z):z}$n("resolveImage",l);function a(ce){let z=ce.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(z)||z.startsWith("/"))return ce;for(const oe of["#","?"]){const W=z.indexOf(oe);W!==-1&&(z=z.slice(0,W))}const Q=i.value;return{...ce,path:s(z,Q)}}const c=e,u=t;function d(ce){c.openFile?.(a(ce))}const f=J(null),h=B(()=>{const ce=c.file;if(!ce)return"binary";const z=ce.mime??"",Q=ce.languageId??"",oe=ce.path.toLowerCase();return z==="text/markdown"||Q==="markdown"||Q==="md"||oe.endsWith(".mdx")?"markdown":z==="application/json"||Q==="json"?"json":z==="text/html"||Q==="html"||oe.endsWith(".html")||oe.endsWith(".htm")?"html":z==="application/pdf"||oe.endsWith(".pdf")?"pdf":z==="text/csv"||Q==="csv"||oe.endsWith(".csv")?"csv":z.startsWith("image/")?"image":ce.isBinary?"binary":z.startsWith("text/")||Q!==""?"text":"binary"});function p(ce){const z=atob(ce),Q=Uint8Array.from(z,oe=>oe.charCodeAt(0));return new TextDecoder().decode(Q)}const m=B(()=>{const ce=c.file;if(!ce)return"";if(ce.encoding==="base64")try{return p(ce.content)}catch{return ce.content}return ce.content}),_=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=B(()=>c.file?(h.value==="json"?_.value:m.value).split(`
|
|
268
|
-
`):[]),g=B(()=>c.file?h.value==="json"?_.value:m.value:""),v=J(""),y=J(0),T=B(()=>{const ce=v.value.trim().toLowerCase();if(!ce)return[];const z=[];return k.value.forEach((Q,oe)=>{Q.toLowerCase().includes(ce)&&z.push(oe+1)}),z});Ve(v,()=>{y.value=0});function P(ce,z=!1){ce&>(()=>{const Q=f.value?.querySelector(".fp-body"),oe=Q?.querySelector(`[data-line="${ce}"]`);if(!Q||!oe)return;z&&(Q.scrollTop=0);const W=Q.getBoundingClientRect(),Z=oe.getBoundingClientRect(),ue=Z.top-W.top+Q.scrollTop;Q.scrollTop=ue-Q.clientHeight/2+Z.height/2})}Ve(()=>[c.file?.path,c.line],()=>P(c.line,!0),{immediate:!0});function N(ce){const z=T.value;z.length!==0&&(y.value=(y.value+ce+z.length)%z.length,P(z[y.value]))}function b(ce){const z=T.value;return{target:c.line===ce,hit:z.includes(ce),active:z[y.value]===ce}}function M(ce){return ce<1024?`${ce} B`:ce<1024*1024?`${(ce/1024).toFixed(1)} KB`:`${(ce/(1024*1024)).toFixed(1)} MB`}const I=J(!1),L=J(!1);function S(){c.file&&js(g.value).then(ce=>{ce&&(I.value=!0,setTimeout(()=>{I.value=!1},1400))})}function E(){c.file&&js(c.file.path).then(ce=>{ce&&(L.value=!0,setTimeout(()=>{L.value=!1},1400))})}const R=J("preview"),D=J("preview"),F=J("fit");function U(ce){R.value=ce}function G(ce){D.value=ce}function Y(ce){F.value=ce}Ve(h,ce=>{R.value=ce==="html"?"preview":"source",D.value="preview",F.value="fit"});const q=B(()=>{const ce=c.file;return!ce||h.value!=="image"?null:ce.sourceUrl?ce.sourceUrl:ce.encoding==="base64"?`data:${ce.mime};base64,${ce.content}`:ce.mime==="image/svg+xml"?`data:${ce.mime};charset=utf-8,${encodeURIComponent(ce.content)}`:null}),ae=B(()=>{const ce=c.file;return!ce||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ce.encoding==="base64"?`data:${ce.mime};base64,${ce.content}`:null}),de=B(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function ne(ce){const z=[];let Q="",oe=!1;for(let W=0;W<ce.length;W++){const Z=ce[W];Z==='"'&&ce[W+1]==='"'?(Q+='"',W++):Z==='"'?oe=!oe:Z===","&&!oe?(z.push(Q),Q=""):Q+=Z}return z.push(Q),z}const X=B(()=>k.value.slice(0,200).map(ne));function he(ce){return ce.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Oe(){const ce=c.file;if(!ce)return"";const z=ce.languageId?.toLowerCase();return z||(ce.path.split(".").pop()?.toLowerCase()??"")}function je(ce){const z=Oe();let Q=he(ce);return h.value==="json"||z==="json"||z==="jsonc"?(Q=Q.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Q=Q.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Q=Q.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Q=Q.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Q):h.value==="html"||z==="html"||z==="xml"||z==="svg"?(Q=Q.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Q=Q.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Q):(Q=Q.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>'),Q=Q.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Q)}function it(ce,z=55){return!ce||ce.length<=z?ce:"…"+ce.slice(ce.length-z+1)}return(ce,z)=>(w(),$("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),$("div",Yte,[x("span",null,O(e.error),1),e.closable?(w(),ye(Pt,{key:0,variant:"secondary",size:"sm",onClick:z[0]||(z[0]=Q=>u("close"))},{default:_e(()=>[Ue(O(C(n)("filePreview.close")),1)]),_:1})):re("",!0)])):!e.file&&!e.loading?(w(),$("div",Qte,O(C(n)("filePreview.empty")),1)):e.loading?(w(),$("div",Xte,[z[7]||(z[7]=x("span",{class:"spinner"},null,-1)),x("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(w(),$(Pe,{key:3},[ie(Xl,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:z[6]||(z[6]=Q=>u("close"))},{default:_e(()=>[ie(jt,{text:e.file.path},{default:_e(()=>[x("span",Zte,O(it(e.file.path)),1)]),_:1},8,["text"]),x("span",Jte,[e.file.lineCount?(w(),$("span",ene,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),x("span",tne,O(M(e.file.size)),1)]),h.value==="html"?(w(),ye(to,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):re("",!0),h.value==="markdown"?(w(),ye(to,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":G},null,8,["model-value","options"])):re("",!0),h.value==="image"?(w(),ye(to,{key:2,"model-value":F.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Y},null,8,["model-value","options"])):re("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),$("div",nne,[Sn(x("input",{"onUpdate:modelValue":z[1]||(z[1]=Q=>v.value=Q),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,sne),[[ao,v.value]]),v.value.trim()?(w(),$("span",one,O(T.value.length),1)):re("",!0),ie(Cn,{size:"sm",disabled:T.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:z[2]||(z[2]=Q=>N(-1))},{default:_e(()=>[ie(Xe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Cn,{size:"sm",disabled:T.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:z[3]||(z[3]=Q=>N(1))},{default:_e(()=>[ie(Xe,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):re("",!0),ie(Cn,{size:"sm",class:Re({copied:L.value}),label:L.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:E},{default:_e(()=>[L.value?(w(),ye(Xe,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ye(Xe,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),ye(Cn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:z[4]||(z[4]=Q=>u("openExternal"))},{default:_e(()=>[ie(Xe,{name:"external-link",size:"md"})]),_:1},8,["label"])):re("",!0),e.externalActions?(w(),ye(Cn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:z[5]||(z[5]=Q=>u("reveal"))},{default:_e(()=>[ie(Xe,{name:"folder",size:"md"})]),_:1},8,["label"])):re("",!0),e.downloadUrl?(w(),$("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(Xe,{name:"download",size:"md"})],8,ine)):re("",!0),!e.file.isBinary&&h.value!=="image"?(w(),ye(Cn,{key:7,size:"sm",class:Re({copied:I.value}),label:I.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:_e(()=>[I.value?(w(),ye(Xe,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ye(Xe,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):re("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),$("div",{key:0,class:Re(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(w(),ye(Hh,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),$("div",rne,[x("div",lne,[(w(!0),$(Pe,null,tt(k.value,(Q,oe)=>(w(),$("div",{key:oe,class:Re(["fp-line-row",b(oe+1)]),"data-line":oe+1},[x("span",cne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Q)},null,8,une)],10,ane))),128))])]))],2)):h.value==="json"?(w(),$("div",dne,[x("div",fne,[(w(!0),$(Pe,null,tt(k.value,(Q,oe)=>(w(),$("div",{key:oe,class:Re(["fp-line-row",b(oe+1)]),"data-line":oe+1},[x("span",hne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Q)},null,8,mne)],10,pne))),128))])])):h.value==="html"?(w(),$("div",gne,[R.value==="preview"?(w(),$("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:de.value,title:e.file.path},null,8,vne)):(w(),$("div",yne,[x("div",kne,[(w(!0),$(Pe,null,tt(k.value,(Q,oe)=>(w(),$("div",{key:oe,class:Re(["fp-line-row",b(oe+1)]),"data-line":oe+1},[x("span",_ne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Q)},null,8,wne)],10,bne))),128))])]))])):h.value==="pdf"?(w(),$("div",Sne,[ae.value?(w(),$("iframe",{key:0,class:"fp-pdf-frame",src:ae.value,title:e.file.path},null,8,Cne)):(w(),$("div",xne,[x("span",Ane,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),$("div",Tne,[x("table",Mne,[x("tbody",null,[(w(!0),$(Pe,null,tt(X.value,(Q,oe)=>(w(),$("tr",{key:oe,class:Re(b(oe+1)),"data-line":oe+1},[x("th",null,O(oe+1),1),(w(!0),$(Pe,null,tt(Q,(W,Z)=>(w(),$("td",{key:Z},O(W),1))),128))],10,Ene))),128))])])])):h.value==="image"?(w(),$("div",Ine,[q.value?(w(),$("img",{key:0,src:q.value,alt:e.file.path,class:Re(["fp-image",{actual:F.value==="actual"}])},null,10,$ne)):(w(),$("div",Nne,[x("span",Lne,[ie(Xe,{name:"image-off",size:"lg"})]),x("span",One,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(w(),$("div",Pne,[x("div",Rne,[(w(!0),$(Pe,null,tt(k.value,(Q,oe)=>(w(),$("div",{key:oe,class:Re(["fp-line-row",b(oe+1)]),"data-line":oe+1},[x("span",Bne,O(oe+1),1),x("span",{class:"fp-line-text",innerHTML:je(Q)},null,8,Fne)],10,Dne))),128))])])):(w(),$("div",Hne,[x("div",Wne,[x("span",zne,[ie(Xe,{name:"file-off",size:"lg"})]),x("span",Une,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),qne=dt(jne,[["__scopeId","data-v-62bfaf2d"]]),Vne={class:"tp"},Kne=qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=J(null);return Ve(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),$("div",Vne,[ie(Xl,{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"]),x("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),aC=dt(Kne,[["__scopeId","data-v-6af94b37"]]),Gne={class:"ap"},Yne={key:0,class:"ap-type"},Qne={key:1,class:"ap-reason"},Xne={key:2,class:"ap-field"},Zne={class:"ap-field-body"},Jne={key:3,class:"ap-field"},ese={class:"ap-field-body ap-live"},tse={key:4,class:"ap-field"},nse={class:"ap-field-body ap-progress"},sse={key:0,class:"ap-call"},ose={key:1,class:"ap-output"},ise=["onClick"],rse={key:5,class:"ap-field"},lse={class:"ap-field-body"},ase=8,cC=5,uC=2,cse=qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=B(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=B(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},_.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},_.push(k));return _}const a=B(()=>l(i.value)),c=J(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-cC-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=J(null);return Ve(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||gt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,_)=>(w(),$("div",Gne,[ie(Xl,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:_[0]||(_[0]=k=>s("close"))},{default:_e(()=>[ie(Ls,{variant:"neutral",size:"sm",class:"ap-phase"},{default:_e(()=>[Ue(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),x("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),$("div",Yne,O(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(w(),$("div",Qne,O(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(w(),$("div",Xne,[_[1]||(_[1]=x("span",{class:"ap-field-label"},"Task",-1)),x("div",Zne,O(e.member.prompt),1)])):re("",!0),r.value?(w(),$("div",Jne,[_[2]||(_[2]=x("span",{class:"ap-field-label"},"Output",-1)),x("div",ese,O(r.value),1)])):re("",!0),a.value.length>0?(w(),$("div",tse,[_[4]||(_[4]=x("span",{class:"ap-field-label"},"Progress",-1)),x("div",nse,[(w(!0),$(Pe,null,tt(a.value,k=>(w(),$("div",{key:k.key,class:"ap-group"},[k.call?(w(),$("div",sse,[_[3]||(_[3]=x("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Ue(" "+O(k.call),1)])):re("",!0),k.output.length>0?(w(),$("div",ose,[k.output.length<=ase||u(k.key)?(w(!0),$(Pe,{key:0},tt(k.output,(g,v)=>(w(),$("div",{key:v,class:"ap-out-line"},O(g),1))),128)):(w(),$(Pe,{key:1},[(w(!0),$(Pe,null,tt(k.output.slice(0,cC),(g,v)=>(w(),$("div",{key:v,class:"ap-out-line"},O(g),1))),128)),x("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+O(f(k))+" more) ",9,ise),(w(!0),$(Pe,null,tt(k.output.slice(-uC),(g,v)=>(w(),$("div",{key:"t"+v,class:"ap-out-line"},O(g),1))),128))],64))])):re("",!0)]))),128))])])):re("",!0),e.member.summary?(w(),$("div",rse,[_[5]||(_[5]=x("span",{class:"ap-field-label"},"Result",-1)),x("div",lse,O(e.member.summary),1)])):re("",!0)],512)]))}}),use=dt(cse,[["__scopeId","data-v-715bd93e"]]),dse={class:"diff-lines"},fse={key:0,class:"hunk-text"},pse={class:"dl-gutter old"},hse={class:"dl-gutter new"},mse={class:"dl-sign"},gse={class:"dl-text"},vse=qe({__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)=>(w(),$("div",dse,[(w(!0),$(Pe,null,tt(e.lines,(r,l)=>(w(),$("div",{key:l,class:Re(["dl",s(r)])},[r.type==="hunk"?(w(),$("span",fse,O(r.text),1)):(w(),$(Pe,{key:1},[x("span",pse,O(t(r)),1),x("span",hse,O(n(r)),1),x("span",mse,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),x("span",gse,O(r.text),1)],64))],2))),128))]))}}),H3=dt(vse,[["__scopeId","data-v-2f6bc1cc"]]),yse={class:"tdp"},kse={class:"tdp-body"},bse={key:1,class:"tdp-output"},_se={key:2,class:"tdp-empty"},wse=qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Tt();return(o,i)=>(w(),$("div",yse,[ie(Xl,{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"]),x("div",kse,[e.target.lines&&e.target.lines.length>0?(w(),ye(H3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),$("div",bse,[(w(!0),$(Pe,null,tt(e.target.output,(r,l)=>(w(),$("div",{key:l},O(r),1))),128))])):(w(),$("div",_se,O(C(s)("diff.noDiff")),1))])]))}}),Sse=dt(wse,[["__scopeId","data-v-76f2fbca"]]),Cse={class:"sc"},xse={key:0,class:"sc-empty"},Ase={key:2,class:"sc-loading","aria-hidden":"true"},Tse={class:"sc-composer"},Mse=["placeholder"],Ese=["disabled"],Ise=qe({__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}=Tt(),i=B(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=B(()=>n.title?.trim()||o("sideChat.title")),l=B(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=J(""),c=J(null),u=J(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const h=B(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((T,P)=>T+P.name.length+(P.arg?.length??0)+(P.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ve(h,async()=>{!n.running&&!n.sending||(await gt(),f())});const p=B(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function _(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(w(),$("div",Cse,[ie(Xl,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),x("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),$("div",xse,O(C(o)("sideChat.empty")),1)):(w(),ye(P3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(w(),$("div",Ase,[ie(O3)])):re("",!0)],512),x("div",Tse,[Sn(x("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,Mse),[[ao,a.value]]),ie(jt,{text:C(o)("sideChat.send")},{default:_e(()=>[x("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Xe,{name:"arrow-right",size:"sm"})],8,Ese)]),_:1},8,["text"])])]))}}),$se=dt(Ise,[["__scopeId","data-v-9ee5df02"]]),Nse={class:"changes-pane"},Lse={class:"dv-path"},Ose={class:"diff-head"},Pse={class:"back-label"},Rse={key:0,class:"empty-state"},Dse={key:1,class:"dv-lines-wrap"},Bse={key:2,class:"empty-state"},Fse={class:"dv-change-count"},Hse={class:"ch-head"},Wse={class:"br-label"},zse={class:"br-name"},Use={key:0,class:"sync-info"},jse={key:0,class:"ahead"},qse={key:0,class:"behind"},Vse={key:1,class:"empty-head"},Kse={key:0,class:"ch-list"},Gse=["onClick"],Yse={class:"fpath"},Qse={key:1,class:"ch-list ch-tree"},Xse={class:"tree-list"},Zse=["onClick"],Jse={class:"tree-name"},eoe=["onClick"],toe={class:"tree-name"},noe={key:2,class:"empty-state"},soe={key:3,class:"empty-state"},ooe=qe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(L){const S=L.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(L){return r[i(L)]??"?"}function a(L,S=60){return L.length<=S?L:"…"+L.slice(L.length-S+1)}const c=B(()=>s.gitInfo!==null),u=B(()=>s.changes.length>0),d=B(()=>(s.selectedDiffPath??null)!==null),f=B(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=B(()=>s.fileDiff??[]),p=B(()=>s.fileDiffLoading===!0);function m(L){o("open",L)}function _(){o("back")}function k(){o("close")}const g=J("list");function v(L){g.value=L}function y(L){const S={children:[]},E=[...L].sort((R,D)=>R.path.localeCompare(D.path));for(const R of E){const D=R.path.split("/");let F=S;for(let U=0;U<D.length;U++){const G=D[U],Y=U===D.length-1,q=D.slice(0,U+1).join("/");let ae=F.children.find(de=>de.name===G&&de.kind===(Y?"file":"folder"));ae||(ae={name:G,path:q,kind:Y?"file":"folder",status:Y?R.status:void 0,children:[]},F.children.push(ae)),F=ae}}return S.children}const T=B(()=>y(s.changes)),P=J(new Set);function N(L){return!P.value.has(L)}const b=B(()=>{const L=[];function S(E,R){for(const D of E)L.push({node:D,depth:R}),D.kind==="folder"&&N(D.path)&&S(D.children,R+1)}return S(T.value,0),L});function M(L){const S=new Set(P.value);S.has(L.path)?S.delete(L.path):S.add(L.path),P.value=S}function I(L){return`${16+L*16}px`}return(L,S)=>(w(),$("div",Nse,[f.value?(w(),$(Pe,{key:0},[ie(Xl,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:_e(()=>[ie(jt,{text:e.selectedDiffPath??""},{default:_e(()=>[x("span",Lse,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),x("div",Ose,[e.hideBack?re("",!0):(w(),ye(Pt,{key:0,variant:"ghost",size:"sm",onClick:_},{default:_e(()=>[S[0]||(S[0]=x("span",{"aria-hidden":"true"},"←",-1)),x("span",Pse,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(w(),$("div",Rse,O(C(n)("diff.loading")),1)):h.value.length>0?(w(),$("div",Dse,[ie(H3,{lines:h.value},null,8,["lines"])])):(w(),$("div",Bse,O(C(n)("diff.noDiff")),1))],64)):(w(),$(Pe,{key:1},[ie(Xl,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:_e(()=>[x("span",Fse,O(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(to,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),x("div",Hse,[c.value?(w(),$(Pe,{key:0},[x("span",Wse,O(C(n)("diff.branch")),1),x("span",zse,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),$("span",Use,[ie(jt,{text:C(n)("diff.aheadTitle")},{default:_e(()=>[e.gitInfo.ahead>0?(w(),$("span",jse,"↑"+O(e.gitInfo.ahead),1)):re("",!0)]),_:1},8,["text"]),ie(jt,{text:C(n)("diff.behindTitle")},{default:_e(()=>[e.gitInfo.behind>0?(w(),$("span",qse,"↓"+O(e.gitInfo.behind),1)):re("",!0)]),_:1},8,["text"])])):re("",!0)],64)):(w(),$("span",Vse,O(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(w(),$("div",Kse,[(w(!0),$(Pe,null,tt(e.changes,E=>(w(),ye(jt,{key:E.path,text:E.path},{default:_e(()=>[x("button",{type:"button",class:"ch-row",onClick:R=>m(E.path)},[x("span",{class:Re(["badge",i(E.status)])},O(l(E.status)),3),x("span",Yse,O(a(E.path)),1)],8,Gse)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(w(),$("div",Qse,[x("ul",Xse,[(w(!0),$(Pe,null,tt(b.value,({node:E,depth:R})=>(w(),$("li",{key:E.path,class:"tree-node"},[E.kind==="folder"?(w(),$("button",{key:0,type:"button",class:"tree-row tree-folder",style:Xt({paddingLeft:I(R)}),onClick:D=>M(E)},[ie(Xe,{class:"tree-icon",name:"folder-solid",size:"sm"}),x("span",Jse,O(E.name),1)],12,Zse)):(w(),ye(jt,{key:1,text:E.path},{default:_e(()=>[x("button",{type:"button",class:"tree-row tree-file",style:Xt({paddingLeft:I(R)}),onClick:D=>m(E.path)},[x("span",{class:Re(["badge",i(E.status)])},O(l(E.status)),3),x("span",toe,O(E.name),1)],12,eoe)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),$("div",noe,O(C(n)("diff.clean")),1)):(w(),$("div",soe,O(C(n)("diff.empty")),1))],64))]))}}),ioe=dt(ooe,[["__scopeId","data-v-7778610a"]]);function Ty(e,t){let n=null;bn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),ds(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const roe=["type","value","placeholder","disabled","readonly"],loe=qe({__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=J();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)=>(w(),$("input",{ref_key:"el",ref:o,class:Re(["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,roe))}}),Vl=dt(loe,[["__scopeId","data-v-340f0da2"]]),aoe={class:"search-wrap"},coe={key:0,class:"tab-strip"},uoe={key:1,class:"state-row"},doe={key:2,class:"state-row unavail"},foe={key:3,class:"model-list"},poe=["aria-selected","onClick","onMouseenter"],hoe={class:"check"},moe={class:"model-main"},goe={class:"model-name"},voe={class:"model-id"},yoe={key:0,class:"caps"},koe={class:"model-provider"},boe={class:"model-ctx"},_oe={key:0,class:"empty"},woe={class:"footer-hint"},Soe=qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=B(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=J(""),a=J(null),c=J(null),u=J("all");Ty(c,a);const d=B(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const T of s.models)v.has(T.provider)||(v.add(T.provider),y.push({id:T.provider,label:T.provider}));return y}),f=B(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(T=>{if(u.value!=="all"&&T.provider!==u.value)return!1;const P=(T.displayName??T.model).toLowerCase().includes(v),N=T.provider.toLowerCase().includes(v),b=T.id.toLowerCase().includes(v);return!v||P||N||b});return u.value!=="all"?y:y.sort((T,P)=>{const N=r(T.id)?1:0;return(r(P.id)?1:0)-N})}),h=B(()=>f.value),p=J(0);Ve([l,u],()=>{p.value=0}),Ve(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ve(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const y=h.value[p.value];y&&o("select",y.id)}}bn(()=>{document.addEventListener("keydown",m)}),Tn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function k(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(w(),ye(pr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=T=>o("close"))},{default:_e(()=>[x("div",{ref_key:"dialogRef",ref:c,class:"mp"},[x("div",aoe,[ie(Vl,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=T=>l.value=T),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),$("div",coe,[(w(!0),$(Pe,null,tt(d.value,T=>(w(),ye(Pt,{key:T.id,variant:T.id===u.value?"secondary":"ghost",size:"sm",onClick:P=>g(T.id)},{default:_e(()=>[Ue(O(T.label),1)]),_:2},1032,["variant","onClick"]))),128))])):re("",!0),e.loading?(w(),$("div",uoe,[ie(ri,{size:"sm"}),x("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(w(),$("div",doe,[ie(Xe,{name:"alert-triangle",size:"lg"}),x("span",null,O(C(n)("model.unavailable")),1)])):(w(),$("div",foe,[(w(!0),$(Pe,null,tt(h.value,T=>(w(),$("div",{key:T.id,class:Re(["model-row",{"is-current":T.id===e.current,"is-selected":k(T)===p.value}]),role:"option","aria-selected":T.id===e.current,onClick:P=>_(T.id),onMouseenter:P=>p.value=k(T)},[x("span",hoe,[T.id===e.current?(w(),ye(Xe,{key:0,name:"check",size:"sm"})):re("",!0)]),x("span",moe,[x("span",goe,O(T.displayName??T.model),1),x("span",voe,O(T.id),1),T.capabilities&&T.capabilities.length>0?(w(),$("span",yoe,[(w(!0),$(Pe,null,tt(T.capabilities,P=>(w(),ye(Ls,{key:P,variant:"info",size:"sm"},{default:_e(()=>[Ue(O(P),1)]),_:2},1024))),128))])):re("",!0)]),x("span",koe,O(T.provider),1),x("span",boe,O(C(n)("model.contextSuffix",{size:Math.round(T.maxContextSize/1e3)})),1),ie(Cn,{size:"sm",label:r(T.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:yt(P=>o("toggle-star",T.id),["stop"])},{default:_e(()=>[r(T.id)?(w(),ye(Xe,{key:0,name:"star",size:"md"})):(w(),ye(Xe,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,poe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),$("div",_oe,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):re("",!0)])),x("div",woe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Coe=dt(Soe,[["__scopeId","data-v-e93073d7"]]),xoe={key:0,class:"ui-field__label"},Aoe={key:1,class:"ui-field__error"},Toe={key:2,class:"ui-field__hint"},Moe=qe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),$("div",{class:Re(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),$("label",xoe,O(e.label),1)):re("",!0),Ln(t.$slots,"default",{},void 0,!0),e.error?(w(),$("span",Aoe,O(e.error),1)):e.hint?(w(),$("span",Toe,O(e.hint),1)):re("",!0)],2))}}),cu=dt(Moe,[["__scopeId","data-v-49bce958"]]),Eoe=["value","disabled"],Ioe=qe({__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)=>(w(),$("select",{class:Re(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Ln(o.$slots,"default",{},void 0,!0)],42,Eoe))}}),q1=dt(Ioe,[["__scopeId","data-v-92a040fd"]]),$oe={class:"prov-list"},Noe={key:0,class:"state-row"},Loe={key:1,class:"state-row unavail"},Ooe={key:2,class:"empty"},Poe={class:"prov-info"},Roe={class:"prov-type"},Doe={key:0,class:"prov-url"},Boe={class:"prov-meta"},Foe={key:0},Hoe={class:"prov-actions"},Woe={key:0,class:"add-section"},zoe={key:0,class:"add-btns"},Uoe={key:1,class:"add-form"},joe=["value"],qoe={key:0,class:"add-error"},Voe={class:"form-btns"},Koe={class:"footer-hint"},Goe=qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=al(),o=J(null);Ty(o);const i=t;async function r(k){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=J(!1),a=Os({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=J(""),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(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}bn(()=>document.addEventListener("keydown",p)),Tn(()=>document.removeEventListener("keydown",p));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(w(),ye(pr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:_e(()=>[x("div",{ref_key:"dialogRef",ref:o,class:"pm"},[x("div",$oe,[e.loading?(w(),$("div",Noe,[ie(ri,{size:"sm"}),x("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(w(),$("div",Loe,[ie(Xe,{name:"alert-triangle",size:"md"}),x("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),$("div",Ooe,O(C(n)("providers.empty")),1)):(w(!0),$(Pe,{key:3},tt(e.providers,v=>(w(),$("div",{key:v.id,class:"prov-row"},[ie(jt,{text:_(v.status)},{default:_e(()=>[x("span",{class:Re(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Xt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),x("div",Poe,[x("span",Roe,O(v.type),1),v.baseUrl?(w(),$("span",Doe,O(v.baseUrl),1)):re("",!0),x("span",Boe,[ie(Ls,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:_e(()=>[Ue(O(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(w(),$("span",Foe," · "+O(C(n)("providers.modelCount",{count:v.models.length})),1)):re("",!0)])]),x("div",Hoe,[ie(jt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:_e(()=>[ie(Pt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:_e(()=>[Ue(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(jt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:_e(()=>[ie(Pt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:_e(()=>[Ue(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?re("",!0):(w(),$("div",Woe,[l.value?(w(),$("div",Uoe,[ie(cu,{label:C(n)("providers.fieldType")},{default:_e(()=>[ie(q1,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:_e(()=>[(w(),$(Pe,null,tt(u,v=>x("option",{key:v,value:v},O(v),9,joe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(cu,{label:C(n)("providers.fieldApiKey")},{default:_e(()=>[ie(Vl,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(cu,{label:C(n)("providers.fieldBaseUrl")},{default:_e(()=>[ie(Vl,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(cu,{label:C(n)("providers.fieldDefaultModel")},{default:_e(()=>[ie(Vl,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(w(),$("div",qoe,O(c.value),1)):re("",!0),x("div",Voe,[ie(Pt,{variant:"primary",size:"sm",onClick:h},{default:_e(()=>[Ue(O(C(n)("providers.add")),1)]),_:1}),ie(Pt,{variant:"secondary",size:"sm",onClick:f},{default:_e(()=>[Ue(O(C(n)("common.cancel")),1)]),_:1})])])):(w(),$("div",zoe,[ie(Pt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:_e(()=>[ie(Xe,{name:"user",size:"sm"}),Ue(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),ie(Pt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:_e(()=>[ie(Xe,{name:"user",size:"sm"}),Ue(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Pt,{variant:"primary",size:"sm",onClick:d},{default:_e(()=>[ie(Xe,{name:"plus",size:"sm"}),Ue(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),x("div",Koe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Yoe=dt(Goe,[["__scopeId","data-v-fb6f1365"]]),Qoe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Xoe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Zoe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},gv=qe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),$("svg",Qoe,[...n[0]||(n[0]=[x("circle",{cx:"18",cy:"18",r:"15"},null,-1),x("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),$("svg",Xoe,[...n[1]||(n[1]=[x("circle",{cx:"14",cy:"14",r:"12"},null,-1),x("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),x("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),$("svg",Zoe,[...n[2]||(n[2]=[x("path",{d:"M14 3 L26 24 H2 Z"},null,-1),x("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),x("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Joe={key:0,class:"center-body"},eie={class:"center-text"},tie={key:1,class:"nb"},nie={class:"nb-lead"},sie=["href"],oie={class:"nb-or"},iie={class:"nb-fallback"},rie={class:"nb-fb-text"},lie=["href"],aie={class:"nb-code-row"},cie={class:"nb-code"},uie={class:"nb-status"},die={class:"nb-status-text"},fie={class:"nb-countdown"},pie={key:2,class:"center-body"},hie={class:"center-text success-text"},mie={class:"center-hint"},gie={class:"center-body"},vie={class:"center-text err-text"},yie={class:"center-hint"},kie={class:"actions"},bie={class:"center-body"},_ie={class:"center-text warn-text"},wie={class:"center-hint"},Sie={class:"actions"},Cie=qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=J(!0),o=t,i=e,r=J("starting"),l=J(null),a=J(0),c=J(!1);let u=null,d=null;bn(async()=>{await f()}),Tn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",h(),p(y.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function p(y){u&&clearTimeout(u),u=setTimeout(async()=>{const T=await i.onPollOAuthLogin();T?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):T?.status==="expired"||T?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function k(){!l.value||!await js(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const T=Math.floor(y/60),P=y%60;return`${T}:${String(P).padStart(2,"0")}`}return(y,T)=>(w(),ye(pr,{open:s.value,"onUpdate:open":T[0]||(T[0]=P=>s.value=P),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:_e(()=>[r.value==="starting"?(w(),$("div",Joe,[ie(ri,{size:"md"}),x("span",eie,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(w(),$("div",tie,[x("div",nie,O(C(n)("login.lead")),1),x("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Ue(O(C(n)("login.authorizeInBrowser"))+" ",1),ie(Xe,{name:"external-link",size:"sm"})],8,sie),x("div",oie,O(C(n)("login.orDivider")),1),x("div",iie,[x("div",rie,[Ue(O(C(n)("login.fallbackPrefix")),1),x("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,lie),Ue(O(C(n)("login.fallbackSuffix")),1)]),x("div",aie,[x("span",cie,O(l.value.userCode),1),ie(Pt,{class:Re(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:_e(()=>[c.value?(w(),$(Pe,{key:0},[ie(Xe,{name:"check",size:"sm"}),Ue(" "+O(C(n)("login.copied")),1)],64)):(w(),$(Pe,{key:1},[ie(Xe,{name:"copy",size:"sm"}),Ue(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),x("div",uie,[ie(ri,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),x("span",die,O(C(n)("login.waitingAutoClose")),1),x("span",fie,O(v(a.value)),1)])])):r.value==="success"?(w(),$("div",pie,[ie(gv,{kind:"success"}),x("span",hie,O(C(n)("login.success")),1),x("span",mie,O(C(n)("login.successHint")),1)])):r.value==="expired"?(w(),$(Pe,{key:3},[x("div",gie,[ie(gv,{kind:"expired"}),x("span",vie,O(C(n)("login.expiredTitle")),1),x("span",yie,O(C(n)("login.expiredHint")),1)]),x("div",kie,[ie(Pt,{variant:"primary",onClick:_},{default:_e(()=>[Ue(O(C(n)("login.retry")),1)]),_:1}),ie(Pt,{variant:"secondary",onClick:g},{default:_e(()=>[Ue(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),$(Pe,{key:4},[x("div",bie,[ie(gv,{kind:"error"}),x("span",_ie,O(C(n)("login.errorTitle")),1),x("span",wie,O(C(n)("login.errorHint")),1)]),x("div",Sie,[ie(Pt,{variant:"primary",onClick:_},{default:_e(()=>[Ue(O(C(n)("login.retry")),1)]),_:1}),ie(Pt,{variant:"secondary",onClick:g},{default:_e(()=>[Ue(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):re("",!0)]),_:1},8,["open","title"]))}}),xie=dt(Cie,[["__scopeId","data-v-b228800e"]]);function Aie(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Tie(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Mie(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:Aie(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=Tie(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,_=r[p.id]===!1?m:Math.max(p.sessionCount,m);let k=p.branch;!k&&i&&o===p.root&&(k=i),f.push({...p,sessionCount:_,branch:k})}return f}function Eie(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=e.filter(o=>{const i=Date.parse(o.createdAt);return!Number.isNaN(i)&&i<n});return s.length>0?[...s,...t]:t}function Iie(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 $ie=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Nie(e){return $ie.has(e.type)}function Lie(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Oie(e,t,n=Lie){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const W3=["blue","mono"],z3=["light","dark","system"],U3=14,Pie=12,Rie=20;function Die(){const e=es($t.accent);return e&&W3.includes(e)?e:"blue"}function Bie(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Fie(){const e=es($t.colorScheme);return e&&z3.includes(e)?e:"system"}function Hie(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 My(e){return Number.isFinite(e)?Math.min(Rie,Math.max(Pie,Math.round(e))):U3}function Wie(){const e=es($t.uiFontSize);return e===null?U3:My(Number(e))}function zie(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${My(e)}px`)}const Ey=J(Fie()),Iy=J(Die()),$y=J(Wie());Ve(Ey,Hie,{immediate:!0});Ve(Iy,Bie,{immediate:!0});Ve($y,zie,{immediate:!0});function Uie(e){z3.includes(e)&&(Ey.value=e,ss($t.colorScheme,e))}function jie(e){W3.includes(e)&&(Iy.value=e,ss($t.accent,e))}function qie(e){const t=My(e);$y.value=t,ss($t.uiFontSize,String(t))}const Vie=600,Kie=250,Wh=250,Gie=1e3,Yie=160,Up=J(!1);let Ol=[],Bl=null,jp=-Wh;function Qie(){Ol=[],jp=-Wh,Up.value=!1,Bl!==null&&(clearTimeout(Bl),Bl=null)}function Xie(){Up.value=!0,Bl!==null&&clearTimeout(Bl),Bl=setTimeout(()=>{Bl=null,Ol=[],jp=-Wh,Up.value=!1},Gie)}function Zie(e){if(e<=0)return;const t=Date.now();Ol.push({time:t,chars:e});const n=t-Vie;if(Ol=Ol.filter(l=>l.time>=n),t-jp<Wh)return;jp=t;const s=Ol[0]?.time??t,o=Math.max(t-s,Kie);Ol.reduce((l,a)=>l+a.chars,0)/o*1e3>=Yie&&Xie()}function j3(){return{colorScheme:Ey,accent:Iy,uiFontSize:$y,fastMoon:Up,setColorScheme:Uie,setAccent:jie,setUiFontSize:qie,resetFastMoon:Qie,recordMoonDelta:Zie}}function q3(e,t){const n=es(e);return n===null?t:n==="1"}const Ny=J(q3($t.notifyOnComplete,!0)),Ly=J(q3($t.notifyOnQuestion,!1)),Oy=J(typeof Notification<"u"?Notification.permission:"denied"),Jie="/favicon.ico";async function V3(e,t,n){if(!n){e.value=!1,ss(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}Oy.value=s,s==="granted"&&(e.value=!0,ss(t,"1"))}function ere(e){return V3(Ny,$t.notifyOnComplete,e)}function tre(e){return V3(Ly,$t.notifyOnQuestion,e)}function K3(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function nre(e){return{title:Bn.global.t("settings.notifyTitle"),body:K3(e,Bn.global.t("settings.notifyFallback"))}}function sre(e,t){return{title:Bn.global.t("settings.notifyQuestionTitle"),body:K3(t,e,Bn.global.t("settings.notifyQuestionFallback"))}}function G3(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{Oy.value=i,i==="granted"&&dC(t,n,s)});return}dC(t,n,s)}}function dC(e,t,n){if(!e.isActiveAndVisible)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:Jie});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function ore(e,t){G3(Ny.value,t,nre(t.sessionTitle),`kimi-complete-${e}`)}function ire(e,t){G3(Ly.value,t,sre(t.sessionTitle,t.questionPreview),`kimi-question-${e}`)}function rre(){return{notifyOnComplete:Ny,notifyOnQuestion:Ly,notifyPermission:Oy,setNotifyOnComplete:ere,setNotifyOnQuestion:tre,maybeNotifyCompletion:ore,maybeNotifyQuestion:ire}}function lre(){return es($t.soundOnComplete)==="1"}const vd=J(lre());function are(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let vv=null;function Y3(){const e=are();if(!e)return null;if(vv===null)try{vv=new e}catch{return null}return vv}function Q3(){if(!vd.value)return;const e=Y3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Xi("sound: audio context resumed",{state:e.state})},t=>{Xi("sound: audio context resume rejected",{error:String(t)})})}let fC=!1;function cre(){if(fC||typeof window>"u")return;fC=!0;const e=()=>{Q3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}cre();function ure(e){vd.value=e,ss($t.soundOnComplete,e?"1":"0"),e&&Q3()}function pC(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 X3(){const e=Y3();if(e===null){Xi("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Xi("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Xi("sound: context resumed for next time",{state:e.state})},t=>{Xi("sound: resume rejected",{error:String(t)})});return}try{pC(e,880,0,.16,.18),pC(e,1320,.1,.22,.16),Xi("sound: chime scheduled",{state:e.state})}catch(t){Xi("sound: failed to play",{error:String(t)})}}function dre(){vd.value&&X3()}function fre(){vd.value&&X3()}function pre(){return{soundOnComplete:vd,setSoundOnComplete:ure,maybePlayCompletionSound:dre,maybePlayQuestionSound:fre}}function hC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const hre=1e3,mre=4096,mC=32*1024;function gre(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await pt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:hC(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=pt(),_=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 y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:mC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=pt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const y=v.status==="running",T=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!T)&&!(T&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const P=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?mre:mC});P.outputPreview!==void 0&&m.set(v.id,{preview:P.outputPreview,bytes:P.outputBytes})}catch{}finally{T&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],k=new Map(_.map(v=>[v.id,v])),g=p.map(v=>{const y=k.get(v.id),T=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:T?.preview??y?.outputPreview,outputBytes:T?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:hC(g,_)}}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())},hre))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=J(0);let d=null;return Ve(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ve(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let _;h&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}const Z3=$t.starredModels;function vre(){try{const e=es(Z3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function yre(e){try{ss(Z3,JSON.stringify(e))}catch{}}function kre(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=J([]),d=J(vre()),f=J({}),h=J({}),p=J([]),m=J(null);function _(Y){if(!(Y==null||Y.length===0))return u.value.find(q=>q.id===Y||q.model===Y)}function k(){const Y=e.activeSessionId?e.sessions.find(q=>q.id===e.activeSessionId):void 0;return _(Y?.model??m.value??e.defaultModel)}function g(Y){const q=Ql(k(),Y);return e.thinking=q,l(q),q}async function v(Y){try{const ae=await pt().listSkills(Y);f.value={...f.value,[Y]:ae}}catch{}}async function y(Y){try{const ae=await pt().listSkillsForWorkspace(Y);h.value={...h.value,[Y]:ae}}catch{}}async function T(){try{const Y=pt();u.value=await Y.listModels(),g(e.thinking)}catch(Y){n("loadModels",Y)}}async function P(){try{const Y=await pt().refreshOAuthProviderModels();for(const q of Y.failed)n("refreshOAuthProviderModels",new Error(q.reason),{message:q.provider})}catch{}}async function N(){try{const Y=pt();p.value=await Y.listProviders()}catch(Y){n("loadProviders",Y)}}async function b(Y){const q=e.activeSessionId,ae=Ql(_(Y),e.thinking),de=e.thinking;if(!q){m.value=Y,g(ae);return}const ne=e.sessions.find(X=>X.id===q)?.model;a(q,X=>({...X,model:Y})),ae!==de&&(e.thinking=ae,l(ae));try{await pt().updateSession(q,{model:Y,thinking:ae!==de?ae:void 0})}catch(X){a(q,he=>({...he,model:ne??he.model})),ae!==de&&(e.thinking=de,l(de)),n("setModel",X,{sessionId:q});return}await s(q)}function M(Y){const q=new Set(d.value);q.has(Y)?q.delete(Y):q.add(Y),d.value=Array.from(q),yre(d.value)}async function I(Y,q,ae){const de=ae??e.activeSessionId;if(!de)return;const ne=i.value==="idle"&&!r.has(de),X=`msg_skill_opt_${Date.now().toString(36)}`;if(ne){r.add(de),e.sendingBySession={...e.sendingBySession,[de]:!0};const he={id:X,sessionId:de,role:"user",content:[{type:"text",text:`/${Y}${q?` ${q}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:Y,skillArgs:q}}};c(de,Oe=>[...Oe,he])}try{await pt().activateSkill(de,Y,q)}catch(he){ne&&(r.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},c(de,Oe=>Oe.filter(je=>je.id!==X))),n("activateSkill",he,{sessionId:de})}}async function L(Y){try{await pt().addProvider(Y),await Promise.all([N(),T()])}catch(q){n("addProvider",q)}}async function S(Y){try{await pt().deleteProvider(Y),await Promise.all([N(),T()])}catch(q){n("deleteProvider",q)}}async function E(Y){try{const q=await pt().refreshProvider(Y);for(const ae of q.failed)n("refreshProvider",new Error(ae.reason),{message:ae.provider});await Promise.all([N(),T()])}catch(q){n("refreshProvider",q)}}async function R(){try{const Y=await pt().refreshAllProviders();for(const q of Y.failed)n("refreshAllProviders",new Error(q.reason),{message:q.provider});await Promise.all([N(),T()])}catch(Y){n("refreshAllProviders",Y)}}async function D(){try{return await pt().startOAuthLogin()}catch{return null}}async function F(){try{return await pt().pollOAuthLogin()}catch{return null}}async function U(){try{await pt().cancelOAuthLogin()}catch{}}function G(Y){const q=g(Y);o({thinking:q})}return{models:u,starredModelIds:d,providers:p,draftModel:m,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:v,loadSkillsForWorkspace:y,loadModels:T,refreshOAuthProviderModels:P,loadProviders:N,setModel:b,toggleStarModel:M,activateSkill:I,addProvider:L,deleteProvider:S,refreshProvider:E,refreshAllProviders:R,startOAuthLogin:D,pollOAuthLogin:F,cancelOAuthLogin:U,setThinking:G}}const J3="kimiWeb.compaction",bre=/^read[_-]?media(?:file)?$/i,_re=/^data:([^;]+);base64,(.*)$/s,wre=/^<(image|video|audio)\s+path="([^"]+)">$/,Sre=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Cre=/Mime type:\s*([^.\s]+)/i,xre=/Size:\s*(\d+)\s*bytes/i,Are=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Tre(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Mre(e){const t=Sre.exec(e.trim());return t?{kind:t[1],path:Tre(t[2])}:null}const Ere=/^f_[A-Za-z0-9]{10,}$/;function Ire(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return Ere.test(s)?s:void 0}function $re(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 Nre(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 Lre(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 Ore(e,t){if(!bre.test(e))return;const n=Nre(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=wre.exec(h);p&&(o=p[1],s=p[2]);const m=Cre.exec(h);m?.[1]&&(i=m[1]);const _=xre.exec(h);_?.[1]&&(r=Number(_[1]));const k=Are.exec(h);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Lre(d);f&&(a=f)}if(a===null)return;const c=_re.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=$re(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Pre(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
269
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
270
|
-
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
271
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
272
|
-
`)):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 Rre(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 Dre(e,t){const n=e.split(`
|
|
273
|
-
`),s=t.split(`
|
|
274
|
-
`),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 Bre(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:Dre(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 Fre(e){const t=`<prompt>
|
|
275
|
-
`,n=`
|
|
276
|
-
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):Hre(e)}function Hre(e){const t=e.split(`
|
|
277
|
-
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
278
|
-
`):e}function Wre(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function zre(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
279
|
-
`);return Fre(t)}function e4(e,t){const n=e.metadata?.origin??{},s=zre(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 Ure(e,t,n){const{text:s,cron:o}=e4(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function jre(e,t){const{text:n,cron:s}=e4(e,t);return{kind:"cron",text:n,cron:s}}function qre(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 Vre(e){return e.metadata?.origin?.kind==="compaction_summary"}function Kre(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Gre(e){return e.tools.some(t=>t.status==="running")}function Yre(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 t4(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);let a=null;function c(f=!1){if(!a)return;const h=a;if(a=null,!f||!s)for(let p=0;p<h.tools.length;p++){const m=h.tools[p];if(m.status!=="running")continue;const _={...m,status:"ok"};h.tools[p]=_;const k=h.blocks.find(g=>g.kind==="tool"&&g.tool.id===_.id);k&&k.kind==="tool"&&(k.tool=_)}i.push({id:h.id,role:"assistant",no:r++,text:h.textParts.join(`
|
|
280
|
-
`),thinking:h.thinkingParts.length>0?h.thinkingParts.join(`
|
|
281
|
-
`):void 0,tools:h.tools.length>0?h.tools:void 0,blocks:h.blocks.length>0?h.blocks:void 0,approval:h.approval,approvalId:h.approvalId,durationMs:h.durationMs})}function u(f,h){for(const p of h)if(p.type==="text"){if(p.text){f.textParts.push(p.text);const m=f.blocks.at(-1);m&&m.kind==="text"?m.text+=`
|
|
282
|
-
`+p.text:f.blocks.push({kind:"text",text:p.text})}}else if(p.type==="thinking"){if(p.thinking){f.thinkingParts.push(p.thinking);const m=f.blocks.at(-1);m&&m.kind==="thinking"?m.thinking+=`
|
|
283
|
-
`+p.thinking:f.blocks.push({kind:"thinking",thinking:p.thinking})}}else if(p.type==="toolUse"){const m=l.get(p.toolCallId),_={id:p.toolCallId,name:p.toolName,arg:typeof p.input=="string"?p.input:JSON.stringify(p.input),status:"running",output:p.outputLines,planPath:p.toolName==="ExitPlanMode"?o[p.toolCallId]?.path:void 0};f.tools.push(_),f.blocks.push({kind:"tool",tool:_}),m&&(f.approval=Bre(m),f.approvalId=m.approvalId)}else if(p.type==="toolResult"){const m=f.tools.findIndex(_=>_.id===p.toolCallId);if(m!==-1){const _=f.tools[m],k={..._,status:p.isError?"error":"ok",output:Pre(p.output),media:p.isError?void 0:Ore(_.name,p.output)};k.name==="ExitPlanMode"&&!k.planPath&&(k.planPath=Yre(k.output)),f.tools[m]=k;const g=f.blocks.find(v=>v.kind==="tool"&&v.tool.id===p.toolCallId);g&&g.kind==="tool"&&(g.tool=k)}}}function d(f){if(f.type==="image"||f.type==="video"){const h=f.type,p=f.source;if(p.kind==="url")return{url:p.url,kind:h};if(p.kind==="base64")return{url:`data:${p.mediaType};base64,${p.data}`,kind:h};if(p.kind==="file"&&n)return{url:n(p.fileId),kind:h,fileId:p.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(Vre(f)){c();const k=f.metadata?.[J3];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
|
|
284
|
-
`),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){const k=Wre(f);if(k!==void 0&&a!==null&&Gre(a)){a.blocks.push(jre(f,k));continue}if(c(),k!==void 0){i.push(Ure(f,r++,k));continue}if(!qre(f))continue;const g=f.metadata?.origin,v=g?.kind==="skill_activation"&&g?.trigger==="user-slash",y=g?.kind==="plugin_command"&&g?.trigger==="user-slash",T=[],P=[];for(const N of f.content){if(N.type==="text")if(v)T.push(g.skillArgs??"");else if(y)T.push(g.commandArgs??"");else{const M=Mre(N.text);if(M&&(M.kind==="video"||M.kind==="image")&&n){const I=Ire(M.path);if(I){P.push({url:n(I),kind:M.kind,alt:I,fileId:I});continue}}T.push(N.text)}const b=d(N);b&&P.push({url:b.url,kind:b.kind,alt:N.type==="file"?N.name:void 0,fileId:b.fileId})}i.push({id:f.id,role:"user",no:r++,text:T.join(`
|
|
285
|
-
`),images:P.length>0?P:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const h=f.promptId;Kre(a,h)?a!==null&&a.promptId===void 0&&h!==void 0&&(a.promptId=h):(c(),a={id:f.id,promptId:h,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const m=a;if(m===null)continue;const _=JSON.stringify(f.content);m.promptId!==void 0&&m.seenSigs.has(_)||(m.seenSigs.add(_),u(m,f.content))}return c(!0),i}function Qre(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=J({}),l=B(()=>{const M=e.activeSessionId;if(!M)return null;const I=r.value[M];return I?{parentId:M,agentId:I.agentId}:null}),a=B(()=>l.value?.parentId??null),c=B(()=>l.value!==null),u=B(()=>{const M=l.value;return M?!!e.sideChatSendingByAgent[M.agentId]:!1}),d=B(()=>{const M=l.value;return M?e.sideChatSendingByAgent[M.agentId]?!0:(e.tasksBySession[M.parentId]??[]).some(I=>I.id===M.agentId&&I.status==="running"):!1}),f=B(()=>{const M=l.value;if(!M)return[];const I=e.sideChatMessagesByAgent[M.agentId]??[];return t4(I,[],L=>pt().getFileUrl(L),d.value)});function h(M,I){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:I(e.sideChatMessagesByAgent[M]??[])}}function p(M,I){h(M,L=>[...L,I])}function m(M){h(M,I=>{const L=[...I].reverse().findIndex(E=>E.role==="user");if(L===-1)return I;const S=I.length-1-L;return I.filter((E,R)=>R!==S)})}function _(M,I){h(M,L=>{const S=[...L];for(let E=S.length-1;E>=0;E-=1){const R=S[E];if(R.role==="user")return S[E]={...R,promptId:R.promptId??I},S}return L})}function k(M,I,L){L&&h(M,S=>{const E=S.at(-1);if(E?.role==="assistant"){const R=E.content[0],D=R?.type==="text"?R.text:"";return[...S.slice(0,-1),{...E,content:[{type:"text",text:`${D}${L}`}]}]}return[...S,{id:s(),sessionId:I,role:"assistant",content:[{type:"text",text:L}],createdAt:new Date().toISOString()}]})}function g(M,I,L){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[M]:!1},!L)return;const E=(e.sideChatMessagesByAgent[M]??[]).at(-1);(E?.role==="assistant"&&E.content[0]?.type==="text"?E.content[0].text:"").trim().length>0||k(M,I,L)}async function v(M){const I=e.activeSessionId;I&&await y(I,M)}async function y(M,I){if(!r.value[M]){let L;try{({agentId:L}=await pt().startBtw(M))}catch(S){n("openSideChat",S,{sessionId:M});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[L]:e.sideChatMessagesByAgent[L]??[]},r.value={...r.value,[M]:{agentId:L}},o(),i()?.markSideChannelAgent(L)}I&&I.trim()&&await T(M,I.trim())}async function T(M,I){const L=r.value[M],S=I.trim();if(!L||!S)return;const E=M,R=L.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!0};const D={id:s(),sessionId:E,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(R,D);try{const F=e.sessions.find(q=>q.id===E),U=(F?.model&&F.model.length>0?F.model:e.defaultModel)??void 0,G=U===void 0?void 0:t.models().find(q=>q.model===U||q.id===U||q.displayName===U),Y=await pt().submitPrompt(E,{content:[{type:"text",text:S}],agentId:R,model:U,thinking:Ql(G,e.thinking),permissionMode:e.permission,planMode:e.planModeBySession[E]??!1,swarmMode:e.swarmModeBySession[E]??!1});_(R,Y.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[E]:[...e.sideChatUserMessageIdsBySession[E]??[],Y.userMessageId]}}catch(F){n("sendSideChatPrompt",F,{sessionId:E}),m(R),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!1}}}function P(){const M=e.activeSessionId;if(!M)return;const{[M]:I,...L}=r.value;r.value=L}async function N(M){const I=l.value;I&&await T(I.parentId,M)}function b(M){if(!r.value[M])return;const{[M]:I,...L}=r.value;r.value=L}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:k,finishSideChatAgent:g,openSideChat:v,openSideChatOn:y,closeSideChat:P,sendSideChatPrompt:N,clearSideChatForSession:b}}function Xre(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 Zre(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
286
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Xre(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 V1="/sessions/";function gC(e){const{pathname:t}=e;if(!t.startsWith(V1))return;const n=t.slice(V1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Jre(e){return e===void 0||e.length===0?"/":`${V1}${encodeURIComponent(e)}`}const ele=50,K1=5,tle=40402,nle=40410,sle=40902;function yv(e){return ol(e)&&e.code===sle}const ole=40904;function ile(e){return ol(e)&&e.code===ole}const El=Os({}),Sf=Os({}),kv=Os({});function rle(e,t){const{t:n}=Bn.global,{confirm:s}=al(),{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:_,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:T,hasLoadedMessages:P,refreshSessionStatus:N,persistSessionProfile:b,mergedWorkspaces:M,workspacesView:I,status:L,workspaceIdForSession:S,savePermissionToStorage:E,savePlanModeToStorage:R,saveSwarmModeToStorage:D,saveGoalModeToStorage:F,draftModes:U,saveUnread:G,saveActiveWorkspaceToStorage:Y,saveHiddenWorkspacesToStorage:q,goalErrorMessage:ae,resetFastMoon:de,initialized:ne,selectedDiffPath:X,fileDiffLines:he,fileDiffLoading:Oe}=t;async function je(se){if(e.messagesLoadingMoreBySession[se])return;const we=e.messagesBySession[se];if(!we||we.length===0)return;const Ce=we[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!1};try{const De=await pt().listMessages(se,{beforeId:Ce,pageSize:ele}),ot=[...De.items].reverse();k(se,at=>[...ot,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[se]:De.hasMore}}catch(De){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[se]:!0},l("loadOlderMessages",De,{sessionId:se})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[se]:!1}}}function it(se){o.loadTasksForSession(se),Q(se),N(se),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,se)||r.loadSkillsForSession(se)}async function ce(se){const we=e.activeSessionId;if(we){X.value=se,he.value=[],Oe.value=!0;try{const De=await pt().getFileDiff(we,se);if(X.value!==se)return;he.value=Zre(De.diff)}catch(Ce){X.value===se&&(he.value=[]),console.warn("[loadFileDiff] diff unavailable for",se,Ce)}finally{X.value===se&&(Oe.value=!1)}}}function z(){X.value=null,he.value=[],Oe.value=!1}async function Q(se){try{const Ce=await pt().getGitStatus(se);e.gitStatusBySession={...e.gitStatusBySession,[se]:Ce}}catch{}}async function oe(){try{const we=await pt().getAuth();e.authReady=we.ready,e.defaultModel=we.defaultModel,e.managedProviderStatus=we.managedProvider?.status??null}catch{}}async function W(){try{const se=pt();e.config=await se.getConfig()}catch{}}async function Z(se){try{const Ce=await pt().setConfig(se);return e.config=Ce,e.defaultModel=Ce.defaultModel??null,!0}catch(we){return l("setConfig",we),!1}}const ue=100,le=30,me=720*60*1e3;async function j(){const se=pt(),we=[];let Ce;for(;;){const De=await se.listSessions({pageSize:ue,beforeId:Ce,excludeEmpty:!0});if(we.push(...De.items),!De.hasMore||De.items.length===0)break;Ce=De.items[De.items.length-1].id}return we}async function ee(se){const we=pt(),Ce=[],De=Date.now(),ot=Jt=>De-new Date(Jt.updatedAt).getTime();let at,Mt=!1,nn=!0;for(;;){let Jt;try{Jt=await we.listSessions({workspaceId:se,pageSize:K1,beforeId:at,excludeEmpty:!0})}catch(Kt){if(nn)throw Kt;break}if(Mt=Jt.hasMore,Jt.items.length===0)break;const As=Jt.items[Jt.items.length-1],hr=ot(As)>=me;if(!nn&&hr){const Kt=Jt.items.findIndex(On=>ot(On)>=me),wn=Kt>=0?Kt+1:Jt.items.length;Ce.push(...Jt.items.slice(0,wn)),Mt=Jt.hasMore||wn<Jt.items.length;break}if(Ce.push(...Jt.items),nn=!1,!Jt.hasMore||hr)break;at=As.id}return{workspaceId:se,page:{items:Ce,hasMore:Mt}}}async function pe(){const se=e.workspaces;if(se.length===0){const Mt=await j().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Mt}const we=await Promise.all(se.map(Mt=>ee(Mt.id).catch(()=>({workspaceId:Mt.id,page:{items:[],hasMore:!1}})))),Ce=[],De={},ot={},at={};for(const{workspaceId:Mt,page:nn}of we)Ce.push(...nn.items),De[Mt]=nn.hasMore,ot[Mt]=nn.items.length>0?nn.items[nn.items.length-1].id:void 0,at[Mt]=Math.max(nn.items.length,K1);return e.sessionsHasMoreByWorkspace=De,e.sessionsCursorByWorkspace=ot,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Ce.sort((Mt,nn)=>new Date(nn.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),Ce}async function ke(se){if(e.sessionsLoadingMoreByWorkspace[se]||e.sessionsHasMoreByWorkspace[se]===!1)return;const we=e.sessionsCursorByWorkspace[se];if(we!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!0};try{const Ce=await pt().listSessions({workspaceId:se,pageSize:le,beforeId:we,excludeEmpty:!0}),De=new Set(e.sessions.map(at=>at.id)),ot=Ce.items.filter(at=>!De.has(at.id));ot.length>0&&d([...e.sessions,...ot]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[se]:Ce.items.length>0?Ce.items[Ce.items.length-1].id:we},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[se]:Ce.hasMore}}catch(Ce){l("loadMoreSessions",Ce)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[se]:!1}}}}async function Te(){if(e.sessionsFullyLoaded)return;const se=await j().catch(()=>null);if(se===null)return;d(se),e.sessionsFullyLoaded=!0;const we={};for(const Ce of e.workspaces)we[Ce.id]=!1;e.sessionsHasMoreByWorkspace=we}async function Ie(){e.loading=!0;try{const se=pt();await Promise.all([se.getHealth().catch(()=>null),se.getMeta().then(Mt=>{e.serverVersion=Mt.serverVersion,e.availableOpenInApps=Mt.openInApps,e.dangerousBypassAuth=Mt.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await oe(),await W(),await fe();const we=await pe();d(we);const Ce=we[0],De=e.activeWorkspaceId;!(De!==null&&M.value.some(Mt=>Mt.id===De))&&Ce&&Ge(S(Ce)),Kn();const at=typeof window<"u"?gC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(nn=>nn.id===at)||await Dn(at))&&await Yt(at,{urlMode:"replace"}),!e.activeSessionId&&we.length>0&&await Yt(we[0].id,{urlMode:"replace"})}catch(se){l("load",se)}finally{e.loading=!1,ne.value=!0}}async function fe(){try{const se=pt(),[we,Ce]=await Promise.all([se.listWorkspaces().catch(()=>[]),se.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Me(we),e.fsHome=Ce.home||null,e.recentRoots=Ce.recentRoots}catch{}}function Me(se){const we=nf();return Object.keys(we).length===0?se:se.map(Ce=>{const De=we[Ce.root];return De!==void 0?{...Ce,name:De}:Ce})}function Ge(se){e.activeWorkspaceId=se,Y(se)}function lt(se){Ge(se);const we=e.sessions.filter(Ce=>S(Ce)===se);if(we.length>0){const Ce=we[0];Ce&&Ce.id!==e.activeSessionId&&Yt(Ce.id)}else _(void 0),nt(void 0,"push")}function kt(se){const we=nf()[se.root],Ce=we!==void 0?{...se,name:we}:se;e.hiddenWorkspaceRoots.includes(Ce.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Ce.root),q(e.hiddenWorkspaceRoots));const De=e.workspaces.findIndex(at=>at.id===Ce.id||at.root===Ce.root);if(De===-1){e.workspaces=[Ce,...e.workspaces];return}const ot=[...e.workspaces];ot[De]=Ce,e.workspaces=ot}function bt(se){if(se.type==="workspaceCreated"||se.type==="workspaceUpdated"){kt(se.workspace);return}const we=e.workspaces.find(De=>De.id===se.workspaceId)?.root??se.root;if(we&&!e.hiddenWorkspaceRoots.includes(we)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,we],q(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(De=>De.id!==se.workspaceId&&De.root!==we),e.activeWorkspaceId===se.workspaceId||e.activeWorkspaceId===we){const De=I.value[0]?.id??null;if(e.activeWorkspaceId=De,De)Y(De);else try{pc($t.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,z(),nt(void 0,"replace")}}function Et(){_(void 0),nt(void 0,"push")}function Rt(se){Ge(se),Et(),z()}async function vt(se){const we=M.value.find(As=>As.id===se);if(!we)return null;const Ce=pt();let De,ot=we.root;try{const As=await Ce.addWorkspace({root:we.root});De=As.id,ot=As.root,kt(As)}catch{}const at=r.draftModel.value??void 0,Mt=await Ce.createSession({workspaceId:De,cwd:ot,model:at});r.draftModel.value=null;const nn=at!==void 0&&(!Mt.model||Mt.model.length===0)?{...Mt,model:at}:Mt;h(nn),Ge(Mt.workspaceId??De??se),await Yt(Mt.id);const Jt=Mt.id;return U.planMode&&(e.planModeBySession={...e.planModeBySession,[Jt]:!0},R()),U.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Jt]:!0},D()),U.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Jt]:!0},F()),U.planMode=!1,U.swarmMode=!1,U.goalMode=!1,Jt}async function qt(se,we,Ce){try{const De=await vt(se);if(!De)return;await Ke(De,we,Ce)}catch(De){l("startSessionAndSendPrompt",De)}}async function dn(se,we,Ce){try{const De=await vt(se);if(!De)return;const ot=e.planModeBySession[De]??!1,at=e.swarmModeBySession[De]??!1,Mt=e.sessions.find(Jt=>Jt.id===De),nn=(Mt?.model&&Mt.model.length>0?Mt.model:e.defaultModel)??void 0;await b({planMode:ot,swarmMode:at,permissionMode:e.permission,thinking:Gn(nn)},De),await r.activateSkill(we,Ce,De)}catch(De){l("startSessionAndActivateSkill",De)}}async function os(se,we){try{const Ce=await vt(se);if(!Ce)return;await i.openSideChatOn(Ce,we)}catch(Ce){l("startSessionAndOpenSideChat",Ce)}}async function Vt(se){const we=se.trim();if(!we)return!1;const Ce=pt();try{const De=await Ce.addWorkspace({root:we});return kt(De),Rt(De.id),!0}catch{return!1}}async function fn(se){try{return await pt().browseFs(se)}catch{return{path:"",parent:null,entries:[]}}}async function Ds(){try{return await pt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function nt(se,we){if(we==="none"||typeof window>"u"||!window.history)return;const Ce=Jre(se);if(window.location.pathname!==Ce)try{we==="push"?window.history.pushState(null,"",Ce):window.history.replaceState(null,"",Ce)}catch{}}async function Dn(se){try{const we=await pt().getSession(se);return e.sessions.some(Ce=>Ce.id===we.id)||p(we),!0}catch{return!1}}function is(){const se=gC(window.location);if(se===void 0){_(void 0);return}if(se!==e.activeSessionId){if(e.sessions.some(we=>we.id===se)){Yt(se,{urlMode:"none"});return}(async()=>{if(await Dn(se)){await Yt(se,{urlMode:"none"});return}const we=e.sessions[0];we?await Yt(we.id,{urlMode:"replace"}):(_(void 0),nt(void 0,"replace"))})()}}let Vn=!1;function Kn(){Vn||typeof window>"u"||(Vn=!0,window.addEventListener("popstate",is))}async function Yt(se,we){const Ce=P(se),De=!Ce&&u.has(se);u.delete(se);try{nt(se,we?.urlMode??"push"),e.sessionLoading=!Ce&&!De,_(se),de(),e.unreadBySession[se]&&(e.unreadBySession={...e.unreadBySession,[se]:!1},G({[se]:!1})),z();const ot=e.sessions.find(at=>at.id===se);if(ot){const at=S(ot);e.activeWorkspaceId!==at&&Ge(at)}if(Ce){if(await T(se)==="not-found")return}else if(await y(se)==="not-found")return;it(se)}catch(ot){l("selectSession",ot,{sessionId:se})}finally{e.activeSessionId===se&&(e.sessionLoading=!1)}}function Gn(se){const we=se===void 0?void 0:r.models.value.find(Ce=>Ce.model===se||Ce.id===se||Ce.displayName===se);return Ql(we,e.thinking)}async function Ke(se,we,Ce){c.add(se),e.sendingBySession={...e.sendingBySession,[se]:!0};const De=g();try{const ot=pt(),at=[];we&&at.push({type:"text",text:we});for(const On of Ce??[])On.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:On.fileId}}):at.push({type:"image",source:{kind:"file",fileId:On.fileId}});if(at.length===0)return c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},!1;const Mt={id:De,sessionId:se,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(se,On=>[...On,Mt]);const nn=e.sessions.find(On=>On.id===se),Jt=(nn?.model&&nn.model.length>0?nn.model:e.defaultModel)??void 0,As=e.planModeBySession[se]??!1,hr=e.swarmModeBySession[se]??!1,Kt=e.goalModeBySession[se]??!1;if(Kt&&we)try{await ot.updateSession(se,{goalObjective:we.trim()})}catch(On){return l("createGoal",On,{sessionId:se}),c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},k(se,ks=>ks.some(bs=>bs.id===De)?ks.filter(bs=>bs.id!==De):ks),!1}const wn=await ot.submitPrompt(se,{content:at,model:Jt,thinking:Gn(Jt),permissionMode:e.permission,planMode:As,swarmMode:hr});return Kt&&(e.goalModeBySession={...e.goalModeBySession,[se]:!1},F()),e.promptIdBySession={...e.promptIdBySession,[se]:wn.promptId},k(se,On=>{const ks=On.findIndex(Ts=>Ts.id===De);if(ks===-1)return On;const bs=[...On];return bs[ks]={...bs[ks],promptId:bs[ks].promptId??wn.promptId},bs}),v()?.bindNextPromptId(se,wn.promptId),!0}catch(ot){return c.delete(se),e.sendingBySession={...e.sendingBySession,[se]:!1},k(se,at=>at.some(Mt=>Mt.id===De)?at.filter(Mt=>Mt.id!==De):at),l("sendPrompt",ot,{sessionId:se}),!1}}async function Qe(se,we){const Ce=e.activeSessionId;if(Ce){if(a.value!=="idle"||c.has(Ce)){ln(se,we);return}await Ke(Ce,se,we)}}async function Dt(se,we){const Ce=e.activeSessionId;if(!Ce)return;const De=e.queuedBySession[Ce]??[],ot=[],at=[];for(const Kt of De){const wn=Kt.text.trim();wn&&ot.push(wn),Kt.attachments?.length&&at.push(...Kt.attachments)}const Mt=se.trim();if(Mt&&ot.push(Mt),we?.length&&at.push(...we),ot.length===0&&at.length===0)return;De.length>0&&(e.queuedBySession={...e.queuedBySession,[Ce]:[]});const nn=ot.join(`
|
|
287
|
-
|
|
288
|
-
`);if(a.value==="idle"&&!c.has(Ce)){await Ke(Ce,nn,at);return}const Jt=[];nn&&Jt.push({type:"text",text:nn});for(const Kt of at)Kt.kind==="video"?Jt.push({type:"video",source:{kind:"file",fileId:Kt.fileId}}):Jt.push({type:"image",source:{kind:"file",fileId:Kt.fileId}});const As=g(),hr={id:As,sessionId:Ce,role:"user",content:Jt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ce,Kt=>[...Kt,hr]);try{const Kt=pt(),wn=e.sessions.find(bs=>bs.id===Ce),On=(wn?.model&&wn.model.length>0?wn.model:e.defaultModel)??void 0,ks=await Kt.submitPrompt(Ce,{content:Jt,model:On,thinking:Gn(On),permissionMode:e.permission,planMode:e.planModeBySession[Ce]??!1,swarmMode:e.swarmModeBySession[Ce]??!1});if(k(Ce,bs=>{const Ts=bs.findIndex(Qh=>Qh.id===As);if(Ts===-1)return bs;const ra=[...bs];return ra[Ts]={...ra[Ts],promptId:ra[Ts].promptId??ks.promptId},ra}),ks.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ce]:ks.promptId},v()?.bindNextPromptId(Ce,ks.promptId);return}try{await Kt.steerPrompts(Ce,[ks.promptId])}catch{}}catch(Kt){k(Ce,wn=>wn.filter(On=>On.id!==As)),l("steer",Kt,{sessionId:Ce})}}async function tn(se,we){try{const De=await pt().uploadFile({file:se,name:we});return{fileId:De.id,name:De.name,mediaType:De.mediaType}}catch(Ce){return l("uploadImage",Ce),null}}function ln(se,we){const Ce=e.activeSessionId;if(!Ce)return;const De=e.queuedBySession[Ce]??[];e.queuedBySession={...e.queuedBySession,[Ce]:[...De,{text:se,attachments:we}]}}async function Zt(){const se=e.activeSessionId;if(!se)return;const we=e.sessions.find(ot=>ot.id===se);let Ce=e.promptIdBySession[se];if(Ce===void 0){const ot=we?.currentPromptId;ot?.startsWith("prompt_")&&(Ce=ot)}const De=pt();if(Ce!==void 0)try{if((await De.abortPrompt(se,Ce)).aborted)return;const at={...e.promptIdBySession};delete at[se],e.promptIdBySession=at}catch(ot){if(ol(ot)&&ot.code===tle){const at={...e.promptIdBySession};delete at[se],e.promptIdBySession=at}else{l("abortCurrentPrompt",ot,{sessionId:se});return}}try{await De.abortSession(se)}catch(ot){l("abortCurrentPrompt",ot,{sessionId:se})}}function _n(se,we){const Ce=e.approvalsBySession[se]??[];e.approvalsBySession={...e.approvalsBySession,[se]:Ce.filter(De=>De.approvalId!==we)}}function xt(se,we){const Ce=e.questionsBySession[se]??[];e.questionsBySession={...e.questionsBySession,[se]:Ce.filter(De=>De.questionId!==we)}}async function Yn(se,we){const Ce=e.activeSessionId;if(Ce&&!Sf[se]){Sf[se]=!0;try{const De=pt(),ot={decision:we.decision,scope:we.scope,feedback:we.feedback,selectedLabel:we.selectedLabel};await De.respondApproval(Ce,se,ot),_n(Ce,se)}catch(De){yv(De)?_n(Ce,se):l("respondApproval",De,{sessionId:Ce})}finally{delete Sf[se]}}}async function Wt(se,we){const Ce=e.activeSessionId;if(Ce&&!El[se]){El[se]="answer";try{await pt().respondQuestion(Ce,se,we),xt(Ce,se)}catch(De){yv(De)?xt(Ce,se):l("respondQuestion",De,{sessionId:Ce})}finally{delete El[se]}}}async function ys(se){const we=e.activeSessionId;if(we&&!El[se]){El[se]="dismiss";try{await pt().dismissQuestion(we,se),xt(we,se)}catch(Ce){yv(Ce)?xt(we,se):l("dismissQuestion",Ce,{sessionId:we})}finally{delete El[se]}}}async function Cs(se){const we=e.activeSessionId;if(we&&!kv[se]){kv[se]=!0;try{await pt().cancelTask(we,se);const De=e.tasksBySession[we]??[];e.tasksBySession={...e.tasksBySession,[we]:De.map(ot=>ot.id===se?{...ot,status:"cancelled"}:ot)}}catch(Ce){ile(Ce)||l("cancelTask",Ce,{sessionId:we})}finally{delete kv[se]}}}function Co(se){const we=e.activeSessionId;we?(e.planModeBySession={...e.planModeBySession,[we]:se},R(),b({planMode:se})):U.planMode=se}function Vs(){const se=e.activeSessionId,we=se?e.planModeBySession[se]??!1:U.planMode;Co(!we)}function co(se){const we=e.activeSessionId;we?(e.swarmModeBySession={...e.swarmModeBySession,[we]:se},D(),b({swarmMode:se})):U.swarmMode=se}async function uo(){const se=e.activeSessionId,Ce=!(se?e.swarmModeBySession[se]??!1:U.swarmMode);Ce&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||co(Ce)}function Lt(se){const we=e.activeSessionId;we?(e.goalModeBySession={...e.goalModeBySession,[we]:se},F()):U.goalMode=se}function Wo(){const se=e.activeSessionId,we=se?e.goalModeBySession[se]??!1:U.goalMode;Lt(!we)}async function zo(se){const we=se.trim();if(!we||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:we}),variant:"primary"}))return;let Ce=e.activeSessionId;if(!Ce){const De=e.activeWorkspaceId,ot=De&&I.value.some(at=>at.id===De)?De:I.value[0]?.id??null;if(!ot)return;try{Ce=await vt(ot)??void 0}catch(at){l("createGoal",at);return}if(!Ce)return}try{await pt().updateSession(Ce,{goalObjective:we})}catch(De){l("createGoal",De,{sessionId:Ce,message:ae(De)});return}e.goalModeBySession[Ce]&&(e.goalModeBySession={...e.goalModeBySession,[Ce]:!1},F()),e.activeSessionId===Ce?await Qe(we):await Ke(Ce,we)}function Ye(se){const we=e.activeSessionId;we&&Promise.resolve(pt().updateSession(we,{goalControl:se})).catch(Ce=>{l("controlGoal",Ce,{sessionId:we,message:ae(Ce)})})}function et(se){e.permission=se,E(se),b({permissionMode:se})}function st(se){const we=[...e.warnings];we.splice(se,1),e.warnings=we}async function Bt(se,we){try{await pt().updateSession(se,{title:we}),f(se,De=>({...De,title:we}))}catch(Ce){l("renameSession",Ce,{sessionId:se})}}async function Uo(se,we){const Ce=e.workspaces.find(ot=>ot.id===se)?.root,De=()=>{e.workspaces=e.workspaces.map(ot=>ot.id===se?{...ot,name:we}:ot)};try{if(await pt().updateWorkspace(se,{name:we}),Ce!==void 0){const ot=nf();Ce in ot&&(delete ot[Ce],N_(ot))}De()}catch(ot){if(Ce!==void 0&&ol(ot)&&ot.code===nle){N_({...nf(),[Ce]:we}),De();return}l("renameWorkspace",ot)}}async function Oi(se){const we=e.workspaces.find(at=>at.id===se)?.root??M.value.find(at=>at.id===se)?.root??se,Ce=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,De=e.activeWorkspaceId===se||e.activeWorkspaceId===we,ot=!!(Ce&&(Ce.cwd===we||Ce.workspaceId===se||S(Ce)===se));we&&!e.hiddenWorkspaceRoots.includes(we)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,we],q(e.hiddenWorkspaceRoots));try{await pt().deleteWorkspace(se)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==se&&at.root!==we),De||ot){const at=I.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Y(at);else try{pc($t.activeWorkspace)}catch{}}(De||ot)&&(_(void 0),e.sessionLoading=!1,z(),nt(void 0,"replace"))}async function Ee(se){try{await pt().archiveSession(se),m(se),i.clearSideChatForSession(se);const{[se]:Ce,...De}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=De,e.activeSessionId===se){const ot=e.sessions[0];ot?await Yt(ot.id,{urlMode:"replace"}):(_(void 0),nt(void 0,"replace"))}}catch(we){l("archiveSession",we,{sessionId:se})}}async function Ae(se){try{const we=await pt().restoreSession(se);return h(we),!0}catch(we){return l("restoreSession",we,{sessionId:se}),!1}}function Fe(se){return pt().listSessions({archivedOnly:!0,beforeId:se?.beforeId,pageSize:se?.pageSize??50})}async function Nt(){try{await pt().logout(),await oe(),await Ie()}catch(se){l("logout",se)}}function zt(se){const we=e.activeSessionId;we&&pt().compactSession(we,se).catch(Ce=>{l("compact",Ce,{sessionId:we})})}async function ts(se){const we=se??e.activeSessionId;if(we)try{const Ce=await pt().forkSession(we);h(Ce),await Yt(Ce.id)}catch(Ce){l("fork",Ce,{sessionId:we})}}async function Qn(se=1){const we=e.activeSessionId;if(!we)return null;const Ce=(()=>{const De=e.messagesBySession[we]??[];for(let ot=De.length-1;ot>=0;ot--){const at=De[ot];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Mt=>Mt.type==="text").map(Mt=>Mt.text).join(`
|
|
289
|
-
`)}return null})();try{return await pt().undoSession(we,se),await y(we),Ce}catch(De){return l("undo",De,{sessionId:we}),null}}function Fn(se){const we=e.activeSessionId;if(!we)return;const Ce=e.queuedBySession[we]??[];if(se<0||se>=Ce.length)return;const De=[...Ce];De.splice(se,1),e.queuedBySession={...e.queuedBySession,[we]:De}}function ft(se,we){const Ce=e.activeSessionId;if(!Ce)return;const De=e.queuedBySession[Ce]??[];if(se===we||se<0||se>=De.length||we<0||we>=De.length)return;const ot=[...De],[at]=ot.splice(se,1);at!==void 0&&(ot.splice(we,0,at),e.queuedBySession={...e.queuedBySession,[Ce]:ot})}async function ve(se){const we=e.activeSessionId;if(!we)return[];try{return(await pt().listDirectory(we,{path:se,includeGitStatus:!0})).items}catch{return[]}}async function Le(se){const we=e.activeSessionId;if(!we)return null;try{const De=await pt().readFile(we,{path:se});return{path:De.path,content:De.content,encoding:De.encoding,mime:De.mime,languageId:De.languageId,isBinary:De.isBinary,size:De.size,lineCount:De.lineCount}}catch{return null}}const Mn=10485760;function xs(se){const we=e.activeSessionId;return we?pt().getFileDownloadUrl(we,se):null}async function ia(se,we){const Ce=e.activeSessionId;if(!Ce)return!1;try{return await pt().openFile(Ce,{path:se,line:we}),!0}catch(De){return l("openFile",De,{sessionId:Ce}),!1}}async function xc(se){const we=e.activeSessionId;if(!we)return;const Ce=L.value.cwd||".";try{await pt().openInApp(we,se,Ce)}catch(De){l("openInApp",De,{sessionId:we})}}async function ai(se){const we=e.activeSessionId;if(!we)return!1;try{return await pt().revealFile(we,{path:se}),!0}catch(Ce){return l("revealFile",Ce,{sessionId:we}),!1}}async function Ks(se){if(/^(https?:|data:|blob:)/i.test(se))return se;const we=e.activeSessionId;if(!we)return se;let Ce=se;if(Ce.startsWith("/")){const De=e.sessions.find(ot=>ot.id===we)?.cwd;if(De&&(Ce===De||Ce.startsWith(De.endsWith("/")?De:`${De}/`))){if(Ce=Ce.slice(De.length).replace(/^\//,""),!Ce)return se}else return se}try{const ot=await pt().readFile(we,{path:Ce,length:Mn});return!ot.isBinary||ot.encoding!=="base64"||ot.truncated?se:`data:${ot.mime};base64,${ot.content}`}catch{return se}}async function Pi(se){const we=e.activeSessionId;if(!we)return[];try{return(await pt().searchFiles(we,{query:se,limit:20})).items.map(ot=>({path:ot.path,name:ot.name}))}catch{return[]}}return{loadFileDiff:ce,clearFileDiff:z,loadGitStatus:Q,checkAuth:oe,loadConfig:W,updateConfig:Z,listAllSessionsGlobal:j,load:Ie,loadWorkspaces:fe,loadMoreSessions:ke,loadAllSessions:Te,selectWorkspace:Ge,openWorkspace:lt,upsertWorkspacePreserveOrder:kt,applyWorkspaceEvent:bt,clearActiveSession:Et,openWorkspaceDraft:Rt,startSessionAndSendPrompt:qt,startSessionAndActivateSkill:dn,startSessionAndOpenSideChat:os,addWorkspaceByPath:Vt,browseFs:fn,getFsHome:Ds,writeSessionUrl:nt,fetchSessionIntoList:Dn,onSessionRoutePopState:is,bindSessionRoute:Kn,selectSession:Yt,submitPromptInternal:Ke,sendPrompt:Qe,steerPrompt:Dt,uploadImage:tn,enqueue:ln,unqueue:Fn,reorderQueue:ft,abortCurrentPrompt:Zt,respondApproval:Yn,respondQuestion:Wt,dismissQuestion:ys,pendingQuestionActions:El,pendingApprovalActions:Sf,cancelTask:Cs,setPlanMode:Co,togglePlanMode:Vs,setSwarmMode:co,toggleSwarmMode:uo,setGoalMode:Lt,toggleGoalMode:Wo,createGoal:zo,controlGoal:Ye,setPermission:et,dismissWarning:st,renameSession:Bt,renameWorkspace:Uo,deleteWorkspace:Oi,archiveSession:Ee,restoreSession:Ae,loadArchivedSessions:Fe,logout:Nt,compact:zt,forkSession:ts,undo:Qn,listDir:ve,readFileContent:Le,getFileDownloadUrl:xs,openWorkspaceFile:ia,openInApp:xc,revealWorkspaceFile:ai,resolveImageUrl:Ks,searchFiles:Pi,loadOlderMessages:je,refreshSessionSidecars:it}}const lle="kimiWeb.optimisticUserMessage";function ale(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function cle(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function ule(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 bv(e){return e.role==="user"&&e.metadata?.[lle]===!0}function dle(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function fle(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const ple=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function vC(e){let t="",n=0;for(const s of e.content)s.type==="text"?ple.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 hle(e,t){const n=vC(e),s=vC(t);return n.text===s.text&&n.media===s.media}function mle(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(bv(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(bv(o)&&fle(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(bv(o)&&hle(o,t))return s}return-1}function gle(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 vle(e,t,n){const s=cle(e);switch(ule(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"},[J3]: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"&&!dle(t.message)){const a=mle(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]=gle(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,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;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?Bn.global.t("warnings.errorLabel"):Bn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function yle(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function kle(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"||ta(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:yle(a.status)}]:[]})}}return[]}const ble=["queued","working","suspended","completed","failed"];function n4(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function _le(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function wle(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:n4(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=_le();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function Sle(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of ble)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function Cle(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:n4(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 Ii=j3(),Pl=rre(),qp=pre(),s4=$t.permission,o4=$t.activeWorkspace,i4=$t.thinking,r4=$t.planMode,l4=$t.swarmMode,a4=$t.goalMode,yC=40401,c4=$t.onboarded,xle=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;pc($t.codeFont);pc($t.theme);function Ale(){try{const e=es(s4);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Tle(e){try{ss(s4,e)}catch{}}function Mle(){try{const e=es(i4);if(e&&xle.test(e))return e}catch{}return"high"}function Ele(e){try{ss(i4,e)}catch{}}function _v(e){const t=es(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 Py(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ss(e,JSON.stringify(n))}catch{}}function u4(){Py(r4,be.planModeBySession)}function d4(){Py(l4,be.swarmModeBySession)}function f4(){Py(a4,be.goalModeBySession)}function Ile(){try{return es(o4)}catch{return null}}const p4=$t.hiddenWorkspaces;function $le(){try{const e=es(p4);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Nle(e){try{ss(p4,JSON.stringify(e))}catch{}}function Lle(e){try{ss(o4,e)}catch{}}function Ole(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 be=Os({...ale(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:Ale(),thinking:Mle(),planModeBySession:_v(r4),swarmModeBySession:_v(l4),goalModeBySession:_v(a4),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:T0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ile(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:$le(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),zh=Os({planMode:!1,swarmMode:!1,goalMode:!1});function h4(e){be.sessions=e}function Uh(e,t){be.sessions=be.sessions.map(n=>n.id===e?t(n):n)}function Ple(e){be.sessions=[e,...be.sessions.filter(t=>t.id!==e.id)]}function Rle(e){be.sessions=[...be.sessions,e]}function Dle(e){be.sessions=be.sessions.filter(t=>t.id!==e)}function m4(){const e=be.activeSessionId;e&&be.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(be.unreadBySession={...be.unreadBySession,[e]:!1},M0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(be.unreadBySession=T0(),m4())});function Ble(){if(oi===null||!oi.health().stale)return;Xi("ws: stale socket on focus, reconnecting",{activeSessionId:be.activeSessionId}),oi.reconnect();const e=be.activeSessionId;e&&I4.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(m4(),Ble())});function Ry(e){be.activeSessionId=e}function Fle(e){be.messagesBySession=e}function Hle(e,t){be.messagesBySession={...be.messagesBySession,[e]:t}}function g4(e,t){be.messagesBySession={...be.messagesBySession,[e]:t(be.messagesBySession[e]??[])}}function Wle(e){const{[e]:t,...n}=be.messagesBySession;be.messagesBySession=n}function v4(e){oi?.unsubscribe(e),cae(e),Vp.flush(),Dle(e),Wle(e),delete be.approvalsBySession[e],delete be.questionsBySession[e],delete be.tasksBySession[e],delete be.goalBySession[e],delete be.gitStatusBySession[e],delete be.lastSeqBySession[e],delete be.compactionBySession[e],delete be.messagesLoadingMoreBySession[e],delete be.messagesHasMoreBySession[e],delete be.messagesLoadMoreErrorBySession[e],delete Dy[e],M4.delete(e),qh.delete(e),delete be.queuedBySession[e],delete be.promptIdBySession[e],delete be.sendingBySession[e],delete be.planModeBySession[e],delete be.swarmModeBySession[e],delete be.goalModeBySession[e],u4(),d4(),f4()}const y4=J(null),k4=J([]),b4=J(!1),_4=J(!1);async function jh(e){let t;try{t=await pt().getSessionStatus(e)}catch{return}Uh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),be.swarmModeBySession={...be.swarmModeBySession,[e]:t.swarmMode},be.planModeBySession={...be.planModeBySession,[e]:t.planMode}}function w4(e,t){const n=t??be.activeSessionId;return n?Promise.resolve(pt().updateSession(n,e)).then(()=>jh(n)).catch(()=>{}):Promise.resolve()}const S4=$t.conversationToc;function zle(){try{const e=es(S4);return e===null?!0:e==="true"}catch{return!0}}function Ule(e){try{ss(S4,e?"true":"false")}catch{}}const C4=J(zle());function jle(e){C4.value=e,Ule(e)}function qle(e){try{return es(e)??""}catch{return""}}const x4=J(qle(c4)==="1");function Vle(e){x4.value=e;try{ss(c4,e?"1":"0")}catch{}}let oi=null,kC=0;function A4(){return kC+=1,`msg_opt_${Date.now().toString(36)}_${kC}`}const qh=new Set;function Kle(e,t,n){const s={sessions:be.sessions,activeSessionId:be.activeSessionId,messagesBySession:be.messagesBySession,approvalsBySession:be.approvalsBySession,planReviewByToolCallId:be.planReviewByToolCallId,questionsBySession:be.questionsBySession,tasksBySession:be.tasksBySession,goalBySession:be.goalBySession,lastSeqBySession:be.lastSeqBySession,compactionBySession:be.compactionBySession,config:be.config,warnings:be.warnings},o=vle(s,e,{sessionId:t,seq:n});h4(o.sessions),Ry(o.activeSessionId),Fle(o.messagesBySession),be.approvalsBySession=o.approvalsBySession,be.planReviewByToolCallId=o.planReviewByToolCallId,be.questionsBySession=o.questionsBySession,be.tasksBySession=o.tasksBySession,be.goalBySession=o.goalBySession,be.lastSeqBySession=o.lastSeqBySession,be.compactionBySession=o.compactionBySession,be.config=o.config??null,be.warnings=o.warnings,e.type==="configChanged"&&(be.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(In.loadModels(),In.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(be.swarmModeBySession={...be.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(be.planModeBySession={...be.planModeBySession,[e.sessionId]:e.planMode}))}function Gle(e,t){Kle(e,t.sessionId,t.seq);const n=Hs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Hs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Hs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Hs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Hs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;be.promptIdBySession[s]!==e.message.promptId&&(be.promptIdBySession={...be.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===be.activeSessionId&&Ii.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&fce(e.sessionId,e.status),e.type==="questionRequested"&&pce(e.sessionId,e.question)}const Vp=Oie(({appEvent:e,meta:t})=>Gle(e,t),({appEvent:e})=>Nie(e));function T4(){if(oi!==null||typeof WebSocket>"u")return;be.connection="connecting",oi=pt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ht.applyWorkspaceEvent(t);return}Vp({appEvent:t,meta:n})},onResync(t,n,s){Vp.flush(),s!==void 0&&(Dy[t]=s),I4.request(t)},onError(t,n,s){By({severity:"error",title:Bn.global.t("warnings.wsTitle"),message:n,details:[zn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){be.connected=t,be.connection=t?"connected":"disconnected"}})}const Dy={},M4=new Set;function Yle(e){return ol(e)&&e.code===yC?!0:typeof e=="object"&&e!==null&&e.code===yC}function zn(e,t){if(!(t==null||t===""))return{label:Bn.global.t(`warnings.details.${e}`),value:E4(t)}}function E4(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 Qle(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Xle(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Zle(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Jle(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function bC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function eae(e,t,n){const s=E3(t),o=ol(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[zn("operation",e),zn("sessionId",n??be.activeSessionId),zn("connection",be.connection),zn("timestamp",Jle(i??Date.now()))];return s?l.push(zn("duration",bC(r)),zn("request",`${t.method} ${t.path}`),zn("endpoint",t.url),zn("requestId",t.requestId),zn("phase",t.phase),zn("timeout",`${t.timeoutMs}ms`),zn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),zn("contentType",t.contentType),zn("responsePreview",t.bodyPreview),zn("cause",t.cause)):o?l.push(zn("duration",bC(r)),zn("code",t.code),zn("requestId",t.requestId),zn("message",t.message),zn("details",t.details)):l.push(zn("errorName",Qle(t)),zn("message",Xle(t)??E4(t)),zn("stack",Zle(t))),l.filter(a=>a!==void 0)}function tae(e,t,n={}){const s=E3(t),o=ol(t),i=n.title??(s?Bn.global.t("warnings.daemonNetworkTitle"):o?Bn.global.t("warnings.daemonApiTitle"):Bn.global.t("warnings.operationFailedTitle")),r=n.message??(s?Bn.global.t("warnings.daemonNetworkMessage"):o?t.message:Bn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:eae(e,t,n.sessionId)}}function By(e){be.warnings=[...be.warnings,e]}function Vh(e,t,n){By(tae(e,t,n))}const nae={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function sae(e){if(!ol(e))return;const t=nae[e.code];return t?Bn.global.t(t):void 0}async function oae(e){if(v4(e),be.activeSessionId!==e)return;const t=be.sessions[0];t?await ht.selectSession(t.id,{urlMode:"replace"}):(Ry(void 0),be.sessionLoading=!1,ht.writeSessionUrl(void 0,"replace"))}const _C=new Set;async function iae(e){if(!_C.has(e)){_C.add(e);try{const t=await pt().getSessionWarnings(e),n=Bn.global.t("warnings.noteLabel");for(const s of t)By(`${n}: ${s.message}`)}catch{}}}async function Fy(e){try{const n=await pt().getSessionSnapshot(e);Vp.flush(),Uh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),Hle(e,Eie(be.messagesBySession[e]??[],n.messages)),be.messagesHasMoreBySession={...be.messagesHasMoreBySession,[e]:n.hasMoreMessages},be.approvalsBySession={...be.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(be.planReviewByToolCallId={...be.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return be.questionsBySession={...be.questionsBySession,[e]:n.pendingQuestions},be.lastSeqBySession={...be.lastSeqBySession,[e]:n.asOfSeq},Dy[e]=n.epoch,T4(),oi&&(oi.seedSnapshot(e,n),oi.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),aae(e)),Hy.delete(e),iae(e),"ok"}catch(t){return Yle(t)?(await oae(e),"not-found"):(Vh("getSessionSnapshot",t,{title:Bn.global.t("warnings.sessionSnapshotTitle"),message:Bn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const I4=Iie(Fy);function rae(e){return Object.prototype.hasOwnProperty.call(be.messagesBySession,e)}const lae=4,Yi=[],Hy=new Set;function aae(e){const t=Yi.indexOf(e);for(t!==-1&&Yi.splice(t,1),Yi.unshift(e);Yi.length>lae;){let n=-1;for(let o=Yi.length-1;o>=0;o--)if(Yi[o]!==be.activeSessionId){n=o;break}if(n===-1)break;const[s]=Yi.splice(n,1);if(s===void 0)break;oi?.unsubscribe(s),Hy.add(s)}}function cae(e){const t=Yi.indexOf(e);t!==-1&&Yi.splice(t,1),Hy.delete(e)}async function uae(e){return Fy(e)}function Kh(e){const t=be.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Hs.sideChatTargetBySession.value[e]?.agentId,o=(be.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&be.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Wy(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return Bn.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)}m`:`${Math.round(r/365)}y`}catch{return e}}const dae=3e4,nd=J(0);let wv=null;function fae(){wv===null&&(wv=setInterval(()=>{nd.value=(nd.value+1)%Number.MAX_SAFE_INTEGER},dae),wv.unref?.())}function pae(e,t){const n=e.split(`
|
|
290
|
-
`),s=t.split(`
|
|
291
|
-
`),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 hae(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:pae(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 mae(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 gae(e){const t=be.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 vae(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=Bn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=Bn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??gae(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 yae=B(()=>{const e=be.sessions.find(n=>n.id===be.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:be.workspaceName,branch:t}}),kae=B(()=>(nd.value,be.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Wy(e.updatedAt,e.status),status:e.status,busy:Kh(e.id)})))),bae=B(()=>be.activeSessionId??""),_ae=B(()=>{const e=be.activeSessionId;if(e)return In.skillsBySession.value[e]??[];const t=Yh.value;return t?In.skillsByWorkspace.value[t]??[]:[]}),wae=B(()=>{const e=be.activeSessionId;return e?be.sendingBySession[e]??!1:!1}),Hs=Qre(be,{pushOperationFailure:Vh,nextOptimisticMsgId:A4,connectEventsIfNeeded:T4,getEventConn:()=>oi,models:()=>In.models.value}),yd=B(()=>{const e=be.activeSessionId;if(!e)return[];const t=Hs.sideChatTargetBySession.value[e]?.agentId;return(be.tasksBySession[e]??[]).filter(n=>n.id!==t)}),$4=gre(be,yd),Sae=B(()=>{const e=be.activeSessionId;if(!e)return[];const t=new Set(be.sideChatUserMessageIdsBySession[e]??[]),n=(be.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=be.approvalsBySession[e]??[];return t4(n,s,o=>pt().getFileUrl(o),Gh.value!=="idle",be.planReviewByToolCallId)}),Cae=B(()=>($4.taskClock.value,yd.value.map(vae))),N4=B(()=>wle(yd.value)),xae=B(()=>Cle(yd.value)),Ba=B(()=>{const e=be.activeSessionId;return e?be.goalBySession[e]??null:null}),Aae=B(()=>{const e=be.activeSessionId;return e?kle(be.messagesBySession[e]??[]):[]}),Tae=B(()=>{const e=be.activeSessionId;return e?be.compactionBySession[e]??null:null}),Mae=B(()=>be.connection),Eae=B(()=>be.loading),Iae=B(()=>be.sessionLoading),$ae=B(()=>{const e=be.activeSessionId;return e?be.messagesLoadingMoreBySession[e]??!1:!1}),Nae=B(()=>{const e=be.activeSessionId;return e?be.messagesHasMoreBySession[e]??!1:!1}),Lae=B(()=>{const e=be.activeSessionId;return e?be.messagesLoadMoreErrorBySession[e]??!1:!1}),Oae=B(()=>be.serverVersion),Pae=B(()=>be.dangerousBypassAuth);function Rae(){be.dangerousBypassAuth=!1}const Dae=B(()=>be.permission),Bae=B(()=>be.thinking),L4=B(()=>{const e=be.activeSessionId;return e?be.planModeBySession[e]??!1:zh.planMode}),Fae=B(()=>{const e=be.activeSessionId;return e?be.swarmModeBySession[e]??!1:zh.swarmMode}),Hae=B(()=>{const e=be.activeSessionId;return e?be.goalModeBySession[e]??!1:zh.goalMode}),Wae=B(()=>{const e=Sle(N4.value);return{plan:L4.value,goal:Ba.value&&Ba.value.status!=="complete"?{status:Ba.value.status,turnsUsed:Ba.value.turnsUsed,elapsedMs:Ba.value.wallClockMs}:null,swarm:e.total>0?e:null}}),zae=B(()=>{const e=be.activeSessionId;if(!e)return[];const t=pt();return(be.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)}))}))}),Uae=B(()=>be.warnings),jae=B(()=>{const e=be.activeSessionId;return e?(be.questionsBySession[e]??[]).map(mae):[]}),qae=B(()=>{const e=be.activeSessionId;return e?(be.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:hae(t),agentName:t.agentName})):[]}),Gh=B(()=>{const e=be.activeSessionId;return e?(be.approvalsBySession[e]??[]).length>0?"awaiting-approval":(be.questionsBySession[e]??[]).length>0?"awaiting-question":Kh(e)?"running":"idle":"idle"}),In=kre(be,{pushOperationFailure:Vh,refreshSessionStatus:jh,persistSessionProfile:w4,activity:Gh,inFlightPromptSessions:qh,saveThinkingToStorage:Ele,updateSession:Uh,updateSessionMessages:g4}),Kp=B(()=>{const e=be.activeSessionId;if(!e)return null;const t=be.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Vae=B(()=>{const e=be.activeSessionId;return e?be.gitStatusBySession[e]?.pullRequest??null:null}),Kae=B(()=>{const e=be.activeSessionId;if(!e)return[];const t=be.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Gae=B(()=>{const e=be.activeSessionId;if(!e)return null;const t=be.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),O4=B(()=>{const e=be.sessions.find(r=>r.id===be.activeSessionId),t=Kp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?In.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??be.defaultModel)??"—",o=In.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:be.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Kp.value!==null}}),Yae=B(()=>k4.value),Qae=B(()=>be.sessions.find(t=>t.id===be.activeSessionId)?.usage.totalCostUsd??0),Xae=B(()=>be.authReady),Zae=B(()=>be.defaultModel),Jae=B(()=>be.managedProviderStatus),ece=B(()=>be.config),tce=B(()=>{const e=be.activeSessionId;if(!e)return{};const t=be.gitStatusBySession[e];return t?{...t.entries}:{}});function gc(e){return be.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const zy=B(()=>Mie({workspaces:be.workspaces,sessions:be.sessions,hiddenWorkspaceRoots:be.hiddenWorkspaceRoots,activeRoot:be.sessions.find(e=>e.id===be.activeSessionId)?.cwd,activeBranch:Kp.value?.branch??null,sessionsHasMoreByWorkspace:be.sessionsHasMoreByWorkspace})),Gp=J($5()),vc=J(N5()==="manual"?"manual":"recent");Ve(()=>[zy.value.map(e=>e.id).join("\0"),be.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=j5(n,Gp.value);s!==null&&(Gp.value=s,$A(s))});const Zl=B(()=>{const e=zy.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Ole(t.root,be.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(vc.value==="recent"){const t=new Map;for(const n of be.sessions){if(n.parentSessionId)continue;const s=gc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return K5(e,t)}return q5(e,Gp.value)}),Yh=B(()=>{const e=be.activeWorkspaceId,t=Zl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ve(Yh,e=>{e&&(Object.prototype.hasOwnProperty.call(In.skillsByWorkspace.value,e)||In.loadSkillsForWorkspace(e))},{immediate:!0});const nce=B(()=>{const e=Yh.value;return e?Zl.value.find(t=>t.id===e)??null:null}),sce=B(()=>{nd.value;const e=new Set(Zl.value.map(n=>n.id)),t=new Map(Zl.value.map(n=>[n.id,n.name]));return be.sessions.filter(n=>!n.parentSessionId&&e.has(gc(n))).map(n=>{const s=gc(n);return{id:n.id,title:n.title,time:Wy(n.updatedAt,n.status),status:n.status,busy:Kh(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),oce=B(()=>{nd.value;const e=new Map;for(const t of be.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=gc(t),s={id:t.id,title:t.title,time:Wy(t.updatedAt,t.status),status:t.status,busy:Kh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Zl.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:be.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:be.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:be.sessionsInitialCountByWorkspace[t.id]??K1}))});function ice(e){Gp.value=e,$A(e),vc.value!=="manual"&&(vc.value="manual",NA("manual"))}function rce(e){vc.value!==e&&(vc.value=e,NA(e))}const P4=B(()=>{const e={};for(const[t,n]of Object.entries(be.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(be.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),lce=B(()=>{const e={};for(const[t,n]of Object.entries(be.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(be.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),ace=B(()=>{const e={};for(const[t,n]of Object.entries(be.unreadBySession))n&&(e[t]=!0);return e}),cce=B(()=>{const e={},t=P4.value;for(const n of be.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=gc(n);e[o]=(e[o]??0)+s}return e}),uce=B(()=>be.recentRoots),dce=B(()=>be.availableOpenInApps),ht=rle(be,{taskPoller:$4,sideChat:Hs,modelProvider:In,pushOperationFailure:Vh,activity:Gh,inFlightPromptSessions:qh,sessionsKnownEmpty:M4,setSessions:h4,updateSession:Uh,upsertSessionFront:Ple,appendSession:Rle,forgetSession:v4,setActiveSessionId:Ry,updateSessionMessages:g4,nextOptimisticMsgId:A4,getEventConn:()=>oi,syncSessionFromSnapshot:Fy,reopenSession:uae,hasLoadedMessages:rae,refreshSessionStatus:jh,persistSessionProfile:w4,mergedWorkspaces:zy,workspacesView:Zl,status:O4,workspaceIdForSession:gc,savePermissionToStorage:Tle,savePlanModeToStorage:u4,saveSwarmModeToStorage:d4,saveGoalModeToStorage:f4,draftModes:zh,saveUnread:M0,saveActiveWorkspaceToStorage:Lle,saveHiddenWorkspacesToStorage:Nle,goalErrorMessage:sae,resetFastMoon:Ii.resetFastMoon,initialized:_4,selectedDiffPath:y4,fileDiffLines:k4,fileDiffLoading:b4});function fce(e,t){if(qh.delete(e),be.sendingBySession={...be.sendingBySession,[e]:!1},be.promptIdBySession[e]!==void 0){const i={...be.promptIdBySession};delete i[e],be.promptIdBySession=i}e===be.activeSessionId?(Ii.resetFastMoon(),ht.loadGitStatus(e),jh(e)):t==="idle"&&(be.unreadBySession={...be.unreadBySession,[e]:!0},M0({[e]:!0})),Pl.maybeNotifyCompletion(e,{isActiveAndVisible:e===be.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:be.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{ht.selectSession(e)}}),t==="idle"&&qp.maybePlayCompletionSound();const n=be.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;be.queuedBySession={...be.queuedBySession,[e]:o},s!==void 0&&ht.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=be.queuedBySession[e]??[];be.queuedBySession={...be.queuedBySession,[e]:[s,...r]}}})}function pce(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Pl.maybeNotifyQuestion(e,{isActiveAndVisible:e===be.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:be.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{ht.selectSession(e)}}),qp.maybePlayQuestionSound()}function Uy(){return fae(),{workspace:yae,sessions:kae,activeSessionId:bae,workspacesView:Zl,workspaceSortMode:vc,visibleWorkspace:nce,activeWorkspaceId:Yh,sessionsForView:sce,workspaceGroups:oce,attentionBySession:P4,pendingBySession:lce,attentionByWorkspace:cce,unreadBySession:ace,recentRoots:uce,turns:Sae,tasks:Cae,activeAppTasks:yd,todos:Aae,goal:Ba,swarms:N4,swarmMembersByToolCallId:xae,activationBadges:Wae,compaction:Tae,status:O4,sessionCost:Qae,fileDiff:Yae,selectedDiffPath:y4,fileDiffLoading:b4,changes:Kae,gitInfo:Kp,gitDiffStats:Gae,activePullRequest:Vae,changesByPath:tce,pendingApprovals:qae,availableOpenInApps:dce,connection:Mae,loading:Eae,sessionLoading:Iae,loadingMoreMessages:$ae,hasMoreMessages:Nae,loadMoreMessagesError:Lae,serverVersion:Oae,dangerousBypassAuth:Pae,clearDangerousBypassAuth:Rae,initialized:_4,permission:Dae,thinking:Bae,planMode:L4,swarmMode:Fae,goalMode:Hae,queued:zae,warnings:Uae,questions:jae,activity:Gh,isSending:wae,fastMoon:Ii.fastMoon,models:In.models,starredModelIds:In.starredModelIds,providers:In.providers,uiFontSize:Ii.uiFontSize,setUiFontSize:Ii.setUiFontSize,conversationToc:C4,setConversationToc:jle,colorScheme:Ii.colorScheme,setColorScheme:Ii.setColorScheme,accent:Ii.accent,setAccent:Ii.setAccent,notifyOnComplete:Pl.notifyOnComplete,notifyOnQuestion:Pl.notifyOnQuestion,notifyPermission:Pl.notifyPermission,setNotifyOnComplete:Pl.setNotifyOnComplete,setNotifyOnQuestion:Pl.setNotifyOnQuestion,soundOnComplete:qp.soundOnComplete,setSoundOnComplete:qp.setSoundOnComplete,onboarded:x4,setOnboarded:Vle,load:ht.load,selectSession:ht.selectSession,clearActiveSession:ht.clearActiveSession,loadOlderMessages:ht.loadOlderMessages,loadWorkspaces:ht.loadWorkspaces,loadMoreSessions:ht.loadMoreSessions,loadAllSessions:ht.loadAllSessions,selectWorkspace:ht.selectWorkspace,openWorkspace:ht.openWorkspace,openWorkspaceDraft:ht.openWorkspaceDraft,startSessionAndSendPrompt:ht.startSessionAndSendPrompt,startSessionAndActivateSkill:ht.startSessionAndActivateSkill,startSessionAndOpenSideChat:ht.startSessionAndOpenSideChat,addWorkspaceByPath:ht.addWorkspaceByPath,browseFs:ht.browseFs,getFsHome:ht.getFsHome,sendPrompt:ht.sendPrompt,steerPrompt:ht.steerPrompt,sideChatVisible:Hs.sideChatVisible,sideChatSessionId:Hs.sideChatSessionId,sideChatTurns:Hs.sideChatTurns,sideChatRunning:Hs.sideChatRunning,sideChatSending:Hs.sideChatSending,openSideChat:Hs.openSideChat,closeSideChat:Hs.closeSideChat,sendSideChatPrompt:Hs.sendSideChatPrompt,uploadImage:ht.uploadImage,abortCurrentPrompt:ht.abortCurrentPrompt,respondApproval:ht.respondApproval,respondQuestion:ht.respondQuestion,dismissQuestion:ht.dismissQuestion,pendingQuestionActions:ht.pendingQuestionActions,pendingApprovalActions:ht.pendingApprovalActions,cancelTask:ht.cancelTask,setPermission:ht.setPermission,setThinking:In.setThinking,setPlanMode:ht.setPlanMode,togglePlanMode:ht.togglePlanMode,setSwarmMode:ht.setSwarmMode,toggleSwarmMode:ht.toggleSwarmMode,setGoalMode:ht.setGoalMode,toggleGoalMode:ht.toggleGoalMode,createGoal:ht.createGoal,controlGoal:ht.controlGoal,enqueue:ht.enqueue,dismissWarning:ht.dismissWarning,renameSession:ht.renameSession,renameWorkspace:ht.renameWorkspace,deleteWorkspace:ht.deleteWorkspace,reorderWorkspaces:ice,setWorkspaceSortMode:rce,archiveSession:ht.archiveSession,restoreSession:ht.restoreSession,loadArchivedSessions:ht.loadArchivedSessions,compact:ht.compact,forkSession:ht.forkSession,undo:ht.undo,unqueue:ht.unqueue,reorderQueue:ht.reorderQueue,searchFiles:ht.searchFiles,loadGitStatus:ht.loadGitStatus,loadFileDiff:ht.loadFileDiff,clearFileDiff:ht.clearFileDiff,listDir:ht.listDir,readFileContent:ht.readFileContent,getFileDownloadUrl:ht.getFileDownloadUrl,openWorkspaceFile:ht.openWorkspaceFile,openInApp:ht.openInApp,revealWorkspaceFile:ht.revealWorkspaceFile,resolveImageUrl:ht.resolveImageUrl,refreshOAuthProviderModels:In.refreshOAuthProviderModels,loadModels:In.loadModels,loadProviders:In.loadProviders,skills:_ae,activateSkill:In.activateSkill,setModel:In.setModel,toggleStarModel:In.toggleStarModel,addProvider:In.addProvider,deleteProvider:In.deleteProvider,refreshProvider:In.refreshProvider,refreshAllProviders:In.refreshAllProviders,authReady:Xae,defaultModel:Zae,managedProviderStatus:Jae,config:ece,updateConfig:ht.updateConfig,checkAuth:ht.checkAuth,startOAuthLogin:In.startOAuthLogin,pollOAuthLogin:In.pollOAuthLogin,cancelOAuthLogin:In.cancelOAuthLogin,logout:ht.logout}}const R4=qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=FA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&HA(o)}return(o,i)=>(w(),ye(to,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),hce=["aria-checked","aria-label","disabled"],mce=qe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),$("button",{class:Re(["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]=[x("span",{class:"ui-switch__thumb"},null,-1)])],10,hce))}}),Nr=dt(mce,[["__scopeId","data-v-dbe22dc4"]]),gce=["aria-label"],vce=["aria-selected","onClick"],yce={class:"body"},kce={class:"panel"},bce={class:"sec"},_ce={class:"sec-title"},wce={class:"row"},Sce={class:"rlabel"},Cce={class:"row"},xce={class:"rlabel"},Ace={class:"row"},Tce={class:"rlabel"},Mce={class:"num-field"},Ece=["value","aria-label"],Ice={class:"row"},$ce={class:"rlabel"},Nce={class:"row"},Lce={class:"rlabel"},Oce={class:"hint"},Pce={class:"sec"},Rce={class:"sec-title"},Dce={class:"row"},Bce={class:"rlabel"},Fce={key:0,class:"hint"},Hce={class:"row"},Wce={class:"rlabel"},zce={key:0,class:"hint"},Uce={class:"row"},jce={class:"rlabel"},qce={class:"panel"},Vce={class:"sec"},Kce={class:"sec-title"},Gce={class:"row"},Yce={class:"rlabel"},Qce={key:0,class:"rvalue"},Xce={class:"actions"},Zce={class:"panel"},Jce={class:"sec"},eue={class:"sec-head"},tue={class:"sec-title"},nue={key:0,class:"saving"},sue={class:"row"},oue={class:"rlabel"},iue={class:"hint"},rue={key:0,class:"select-wrap"},lue={key:0,value:"",disabled:""},aue=["label"],cue=["value"],uue={key:1,class:"rvalue mono"},due={class:"row"},fue={class:"rlabel"},pue={class:"hint"},hue={class:"row"},mue={class:"rlabel"},gue={class:"hint"},vue={class:"row"},yue={class:"rlabel"},kue={class:"hint"},bue={class:"row"},_ue={class:"rlabel"},wue={class:"hint"},Sue={key:1,class:"empty-config"},Cue={class:"panel"},xue={class:"sec"},Aue={class:"sec-title"},Tue={class:"row"},Mue={class:"rlabel"},Eue={class:"rvalue mono"},Iue={class:"row"},$ue={class:"rlabel"},Nue={class:"rvalue mono"},Lue={key:0,class:"row"},Oue={class:"rlabel"},Pue={class:"hint"},Rue={class:"hint"},Due={class:"row"},Bue={class:"rlabel"},Fue={key:0,class:"hint"},Hue={class:"panel"},Wue={class:"panel-head"},zue={class:"panel-title"},Uue={class:"panel-desc"},jue={class:"archive-toolbar"},que={class:"archive-search"},Vue=["placeholder"],Kue={value:"all"},Gue=["value"],Yue={key:0,class:"archive-empty"},Que={key:0,class:"archive-list"},Xue={class:"archive-workspace"},Zue={class:"path"},Jue={class:"count"},ede={class:"setting-card"},tde={class:"archive-meta"},nde={class:"archive-name"},sde={class:"archive-time"},ode={key:1,class:"archive-empty"},ide=100,rde=qe({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=J("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=F5(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=J(null);Ty(u);function d(ne){ne.key==="Escape"&&o("close")}bn(()=>document.addEventListener("keydown",d)),Tn(()=>document.removeEventListener("keydown",d));function f(){I3()}const h=B(()=>{const ne=new Map;for(const X of s.models??[])ne.set(X.id,{id:X.id,label:X.displayName??X.model??X.id,provider:X.provider});for(const[X,he]of Object.entries(s.config?.models??{})){if(ne.has(X))continue;const Oe=_(he);ne.set(X,{id:X,label:k(X,he,Oe),provider:Oe??X})}return Array.from(ne.values())}),p=B(()=>{const ne=new Map;for(const X of h.value){const he=ne.get(X.provider)??[];he.push(X),ne.set(X.provider,he)}for(const X of ne.values())X.sort((he,Oe)=>he.label.localeCompare(Oe.label));return Array.from(ne.entries()).toSorted(([X],[he])=>X.localeCompare(he)).map(([X,he])=>({provider:X,options:he}))}),m=B(()=>{const ne=s.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function _(ne){if(!ne||typeof ne!="object")return;const X=ne;return typeof X.provider=="string"?X.provider:void 0}function k(ne,X,he){if(!X||typeof X!="object")return ne;const Oe=X,je=typeof Oe.model=="string"?Oe.model:void 0,it=he??_(X);return je&&it?`${ne} (${it}/${je})`:je?`${ne} (${je})`:ne}function g(ne){return ne===!0}function v(ne){!ne||ne===s.config?.defaultModel||o("updateConfig",{defaultModel:ne})}function y(ne){ne!==m.value&&o("updateConfig",{defaultPermissionMode:ne})}function T(ne){const X=s.config?.[ne];o("updateConfig",{[ne]:!g(X)})}function P(){const ne=s.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function N(){o("updateConfig",{thinking:{enabled:!P()}})}function b(){const ne=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!ne})}function M(ne){i.value=ne}const I=Uy(),L=J([]),S=J(!1),E=J(!1),R=J(""),D=J("all"),F=J("archived-desc");async function U(){if(!(S.value||E.value)){S.value=!0;try{const ne=[];let X;for(;;){const he=await I.loadArchivedSessions({beforeId:X,pageSize:ide});if(ne.push(...he.items),!he.hasMore||he.items.length===0)break;const Oe=he.items.at(-1)?.id;if(Oe===void 0)break;X=Oe}L.value=ne,E.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{S.value=!1}}}Ve(i,ne=>{ne==="archived"&&!E.value&&U()});const G=B(()=>{const ne=new Set;for(const X of L.value)ne.add(X.cwd);return Array.from(ne).sort((X,he)=>X.localeCompare(he))}),Y=B(()=>{const ne=R.value.trim().toLowerCase();let X=L.value.filter(he=>he.archived===!0);return D.value!=="all"&&(X=X.filter(he=>he.cwd===D.value)),ne&&(X=X.filter(he=>he.title.toLowerCase().includes(ne))),X=X.slice(),F.value==="archived-desc"?X.sort((he,Oe)=>Oe.updatedAt.localeCompare(he.updatedAt)):F.value==="created-desc"?X.sort((he,Oe)=>Oe.createdAt.localeCompare(he.createdAt)):X.sort((he,Oe)=>he.title.localeCompare(Oe.title,"zh")),X}),q=B(()=>{const ne=new Map;for(const X of Y.value){const he=ne.get(X.cwd)??[];he.push(X),ne.set(X.cwd,he)}return Array.from(ne.entries()).map(([X,he])=>({cwd:X,items:he}))});async function ae(ne){await I.restoreSession(ne)&&(L.value=L.value.filter(he=>he.id!==ne))}function de(ne){const X=new Date(ne);if(Number.isNaN(X.getTime()))return ne;const he=Oe=>String(Oe).padStart(2,"0");return`${X.getFullYear()}-${he(X.getMonth()+1)}-${he(X.getDate())} ${he(X.getHours())}:${he(X.getMinutes())}`}return(ne,X)=>(w(),ye(pr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:X[18]||(X[18]=he=>o("close"))},{default:_e(()=>[x("div",{ref_key:"dialogRef",ref:u,class:"sd"},[x("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(w(),$(Pe,null,tt(r,he=>x("button",{key:he.id,type:"button",class:Re(["tab",{on:i.value===he.id}]),role:"tab","aria-selected":i.value===he.id,onClick:Oe=>M(he.id)},O(C(n)(he.labelKey)),11,vce)),64))],8,gce),x("div",yce,[Sn(x("section",kce,[x("section",bce,[x("h3",_ce,O(C(n)("settings.appearance")),1),x("div",wce,[x("span",Sce,O(C(n)("theme.colorSchemeLabel")),1),ie(to,{"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":X[0]||(X[0]=he=>o("setColorScheme",he))},null,8,["model-value","options"])]),x("div",Cce,[x("span",xce,O(C(n)("theme.accentLabel")),1),ie(to,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":X[1]||(X[1]=he=>o("setAccent",he))},null,8,["model-value","options"])]),x("div",Ace,[x("span",Tce,O(C(n)("settings.uiFontSize")),1),x("label",Mce,[x("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:X[2]||(X[2]=he=>o("setUiFontSize",Number(he.target.value)))},null,40,Ece),X[19]||(X[19]=x("span",{class:"num-unit"},"px",-1))])]),x("div",Ice,[x("span",$ce,O(C(n)("sidebar.language")),1),ie(R4)]),x("div",Nce,[x("span",Lce,[Ue(O(C(n)("settings.conversationToc"))+" ",1),x("span",Oce,O(C(n)("settings.conversationTocHint")),1)]),ie(Nr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":X[3]||(X[3]=he=>o("setConversationToc",he))},null,8,["model-value","label"])])]),x("section",Pce,[x("h3",Rce,O(C(n)("settings.notifications")),1),x("div",Dce,[x("span",Bce,[Ue(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),$("span",Fce,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(Nr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":X[4]||(X[4]=he=>o("setNotify",he))},null,8,["model-value","disabled","label"])]),x("div",Hce,[x("span",Wce,[Ue(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),$("span",zce,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(Nr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":X[5]||(X[5]=he=>o("setNotifyQuestion",he))},null,8,["model-value","disabled","label"])]),x("div",Uce,[x("span",jce,O(C(n)("settings.soundOnComplete")),1),ie(Nr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":X[6]||(X[6]=he=>o("setSound",he))},null,8,["model-value","label"])])])],512),[[$o,i.value==="general"]]),Sn(x("section",qce,[x("section",Vce,[x("h3",Kce,O(C(n)("settings.account")),1),x("div",Gce,[x("span",Yce,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(jt,{text:e.accountModel},{default:_e(()=>[e.authReady&&e.accountModel?(w(),$("span",Qce,O(e.accountModel),1)):re("",!0)]),_:1},8,["text"])]),x("div",Xce,[ie(Pt,{variant:"secondary",size:"sm",onClick:X[7]||(X[7]=he=>{o("openOnboarding"),o("close")})},{default:_e(()=>[Ue(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),ye(Pt,{key:0,variant:"danger-soft",size:"sm",onClick:X[8]||(X[8]=he=>o("logout"))},{default:_e(()=>[Ue(O(C(n)("sidebar.signOut")),1)]),_:1})):(w(),ye(Pt,{key:1,variant:"primary",size:"sm",onClick:X[9]||(X[9]=he=>o("login"))},{default:_e(()=>[Ue(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[$o,i.value==="account"]]),Sn(x("section",Zce,[x("section",Jce,[x("div",eue,[x("h3",tue,O(C(n)("settings.agentDefaults")),1),e.configSaving?(w(),$("span",nue,O(C(n)("settings.saving")),1)):re("",!0)]),e.config?(w(),$(Pe,{key:0},[x("div",sue,[x("span",oue,[Ue(O(C(n)("settings.defaultModel"))+" ",1),x("span",iue,O(C(n)("settings.defaultModelHint")),1)]),p.value.length>0?(w(),$("div",rue,[ie(q1,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:_e(()=>[e.config.defaultModel?re("",!0):(w(),$("option",lue,O(C(n)("settings.noDefaultModel")),1)),(w(!0),$(Pe,null,tt(p.value,he=>(w(),$("optgroup",{key:he.provider,label:he.provider},[(w(!0),$(Pe,null,tt(he.options,Oe=>(w(),$("option",{key:Oe.id,value:Oe.id},O(Oe.label),9,cue))),128))],8,aue))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),$("span",uue,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),x("div",due,[x("span",fue,[Ue(O(C(n)("settings.defaultPermission"))+" ",1),x("span",pue,O(C(n)("settings.defaultPermissionHint")),1)]),ie(to,{"model-value":m.value,options:a.map(he=>({value:he,label:C(n)(c[he])})),"onUpdate:modelValue":X[10]||(X[10]=he=>y(he))},null,8,["model-value","options"])]),x("div",hue,[x("span",mue,[Ue(O(C(n)("settings.defaultThinking"))+" ",1),x("span",gue,O(C(n)("settings.defaultThinkingHint")),1)]),ie(Nr,{"model-value":P(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":X[11]||(X[11]=he=>N())},null,8,["model-value","disabled","label"])]),x("div",vue,[x("span",yue,[Ue(O(C(n)("settings.defaultPlanMode"))+" ",1),x("span",kue,O(C(n)("settings.defaultPlanModeHint")),1)]),ie(Nr,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":X[12]||(X[12]=he=>T("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),x("div",bue,[x("span",_ue,[Ue(O(C(n)("settings.mergeSkills"))+" ",1),x("span",wue,O(C(n)("settings.mergeSkillsHint")),1)]),ie(Nr,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":X[13]||(X[13]=he=>T("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),$("div",Sue,O(C(n)("settings.configUnavailable")),1))])],512),[[$o,i.value==="agent"]]),Sn(x("section",Cue,[x("section",xue,[x("h3",Aue,O(C(n)("settings.advanced")),1),x("div",Tue,[x("span",Mue,O(C(n)("sidebar.daemon")),1),x("span",Eue,O(C(l)),1)]),x("div",Iue,[x("span",$ue,O(C(n)("settings.serverVersion")),1),x("span",Nue,O(e.serverVersion||"-"),1)]),e.config?(w(),$("div",Lue,[x("span",Oue,[Ue(O(C(n)("settings.telemetry"))+" ",1),x("span",Pue,O(C(n)("settings.telemetryHint")),1),x("span",Rue,O(C(n)("settings.telemetryRestartHint")),1)]),ie(Nr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":X[14]||(X[14]=he=>b())},null,8,["model-value","disabled","label"])])):re("",!0),x("div",Due,[x("span",Bue,[Ue(O(C(n)("settings.exportLog"))+" ",1),C(bi)()?re("",!0):(w(),$("span",Fue,O(C(n)("settings.logHint")),1))]),ie(Pt,{variant:"secondary",size:"sm",onClick:f},{default:_e(()=>[Ue(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[$o,i.value==="advanced"]]),Sn(x("section",Hue,[x("div",Wue,[X[20]||(X[20]=x("div",{class:"panel-kicker"},"Archived sessions",-1)),x("h4",zue,O(C(n)("settings.archivedTitle")),1),x("p",Uue,O(C(n)("settings.archivedDesc")),1)]),x("div",jue,[x("label",que,[X[21]||(X[21]=x("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[x("circle",{cx:"11",cy:"11",r:"7"}),x("path",{d:"m21 21-4.3-4.3"})],-1)),Sn(x("input",{"onUpdate:modelValue":X[15]||(X[15]=he=>R.value=he),placeholder:C(n)("settings.archivedSearch")},null,8,Vue),[[ao,R.value]])]),ie(q1,{"model-value":D.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":X[16]||(X[16]=he=>D.value=he)},{default:_e(()=>[x("option",Kue,O(C(n)("settings.archivedAllWorkspaces")),1),(w(!0),$(Pe,null,tt(G.value,he=>(w(),$("option",{key:he,value:he},O(he),9,Gue))),128))]),_:1},8,["model-value","aria-label"]),ie(to,{size:"sm","model-value":F.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":X[17]||(X[17]=he=>F.value=he)},null,8,["model-value","options"])]),S.value?(w(),$("div",Yue,O(C(n)("settings.archivedLoadingAll")),1)):(w(),$(Pe,{key:1},[q.value.length>0?(w(),$("div",Que,[(w(!0),$(Pe,null,tt(q.value,he=>(w(),$("section",{key:he.cwd,class:"archive-card"},[x("div",Xue,[X[22]||(X[22]=x("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[x("path",{d:"M3 7h6l2 2h10v9H3z"}),x("path",{d:"M3 7V5h6l2 2"})],-1)),x("span",Zue,O(he.cwd),1),x("span",Jue,O(C(n)("settings.archivedSessionsCount",{count:he.items.length})),1)]),x("div",ede,[(w(!0),$(Pe,null,tt(he.items,Oe=>(w(),$("div",{key:Oe.id,class:"archive-row"},[x("div",tde,[x("div",nde,O(Oe.title),1),x("div",sde,O(C(n)("settings.archivedAt",{time:de(Oe.updatedAt)})),1)]),ie(Pt,{variant:"secondary",size:"sm",onClick:je=>ae(Oe.id)},{default:_e(()=>[Ue(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(w(),$("div",ode,O(L.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[$o,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),lde=dt(rde,[["__scopeId","data-v-47260198"]]),ade={class:"aw"},cde={class:"crumbbar"},ude={class:"crumbs"},dde={key:0,class:"crumb-sep"},fde=["onClick"],pde={key:0,class:"filterbar"},hde=["placeholder"],mde={class:"folder-list"},gde={key:0,class:"fl-loading"},vde=["onClick"],yde={class:"folder-name search-rel"},kde={key:0,class:"git-branch"},bde={key:0,class:"fl-empty"},_de={key:1,class:"fl-loading"},wde=["onClick"],Sde={class:"folder-name"},Cde={key:0,class:"git-branch"},xde={key:0,class:"fl-empty"},Ade={class:"paste-row"},Tde={class:"paste-input-wrap"},Mde={key:1,class:"add-error",role:"alert"},Ede={class:"actions"},Ide={class:"footer-hint"},$de=600,Nde=6,wC=150,Lde=qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=J(!0),r=J(!1),l=J(!1),a=J(""),c=J(null),u=J([]),d=J(""),f=J(!1),h=J([]),p=B(()=>d.value.trim().length>0);let m=0,_=null;function k(E,R){const D=E.toLowerCase(),F=R.toLowerCase();let U=0;for(let G=0;G<F.length&&U<D.length;G++)F[G]===D[U]&&U++;return U===D.length}async function g(E){const R=a.value,D=E.trim();if(!R||D===""){h.value=[],f.value=!1;return}const F=++m;f.value=!0;const U=[],G=[{path:R,depth:0}];let Y=0;for(;G.length>0&&Y<$de&&U.length<wC;){if(F!==m)return;const q=G.shift();Y++;let ae;try{ae=await s.browseFs(q.path)}catch{continue}if(F!==m)return;for(const de of ae.entries){if(!de.isDir)continue;const ne=de.path.startsWith(R)?de.path.slice(R.length).replace(/^\/+/,""):de.path;if(k(D,ne||de.name)&&(U.push({path:de.path,name:de.name,rel:ne||de.name,isGitRepo:de.isGitRepo,branch:de.branch}),U.length>=wC))break;q.depth+1<Nde&&G.push({path:de.path,depth:q.depth+1})}F===m&&(h.value=[...U])}F===m&&(f.value=!1)}Ve(d,E=>{if(_&&clearTimeout(_),E.trim()===""){m++,h.value=[],f.value=!1;return}_=setTimeout(()=>void g(E),220)});const v=J(!1),y=J(""),T=B(()=>y.value.trim()),P=B(()=>{const E=a.value;if(!E)return[];const R=E.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let F="";for(const U of R)F+=`/${U}`,D.push({label:U,path:F});return D}),N=B(()=>a.value.length>0);async function b(E){r.value=!0;try{const R=await s.browseFs(E);if(!R.path){l.value=!0;return}a.value=R.path,c.value=R.parent,u.value=R.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function M(E){E.isDir&&b(E.path)}function I(){c.value&&b(c.value)}function L(){N.value&&o("add",a.value)}function S(){T.value.length!==0&&o("add",T.value)}return bn(async()=>{r.value=!0;try{if(s.defaultPath&&(await b(s.defaultPath),!l.value))return;const E=await s.getFsHome();E.home?await b(E.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),Tn(()=>{_&&clearTimeout(_)}),(E,R)=>(w(),ye(pr,{open:i.value,"onUpdate:open":R[5]||(R[5]=D=>i.value=D),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:R[6]||(R[6]=D=>o("close"))},{default:_e(()=>[x("div",ade,[l.value?re("",!0):(w(),$(Pe,{key:0},[x("div",cde,[ie(Cn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:I},{default:_e(()=>[ie(Xe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),x("div",ude,[(w(!0),$(Pe,null,tt(P.value,(D,F)=>(w(),$(Pe,{key:D.path},[F>1?(w(),$("span",dde,"/")):re("",!0),x("button",{class:Re(["crumb",{last:F===P.value.length-1}]),onClick:U=>b(D.path)},O(D.label),11,fde)],64))),128))])]),r.value?re("",!0):(w(),$("div",pde,[ie(Xe,{class:"filter-icon",name:"search",size:"md"}),Sn(x("input",{"onUpdate:modelValue":R[0]||(R[0]=D=>d.value=D),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[1]||(R[1]=yt(()=>{},["stop"]))},null,40,hde),[[ao,d.value]]),f.value?(w(),ye(ri,{key:0,size:"sm"})):re("",!0)])),x("div",mde,[r.value?(w(),$("div",gde,O(C(n)("workspace.browsing")),1)):p.value?(w(),$(Pe,{key:1},[(w(!0),$(Pe,null,tt(h.value,D=>(w(),$("button",{key:D.path,class:"folder-row",onClick:F=>b(D.path)},[ie(Xe,{class:"dir-icon",name:"folder-closed",size:"sm"}),x("span",yde,O(D.rel),1),D.isGitRepo?(w(),ye(Ls,{key:0,variant:"info",size:"sm"},{default:_e(()=>[Ue(O(C(n)("workspace.gitTag")),1),D.branch?(w(),$("span",kde,O(D.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,vde))),128)),!f.value&&h.value.length===0?(w(),$("div",bde,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),$("div",_de,O(C(n)("workspace.searching")),1)):re("",!0)],64)):(w(),$(Pe,{key:2},[(w(!0),$(Pe,null,tt(u.value,D=>(w(),$("button",{key:D.path,class:"folder-row",onClick:F=>M(D)},[ie(Xe,{class:"dir-icon",name:"folder-closed",size:"sm"}),x("span",Sde,O(D.name),1),D.isGitRepo?(w(),ye(Ls,{key:0,variant:"info",size:"sm"},{default:_e(()=>[Ue(O(C(n)("workspace.gitTag")),1),D.branch?(w(),$("span",Cde,O(D.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,wde))),128)),u.value.length===0?(w(),$("div",xde,O(C(n)("workspace.noSubfolders")),1)):re("",!0)],64))])],64)),x("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(w(),ye(Pt,{key:0,variant:"ghost",size:"sm",onClick:R[2]||(R[2]=D=>v.value=!0)},{default:_e(()=>[Ue(O(C(n)("workspace.pasteToggle")),1)]),_:1})):(w(),ye(cu,{key:1,label:C(n)("workspace.pathLabel")},{default:_e(()=>[x("div",Ade,[x("div",Tde,[ie(Vl,{modelValue:y.value,"onUpdate:modelValue":R[3]||(R[3]=D=>y.value=D),placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:mi(yt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),ie(Cn,{disabled:T.value.length===0,label:C(n)("workspace.add"),onClick:S},{default:_e(()=>[ie(Xe,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(w(),$("div",Mde,O(e.error),1)):re("",!0),x("div",Ede,[ie(jt,{text:a.value},{default:_e(()=>[l.value?re("",!0):(w(),ye(Pt,{key:0,variant:"primary",disabled:!N.value,onClick:L},{default:_e(()=>[Ue(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Pt,{variant:"secondary",onClick:R[4]||(R[4]=D=>o("close"))},{default:_e(()=>[Ue(O(C(n)("workspace.cancel")),1)]),_:1})]),x("div",Ide,O(C(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),Ode=dt(Lde,[["__scopeId","data-v-ad529757"]]),Pde={key:0,class:"confirm-dialog__message"},Rde=qe({__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=t,{t:s}=Tt();function o(){n("update:open",!1),n("cancel")}return(i,r)=>(w(),ye(pr,{open:e.open,title:e.title,height:"auto","onUpdate:open":r[1]||(r[1]=l=>n("update:open",l)),onClose:o},{foot:_e(()=>[ie(Pt,{variant:"secondary",disabled:e.loading,onClick:o},{default:_e(()=>[Ue(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Pt,{variant:e.variant,loading:e.loading,onClick:r[0]||(r[0]=l=>n("confirm"))},{default:_e(()=>[Ue(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:_e(()=>[e.message?(w(),$("p",Pde,O(e.message),1)):re("",!0)]),_:1},8,["open","title"]))}}),Dde=dt(Rde,[["__scopeId","data-v-a9df9b9a"]]),Bde=qe({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=al();return(s,o)=>(w(),ye(Dde,{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"]))}}),Fde={class:"rows"},Hde={class:"row"},Wde={class:"row"},zde={class:"row"},Ude={class:"row"},jde={class:"row"},qde={class:"row"},Vde={class:"ctx-text"},Kde={key:0,class:"bar"},Gde={class:"row"},Yde=qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=J(!0),r=B(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=B(()=>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=B(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=B(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=B(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=B(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(w(),ye(pr,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:_e(()=>[x("dl",Fde,[x("div",Hde,[x("dt",null,O(C(n)("status.statusModel")),1),x("dd",null,O(e.status.model),1)]),x("div",Wde,[x("dt",null,O(C(n)("status.statusThinking")),1),x("dd",null,O(e.thinking),1)]),x("div",zde,[x("dt",null,O(C(n)("status.statusPermission")),1),x("dd",{style:Xt({color:c.value})},O(a(e.status.permission)),5)]),x("div",Ude,[x("dt",null,O(C(n)("status.statusPlanMode")),1),x("dd",{class:Re({"plan-on":e.planMode})},O(u.value),3)]),x("div",jde,[x("dt",null,O(C(n)("status.statusSwarmMode")),1),x("dd",{class:Re({"swarm-on":e.swarmMode})},O(d.value),3)]),x("div",qde,[x("dt",null,O(C(n)("status.statusContext")),1),x("dd",null,[x("span",Vde,O(l.value),1),e.status.ctxMax>0?(w(),$("span",Kde,[x("i",{style:Xt({width:r.value+"%"})},null,4)])):re("",!0)])]),x("div",Gde,[x("dt",null,O(C(n)("status.statusCost")),1),x("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Qde=dt(Yde,[["__scopeId","data-v-59dd31f3"]]),Xde={class:"ui-toast__icon","aria-hidden":"true"},Zde={class:"ui-toast__body"},Jde={class:"ui-toast__title"},efe={key:0,class:"ui-toast__msg"},tfe=qe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),$("div",{class:Re(["ui-toast",`ui-toast--${e.variant}`])},[x("span",Xde,[Ln(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),ye(Xe,{key:0,name:"check"})):e.variant==="danger"?(w(),ye(Xe,{key:1,name:"close"})):e.variant==="warning"?(w(),ye(Xe,{key:2,name:"alert-triangle"})):(w(),ye(Xe,{key:3,name:"info"}))],!0)]),x("div",Zde,[x("div",Jde,O(e.title),1),e.message?(w(),$("div",efe,O(e.message),1)):re("",!0),Ln(t.$slots,"default",{},void 0,!0)]),ie(Cn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:_e(()=>[ie(Xe,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),nfe=dt(tfe,[["__scopeId","data-v-adc6f346"]]),sfe={key:0,class:"actions"},ofe=["onClick"],ife=["onClick"],rfe={key:1,class:"details"},lfe=qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt();function i(b){return typeof b=="object"&&b!==null}function r(b){return i(b)?b.title:b}function l(b){return i(b)?b.message??"":""}function a(b){return i(b)?b.details:void 0}function c(b){return i(b)?b.severity==="error":b.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(b)}function u(b){return i(b)?`notice:${b.severity}:${b.title}:${b.message??""}:${JSON.stringify(b.details??[])}`:`text:${b}`}function d(b){if(!i(b))return b;const M=[b.title];b.message&&M.push(b.message);const I=b.details??[];if(I.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const L of I)M.push(`${L.label}: ${L.value}`)}return M.join(`
|
|
292
|
-
`)}let f=1;const h=J([]),p=new Map,m=new Map;function _(b){const M=c(b)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function k(b,M){const I=p.get(b)??{handle:null,deadline:0,remaining:0};I.handle=setTimeout(()=>N(b),M),I.deadline=Date.now()+M,p.set(b,I)}function g(b){const M=p.get(b);M&&M.handle!==null&&clearTimeout(M.handle),p.delete(b)}function v(b){const M=p.get(b);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(b){if(h.value.find(L=>L.id===b)?.detailsOpen)return;const I=p.get(b);!I||I.handle!==null||k(b,I.remaining)}function T(b){b.detailsOpen=!b.detailsOpen,b.detailsOpen?v(b.id):y(b.id)}async function P(b){if(!await js(d(b.warning)))return;b.copied=!0;const I=m.get(b.id);I&&clearTimeout(I),m.set(b.id,setTimeout(()=>{b.copied=!1,m.delete(b.id)},1400))}function N(b){g(b);const M=m.get(b);M&&clearTimeout(M),m.delete(b);const I=h.value.findIndex(L=>L.id===b);I!==-1&&(h.value=h.value.filter(L=>L.id!==b),s("dismiss",I))}return Ve(()=>n.warnings,b=>{const M=[...h.value];h.value=b.map(I=>{const L=u(I),S=M.findIndex(D=>D.key===L),E=S===-1?void 0:M.splice(S,1)[0];if(E)return E.warning=I,E;const R={id:f++,key:L,warning:I,detailsOpen:!1,copied:!1};return k(R.id,_(I)),R});for(const I of M){g(I.id);const L=m.get(I.id);L&&clearTimeout(L),m.delete(I.id)}},{immediate:!0,flush:"post"}),Tn(()=>{p.forEach(b=>{b.handle!==null&&clearTimeout(b.handle)}),p.clear(),m.forEach(b=>clearTimeout(b)),m.clear()}),(b,M)=>(w(),ye(u6,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:_e(()=>[(w(!0),$(Pe,null,tt(h.value,I=>(w(),ye(nfe,{key:I.id,variant:c(I.warning)?"danger":"warning",title:r(I.warning),message:l(I.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:L=>N(I.id),onPointerenter:L=>v(I.id),onPointerleave:L=>y(I.id)},{default:_e(()=>[a(I.warning)?.length?(w(),$("div",sfe,[x("button",{class:"link",type:"button",onClick:L=>T(I)},O(I.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,ofe),x("button",{class:"link",type:"button",onClick:L=>P(I)},O(I.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,ife)])):re("",!0),I.detailsOpen&&a(I.warning)?.length?(w(),$("dl",rfe,[(w(!0),$(Pe,null,tt(a(I.warning),L=>(w(),$("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[x("dt",null,O(L.label),1),x("dd",null,O(L.value),1)]))),128))])):re("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),afe=dt(lfe,[["__scopeId","data-v-92efeff8"]]),cfe={class:"topbar"},ufe={class:"wsq"},dfe=["aria-label"],ffe={class:"tb-path"},pfe={class:"ws"},hfe={class:"se"},mfe={class:"tb-sub"},gfe=qe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=B(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=B(()=>s.workspace?.name??n("workspace.noWorkspace")),l=B(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),$("div",cfe,[x("span",ufe,O(i.value),1),x("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[x("span",ffe,[x("span",pfe,O(r.value),1),e.sessionTitle?(w(),$(Pe,{key:0},[c[2]||(c[2]=x("span",{class:"sl"},"/",-1)),x("span",hfe,O(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=x("span",{class:"cv"},"⌄",-1))]),x("span",mfe,[x("span",{class:Re(["rd",{on:e.running}])},null,2),x("span",null,O(l.value),1),e.branch?(w(),$(Pe,{key:0},[Ue(" · "+O(e.branch),1)],64)):re("",!0),e.sessionCount>0?(w(),$(Pe,{key:1},[Ue(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,dfe),ie(Cn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:_e(()=>[ie(Xe,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),vfe=dt(gfe,[["__scopeId","data-v-59a11935"]]),yfe={key:0,class:"sheet-root"},kfe=["aria-label"],bfe=["aria-label"],_fe={key:0,class:"sheet-head"},wfe={class:"sheet-title"},Sfe={class:"sheet-body"},Cfe=qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Tn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),ye(Zr,{name:"sheet"},{default:_e(()=>[e.modelValue?(w(),$("div",yfe,[x("div",{class:"sheet-scrim",onClick:i}),x("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[x("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,bfe),e.title?(w(),$("div",_fe,[x("span",wfe,O(e.title),1)])):re("",!0),x("div",Sfe,[Ln(l.$slots,"default",{},void 0,!0)])],8,kfe)])):re("",!0)]),_:3}))}}),D4=dt(Cfe,[["__scopeId","data-v-4441dd70"]]),xfe={class:"mlist"},Afe={key:0,class:"mempty"},Tfe=["onClick"],Mfe={class:"mgh-main"},Efe={class:"mgh-name"},Ife={class:"mgh-path"},$fe={key:2,class:"att"},Nfe={key:0,class:"mempty small"},Lfe=["onClick"],Ofe={class:"m"},Pfe={class:"s"},Rfe={key:0,class:"att"},Dfe=["disabled","onClick"],Bfe=["onClick"],Ffe=qe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=al(),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=J(new Set);function f(S){return d.value.has(S)}function h(S){const E=new Set(d.value);E.has(S)?E.delete(S):E.add(S),d.value=E,y.value=null,b.value=null}const p=J(new Set);function m(S){return p.value.has(S)}function _(S){const E=new Set(p.value);E.has(S)?E.delete(S):E.add(S),p.value=E}function k(S){if(m(S.workspace.id))return S.sessions;const E=S.sessions.slice(0,S.initialCount);if(o.activeId&&!E.some(R=>R.id===o.activeId)){const R=S.sessions.find(D=>D.id===o.activeId);if(R)return[...E,R]}return E}function g(S){if(!p.value.has(S)){const E=new Set(p.value);E.add(S),p.value=E}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=J(null);function T(S){y.value=y.value===S?null:S,b.value=null}function P(S){y.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();R&&i("rename",S.id,R)}async function N(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const b=J(null);function M(S){b.value=b.value===S?null:S,y.value=null}function I(S){js(S.root),b.value=null}async function L(S){b.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,E)=>(w(),ye(D4,{"model-value":e.modelValue,"onUpdate:modelValue":E[2]||(E[2]=R=>i("update:modelValue",R))},{default:_e(()=>[x("button",{type:"button",class:"newrow",onClick:c},[ie(Xe,{name:"message",size:"sm"}),Ue(" "+O(C(n)("sidebar.newChat")),1)]),x("button",{type:"button",class:"newrow secondary",onClick:u},[ie(Xe,{name:"folder",size:"sm"}),Ue(" "+O(C(n)("sidebar.newWorkspace")),1)]),x("div",xfe,[e.groups.length===0?(w(),$("div",Afe,O(C(n)("workspace.noWorkspace")),1)):re("",!0),(w(!0),$(Pe,null,tt(e.groups,R=>(w(),$("div",{key:R.workspace.id,class:"mgroup"},[x("div",{class:Re(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:D=>h(R.workspace.id)},[f(R.workspace.id)?(w(),ye(Xe,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),ye(Xe,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),x("div",Mfe,[x("span",Efe,O(R.workspace.name),1),ie(jt,{text:R.workspace.root},{default:_e(()=>[x("span",Ife,O(R.workspace.branch||R.workspace.shortPath),1)]),_:2},1032,["text"])]),f(R.workspace.id)&&v(R.workspace.id)>0?(w(),$("span",$fe,O(v(R.workspace.id)),1)):re("",!0),ie(Cn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:yt(D=>M(R.workspace.id),["stop"])},{default:_e(()=>[ie(Xe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Cn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:yt(D=>a(R.workspace.id),["stop"])},{default:_e(()=>[ie(Xe,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),b.value===R.workspace.id?(w(),ye(zl,{key:3,class:"kmenu wsmenu",onClick:E[0]||(E[0]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{size:"lg",onClick:D=>I(R.workspace)},{default:_e(()=>[Ue(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(yn,{size:"lg",danger:"",onClick:D=>L(R.workspace)},{default:_e(()=>[Ue(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Tfe),Sn(x("div",null,[R.sessions.length===0?(w(),$("div",Nfe,O(C(n)("sidebar.noSessions")),1)):re("",!0),(w(!0),$(Pe,null,tt(k(R),D=>(w(),$("div",{key:D.id,class:Re(["srow",{cur:D.id===e.activeId}]),onClick:F=>l(D.id)},[x("div",Ofe,[x("div",{class:Re(["t",{run:D.busy,aborted:D.status==="aborted"}])},O(D.title),3),x("div",Pfe,O(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(w(),$("span",Rfe,O(e.attentionBySession[D.id]),1)):re("",!0),ie(Cn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:yt(F=>T(D.id),["stop"])},{default:_e(()=>[ie(Xe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(w(),ye(zl,{key:1,class:"kmenu",onClick:E[1]||(E[1]=yt(()=>{},["stop"]))},{default:_e(()=>[ie(yn,{size:"lg",onClick:F=>P(D)},{default:_e(()=>[Ue(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(yn,{size:"lg",danger:"",onClick:F=>N(D.id)},{default:_e(()=>[Ue(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Lfe))),128)),R.hasMore||R.loadingMore?(w(),$("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:yt(D=>g(R.workspace.id),["stop"])},O(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,Dfe)):re("",!0),R.sessions.length>R.initialCount?(w(),$("button",{key:2,type:"button",class:"mshow-more",onClick:yt(D=>_(R.workspace.id),["stop"])},O(m(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,Bfe)):re("",!0)],512),[[$o,!f(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Hfe=dt(Ffe,[["__scopeId","data-v-58db7de1"]]),Wfe={class:"group-title"},zfe={class:"srow-main"},Ufe={class:"srow-label"},jfe={class:"srow-sub"},qfe={class:"srow read-only"},Vfe={class:"srow-main"},Kfe={class:"srow-label"},Gfe={key:0,class:"srow-sub"},Yfe={class:"srow-main"},Qfe={class:"srow-label"},Xfe={class:"srow-sub"},Zfe=["aria-checked"],Jfe={class:"srow-main"},epe={class:"srow-label"},tpe={class:"srow-sub"},npe=["aria-checked"],spe={class:"srow-main"},ope={class:"srow-label"},ipe={class:"srow read-only"},rpe={class:"srow-main"},lpe={class:"srow-label"},ape={class:"srow-sub"},cpe=["aria-label"],upe={class:"group-title"},dpe={class:"srow-main"},fpe={class:"srow-label"},ppe={class:"srow-sub"},hpe={class:"srow read-only pref"},mpe={class:"srow-main"},gpe={class:"srow-label"},vpe={class:"srow read-only pref"},ype={class:"srow-main"},kpe={class:"srow-label"},bpe={class:"srow read-only pref"},_pe={class:"srow-main"},wpe={class:"srow-label"},Spe={class:"num-field"},Cpe=["value","aria-label"],xpe={class:"srow-main"},Ape={class:"srow-label"},Tpe={class:"srow-sub"},Mpe=["aria-checked"],Epe={class:"srow-main"},Ipe={class:"srow-label"},$pe={class:"srow-main"},Npe={class:"srow-label"},Lpe={key:2,class:"srow read-only"},Ope={class:"srow-main"},Ppe={class:"srow-label"},Rpe={class:"srow-val dim"},Dpe={class:"arch-subhead"},Bpe={class:"arch-count"},Fpe={class:"arch-tools"},Hpe={key:0,class:"arch-empty"},Wpe={class:"arch-meta"},zpe={class:"arch-name"},Upe={class:"arch-time"},jpe={key:2,class:"arch-empty"},qpe=100,Vpe=qe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(de){o("setColorScheme",de)}const r=["manual","auto","yolo"],l=B(()=>{const de=s.status?.modelId??s.status?.model??"";return s.models?.find(ne=>ne.id===de||ne.model===de||ne.displayName===s.status?.model)}),a=B(()=>gd(l.value)),c=B(()=>Cy(l.value)),u=B(()=>Ql(l.value,s.thinking??"off")),d=B(()=>{const de=c.value,ne=u.value;return de.includes(ne)?ne:de.includes("on")?"on":de[0]??"off"}),f=B(()=>c.value.map(de=>({value:de,label:j1(de)}))),h=B(()=>s.planMode===!0),p=B(()=>s.swarmMode===!0),m=B(()=>{const de=s.status.permission;return de==="yolo"?"var(--color-danger)":de==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),_=B(()=>{const de=s.status.permission,ne=n(de==="yolo"?"mobile.permYoloSub":de==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${de} · ${ne}`}),k=de=>`${Math.round(de/1e3)}k`,g=B(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=B(()=>s.status.ctxMax>0?`${k(s.status.ctxUsed)}/${k(s.status.ctxMax)}`:n("status.statusNone"));function y(de){o("setThinking",xy(l.value,de))}function T(){const de=r.indexOf(s.status.permission),ne=r[(de+1)%r.length];o("setPermission",ne)}function P(){o("pickModel"),o("update:modelValue",!1)}function N(){o("login"),o("update:modelValue",!1)}function b(){o("logout"),o("update:modelValue",!1)}const M=Uy(),I=J("main"),L=J([]),S=J(!1),E=J(!1),R=J(""),D=J("archived-desc");async function F(){if(!S.value){S.value=!0,E.value=!1;try{const de=[];let ne;for(;;){const X=await M.loadArchivedSessions({beforeId:ne,pageSize:qpe});if(de.push(...X.items),!X.hasMore||X.items.length===0)break;const he=X.items.at(-1)?.id;if(he===void 0)break;ne=he}L.value=de,E.value=!0}catch(de){console.warn("loadAllArchived failed",de)}finally{S.value=!1}}}function U(){I.value="archived",R.value="",F()}function G(){I.value="main"}const Y=B(()=>{const de=R.value.trim().toLowerCase();let ne=L.value.filter(X=>X.archived===!0);return de&&(ne=ne.filter(X=>X.title.toLowerCase().includes(de))),ne=ne.slice(),D.value==="archived-desc"?ne.sort((X,he)=>he.updatedAt.localeCompare(X.updatedAt)):D.value==="created-desc"?ne.sort((X,he)=>he.createdAt.localeCompare(X.createdAt)):ne.sort((X,he)=>X.title.localeCompare(he.title,"zh")),ne});async function q(de){await M.restoreSession(de)&&(L.value=L.value.filter(X=>X.id!==de))}function ae(de){const ne=new Date(de);if(Number.isNaN(ne.getTime()))return de;const X=he=>String(he).padStart(2,"0");return`${ne.getFullYear()}-${X(ne.getMonth()+1)}-${X(ne.getDate())} ${X(ne.getHours())}:${X(ne.getMinutes())}`}return Ve(()=>s.modelValue,de=>{de||(I.value="main")}),(de,ne)=>(w(),ye(D4,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":ne[6]||(ne[6]=X=>o("update:modelValue",X))},{default:_e(()=>[I.value==="main"?(w(),$(Pe,{key:0},[x("div",Wfe,O(C(n)("mobile.groupSession")),1),x("button",{type:"button",class:"srow",onClick:P},[x("span",zfe,[x("span",Ufe,O(C(n)("status.statusModel")),1),x("span",jfe,O(e.status.model),1)]),ne[7]||(ne[7]=x("span",{class:"chev"},"›",-1))]),x("div",qfe,[x("span",Vfe,[x("span",Kfe,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),$("span",Gfe,O(C(n)("status.modeNotSupported")),1)):re("",!0)]),c.value.length>1?(w(),ye(to,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),$("span",{key:1,class:Re(["srow-val",{dim:d.value==="off"}])},O(d.value==="off"?C(n)("status.planOff"):C(j1)(d.value)),3))]),x("button",{type:"button",class:"srow",onClick:ne[0]||(ne[0]=X=>o("togglePlan"))},[x("span",Yfe,[x("span",Qfe,O(C(n)("status.statusPlanMode")),1),x("span",Xfe,O(C(n)("mobile.planModeSub")),1)]),x("span",{class:Re(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Zfe)]),x("button",{type:"button",class:"srow",onClick:ne[1]||(ne[1]=X=>o("toggleSwarm"))},[x("span",Jfe,[x("span",epe,O(C(n)("status.statusSwarmMode")),1),x("span",tpe,O(C(n)("mobile.swarmModeSub")),1)]),x("span",{class:Re(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,npe)]),x("button",{type:"button",class:"srow",onClick:T},[x("span",spe,[x("span",ope,O(C(n)("status.statusPermission")),1),x("span",{class:"srow-sub",style:Xt({color:m.value})},O(_.value),5)]),ne[8]||(ne[8]=x("span",{class:"chev"},"›",-1))]),x("div",ipe,[x("span",rpe,[x("span",lpe,O(C(n)("status.statusContext")),1),x("span",ape,O(v.value),1)]),x("span",{class:"ctx-meter","aria-label":v.value},[x("i",{style:Xt({width:g.value+"%"})},null,4)],8,cpe)]),x("div",upe,O(C(n)("mobile.groupApp")),1),x("button",{type:"button",class:"srow",onClick:U},[x("span",dpe,[x("span",fpe,O(C(n)("mobile.archivedSessions")),1),x("span",ppe,O(C(n)("mobile.archivedSessionsSub")),1)]),ne[9]||(ne[9]=x("span",{class:"chev"},"›",-1))]),x("div",hpe,[x("span",mpe,[x("span",gpe,O(C(n)("theme.colorSchemeLabel")),1)]),ie(to,{"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"])]),x("div",vpe,[x("span",ype,[x("span",kpe,O(C(n)("sidebar.language")),1)]),ie(R4)]),x("div",bpe,[x("span",_pe,[x("span",wpe,O(C(n)("settings.uiFontSize")),1)]),x("label",Spe,[x("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ne[2]||(ne[2]=X=>o("setUiFontSize",Number(X.target.value)))},null,40,Cpe),ne[10]||(ne[10]=x("span",{class:"num-unit"},"px",-1))])]),x("button",{type:"button",class:"srow",onClick:ne[3]||(ne[3]=X=>o("setConversationToc",!e.conversationToc))},[x("span",xpe,[x("span",Ape,O(C(n)("settings.conversationToc")),1),x("span",Tpe,O(C(n)("settings.conversationTocHint")),1)]),x("span",{class:Re(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Mpe)]),e.authReady?(w(),$("button",{key:0,type:"button",class:"srow acct out",onClick:b},[x("span",Epe,[x("span",Ipe,O(C(n)("sidebar.signOut")),1)])])):(w(),$("button",{key:1,type:"button",class:"srow acct in",onClick:N},[x("span",$pe,[x("span",Npe,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),$("div",Lpe,[x("span",Ope,[x("span",Ppe,O(C(n)("settings.serverVersion")),1)]),x("span",Rpe,O(e.serverVersion),1)])):re("",!0)],64)):(w(),$(Pe,{key:1},[x("div",Dpe,[x("button",{type:"button",class:"arch-back",onClick:G},[ne[11]||(ne[11]=x("span",{class:"chev back"},"‹",-1)),Ue(" "+O(C(n)("mobile.archivedBack")),1)]),x("span",Bpe,O(C(n)("mobile.sessionCount",{n:Y.value.length})),1)]),x("div",Fpe,[ie(Vl,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":ne[4]||(ne[4]=X=>R.value=X)},null,8,["model-value","placeholder"]),ie(to,{size:"sm","model-value":D.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ne[5]||(ne[5]=X=>D.value=X)},null,8,["model-value","options"])]),S.value?(w(),$("div",Hpe,O(C(n)("settings.archivedLoadingAll")),1)):Y.value.length>0?(w(!0),$(Pe,{key:1},tt(Y.value,X=>(w(),$("div",{key:X.id,class:"arch-row"},[x("div",Wpe,[x("div",zpe,O(X.title),1),x("div",Upe,O(C(n)("settings.archivedAt",{time:ae(X.updatedAt)})),1)]),ie(Pt,{variant:"secondary",size:"sm",onClick:he=>q(X.id)},{default:_e(()=>[Ue(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(w(),$("div",jpe,O(L.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),Kpe=dt(Vpe,[["__scopeId","data-v-eeaf31bb"]]),Gpe={class:"ob-brand"},Ype={class:"ob-brand-text"},Qpe={class:"ob-title"},Xpe={class:"ob-sub"},Zpe={class:"ob-sec"},Jpe={class:"ob-label"},ehe={class:"ob-sec"},the={class:"ob-label"},nhe={class:"ob-sec"},she={class:"ob-label"},ohe=qe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=j3();function c(d){o.value!==d&&HA(d)}function u(){n("complete")}return(d,f)=>(w(),ye(pr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:_e(()=>[x("div",Gpe,[f[4]||(f[4]=x("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[x("defs",null,[x("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[x("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),x("g",{class:"ob-eyes",fill:"#000"},[x("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),x("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),x("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),x("div",Ype,[x("div",Qpe,O(C(s)("onboarding.title")),1),x("div",Xpe,O(C(s)("onboarding.subtitle")),1)])])]),default:_e(()=>[x("section",Zpe,[x("div",Jpe,O(C(s)("onboarding.languageLabel")),1),ie(to,{"model-value":C(o),options:C(FA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),x("section",ehe,[x("div",the,O(C(s)("theme.colorSchemeLabel")),1),ie(to,{"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"])]),x("section",nhe,[x("div",she,O(C(s)("theme.accentLabel")),1),ie(to,{"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"])]),ie(Pt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:_e(()=>[Ue(O(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),ihe=dt(ohe,[["__scopeId","data-v-fbdd3eab"]]),rhe=["aria-label"],lhe={class:"gload-box"},ahe={class:"gload-text"},che=qe({__name:"GlobalLoading",setup(e){const{t}=Tt();return(n,s)=>(w(),$("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[x("div",lhe,[s[0]||(s[0]=m0('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-8d6a5c44></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-8d6a5c44></path></svg>',1)),ie(ri,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),x("div",ahe,O(C(t)("app.connecting")),1)])],8,rhe))}}),uhe=dt(che,[["__scopeId","data-v-8d6a5c44"]]),dhe={class:"kap-root"},fhe={class:"kap-head"},phe={class:"kap-count"},hhe={class:"kap-head-actions"},mhe={class:"kap-filters"},ghe=["value"],vhe={class:"kap-check"},yhe={class:"kap-check"},khe={class:"kap-view-toggle",role:"group"},bhe={key:0,class:"kap-empty"},_he=["onClick"],whe={class:"kap-ts"},She={class:"kap-label"},Che={key:0,class:"kap-detail"},xhe={class:"kap-detail-actions"},Ahe=["onClick"],The={key:1,class:"kap-agg"},Mhe={class:"mono"},Ehe={class:"mono"},Ihe={class:"num"},$he={class:"num"},Nhe={key:0},Lhe={class:"mono"},Ohe={class:"num"},Phe={class:"num"},Rhe={key:0},Dhe=qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=J("all"),o=J(""),i=J(""),r=J(!1),l=J("timeline"),a=B(()=>(_y.value,[...UY()])),c=B(()=>{const M=new Set;for(const I of a.value)I.sessionId&&M.add(I.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=B(()=>{const M=o.value.trim().toLowerCase();return a.value.filter(I=>!(s.value!=="all"&&I.source!==s.value||i.value&&I.sessionId!==i.value||r.value&&!u(I)||M&&!`${I.label} ${I.kind} ${I.eventType??""} ${I.sessionId??""} ${I.requestId??""}`.toLowerCase().includes(M)))}),f=B(()=>{const M=new Map;for(const I of d.value){if(I.kind!=="ws:in"&&I.kind!=="ws:out")continue;const L=I.kind==="ws:in"?"←":"→",S=`${L} ${I.eventType??"?"} @ ${I.sessionId??"-"}`,E=M.get(S)??{key:S,sessionId:I.sessionId??"-",eventType:I.eventType??"?",dir:L,count:0};E.count++,I.seq!==void 0&&(E.lastSeq=I.seq),M.set(S,E)}return[...M.values()].sort((I,L)=>L.count-I.count)}),h=B(()=>{const M=new Map;for(const I of d.value){if(I.source!=="rest"||I.kind==="rest:request")continue;const L=`${I.method??"?"} ${I.path??"?"}`,S=M.get(L)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(I)&&S.errors++,I.durationMs!==void 0&&(S.totalMs+=I.durationMs,S.timed++),M.set(L,S)}return[...M.entries()].map(([I,L])=>({key:I,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort((I,L)=>L.count-I.count)}),p=J(null),m=J(!0),_=J(null),k=J(null);Ve(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await gt();const M=_.value;M&&(M.scrollTop=M.scrollHeight)});function g(M){p.value=p.value===M?null:M}function v(M){const I=new Date(M),L=(S,E=2)=>String(S).padStart(E,"0");return`${L(I.getHours())}:${L(I.getMinutes())}:${L(I.getSeconds())}.${L(I.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function T(M){await js(y(M))&&(k.value=M.id,setTimeout(()=>{k.value===M.id&&(k.value=null)},1500))}function P(){I3(d.value)}function N(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function b(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,I)=>(w(),$("section",dhe,[x("header",fhe,[I[11]||(I[11]=x("strong",null,"KAP debug",-1)),x("span",phe,O(d.value.length)+"/"+O(a.value.length),1),x("div",hhe,[x("button",{type:"button",class:Re({on:C(au)}),onClick:I[0]||(I[0]=L=>au.value=!C(au))},O(C(au)?"resume":"pause"),3),x("button",{type:"button",onClick:I[1]||(I[1]=L=>C(jY)())},"clear"),x("button",{type:"button",onClick:I[2]||(I[2]=L=>P())},"export jsonl"),ie(jt,{text:"Close window"},{default:_e(()=>[x("button",{type:"button",onClick:I[3]||(I[3]=L=>n("close"))},"✕")]),_:1})])]),x("div",mhe,[Sn(x("select",{"onUpdate:modelValue":I[4]||(I[4]=L=>s.value=L),"aria-label":"Source filter"},[...I[12]||(I[12]=[x("option",{value:"all"},"rest + ws + app",-1),x("option",{value:"rest"},"rest",-1),x("option",{value:"ws"},"ws",-1),x("option",{value:"client"},"app errors",-1)])],512),[[Wv,s.value]]),Sn(x("select",{"onUpdate:modelValue":I[5]||(I[5]=L=>i.value=L),"aria-label":"Session filter"},[I[13]||(I[13]=x("option",{value:""},"all sessions",-1)),(w(!0),$(Pe,null,tt(c.value,L=>(w(),$("option",{key:L,value:L},O(L),9,ghe))),128))],512),[[Wv,i.value]]),Sn(x("input",{"onUpdate:modelValue":I[6]||(I[6]=L=>o.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ao,o.value]]),x("label",vhe,[Sn(x("input",{"onUpdate:modelValue":I[7]||(I[7]=L=>r.value=L),type:"checkbox"},null,512),[[up,r.value]]),I[14]||(I[14]=Ue(" errors",-1))]),x("label",yhe,[Sn(x("input",{"onUpdate:modelValue":I[8]||(I[8]=L=>m.value=L),type:"checkbox"},null,512),[[up,m.value]]),I[15]||(I[15]=Ue(" follow",-1))]),x("div",khe,[x("button",{type:"button",class:Re({on:l.value==="timeline"}),onClick:I[9]||(I[9]=L=>l.value="timeline")},"timeline",2),x("button",{type:"button",class:Re({on:l.value==="aggregate"}),onClick:I[10]||(I[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),$("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(w(),$("div",bhe," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(w(!0),$(Pe,null,tt(d.value,L=>(w(),$("div",{key:L.id,class:"kap-row-wrap"},[x("button",{type:"button",class:Re(["kap-row",{expanded:p.value===L.id}]),onClick:S=>g(L.id)},[x("span",whe,O(v(L.ts)),1),x("span",{class:Re(["kap-badge",N(L)])},O(b(L)),3),x("span",She,O(L.label),1)],10,_he),p.value===L.id?(w(),$("div",Che,[x("div",xhe,[x("button",{type:"button",onClick:S=>T(L)},O(k.value===L.id?"copied ✓":"copy json"),9,Ahe)]),x("pre",null,O(y(L)),1)])):re("",!0)]))),128))],512)):(w(),$("div",The,[I[20]||(I[20]=x("h4",null,"WS frames by session / type",-1)),x("table",null,[I[17]||(I[17]=x("thead",null,[x("tr",null,[x("th",null,"dir"),x("th",null,"type"),x("th",null,"session"),x("th",null,"count"),x("th",null,"last seq")])],-1)),x("tbody",null,[(w(!0),$(Pe,null,tt(f.value,L=>(w(),$("tr",{key:L.key},[x("td",null,O(L.dir),1),x("td",Mhe,O(L.eventType),1),x("td",Ehe,O(L.sessionId),1),x("td",Ihe,O(L.count),1),x("td",$he,O(L.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),$("tr",Nhe,[...I[16]||(I[16]=[x("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),I[21]||(I[21]=x("h4",null,"REST by endpoint",-1)),x("table",null,[I[19]||(I[19]=x("thead",null,[x("tr",null,[x("th",null,"endpoint"),x("th",null,"count"),x("th",null,"errors"),x("th",null,"avg ms")])],-1)),x("tbody",null,[(w(!0),$(Pe,null,tt(h.value,L=>(w(),$("tr",{key:L.key},[x("td",Lhe,O(L.key),1),x("td",Ohe,O(L.count),1),x("td",{class:Re(["num",{err:L.errors>0}])},O(L.errors),3),x("td",Phe,O(L.avgMs),1)]))),128)),h.value.length===0?(w(),$("tr",Rhe,[...I[18]||(I[18]=[x("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),Bhe=dt(Dhe,[["__scopeId","data-v-3cda6fe3"]]),Fhe=qe({__name:"DebugPanel",setup(e){const t=J(!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=dp(Bhe,{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 bn(()=>{c()}),ds(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),ye(jt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:_e(()=>[x("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Hhe=dt(Fhe,[["__scopeId","data-v-21346738"]]);function Whe({client:e,authLogoRef:t}){const n=B(()=>e.authReady.value),s=B(()=>e.initialized.value&&!n.value),o="/login",i=J(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ve(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 Tn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function zhe({running:e,showAuthGate:t}){const{t:n}=Tt(),s=["◐","◓","◑","◒"],o=J(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}Ve(e,c=>{c?r():l()},{immediate:!0});const a=B(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});AI(()=>{typeof document<"u"&&(document.title=a.value)}),Tn(()=>{l()})}const B4=J(typeof window>"u"?0:window.innerWidth);let Cf=0,Yp=!1;function G1(){B4.value=window.innerWidth}function Uhe(){Yp||typeof window>"u"||(window.addEventListener("resize",G1),Yp=!0,G1())}function jhe(){!Yp||typeof window>"u"||(window.removeEventListener("resize",G1),Yp=!1)}function F4(e,t,n){return Math.max(t,e-n)}function Y1(e,t,n){return Math.min(n,Math.max(t,e))}function H4(){return bn(()=>{Cf+=1,Uhe()}),ds(()=>{Cf=Math.max(0,Cf-1),Cf===0&&jhe()}),{viewportWidth:B4}}const qhe="kimi-web.file-preview-width",Fa=320;function Vhe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=H4(),i=B(()=>Math.max(0,o.value-t.value)),r=B(()=>F4(i.value,Fa,Fa));function l(oe){return Y1(Math.round(oe),Fa,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=J(c.value),d=B(()=>Y1(u.value,Fa,r.value)),f=J(null),h=B(()=>{const oe=f.value;if(!oe)return null;const Z=e.turns.value.find(ue=>ue.id===oe.turnId)?.blocks?.[oe.blockIndex];return Z?.kind==="thinking"?Z.thinking:null}),p=B(()=>h.value!==null);function m(oe){const W=f.value;if(W&&W.turnId===oe.turnId&&W.blockIndex===oe.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=oe}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=J(null),g=B(()=>{const oe=k.value;if(!oe)return null;const W=e.turns.value.find(Z=>Z.id===oe.turnId);return W?.role==="compaction"&&W.text?W.text:null}),v=B(()=>g.value!==null);function y(oe){if(k.value?.turnId===oe.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=oe}function T(){k.value=null,n.value==="compaction"&&(n.value=null)}const P=J(null);function N(oe){const W=e.activeAppTasks.value,Z=W.find(le=>le.id===oe)??W.find(le=>le.parentToolCallId===oe);if(Z)return Z.id;const ue=W.filter(le=>le.kind==="subagent"&&!le.parentToolCallId);if(ue.length===1)return ue[0].id}const b=B(()=>{const oe=P.value;if(!oe)return null;const W=e.activeAppTasks.value.find(Z=>Z.id===oe.subagentId);return W?Rre(W):null}),M=B(()=>b.value!==null);function I(oe){const W=N(oe);if(W){if(P.value?.subagentId===W){P.value=null,n.value==="agent"&&(n.value=null);return}P.value={subagentId:W},n.value="agent"}}function L(){P.value=null,n.value==="agent"&&(n.value=null)}const S=J(null),E=B(()=>{const oe=S.value;if(!oe)return null;const W=jP(e.turns.value,oe);return W?{id:oe,title:na(W.name),path:UP(W.arg),lines:W.status==="error"?null:UA(W),output:W.output}:null}),R=B(()=>E.value!==null);function D(oe){if(n.value==="toolDiff"&&S.value===oe){F();return}n.value="toolDiff",S.value=oe}function F(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const U=J("list"),G=J(null);function Y(){if(n.value==="diff"){q();return}n.value="diff",U.value="list",G.value=null,e.loadGitStatus(e.activeSessionId.value)}function q(){n.value==="diff"&&(n.value=null),U.value="list",G.value=null,e.clearFileDiff()}async function ae(oe){U.value="detail",G.value=oe,await e.loadFileDiff(oe)}async function de(oe){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,oe):await e.openSideChat(oe),n.value="btw"}function ne(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function X(){n.value==="btw"&&(n.value=null)}const he=B(()=>e.sideChatVisible.value),Oe=B(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||M.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||he.value)),je=J(!1),it=J({});function ce(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return P.value?{kind:"agent",...P.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function z(oe){if(oe)switch(oe.kind){case"thinking":f.value={turnId:oe.turnId,blockIndex:oe.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:oe.turnId},n.value="compaction";break;case"agent":P.value={subagentId:oe.subagentId},n.value="agent";break;case"toolDiff":S.value=oe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Q(){return n.value==="thinking"&&p.value?(_(),!0):n.value==="compaction"&&v.value?(T(),!0):n.value==="agent"&&M.value?(L(),!0):n.value==="toolDiff"&&R.value?(F(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(q(),!0):n.value==="btw"?(ne(),!0):!1}return Ve(e.activeSessionId,(oe,W)=>{if(W){const Z=ce();Z?it.value[W]=Z:delete it.value[W]}s(),_(),T(),L(),F(),q(),X(),oe&&z(it.value[oe])}),{PREVIEW_WIDTH_KEY:qhe,PREVIEW_MIN:Fa,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:T,agentPanelMember:b,agentPanelVisible:M,openAgentPanel:I,closeAgentPanel:L,toolDiffTarget:E,toolDiffVisible:R,openToolDiff:D,closeToolDiff:F,detailDiffMode:U,detailDiffPath:G,openDiffDetail:Y,closeDiffDetail:q,selectDiffFile:ae,btwVisible:he,openSideChatTab:de,closeSideChat:ne,hideSideChatPanel:X,sidePanelVisible:Oe,panelDragging:je,closeOpenSidePanel:Q}}const Khe=$t.sidebarWidth,SC=$t.sidebarCollapsed,CC=270,Sv=170,Ghe=36,Yhe=320;function Qhe(e={}){const{viewportWidth:t}=H4(),n=J(CC),s=J(!1),o=B(()=>{const c=Yhe+(GC(e.previewOpen)?Fa:0);return F4(t.value,Sv,c)}),i=B(()=>s.value?Ghe:Y1(n.value,Sv,o.value));function r(){try{s.value=es(SC)==="true"}catch{s.value=!1}}function l(){try{ss(SC,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:Khe,SIDEBAR_DEFAULT:CC,SIDEBAR_MIN:Sv,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function Xhe({client:e,detailTarget:t}){const{t:n}=Tt(),s=J(null),o=J(null),i=J(!1),r=J(null),l=J(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=B(()=>{const N=l.value;return N?e.getFileDownloadUrl(N):null}),f=B(()=>s.value!==null);function h(N){return N.length>1?N.replace(/\/+$/,""):N}function p(N){const b=[];for(const M of N.split(/[\\/]+/))if(!(!M||M===".")){if(M===".."){b.pop();continue}b.push(M)}return b.join("/")}function m(N){const b=N.trim();if(!b)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(b))return{error:n("filePreview.errors.unsupportedPath")};if(b.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const M=h(e.status.value.cwd);if(b.startsWith("/")){if(!M||b!==M&&!b.startsWith(`${M}/`))return{error:n("filePreview.errors.outsideWorkspace")};const L=b===M?"":b.slice(M.length+1);if(L.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(L);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(b.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const I=p(b);return I?{path:I}:{error:n("filePreview.errors.emptyPath")}}async function _(N){const b=s.value;if(t.value==="file"&&b&&b.path===N.path&&b.line===N.line){y();return}const M=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=N,l.value=null;const I=m(N.path);if("error"in I){i.value=!1,r.value=I.error;return}l.value=I.path;try{const L=await e.readFileContent(I.path);if(M!==a)return;L?o.value={...L,path:L.path||I.path}:o.value={path:I.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(L){if(M!==a)return;r.value=L instanceof Error?L.message:n("filePreview.errors.loadFailed")}finally{M===a&&(i.value=!1)}}function k(N){return/^data:([^;,]+)/i.exec(N)?.[1]}function g(N){if(N.kind!=="image")return;const b=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const M={path:N.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:N.mimeType??k(N.url)??"image/*",isBinary:!0,size:N.bytes??0};N.fileId?(i.value=!0,o.value=M,pt().getFileBlob(N.fileId).then(I=>{if(b===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(I),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{b===a&&(o.value&&(o.value={...o.value,sourceUrl:N.url}),i.value=!1)})):(i.value=!1,o.value={...M,sourceUrl:N.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ve(t,(N,b)=>{b==="file"&&N!=="file"&&v()});function T(){const N=o.value?.path??s.value?.path;N&&e.openWorkspaceFile(N,s.value?.line)}function P(){const N=o.value?.path??s.value?.path;N&&e.revealWorkspaceFile(N)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:_,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:T,revealPreviewFile:P}}const Zhe=640,Jhe=`(max-width: ${Zhe}px)`;function eme(){const e=J(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Jhe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Tn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Tn(()=>t.removeListener(n))),e}const tme={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},nme={class:"server-auth-card"},sme={class:"server-auth-body"},ome={class:"server-auth-foot"},ime=qe({__name:"ServerAuthDialog",setup(e){const t=J(""),n=J(null),s=J(!1);bn(()=>{gt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,N3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(w(),$("div",tme,[x("div",nme,[l[1]||(l[1]=x("div",{class:"server-auth-head"},[x("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),x("p",{class:"server-auth-hint"},[Ue(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),x("code",null,"KIMI_CODE_PASSWORD"),Ue("). ")])],-1)),x("div",sme,[ie(Vl,{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"])]),x("div",ome,[ie(Pt,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:_e(()=>[Ue(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),rme=dt(ime,[["__scopeId","data-v-82150ea4"]]),lme={class:"app-shell"},ame={key:1,class:"auth-page"},cme={class:"auth-page-inner"},ume={class:"auth-page-copy"},dme={key:0,class:"sidebar-rail"},fme=["aria-label","aria-hidden"],pme=qe({__name:"App",setup(e){const t=eQ(),n=J(!t);let s=null;const o=Uy(),i=B(()=>!o.dangerousBypassAuth.value&&n.value);$n("resolveImage",o.resolveImageUrl),$n("resolveSwarmMembers",ft=>o.swarmMembersByToolCallId.value.get(ft)??[]);const{t:r}=Tt(),l=bi(),a=eme(),c=J(!1),u=J(!1),d=B(()=>{const ft=o.activeSessionId.value;return o.sessions.value.find(ve=>ve.id===ft)?.title??""}),f=B(()=>o.visibleWorkspace.value?.sessionCount??0),h=B(()=>o.activity.value!=="idle"),p=J(null),{showAuthGate:m,blinkAuthLogo:_}=Whe({client:o,authLogoRef:p});zhe({running:h,showAuthGate:m});function k(ft){const ve=o.status.value.modelId??o.status.value.model??"",Le=o.models.value.find(ai=>ai.id===ve||ai.model===ve||ai.displayName===o.status.value.model),Mn=Cy(Le),xs=Ql(Le,ft),ia=Mn.indexOf(xs),xc=Mn[(ia+1)%Mn.length]??Mn[0]??"off";return xy(Le,xc)}const g=J(!o.onboarded.value);function v(){o.setOnboarded(!0),g.value=!1}function y(){g.value=!0}bn(()=>{o.load(),je(),document.addEventListener("keydown",T,!0),s=nQ(()=>{n.value=!0,o.clearDangerousBypassAuth()})}),Tn(()=>{document.removeEventListener("keydown",T,!0),s!==null&&(s(),s=null)});function T(ft){ft.key==="Escape"&&(tn.value||nt()&&(ft.stopPropagation(),ft.preventDefault()))}const P=J(null),N=J(!1);Ve(o.activeSessionId,()=>{N.value=!0,gt(()=>{N.value=!1})});const{previewTarget:b,previewFile:M,previewLoading:I,previewError:L,previewDownloadUrl:S,previewExternalActions:E,openFilePreview:R,openMediaPreview:D,closeFilePreview:F,openPreviewInEditor:U,revealPreviewFile:G}=Xhe({client:o,detailTarget:P}),Y=B(()=>P.value!==null),{SIDEBAR_WIDTH_KEY:q,SIDEBAR_DEFAULT:ae,SIDEBAR_MIN:de,sidebarMax:ne,sessionColWidth:X,sidebarCollapsed:he,sideWidth:Oe,loadSidebarCollapsed:je,toggleSidebarCollapse:it}=Qhe({previewOpen:Y}),{PREVIEW_WIDTH_KEY:ce,PREVIEW_MIN:z,previewDefaultWidth:Q,previewMax:oe,previewWidth:W,previewPanelWidth:Z,thinkingPanelText:ue,thinkingVisible:le,openThinkingPanel:me,closeThinkingPanel:j,compactionPanelText:ee,compactionPanelVisible:pe,openCompactionPanel:ke,closeCompactionPanel:Te,agentPanelMember:Ie,openAgentPanel:fe,closeAgentPanel:Me,toolDiffTarget:Ge,openToolDiff:lt,closeToolDiff:kt,detailDiffMode:bt,detailDiffPath:Et,openDiffDetail:Rt,closeDiffDetail:vt,selectDiffFile:qt,btwVisible:dn,openSideChatTab:os,closeSideChat:Vt,sidePanelVisible:fn,panelDragging:Ds,closeOpenSidePanel:nt}=Vhe({client:o,sideWidth:Oe,detailTarget:P,closeFilePreview:F}),Dn=J(null),is=J(!1),Vn=J(!1),Kn=J(!1),Yt=J(!1),Gn=J(!1),Ke=J(!1),Qe=J(null),Dt=J(null),tn=B(()=>Oa.value>0||is.value||Vn.value||Kn.value||Yt.value||Gn.value||Ke.value||g.value||c.value||u.value),ln=J(!1),Zt=J(!1),_n=J(!1),xt=J(!1),Yn=J(!1);async function Wt(){ln.value=!0,Zt.value=!1,is.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{Zt.value=!0}finally{ln.value=!1}}async function ys(){_n.value=!0,xt.value=!1,Vn.value=!0;try{await o.loadProviders()}catch{xt.value=!0}finally{_n.value=!1}}function Cs(){Kn.value=!0}async function Co(ft){is.value=!1,await o.setModel(ft)}async function Vs(ft){await o.addProvider(ft)}async function co(ft){await o.deleteProvider(ft)}async function uo(ft){await o.refreshProvider(ft)}async function Lt(ft){Yn.value=!0;try{await o.updateConfig(ft)&&await o.checkAuth()}finally{Yn.value=!1}}async function Wo(){return o.startOAuthLogin()}async function zo(){return o.pollOAuthLogin()}async function Ye(){return o.cancelOAuthLogin()}async function et(){Kn.value=!1,await o.checkAuth(),await o.load()}async function st(ft){await o.undo(1),await gt(),Dn.value?.loadComposerForEdit(ft.text,ft.images)}function Bt(ft){if(ft==="/compact"||ft.startsWith("/compact ")){o.compact(ft.slice(8).trim()||void 0);return}if(ft==="/swarm"||ft.startsWith("/swarm ")){const ve=ft.slice(6).trim();ve==="on"?o.setSwarmMode(!0):ve==="off"?o.setSwarmMode(!1):ve?(o.setSwarmMode(!0),o.sendPrompt(ve)):o.toggleSwarmMode();return}if(ft==="/goal"||ft.startsWith("/goal ")){const ve=ft.slice(5).trim();ve==="pause"||ve==="resume"||ve==="cancel"?o.controlGoal(ve):ve?o.createGoal(ve):o.toggleGoalMode();return}if(ft==="/btw"||ft.startsWith("/btw ")){const ve=ft.slice(4).trim();!ve&&o.sideChatVisible.value?Vt():os(ve||void 0);return}switch(ft){case"/new":case"/clear":ts();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const ve=o.permission.value,Le=ve==="manual"?"auto":ve==="auto"?"yolo":"manual";o.setPermission(Le);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(k(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":Gn.value=!0;break;case"/model":Wt();break;case"/provider":break;case"/login":Cs();break;default:{const ve=ft.indexOf(" "),Le=(ve===-1?ft:ft.slice(0,ve)).slice(1),Mn=ve===-1?void 0:ft.slice(ve+1).trim()||void 0;if(!Le)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Le,Mn):o.activateSkill(Le,Mn);break}}}function Uo(ft){o.unqueue(ft)}function Oi(ft){o.unqueue(ft)}function Ee(ft){o.reorderQueue(ft.from,ft.to)}async function Ae(ft){const ve=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&ve){await o.startSessionAndSendPrompt(ve,ft.text,ft.attachments);return}if(!o.activeSessionId.value&&!ve){Qe.value=ft,Yt.value=!0;return}o.sendPrompt(ft.text,ft.attachments)}async function Fe(ft){if(Dt.value=null,!await o.addWorkspaceByPath(ft)){Dt.value=r("workspace.addFailed");return}Yt.value=!1;const Le=Qe.value;Qe.value=null;const Mn=o.activeWorkspaceId.value;Le&&Mn&&await o.startSessionAndSendPrompt(Mn,Le.text,Le.attachments)}function Nt(){Qe.value=null,Dt.value=null,Yt.value=!1}function zt(){gt(()=>{Dn.value?.focusComposer()})}function ts(){const ft=o.activeWorkspaceId.value;ft?o.openWorkspaceDraft(ft):o.clearActiveSession(),zt()}function Qn(ft){o.openWorkspaceDraft(ft),zt()}function Fn(ft){ft&&window.open(ft,"_blank","noopener")}return(ft,ve)=>(w(),$("div",lme,[i.value?(w(),ye(rme,{key:0})):re("",!0),C(m)?(w(),$("section",ame,[x("div",cme,[(w(),$("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:ve[0]||(ve[0]=yt(()=>{},["prevent"])),onClick:ve[1]||(ve[1]=(...Le)=>C(_)&&C(_)(...Le))},[...ve[94]||(ve[94]=[m0('<defs data-v-80c89e01><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-80c89e01><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-80c89e01></rect><g class="ch-eyes" fill="#000" data-v-80c89e01><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-80c89e01></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-80c89e01></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-80c89e01></rect>',2)])],544)),x("div",ume,[x("h1",null,O(C(r)("app.authPageTitle")),1),x("p",null,O(C(r)("app.authPageMessage")),1)]),ie(Pt,{class:"auth-page-btn",variant:"primary",onClick:Cs},{default:_e(()=>[ie(Xe,{name:"log-in",size:"md"}),x("span",null,O(C(r)("app.authPageLogin")),1)]),_:1})])])):(w(),$("div",{key:2,class:Re(["app",{mobile:C(a),"sidebar-collapsed":C(he)&&!C(a)}]),style:Xt({"--side-w":C(Oe)+"px","--preview-w":C(Z)+"px"})},[C(a)?(w(),ye(vfe,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:ve[17]||(ve[17]=Le=>c.value=!0),onOpenSettings:ve[18]||(ve[18]=Le=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),$(Pe,{key:0},[Sn(ie(OL,{"col-width":C(Oe),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,onSelect:ve[2]||(ve[2]=Le=>C(o).selectSession(Le)),onCreate:ts,onCreateInWorkspace:ve[3]||(ve[3]=Le=>Qn(Le)),onSelectWorkspace:ve[4]||(ve[4]=Le=>C(o).openWorkspace(Le)),onAddWorkspace:ve[5]||(ve[5]=Le=>Yt.value=!0),onRename:ve[6]||(ve[6]=(Le,Mn)=>C(o).renameSession(Le,Mn)),onArchive:ve[7]||(ve[7]=Le=>C(o).archiveSession(Le)),onFork:ve[8]||(ve[8]=Le=>C(o).forkSession(Le)),onRenameWorkspace:ve[9]||(ve[9]=(Le,Mn)=>C(o).renameWorkspace(Le,Mn)),onDeleteWorkspace:ve[10]||(ve[10]=Le=>C(o).deleteWorkspace(Le)),onReorderWorkspaces:ve[11]||(ve[11]=Le=>C(o).reorderWorkspaces(Le)),onSetWorkspaceSortMode:ve[12]||(ve[12]=Le=>C(o).setWorkspaceSortMode(Le)),onLoadMoreSessions:ve[13]||(ve[13]=Le=>void C(o).loadMoreSessions(Le)),onLoadAllSessions:ve[14]||(ve[14]=Le=>void C(o).loadAllSessions()),onOpenSettings:ve[15]||(ve[15]=Le=>Ke.value=!0),onCollapse:C(it)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),[[$o,!C(he)]]),Sn(ie(F_,{"storage-key":C(q),"default-width":C(ae),min:C(de),max:C(ne),"onUpdate:width":ve[16]||(ve[16]=Le=>X.value=Le)},null,8,["storage-key","default-width","min","max"]),[[$o,!C(he)]]),C(he)?(w(),$("div",dme,[ie(Cn,{size:"sm",label:C(r)("sidebar.expandSidebar"),onClick:C(it)},{default:_e(()=>[ie(Xe,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])])):re("",!0)],64)),ie(Ute,{ref_key:"conversationPaneRef",ref:Dn,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:ve[19]||(ve[19]=Le=>C(Rt)()),onSelectWorkspace:ve[20]||(ve[20]=Le=>Qn(Le)),onAddWorkspace:ve[21]||(ve[21]=Le=>Yt.value=!0),onOpenPr:Fn,onSubmit:ve[22]||(ve[22]=Le=>Ae(Le)),onSteer:ve[23]||(ve[23]=Le=>C(o).steerPrompt(Le.text,Le.attachments)),onApproval:ve[24]||(ve[24]=(Le,Mn)=>C(o).respondApproval(Le,Mn)),onCancelTask:ve[25]||(ve[25]=Le=>C(o).cancelTask(Le)),onAnswer:ve[26]||(ve[26]=(Le,Mn)=>C(o).respondQuestion(Le,Mn)),onDismiss:ve[27]||(ve[27]=Le=>C(o).dismissQuestion(Le)),onCommand:Bt,onInterrupt:ve[28]||(ve[28]=Le=>C(o).abortCurrentPrompt()),onUnqueue:Uo,onEditQueued:Oi,onReorderQueue:Ee,onSetPermission:ve[29]||(ve[29]=Le=>C(o).setPermission(Le)),onSetThinking:ve[30]||(ve[30]=Le=>C(o).setThinking(Le)),onTogglePlan:ve[31]||(ve[31]=Le=>C(o).togglePlanMode()),onToggleSwarm:ve[32]||(ve[32]=Le=>C(o).toggleSwarmMode()),onToggleGoal:ve[33]||(ve[33]=Le=>C(o).toggleGoalMode()),onCreateGoal:ve[34]||(ve[34]=Le=>C(o).createGoal(Le)),onControlGoal:ve[35]||(ve[35]=Le=>C(o).controlGoal(Le)),onRefreshGitStatus:ve[36]||(ve[36]=Le=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:ve[37]||(ve[37]=(Le,Mn)=>C(o).renameSession(Le,Mn)),onForkSession:ve[38]||(ve[38]=Le=>C(o).forkSession(Le)),onArchiveSession:ve[39]||(ve[39]=Le=>C(o).archiveSession(Le)),onCompact:ve[40]||(ve[40]=Le=>C(o).compact()),onPickModel:ve[41]||(ve[41]=Le=>Wt()),onSelectModel:ve[42]||(ve[42]=Le=>C(o).setModel(Le)),onOpenFile:ve[43]||(ve[43]=Le=>C(R)(Le)),onOpenMedia:ve[44]||(ve[44]=Le=>C(D)(Le)),onOpenThinking:ve[45]||(ve[45]=Le=>C(me)(Le)),onOpenCompaction:ve[46]||(ve[46]=Le=>C(ke)(Le)),onOpenAgent:ve[47]||(ve[47]=Le=>C(fe)(Le)),onOpenToolDiff:ve[48]||(ve[48]=Le=>C(lt)(Le)),onEditMessage:st},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),C(fn)&&!C(a)?(w(),ye(F_,{key:2,"storage-key":C(ce),"default-width":C(Q),min:C(z),max:C(oe),reverse:"","aria-label":C(r)("layout.resizePreviewAria"),"onUpdate:width":ve[49]||(ve[49]=Le=>W.value=Le),"onUpdate:dragging":ve[50]||(ve[50]=Le=>Ds.value=Le)},null,8,["storage-key","default-width","min","max","aria-label"])):re("",!0),!C(a)||C(fn)?(w(),$("aside",{key:3,class:Re(["global-preview",{open:C(fn),mobile:C(a),"no-anim":C(Ds)||N.value}]),role:"complementary","aria-label":C(r)("layout.detailPanelAria"),"aria-hidden":!C(fn)},[P.value==="thinking"&&C(le)?(w(),ye(aC,{key:0,text:C(ue)??"",onClose:C(j)},null,8,["text","onClose"])):P.value==="compaction"&&C(pe)?(w(),ye(aC,{key:1,text:C(ee)??"",subtitle:C(r)("conversation.summaryTitle"),onClose:C(Te)},null,8,["text","subtitle","onClose"])):P.value==="agent"&&C(Ie)?(w(),ye(use,{key:2,member:C(Ie),onClose:C(Me)},null,8,["member","onClose"])):P.value==="btw"&&C(dn)?(w(),ye($se,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:ve[51]||(ve[51]=Le=>C(o).sendSideChatPrompt(Le)),onClose:C(Vt)},null,8,["turns","running","sending","onClose"])):P.value==="diff"?(w(),ye(ioe,{key:4,mode:C(bt),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(qt),onBack:ve[52]||(ve[52]=Le=>{bt.value="list",Et.value=null,C(o).clearFileDiff()}),onClose:C(vt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):P.value==="toolDiff"&&C(Ge)?(w(),ye(Sse,{key:5,target:C(Ge),onClose:C(kt)},null,8,["target","onClose"])):P.value==="file"?(w(),ye(qne,{key:6,file:C(M),loading:C(I),error:C(L),line:C(b)?.line,"download-url":C(S),closable:"","external-actions":C(E),"open-file":C(R),onClose:C(F),onOpenExternal:C(U),onReveal:C(G)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):re("",!0)],10,fme)):re("",!0),is.value?(w(),ye(Coe,{key:4,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:ln.value,unavailable:Zt.value,onSelect:ve[53]||(ve[53]=Le=>Co(Le)),onToggleStar:ve[54]||(ve[54]=Le=>C(o).toggleStarModel(Le)),onClose:ve[55]||(ve[55]=Le=>is.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),Ke.value?(w(),ye(lde,{key:5,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Yn.value,"server-version":C(o).serverVersion.value,onSetColorScheme:ve[56]||(ve[56]=Le=>C(o).setColorScheme(Le)),onSetAccent:ve[57]||(ve[57]=Le=>C(o).setAccent(Le)),onSetUiFontSize:ve[58]||(ve[58]=Le=>C(o).setUiFontSize(Le)),onSetNotify:ve[59]||(ve[59]=Le=>C(o).setNotifyOnComplete(Le)),onSetNotifyQuestion:ve[60]||(ve[60]=Le=>C(o).setNotifyOnQuestion(Le)),onSetSound:ve[61]||(ve[61]=Le=>C(o).setSoundOnComplete(Le)),onSetConversationToc:ve[62]||(ve[62]=Le=>C(o).setConversationToc(Le)),onUpdateConfig:ve[63]||(ve[63]=Le=>Lt(Le)),onLogin:ve[64]||(ve[64]=()=>{Ke.value=!1,Cs()}),onLogout:C(o).logout,onOpenOnboarding:ve[65]||(ve[65]=()=>{Ke.value=!1,y()}),onOpenProviders:ve[66]||(ve[66]=()=>{Ke.value=!1,ys()}),onClose:ve[67]||(ve[67]=Le=>Ke.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):re("",!0),Vn.value?(w(),ye(Yoe,{key:6,providers:C(o).providers.value,loading:_n.value,unavailable:xt.value,onAdd:ve[68]||(ve[68]=Le=>Vs(Le)),onRefresh:ve[69]||(ve[69]=Le=>uo(Le)),onDelete:ve[70]||(ve[70]=Le=>co(Le)),onOpenLogin:ve[71]||(ve[71]=()=>{Vn.value=!1,Cs()}),onClose:ve[72]||(ve[72]=Le=>Vn.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),Gn.value?(w(),ye(Qde,{key:7,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:ve[73]||(ve[73]=Le=>Gn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),Yt.value?(w(),ye(Ode,{key:8,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:Dt.value,onAdd:ve[74]||(ve[74]=Le=>Fe(Le)),onClose:Nt},null,8,["browse-fs","get-fs-home","default-path","error"])):re("",!0),ie(Zr,{name:"gload-fade"},{default:_e(()=>[C(o).initialized.value?re("",!0):(w(),ye(uhe,{key:0}))]),_:1}),g.value&&!C(m)?(w(),ye(ihe,{key:9,onComplete:v,onSkip:v})):re("",!0),ie(afe,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(w(),ye(Hhe,{key:10})):re("",!0),ie(Bde),C(a)?(w(),ye(Hfe,{key:11,modelValue:c.value,"onUpdate:modelValue":ve[75]||(ve[75]=Le=>c.value=Le),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:ve[76]||(ve[76]=Le=>C(o).selectSession(Le)),onCreate:ts,onCreateInWorkspace:ve[77]||(ve[77]=Le=>Qn(Le)),onAddWorkspace:ve[78]||(ve[78]=Le=>Yt.value=!0),onRename:ve[79]||(ve[79]=(Le,Mn)=>C(o).renameSession(Le,Mn)),onArchive:ve[80]||(ve[80]=Le=>C(o).archiveSession(Le)),onDeleteWorkspace:ve[81]||(ve[81]=Le=>C(o).deleteWorkspace(Le)),onLoadMore:ve[82]||(ve[82]=Le=>void C(o).loadMoreSessions(Le))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),C(a)?(w(),ye(Kpe,{key:12,modelValue:u.value,"onUpdate:modelValue":ve[83]||(ve[83]=Le=>u.value=Le),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:ve[84]||(ve[84]=Le=>Wt()),onSetThinking:ve[85]||(ve[85]=Le=>C(o).setThinking(Le)),onTogglePlan:ve[86]||(ve[86]=Le=>C(o).togglePlanMode()),onToggleSwarm:ve[87]||(ve[87]=Le=>C(o).toggleSwarmMode()),onSetPermission:ve[88]||(ve[88]=Le=>C(o).setPermission(Le)),onSetColorScheme:ve[89]||(ve[89]=Le=>C(o).setColorScheme(Le)),onSetUiFontSize:ve[90]||(ve[90]=Le=>C(o).setUiFontSize(Le)),onSetConversationToc:ve[91]||(ve[91]=Le=>C(o).setConversationToc(Le)),onLogin:ve[92]||(ve[92]=()=>{u.value=!1,Cs()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):re("",!0)],6)),Kn.value?(w(),ye(xie,{key:3,"on-start-o-auth-login":Wo,"on-poll-o-auth-login":zo,"on-cancel-o-auth-login":Ye,onSuccess:et,onClose:ve[93]||(ve[93]=Le=>Kn.value=!1)})):re("",!0)]))}}),hme=dt(pme,[["__scopeId","data-v-80c89e01"]]);GY();dp(hme).use(Bn).mount("#app");export{UE as $,c0 as A,LI as B,as as C,pge as D,$C as E,Pe as F,m0 as G,Ue as H,ie as I,fI as J,Bme as K,hi as L,qe as M,i6 as N,zme as O,Ume as P,Vme as Q,Kf as R,Ja as S,dh as T,jme as U,v0 as V,Wme as W,mge as X,qme as Y,age as Z,gme as _,rx as a,zs as a$,Rs as a0,Z1 as a1,Cme as a2,o0 as a3,E$ as a4,mn as a5,kc as a6,Ime as a7,yge as a8,Ome as a9,dx as aA,jI as aB,QI as aC,bn as aD,YI as aE,GI as aF,J1 as aG,KI as aH,Tn as aI,r0 as aJ,vI as aK,w as aL,n6 as aM,Mme as aN,$n as aO,YC as aP,Tme as aQ,Zf as aR,Os as aS,Yf as aT,J as aU,nge as aV,_6 as aW,tt as aX,Ln as aY,ZI as aZ,Fme as a_,Dme as aa,Rme as ab,Pme as ac,oge as ad,kge as ae,Ut as af,P$ as ag,ch as ah,qr as ai,cr as aj,ns as ak,sge as al,Lo as am,Xr as an,Wr as ao,Yme as ap,Qme as aq,vn as ar,gt as as,H$ as at,Re as au,mme as av,Xt as aw,UI as ax,VI as ay,ds as az,Ame as b,Zq as b$,dge as b0,Ou as b1,op as b2,cge as b3,Qr as b4,aI as b5,yme as b6,ea as b7,CI as b8,uge as b9,ao as bA,$o as bB,R$ as bC,rge as bD,Ve as bE,AI as bF,$me as bG,TI as bH,Zme as bI,_e as bJ,Kme as bK,Sn as bL,mi as bM,ige as bN,yt as bO,Eme as bP,gn as bQ,eo as bR,Ege as bS,WV as bT,e3 as bU,$ge as bV,gq as bW,ay as bX,Ige as bY,m1 as bZ,Dge as b_,vme as ba,O as bb,xf as bc,Hme as bd,en as be,_me as bf,bme as bg,GC as bh,tge as bi,kme as bj,C as bk,ld as bl,vge as bm,hge as bn,l6 as bo,Nme as bp,Jme as bq,xI as br,gge as bs,Gme as bt,Lme as bu,ix as bv,up as bw,g6 as bx,Xx as by,Wv as bz,lge as c,Xq as c0,iy as c1,Qq as c2,Age as c3,cq as c4,xge as c5,Pp as c6,wge as c7,Yq as c8,GM as c9,Rge as ca,Sge as cb,Fge as cc,_1 as cd,qa as ce,k1 as cf,Hge as cg,Bge as ch,Mge as ci,Eo as cj,Cge as ck,Tge as cl,yq as cm,Pge as cn,b1 as co,y1 as cp,Oge as cq,_ge as cr,Lge as cs,Nge as ct,dt as cu,bge as cv,LA as cw,a8 as cx,ege as d,Vr as e,wme as f,Zr as g,u6 as h,Sme as i,xme as j,ii as k,od as l,vs as m,th as n,ur as o,fge as p,B as q,dp as r,ye as s,re as t,$ as u,x as v,b$ as w,Xme as x,k$ as y,w6 as z};
|