@dimi-agent/cli 0.4.4 → 0.5.1
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 +6648 -10909
- package/dist-web/assets/{CodeBlockNode-BL_lWHk1.js → CodeBlockNode-BaWzfCy0.js} +1 -1
- package/dist-web/assets/{DesignSystemView-Gp4T3sr4.js → DesignSystemView-Bb01YcYk.js} +1 -1
- package/dist-web/assets/{Tooltip-DsL7mF2H.js → Tooltip-S8S-9806.js} +1 -1
- package/dist-web/assets/{arc-CWKkAytd.js → arc-CJvKR1oC.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-BxQA87W8.js → architectureDiagram-3BPJPVTR-D0r4NgJY.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-Bv-uKykJ.js → blockDiagram-GPEHLZMM-CcVFv_et.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-BNwMmBwW.js → c4Diagram-AAUBKEIU-gMmJTN7c.js} +1 -1
- package/dist-web/assets/channel-DlP6phL9.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-D0o9LNEb.js → chunk-2J33WTMH-BZpxh0T1.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-C9DEPDT4.js → chunk-4BX2VUAB-NJfuQ9IP.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DM4XnM9f.js → chunk-55IACEB6-BKgkJoe-.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-Dky6n2gf.js → chunk-727SXJPM-DA5_3QvA.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-DjmnKhuo.js → chunk-AQP2D5EJ-DbJPlxYa.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-wkNtOdUv.js → chunk-FMBD7UC4-DDzZo5dG.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-Byh5s8MO.js → chunk-ND2GUHAM-BuOldrpx.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-C596rHAe.js → chunk-QZHKN3VN-B4kJPKe8.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-BsZqzmeE.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BsZqzmeE.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-B5CIST3j.js → cose-bilkent-S5V4N54A-DWk2qZTK.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-DQ2h_HWV.js → dagre-BM42HDAG-BfzrP96D.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-DcJgQFHi.js → diagram-2AECGRRQ-TGkTAtM-.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-CHeEjhiL.js → diagram-5GNKFQAL-T2-djOqO.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-CCF3txiw.js → diagram-KO2AKTUF--TEvFK3o.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-B5_nRmtD.js → diagram-LMA3HP47-Bp3C9QTX.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BdSBNBYS.js → diagram-OG6HWLK6-B9Jf7Zjz.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-CZ1Ubm9Y.js → erDiagram-TEJ5UH35-DofEbbkJ.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-C6eXPlWY.js → flowDiagram-I6XJVG4X-Bzb-pXgl.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-LvGiqVrM.js → ganttDiagram-6RSMTGT7-CZH_FJYt.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-D1ktH7c_.js → gitGraphDiagram-PVQCEYII-BflQ8SBJ.js} +1 -1
- package/dist-web/assets/{index-CXz8XYk1.css → index-HKPwTfaa.css} +1 -1
- package/dist-web/assets/index-Ia-ZUO2Z.js +337 -0
- package/dist-web/assets/{index10-ePz6DAnA.js → index10-cnUP9s6C.js} +1 -1
- package/dist-web/assets/{index11-wd1P4PGw.js → index11-Bndq68af.js} +1 -1
- package/dist-web/assets/{index5-D_56m6HR.js → index5-B1-fjW_m.js} +1 -1
- package/dist-web/assets/{index6-BiWLUsB3.js → index6-xetF8e8c.js} +1 -1
- package/dist-web/assets/{index7-DSRe_h5d.js → index7-CtaXn3W4.js} +1 -1
- package/dist-web/assets/{index8-C0MfrVDC.js → index8-d5uRV0AF.js} +1 -1
- package/dist-web/assets/{infoDiagram-5YYISTIA-C0KiosmZ.js → infoDiagram-5YYISTIA-B0gQEyYk.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-CGUCgDXm.js → ishikawaDiagram-YF4QCWOH-DA51LQsg.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-K-24gGZU.js → journeyDiagram-JHISSGLW-C0hOvJE-.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-DDKuz_xA.js → kanban-definition-UN3LZRKU-fQck3D0t.js} +1 -1
- package/dist-web/assets/{linear-DYKn_u2q.js → linear-ICCSqDsp.js} +1 -1
- package/dist-web/assets/{mermaid.core-oS_owI3c.js → mermaid.core-B_k0q1Z5.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-C0lJUdai.js → mindmap-definition-RKZ34NQL-DMytkbGB.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-DGCPaNkB.js → pieDiagram-4H26LBE5-Df6_JDYe.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-B3op7xS9.js → quadrantDiagram-W4KKPZXB-DNnSVq1-.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-xbfEgwL_.js → requirementDiagram-4Y6WPE33-B9O3pyZ5.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-3ff_V2pD.js → sankeyDiagram-5OEKKPKP-BfJ-To-P.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-C5YRTKoy.js → sequenceDiagram-3UESZ5HK-zK8EZ0hV.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-ltBPYPwO.js → stateDiagram-AJRCARHV-D8kyVPrY.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CnQhCLSR.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-BT-5Wtvy.js → timeline-definition-PNZ67QCA-nE5-ttgA.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-Tif-M9Km.js → vennDiagram-CIIHVFJN-bfmUW0Li.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-BMrzHc_f.js → vue.runtime.esm-bundler-CNUOXmj4.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-CqiBaH6C.js → wardley-L42UT6IY-CBG17PJg.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DfgCjyaL.js → wardleyDiagram-YWT4CUSO-djjE-wCw.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-DTwp2FCG.js → xychartDiagram-2RQKCTM6-CTGSlEc6.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +6 -6
- package/dist-web/assets/channel-B2QvGyDT.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Cc_V2QfH.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cc_V2QfH.js +0 -1
- package/dist-web/assets/index-DKIJmNQn.js +0 -337
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dl6LC5u9.js +0 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Bb01YcYk.js","assets/DesignSystemView-VV_44Ep3.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-BaWzfCy0.js","assets/safeRaf-DGuzXxDK.js","assets/index5-B1-fjW_m.js","assets/index11-Bndq68af.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 Gm(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Qt={},Hc=[],di=()=>{},q3=()=>!1,kf=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ym=e=>e.startsWith("onUpdate:"),Sn=Object.assign,dk=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},HN=Object.prototype.hasOwnProperty,fn=(e,t)=>HN.call(e,t),St=Array.isArray,Wc=e=>hu(e)==="[object Map]",Ua=e=>hu(e)==="[object Set]",Ux=e=>hu(e)==="[object Date]",WN=e=>hu(e)==="[object RegExp]",Dt=e=>typeof e=="function",Tn=e=>typeof e=="string",Xo=e=>typeof e=="symbol",pn=e=>e!==null&&typeof e=="object",fk=e=>(pn(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),j3=Object.prototype.toString,hu=e=>j3.call(e),zN=e=>hu(e).slice(8,-1),Zm=e=>hu(e)==="[object Object]",Xm=e=>Tn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Sa=Gm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qm=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},UN=/-\w/g,ks=Qm(e=>e.replace(UN,t=>t.slice(1).toUpperCase())),qN=/\B([A-Z])/g,Ao=Qm(e=>e.replace(qN,"-$1").toLowerCase()),Jm=Qm(e=>e.charAt(0).toUpperCase()+e.slice(1)),lp=Qm(e=>e?`on${Jm(e)}`:""),Bs=(e,t)=>!Object.is(e,t),zc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},V3=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},e1=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Lp=e=>{const t=Tn(e)?Number(e):NaN;return isNaN(t)?e:t};let qx;const t1=()=>qx||(qx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),jN="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",VN=Gm(jN);function Jt(e){if(St(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Tn(s)?ZN(s):Jt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Tn(e)||pn(e))return e}const KN=/;(?![^(]*\))/g,GN=/:([^]+)/,YN=/\/\*[^]*?\*\//g;function ZN(e){const t={};return e.replace(YN,"").split(KN).forEach(n=>{if(n){const s=n.split(GN);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function He(e){let t="";if(Tn(e))t=e;else if(St(e))for(let n=0;n<e.length;n++){const s=He(e[n]);s&&(t+=s+" ")}else if(pn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function XN(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Tn(t)&&(e.class=He(t)),n&&(e.style=Jt(n)),e}const QN="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",JN=Gm(QN);function K3(e){return!!e||e===""}function e9(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Lr(e[s],t[s]);return n}function Lr(e,t){if(e===t)return!0;let n=Ux(e),s=Ux(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Xo(e),s=Xo(t),n||s)return e===t;if(n=St(e),s=St(t),n||s)return n&&s?e9(e,t):!1;if(n=pn(e),s=pn(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||!Lr(e[r],t[r]))return!1}}return String(e)===String(t)}function n1(e,t){return e.findIndex(n=>Lr(n,t))}const G3=e=>!!(e&&e.__v_isRef===!0),B=e=>Tn(e)?e:e==null?"":St(e)||pn(e)&&(e.toString===j3||!Dt(e.toString))?G3(e)?B(e.value):JSON.stringify(e,Y3,2):String(e),Y3=(e,t)=>G3(t)?Y3(e,t.value):Wc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Z0(s,i)+" =>"]=o,n),{})}:Ua(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Z0(n))}:Xo(t)?Z0(t):pn(t)&&!St(t)&&!Zm(t)?String(t):t,Z0=(e,t="")=>{var n;return Xo(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function t9(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 ys;class Z3{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&&ys&&(ys.active?(this.parent=ys,this.index=(ys.scopes||(ys.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=ys;try{return ys=this,t()}finally{ys=n}}}on(){++this._on===1&&(this.prevScope=ys,ys=this)}off(){if(this._on>0&&--this._on===0){if(ys===this)ys=this.prevScope;else{let t=ys;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 n9(e){return new Z3(e)}function hk(){return ys}function bf(e,t=!1){ys&&ys.cleanups.push(e)}let Pn;const X0=new WeakSet;class $p{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,ys&&(ys.active?ys.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,X0.has(this)&&(X0.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Q3(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,jx(this),J3(this);const t=Pn,n=Ei;Pn=this,Ei=!0;try{return this.fn()}finally{eA(this),Pn=t,Ei=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gk(t);this.deps=this.depsTail=void 0,jx(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?X0.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Lv(this)&&this.run()}get dirty(){return Lv(this)}}let X3=0,wd,_d;function Q3(e,t=!1){if(e.flags|=8,t){e.next=_d,_d=e;return}e.next=wd,wd=e}function pk(){X3++}function mk(){if(--X3>0)return;if(_d){let t=_d;for(_d=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;wd;){let t=wd;for(wd=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 J3(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eA(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),gk(s),s9(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Lv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(tA(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function tA(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qd)||(e.globalVersion=qd,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Lv(e))))return;e.flags|=2;const t=e.dep,n=Pn,s=Ei;Pn=e,Ei=!0;try{J3(e);const o=e.fn(e._value);(t.version===0||Bs(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Pn=n,Ei=s,eA(e),e.flags&=-3}}function gk(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)gk(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function s9(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function XSe(e,t){e.effect instanceof $p&&(e=e.effect.fn);const n=new $p(e);t&&Sn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function QSe(e){e.effect.stop()}let Ei=!0;const nA=[];function $r(){nA.push(Ei),Ei=!1}function Fr(){const e=nA.pop();Ei=e===void 0?!0:e}function jx(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Pn;Pn=void 0;try{t()}finally{Pn=n}}}let qd=0;class o9{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 s1{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(!Pn||!Ei||Pn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Pn)n=this.activeLink=new o9(Pn,this),Pn.deps?(n.prevDep=Pn.depsTail,Pn.depsTail.nextDep=n,Pn.depsTail=n):Pn.deps=Pn.depsTail=n,sA(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=Pn.depsTail,n.nextDep=void 0,Pn.depsTail.nextDep=n,Pn.depsTail=n,Pn.deps===n&&(Pn.deps=s)}return n}trigger(t){this.version++,qd++,this.notify(t)}notify(t){pk();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{mk()}}}function sA(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)sA(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Fp=new WeakMap,Ca=Symbol(""),$v=Symbol(""),jd=Symbol("");function Ks(e,t,n){if(Ei&&Pn){let s=Fp.get(e);s||Fp.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new s1),o.map=s,o.key=n),o.track()}}function Cr(e,t,n,s,o,i){const r=Fp.get(e);if(!r){qd++;return}const l=a=>{a&&a.trigger()};if(pk(),t==="clear")r.forEach(l);else{const a=St(e),c=a&&Xm(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===jd||!Xo(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(jd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Ca)),Wc(e)&&l(r.get($v)));break;case"delete":a||(l(r.get(Ca)),Wc(e)&&l(r.get($v)));break;case"set":Wc(e)&&l(r.get(Ca));break}}mk()}function i9(e,t){const n=Fp.get(e);return n&&n.get(t)}function pc(e){const t=sn(e);return t===e?t:(Ks(t,"iterate",jd),Vo(e)?t:t.map(Ni))}function o1(e){return Ks(e=sn(e),"iterate",jd),e}function Ki(e,t){return Or(e)?iu(kl(e)?Ni(t):t):Ni(t)}const r9={__proto__:null,[Symbol.iterator](){return Q0(this,Symbol.iterator,e=>Ki(this,e))},concat(...e){return pc(this).concat(...e.map(t=>St(t)?pc(t):t))},entries(){return Q0(this,"entries",e=>(e[1]=Ki(this,e[1]),e))},every(e,t){return fr(this,"every",e,t,void 0,arguments)},filter(e,t){return fr(this,"filter",e,t,n=>n.map(s=>Ki(this,s)),arguments)},find(e,t){return fr(this,"find",e,t,n=>Ki(this,n),arguments)},findIndex(e,t){return fr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return fr(this,"findLast",e,t,n=>Ki(this,n),arguments)},findLastIndex(e,t){return fr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return fr(this,"forEach",e,t,void 0,arguments)},includes(...e){return J0(this,"includes",e)},indexOf(...e){return J0(this,"indexOf",e)},join(e){return pc(this).join(e)},lastIndexOf(...e){return J0(this,"lastIndexOf",e)},map(e,t){return fr(this,"map",e,t,void 0,arguments)},pop(){return Ku(this,"pop")},push(...e){return Ku(this,"push",e)},reduce(e,...t){return Vx(this,"reduce",e,t)},reduceRight(e,...t){return Vx(this,"reduceRight",e,t)},shift(){return Ku(this,"shift")},some(e,t){return fr(this,"some",e,t,void 0,arguments)},splice(...e){return Ku(this,"splice",e)},toReversed(){return pc(this).toReversed()},toSorted(e){return pc(this).toSorted(e)},toSpliced(...e){return pc(this).toSpliced(...e)},unshift(...e){return Ku(this,"unshift",e)},values(){return Q0(this,"values",e=>Ki(this,e))}};function Q0(e,t,n){const s=o1(e),o=s[t]();return s!==e&&!Vo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const l9=Array.prototype;function fr(e,t,n,s,o,i){const r=o1(e),l=r!==e&&!Vo(e),a=r[t];if(a!==l9[t]){const d=a.apply(e,i);return l?Ni(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Ki(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 Vx(e,t,n,s){const o=o1(e),i=o!==e&&!Vo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Ki(e,c)),n.call(this,c,Ki(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?Ki(e,a):a}function J0(e,t,n){const s=sn(e);Ks(s,"iterate",jd);const o=s[t](...n);return(o===-1||o===!1)&&l1(n[0])?(n[0]=sn(n[0]),s[t](...n)):o}function Ku(e,t,n=[]){$r(),pk();const s=sn(e)[t].apply(e,n);return mk(),Fr(),s}const a9=Gm("__proto__,__v_isRef,__isVue"),oA=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Xo));function c9(e){Xo(e)||(e=String(e));const t=sn(this);return Ks(t,"has",e),t.hasOwnProperty(e)}class iA{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?dA:uA:i?cA:aA).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=St(t);if(!o){let a;if(r&&(a=r9[n]))return a;if(n==="hasOwnProperty")return c9}const l=Reflect.get(t,n,ns(t)?t:s);if((Xo(n)?oA.has(n):a9(n))||(o||Ks(t,"get",n),i))return l;if(ns(l)){const a=r&&Xm(n)?l:l.value;return o&&pn(a)?Ov(a):a}return pn(l)?o?Ov(l):Ts(l):l}}class rA extends iA{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=St(t)&&Xm(n);if(!this._isShallow){const c=Or(i);if(!Vo(s)&&!Or(s)&&(i=sn(i),s=sn(s)),!r&&ns(i)&&!ns(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:fn(t,n),a=Reflect.set(t,n,s,ns(t)?t:o);return t===sn(o)&&(l?Bs(s,i)&&Cr(t,"set",n,s):Cr(t,"add",n,s)),a}deleteProperty(t,n){const s=fn(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Cr(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Xo(n)||!oA.has(n))&&Ks(t,"has",n),s}ownKeys(t){return Ks(t,"iterate",St(t)?"length":Ca),Reflect.ownKeys(t)}}class lA extends iA{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const u9=new rA,d9=new lA,f9=new rA(!0),h9=new lA(!0),Fv=e=>e,mh=e=>Reflect.getPrototypeOf(e);function p9(e,t,n){return function(...s){const o=this.__v_raw,i=sn(o),r=Wc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Fv:t?iu:Ni;return!t&&Ks(i,"iterate",a?$v:Ca),Sn(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 gh(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function m9(e,t){const n={get(o){const i=this.__v_raw,r=sn(i),l=sn(o);e||(Bs(o,l)&&Ks(r,"get",o),Ks(r,"get",l));const{has:a}=mh(r),c=t?Fv:e?iu:Ni;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&&Ks(sn(o),"iterate",Ca),o.size},has(o){const i=this.__v_raw,r=sn(i),l=sn(o);return e||(Bs(o,l)&&Ks(r,"has",o),Ks(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=sn(l),c=t?Fv:e?iu:Ni;return!e&&Ks(a,"iterate",Ca),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return Sn(n,e?{add:gh("add"),set:gh("set"),delete:gh("delete"),clear:gh("clear")}:{add(o){const i=sn(this),r=mh(i),l=sn(o),a=!t&&!Vo(o)&&!Or(o)?l:o;return r.has.call(i,a)||Bs(o,a)&&r.has.call(i,o)||Bs(l,a)&&r.has.call(i,l)||(i.add(a),Cr(i,"add",a,a)),this},set(o,i){!t&&!Vo(i)&&!Or(i)&&(i=sn(i));const r=sn(this),{has:l,get:a}=mh(r);let c=l.call(r,o);c||(o=sn(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Bs(i,u)&&Cr(r,"set",o,i):Cr(r,"add",o,i),this},delete(o){const i=sn(this),{has:r,get:l}=mh(i);let a=r.call(i,o);a||(o=sn(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Cr(i,"delete",o,void 0),c},clear(){const o=sn(this),i=o.size!==0,r=o.clear();return i&&Cr(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=p9(o,e,t)}),n}function i1(e,t){const n=m9(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(fn(n,o)&&o in s?n:s,o,i)}const g9={get:i1(!1,!1)},v9={get:i1(!1,!0)},y9={get:i1(!0,!1)},k9={get:i1(!0,!0)},aA=new WeakMap,cA=new WeakMap,uA=new WeakMap,dA=new WeakMap;function b9(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ts(e){return Or(e)?e:r1(e,!1,u9,g9,aA)}function x9(e){return r1(e,!1,f9,v9,cA)}function Ov(e){return r1(e,!0,d9,y9,uA)}function JSe(e){return r1(e,!0,h9,k9,dA)}function r1(e,t,n,s,o){if(!pn(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=b9(zN(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function kl(e){return Or(e)?kl(e.__v_raw):!!(e&&e.__v_isReactive)}function Or(e){return!!(e&&e.__v_isReadonly)}function Vo(e){return!!(e&&e.__v_isShallow)}function l1(e){return e?!!e.__v_raw:!1}function sn(e){const t=e&&e.__v_raw;return t?sn(t):e}function vt(e){return!fn(e,"__v_skip")&&Object.isExtensible(e)&&V3(e,"__v_skip",!0),e}const Ni=e=>pn(e)?Ts(e):e,iu=e=>pn(e)?Ov(e):e;function ns(e){return e?e.__v_isRef===!0:!1}function se(e){return fA(e,!1)}function tr(e){return fA(e,!0)}function fA(e,t){return ns(e)?e:new w9(e,t)}class w9{constructor(t,n){this.dep=new s1,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:sn(t),this._value=n?t:Ni(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Vo(t)||Or(t);t=s?t:sn(t),Bs(t,n)&&(this._rawValue=t,this._value=s?t:Ni(t),this.dep.trigger())}}function _9(e){e.dep&&e.dep.trigger()}function A(e){return ns(e)?e.value:e}function hA(e){return Dt(e)?e():A(e)}const S9={get:(e,t,n)=>t==="__v_raw"?e:A(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 pA(e){return kl(e)?e:new Proxy(e,S9)}class C9{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new s1,{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 A9(e){return new C9(e)}function eCe(e){const t=St(e)?new Array(e.length):{};for(const n in e)t[n]=mA(e,n);return t}class M9{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Xo(n)?n:String(n),this._raw=sn(t);let o=!0,i=t;if(!St(t)||Xo(this._key)||!Xm(this._key))do o=!l1(i)||Vo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=A(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&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 i9(this._raw,this._key)}}class E9{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 tCe(e,t,n){return ns(e)?e:Dt(e)?new E9(e):pn(e)&&arguments.length>1?mA(e,t,n):se(e)}function mA(e,t,n){return new M9(e,t,n)}class T9{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new s1(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Pn!==this)return Q3(this,!0),!0}get value(){const t=this.dep.track();return tA(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function N9(e,t,n=!1){let s,o;return Dt(e)?s=e:(s=e.get,o=e.set),new T9(s,o,n)}const nCe={GET:"get",HAS:"has",ITERATE:"iterate"},sCe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},vh={},Op=new WeakMap;let cl;function oCe(){return cl}function I9(e,t=!1,n=cl){if(n){let s=Op.get(n);s||Op.set(n,s=[]),s.push(e)}}function L9(e,t,n=Qt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=b=>o?b:Vo(b)||o===!1||o===0?Ar(b,1):Ar(b);let u,d,f,h,p=!1,m=!1;if(ns(e)?(d=()=>e.value,p=Vo(e)):kl(e)?(d=()=>c(e),p=!0):St(e)?(m=!0,p=e.some(b=>kl(b)||Vo(b)),d=()=>e.map(b=>{if(ns(b))return b.value;if(kl(b))return c(b);if(Dt(b))return a?a(b,2):b()})):Dt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){$r();try{f()}finally{Fr()}}const b=cl;cl=u;try{return a?a(e,3,[h]):e(h)}finally{cl=b}}:d=di,t&&o){const b=d,C=o===!0?1/0:o;d=()=>Ar(b(),C)}const y=hk(),k=()=>{u.stop(),y&&y.active&&dk(y.effects,u)};if(i&&t){const b=t;t=(...C)=>{b(...C),k()}}let g=m?new Array(e.length).fill(vh):vh;const v=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(t){const C=u.run();if(o||p||(m?C.some((I,T)=>Bs(I,g[T])):Bs(C,g))){f&&f();const I=cl;cl=u;try{const T=[C,g===vh?void 0:m&&g[0]===vh?[]:g,h];g=C,a?a(t,3,T):t(...T)}finally{cl=I}}}else u.run()};return l&&l(v),u=new $p(d),u.scheduler=r?()=>r(v,!1):v,h=b=>I9(b,!1,u),f=u.onStop=()=>{const b=Op.get(u);if(b){if(a)a(b,4);else for(const C of b)C();Op.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 Ar(e,t=1/0,n){if(t<=0||!pn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ns(e))Ar(e.value,t,n);else if(St(e))for(let s=0;s<e.length;s++)Ar(e[s],t,n);else if(Ua(e)||Wc(e))e.forEach(s=>{Ar(s,t,n)});else if(Zm(e)){for(const s in e)Ar(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ar(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 gA=[];function $9(e){gA.push(e)}function F9(){gA.pop()}function iCe(e,t){}const rCe={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"},O9={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 xf(e,t,n,s){try{return s?e(...s):e()}catch(o){pu(o,t,n)}}function pi(e,t,n,s){if(Dt(e)){const o=xf(e,t,n,s);return o&&fk(o)&&o.catch(i=>{pu(i,t,n)}),o}if(St(e)){const o=[];for(let i=0;i<e.length;i++)o.push(pi(e[i],t,n,s));return o}}function pu(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Qt;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){$r(),xf(i,null,10,[e,a,c]),Fr();return}}R9(e,n,o,s,r)}function R9(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const so=[];let qi=-1;const Uc=[];let ul=null,Sc=0;const vA=Promise.resolve();let Rp=null;function yt(e){const t=Rp||vA;return e?t.then(this?e.bind(this):e):t}function B9(e){let t=qi+1,n=so.length;for(;t<n;){const s=t+n>>>1,o=so[s],i=Vd(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function vk(e){if(!(e.flags&1)){const t=Vd(e),n=so[so.length-1];!n||!(e.flags&2)&&t>=Vd(n)?so.push(e):so.splice(B9(t),0,e),e.flags|=1,yA()}}function yA(){Rp||(Rp=vA.then(kA))}function Bp(e){St(e)?Uc.push(...e):ul&&e.id===-1?ul.splice(Sc+1,0,e):e.flags&1||(Uc.push(e),e.flags|=1),yA()}function Kx(e,t,n=qi+1){for(;n<so.length;n++){const s=so[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;so.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Dp(e){if(Uc.length){const t=[...new Set(Uc)].sort((n,s)=>Vd(n)-Vd(s));if(Uc.length=0,ul){ul.push(...t);return}for(ul=t,Sc=0;Sc<ul.length;Sc++){const n=ul[Sc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ul=null,Sc=0}}const Vd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function kA(e){try{for(qi=0;qi<so.length;qi++){const t=so[qi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),xf(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;qi<so.length;qi++){const t=so[qi];t&&(t.flags&=-2)}qi=-1,so.length=0,Dp(),Rp=null,(so.length||Uc.length)&&kA()}}let Cc,yh=[];function bA(e,t){var n,s;Cc=e,Cc?(Cc.enabled=!0,yh.forEach(({event:o,args:i})=>Cc.emit(o,...i)),yh=[]):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=>{bA(i,t)}),setTimeout(()=>{Cc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,yh=[])},3e3)):yh=[]}let Ps=null,a1=null;function Kd(e){const t=Ps;return Ps=e,a1=e&&e.type.__scopeId||null,t}function lCe(e){a1=e}function aCe(){a1=null}const cCe=e=>Fe;function Fe(e,t=Ps,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Up(-1);const i=Kd(t);let r;try{r=e(...o)}finally{Kd(i),s._d&&Up(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Fn(e,t){if(Ps===null)return e;const n=Cf(Ps),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Qt]=t[o];i&&(Dt(i)&&(i={mounted:i,updated:i}),i.deep&&Ar(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function ji(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&&($r(),pi(a,n,8,[e.el,l,e,t]),Fr())}}function wn(e,t){if(Ds){let n=Ds.provides;const s=Ds.parent&&Ds.parent.provides;s===n&&(n=Ds.provides=Object.create(s)),n[e]=t}}function jt(e,t,n=!1){const s=hs();if(s||Aa){let o=Aa?Aa._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&&Dt(t)?t.call(s&&s.proxy):t}}function uCe(){return!!(hs()||Aa)}const D9=Symbol.for("v-scx"),P9=()=>jt(D9);function xA(e,t){return wf(e,null,t)}function dCe(e,t){return wf(e,null,{flush:"post"})}function H9(e,t){return wf(e,null,{flush:"sync"})}function Je(e,t,n){return wf(e,t,n)}function wf(e,t,n=Qt){const{immediate:s,deep:o,flush:i,once:r}=n,l=Sn({},n),a=t&&s||!t&&i!=="post";let c;if($a){if(i==="sync"){const h=P9();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=di,h.resume=di,h.pause=di,h}}const u=Ds;l.call=(h,p,m)=>pi(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():vk(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=L9(e,t,l);return $a&&(c?c.push(f):a&&f()),f}function W9(e,t,n){const s=this.proxy,o=Tn(e)?e.includes(".")?wA(s,e):()=>s[e]:e.bind(s,s);let i;Dt(t)?i=t:(i=t.handler,n=t);const r=mu(this),l=wf(o,i.bind(s),n);return r(),l}function wA(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 rl=new WeakMap,_A=Symbol("_vte"),SA=e=>e.__isTeleport,da=e=>e&&(e.disabled||e.disabled===""),z9=e=>e&&(e.defer||e.defer===""),Gx=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Yx=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Rv=(e,t)=>{const n=e&&e.to;return Tn(n)?t?t(n):null:n},U9={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:y,parentNode:k}}=c,g=da(t.props);let{dynamicChildren:v}=t;const b=(T,M,$)=>{T.shapeFlag&16&&u(T.children,M,$,o,i,r,l,a)},C=(T=t)=>{const M=da(T.props),$=T.target=Rv(T.props,p),N=Bv($,T,m,h);$&&(r!=="svg"&&Gx($)?r="svg":r!=="mathml"&&Yx($)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add($),M||(b(T,$,N),ld(T,!1)))},I=T=>{const M=()=>{if(rl.get(T)===M){if(rl.delete(T),da(T.props)){const $=k(T.el)||n;b(T,$,T.anchor),ld(T,!0)}C(T)}};rl.set(T,M),rs(M,i)};if(e==null){const T=t.el=m(""),M=t.anchor=m("");if(h(T,n,s),h(M,n,s),z9(t.props)||i&&i.pendingBranch){I(t);return}g&&(b(t,n,M),ld(t,!0)),C()}else{t.el=e.el;const T=t.anchor=e.anchor,M=rl.get(e);if(M){M.flags|=8,rl.delete(e),I(t);return}t.targetStart=e.targetStart;const $=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=da(e.props),_=F?n:$,R=F?T:N;if(r==="svg"||Gx($)?r="svg":(r==="mathml"||Yx($))&&(r="mathml"),v?(f(e.dynamicChildren,v,_,o,i,r,l),Mk(e,t,!0)):a||d(e,t,_,R,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kh(t,n,T,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const z=t.target=Rv(t.props,p);z&&kh(t,z,null,c,0)}else F&&kh(t,$,N,c,1);ld(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||!da(f),p=rl.get(e);if(p&&(p.flags|=8,rl.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const y=l[m];s(y,t,n,h,!!y.dynamicChildren)}},move:kh,hydrate:q9};function kh(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),!rl.has(e)&&(!d||da(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function q9(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(y,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,y._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(y,k){k.anchor=d(r(y),k,l(y),n,s,o,i)}const p=t.target=Rv(t.props,a),m=da(t.props);if(p){const y=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,y),t.targetAnchor||Bv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,y),t.targetAnchor||Bv(p,t,u,c),d(y&&r(y),t,p,n,s,o,i))),ld(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const c1=U9;function ld(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 Bv(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[_A]=r,e&&(s(i,e,o),s(r,e,o)),r}const li=Symbol("_leaveCb"),Gu=Symbol("_enterCb");function CA(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return mn(()=>{e.isMounted=!0}),Qn(()=>{e.isUnmounting=!0}),e}const oi=[Function,Array],AA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:oi,onEnter:oi,onAfterEnter:oi,onEnterCancelled:oi,onBeforeLeave:oi,onLeave:oi,onAfterLeave:oi,onLeaveCancelled:oi,onBeforeAppear:oi,onAppear:oi,onAfterAppear:oi,onAppearCancelled:oi},MA=e=>{const t=e.subTree;return t.component?MA(t.component):t},j9={name:"BaseTransition",props:AA,setup(e,{slots:t}){const n=hs(),s=CA();return()=>{const o=t.default&&yk(t.default(),!0),i=o&&o.length?EA(o):n.subTree?ge():void 0;if(!i)return;const r=sn(e),{mode:l}=r;if(s.isLeaving)return eg(i);const a=Zx(i);if(!a)return eg(i);let c=Gd(a,r,s,n,d=>c=d);a.type!==cs&&Cl(a,c);let u=n.subTree&&Zx(n.subTree);if(u&&u.type!==cs&&!_i(u,a)&&MA(n).type!==cs){let d=Gd(u,r,s,n);if(Cl(u,d),l==="out-in"&&a.type!==cs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},eg(i);l==="in-out"&&a.type!==cs?d.delayLeave=(f,h,p)=>{const m=TA(s,u);m[String(u.key)]=u,f[li]=()=>{h(),f[li]=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 EA(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==cs){t=n;break}}return t}const V9=j9;function TA(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 Gd(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:y,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,b=String(e.key),C=TA(n,e),I=($,N)=>{$&&pi($,s,9,N)},T=($,N)=>{const F=N[1];I($,N),St($)?$.every(_=>_.length<=1)&&F():$.length<=1&&F()},M={mode:r,persisted:l,beforeEnter($){let N=a;if(!n.isMounted)if(i)N=y||a;else return;$[li]&&$[li](!0);const F=C[b];F&&_i(e,F)&&F.el[li]&&F.el[li](),I(N,[$])},enter($){if(C[b]===e)return;let N=c,F=u,_=d;if(!n.isMounted)if(i)N=k||c,F=g||u,_=v||d;else return;let R=!1;$[Gu]=W=>{R||(R=!0,W?I(_,[$]):I(F,[$]),M.delayedLeave&&M.delayedLeave(),$[Gu]=void 0)};const z=$[Gu].bind(null,!1);N?T(N,[$,z]):z()},leave($,N){const F=String(e.key);if($[Gu]&&$[Gu](!0),n.isUnmounting)return N();I(f,[$]);let _=!1;$[li]=z=>{_||(_=!0,N(),z?I(m,[$]):I(p,[$]),$[li]=void 0,C[F]===e&&delete C[F])};const R=$[li].bind(null,!1);C[F]=e,h?T(h,[$,R]):R()},clone($){const N=Gd($,t,n,s,o);return o&&o(N),N}};return M}function eg(e){if(_f(e))return e=Rr(e),e.children=null,e}function Zx(e){if(!_f(e))return SA(e.type)&&e.children?EA(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&&Dt(n.default))return n.default()}}function Cl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Cl(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 yk(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===De?(r.patchFlag&128&&o++,s=s.concat(yk(r.children,t,l))):(t||r.type!==cs)&&s.push(l!=null?Rr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Xe(e,t){return Dt(e)?Sn({name:e.name},t,{setup:e}):e}function fCe(){const e=hs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function kk(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function hCe(e){const t=hs(),n=tr(null);if(t){const o=t.refs===Qt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Xx(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Pp=new WeakMap;function qc(e,t,n,s,o=!1){if(St(e)){e.forEach((m,y)=>qc(m,t&&(St(t)?t[y]:t),n,s,o));return}if(Ir(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&qc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Cf(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Qt?l.refs={}:l.refs,d=l.setupState,f=sn(d),h=d===Qt?q3:m=>Xx(u,m)?!1:fn(f,m),p=(m,y)=>!(y&&Xx(u,y));if(c!=null&&c!==a){if(Qx(t),Tn(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(Dt(a))xf(a,l,12,[r,u]);else{const m=Tn(a),y=ns(a);if(m||y){const k=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)St(g)&&dk(g,i);else if(St(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)):y&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),Pp.delete(e)};g.id=-1,Pp.set(e,g),rs(g,n)}else Qx(e),k()}}}function Qx(e){const t=Pp.get(e);t&&(t.flags|=8,Pp.delete(e))}let Jx=!1;const mc=()=>{Jx||(console.error("Hydration completed but contains mismatches."),Jx=!0)},K9=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",G9=e=>e.namespaceURI.includes("MathML"),bh=e=>{if(e.nodeType===1){if(K9(e))return"svg";if(G9(e))return"mathml"}},Lc=e=>e.nodeType===8;function Y9(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,b)=>{if(!b.hasChildNodes()){n(null,v,b),Dp(),b._vnode=v;return}d(b.firstChild,v,null,null,null),Dp(),b._vnode=v},d=(v,b,C,I,T,M=!1)=>{M=M||!!b.dynamicChildren;const $=Lc(v)&&v.data==="[",N=()=>m(v,b,C,I,T,$),{type:F,ref:_,shapeFlag:R,patchFlag:z}=b;let W=v.nodeType;b.el=v,z===-2&&(M=!1,b.dynamicChildren=null);let L=null;switch(F){case bl:W!==3?b.children===""?(a(b.el=o(""),r(v),v),L=v):L=N():(v.data!==b.children&&(mc(),v.data=b.children),L=i(v));break;case cs:g(v)?(L=i(v),k(b.el=v.content.firstChild,v,C)):W!==8||$?L=N():L=i(v);break;case Vc:if($&&(v=i(v),W=v.nodeType),W===1||W===3){L=v;const O=!b.children.length;for(let q=0;q<b.staticCount;q++)O&&(b.children+=L.nodeType===1?L.outerHTML:L.data),q===b.staticCount-1&&(b.anchor=L),L=i(L);return $?i(L):L}else N();break;case De:$?L=p(v,b,C,I,T,M):L=N();break;default:if(R&1)(W!==1||b.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?L=N():L=f(v,b,C,I,T,M);else if(R&6){b.slotScopeIds=T;const O=r(v);if($?L=y(v):Lc(v)&&v.data==="teleport start"?L=y(v,v.data,"teleport end"):L=i(v),t(b,O,null,C,I,bh(O),M),Ir(b)&&!b.type.__asyncResolved){let q;$?(q=ve(De),q.anchor=L?L.previousSibling:O.lastChild):q=v.nodeType===3?tt(""):ve("div"),q.el=v,b.component.subTree=q}}else R&64?W!==8?L=N():L=b.type.hydrate(v,b,C,I,T,M,e,h):R&128&&(L=b.type.hydrate(v,b,C,I,bh(r(v)),T,M,e,d))}return _!=null&&qc(_,null,I,b),L},f=(v,b,C,I,T,M)=>{M=M||!!b.dynamicChildren;const{type:$,props:N,patchFlag:F,shapeFlag:_,dirs:R,transition:z}=b,W=$==="input"||$==="option";if(W||F!==-1){R&&ji(b,null,C,"created");let L=!1;if(g(v)){L=YA(null,z)&&C&&C.vnode.props&&C.vnode.props.appear;const q=v.content.firstChild;if(L){const X=q.getAttribute("class");X&&(q.$cls=X),z.beforeEnter(q)}k(q,v,C),b.el=v=q}if(_&16&&!(N&&(N.innerHTML||N.textContent))){let q=h(v.firstChild,b,v,C,I,T,M);for(q&&!xh(v,1)&&mc();q;){const X=q;q=q.nextSibling,l(X)}}else if(_&8){let q=b.children;q[0]===`
|
|
15
|
+
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(q=q.slice(1));const{textContent:X}=v;X!==q&&X!==q.replace(/\r\n|\r/g,`
|
|
16
|
+
`)&&(xh(v,0)||mc(),v.textContent=b.children)}if(N){if(W||!M||F&48){const q=v.tagName.includes("-");for(const X in N)(W&&(X.endsWith("value")||X==="indeterminate")||kf(X)&&!Sa(X)||X[0]==="."||q&&!Sa(X))&&s(v,X,null,N[X],void 0,C)}else if(N.onClick)s(v,"onClick",null,N.onClick,void 0,C);else if(F&4&&kl(N.style))for(const q in N.style)N.style[q]}let O;(O=N&&N.onVnodeBeforeMount)&&xo(O,C,b),R&&ji(b,null,C,"beforeMount"),((O=N&&N.onVnodeMounted)||R||L)&&JA(()=>{O&&xo(O,C,b),L&&z.enter(v),R&&ji(b,null,C,"mounted")},I)}return v.nextSibling},h=(v,b,C,I,T,M,$)=>{$=$||!!b.dynamicChildren;const N=b.children,F=N.length;let _=!1;for(let R=0;R<F;R++){const z=$?N[R]:N[R]=Co(N[R]),W=z.type===bl;v?(W&&!$&&R+1<F&&Co(N[R+1]).type===bl&&(a(o(v.data.slice(z.children.length)),C,i(v)),v.data=z.children),v=d(v,z,I,T,M,$)):W&&!z.children?a(z.el=o(""),C):(_||(_=!0,xh(C,1)||mc()),n(null,z,C,null,I,T,bh(C),M))}return v},p=(v,b,C,I,T,M)=>{const{slotScopeIds:$}=b;$&&(T=T?T.concat($):$);const N=r(v),F=h(i(v),b,N,C,I,T,M);return F&&Lc(F)&&F.data==="]"?i(b.anchor=F):(mc(),a(b.anchor=c("]"),N,F),F)},m=(v,b,C,I,T,M)=>{if(xh(v.parentElement,1)||mc(),b.el=null,M){const F=y(v);for(;;){const _=i(v);if(_&&_!==F)l(_);else break}}const $=i(v),N=r(v);return l(v),n(null,b,N,$,C,I,bh(N),T),C&&(C.vnode.el=b.el,f1(C,b.el)),$},y=(v,b="[",C="]")=>{let I=0;for(;v;)if(v=i(v),v&&Lc(v)&&(v.data===b&&I++,v.data===C)){if(I===0)return i(v);I--}return v},k=(v,b,C)=>{const I=b.parentNode;I&&I.replaceChild(v,b);let T=C;for(;T;)T.vnode.el===b&&(T.vnode.el=T.subTree.el=v),T=T.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const ew="data-allow-mismatch",Z9={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function xh(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ew);)e=e.parentElement;const n=e&&e.getAttribute(ew);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(Z9[t])}}const X9=t1().requestIdleCallback||(e=>setTimeout(e,1)),Q9=t1().cancelIdleCallback||(e=>clearTimeout(e)),pCe=(e=1e4)=>t=>{const n=X9(t,{timeout:e});return()=>Q9(n)};function J9(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 mCe=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(J9(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},gCe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},vCe=(e=[])=>(t,n)=>{Tn(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 eI(e,t){if(Lc(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Lc(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Ir=e=>!!e.type.__asyncLoader;function Ci(e){Dt(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((y,k)=>{a(m,()=>y(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 Xe({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,y){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||y()},v=i?()=>{const b=i(g,C=>eI(p,C));b&&(m.bum||(m.bum=[])).push(b)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Ds;if(kk(p),u)return()=>wh(u,p);const m=v=>{c=null,pu(v,p,13,!s)};if(l&&p.suspense||$a)return h().then(v=>()=>wh(v,p)).catch(v=>(m(v),()=>s?ve(s,{error:v}):null));const y=se(!1),k=se(),g=se(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!y.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),h().then(()=>{y.value=!0,p.parent&&_f(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(y.value&&u)return wh(u,p);if(k.value&&s)return ve(s,{error:k.value});if(n&&!g.value)return wh(n,p)}}})}function wh(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ve(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const _f=e=>e.type.__isKeepAlive,tI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=hs(),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,b,C,I)=>{const T=g.component;c(g,v,b,0,l),a(T.vnode,g,v,b,T,l,C,g.slotScopeIds,I),rs(()=>{T.isDeactivated=!1,T.a&&zc(T.a);const M=g.props&&g.props.onVnodeMounted;M&&xo(M,T.parent,g)},l)},s.deactivate=g=>{const v=g.component;Wp(v.m),Wp(v.a),c(g,f,null,1,l),rs(()=>{v.da&&zc(v.da);const b=g.props&&g.props.onVnodeUnmounted;b&&xo(b,v.parent,g),v.isDeactivated=!0},l)};function h(g){tg(g),u(g,n,l,!0)}function p(g){o.forEach((v,b)=>{const C=Vv(Ir(v)?v.type.__asyncResolved||{}:v.type);C&&!g(C)&&m(b)})}function m(g){const v=o.get(g);v&&(!r||!_i(v,r))?h(v):r&&tg(r),o.delete(g),i.delete(g)}Je(()=>[e.include,e.exclude],([g,v])=>{g&&p(b=>ad(g,b)),v&&p(b=>!ad(v,b))},{flush:"post",deep:!0});let y=null;const k=()=>{y!=null&&(zp(n.subTree.type)?rs(()=>{o.set(y,_h(n.subTree))},n.subTree.suspense):o.set(y,_h(n.subTree)))};return mn(k),bk(k),Qn(()=>{o.forEach(g=>{const{subTree:v,suspense:b}=n,C=_h(v);if(g.type===C.type&&g.key===C.key){tg(C);const I=C.component.da;I&&rs(I,b);return}h(g)})}),()=>{if(y=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Al(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let b=_h(v);if(b.type===cs)return r=null,b;const C=b.type,I=Vv(Ir(b)?b.type.__asyncResolved||{}:C),{include:T,exclude:M,max:$}=e;if(T&&(!I||!ad(T,I))||M&&I&&ad(M,I))return b.shapeFlag&=-257,r=b,v;const N=b.key==null?C:b.key,F=o.get(N);return b.el&&(b=Rr(b),v.shapeFlag&128&&(v.ssContent=b)),y=N,F?(b.el=F.el,b.component=F.component,b.transition&&Cl(b,b.transition),b.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),$&&i.size>parseInt($,10)&&m(i.values().next().value)),b.shapeFlag|=256,r=b,zp(v.type)?v:b}}},yCe=tI;function ad(e,t){return St(e)?e.some(n=>ad(n,t)):Tn(e)?e.split(",").includes(t):WN(e)?(e.lastIndex=0,e.test(t)):!1}function nI(e,t){NA(e,"a",t)}function sI(e,t){NA(e,"da",t)}function NA(e,t,n=Ds){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(u1(t,s,n),n){let o=n.parent;for(;o&&o.parent;)_f(o.parent.vnode)&&oI(s,t,n,o),o=o.parent}}function oI(e,t,n,s){const o=u1(t,e,s,!0);Cn(()=>{dk(s[t],o)},n)}function tg(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function _h(e){return e.shapeFlag&128?e.ssContent:e}function u1(e,t,n=Ds,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{$r();const l=mu(n),a=pi(t,n,e,r);return l(),Fr(),a});return s?o.unshift(i):o.push(i),i}}const Pr=e=>(t,n=Ds)=>{(!$a||e==="sp")&&u1(e,(...s)=>t(...s),n)},iI=Pr("bm"),mn=Pr("m"),IA=Pr("bu"),bk=Pr("u"),Qn=Pr("bum"),Cn=Pr("um"),rI=Pr("sp"),lI=Pr("rtg"),aI=Pr("rtc");function cI(e,t=Ds){u1("ec",e,t)}const xk="components",uI="directives";function dI(e,t){return wk(xk,e,!0,t)||e}const LA=Symbol.for("v-ndc");function Ms(e){return Tn(e)?wk(xk,e,!1)||e:e||LA}function kCe(e){return wk(uI,e)}function wk(e,t,n=!0,s=!1){const o=Ps||Ds;if(o){const i=o.type;if(e===xk){const l=Vv(i,!1);if(l&&(l===t||l===ks(t)||l===Jm(ks(t))))return i}const r=tw(o[e]||i[e],t)||tw(o.appContext[e],t);return!r&&s?i:r}}function tw(e,t){return e&&(e[t]||e[ks(t)]||e[Jm(ks(t))])}function rt(e,t,n,s){let o;const i=n&&n[s],r=St(e);if(r||Tn(e)){const l=r&&kl(e);let a=!1,c=!1;l&&(a=!Vo(e),c=Or(e),e=o1(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?iu(Ni(e[u])):Ni(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(pn(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 $A(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(St(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Rn(e,t,n={},s,o){if(Ps.ce||Ps.parent&&Ir(Ps.parent)&&Ps.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),Ae(De,null,[ve("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&_k(i(n)),l=n.key||r&&r.key,a=Ae(De,{key:(l&&!Xo(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 _k(e){return e.some(t=>Al(t)?!(t.type===cs||t.type===De&&!_k(t.children)):!0)?e:null}function bCe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:lp(s)]=e[s];return n}const Dv=e=>e?iM(e)?Cf(e):Dv(e.parent):null,Sd=Sn(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=>Dv(e.parent),$root:e=>Dv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Sk(e),$forceUpdate:e=>e.f||(e.f=()=>{vk(e.update)}),$nextTick:e=>e.n||(e.n=yt.bind(e.proxy)),$watch:e=>W9.bind(e)}),ng=(e,t)=>e!==Qt&&!e.__isScriptSetup&&fn(e,t),Pv={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(ng(s,t))return r[t]=1,s[t];if(o!==Qt&&fn(o,t))return r[t]=2,o[t];if(fn(i,t))return r[t]=3,i[t];if(n!==Qt&&fn(n,t))return r[t]=4,n[t];Hv&&(r[t]=0)}}const c=Sd[t];let u,d;if(c)return t==="$attrs"&&Ks(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Qt&&fn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,fn(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return ng(o,t)?(o[t]=n,!0):s!==Qt&&fn(s,t)?(s[t]=n,!0):fn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Qt&&l[0]!=="$"&&fn(e,l)||ng(t,l)||fn(i,l)||fn(s,l)||fn(Sd,l)||fn(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:fn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},fI=Sn({},Pv,{get(e,t){if(t!==Symbol.unscopables)return Pv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!VN(t)}});function xCe(){return null}function wCe(){return null}function _Ce(e){}function SCe(e){}function CCe(){return null}function ACe(){}function MCe(e,t){return null}function ECe(){return FA().slots}function Sf(){return FA().attrs}function FA(e){const t=hs();return t.setupContext||(t.setupContext=aM(t))}function Yd(e){return St(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function TCe(e,t){const n=Yd(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?St(o)||Dt(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 NCe(e,t){return!e||!t?e||t:St(e)&&St(t)?e.concat(t):Sn({},Yd(e),Yd(t))}function ICe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function LCe(e){const t=hs(),n=$a;let s=e();Xd(),n&&Kc(!1);const o=()=>{mu(t),n&&Kc(!0)},i=()=>{hs()!==t&&t.scope.off(),Xd(),n&&Kc(!1)};return fk(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let Hv=!0;function hI(e){const t=Sk(e),n=e.proxy,s=e.ctx;Hv=!1,t.beforeCreate&&nw(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:y,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:b,render:C,renderTracked:I,renderTriggered:T,errorCaptured:M,serverPrefetch:$,expose:N,inheritAttrs:F,components:_,directives:R,filters:z}=t;if(c&&pI(c,s,null),r)for(const O in r){const q=r[O];Dt(q)&&(s[O]=q.bind(n))}if(o){const O=o.call(n,n);pn(O)&&(e.data=Ts(O))}if(Hv=!0,i)for(const O in i){const q=i[O],X=Dt(q)?q.bind(n,n):Dt(q.get)?q.get.bind(n,n):di,ie=!Dt(q)&&Dt(q.set)?q.set.bind(n):di,U=D({get:X,set:ie});Object.defineProperty(s,O,{enumerable:!0,configurable:!0,get:()=>U.value,set:j=>U.value=j})}if(l)for(const O in l)OA(l[O],s,n,O);if(a){const O=Dt(a)?a.call(n):a;Reflect.ownKeys(O).forEach(q=>{wn(q,O[q])})}u&&nw(u,e,"c");function L(O,q){St(q)?q.forEach(X=>O(X.bind(n))):q&&O(q.bind(n))}if(L(iI,d),L(mn,f),L(IA,h),L(bk,p),L(nI,m),L(sI,y),L(cI,M),L(aI,I),L(lI,T),L(Qn,g),L(Cn,b),L(rI,$),St(N))if(N.length){const O=e.exposed||(e.exposed={});N.forEach(q=>{Object.defineProperty(O,q,{get:()=>n[q],set:X=>n[q]=X,enumerable:!0})})}else e.exposed||(e.exposed={});C&&e.render===di&&(e.render=C),F!=null&&(e.inheritAttrs=F),_&&(e.components=_),R&&(e.directives=R),$&&kk(e)}function pI(e,t,n=di){St(e)&&(e=Wv(e));for(const s in e){const o=e[s];let i;pn(o)?"default"in o?i=jt(o.from||s,o.default,!0):i=jt(o.from||s):i=jt(o),ns(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function nw(e,t,n){pi(St(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function OA(e,t,n,s){let o=s.includes(".")?wA(n,s):()=>n[s];if(Tn(e)){const i=t[e];Dt(i)&&Je(o,i)}else if(Dt(e))Je(o,e.bind(n));else if(pn(e))if(St(e))e.forEach(i=>OA(i,t,n,s));else{const i=Dt(e.handler)?e.handler.bind(n):t[e.handler];Dt(i)&&Je(o,i,e)}}function Sk(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=>Hp(a,c,r,!0)),Hp(a,t,r)),pn(t)&&i.set(t,a),a}function Hp(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Hp(e,i,n,!0),o&&o.forEach(r=>Hp(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=mI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const mI={data:sw,props:ow,emits:ow,methods:cd,computed:cd,beforeCreate:eo,created:eo,beforeMount:eo,mounted:eo,beforeUpdate:eo,updated:eo,beforeDestroy:eo,beforeUnmount:eo,destroyed:eo,unmounted:eo,activated:eo,deactivated:eo,errorCaptured:eo,serverPrefetch:eo,components:cd,directives:cd,watch:vI,provide:sw,inject:gI};function sw(e,t){return t?e?function(){return Sn(Dt(e)?e.call(this,this):e,Dt(t)?t.call(this,this):t)}:t:e}function gI(e,t){return cd(Wv(e),Wv(t))}function Wv(e){if(St(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function eo(e,t){return e?[...new Set([].concat(e,t))]:t}function cd(e,t){return e?Sn(Object.create(null),e,t):t}function ow(e,t){return e?St(e)&&St(t)?[...new Set([...e,...t])]:Sn(Object.create(null),Yd(e),Yd(t??{})):t}function vI(e,t){if(!e)return t;if(!t)return e;const n=Sn(Object.create(null),e);for(const s in t)n[s]=eo(e[s],t[s]);return n}function RA(){return{app:null,config:{isNativeTag:q3,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 yI=0;function kI(e,t){return function(s,o=null){Dt(s)||(s=Sn({},s)),o!=null&&!pn(o)&&(o=null);const i=RA(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:yI++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:GI,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Dt(u.install)?(r.add(u),u.install(c,...d)):Dt(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||ve(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,Cf(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(pi(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=Aa;Aa=c;try{return u()}finally{Aa=d}}};return c}}let Aa=null;function $Ce(e,t,n=Qt){const s=hs(),o=ks(t),i=Ao(t),r=BA(e,o),l=A9((a,c)=>{let u,d=Qt,f;return H9(()=>{const h=e[o];Bs(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(!Bs(p,u)&&!(d!==Qt&&Bs(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),Bs(h,p)&&Bs(h,d)&&!Bs(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Qt:l,done:!1}:{done:!0}}}},l}const BA=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ks(t)}Modifiers`]||e[`${Ao(t)}Modifiers`];function bI(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Qt;let o=n;const i=t.startsWith("update:"),r=i&&BA(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Tn(u)?u.trim():u)),r.number&&(o=n.map(e1)));let l,a=s[l=lp(t)]||s[l=lp(ks(t))];!a&&i&&(a=s[l=lp(Ao(t))]),a&&pi(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,pi(c,e,6,o)}}const xI=new WeakMap;function DA(e,t,n=!1){const s=n?xI:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!Dt(e)){const a=c=>{const u=DA(c,t,!0);u&&(l=!0,Sn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(pn(e)&&s.set(e,null),null):(St(i)?i.forEach(a=>r[a]=null):Sn(r,i),pn(e)&&s.set(e,r),r)}function d1(e,t){return!e||!kf(t)?!1:(t=t.slice(2).replace(/Once$/,""),fn(e,t[0].toLowerCase()+t.slice(1))||fn(e,Ao(t))||fn(e,t))}function ap(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,y=Kd(e);let k,g;try{if(n.shapeFlag&4){const b=o||s,C=b;k=Co(c.call(C,b,u,d,h,f,p)),g=l}else{const b=t;k=Co(b.length>1?b(d,{attrs:l,slots:r,emit:a}):b(d,null)),g=t.props?l:_I(l)}}catch(b){Cd.length=0,pu(b,e,1),k=ve(cs)}let v=k;if(g&&m!==!1){const b=Object.keys(g),{shapeFlag:C}=v;b.length&&C&7&&(i&&b.some(Ym)&&(g=SI(g,i)),v=Rr(v,g,!1,!0))}return n.dirs&&(v=Rr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Cl(v,n.transition),k=v,Kd(y),k}function wI(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Al(o)){if(o.type!==cs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const _I=e=>{let t;for(const n in e)(n==="class"||n==="style"||kf(n))&&((t||(t={}))[n]=e[n]);return t},SI=(e,t)=>{const n={};for(const s in e)(!Ym(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function CI(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?iw(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(PA(r,s,f)&&!d1(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?iw(s,r,c):!0:!!r;return!1}function iw(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(PA(t,e,i)&&!d1(n,i))return!0}return!1}function PA(e,t,n){const s=e[n],o=t[n];return n==="style"&&pn(s)&&pn(o)?!Lr(s,o):s!==o}function f1({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 HA={},WA=()=>Object.create(HA),zA=e=>Object.getPrototypeOf(e)===HA;function AI(e,t,n,s=!1){const o={},i=WA();e.propsDefaults=Object.create(null),UA(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:x9(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function MI(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=sn(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(d1(e.emitsOptions,f))continue;const h=t[f];if(a)if(fn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=ks(f);o[p]=zv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{UA(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!fn(t,d)&&((u=Ao(d))===d||!fn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=zv(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!fn(t,d))&&(delete i[d],c=!0)}c&&Cr(e.attrs,"set","")}function UA(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Sa(a))continue;const c=t[a];let u;o&&fn(o,u=ks(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:d1(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=sn(n),c=l||Qt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=zv(o,a,d,c[d],e,!fn(c,d))}}return r}function zv(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=fn(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Dt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=mu(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===Ao(n))&&(s=!0))}return s}const EI=new WeakMap;function qA(e,t,n=!1){const s=n?EI:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!Dt(e)){const u=d=>{a=!0;const[f,h]=qA(d,t,!0);Sn(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 pn(e)&&s.set(e,Hc),Hc;if(St(i))for(let u=0;u<i.length;u++){const d=ks(i[u]);rw(d)&&(r[d]=Qt)}else if(i)for(const u in i){const d=ks(u);if(rw(d)){const f=i[u],h=r[d]=St(f)||Dt(f)?{type:f}:Sn({},f),p=h.type;let m=!1,y=!0;if(St(p))for(let k=0;k<p.length;++k){const g=p[k],v=Dt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(y=!1)}else m=Dt(p)&&p.name==="Boolean";h[0]=m,h[1]=y,(m||fn(h,"default"))&&l.push(d)}}const c=[r,l];return pn(e)&&s.set(e,c),c}function rw(e){return e[0]!=="$"&&!Sa(e)}const Ck=e=>e==="_"||e==="_ctx"||e==="$stable",Ak=e=>St(e)?e.map(Co):[Co(e)],TI=(e,t,n)=>{if(t._n)return t;const s=Fe((...o)=>Ak(t(...o)),n);return s._c=!1,s},jA=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Ck(o))continue;const i=e[o];if(Dt(i))t[o]=TI(o,i,s);else if(i!=null){const r=Ak(i);t[o]=()=>r}}},VA=(e,t)=>{const n=Ak(t);e.slots.default=()=>n},KA=(e,t,n)=>{for(const s in t)(n||!Ck(s))&&(e[s]=t[s])},NI=(e,t,n)=>{const s=e.slots=WA();if(e.vnode.shapeFlag&32){const o=t._;o?(KA(s,t,n),n&&V3(s,"_",o,!0)):jA(t,s)}else t&&VA(e,t)},II=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Qt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:KA(o,t,n):(i=!t.$stable,jA(t,o)),r=t}else t&&(VA(e,t),r={default:1});if(i)for(const l in o)!Ck(l)&&r[l]==null&&delete o[l]},rs=JA;function LI(e){return GA(e)}function $I(e){return GA(e,Y9)}function GA(e,t){const n=t1();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=di,insertStaticContent:p}=e,m=(P,G,ye,he=null,fe=null,K=null,ne=void 0,me=null,we=!!G.dynamicChildren)=>{if(P===G)return;P&&!_i(P,G)&&(he=xe(P),j(P,fe,K,!0),P=null),G.patchFlag===-2&&(we=!1,G.dynamicChildren=null);const{type:Te,ref:Pe,shapeFlag:be}=G;switch(Te){case bl:y(P,G,ye,he);break;case cs:k(P,G,ye,he);break;case Vc:P==null&&g(G,ye,he,ne);break;case De:_(P,G,ye,he,fe,K,ne,me,we);break;default:be&1?C(P,G,ye,he,fe,K,ne,me,we):be&6?R(P,G,ye,he,fe,K,ne,me,we):(be&64||be&128)&&Te.process(P,G,ye,he,fe,K,ne,me,we,ue)}Pe!=null&&fe?qc(Pe,P&&P.ref,K,G||P,!G):Pe==null&&P&&P.ref!=null&&qc(P.ref,null,K,P,!0)},y=(P,G,ye,he)=>{if(P==null)s(G.el=l(G.children),ye,he);else{const fe=G.el=P.el;G.children!==P.children&&c(fe,G.children)}},k=(P,G,ye,he)=>{P==null?s(G.el=a(G.children||""),ye,he):G.el=P.el},g=(P,G,ye,he)=>{[P.el,P.anchor]=p(P.children,G,ye,he,P.el,P.anchor)},v=({el:P,anchor:G},ye,he)=>{let fe;for(;P&&P!==G;)fe=f(P),s(P,ye,he),P=fe;s(G,ye,he)},b=({el:P,anchor:G})=>{let ye;for(;P&&P!==G;)ye=f(P),o(P),P=ye;o(G)},C=(P,G,ye,he,fe,K,ne,me,we)=>{if(G.type==="svg"?ne="svg":G.type==="math"&&(ne="mathml"),P==null)I(G,ye,he,fe,K,ne,me,we);else{const Te=P.el&&P.el._isVueCE?P.el:null;try{Te&&Te._beginPatch(),$(P,G,fe,K,ne,me,we)}finally{Te&&Te._endPatch()}}},I=(P,G,ye,he,fe,K,ne,me)=>{let we,Te;const{props:Pe,shapeFlag:be,transition:_e,dirs:Ke}=P;if(we=P.el=r(P.type,K,Pe&&Pe.is,Pe),be&8?u(we,P.children):be&16&&M(P.children,we,null,he,fe,sg(P,K),ne,me),Ke&&ji(P,null,he,"created"),T(we,P,P.scopeId,ne,he),Pe){for(const ot in Pe)ot!=="value"&&!Sa(ot)&&i(we,ot,null,Pe[ot],K,he);"value"in Pe&&i(we,"value",null,Pe.value,K),(Te=Pe.onVnodeBeforeMount)&&xo(Te,he,P)}Ke&&ji(P,null,he,"beforeMount");const Qe=YA(fe,_e);Qe&&_e.beforeEnter(we),s(we,G,ye),((Te=Pe&&Pe.onVnodeMounted)||Qe||Ke)&&rs(()=>{try{Te&&xo(Te,he,P),Qe&&_e.enter(we),Ke&&ji(P,null,he,"mounted")}finally{}},fe)},T=(P,G,ye,he,fe)=>{if(ye&&h(P,ye),he)for(let K=0;K<he.length;K++)h(P,he[K]);if(fe){let K=fe.subTree;if(G===K||zp(K.type)&&(K.ssContent===G||K.ssFallback===G)){const ne=fe.vnode;T(P,ne,ne.scopeId,ne.slotScopeIds,fe.parent)}}},M=(P,G,ye,he,fe,K,ne,me,we=0)=>{for(let Te=we;Te<P.length;Te++){const Pe=P[Te]=me?_r(P[Te]):Co(P[Te]);m(null,Pe,G,ye,he,fe,K,ne,me)}},$=(P,G,ye,he,fe,K,ne)=>{const me=G.el=P.el;let{patchFlag:we,dynamicChildren:Te,dirs:Pe}=G;we|=P.patchFlag&16;const be=P.props||Qt,_e=G.props||Qt;let Ke;if(ye&&Ql(ye,!1),(Ke=_e.onVnodeBeforeUpdate)&&xo(Ke,ye,G,P),Pe&&ji(G,P,ye,"beforeUpdate"),ye&&Ql(ye,!0),(be.innerHTML&&_e.innerHTML==null||be.textContent&&_e.textContent==null)&&u(me,""),Te?N(P.dynamicChildren,Te,me,ye,he,sg(G,fe),K):ne||q(P,G,me,null,ye,he,sg(G,fe),K,!1),we>0){if(we&16)F(me,be,_e,ye,fe);else if(we&2&&be.class!==_e.class&&i(me,"class",null,_e.class,fe),we&4&&i(me,"style",be.style,_e.style,fe),we&8){const Qe=G.dynamicProps;for(let ot=0;ot<Qe.length;ot++){const at=Qe[ot],ht=be[at],Et=_e[at];(Et!==ht||at==="value")&&i(me,at,ht,Et,fe,ye)}}we&1&&P.children!==G.children&&u(me,G.children)}else!ne&&Te==null&&F(me,be,_e,ye,fe);((Ke=_e.onVnodeUpdated)||Pe)&&rs(()=>{Ke&&xo(Ke,ye,G,P),Pe&&ji(G,P,ye,"updated")},he)},N=(P,G,ye,he,fe,K,ne)=>{for(let me=0;me<G.length;me++){const we=P[me],Te=G[me],Pe=we.el&&(we.type===De||!_i(we,Te)||we.shapeFlag&198)?d(we.el):ye;m(we,Te,Pe,null,he,fe,K,ne,!0)}},F=(P,G,ye,he,fe)=>{if(G!==ye){if(G!==Qt)for(const K in G)!Sa(K)&&!(K in ye)&&i(P,K,G[K],null,fe,he);for(const K in ye){if(Sa(K))continue;const ne=ye[K],me=G[K];ne!==me&&K!=="value"&&i(P,K,me,ne,fe,he)}"value"in ye&&i(P,"value",G.value,ye.value,fe)}},_=(P,G,ye,he,fe,K,ne,me,we)=>{const Te=G.el=P?P.el:l(""),Pe=G.anchor=P?P.anchor:l("");let{patchFlag:be,dynamicChildren:_e,slotScopeIds:Ke}=G;Ke&&(me=me?me.concat(Ke):Ke),P==null?(s(Te,ye,he),s(Pe,ye,he),M(G.children||[],ye,Pe,fe,K,ne,me,we)):be>0&&be&64&&_e&&P.dynamicChildren&&P.dynamicChildren.length===_e.length?(N(P.dynamicChildren,_e,ye,fe,K,ne,me),(G.key!=null||fe&&G===fe.subTree)&&Mk(P,G,!0)):q(P,G,ye,Pe,fe,K,ne,me,we)},R=(P,G,ye,he,fe,K,ne,me,we)=>{G.slotScopeIds=me,P==null?G.shapeFlag&512?fe.ctx.activate(G,ye,he,ne,we):z(G,ye,he,fe,K,ne,we):W(P,G,we)},z=(P,G,ye,he,fe,K,ne)=>{const me=P.component=oM(P,he,fe);if(_f(P)&&(me.ctx.renderer=ue),rM(me,!1,ne),me.asyncDep){if(fe&&fe.registerDep(me,L,ne),!P.el){const we=me.subTree=ve(cs);k(null,we,G,ye),P.placeholder=we.el}}else L(me,P,G,ye,fe,K,ne)},W=(P,G,ye)=>{const he=G.component=P.component;if(CI(P,G,ye))if(he.asyncDep&&!he.asyncResolved){O(he,G,ye);return}else he.next=G,he.update();else G.el=P.el,he.vnode=G},L=(P,G,ye,he,fe,K,ne)=>{const me=()=>{if(P.isMounted){let{next:be,bu:_e,u:Ke,parent:Qe,vnode:ot}=P;{const $t=ZA(P);if($t){be&&(be.el=ot.el,O(P,be,ne)),$t.asyncDep.then(()=>{rs(()=>{P.isUnmounted||Te()},fe)});return}}let at=be,ht;Ql(P,!1),be?(be.el=ot.el,O(P,be,ne)):be=ot,_e&&zc(_e),(ht=be.props&&be.props.onVnodeBeforeUpdate)&&xo(ht,Qe,be,ot),Ql(P,!0);const Et=ap(P),Tt=P.subTree;P.subTree=Et,m(Tt,Et,d(Tt.el),xe(Tt),P,fe,K),be.el=Et.el,at===null&&f1(P,Et.el),Ke&&rs(Ke,fe),(ht=be.props&&be.props.onVnodeUpdated)&&rs(()=>xo(ht,Qe,be,ot),fe)}else{let be;const{el:_e,props:Ke}=G,{bm:Qe,m:ot,parent:at,root:ht,type:Et}=P,Tt=Ir(G);if(Ql(P,!1),Qe&&zc(Qe),!Tt&&(be=Ke&&Ke.onVnodeBeforeMount)&&xo(be,at,G),Ql(P,!0),_e&&Q){const $t=()=>{P.subTree=ap(P),Q(_e,P.subTree,P,fe,null)};Tt&&Et.__asyncHydrate?Et.__asyncHydrate(_e,P,$t):$t()}else{ht.ce&&ht.ce._hasShadowRoot()&&ht.ce._injectChildStyle(Et,P.parent?P.parent.type:void 0);const $t=P.subTree=ap(P);m(null,$t,ye,he,P,fe,K),G.el=$t.el}if(ot&&rs(ot,fe),!Tt&&(be=Ke&&Ke.onVnodeMounted)){const $t=G;rs(()=>xo(be,at,$t),fe)}(G.shapeFlag&256||at&&Ir(at.vnode)&&at.vnode.shapeFlag&256)&&P.a&&rs(P.a,fe),P.isMounted=!0,G=ye=he=null}};P.scope.on();const we=P.effect=new $p(me);P.scope.off();const Te=P.update=we.run.bind(we),Pe=P.job=we.runIfDirty.bind(we);Pe.i=P,Pe.id=P.uid,we.scheduler=()=>vk(Pe),Ql(P,!0),Te()},O=(P,G,ye)=>{G.component=P;const he=P.vnode.props;P.vnode=G,P.next=null,MI(P,G.props,he,ye),II(P,G.children,ye),$r(),Kx(P),Fr()},q=(P,G,ye,he,fe,K,ne,me,we=!1)=>{const Te=P&&P.children,Pe=P?P.shapeFlag:0,be=G.children,{patchFlag:_e,shapeFlag:Ke}=G;if(_e>0){if(_e&128){ie(Te,be,ye,he,fe,K,ne,me,we);return}else if(_e&256){X(Te,be,ye,he,fe,K,ne,me,we);return}}Ke&8?(Pe&16&&re(Te,fe,K),be!==Te&&u(ye,be)):Pe&16?Ke&16?ie(Te,be,ye,he,fe,K,ne,me,we):re(Te,fe,K,!0):(Pe&8&&u(ye,""),Ke&16&&M(be,ye,he,fe,K,ne,me,we))},X=(P,G,ye,he,fe,K,ne,me,we)=>{P=P||Hc,G=G||Hc;const Te=P.length,Pe=G.length,be=Math.min(Te,Pe);let _e;for(_e=0;_e<be;_e++){const Ke=G[_e]=we?_r(G[_e]):Co(G[_e]);m(P[_e],Ke,ye,null,fe,K,ne,me,we)}Te>Pe?re(P,fe,K,!0,!1,be):M(G,ye,he,fe,K,ne,me,we,be)},ie=(P,G,ye,he,fe,K,ne,me,we)=>{let Te=0;const Pe=G.length;let be=P.length-1,_e=Pe-1;for(;Te<=be&&Te<=_e;){const Ke=P[Te],Qe=G[Te]=we?_r(G[Te]):Co(G[Te]);if(_i(Ke,Qe))m(Ke,Qe,ye,null,fe,K,ne,me,we);else break;Te++}for(;Te<=be&&Te<=_e;){const Ke=P[be],Qe=G[_e]=we?_r(G[_e]):Co(G[_e]);if(_i(Ke,Qe))m(Ke,Qe,ye,null,fe,K,ne,me,we);else break;be--,_e--}if(Te>be){if(Te<=_e){const Ke=_e+1,Qe=Ke<Pe?G[Ke].el:he;for(;Te<=_e;)m(null,G[Te]=we?_r(G[Te]):Co(G[Te]),ye,Qe,fe,K,ne,me,we),Te++}}else if(Te>_e)for(;Te<=be;)j(P[Te],fe,K,!0),Te++;else{const Ke=Te,Qe=Te,ot=new Map;for(Te=Qe;Te<=_e;Te++){const Ht=G[Te]=we?_r(G[Te]):Co(G[Te]);Ht.key!=null&&ot.set(Ht.key,Te)}let at,ht=0;const Et=_e-Qe+1;let Tt=!1,$t=0;const rn=new Array(Et);for(Te=0;Te<Et;Te++)rn[Te]=0;for(Te=Ke;Te<=be;Te++){const Ht=P[Te];if(ht>=Et){j(Ht,fe,K,!0);continue}let Zt;if(Ht.key!=null)Zt=ot.get(Ht.key);else for(at=Qe;at<=_e;at++)if(rn[at-Qe]===0&&_i(Ht,G[at])){Zt=at;break}Zt===void 0?j(Ht,fe,K,!0):(rn[Zt-Qe]=Te+1,Zt>=$t?$t=Zt:Tt=!0,m(Ht,G[Zt],ye,null,fe,K,ne,me,we),ht++)}const vn=Tt?FI(rn):Hc;for(at=vn.length-1,Te=Et-1;Te>=0;Te--){const Ht=Qe+Te,Zt=G[Ht],tn=G[Ht+1],Gt=Ht+1<Pe?tn.el||XA(tn):he;rn[Te]===0?m(null,Zt,ye,Gt,fe,K,ne,me,we):Tt&&(at<0||Te!==vn[at]?U(Zt,ye,Gt,2):at--)}}},U=(P,G,ye,he,fe=null)=>{const{el:K,type:ne,transition:me,children:we,shapeFlag:Te}=P;if(Te&6){U(P.component.subTree,G,ye,he);return}if(Te&128){P.suspense.move(G,ye,he);return}if(Te&64){ne.move(P,G,ye,ue);return}if(ne===De){s(K,G,ye);for(let be=0;be<we.length;be++)U(we[be],G,ye,he);s(P.anchor,G,ye);return}if(ne===Vc){v(P,G,ye);return}if(he!==2&&Te&1&&me)if(he===0)me.persisted&&!K[li]?s(K,G,ye):(me.beforeEnter(K),s(K,G,ye),rs(()=>me.enter(K),fe));else{const{leave:be,delayLeave:_e,afterLeave:Ke}=me,Qe=()=>{P.ctx.isUnmounted?o(K):s(K,G,ye)},ot=()=>{const at=K._isLeaving||!!K[li];K._isLeaving&&K[li](!0),me.persisted&&!at?Qe():be(K,()=>{Qe(),Ke&&Ke()})};_e?_e(K,Qe,ot):ot()}else s(K,G,ye)},j=(P,G,ye,he=!1,fe=!1)=>{const{type:K,props:ne,ref:me,children:we,dynamicChildren:Te,shapeFlag:Pe,patchFlag:be,dirs:_e,cacheIndex:Ke,memo:Qe}=P;if(be===-2&&(fe=!1),me!=null&&($r(),qc(me,null,ye,P,!0),Fr()),Ke!=null&&(G.renderCache[Ke]=void 0),Pe&256){G.ctx.deactivate(P);return}const ot=Pe&1&&_e,at=!Ir(P);let ht;if(at&&(ht=ne&&ne.onVnodeBeforeUnmount)&&xo(ht,G,P),Pe&6)oe(P.component,ye,he);else{if(Pe&128){P.suspense.unmount(ye,he);return}ot&&ji(P,null,G,"beforeUnmount"),Pe&64?P.type.remove(P,G,ye,ue,he):Te&&!Te.hasOnce&&(K!==De||be>0&&be&64)?re(Te,G,ye,!1,!0):(K===De&&be&384||!fe&&Pe&16)&&re(we,G,ye),he&&te(P)}const Et=Qe!=null&&Ke==null;(at&&(ht=ne&&ne.onVnodeUnmounted)||ot||Et)&&rs(()=>{ht&&xo(ht,G,P),ot&&ji(P,null,G,"unmounted"),Et&&(P.el=null)},ye)},te=P=>{const{type:G,el:ye,anchor:he,transition:fe}=P;if(G===De){ae(ye,he);return}if(G===Vc){b(P);return}const K=()=>{o(ye),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(P.shapeFlag&1&&fe&&!fe.persisted){const{leave:ne,delayLeave:me}=fe,we=()=>ne(ye,K);me?me(P.el,K,we):we()}else K()},ae=(P,G)=>{let ye;for(;P!==G;)ye=f(P),o(P),P=ye;o(G)},oe=(P,G,ye)=>{const{bum:he,scope:fe,job:K,subTree:ne,um:me,m:we,a:Te}=P;Wp(we),Wp(Te),he&&zc(he),fe.stop(),K&&(K.flags|=8,j(ne,P,G,ye)),me&&rs(me,G),rs(()=>{P.isUnmounted=!0},G)},re=(P,G,ye,he=!1,fe=!1,K=0)=>{for(let ne=K;ne<P.length;ne++)j(P[ne],G,ye,he,fe)},xe=P=>{if(P.shapeFlag&6)return xe(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const G=f(P.anchor||P.el),ye=G&&G[_A];return ye?f(ye):G};let pe=!1;const Ee=(P,G,ye)=>{let he;P==null?G._vnode&&(j(G._vnode,null,null,!0),he=G._vnode.component):m(G._vnode||null,P,G,null,null,null,ye),G._vnode=P,pe||(pe=!0,Kx(he),Dp(),pe=!1)},ue={p:m,um:j,m:U,r:te,mt:z,mc:M,pc:q,pbc:N,n:xe,o:e};let Y,Q;return t&&([Y,Q]=t(ue)),{render:Ee,hydrate:Y,createApp:kI(Ee,Y)}}function sg({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 Ql({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function YA(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Mk(e,t,n=!1){const s=e.children,o=t.children;if(St(s)&&St(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]=_r(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Mk(r,l)),l.type===bl&&(l.patchFlag===-1&&(l=o[i]=_r(l)),l.el=r.el),l.type===cs&&!l.el&&(l.el=r.el)}}function FI(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 ZA(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ZA(t)}function Wp(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function XA(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?XA(t.subTree):null}const zp=e=>e.__isSuspense;let Uv=0;const OI={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)RI(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}BI(e,t,n,s,o,r,l,a,c)}},hydrate:DI,normalize:PI},FCe=OI;function Zd(e,t){const n=e.props&&e.props[t];Dt(n)&&n()}function RI(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=QA(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?(Zd(e,"onPending"),Zd(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),jc(f,e.ssFallback)):f.resolve(!1,!0)}function BI(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:y,isHydrating:k}=d;if(m)d.pendingBranch=f,_i(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():y&&(k||(a(p,h,n,s,o,null,i,r,l),jc(d,h)))):(d.pendingId=Uv++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(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),jc(d,h))):p&&_i(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&&_i(p,f))a(p,f,n,s,o,d,i,r,l),jc(d,f);else if(Zd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Uv++,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 QA(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:y}}=c;let k;const g=HI(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?Lp(e.props.timeout):void 0,b=i,C={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Uv++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(I=!1,T=!1){const{vnode:M,activeBranch:$,pendingBranch:N,pendingId:F,effects:_,parentComponent:R,container:z,isInFallback:W}=C;let L=!1;if(C.isHydrating)C.isHydrating=!1;else if(!I){L=$&&N.transition&&N.transition.mode==="out-in";let X=!1;L&&($.transition.afterLeave=()=>{F===C.pendingId&&(f(N,z,i===b&&!X?p($):i,0),Bp(_),W&&M.ssFallback&&(M.ssFallback.el=null))}),$&&!C.isFallbackMountPending&&(m($.el)===z&&(i=p($),X=!0),h($,R,C,!0),!L&&W&&M.ssFallback&&rs(()=>M.ssFallback.el=null,C)),L||f(N,z,i,0)}C.isFallbackMountPending=!1,jc(C,N),C.pendingBranch=null,C.isInFallback=!1;let O=C.parent,q=!1;for(;O;){if(O.pendingBranch){O.effects.push(..._),q=!0;break}O=O.parent}!q&&!L&&Bp(_),C.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!T&&t.resolve()),Zd(M,"onResolve")},fallback(I){if(!C.pendingBranch)return;const{vnode:T,activeBranch:M,parentComponent:$,container:N,namespace:F}=C;Zd(T,"onFallback");const _=p(M),R=()=>{C.isFallbackMountPending=!1,C.isInFallback&&(d(null,I,N,_,$,null,F,l,a),jc(C,I))},z=I.transition&&I.transition.mode==="out-in";z&&(C.isFallbackMountPending=!0,M.transition.afterLeave=R),C.isInFallback=!0,h(M,$,null,!0),z||R()},move(I,T,M){C.activeBranch&&f(C.activeBranch,I,T,M),C.container=I},next(){return C.activeBranch&&p(C.activeBranch)},registerDep(I,T,M){const $=!!C.pendingBranch;$&&C.deps++;const N=I.vnode.el;I.asyncDep.catch(F=>{pu(F,I,0)}).then(F=>{if(I.isUnmounted||C.isUnmounted||C.pendingId!==I.suspenseId)return;Xd(),I.asyncResolved=!0;const{vnode:_}=I;qv(I,F,!1),N&&(_.el=N);const R=!N&&I.subTree.el;T(I,_,m(N||I.subTree.el),N?null:p(I.subTree),C,r,M),R&&(_.placeholder=null,y(R)),f1(I,_.el),$&&--C.deps===0&&C.resolve()})},unmount(I,T){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,I,T),C.pendingBranch&&h(C.pendingBranch,n,I,T)}};return C}function DI(e,t,n,s,o,i,r,l,a){const c=t.suspense=QA(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 PI(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=lw(s?n.default:n),e.ssFallback=s?lw(n.fallback):ve(cs)}function lw(e){let t;if(Dt(e)){const n=La&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=Gs,eM())}return St(e)&&(e=wI(e)),e=Co(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function JA(e,t){t&&t.pendingBranch?St(e)?t.effects.push(...e):t.effects.push(e):Bp(e)}function jc(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,f1(s,o))}function HI(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const De=Symbol.for("v-fgt"),bl=Symbol.for("v-txt"),cs=Symbol.for("v-cmt"),Vc=Symbol.for("v-stc"),Cd=[];let Gs=null;function x(e=!1){Cd.push(Gs=e?null:[])}function eM(){Cd.pop(),Gs=Cd[Cd.length-1]||null}let La=1;function Up(e,t=!1){La+=e,e<0&&Gs&&t&&(Gs.hasOnce=!0)}function tM(e){return e.dynamicChildren=La>0?Gs||Hc:null,eM(),La>0&&Gs&&Gs.push(e),e}function E(e,t,n,s,o,i){return tM(S(e,t,n,s,o,i,!0))}function Ae(e,t,n,s,o){return tM(ve(e,t,n,s,o,!0))}function Al(e){return e?e.__v_isVNode===!0:!1}function _i(e,t){return e.type===t.type&&e.key===t.key}function OCe(e){}const nM=({key:e})=>e??null,cp=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Tn(e)||ns(e)||Dt(e)?{i:Ps,r:e,k:t,f:!!n}:e:null);function S(e,t=null,n=null,s=0,o=null,i=e===De?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&nM(t),ref:t&&cp(t),scopeId:a1,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?(Tk(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Tn(n)?8:16),La>0&&!r&&Gs&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Gs.push(a),a}const ve=WI;function WI(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===LA)&&(e=cs),Al(e)){const l=Rr(e,t,!0);return n&&Tk(l,n),La>0&&!i&&Gs&&(l.shapeFlag&6?Gs[Gs.indexOf(e)]=l:Gs.push(l)),l.patchFlag=-2,l}if(VI(e)&&(e=e.__vccOpts),t){t=sM(t);let{class:l,style:a}=t;l&&!Tn(l)&&(t.class=He(l)),pn(a)&&(l1(a)&&!St(a)&&(a=Sn({},a)),t.style=Jt(a))}const r=Tn(e)?1:zp(e)?128:SA(e)?64:pn(e)?4:Dt(e)?2:0;return S(e,t,n,s,o,r,i,!0)}function sM(e){return e?l1(e)||zA(e)?Sn({},e):e:null}function Rr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?hn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&nM(c),ref:t&&t.ref?n&&i?St(i)?i.concat(cp(t)):[i,cp(t)]:cp(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!==De?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&&Rr(e.ssContent),ssFallback:e.ssFallback&&Rr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Cl(u,a.clone(u)),u}function tt(e=" ",t=0){return ve(bl,null,e,t)}function Ek(e,t){const n=ve(Vc,null,e);return n.staticCount=t,n}function ge(e="",t=!1){return t?(x(),Ae(cs,null,e)):ve(cs,null,e)}function Co(e){return e==null||typeof e=="boolean"?ve(cs):St(e)?ve(De,null,e.slice()):Al(e)?_r(e):ve(bl,null,String(e))}function _r(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Rr(e)}function Tk(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(St(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Tk(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!zA(t)?t._ctx=Ps:o===3&&Ps&&(Ps.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Dt(t)?(t={default:t,_ctx:Ps},n=32):(t=String(t),s&64?(n=16,t=[tt(t)]):n=8);e.children=t,e.shapeFlag|=n}function hn(...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=He([t.class,s.class]));else if(o==="style")t.style=Jt([t.style,s.style]);else if(kf(o)){const i=t[o],r=s[o];r&&i!==r&&!(St(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Ym(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function xo(e,t,n,s=null){pi(e,t,7,[n,s])}const zI=RA();let UI=0;function oM(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||zI,i={uid:UI++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Z3(!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:qA(s,o),emitsOptions:DA(s,o),emit:null,emitted:null,propsDefaults:Qt,inheritAttrs:s.inheritAttrs,ctx:Qt,data:Qt,props:Qt,attrs:Qt,slots:Qt,refs:Qt,setupState:Qt,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=bI.bind(null,i),e.ce&&e.ce(i),i}let Ds=null;const hs=()=>Ds||Ps;let qp,Kc;{const e=t1(),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)}};qp=t("__VUE_INSTANCE_SETTERS__",n=>Ds=n),Kc=t("__VUE_SSR_SETTERS__",n=>$a=n)}const mu=e=>{const t=Ds;return qp(e),e.scope.on(),()=>{e.scope.off(),qp(t)}},Xd=()=>{Ds&&Ds.scope.off(),qp(null)};function iM(e){return e.vnode.shapeFlag&4}let $a=!1;function rM(e,t=!1,n=!1){t&&Kc(t);const{props:s,children:o}=e.vnode,i=iM(e);AI(e,s,i,t),NI(e,o,n||t);const r=i?qI(e,t):void 0;return t&&Kc(!1),r}function qI(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Pv);const{setup:s}=n;if(s){$r();const o=e.setupContext=s.length>1?aM(e):null,i=mu(e),r=xf(s,e,0,[e.props,o]),l=fk(r);if(Fr(),i(),(l||e.sp)&&!Ir(e)&&kk(e),l){if(r.then(Xd,Xd),t)return r.then(a=>{qv(e,a,t)}).catch(a=>{pu(a,e,0)});e.asyncDep=r}else qv(e,r,t)}else lM(e,t)}function qv(e,t,n){Dt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pn(t)&&(e.setupState=pA(t)),lM(e,n)}let jp,jv;function RCe(e){jp=e,jv=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,fI))}}const BCe=()=>!jp;function lM(e,t,n){const s=e.type;if(!e.render){if(!t&&jp&&!s.render){const o=s.template||Sk(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=Sn(Sn({isCustomElement:i,delimiters:l},r),a);s.render=jp(o,c)}}e.render=s.render||di,jv&&jv(e)}{const o=mu(e);$r();try{hI(e)}finally{Fr(),o()}}}const jI={get(e,t){return Ks(e,"get",""),e[t]}};function aM(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,jI),slots:e.slots,emit:e.emit,expose:t}}function Cf(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(pA(vt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Sd)return Sd[n](e)},has(t,n){return n in t||n in Sd}})):e.proxy}function Vv(e,t=!0){return Dt(e)?e.displayName||e.name:e.name||t&&e.__name}function VI(e){return Dt(e)&&"__vccOpts"in e}const D=(e,t)=>N9(e,t,$a);function Ft(e,t,n){try{Up(-1);const s=arguments.length;return s===2?pn(t)&&!St(t)?Al(t)?ve(e,null,[t]):ve(e,t):ve(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Al(n)&&(n=[n]),ve(e,t,n))}finally{Up(1)}}function DCe(){}function PCe(e,t,n,s){const o=n[s];if(o&&KI(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function KI(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Bs(n[s],t[s]))return!1;return La>0&&Gs&&Gs.push(e),!0}const GI="3.5.35",HCe=di,WCe=O9,zCe=Cc,UCe=bA,YI={createComponentInstance:oM,setupComponent:rM,renderComponentRoot:ap,setCurrentRenderingInstance:Kd,isVNode:Al,normalizeVNode:Co,getComponentPublicInstance:Cf,ensureValidVNode:_k,pushWarningContext:$9,popWarningContext:F9},qCe=YI,jCe=null,VCe=null,KCe=null;/**
|
|
17
|
+
* @vue/runtime-dom v3.5.35
|
|
18
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
+
* @license MIT
|
|
20
|
+
**/let Kv;const aw=typeof window<"u"&&window.trustedTypes;if(aw)try{Kv=aw.createPolicy("vue",{createHTML:e=>e})}catch{}const cM=Kv?e=>Kv.createHTML(e):e=>e,ZI="http://www.w3.org/2000/svg",XI="http://www.w3.org/1998/Math/MathML",yr=typeof document<"u"?document:null,cw=yr&&yr.createElement("template"),QI={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"?yr.createElementNS(ZI,e):t==="mathml"?yr.createElementNS(XI,e):n?yr.createElement(e,{is:n}):yr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>yr.createTextNode(e),createComment:e=>yr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yr.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{cw.innerHTML=cM(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=cw.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]}},Qr="transition",Yu="animation",ru=Symbol("_vtc"),uM={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},dM=Sn({},AA,uM),JI=e=>(e.displayName="Transition",e.props=dM,e),Fa=JI((e,{slots:t})=>Ft(V9,fM(e),t)),Jl=(e,t=[])=>{St(e)?e.forEach(n=>n(...t)):e&&e(...t)},uw=e=>e?St(e)?e.some(t=>t.length>1):e.length>1:!1;function fM(e){const t={};for(const _ in e)_ in uM||(t[_]=e[_]);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=e7(o),m=p&&p[0],y=p&&p[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:b,onLeaveCancelled:C,onBeforeAppear:I=k,onAppear:T=g,onAppearCancelled:M=v}=t,$=(_,R,z,W)=>{_._enterCancelled=W,ll(_,R?u:l),ll(_,R?c:r),z&&z()},N=(_,R)=>{_._isLeaving=!1,ll(_,d),ll(_,h),ll(_,f),R&&R()},F=_=>(R,z)=>{const W=_?T:g,L=()=>$(R,_,z);Jl(W,[R,L]),dw(()=>{ll(R,_?a:i),Ui(R,_?u:l),uw(W)||fw(R,s,m,L)})};return Sn(t,{onBeforeEnter(_){Jl(k,[_]),Ui(_,i),Ui(_,r)},onBeforeAppear(_){Jl(I,[_]),Ui(_,a),Ui(_,c)},onEnter:F(!1),onAppear:F(!0),onLeave(_,R){_._isLeaving=!0;const z=()=>N(_,R);Ui(_,d),_._enterCancelled?(Ui(_,f),Gv(_)):(Gv(_),Ui(_,f)),dw(()=>{_._isLeaving&&(ll(_,d),Ui(_,h),uw(b)||fw(_,s,y,z))}),Jl(b,[_,z])},onEnterCancelled(_){$(_,!1,void 0,!0),Jl(v,[_])},onAppearCancelled(_){$(_,!0,void 0,!0),Jl(M,[_])},onLeaveCancelled(_){N(_),Jl(C,[_])}})}function e7(e){if(e==null)return null;if(pn(e))return[og(e.enter),og(e.leave)];{const t=og(e);return[t,t]}}function og(e){return Lp(e)}function Ui(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ru]||(e[ru]=new Set)).add(t)}function ll(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ru];n&&(n.delete(t),n.size||(e[ru]=void 0))}function dw(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let t7=0;function fw(e,t,n,s){const o=e._endId=++t7,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=hM(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 hM(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${Qr}Delay`),i=s(`${Qr}Duration`),r=hw(o,i),l=s(`${Yu}Delay`),a=s(`${Yu}Duration`),c=hw(l,a);let u=null,d=0,f=0;t===Qr?r>0&&(u=Qr,d=r,f=i.length):t===Yu?c>0&&(u=Yu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Qr:Yu:null,f=u?u===Qr?i.length:a.length:0);const h=u===Qr&&/\b(?:transform|all)(?:,|$)/.test(s(`${Qr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function hw(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>pw(n)+pw(e[s])))}function pw(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Gv(e){return(e?e.ownerDocument:document).body.offsetHeight}function n7(e,t,n){const s=e[ru];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Vp=Symbol("_vod"),pM=Symbol("_vsh"),ci={name:"show",beforeMount(e,{value:t},{transition:n}){e[Vp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Zu(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),Zu(e,!0),s.enter(e)):s.leave(e,()=>{Zu(e,!1)}):Zu(e,t))},beforeUnmount(e,{value:t}){Zu(e,t)}};function Zu(e,t){e.style.display=t?e[Vp]:"none",e[pM]=!t}function s7(){ci.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const mM=Symbol("");function GCe(e){const t=hs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Kp(i,o))},s=()=>{const o=e(t.proxy);t.ce?Kp(t.ce,o):Yv(t.subTree,o),n(o)};IA(()=>{Bp(s)}),mn(()=>{Je(s,di,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Cn(()=>o.disconnect())})}function Yv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Yv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Kp(e.el,t);else if(e.type===De)e.children.forEach(n=>Yv(n,t));else if(e.type===Vc){let{el:n,anchor:s}=e;for(;n&&(Kp(n,t),n!==s);)n=n.nextSibling}}function Kp(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=t9(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[mM]=s}}const o7=/(?:^|;)\s*display\s*:/;function i7(e,t,n){const s=e.style,o=Tn(n);let i=!1;if(n&&!o){if(t)if(Tn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&ud(s,l,"")}else for(const r in t)n[r]==null&&ud(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?l7(e,r,!Tn(t)&&t?t[r]:void 0,l)||ud(s,r,l):ud(s,r,"")}}else if(o){if(t!==n){const r=s[mM];r&&(n+=";"+r),s.cssText=n,i=o7.test(n)}}else t&&e.removeAttribute("style");Vp in e&&(e[Vp]=i?s.display:"",e[pM]&&(s.display="none"))}const mw=/\s*!important$/;function ud(e,t,n){if(St(n))n.forEach(s=>ud(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=r7(e,t);mw.test(n)?e.setProperty(Ao(s),n.replace(mw,""),"important"):e[s]=n}}const gw=["Webkit","Moz","ms"],ig={};function r7(e,t){const n=ig[t];if(n)return n;let s=ks(t);if(s!=="filter"&&s in e)return ig[t]=s;s=Jm(s);for(let o=0;o<gw.length;o++){const i=gw[o]+s;if(i in e)return ig[t]=i}return t}function l7(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Tn(s)&&n===s}const vw="http://www.w3.org/1999/xlink";function yw(e,t,n,s,o,i=JN(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(vw,t.slice(6,t.length)):e.setAttributeNS(vw,t,n):n==null||i&&!K3(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Xo(n)?String(n):n)}function kw(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?cM(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=K3(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 Mr(e,t,n,s){e.addEventListener(t,n,s)}function a7(e,t,n,s){e.removeEventListener(t,n,s)}const bw=Symbol("_vei");function c7(e,t,n,s,o=null){const i=e[bw]||(e[bw]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=u7(t);if(s){const c=i[t]=h7(s,o);Mr(e,l,c,a)}else r&&(a7(e,l,r,a),i[t]=void 0)}}const xw=/(?:Once|Passive|Capture)$/;function u7(e){let t;if(xw.test(e)){t={};let s;for(;s=e.match(xw);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ao(e.slice(2)),t]}let rg=0;const d7=Promise.resolve(),f7=()=>rg||(d7.then(()=>rg=0),rg=Date.now());function h7(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(St(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&&pi(c,t,5,l)}}else pi(o,t,5,[s])};return n.value=e,n.attached=f7(),n}const ww=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,p7=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?n7(e,s,r):t==="style"?i7(e,n,s):kf(t)?Ym(t)||c7(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):m7(e,t,s,r))?(kw(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&yw(e,t,s,r,i,t!=="value")):e._isVueCE&&(g7(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Tn(s)))?kw(e,ks(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),yw(e,t,s,r))};function m7(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&ww(t)&&Dt(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 ww(t)&&Tn(n)?!1:t in e}function g7(e,t){const n=e._def.props;if(!n)return!1;const s=ks(t);return Array.isArray(n)?n.some(o=>ks(o)===s):Object.keys(n).some(o=>ks(o)===s)}const _w={};function v7(e,t,n){let s=Xe(e,t);Zm(s)&&(s=Sn({},s,t));class o extends Nk{constructor(r){super(s,r,n)}}return o.def=s,o}const YCe=((e,t)=>v7(e,t,F7)),y7=typeof HTMLElement<"u"?HTMLElement:class{};class Nk extends y7{constructor(t,n={},s=Zp){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!==Zp?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Sn({},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 Nk){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,yt(()=>{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&&!St(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Lp(this._props[a])),(l||(l=Object.create(null)))[ks(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)fn(this,s)||Object.defineProperty(this,s,{get:()=>A(n[s])})}_resolveProps(t){const{props:n}=t,s=St(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(ks))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):_w;const o=ks(t);n&&this._numberProps&&this._numberProps[o]&&(s=Lp(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===_w?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(Ao(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ao(t),n+""):n||this.removeAttribute(Ao(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),$7(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ve(this._def,Sn(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,Zm(r[0])?Sn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Ao(i)!==i&&o(Ao(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 k7(e){const t=hs(),n=t&&t.ce;return n||null}function ZCe(){const e=k7();return e&&e.shadowRoot}function XCe(e="$style"){{const t=hs();if(!t)return Qt;const n=t.type.__cssModules;if(!n)return Qt;const s=n[e];return s||Qt}}const gM=new WeakMap,vM=new WeakMap,Gp=Symbol("_moveCb"),Sw=Symbol("_enterCb"),b7=e=>(delete e.props.mode,e),x7=b7({name:"TransitionGroup",props:Sn({},dM,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=hs(),s=CA();let o,i;return bk(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!A7(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(_7),o.forEach(S7);const l=o.filter(C7);Gv(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ui(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Gp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Gp]=null,ll(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=sn(e),l=fM(r);let a=r.tag||De;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),Cl(u,Gd(u,l,s,n)),gM.set(u,yM(u.el)))}i=t.default?yk(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Cl(u,Gd(u,l,s,n))}return ve(a,null,i)}}}),w7=x7;function _7(e){const t=e.el;t[Gp]&&t[Gp](),t[Sw]&&t[Sw]()}function S7(e){vM.set(e,yM(e.el))}function C7(e){const t=gM.get(e),n=vM.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 yM(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function A7(e,t,n){const s=e.cloneNode(),o=e[ru];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}=hM(s);return i.removeChild(s),r}const Ml=e=>{const t=e.props["onUpdate:modelValue"]||!1;return St(t)?n=>zc(t,n):t};function M7(e){e.target.composing=!0}function Cw(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const fi=Symbol("_assign");function Aw(e,t,n){return t&&(e=e.trim()),n&&(e=e1(e)),e}const po={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[fi]=Ml(o);const i=s||o.props&&o.props.type==="number";Mr(e,t?"change":"input",r=>{r.target.composing||e[fi](Aw(e.value,n,i))}),(n||i)&&Mr(e,"change",()=>{e.value=Aw(e.value,n,i)}),t||(Mr(e,"compositionstart",M7),Mr(e,"compositionend",Cw),Mr(e,"change",Cw))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[fi]=Ml(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?e1(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)}},Yp={deep:!0,created(e,t,n){e[fi]=Ml(n),Mr(e,"change",()=>{const s=e._modelValue,o=lu(e),i=e.checked,r=e[fi];if(St(s)){const l=n1(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(Ua(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(bM(e,i))})},mounted:Mw,beforeUpdate(e,t,n){e[fi]=Ml(n),Mw(e,t,n)}};function Mw(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(St(t))o=n1(t,s.props.value)>-1;else if(Ua(t))o=t.has(s.props.value);else{if(t===n)return;o=Lr(t,bM(e,!0))}e.checked!==o&&(e.checked=o)}const kM={created(e,{value:t},n){e.checked=Lr(t,n.props.value),e[fi]=Ml(n),Mr(e,"change",()=>{e[fi](lu(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[fi]=Ml(s),t!==n&&(e.checked=Lr(t,s.props.value))}},Zv={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Ua(t);Mr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?e1(lu(r)):lu(r));e[fi](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,yt(()=>{e._assigning=!1})}),e[fi]=Ml(s)},mounted(e,{value:t}){Ew(e,t)},beforeUpdate(e,t,n){e[fi]=Ml(n)},updated(e,{value:t}){e._assigning||Ew(e,t)}};function Ew(e,t){const n=e.multiple,s=St(t);if(!(n&&!s&&!Ua(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=lu(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=n1(t,l)>-1}else r.selected=t.has(l);else if(Lr(lu(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function lu(e){return"_value"in e?e._value:e.value}function bM(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const E7={created(e,t,n){Sh(e,t,n,null,"created")},mounted(e,t,n){Sh(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Sh(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Sh(e,t,n,s,"updated")}};function xM(e,t){switch(e){case"SELECT":return Zv;case"TEXTAREA":return po;default:switch(t){case"checkbox":return Yp;case"radio":return kM;default:return po}}}function Sh(e,t,n,s,o){const r=xM(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function T7(){po.getSSRProps=({value:e})=>({value:e}),kM.getSSRProps=({value:e},t)=>{if(t.props&&Lr(t.props.value,e))return{checked:!0}},Yp.getSSRProps=({value:e},t)=>{if(St(e)){if(t.props&&n1(e,t.props.value)>-1)return{checked:!0}}else if(Ua(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},E7.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=xM(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const N7=["ctrl","shift","alt","meta"],I7={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)=>N7.some(n=>e[`${n}Key`]&&!t.includes(n))},Mt=(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=I7[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},L7={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Ao(o.key);if(t.some(r=>r===i||L7[r]===i))return e(o)}))},wM=Sn({patchProp:p7},QI);let Ad,Tw=!1;function _M(){return Ad||(Ad=LI(wM))}function SM(){return Ad=Tw?Ad:$I(wM),Tw=!0,Ad}const $7=((...e)=>{_M().render(...e)}),QCe=((...e)=>{SM().hydrate(...e)}),Zp=((...e)=>{const t=_M().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=AM(s);if(!o)return;const i=t._component;!Dt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,CM(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),F7=((...e)=>{const t=SM().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=AM(s);if(o)return n(o,!0,CM(o))},t});function CM(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function AM(e){return Tn(e)?document.querySelector(e):e}let Nw=!1;const JCe=()=>{Nw||(Nw=!0,T7(),s7())};/*!
|
|
21
|
+
* shared v11.4.5
|
|
22
|
+
* (c) 2026 kazuya kawaguchi
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/function O7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Xp=typeof window<"u",Fl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),R7=(e,t,n)=>B7({l:e,k:t,s:n}),B7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ds=e=>typeof e=="number"&&isFinite(e),MM=e=>Lk(e)==="[object Date]",au=e=>Lk(e)==="[object RegExp]",h1=e=>nn(e)&&Object.keys(e).length===0,fs=Object.assign,D7=Object.create,En=(e=null)=>D7(e);let Iw;const ya=()=>Iw||(Iw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:En());function Lw(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function P7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const H7=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,W7=/^(?:href|src|action|formaction)$/i;function Ik(e){return H7.test(e)}function z7(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+=Ik(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function $w(e,t){if(W7.test(e)&&Ik(t))return"about:blank";const n=e.toLowerCase()==="style"?z7(t):t;return P7(n)}function U7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${$w(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${$w(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)=>Ik(o)?`${s}about:blank`:n),e}const q7=Object.prototype.hasOwnProperty;function ui(e,t){return q7.call(e,t)}const Xn=Array.isArray,jn=e=>typeof e=="function",xt=e=>typeof e=="string",ln=e=>typeof e=="boolean",an=e=>e!==null&&typeof e=="object",j7=e=>an(e)&&jn(e.then)&&jn(e.catch),EM=Object.prototype.toString,Lk=e=>EM.call(e),nn=e=>Lk(e)==="[object Object]",V7=e=>e==null?"":Xn(e)||nn(e)&&e.toString===EM?JSON.stringify(e,null,2):String(e);function $k(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Ch=e=>!an(e)||Xn(e);function up(e,t){if(Ch(e)||Ch(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(an(s[i])&&!an(o[i])&&(o[i]=Array.isArray(s[i])?[]:En()),Ch(o[i])||Ch(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 K7(e,t,n){return{line:e,column:t,offset:n}}function Xv(e,t,n){return{start:e,end:t}}const yn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},G7=17;function p1(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 Y7(e){throw e}const Pi=" ",Z7="\r",Vs=`
|
|
29
|
+
`,X7="\u2028",Q7="\u2029";function J7(e){const t=e;let n=0,s=1,o=1,i=0;const r=T=>t[T]===Z7&&t[T+1]===Vs,l=T=>t[T]===Vs,a=T=>t[T]===Q7,c=T=>t[T]===X7,u=T=>r(T)||l(T)||a(T)||c(T),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=T=>r(T)||a(T)||c(T)?Vs:t[T],y=()=>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 b(){n=0,s=1,o=1,i=0}function C(T=0){i=T}function I(){const T=n+i;for(;T!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:y,currentPeek:k,next:g,peek:v,reset:b,resetPeek:C,skipToPeek:I}}const hr=void 0,eL=".",Fw="'",tL="tokenizer";function nL(e,t={}){const n=t.location!==!1,s=J7(e),o=()=>s.index(),i=()=>K7(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(K,ne,me,...we){const Te=c();if(ne.column+=me,ne.offset+=me,u){const Pe=n?Xv(Te.startLoc,ne):null,be=p1(K,Pe,{domain:tL,args:we});u(be)}}function f(K,ne,me){K.endLoc=i(),K.currentType=ne;const we={type:ne};return n&&(we.loc=Xv(K.startLoc,K.endLoc)),me!=null&&(we.value=me),we}const h=K=>f(K,13);function p(K,ne){return K.currentChar()===ne?(K.next(),ne):(d(yn.EXPECTED_TOKEN,i(),0,ne),"")}function m(K){let ne="";for(;K.currentPeek()===Pi||K.currentPeek()===Vs;)ne+=K.currentPeek(),K.peek();return ne}function y(K){const ne=m(K);return K.skipToPeek(),ne}function k(K){if(K===hr)return!1;const ne=K.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne===95}function g(K){if(K===hr)return!1;const ne=K.charCodeAt(0);return ne>=48&&ne<=57}function v(K,ne){const{currentType:me}=ne;if(me!==2)return!1;m(K);const we=k(K.currentPeek());return K.resetPeek(),we}function b(K,ne){const{currentType:me}=ne;if(me!==2)return!1;m(K);const we=K.currentPeek()==="-"?K.peek():K.currentPeek(),Te=g(we);return K.resetPeek(),Te}function C(K,ne){const{currentType:me}=ne;if(me!==2)return!1;m(K);const we=K.currentPeek()===Fw;return K.resetPeek(),we}function I(K,ne){const{currentType:me}=ne;if(me!==7)return!1;m(K);const we=K.currentPeek()===".";return K.resetPeek(),we}function T(K,ne){const{currentType:me}=ne;if(me!==8)return!1;m(K);const we=k(K.currentPeek());return K.resetPeek(),we}function M(K,ne){const{currentType:me}=ne;if(!(me===7||me===11))return!1;m(K);const we=K.currentPeek()===":";return K.resetPeek(),we}function $(K,ne){const{currentType:me}=ne;if(me!==9)return!1;const we=()=>{const Pe=K.currentPeek();return Pe==="{"?k(K.peek()):Pe==="@"||Pe==="|"||Pe===":"||Pe==="."||Pe===Pi||!Pe?!1:Pe===Vs?(K.peek(),we()):F(K,!1)},Te=we();return K.resetPeek(),Te}function N(K){m(K);const ne=K.currentPeek()==="|";return K.resetPeek(),ne}function F(K,ne=!0){const me=(Te=!1,Pe="")=>{const be=K.currentPeek();return be==="{"||be==="@"||!be?Te:be==="|"?!(Pe===Pi||Pe===Vs):be===Pi?(K.peek(),me(!0,Pi)):be===Vs?(K.peek(),me(!0,Vs)):!0},we=me();return ne&&K.resetPeek(),we}function _(K,ne){const me=K.currentChar();return me===hr?hr:ne(me)?(K.next(),me):null}function R(K){const ne=K.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne>=48&&ne<=57||ne===95||ne===36}function z(K){return _(K,R)}function W(K){const ne=K.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne>=48&&ne<=57||ne===95||ne===36||ne===45}function L(K){return _(K,W)}function O(K){const ne=K.charCodeAt(0);return ne>=48&&ne<=57}function q(K){return _(K,O)}function X(K){const ne=K.charCodeAt(0);return ne>=48&&ne<=57||ne>=65&&ne<=70||ne>=97&&ne<=102}function ie(K){return _(K,X)}function U(K){let ne="",me="";for(;ne=q(K);)me+=ne;return me}function j(K){let ne="";for(;;){const me=K.currentChar();if(me==="\\"){const we=K.peek();we==="{"||we==="}"||we==="@"||we==="|"||we==="\\"?(ne+=me+we,K.next(),K.next()):(K.resetPeek(),ne+=me,K.next())}else{if(me==="{"||me==="}"||me==="@"||me==="|"||!me)break;if(me===Pi||me===Vs)if(F(K))ne+=me,K.next();else{if(N(K))break;ne+=me,K.next()}else ne+=me,K.next()}}return ne}function te(K){y(K);let ne="",me="";for(;ne=L(K);)me+=ne;const we=K.currentChar();if(we&&we!=="}"&&we!==hr&&we!==Pi&&we!==Vs&&we!==" "){const Te=ue(K);return d(yn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me+Te),me+Te}return K.currentChar()===hr&&d(yn.UNTERMINATED_CLOSING_BRACE,i(),0),me}function ae(K){y(K);let ne="";return K.currentChar()==="-"?(K.next(),ne+=`-${U(K)}`):ne+=U(K),K.currentChar()===hr&&d(yn.UNTERMINATED_CLOSING_BRACE,i(),0),ne}function oe(K){return K!==Fw&&K!==Vs}function re(K){y(K),p(K,"'");let ne="",me="";for(;ne=_(K,oe);)ne==="\\"?me+=xe(K):me+=ne;const we=K.currentChar();return we===Vs||we===hr?(d(yn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),we===Vs&&(K.next(),p(K,"'")),me):(p(K,"'"),me)}function xe(K){const ne=K.currentChar();switch(ne){case"\\":case"'":return K.next(),`\\${ne}`;case"u":return pe(K,ne,4);case"U":return pe(K,ne,6);default:return d(yn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,ne),""}}function pe(K,ne,me){p(K,ne);let we="";for(let Te=0;Te<me;Te++){const Pe=ie(K);if(!Pe){d(yn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${ne}${we}${K.currentChar()}`);break}we+=Pe}return`\\${ne}${we}`}function Ee(K){return K!=="{"&&K!=="}"&&K!==Pi&&K!==Vs}function ue(K){y(K);let ne="",me="";for(;ne=_(K,Ee);)me+=ne;return me}function Y(K){let ne="",me="";for(;ne=z(K);)me+=ne;return me}function Q(K){const ne=me=>{const we=K.currentChar();return we==="{"||we==="@"||we==="|"||we==="("||we===")"||!we||we===Pi?me:(me+=we,K.next(),ne(me))};return ne("")}function P(K){y(K);const ne=p(K,"|");return y(K),ne}function G(K,ne){let me=null;switch(K.currentChar()){case"{":return ne.braceNest>=1&&d(yn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),K.next(),me=f(ne,2,"{"),y(K),ne.braceNest++,me;case"}":return ne.braceNest>0&&ne.currentType===2&&d(yn.EMPTY_PLACEHOLDER,i(),0),K.next(),me=f(ne,3,"}"),ne.braceNest--,ne.braceNest>0&&y(K),ne.inLinked&&ne.braceNest===0&&(ne.inLinked=!1),me;case"@":return ne.braceNest>0&&d(yn.UNTERMINATED_CLOSING_BRACE,i(),0),me=ye(K,ne)||h(ne),ne.braceNest=0,me;default:{let Te=!0,Pe=!0,be=!0;if(N(K))return ne.braceNest>0&&d(yn.UNTERMINATED_CLOSING_BRACE,i(),0),me=f(ne,1,P(K)),ne.braceNest=0,ne.inLinked=!1,me;if(ne.braceNest>0&&(ne.currentType===4||ne.currentType===5||ne.currentType===6))return d(yn.UNTERMINATED_CLOSING_BRACE,i(),0),ne.braceNest=0,he(K,ne);if(Te=v(K,ne))return me=f(ne,4,te(K)),y(K),me;if(Pe=b(K,ne))return me=f(ne,5,ae(K)),y(K),me;if(be=C(K,ne))return me=f(ne,6,re(K)),y(K),me;if(!Te&&!Pe&&!be)return me=f(ne,12,ue(K)),d(yn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me.value),y(K),me;break}}return me}function ye(K,ne){const{currentType:me}=ne;let we=null;const Te=K.currentChar();switch((me===7||me===8||me===11||me===9)&&(Te===Vs||Te===Pi)&&d(yn.INVALID_LINKED_FORMAT,i(),0),Te){case"@":return K.next(),we=f(ne,7,"@"),ne.inLinked=!0,we;case".":return y(K),K.next(),f(ne,8,".");case":":return y(K),K.next(),f(ne,9,":");default:return N(K)?(we=f(ne,1,P(K)),ne.braceNest=0,ne.inLinked=!1,we):I(K,ne)||M(K,ne)?(y(K),ye(K,ne)):T(K,ne)?(y(K),f(ne,11,Y(K))):$(K,ne)?(y(K),Te==="{"?G(K,ne)||we:f(ne,10,Q(K))):(me===7&&d(yn.INVALID_LINKED_FORMAT,i(),0),ne.braceNest=0,ne.inLinked=!1,he(K,ne))}}function he(K,ne){let me={type:13};if(ne.braceNest>0)return G(K,ne)||h(ne);if(ne.inLinked)return ye(K,ne)||h(ne);switch(K.currentChar()){case"{":return G(K,ne)||h(ne);case"}":return d(yn.UNBALANCED_CLOSING_BRACE,i(),0),K.next(),f(ne,3,"}");case"@":return ye(K,ne)||h(ne);default:{if(N(K))return me=f(ne,1,P(K)),ne.braceNest=0,ne.inLinked=!1,me;if(F(K))return f(ne,0,j(K));break}}return me}function fe(){const{currentType:K,offset:ne,startLoc:me,endLoc:we}=a;return a.lastType=K,a.lastOffset=ne,a.lastStartLoc=me,a.lastEndLoc=we,a.offset=o(),a.startLoc=i(),s.currentChar()===hr?f(a,13):he(s,a)}return{nextToken:fe,currentOffset:o,currentPosition:i,context:c}}const sL="parser",oL=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,iL=/\\([\\@{}|])/g;function rL(e,t){return t}function lL(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 aL(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,g,v,b,...C){const I=k.currentPosition();if(I.offset+=b,I.column+=b,n){const T=t?Xv(v,I):null,M=p1(g,T,{domain:sL,args:C});n(M)}}function o(k,g,v){const b={type:k};return t&&(b.start=g,b.end=g,b.loc={start:v,end:v}),b}function i(k,g,v,b){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),b=o(3,v.offset,v.startLoc);return b.value=g.replace(iL,rL),i(b,k.currentOffset(),k.currentPosition()),b}function l(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:C}=v,I=o(5,b,C);return I.index=parseInt(g,10),k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function a(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:C}=v,I=o(4,b,C);return I.key=g,k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function c(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:C}=v,I=o(9,b,C);return I.value=g.replace(oL,lL),k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:b,lastStartLoc:C}=v,I=o(8,b,C);return g.type!==11?(s(k,yn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),I.value="",i(I,b,C),{nextConsumeToken:g,node:I}):(g.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Hi(g)),I.value=g.value||"",i(I,k.currentOffset(),k.currentPosition()),{node:I})}function d(k,g){const v=k.context(),b=o(7,v.offset,v.startLoc);return b.value=g,i(b,k.currentOffset(),k.currentPosition()),b}function f(k){const g=k.context(),v=o(6,g.offset,g.startLoc);let b=k.nextToken();if(b.type===8){const C=u(k);v.modifier=C.node,b=C.nextConsumeToken||k.nextToken()}switch(b.type!==9&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi(b)),b=k.nextToken(),b.type===2&&(b=k.nextToken()),b.type){case 10:b.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi(b)),v.key=d(k,b.value||"");break;case 4:b.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi(b)),v.key=a(k,b.value||"");break;case 5:b.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi(b)),v.key=l(k,b.value||"");break;case 6:b.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi(b)),v.key=c(k,b.value||"");break;default:{s(k,yn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const C=k.context(),I=o(7,C.offset,C.startLoc);return I.value="",i(I,C.offset,C.startLoc),v.key=I,i(v,C.offset,C.startLoc),{nextConsumeToken:b,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,b=g.currentType===1?g.endLoc:g.startLoc,C=o(2,v,b);C.items=[];let I=null;do{const $=I||k.nextToken();switch(I=null,$.type){case 0:$.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi($)),C.items.push(r(k,$.value||""));break;case 5:$.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi($)),C.items.push(l(k,$.value||""));break;case 4:$.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi($)),C.items.push(a(k,$.value||""));break;case 6:$.value==null&&s(k,yn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Hi($)),C.items.push(c(k,$.value||""));break;case 7:{const N=f(k);C.items.push(N.node),I=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const T=g.currentType===1?g.lastOffset:k.currentOffset(),M=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(C,T,M),C}function p(k,g,v,b){const C=k.context();let I=b.items.length===0;const T=o(1,g,v);T.cases=[],T.cases.push(b);do{const M=h(k);I||(I=M.items.length===0),T.cases.push(M)}while(C.currentType!==13);return I&&s(k,yn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(T,k.currentOffset(),k.currentPosition()),T}function m(k){const g=k.context(),{offset:v,startLoc:b}=g,C=h(k);return g.currentType===13?C:p(k,v,b,C)}function y(k){const g=nL(k,fs({},e)),v=g.context(),b=o(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=k),b.body=m(g),e.onCacheKey&&(b.cacheKey=e.onCacheKey(k)),v.currentType!==13&&s(g,yn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(b,g.currentOffset(),g.currentPosition()),b}return{parse:y}}function Hi(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 cL(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Ow(e,t){for(let n=0;n<e.length;n++)Fk(e[n],t)}function Fk(e,t){switch(e.type){case 1:Ow(e.cases,t),t.helper("plural");break;case 2:Ow(e.items,t);break;case 6:{Fk(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 uL(e,t={}){const n=cL(e);n.helper("normalize"),e.body&&Fk(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function dL(e){const t=e.body;return t.type===2?Rw(t):t.cases.forEach(n=>Rw(n)),e}function Rw(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=$k(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 Ac(e){switch(e.t=e.type,e.type){case 0:{const t=e;Ac(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++)Ac(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++)Ac(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;Ac(t.key),t.k=t.key,delete t.key,t.modifier&&(Ac(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 fL(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,y){r.code+=m}function c(m,y=!0){const k=y?s:"";a(o?k+" ".repeat(m):k)}function u(m=!0){const y=++r.indentLevel;m&&c(y)}function d(m=!0){const y=--r.indentLevel;m&&c(y)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function hL(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),cu(e,t.key),t.modifier?(e.push(", "),cu(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function pL(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&&(cu(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function mL(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&&(cu(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function gL(e,t){t.body?cu(e,t.body):e.push("null")}function cu(e,t){const{helper:n}=e;switch(t.type){case 0:gL(e,t);break;case 1:mL(e,t);break;case 2:pL(e,t);break;case 6:hL(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 vL=(e,t={})=>{const n=xt(t.mode)?t.mode:"normal",s=xt(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=fL(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${$k(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),cu(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 yL(e,t={}){const n=fs({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=aL(n).parse(e);return s?(i&&dL(l),o&&Ac(l),{ast:l,code:""}):(uL(l,n),vL(l,n))}/*!
|
|
31
|
+
* core-base v11.4.5
|
|
32
|
+
* (c) 2026 kazuya kawaguchi
|
|
33
|
+
* Released under the MIT License.
|
|
34
|
+
*/function kL(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Qi(e){return an(e)&&Ok(e)===0&&(ui(e,"b")||ui(e,"body"))}const TM=["b","body"];function bL(e){return Ol(e,TM)}const NM=["c","cases"];function xL(e){return Ol(e,NM,[])}const IM=["s","static"];function wL(e){return Ol(e,IM)}const LM=["i","items"];function _L(e){return Ol(e,LM,[])}const $M=["t","type"];function Ok(e){return Ol(e,$M)}const FM=["v","value"];function Ah(e,t){const n=Ol(e,FM);if(n!=null)return n;throw Qd(t)}const OM=["m","modifier"];function SL(e){return Ol(e,OM)}const RM=["k","key"];function CL(e){const t=Ol(e,RM);if(t)return t;throw Qd(6)}function Ol(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(ui(e,o)&&e[o]!=null)return e[o]}return n}const BM=[...TM,...NM,...IM,...LM,...RM,...OM,...FM,...$M];function Qd(e){return new Error(`unhandled node type: ${e}`)}function lg(e){return n=>AL(n,e)}function AL(e,t){const n=bL(t);if(n==null)throw Qd(0);if(Ok(n)===1){const i=xL(n);return e.plural(i.reduce((r,l)=>[...r,Bw(e,l)],[]))}else return Bw(e,n)}function Bw(e,t){const n=wL(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=_L(t).reduce((o,i)=>[...o,Qv(e,i)],[]);return e.normalize(s)}}function Qv(e,t){const n=Ok(t);switch(n){case 3:return Ah(t,n);case 9:return Ah(t,n);case 4:{const s=t;if(ui(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ui(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Qd(n)}case 5:{const s=t;if(ui(s,"i")&&ds(s.i))return e.interpolate(e.list(s.i));if(ui(s,"index")&&ds(s.index))return e.interpolate(e.list(s.index));throw Qd(n)}case 6:{const s=t,o=SL(s),i=CL(s);return e.linked(Qv(e,i),o?Qv(e,o):void 0,e.type)}case 7:return Ah(t,n);case 8:return Ah(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const ML=e=>e;let Mh=En();function EL(e,t={}){let n=!1;const s=t.onError||Y7;return t.onError=o=>{n=!0,s(o)},{...yL(e,t),detectError:n}}function TL(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&xt(e)){ln(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||ML)(e),o=Mh[s];if(o)return o;const{ast:i,detectError:r}=EL(e,{...t,location:!1,jit:!0}),l=lg(i);return r?l:Mh[s]=l}else{const n=e.cacheKey;if(n){const s=Mh[n];return s||(Mh[n]=lg(e))}else return lg(e)}}let Jd=null;function NL(e){Jd=e}function IL(e,t,n){Jd&&Jd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const LL=$L("function:translate");function $L(e){return t=>Jd&&Jd.emit(e,t)}const Er={INVALID_ARGUMENT:G7,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},FL=24;function Tr(e){return p1(e,null,void 0)}function Rk(e,t){return t.locale!=null?Dw(t.locale):Dw(e.locale)}let ag;function Dw(e){if(xt(e))return e;if(jn(e)){if(e.resolvedOnce&&ag!=null)return ag;if(e.constructor.name==="Function"){const t=e();if(j7(t))throw Tr(Er.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ag=t}else throw Tr(Er.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Tr(Er.NOT_SUPPORT_LOCALE_TYPE)}function OL(e,t,n){return[...new Set([n,...Xn(t)?t:an(t)?Object.keys(t):xt(t)?[t]:[n]])]}function Jv(e,t,n){const s=xt(n)?n:ef,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Xn(r);)r=Pw(i,r,t);const l=Xn(t)||!nn(t)?t:t.default?t.default:null;r=xt(l)?[l]:l,Xn(r)&&Pw(i,r,!1),o.__localeChainCache.set(s,i)}return i}function Pw(e,t,n){let s=!0;for(let o=0;o<t.length&&ln(s);o++){const i=t[o];xt(i)&&(s=RL(e,t[o],n))}return s}function RL(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=BL(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function BL(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),(Xn(n)||nn(n))&&n[o]&&(s=n[o])}return s}const Rl=[];Rl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Rl[1]={w:[1],".":[2],"[":[4],o:[7]};Rl[2]={w:[2],i:[3,0],0:[3,0]};Rl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Rl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Rl[5]={"'":[4,0],o:8,l:[5,0]};Rl[6]={'"':[4,0],o:8,l:[6,0]};const DL=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function PL(e){return DL.test(e)}function HL(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 WL(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 zL(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:PL(t)?HL(t):"*"+t}function UL(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=zL(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=WL(i),d=Rl[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 Hw=new Map;function qL(e,t){return an(e)?e[t]:null}function jL(e,t){if(!an(e))return null;let n=Hw.get(t);if(n||(n=UL(t),n&&Hw.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(BM.includes(r)&&Qi(o)||!an(o)||!ui(o,r))return null;const l=o[r];if(l===void 0||jn(o))return null;o=l,i++}return o}const VL="11.4.5",m1=-1,ef="en-US",Qp="",Ww=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function KL(){return{upper:(e,t)=>t==="text"&&xt(e)?e.toUpperCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&xt(e)?e.toLowerCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&xt(e)?Ww(e):t==="vnode"&&an(e)&&"__v_isVNode"in e?Ww(e.children):e}}let DM;function GL(e){DM=e}let PM;function YL(e){PM=e}let HM;function ZL(e){HM=e}let WM=null;const XL=e=>{WM=e},QL=()=>WM;let zM=null;const zw=e=>{zM=e},JL=()=>zM;let Uw=0;function e$(e={}){const t=jn(e.onWarn)?e.onWarn:O7,n=xt(e.version)?e.version:VL,s=xt(e.locale)||jn(e.locale)?e.locale:ef,o=jn(s)?ef:s,i=Xn(e.fallbackLocale)||nn(e.fallbackLocale)||xt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=nn(e.messages)?e.messages:cg(o),l=nn(e.datetimeFormats)?e.datetimeFormats:cg(o),a=nn(e.numberFormats)?e.numberFormats:cg(o),c=fs(En(),e.modifiers,KL()),u=e.pluralRules||En(),d=jn(e.missing)?e.missing:null,f=ln(e.missingWarn)||au(e.missingWarn)?e.missingWarn:!0,h=ln(e.fallbackWarn)||au(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,y=jn(e.postTranslation)?e.postTranslation:null,k=nn(e.processor)?e.processor:null,g=ln(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,b=jn(e.messageCompiler)?e.messageCompiler:DM,C=jn(e.messageResolver)?e.messageResolver:PM||qL,I=jn(e.localeFallbacker)?e.localeFallbacker:HM||OL,T=an(e.fallbackContext)?e.fallbackContext:void 0,M=e,$=an(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,N=an(M.__numberFormatters)?M.__numberFormatters:new Map,F=an(M.__meta)?M.__meta:{};Uw++;const _={version:n,cid:Uw,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:y,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:b,messageResolver:C,localeFallbacker:I,fallbackContext:T,onWarn:t,__meta:F};return _.datetimeFormats=l,_.numberFormats=a,_.__datetimeFormatters=$,_.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&IL(_,n,F),_}const cg=e=>({[e]:En()});function Bk(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return xt(l)?l:t}else return t}function Xu(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function t$(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function n$(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(t$(e,t[s]))return!0;return!1}function qw(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!xt(t[0])&&!MM(t[0])&&!ds(t[0]))return Qp;const[a,c,u,d]=ey(...t),f=ln(u.missingWarn)?u.missingWarn:e.missingWarn;ln(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Rk(e,u),m=r(e,o,p);if(!xt(a)||a===""){const I=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let y={},k,g=null;const v="datetime format";for(let I=0;I<m.length&&(k=m[I],y=n[k]||{},g=y[a],!nn(g));I++)Bk(e,a,k,f,v);if(!nn(g)||!xt(k))return s?m1:a;let b=`${k}__${a}`;h1(d)||(b=`${b}__${JSON.stringify(d)}`);let C=l.get(b);return C||(C=new Intl.DateTimeFormat(k,fs({},g,d)),l.set(b,C)),h?C.formatToParts(c):C.format(c)}const UM=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function ey(...e){const[t,n,s,o]=e,i=En();let r=En(),l;if(xt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Tr(Er.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 Tr(Er.INVALID_ISO_DATE_ARGUMENT)}}else if(MM(t)){if(isNaN(t.getTime()))throw Tr(Er.INVALID_DATE_ARGUMENT);l=t}else if(ds(t))l=t;else throw Tr(Er.INVALID_ARGUMENT);return xt(n)?i.key=n:nn(n)&&Object.keys(n).forEach(a=>{UM.includes(a)?r[a]=n[a]:i[a]=n[a]}),xt(s)?i.locale=s:nn(s)&&(r=s),nn(o)&&(r=o),[i.key||"",l,i,r]}function jw(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Vw(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ds(t[0]))return Qp;const[a,c,u,d]=ty(...t),f=ln(u.missingWarn)?u.missingWarn:e.missingWarn;ln(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Rk(e,u),m=r(e,o,p);if(!xt(a)||a===""){const I=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let y={},k,g=null;const v="number format";for(let I=0;I<m.length&&(k=m[I],y=n[k]||{},g=y[a],!nn(g));I++)Bk(e,a,k,f,v);if(!nn(g)||!xt(k))return s?m1:a;let b=`${k}__${a}`;h1(d)||(b=`${b}__${JSON.stringify(d)}`);let C=l.get(b);return C||(C=new Intl.NumberFormat(k,fs({},g,d)),l.set(b,C)),h?C.formatToParts(c):C.format(c)}const qM=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function ty(...e){const[t,n,s,o]=e,i=En();let r=En();if(!ds(t))throw Tr(Er.INVALID_ARGUMENT);const l=t;return xt(n)?i.key=n:nn(n)&&Object.keys(n).forEach(a=>{qM.includes(a)?r[a]=n[a]:i[a]=n[a]}),xt(s)?i.locale=s:nn(s)&&(r=s),nn(o)&&(r=o),[i.key||"",l,i,r]}function Kw(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const s$=e=>e,o$=e=>"",i$="text",r$=e=>e.length===0?"":$k(e),l$=V7;function ug(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function a$(e){const t=ds(e.pluralIndex)?e.pluralIndex:-1;return ds(e.named?.count)?e.named.count:ds(e.named?.n)?e.named.n:t}function c$(e={}){const t=e.locale,n=a$(e),s=xt(t)&&jn(e.pluralRules?.[t])?e.pluralRules[t]:ug,o=s===ug?void 0:ug,i=k=>k[s(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||En();ds(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=jn(e.messages)?e.messages(k,!!g):an(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):o$)}const d=k=>e.modifiers?e.modifiers[k]:s$,f=jn(e.processor?.normalize)?e.processor.normalize:r$,h=jn(e.processor?.interpolate)?e.processor.interpolate:l$,p=xt(e.processor?.type)?e.processor.type:i$,y={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,b]=g;let C="text",I="";g.length===1?an(v)?(I=v.modifier||I,C=v.type||C):xt(v)&&(I=v||I):g.length===2&&(xt(v)&&(I=v||I),xt(b)&&(C=b||C));const T=u(k,!0)(y),M=T===""||T===void 0?k:T,$=C==="vnode"&&Xn(M)&&I?M[0]:M;return I?d(I)($,C):$},message:u,type:p,interpolate:h,normalize:f,values:fs(En(),r,a)};return y}const Gw=()=>"",ai=e=>jn(e);function Yw(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=ny(...t),u=ln(c.missingWarn)?c.missingWarn:e.missingWarn,d=ln(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=ln(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=xt(c.default)||ln(c.default)?ln(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(xt(p)||jn(p)),y=Rk(e,c);f&&u$(c);let[k,g,v]=h?[a,y,l[y]||En()]:jM(e,a,y,r,d,u),b=k,C=a;if(!h&&!(xt(b)||Qi(b)||ai(b))&&m&&(b=p,C=b),!h&&(!(xt(b)||Qi(b)||ai(b))||!xt(g)))return o?m1:a;let I=!1;const T=()=>{I=!0},M=ai(b)?b:VM(e,a,g,b,C,T);if(I)return b;const $=h$(e,g,v,c),N=c$($),F=d$(e,M,N);let _=s?s(F,a):F;if(f&&xt(_)&&(_=U7(_)),__INTLIFY_PROD_DEVTOOLS__){const R={timestamp:Date.now(),key:xt(a)?a:ai(b)?b.key:"",locale:g||(ai(b)?b.locale:""),format:xt(b)?b:ai(b)?b.source:"",message:_};R.meta=fs({},e.__meta,QL()||{}),LL(R)}return _}function u$(e){Xn(e.list)?e.list=e.list.map(t=>xt(t)?Lw(t):t):an(e.named)&&Object.keys(e.named).forEach(t=>{xt(e.named[t])&&(e.named[t]=Lw(e.named[t]))})}function jM(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=En(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||En(),(h=a(d,t))===null&&(h=d[t]),!(xt(h)||Qi(h)||ai(h)));m++)if(!n$(f,u)){const y=Bk(e,t,f,i,p);y!==t&&(h=y)}return[h,f,d]}function VM(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(ai(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,f$(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function d$(e,t,n){return t(n)}function ny(...e){const[t,n,s]=e,o=En();if(!xt(t)&&!ds(t)&&!ai(t)&&!Qi(t))throw Tr(Er.INVALID_ARGUMENT);const i=ds(t)?String(t):(ai(t),t);return ds(n)?o.plural=n:xt(n)?o.default=n:nn(n)&&!h1(n)?o.named=n:Xn(n)&&(o.list=n),ds(s)?o.plural=s:xt(s)?o.default=s:nn(s)&&fs(o,s),[i,o]}function f$(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>R7(t,n,r)}}function h$(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[y,,k]=jM(u||e,h,t,l,a,c);m=y??r(k,h)}if(xt(m)||Qi(m)){let y=!1;const g=VM(e,h,t,m,h,()=>{y=!0});return y?Gw:g}else return ai(m)?m:Gw}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),ds(s.plural)&&(f.pluralIndex=s.plural),f}kL();/*!
|
|
35
|
+
* vue-i18n v11.4.5
|
|
36
|
+
* (c) 2026 kazuya kawaguchi
|
|
37
|
+
* Released under the MIT License.
|
|
38
|
+
*/const p$="11.4.5";function m$(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ya().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ya().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1)}const lo={UNEXPECTED_RETURN_TYPE:FL,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 Mo(e,...t){return p1(e,null,void 0)}const sy=Fl("__translateVNode"),oy=Fl("__datetimeParts"),iy=Fl("__numberParts"),KM=Fl("__setPluralRules"),GM=Fl("__injectWithOption"),$c=Fl("__dispose");function tf(e){if(!an(e)||Qi(e))return e;for(const t in e)if(ui(e,t))if(!t.includes("."))an(e[t])&&tf(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]]=En()),!an(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Qi(o)?BM.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Qi(o)){const r=o[n[s]];an(r)&&tf(r)}}return e}function Dk(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=nn(n)?n:Xn(s)?En():{[e]:En()};if(Xn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||En(),up(c,r[a])):up(c,r)}else xt(l)&&up(JSON.parse(l),r)}),o==null&&i)for(const l in r)ui(r,l)&&tf(r[l]);return r}function YM(e){return e.type}function ZM(e,t,n){let s=an(t.messages)?t.messages:En();"__i18nGlobal"in n&&(s=Dk(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(an(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(an(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Zw(e){return ve(bl,null,e,0)}function nf(){return hs()}const Xw="__INTLIFY_META__",Qw=()=>[],g$=()=>!1;let Jw=0;function e_(e){return((t,n,s,o)=>e(n,s,nf()||void 0,o))}const v$=()=>{const e=nf();let t=null;return e&&(t=YM(e)[Xw])?{[Xw]:t}:null};function Jp(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Xp?se:tr;let r=ln(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:xt(e.locale)?e.locale:ef),a=i(t&&r?t.fallbackLocale.value:xt(e.fallbackLocale)||Xn(e.fallbackLocale)||nn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Dk(l.value,e)),u=i(nn(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(nn(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:ln(e.missingWarn)||au(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:ln(e.fallbackWarn)||au(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:ln(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,y=jn(e.missing)?e.missing:null,k=jn(e.missing)?e_(e.missing):null,g=jn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:ln(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter;const C=t?t.modifiers:nn(e.modifiers)?e.modifiers:{};let I=e.pluralRules||t&&t.pluralRules,T;T=(()=>{s&&zw(null);const be={version:p$,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:C,pluralRules:I,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};be.datetimeFormats=u.value,be.numberFormats=d.value,be.__datetimeFormatters=nn(T)?T.__datetimeFormatters:void 0,be.__numberFormatters=nn(T)?T.__numberFormatters:void 0;const _e=e$(be);return s&&zw(_e),_e})(),Xu(T,l.value,a.value);function $(){return[l.value,a.value,c.value,u.value,d.value]}const N=D({get:()=>l.value,set:be=>{T.locale=be,l.value=be}}),F=D({get:()=>a.value,set:be=>{T.fallbackLocale=be,a.value=be,Xu(T,l.value,be)}}),_=D(()=>c.value),R=D(()=>u.value),z=D(()=>d.value);function W(){return jn(g)?g:null}function L(be){g=be,T.postTranslation=be}function O(){return y}function q(be){be!==null&&(k=e_(be)),y=be,T.missing=k}const X=(be,_e,Ke,Qe,ot,at)=>{$();let ht;try{__INTLIFY_PROD_DEVTOOLS__,s||(T.fallbackContext=t?JL():void 0),ht=be(T)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(T.fallbackContext=void 0)}if(Ke!=="translate exists"&&ds(ht)&&ht===m1||Ke==="translate exists"&&!ht){const[Et,Tt]=_e();return t&&p?Qe(t):ot(Et)}else{if(at(ht))return ht;throw Mo(lo.UNEXPECTED_RETURN_TYPE)}};function ie(...be){return X(_e=>Reflect.apply(Yw,null,[_e,...be]),()=>ny(...be),"translate",_e=>Reflect.apply(_e.t,_e,[...be]),_e=>_e,_e=>xt(_e))}function U(...be){const[_e,Ke,Qe]=be;if(Qe&&!an(Qe))throw Mo(lo.INVALID_ARGUMENT);return ie(_e,Ke,fs({resolvedMessage:!0},Qe||{}))}function j(...be){return X(_e=>Reflect.apply(qw,null,[_e,...be]),()=>ey(...be),"datetime format",_e=>Reflect.apply(_e.d,_e,[...be]),()=>Qp,_e=>xt(_e)||Xn(_e))}function te(...be){return X(_e=>Reflect.apply(Vw,null,[_e,...be]),()=>ty(...be),"number format",_e=>Reflect.apply(_e.n,_e,[...be]),()=>Qp,_e=>xt(_e)||Xn(_e))}function ae(be){return be.map(_e=>xt(_e)||ds(_e)||ln(_e)?Zw(String(_e)):_e)}const re={normalize:ae,interpolate:be=>be,type:"vnode"};function xe(...be){return X(_e=>{let Ke;const Qe=_e;try{Qe.processor=re,Ke=Reflect.apply(Yw,null,[Qe,...be])}finally{Qe.processor=null}return Ke},()=>ny(...be),"translate",_e=>_e[sy](...be),_e=>[Zw(_e)],_e=>Xn(_e))}function pe(...be){return X(_e=>Reflect.apply(Vw,null,[_e,...be]),()=>ty(...be),"number format",_e=>_e[iy](...be),Qw,_e=>xt(_e)||Xn(_e))}function Ee(...be){return X(_e=>Reflect.apply(qw,null,[_e,...be]),()=>ey(...be),"datetime format",_e=>_e[oy](...be),Qw,_e=>xt(_e)||Xn(_e))}function ue(be){I=be,T.pluralRules=I}function Y(be,_e){return X(()=>{if(!be)return!1;const Ke=xt(_e)?_e:l.value,Qe=xt(_e)?[Ke]:Jv(T,a.value,Ke);for(let ot=0;ot<Qe.length;ot++){const at=G(Qe[ot]);let ht=T.messageResolver(at,be);if(ht===null&&(ht=at[be]),Qi(ht)||ai(ht)||xt(ht))return!0}return!1},()=>[be],"translate exists",Ke=>Reflect.apply(Ke.te,Ke,[be,_e]),g$,Ke=>ln(Ke))}function Q(be){let _e=null;const Ke=Jv(T,a.value,l.value);for(let Qe=0;Qe<Ke.length;Qe++){const ot=c.value[Ke[Qe]]||{},at=T.messageResolver(ot,be);if(at!=null){_e=at;break}}return _e}function P(be){const _e=Q(be);return _e??(t?t.tm(be)||{}:{})}function G(be){return c.value[be]||{}}function ye(be,_e){if(o){const Ke={[be]:_e};for(const Qe in Ke)ui(Ke,Qe)&&tf(Ke[Qe]);_e=Ke[be]}c.value[be]=_e,T.messages=c.value}function he(be,_e){c.value[be]=c.value[be]||{};const Ke={[be]:_e};if(o)for(const Qe in Ke)ui(Ke,Qe)&&tf(Ke[Qe]);_e=Ke[be],up(_e,c.value[be]),T.messages=c.value}function fe(be){return u.value[be]||{}}function K(be,_e){u.value[be]=_e,T.datetimeFormats=u.value,jw(T,be,_e)}function ne(be,_e){u.value[be]=fs(u.value[be]||{},_e),T.datetimeFormats=u.value,jw(T,be,_e)}function me(be){return d.value[be]||{}}function we(be,_e){d.value[be]=_e,T.numberFormats=d.value,Kw(T,be,_e)}function Te(be,_e){d.value[be]=fs(d.value[be]||{},_e),T.numberFormats=d.value,Kw(T,be,_e)}Jw++,t&&Xp&&(Je(t.locale,be=>{r&&(l.value=be,T.locale=be,Xu(T,l.value,a.value))}),Je(t.fallbackLocale,be=>{r&&(a.value=be,T.fallbackLocale=be,Xu(T,l.value,a.value))}));const Pe={id:Jw,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(be){r=be,be&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Xu(T,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:_,get modifiers(){return C},get pluralRules(){return I||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(be){f=be,T.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(be){h=be,T.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(be){p=be},get fallbackFormat(){return m},set fallbackFormat(be){m=be,T.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(be){v=be,T.warnHtmlMessage=be},get escapeParameter(){return b},set escapeParameter(be){b=be,T.escapeParameter=be},t:ie,getLocaleMessage:G,setLocaleMessage:ye,mergeLocaleMessage:he,getPostTranslationHandler:W,setPostTranslationHandler:L,getMissingHandler:O,setMissingHandler:q,[KM]:ue};return Pe.datetimeFormats=R,Pe.numberFormats=z,Pe.rt=U,Pe.te=Y,Pe.tm=P,Pe.d=j,Pe.n=te,Pe.getDateTimeFormat=fe,Pe.setDateTimeFormat=K,Pe.mergeDateTimeFormat=ne,Pe.getNumberFormat=me,Pe.setNumberFormat=we,Pe.mergeNumberFormat=Te,Pe[GM]=n,Pe[sy]=xe,Pe[oy]=Ee,Pe[iy]=pe,Pe}function y$(e){const t=xt(e.locale)?e.locale:ef,n=xt(e.fallbackLocale)||Xn(e.fallbackLocale)||nn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=jn(e.missing)?e.missing:void 0,o=ln(e.silentTranslationWarn)||au(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=ln(e.silentFallbackWarn)||au(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=ln(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=nn(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=jn(e.postTranslation)?e.postTranslation:void 0,d=xt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=ln(e.sync)?e.sync:!0;let p=e.messages;if(nn(e.sharedMessages)){const C=e.sharedMessages;p=Object.keys(C).reduce((T,M)=>{const $=T[M]||(T[M]={});return fs($,C[M]),T},p||{})}const{__i18n:m,__root:y,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,b=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:b,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:y,__injectWithOption:k}}function ry(e={}){const t=Jp(y$(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return ln(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=ln(o)?!o:o},get silentFallbackWarn(){return ln(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=ln(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function k$(e,t,n){return{beforeCreate(){const s=nf();if(!s)throw Mo(lo.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=t_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=ry(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=t_(e,o);else{this.$i18n=ry({__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&&ZM(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=nf();if(!s)throw Mo(lo.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 t_(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[KM](t.pluralizationRules||e.pluralizationRules);const n=Dk(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 Pk={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function b$({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===De?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},En())}function XM(){return De}const x$=Xe({name:"i18n-t",props:fs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ds(e)||!isNaN(e)}},Pk),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Ot({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=En();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=xt(e.plural)?+e.plural:e.plural);const u=b$(t,a);return o[sy](e.keypath,u,c)},r=fs(En(),s),l=xt(e.tag)||an(e.tag)?e.tag:XM();return an(l)?Ft(l,r,{default:i}):Ft(l,r,i())}}}),n_=x$;function w$(e){return Xn(e)&&!xt(e[0])}function QM(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=En();e.locale&&(c.locale=e.locale),xt(e.format)?c.key=e.format:an(e.format)&&(xt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?fs(En(),h,{[p]:e.format[p]}):h,En()));const d=s(e.value,c,u);let f=[c.key];return Xn(d)?f=d.map((h,p)=>{const m=o[h.type],y=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return w$(y)&&(y[0].key=`${h.type}-${p}`),y}):xt(d)&&(f=[d]),f},l=fs(En(),i),a=xt(e.tag)||an(e.tag)?e.tag:XM();return an(a)?Ft(a,l,{default:r}):Ft(a,l,r())}}const _$=Xe({name:"i18n-n",props:fs({value:{type:Number,required:!0},format:{type:[String,Object]}},Pk),setup(e,t){const n=e.i18n||Ot({useScope:e.scope,__useComponent:!0});return QM(e,t,qM,(...s)=>n[iy](...s))}}),s_=_$;function S$(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 C$(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Mo(lo.UNEXPECTED_ERROR);const c=S$(e,l.$),u=o_(a);return[Reflect.apply(c.t,c,[...i_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Xp&&(r.__i18nWatcher=Je(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Xp&&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=o_(l);r.textContent=Reflect.apply(a.t,a,[...i_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function o_(e){if(xt(e))return{path:e};if(nn(e)){if(!("path"in e))throw Mo(lo.REQUIRED_VALUE,"path");return e}else throw Mo(lo.INVALID_VALUE)}function i_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return xt(n)&&(r.locale=n),ds(o)&&(r.plural=o),ds(i)&&(r.plural=i),[t,l,r]}function A$(e,t,...n){const s=nn(n[0])?n[0]:{};(ln(s.globalInstall)?s.globalInstall:!0)&&([n_.name,"I18nT"].forEach(i=>e.component(i,n_)),[s_.name,"I18nN"].forEach(i=>e.component(i,s_)),[a_.name,"I18nD"].forEach(i=>e.component(i,a_))),e.directive("t",C$(t))}const M$=Fl("global-vue-i18n");function E$(e={}){const t=__VUE_I18N_LEGACY_API__&&ln(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=ln(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=T$(e,t),r=Fl("");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),nn(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=R$(d,u.global)),__VUE_I18N_FULL_INSTALL__&&A$(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(k$(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 Ot(e={}){const t=nf();if(t==null)throw Mo(lo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Mo(lo.NOT_INSTALLED);const n=N$(t),s=L$(n),o=YM(t),i=I$(e,o);if(i==="global")return ZM(s,e,o),s;if(i==="parent"){let a=r_(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Mo(lo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=fs({},e),u=r_(n,t);c.__root=u||s;const d=Jp(c);return a.__composerExtend&&(d[$c]=a.__composerExtend(d)),hk()&&bf(()=>{const h=d[$c];h&&(h(),delete d[$c])}),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=Jp(a),r.__composerExtend&&(l[$c]=r.__composerExtend(l)),F$(r,t,l),r.__setInstance(t,l)}return l}function T$(e,t){const n=n9(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>ry(e)):n.run(()=>Jp(e));if(s==null)throw Mo(lo.UNEXPECTED_ERROR);return[n,s]}function N$(e){const t=jt(e.isCE?M$:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Mo(e.isCE?lo.NOT_INSTALLED_WITH_PROVIDE:lo.UNEXPECTED_ERROR);return t}function I$(e,t){return h1(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function L$(e){return e.mode==="composition"?e.global:e.global.__composer}function r_(e,t,n=!1){let s=null;const o=t.root;let i=$$(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[GM]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function $$(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function F$(e,t,n){mn(()=>{},t),Cn(()=>{const s=n;e.__deleteInstance(t);const o=s[$c];o&&(o(),delete s[$c])},t)}const O$=["locale","fallbackLocale","availableLocales"],l_=["t","rt","d","n","tm","te"];function R$(e,t){const n=Object.create(null);return O$.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Mo(lo.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,l_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Mo(lo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,l_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const B$=Xe({name:"i18n-d",props:fs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Pk),setup(e,t){const n=e.i18n||Ot({useScope:e.scope,__useComponent:!0});return QM(e,t,UM,(...s)=>n[oy](...s))}}),a_=B$;m$();GL(TL);YL(jL);ZL(Jv);if(__INTLIFY_PROD_DEVTOOLS__){const e=ya();e.__INTLIFY__=!0,NL(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const D$="modulepreload",P$=function(e){return"/"+e},c_={},io=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=P$(c),c in c_)return;c_[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":D$,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)})};async function Hs(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 W$(e)}function H$(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||Hs(e)}function W$(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}const Pt={permission:"dimi-web.permission",activeWorkspace:"dimi-active-workspace",planMode:"dimi-web.plan-mode",swarmMode:"dimi-web.swarm-mode",uiFontSize:"dimi-web.ui-font-size",starredModels:"dimi-web.starred-models",unread:"dimi-web.unread",onboarded:"dimi-web.onboarded",accent:"dimi-web.accent",colorScheme:"dimi-web.color-scheme",hiddenWorkspaces:"dimi-web.hidden-workspaces",collapsedWorkspaces:"dimi-web.collapsed-workspaces",workspaceOrder:"dimi-web.workspace-order",workspaceNameOverrides:"dimi-web.workspace-name-overrides",workspaceSort:"dimi-web.workspace-sort",conversationToc:"dimi-web.beta-toc",notifyOnComplete:"dimi-web.notify-on-complete",notifyOnQuestion:"dimi-web.notify-on-question",notifyOnApproval:"dimi-web.notify-on-approval",soundOnComplete:"dimi-web.sound-on-complete",inputHistory:"dimi-web.input-history",locale:"dimi-locale",clientId:"dimi-web.client-id",debug:"dimi-web.debug",openInLastTarget:"dimi-web.open-in.last-target",sidebarCollapsed:"dimi-web.sidebar-collapsed",sidebarWidth:"dimi-web.sidebar-width",codeFont:"dimi-web.code-font",contentAlign:"dimi-web.content-align",theme:"dimi-web.theme",thinking:"dimi-web.thinking"};function u_(e){return`dimi-web.draft.${e&&e.length>0?e:"__new__"}`}function ss(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ps(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Oa(e){try{globalThis.localStorage.removeItem(e)}catch{}}function g1(e){const t=ss(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Af(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Hk(){const e=ss(Pt.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 Wk(e){const n={...Hk()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ps(Pt.unread,JSON.stringify(n))}function z$(){const e=g1(Pt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function dg(e){Af(Pt.collapsedWorkspaces,Array.from(e))}function U$(){const e=g1(Pt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function JM(e){Af(Pt.workspaceOrder,Array.from(e))}function Eh(){const e=g1(Pt.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 d_(e){Af(Pt.workspaceNameOverrides,e)}function q$(){return ss(Pt.workspaceSort)}function e6(e){ps(Pt.workspaceSort,e)}function j$(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 V$(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 K$(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 G$(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const Y$={"&":"&","<":"<",">":">",'"':""","'":"'"};function f_(e){return e.replace(/[&<>"']/g,t=>Y$[t]??t)}function Z$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X$(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 h_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return h_(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 h_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function fg(e,t){const n=f_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(Z$(f_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Mc=se(0),Q$=["type","disabled","aria-label"],J$=Xe({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=se();return t({el:n}),(s,o)=>(x(),E("button",{ref_key:"el",ref:n,class:He(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Rn(s.$slots,"default",{},void 0,!0)],10,Q$))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Wn=dt(J$,[["__scopeId","data-v-cf3e49cd"]]),eF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tF(e,t){return x(),E("svg",eF,[...t[0]||(t[0]=[S("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),S("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const nF=vt({name:"dimi-add-conversation",render:tF}),sF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oF(e,t){return x(),E("svg",sF,[...t[0]||(t[0]=[S("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const iF=vt({name:"dimi-folder",render:oF}),rF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lF=["clip-path"],aF=["id"];function cF(e,t){return x(),E("svg",rF,[S("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[S("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,lF),S("defs",null,[S("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[S("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,aF)])])}const uF=vt({name:"dimi-folder-open",render:cF,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),dF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fF(e,t){return x(),E("svg",dF,[...t[0]||(t[0]=[S("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),S("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),S("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const hF=vt({name:"dimi-more",render:fF}),pF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mF(e,t){return x(),E("svg",pF,[...t[0]||(t[0]=[S("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const gF=vt({name:"dimi-search",render:mF}),vF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function yF(e,t){return x(),E("svg",vF,[...t[0]||(t[0]=[S("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),S("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const kF=vt({name:"dimi-setting",render:yF}),bF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xF(e,t){return x(),E("svg",bF,[...t[0]||(t[0]=[S("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[S("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),S("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const wF=vt({name:"tabler-layout-sidebar-left-collapse",render:xF}),_F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SF(e,t){return x(),E("svg",_F,[...t[0]||(t[0]=[S("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[S("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),S("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const CF=vt({name:"tabler-layout-sidebar-left-expand",render:SF}),AF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MF(e,t){return x(),E("svg",AF,[...t[0]||(t[0]=[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const EF=vt({name:"tabler-paperclip",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return x(),E("svg",TF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const IF=vt({name:"ri-add-line",render:NF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $F(e,t){return x(),E("svg",LF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const FF=vt({name:"ri-alert-line",render:$F}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return x(),E("svg",OF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const BF=vt({name:"ri-archive-line",render:RF}),DF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PF(e,t){return x(),E("svg",DF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const HF=vt({name:"ri-arrow-down-line",render:PF}),WF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zF(e,t){return x(),E("svg",WF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const UF=vt({name:"ri-arrow-down-s-line",render:zF}),qF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jF(e,t){return x(),E("svg",qF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const VF=vt({name:"ri-arrow-go-back-line",render:jF}),KF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GF(e,t){return x(),E("svg",KF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const YF=vt({name:"ri-arrow-right-line",render:GF}),ZF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return x(),E("svg",ZF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const QF=vt({name:"ri-arrow-right-s-line",render:XF}),JF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eO(e,t){return x(),E("svg",JF,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const p_=vt({name:"ri-arrow-up-line",render:eO}),tO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nO(e,t){return x(),E("svg",tO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const sO=vt({name:"ri-arrow-up-s-line",render:nO}),oO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iO(e,t){return x(),E("svg",oO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const rO=vt({name:"ri-braces-line",render:iO}),lO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aO(e,t){return x(),E("svg",lO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const cO=vt({name:"ri-calendar-close-line",render:aO}),uO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dO(e,t){return x(),E("svg",uO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const fO=vt({name:"ri-calendar-schedule-line",render:dO}),hO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pO(e,t){return x(),E("svg",hO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const mO=vt({name:"ri-calendar-todo-line",render:pO}),gO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vO(e,t){return x(),E("svg",gO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const yO=vt({name:"ri-check-line",render:vO}),kO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bO(e,t){return x(),E("svg",kO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const xO=vt({name:"ri-close-line",render:bO}),wO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _O(e,t){return x(),E("svg",wO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const SO=vt({name:"ri-code-line",render:_O}),CO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AO(e,t){return x(),E("svg",CO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const MO=vt({name:"ri-collapse-diagonal-line",render:AO}),EO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TO(e,t){return x(),E("svg",EO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const NO=vt({name:"ri-download-line",render:TO}),IO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LO(e,t){return x(),E("svg",IO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const $O=vt({name:"ri-draggable",render:LO}),FO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OO(e,t){return x(),E("svg",FO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const RO=vt({name:"ri-equalizer-line",render:OO}),BO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DO(e,t){return x(),E("svg",BO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const PO=vt({name:"ri-expand-diagonal-line",render:DO}),HO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WO(e,t){return x(),E("svg",HO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const zO=vt({name:"ri-external-link-line",render:WO}),UO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qO(e,t){return x(),E("svg",UO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const jO=vt({name:"ri-file-add-line",render:qO}),VO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KO(e,t){return x(),E("svg",VO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const GO=vt({name:"ri-file-copy-line",render:KO}),YO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZO(e,t){return x(),E("svg",YO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const XO=vt({name:"ri-file-edit-line",render:ZO}),QO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JO(e,t){return x(),E("svg",QO,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const m_=vt({name:"ri-file-line",render:JO}),eR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tR(e,t){return x(),E("svg",eR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const nR=vt({name:"ri-file-text-line",render:tR}),sR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oR(e,t){return x(),E("svg",sR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const iR=vt({name:"ri-flashlight-line",render:oR}),rR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lR(e,t){return x(),E("svg",rR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const aR=vt({name:"ri-folder-add-line",render:lR}),cR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uR(e,t){return x(),E("svg",cR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const dR=vt({name:"ri-folder-fill",render:uR}),fR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hR(e,t){return x(),E("svg",fR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const pR=vt({name:"ri-git-fork-line",render:hR}),mR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gR(e,t){return x(),E("svg",mR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const vR=vt({name:"ri-git-pull-request-line",render:gR}),yR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kR(e,t){return x(),E("svg",yR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const bR=vt({name:"ri-global-line",render:kR}),xR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wR(e,t){return x(),E("svg",xR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const g_=vt({name:"ri-image-line",render:wR}),_R={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SR(e,t){return x(),E("svg",_R,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const CR=vt({name:"ri-information-line",render:SR}),AR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MR(e,t){return x(),E("svg",AR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const ER=vt({name:"ri-links-line",render:MR}),TR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NR(e,t){return x(),E("svg",TR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const IR=vt({name:"ri-list-check",render:NR}),LR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $R(e,t){return x(),E("svg",LR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const FR=vt({name:"ri-list-unordered",render:$R}),OR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RR(e,t){return x(),E("svg",OR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const BR=vt({name:"ri-login-box-line",render:RR}),DR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PR(e,t){return x(),E("svg",DR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const HR=vt({name:"ri-mail-line",render:PR}),WR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zR(e,t){return x(),E("svg",WR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const UR=vt({name:"ri-message-line",render:zR}),qR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jR(e,t){return x(),E("svg",qR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const VR=vt({name:"ri-pause-fill",render:jR}),KR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GR(e,t){return x(),E("svg",KR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const YR=vt({name:"ri-pencil-line",render:GR}),ZR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XR(e,t){return x(),E("svg",ZR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const QR=vt({name:"ri-play-fill",render:XR}),JR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eB(e,t){return x(),E("svg",JR,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const tB=vt({name:"ri-question-line",render:eB}),nB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sB(e,t){return x(),E("svg",nB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const oB=vt({name:"ri-sort-desc",render:sB}),iB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rB(e,t){return x(),E("svg",iB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const lB=vt({name:"ri-sparkling-line",render:rB}),aB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cB(e,t){return x(),E("svg",aB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const uB=vt({name:"ri-star-fill",render:cB}),dB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fB(e,t){return x(),E("svg",dB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const hB=vt({name:"ri-star-line",render:fB}),pB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mB(e,t){return x(),E("svg",pB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const gB=vt({name:"ri-stop-fill",render:mB}),vB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yB(e,t){return x(),E("svg",vB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const kB=vt({name:"ri-subtract-line",render:yB}),bB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xB(e,t){return x(),E("svg",bB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const wB=vt({name:"ri-target-line",render:xB}),_B={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SB(e,t){return x(),E("svg",_B,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const CB=vt({name:"ri-terminal-box-line",render:SB}),AB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MB(e,t){return x(),E("svg",AB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const EB=vt({name:"ri-time-line",render:MB}),TB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NB(e,t){return x(),E("svg",TB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const IB=vt({name:"ri-tools-line",render:NB}),LB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $B(e,t){return x(),E("svg",LB,[...t[0]||(t[0]=[S("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const FB=vt({name:"ri-user-line",render:$B}),OB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
+
<path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
|
|
40
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
|
|
41
|
+
</svg>
|
|
42
|
+
`,RB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
+
<path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
|
|
44
|
+
</svg>
|
|
45
|
+
`,BB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
<g clip-path="url(#clip0_4626_2033)">
|
|
47
|
+
<path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
|
|
48
|
+
</g>
|
|
49
|
+
<defs>
|
|
50
|
+
<clipPath id="clip0_4626_2033">
|
|
51
|
+
<rect width="24" height="24" fill="white"/>
|
|
52
|
+
</clipPath>
|
|
53
|
+
</defs>
|
|
54
|
+
</svg>
|
|
55
|
+
`,DB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
+
<path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
|
|
57
|
+
<path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
|
|
58
|
+
<path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
|
|
59
|
+
</svg>
|
|
60
|
+
`,PB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
+
<path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
|
|
62
|
+
</svg>
|
|
63
|
+
`,HB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
64
|
+
<path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
|
|
65
|
+
<path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
|
|
66
|
+
</svg>
|
|
67
|
+
`,WB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',zB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',UB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',qB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',jB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',VB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',KB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',GB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',YB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',ZB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',XB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',v_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',QB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',JB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',eD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',tD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',nD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',sD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',oD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',iD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',rD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',lD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',aD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',cD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',uD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',dD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',fD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',hD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',pD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',y_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',mD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',gD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',vD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',yD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',kD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',bD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',xD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',k_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',wD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',_D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',SD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',CD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',AD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',MD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',ED='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',TD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',ND='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',ID='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',LD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',$D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',FD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',OD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',RD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',BD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',DD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',PD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',HD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',WD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',zD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',UD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',t6={sm:14,md:16,lg:20};function bt(e,t){return{component:e,svg:t}}const n6={plus:bt(IF,qB),"chat-new":bt(nF,OB),"calendar-close":bt(cO,eD),"calendar-schedule":bt(fO,tD),"calendar-todo":bt(mO,nD),close:bt(xO,oD),check:bt(yO,sD),archive:bt(BF,VB),search:bt(gF,PB),copy:bt(GO,hD),link:bt(ER,_D),"external-link":bt(zO,dD),download:bt(NO,lD),undo:bt(VF,YB),send:bt(p_,v_),image:bt(g_,k_),settings:bt(kF,HB),sliders:bt(RO,cD),"log-in":bt(BR,AD),"chevron-down":bt(UF,GB),"chevron-right":bt(QF,XB),"chevron-up":bt(sO,QB),"arrow-up":bt(p_,v_),"arrow-down":bt(HF,KB),"arrow-right":bt(YF,ZB),minus:bt(kB,DD),"panel-collapse":bt(wF,WB),"panel-expand":bt(CF,zB),expand:bt(PO,uD),collapse:bt(MO,rD),list:bt(FR,CD),sort:bt(oB,$D),grip:bt($O,aD),folder:bt(uF,BB),"folder-closed":bt(iF,RB),"folder-plus":bt(aR,vD),"folder-solid":bt(dR,yD),file:bt(m_,y_),"file-text":bt(nR,mD),"file-edit":bt(XO,pD),"file-plus":bt(jO,fD),"file-off":bt(m_,y_),attachment:bt(EF,UB),"image-off":bt(g_,k_),code:bt(SO,iD),terminal:bt(CB,HD),pencil:bt(YR,ND),tool:bt(IB,zD),glob:bt(rO,JB),globe:bt(bR,xD),"check-list":bt(IR,SD),bolt:bt(iR,gD),"git-fork":bt(pR,kD),"git-pull-request":bt(vR,bD),message:bt(UR,ED),mail:bt(HR,MD),user:bt(FB,UD),info:bt(CR,wD),"help-circle":bt(tB,LD),"alert-triangle":bt(FF,jB),clock:bt(EB,WD),sparkles:bt(lB,FD),target:bt(wB,PD),pause:bt(VR,TD),play:bt(QR,ID),stop:bt(gB,BD),star:bt(uB,OD),"star-outline":bt(hB,RD),"dots-horizontal":bt(hF,DB)};function qD(e){return n6[e]}function jD(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Ec(e,t="md"){const n=n6[e];return n?jD(n.svg,t6[t]):""}const e4e=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],et=Xe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>qD(t.name)),s=D(()=>t6[t.size]);return(o,i)=>n.value?(x(),Ae(Ms(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ge("",!0)}}),VD={key:0,class:"ui-dialog__head"},KD={class:"ui-dialog__titles"},GD={key:0,class:"ui-dialog__title"},YD={key:1,class:"ui-dialog__desc"},ZD={class:"ui-dialog__body"},XD={key:1,class:"ui-dialog__foot"},QD='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',JD=Xe({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=se(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(QD)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Je(()=>n.open,async d=>{if(d){Mc.value+=1,i=document.activeElement,await yt();const f=a(),h=l();(f??h[0]??o.value)?.focus()}else Mc.value=Math.max(0,Mc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),Qn(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Mc.value=Math.max(0,Mc.value-1))}),(d,f)=>(x(),Ae(c1,{to:"body"},[e.open?(x(),E("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[S("div",{ref_key:"panel",ref:o,class:He(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),E("div",VD,[Rn(d.$slots,"head",{},()=>[S("div",KD,[e.title?(x(),E("div",GD,B(e.title),1)):ge("",!0),e.description?(x(),E("div",YD,B(e.description),1)):ge("",!0)])],!0),ve(Wn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Fe(()=>[ve(et,{name:"close",size:"md"})]),_:1})])):ge("",!0),S("div",ZD,[Rn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),E("div",XD,[Rn(d.$slots,"foot",{},void 0,!0)])):ge("",!0)],2)],32)):ge("",!0)]))}}),Hr=dt(JD,[["__scopeId","data-v-5ae91c30"]]),eP={class:"sd-head"},tP=["placeholder","aria-label"],nP=["aria-selected","onClick","onMousemove"],sP={class:"sd-meta"},oP=["innerHTML"],iP={class:"sd-time"},rP=["innerHTML"],lP=["innerHTML"],aP={key:1,class:"sd-empty"},cP={class:"sd-hint"},uP=200,dP=Xe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=se(!0),r=se(""),l=se(null),a=se(null),c=D(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const b=v.title??"",C=v.lastPrompt??"",I=v.workspaceName??"",T=k.length>0&&b.toLowerCase().includes(k),M=k.length>0&&C.toLowerCase().includes(k),$=k.length>0&&I.toLowerCase().includes(k);if(!(k.length>0&&!T&&!M&&!$)&&(g.push({session:v,inTitle:T,inWorkspace:$,snippetText:C?X$(C,r.value):""}),g.length>=uP))break}return g}),u=se(0);Je(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 yt(),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 y(k){k.key==="ArrowDown"?(k.preventDefault(),h(1)):k.key==="ArrowUp"?(k.preventDefault(),h(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return mn(()=>{l.value?.focus()}),(k,g)=>(x(),Ae(Hr,{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:Fe(()=>[S("div",eP,[ve(et,{class:"sd-search-icon",name:"search",size:"md"}),Fn(S("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:A(n)("sidebar.searchPlaceholder"),"aria-label":A(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:y},null,40,tP),[[po,r.value]])])]),foot:Fe(()=>[S("span",cP,B(A(n)("sidebar.searchHint")),1)]),default:Fe(()=>[S("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),E(De,{key:0},rt(c.value,(v,b)=>(x(),E("button",{key:v.session.id,class:He(["sd-row",{on:b===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":b===u.value,onClick:C=>p(v.session.id),onMousemove:C=>u.value=b},[S("span",sP,[ve(et,{class:"sd-folder",name:"folder-closed",size:"sm"}),S("span",{class:"sd-ws",innerHTML:A(fg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,oP),S("span",iP,B(v.session.time),1)]),S("span",{class:"sd-title",innerHTML:A(fg)(v.session.title,v.inTitle?r.value:"")},null,8,rP),v.snippetText?(x(),E("span",{key:0,class:"sd-snippet",innerHTML:A(fg)(v.snippetText,r.value)},null,8,lP)):ge("",!0)],42,nP))),128)):(x(),E("div",aP,B(A(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),fP=dt(dP,[["__scopeId","data-v-546f6e6f"]]),hP=["aria-label"],pP=Xe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),E("span",{class:He(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[S("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[S("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),S("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,hP))}}),$o=dt(pP,[["__scopeId","data-v-abb00d1e"]]),mP={key:0,class:"ui-badge__dot","aria-hidden":"true"},gP=Xe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),E("span",{class:He(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),E("span",mP)):ge("",!0),Rn(t.$slots,"default",{},void 0,!0)],2))}}),Ji=dt(gP,[["__scopeId","data-v-44fb1da1"]]),vP=Xe({__name:"Menu",setup(e,{expose:t}){const n=se();return t({el:n}),(s,o)=>(x(),E("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Rn(s.$slots,"default",{},void 0,!0)],512))}}),Ma=dt(vP,[["__scopeId","data-v-3366462d"]]),yP={key:0,class:"ui-menu-sep",role:"separator"},kP=["disabled"],bP=Xe({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),E("div",yP)):(x(),E("button",{key:1,class:He(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Rn(t.$slots,"default",{},void 0,!0)],10,kP))}}),_n=dt(bP,[["__scopeId","data-v-da8fb1fa"]]),Jr=6,el=8,xP=150,wP=Xe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=se(),s=se(),o=se(!1),i=se(!1),r=se({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const y=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,b=window.innerHeight;let C=t.placement;C==="top"&&y.top-Jr-g<el?C="bottom":C==="bottom"&&y.bottom+Jr+g>b-el?C="top":C==="left"&&y.left-Jr-k<el?C="right":C==="right"&&y.right+Jr+k>v-el&&(C="left");let I=0,T=0;C==="top"?(I=y.top-Jr-g,T=y.left+y.width/2-k/2):C==="bottom"?(I=y.bottom+Jr,T=y.left+y.width/2-k/2):C==="left"?(I=y.top+y.height/2-g/2,T=y.left-Jr-k):(I=y.top+y.height/2-g/2,T=y.right+Jr),T=Math.min(Math.max(T,el),v-el-k),I=Math.min(Math.max(I,el),b-el-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(I)}px`,left:`${Math.round(T)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,yt(()=>{u(),i.value=!0})},xP))}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 mn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const y=m.firstElementChild??null;y!==a&&(f(),p(y??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),Qn(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,y)=>(x(),E(De,null,[S("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Rn(m.$slots,"default",{},void 0,!0)],512),(x(),Ae(c1,{to:"body"},[Fn(S("div",{ref_key:"bubble",ref:s,class:He(["ui-tip__bubble",{positioned:i.value}]),style:Jt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},B(e.text),7),[[ci,o.value]])]))],64))}}),en=dt(wP,[["__scopeId","data-v-3884c2bc"]]),_P={class:"row"},SP={class:"lead","aria-hidden":"true"},CP={key:1,class:"unread-dot"},AP={class:"left"},MP=["onKeydown"],EP={class:"act"},TP={class:"ts"},NP={class:"menu-time"},IP=Xe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:s}=Ot(),o=e,i=n;function r(_){const R=new Date(_);if(Number.isNaN(R.getTime()))return _;const z=W=>String(W).padStart(2,"0");return`${R.getFullYear()}-${z(R.getMonth()+1)}-${z(R.getDate())} ${z(R.getHours())}:${z(R.getMinutes())}`}const l=D(()=>o.session.updatedAt?r(o.session.updatedAt):o.session.time),a=se(!1),c=se(null),u=se(null),d=se({});function f(_){const R=_.target;u.value?.el?.contains(R)||c.value?.el?.contains(R)||m()}function h(){const _=c.value?.el;if(!_)return;const R=u.value?.el,z=_.getBoundingClientRect(),W=4,L=8,O=R?.offsetHeight??0,q=R?.offsetWidth??0;let X=z.bottom+W;X+O>window.innerHeight-L&&(X=Math.max(L,z.top-O-W));let ie=z.right-q;ie<L&&(ie=L),d.value={top:`${Math.round(X)}px`,left:`${Math.round(ie)}px`}}async function p(_){if(_.stopPropagation(),a.value){m();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",m),await yt(),h()}function m(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)}Cn(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)});const y=se(!1),k=se(""),g=se(null);async function v(){m(),y.value=!0,k.value=o.session.title,await yt();try{g.value?.focus(),g.value?.select()}catch{}}function b(){const _=k.value.trim();_&&i("rename",o.session.id,_),y.value=!1}function C(){y.value=!1}const I=se(!1),T=se(!1);async function M(){const _=await Hs(o.session.id);I.value=_,T.value=!_,setTimeout(()=>{I.value=!1,T.value=!1,m()},1500)}function $(){m(),i("fork",o.session.id)}function N(){m(),i("export",o.session.id)}function F(){m(),i("archive",o.session.id)}return t({closeMenu:m}),(_,R)=>(x(),E("div",{class:He(["se",{on:e.active}]),onClick:R[4]||(R[4]=z=>i("select",e.session.id))},[S("div",_P,[S("span",SP,[e.session.busy?(x(),Ae($o,{key:0,size:"sm"})):e.unread?(x(),E("span",CP)):ge("",!0)]),S("div",AP,[y.value?Fn((x(),E("input",{key:0,ref_key:"renameInputRef",ref:g,"onUpdate:modelValue":R[0]||(R[0]=z=>k.value=z),class:"rename-input",onClick:R[1]||(R[1]=Mt(()=>{},["stop"])),onKeydown:[Yi(Mt(b,["stop"]),["enter"]),Yi(Mt(C,["stop"]),["esc"])],onBlur:b},null,40,MP)),[[po,k.value]]):(x(),E("span",{key:1,class:"t",onDblclick:Mt(v,["stop"])},B(e.session.title),33))]),ve(en,{text:A(s)("workspace.awaitingAnswerTitle")},{default:Fe(()=>[!y.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(x(),Ae(Ji,{key:0,variant:"info",size:"sm"},{default:Fe(()=>[tt(B(A(s)("workspace.awaitingAnswer")),1)]),_:1})):ge("",!0)]),_:1},8,["text"]),ve(en,{text:A(s)("workspace.awaitingPermissionTitle")},{default:Fe(()=>[!y.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(x(),Ae(Ji,{key:0,variant:"warning",size:"sm"},{default:Fe(()=>[tt(B(A(s)("workspace.awaitingPermission")),1)]),_:1})):ge("",!0)]),_:1},8,["text"]),ve(en,{text:A(s)("workspace.abortedTitle")},{default:Fe(()=>[!y.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(x(),Ae(Ji,{key:0,variant:"danger",size:"sm"},{default:Fe(()=>[tt(B(A(s)("workspace.aborted")),1)]),_:1})):ge("",!0)]),_:1},8,["text"]),S("span",EP,[S("span",TP,B(e.session.time),1),y.value?ge("",!0):(x(),Ae(Wn,{key:0,ref_key:"kebabRef",ref:c,class:He(["kebab",{open:a.value}]),size:"sm",label:A(s)("sidebar.options"),onClick:R[2]||(R[2]=Mt(z=>p(z),["stop"]))},{default:Fe(()=>[ve(et,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),Ae(c1,{to:"body"},[a.value?(x(),Ae(Ma,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:Jt(d.value),onClick:R[3]||(R[3]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{danger:T.value,onClick:M},{default:Fe(()=>[ve(et,{name:I.value?"check":"copy",size:"sm"},null,8,["name"]),tt(" "+B(T.value?A(s)("sidebar.copyFailed"):I.value?A(s)("sidebar.copied"):A(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ve(_n,{separator:""}),ve(_n,{onClick:v},{default:Fe(()=>[ve(et,{name:"pencil",size:"sm"}),tt(" "+B(A(s)("sidebar.rename")),1)]),_:1}),ve(_n,{onClick:$},{default:Fe(()=>[ve(et,{name:"git-fork",size:"sm"}),tt(" "+B(A(s)("sidebar.fork")),1)]),_:1}),ve(_n,{onClick:N},{default:Fe(()=>[ve(et,{name:"download",size:"sm"}),tt(" "+B(A(s)("sidebar.export")),1)]),_:1}),ve(_n,{danger:"",onClick:F},{default:Fe(()=>[ve(et,{name:"archive",size:"sm"}),tt(" "+B(A(s)("sidebar.archive")),1)]),_:1}),ve(_n,{separator:""}),S("div",NP,B(l.value),1)]),_:1},8,["style"])):ge("",!0)]))],2))}}),LP=dt(IP,[["__scopeId","data-v-b8e37ad9"]]),$P={class:"gh-top"},FP={class:"gh-name"},OP=["inert"],RP=["disabled"],BP={class:"show-more-label"},DP={class:"show-more-label"},PP={key:2,class:"group-empty"},HP=Xe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=D({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=D(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(h=>h.id===s.activeId)){const h=s.group.sessions.find(p=>p.id===s.activeId);if(h)return[...f,h]}return f}),l=D(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,h)=>(x(),E("div",{class:He(["group",{dragging:e.dragging}])},[S("div",{class:He(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=Mt(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"))},[S("div",$P,[e.isCollapsed(e.group.workspace.id)?(x(),Ae(et,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),Ae(et,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),Ae(en,{key:2,text:e.group.workspace.root},{default:Fe(()=>[S("span",FP,B(e.group.workspace.name),1)]),_:1},8,["text"])):Fn((x(),E("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]=Yi(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=Yi(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=Mt(()=>{},["stop"]))},null,544)),[[po,i.value]]),e.renamingId!==e.group.workspace.id?(x(),E("div",{key:4,class:He(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ve(Wn,{class:He(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:A(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=Mt(p=>o("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Fe(()=>[ve(et,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ve(Wn,{class:"gh-add",size:"sm",label:A(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=Mt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Fe(()=>[ve(et,{name:"chat-new"})]),_:1},8,["label"])],2)):ge("",!0)])],34),S("div",{class:He(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),E(De,null,rt(r.value,p=>(x(),Ae(LP,{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,y)=>o("renameSession",m,y)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m)),onExport:h[14]||(h[14]=m=>o("exportSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),E("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=Mt(p=>o("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=S("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),S("span",BP,B(e.group.loadingMore?A(n)("sidebar.loadingMore"):A(n)("sidebar.showMore",{count:a()})),1)],8,RP)):ge("",!0),l.value?(x(),E("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=Mt(p=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=S("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),S("span",DP,B(e.isExpanded(e.group.workspace.id)?A(n)("sidebar.showLess"):A(n)("sidebar.showAll",{count:c()})),1)])):ge("",!0),e.group.sessions.length===0?(x(),E("div",PP,B(A(n)("sidebar.noSessions")),1)):ge("",!0)],10,OP)],2))}}),WP=dt(HP,[["__scopeId","data-v-775de356"]]),zP="kimi_desktop",UP="platform",b_="dimi-desktop",x_="dimi-desktop-platform";function qP(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(zP)?(sessionStorage.setItem(b_,"1"),e=!0):e=e||sessionStorage.getItem(b_)==="1";const s=n.get(UP);s?(sessionStorage.setItem(x_,s),t=s):t=sessionStorage.getItem(x_)}catch{}return{isDesktop:e,platform:t}}const ly=qP(),jP=ly.isDesktop,Gc=ly.isDesktop&&ly.platform==="darwin",VP={class:"ui-kbd"},KP=Xe({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),E("span",VP,[(x(!0),E(De,null,rt(e.keys,s=>(x(),E("kbd",{key:s,class:"ui-kbd__key"},B(s),1))),128))]))}}),mr=dt(KP,[["__scopeId","data-v-f7d12d7c"]]),GP={class:"ch"},YP={class:"ch-brand"},ZP={class:"btn-wrap"},XP={class:"search-input"},QP={key:0,class:"empty"},JP={class:"side-section-label"},eH={class:"side-section-title"},tH={class:"side-section-actions"},nH=["onDragover","onDrop"],sH={class:"side-footer"},oH={class:"section-menu-check"},iH={class:"section-menu-check"},rH=1e3,lH=Xe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Ot(),s=!1,o=e,i=t,r=se(!1),l=u()?["⌘","K"]:["Ctrl","K"];function a(){i("loadAllSessions"),r.value=!0}function c(Ye){(Ye.metaKey||Ye.ctrlKey)&&Ye.key.toLowerCase()==="k"&&(Ye.preventDefault(),a())}mn(()=>window.addEventListener("keydown",c)),Qn(()=>window.removeEventListener("keydown",c));function u(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Ye=navigator.userAgentData;return Ye?.platform==="macOS"||Ye?.platform==="iOS"}const d=se(!1);function f(Ye){d.value=Ye.target.scrollTop>0}const h=se(new Set(z$()));function p(Ye){return h.value.has(Ye)}function m(Ye){const qe=new Set(h.value);qe.has(Ye)?qe.delete(Ye):qe.add(Ye),h.value=qe,dg(qe)}function y(){const Ye=new Set(o.groups.map(qe=>qe.workspace.id));h.value=Ye,dg(Ye)}function k(){const Ye=new Set;h.value=Ye,dg(Ye)}const g=D(()=>o.groups.length>0&&o.groups.every(Ye=>h.value.has(Ye.workspace.id))),v=se(new Set);function b(Ye){return v.value.has(Ye)}function C(Ye){const qe=new Set(v.value);qe.has(Ye)?qe.delete(Ye):qe.add(Ye),v.value=qe}function I(Ye){if(!v.value.has(Ye)){const qe=new Set(v.value);qe.add(Ye),v.value=qe}i("loadMoreSessions",Ye)}const T=se(null),M=se(null);function $(Ye){T.value=Ye}function N(){T.value=null,M.value=null}function F(Ye){const qe=Ye.currentTarget.getBoundingClientRect();return Ye.clientY<qe.top+qe.height/2?"before":"after"}function _(Ye,qe){T.value===null||T.value===qe||(Ye.preventDefault(),Ye.dataTransfer&&(Ye.dataTransfer.dropEffect="move"),M.value={id:qe,position:F(Ye)})}function R(Ye){const qe=T.value,It=M.value?.id===Ye?M.value.position:"before";if(M.value=null,T.value=null,!qe||qe===Ye)return;const Ut=K$(o.groups.map(Vt=>Vt.workspace.id),qe,Ye,It);i("reorderWorkspaces",Ut)}function z(Ye,qe){qe.target.closest(".gh-more, .gh-add")||m(Ye)}function W(Ye){i("select",Ye)}const L=se(null),O=se(""),q=se(null);function X(){return q}function ie(Ye,qe){L.value=Ye,O.value=qe,yt().then(()=>q.value?.focus())}function U(){const Ye=L.value,qe=O.value.trim();Ye&&qe&&i("renameWorkspace",Ye,qe),L.value=null}function j(){L.value=null}function te(Ye){O.value=Ye}const ae=se(!1),oe=se(null),re=se({}),xe=se(null);function pe(Ye){xe.value?.el&&!xe.value.el.contains(Ye.target)&&ue()}function Ee(Ye,qe){qe.preventDefault(),qe.stopPropagation(),oe.value=Ye,re.value={top:`${qe.clientY}px`,left:`${qe.clientX}px`},ae.value=!0,document.addEventListener("mousedown",pe,!0)}function ue(){ae.value=!1,document.removeEventListener("mousedown",pe,!0),oe.value=null}function Y(){oe.value&&Hs(oe.value.root),ue()}function Q(){oe.value&&ie(oe.value.id,oe.value.name),ue()}function P(){const Ye=oe.value;Ye&&(ue(),i("deleteWorkspace",Ye.id))}const G=se(null),ye=se(null),he=se({}),fe=se(null);function K(Ye){const qe=Ye.target;qe.closest(".gh-more")||qe.closest(".ws-menu")||me()}async function ne(Ye,qe){if(G.value===Ye.id){me();return}const It=qe.currentTarget;ye.value=Ye,G.value=Ye.id,document.addEventListener("mousedown",K),window.addEventListener("resize",me),await yt();const Ut=fe.value?.el,Vt=It.getBoundingClientRect(),kn=4,ft=8,cn=Ut?.offsetHeight??0,un=Ut?.offsetWidth??0;let Bn=Vt.bottom+kn;Bn+cn>window.innerHeight-ft&&(Bn=Math.max(ft,Vt.top-cn-kn));let Mn=Vt.right-un;Mn<ft&&(Mn=ft),he.value={top:`${Math.round(Bn)}px`,left:`${Math.round(Mn)}px`}}function me(){G.value=null,ye.value=null,document.removeEventListener("mousedown",K),window.removeEventListener("resize",me)}function we(Ye){Hs(Ye.root),me()}function Te(Ye){ie(Ye.id,Ye.name),me()}function Pe(Ye){me(),i("deleteWorkspace",Ye.id)}const be=se(!1),_e=se({}),Ke=se(null);function Qe(Ye){const qe=Ye.target;qe.closest(".side-section-kebab")||qe.closest(".section-menu")||at()}async function ot(Ye){if(be.value){at();return}const qe=Ye.currentTarget;be.value=!0,document.addEventListener("mousedown",Qe),window.addEventListener("resize",at),await yt();const It=Ke.value?.el,Ut=qe.getBoundingClientRect(),Vt=4,kn=8,ft=It?.offsetHeight??0,cn=It?.offsetWidth??0;let un=Ut.bottom+Vt;un+ft>window.innerHeight-kn&&(un=Math.max(kn,Ut.top-ft-Vt));let Bn=Ut.right-cn;Bn<kn&&(Bn=kn),_e.value={top:`${Math.round(un)}px`,left:`${Math.round(Bn)}px`}}function at(){be.value=!1,document.removeEventListener("mousedown",Qe),window.removeEventListener("resize",at)}function ht(Ye){i("setWorkspaceSortMode",Ye),at()}Qn(()=>{document.removeEventListener("mousedown",pe,!0),document.removeEventListener("mousedown",K),document.removeEventListener("mousedown",Qe),window.removeEventListener("resize",me),window.removeEventListener("resize",at)});const Et=se(null);let Tt;function $t(){const Ye=Et.value;Ye&&(Ye.classList.remove("blink-now"),Ye.getBoundingClientRect(),Ye.classList.add("blink-now"),clearTimeout(Tt),Tt=setTimeout(()=>Ye.classList.remove("blink-now"),300))}const rn=Ci(()=>io(()=>import("./DesignSystemView-Bb01YcYk.js"),__vite__mapDeps([0,1]))),vn=se(!1);let Ht,Zt=!1;function tn(Ye){Zt=!1,clearTimeout(Ht),Ye.currentTarget.setPointerCapture?.(Ye.pointerId),Ht=setTimeout(()=>{Zt=!0,vn.value=!0},rH)}function Gt(Ye){clearTimeout(Ht);const qe=Ye.currentTarget;qe.hasPointerCapture?.(Ye.pointerId)&&qe.releasePointerCapture(Ye.pointerId)}function An(){if(Zt){Zt=!1;return}$t()}return Qn(()=>{clearTimeout(Ht)}),(Ye,qe)=>(x(),E("aside",{class:He(["side",{"macos-desktop":A(Gc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Jt({width:e.collapsed?"0px":e.colWidth+"px"})},[S("div",{class:"col",style:Jt({width:e.colWidth+"px"})},[S("div",GP,[S("div",YP,[A(Gc)?ge("",!0):(x(),E(De,{key:0},[(x(),E("svg",{ref_key:"logoRef",ref:Et,class:He(["ch-logo",{"is-dev":A(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Dimi",onClick:An,onPointerdown:tn,onPointerup:Gt,onPointercancel:Gt},[...qe[21]||(qe[21]=[Ek('<defs data-v-2504adf9><mask id="dimiEyes" maskUnits="userSpaceOnUse" data-v-2504adf9><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-2504adf9></rect><g class="ch-eyes" fill="#000" data-v-2504adf9><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-2504adf9></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-2504adf9></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#dimiEyes)" data-v-2504adf9></rect>',2)])],34)),qe[22]||(qe[22]=S("span",{class:"ch-name"},"Dimi",-1))],64))]),A(Gc)?ge("",!0):(x(),Ae(Wn,{key:0,class:"ch-collapse",size:"sm",label:A(n)("sidebar.collapseSidebar"),onClick:qe[0]||(qe[0]=Mt(It=>i("collapse"),["stop"]))},{default:Fe(()=>[ve(et,{name:"panel-collapse"})]),_:1},8,["label"]))]),S("div",ZP,[S("button",{class:"btn-new-chat",type:"button",onClick:qe[1]||(qe[1]=Mt(It=>i("create"),["stop"]))},[ve(et,{name:"chat-new"}),S("span",null,B(A(n)("sidebar.newChat")),1)]),ge("",!0)]),S("div",{class:He(["search-wrap",{"search-wrap--scrolled":d.value}])},[S("button",{class:"search",type:"button",onClick:a},[ve(et,{class:"search-icon",name:"search"}),S("span",XP,B(A(n)("sidebar.search")),1),ve(mr,{keys:A(l)},null,8,["keys"])])],2),S("div",{class:"sessions",onScroll:f},[e.groups.length===0?(x(),E("div",QP,B(A(n)("workspace.noWorkspace")),1)):(x(),E(De,{key:1},[S("div",JP,[S("span",eH,B(A(n)("sidebar.workspaces")),1),S("div",tH,[ve(Wn,{class:"side-section-toggle",size:"sm",label:g.value?A(n)("sidebar.expandAll"):A(n)("sidebar.collapseAll"),onClick:qe[3]||(qe[3]=Mt(It=>g.value?k():y(),["stop"]))},{default:Fe(()=>[g.value?(x(),Ae(et,{key:0,name:"expand"})):(x(),Ae(et,{key:1,name:"collapse"}))]),_:1},8,["label"]),ve(Wn,{class:"side-section-toggle side-section-kebab",size:"sm",label:A(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":be.value,onClick:qe[4]||(qe[4]=Mt(It=>ot(It),["stop"]))},{default:Fe(()=>[ve(et,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),E(De,null,rt(e.groups,It=>(x(),E("div",{key:It.workspace.id,class:He(["ws-drop-target",{"drop-before":M.value?.id===It.workspace.id&&M.value.position==="before","drop-after":M.value?.id===It.workspace.id&&M.value.position==="after"}]),onDragover:Ut=>_(Ut,It.workspace.id),onDrop:Ut=>R(It.workspace.id)},[ve(WP,{group:It,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":L.value,"rename-value":O.value,"rename-input-ref":X(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":G.value,dragging:T.value===It.workspace.id,"is-collapsed":p,"is-expanded":b,onGroupClick:z,onGroupContextmenu:Ee,onToggleWsMenu:ne,onCreateInWorkspace:qe[5]||(qe[5]=Ut=>i("createInWorkspace",Ut)),onSelectSession:W,onRenameSession:qe[6]||(qe[6]=(Ut,Vt)=>i("rename",Ut,Vt)),onArchiveSession:qe[7]||(qe[7]=Ut=>i("archive",Ut)),onForkSession:qe[8]||(qe[8]=Ut=>i("fork",Ut)),onExportSession:qe[9]||(qe[9]=Ut=>i("export",Ut)),onLoadMore:I,onToggleExpand:C,onConfirmRename:U,onCancelRename:j,onUpdateRenameValue:te,onWsDragstart:$,onWsDragend:N},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,nH))),128))],64))],32),S("div",sH,[S("button",{class:"btn-settings",type:"button",onClick:qe[10]||(qe[10]=Mt(It=>i("openSettings"),["stop"]))},[ve(et,{name:"settings"}),S("span",null,B(A(n)("settings.title")),1)])])],4),ae.value?(x(),Ae(Ma,{key:0,ref_key:"ghMenuRef",ref:xe,class:"gh-menu",style:Jt(re.value),onClick:qe[11]||(qe[11]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{onClick:Y},{default:Fe(()=>[tt(B(A(n)("sidebar.copyPath")),1)]),_:1}),ve(_n,{onClick:Q},{default:Fe(()=>[tt(B(A(n)("sidebar.rename")),1)]),_:1}),ve(_n,{danger:"",onClick:P},{default:Fe(()=>[tt(B(A(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ge("",!0),G.value!==null&&ye.value?(x(),Ae(Ma,{key:1,ref_key:"wsMenuRef",ref:fe,class:"ws-menu",style:Jt(he.value),onClick:qe[15]||(qe[15]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{onClick:qe[12]||(qe[12]=It=>we(ye.value))},{default:Fe(()=>[tt(B(A(n)("sidebar.copyPath")),1)]),_:1}),ve(_n,{separator:""}),ve(_n,{onClick:qe[13]||(qe[13]=It=>Te(ye.value))},{default:Fe(()=>[tt(B(A(n)("sidebar.rename")),1)]),_:1}),ve(_n,{separator:""}),ve(_n,{danger:"",onClick:qe[14]||(qe[14]=It=>Pe(ye.value))},{default:Fe(()=>[tt(B(A(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ge("",!0),be.value?(x(),Ae(Ma,{key:2,ref_key:"sectionMenuRef",ref:Ke,class:"section-menu",style:Jt(_e.value),onClick:qe[18]||(qe[18]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{onClick:qe[16]||(qe[16]=It=>ht("manual"))},{default:Fe(()=>[S("span",oH,[e.workspaceSortMode==="manual"?(x(),Ae(et,{key:0,name:"check",size:"sm"})):ge("",!0)]),tt(" "+B(A(n)("sidebar.sortManual")),1)]),_:1}),ve(_n,{onClick:qe[17]||(qe[17]=It=>ht("recent"))},{default:Fe(()=>[S("span",iH,[e.workspaceSortMode==="recent"?(x(),Ae(et,{key:0,name:"check",size:"sm"})):ge("",!0)]),tt(" "+B(A(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ge("",!0),r.value?(x(),Ae(fP,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:W,onClose:qe[19]||(qe[19]=It=>r.value=!1)},null,8,["sessions","active-id"])):ge("",!0),(x(),Ae(c1,{to:"body"},[vn.value?(x(),Ae(A(rn),{key:0,onClose:qe[20]||(qe[20]=It=>vn.value=!1)})):ge("",!0)]))],6))}}),aH=dt(lH,[["__scopeId","data-v-2504adf9"]]);function cH(e){try{const t=ss(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function uH(e,t){try{ps(e,String(t))}catch{}}function dH(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(hA(o),Math.max(s,Math.round(k))):n}const l=se(r(cH(t)??n)),a=se(!1);function c(k){const g=r(k);l.value=g,uH(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 y(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 Qn(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:y}}const fH=["aria-label"],hH=Xe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),{width:i,dragging:r,onPointerDown:l}=dH({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Je(i,a=>s("update:width",a)),Je(r,a=>s("update:dragging",a)),(a,c)=>(x(),E("div",{class:He(["rh",{dragging:A(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??A(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>A(l)&&A(l)(...u))},[...c[1]||(c[1]=[S("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,fH))}}),w_=dt(hH,[["__scopeId","data-v-877faec4"]]),pH={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},mH={authBannerMessage:"Not signed in · Sign in to Dimi to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Connect a model provider",authPageMessage:"Sign in with a supported account or enter an API key to start a conversation.",authPageLogin:"Choose provider",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},gH={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Dimi",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},vH={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.",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},yH={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},kH={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",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"},bH={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Dimi",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},xH={title:"Sign in with {provider}",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 dimi and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the dimi process and try again."},wH={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"},notConnected:"not connected",modelCount:"{count} models",refresh:"Refresh",signIn:"Sign in",connect:"Connect",logout:"Disconnect",refreshTitle:"Refresh {type}",logoutTitle:"Disconnect {type}",enterApiKey:"Enter API Key",fieldApiKey:"API Key",apiKeyRequired:"API Key cannot be empty",escClose:"Esc to close"},_H={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} 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"},SH={justNow:"just now"},CH={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"},AH={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},MH={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"},EH={panelTitle:"Thinking",close:"Close"},TH={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"},NH={},IH={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",videoNoPreview:"Video 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"}},LH={searching:"Searching…",noMatch:"No matches"},$H={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},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:"Dimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Dimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Dimi 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 Dimi 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"},FH={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Dimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve tool actions; the agent may still ask questions"},auto:{desc:"Fully autonomous — the agent never asks questions"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},OH={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)"}},RH={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},BH={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:"fully autonomous, never asks",permYoloSub:"auto-approve tools, may still ask",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},DH={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},PH={preview:"预览",confirm:"确认",cancel:"取消"},HH={authBannerMessage:"未登录 · 需要登录 Dimi 才能开始对话",authBannerLogin:"登录",authPageTitle:"连接模型提供商",authPageMessage:"登录支持的账号或填写 API Key,然后开始对话。",authPageLogin:"选择提供商",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},WH={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Dimi",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},zH={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},UH={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},qH={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建对话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},jH={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Dimi",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},VH={title:"登录 {provider}",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 dimi 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 dimi 进程后重试"},KH={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},notConnected:"未连接",modelCount:"{count} 个模型",refresh:"刷新",signIn:"登录",connect:"连接",logout:"断开连接",refreshTitle:"刷新 {type}",logoutTitle:"断开 {type}",enterApiKey:"填写 API Key",fieldApiKey:"API Key",apiKeyRequired:"API Key 不能为空",escClose:"Esc 关闭"},GH={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},YH={justNow:"刚刚"},ZH={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:"拒绝并退出"},XH={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},QH={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:"展开"},JH={panelTitle:"思考过程",close:"关闭"},eW={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},tW={},nW={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} · 暂不预览",videoNoPreview:"视频文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},sW={searching:"搜索中…",noMatch:"无匹配"},oW={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},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:"Dimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Dimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Dimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Dimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错"},iW={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Dimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准工具操作,Agent 仍可能提问"},auto:{desc:"完全自主,Agent 不再提问"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},rW={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} 个)"}},lW={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},aW={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},cW={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},uW={title:"Welcome to Dimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},dW={title:"欢迎来使用 Dimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},fW={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Dimi · Turn finished",notifyQuestionTitle:"Dimi · Needs answer",notifyApprovalTitle:"Dimi · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",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…"},hW={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Dimi · 回合完成",notifyQuestionTitle:"Dimi · 待回答",notifyApprovalTitle:"Dimi · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",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:"正在加载全部归档会话…"},pW={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},mW={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},gW={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"},vW={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},yW={en:{common:pH,app:mH,sidebar:gH,workspace:vH,conversation:yH,status:kH,composer:bH,login:xH,providers:wH,model:_H,sessions:SH,approval:CH,question:AH,tasks:MH,thinking:EH,diff:TH,fileTree:NH,filePreview:IH,mention:LH,warnings:$H,commands:FH,tools:OH,layout:RH,mobile:BH,theme:DH,onboarding:uW,settings:fW,header:pW,sideChat:gW},zh:{common:PH,app:HH,sidebar:WH,workspace:zH,conversation:UH,status:qH,composer:jH,login:VH,providers:KH,model:GH,sessions:YH,approval:ZH,question:XH,tasks:QH,thinking:JH,diff:eW,fileTree:tW,filePreview:nW,mention:sW,warnings:oW,commands:iW,tools:rW,layout:lW,mobile:aW,theme:cW,onboarding:dW,settings:hW,header:mW,sideChat:vW}},s6=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function kW(){const e=ss(Pt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const On=E$({legacy:!1,locale:kW(),fallbackLocale:"en",messages:yW});function o6(e){On.global.locale.value=e,ps(Pt.locale,e)}const Yc=On.global.t,bW={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"},xW={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 qa(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return xW[t]??t}function ja(e){const t=bW[qa(e)];return t?Yc(t):e}const wW={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function v1(e){const t=qa(e);let n=wW[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Ec(n,"sm")}const i6=80;function _W(e,t=i6){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function SW(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function CW(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function dn(e){return typeof e=="string"&&e.length>0?e:void 0}function ea(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function AW(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 hg(e){return dn(e.path)??dn(e.file_path)??dn(e.filePath)??dn(e.filename)}const MW=64;function sf(e,t,n=!1){const s=(o,i=i6)=>n?o.trim():_W(o,i);try{const o=CW(t);if(!n&&SW(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(qa(e)){case"read":{const r=hg(o);if(!r)return i();const l=ea(o.offset)??ea(o.line_start)??ea(o.start_line),a=ea(o.limit)??ea(o.length),c=ea(o.line_end)??ea(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=hg(o);return r?s(`${r} ${Yc("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=hg(o);return r?s(r):i()}case"bash":{const r=dn(o.command)??dn(o.cmd)??dn(o.script);return r?s(r,MW):i()}case"grep":case"search":{const r=dn(o.pattern)??dn(o.query)??dn(o.regex),l=dn(o.path)??dn(o.glob)??dn(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=dn(o.pattern)??dn(o.glob)??dn(o.query),l=dn(o.path)??dn(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):dn(o.path)?s(dn(o.path)):i()}case"ls":{const r=dn(o.path)??dn(o.dir)??dn(o.directory)??dn(o.cwd);return r?s(r):i()}case"web_fetch":{const r=dn(o.url)??dn(o.uri);return r?s(AW(r)):i()}case"todo":case"task":{const r=dn(o.description)??dn(o.title)??dn(o.prompt)??dn(o.name)??dn(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(Yc("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function EW(e){try{switch(qa(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Yc("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 Yc("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Yc("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const TW=Xe({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=D(()=>n(t.status));return(o,i)=>(x(),E("span",{class:He(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),of=dt(TW,[["__scopeId","data-v-1936f8c5"]]),NW=["innerHTML"],IW={class:"bh-text"},LW={class:"a"},$W={key:0,class:"p"},FW={class:"rt"},OW=["aria-label"],RW={key:0,class:"tm"},BW=["inert"],DW={class:"bb-pad"},PW=Xe({__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=jt("pinScroll",()=>{}),o=se(null);function i(){n("toggle");const r=o.value;r&&yt(()=>s(r))}return(r,l)=>(x(),E("div",{class:He(["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"}])},[S("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(x(),E("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,NW)):ge("",!0),S("span",IW,[S("span",LW,B(e.name),1),ve(en,{text:e.arg},{default:Fe(()=>[e.arg?(x(),E("span",$W,B(e.arg),1)):ge("",!0)]),_:1},8,["text"])]),S("span",FW,[S("span",{class:He(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),Ae(et,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),Ae(et,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),Ae(of,{key:2,status:"suspended"})):(x(),Ae(of,{key:3,status:"running"}))],10,OW),Rn(r.$slots,"trailing"),e.time?(x(),E("span",RW,B(e.time),1)):ge("",!0)]),e.expandable?(x(),Ae(et,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ge("",!0)],512),S("div",{class:He(["bb",{open:e.open}]),inert:!e.open},[S("div",DW,[Rn(r.$slots,"default")])],10,BW)],2))}}),y1=dt(PW,[["__scopeId","data-v-3b97a58a"]]),HW={key:0,class:"at-type"},WW={key:1,class:"at-task"},zW={key:2,class:"bb-code"},UW=Xe({__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}=Ot(),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=D(()=>i(s.tool.arg)),l=D(()=>!!s.tool.output&&s.tool.output.length>0),a=D(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=se(s.tool.defaultExpanded===!0&&a.value),u=D(()=>s.tool.status),d=D(()=>ja(s.tool.name)),f=D(()=>v1(s.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=jt("resolveAgentTaskId"),m=D(()=>p?p(s.tool.id)!==void 0:!0);function y(){a.value&&(c.value=!c.value)}return Je(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(x(),Ae(y1,{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:y},{trailing:Fe(()=>[m.value?(x(),E("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=Mt(v=>o("openAgent",e.tool.id),["stop"]))},B(A(n)("tasks.openDetail")),1)):ge("",!0)]),default:Fe(()=>[r.value.subagentType?(x(),E("div",HW,B(r.value.subagentType),1)):ge("",!0),r.value.prompt?(x(),E("div",WW,B(r.value.prompt),1)):ge("",!0),l.value?(x(),E("div",zW,[(x(!0),E(De,null,rt(e.tool.output??[],(v,b)=>(x(),E("div",{key:b},B(v),1))),128))])):ge("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),qW=dt(UW,[["__scopeId","data-v-ead824db"]]);function jW(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 Th={recognized:!1,answers:{},note:""};function VW(e){const t=e?.[0];if(!t)return Th;let n;try{n=JSON.parse(t)}catch{return Th}if(!n||typeof n!="object"||Array.isArray(n))return Th;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return Th;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 KW(e,t,n){return e[t]??e[`q_${n}`]}const GW=/^opt_\d+_(\d+)$/;function YW(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=GW.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const ZW={key:0,class:"chip"},XW={key:0,class:"au-dismissed"},QW={key:1,class:"au-list"},JW={class:"au-q"},ez={key:0,class:"au-hdr"},tz={class:"au-qtext"},nz={class:"au-opts"},sz={class:"au-glyph"},oz={class:"au-label"},iz={key:0,class:"au-desc"},rz={key:0,class:"au-opt sel"},lz={class:"au-glyph"},az={class:"au-label"},cz={key:1,class:"au-opt sel"},uz={class:"au-label"},dz={key:2,class:"au-raw"},fz=80,hz=Xe({__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}=Ot();function s(T,M=fz){const $=T.trim();return $.length>M?$.slice(0,M-1)+"…":$}const o=D(()=>jW(t.tool.arg)),i=D(()=>VW(t.tool.output)),r=D(()=>i.value.recognized),l=D(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=D(()=>o.value.map((T,M)=>YW(KW(i.value.answers,T.question,M),T.options))),c=D(()=>Object.keys(i.value.answers).length);function u(T,M){return a.value[T]?.selected.has(M)??!1}function d(T){return a.value[T]?.otherText??""}function f(T){return a.value[T]?.indeterminate??!1}function h(T,M){return T?M?"■":"□":M?"●":"○"}const p=D(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const T=o.value[0]?.question??"",M=s(T);return o.value.length<=1?M:`${M} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=D(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),y=D(()=>!!t.tool.output&&t.tool.output.length>0),k=D(()=>r.value&&(o.value.length>0||l.value)||y.value),g=se(t.tool.defaultExpanded===!0&&k.value),v=D(()=>t.tool.status),b=D(()=>ja(t.tool.name)),C=D(()=>v1(t.tool.name));function I(){k.value&&(g.value=!g.value)}return Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),(T,M)=>(x(),Ae(y1,{status:v.value,icon:C.value,name:b.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:I},{trailing:Fe(()=>[m.value?(x(),E("span",ZW,B(m.value),1)):ge("",!0)]),default:Fe(()=>[l.value?(x(),E("div",XW,B(i.value.note),1)):r.value?(x(),E("div",QW,[(x(!0),E(De,null,rt(o.value,($,N)=>(x(),E("div",{key:N,class:"au-block"},[S("div",JW,[$.header?(x(),E("span",ez,B($.header),1)):ge("",!0),S("span",tz,B($.question),1)]),S("div",nz,[(x(!0),E(De,null,rt($.options,(F,_)=>(x(),E("div",{key:_,class:He(["au-opt",{sel:u(N,_)}])},[S("span",sz,B(h($.multiSelect,u(N,_))),1),S("span",oz,B(F.label),1),F.description?(x(),E("span",iz,B(F.description),1)):ge("",!0)],2))),128)),d(N)?(x(),E("div",rz,[S("span",lz,B(h($.multiSelect,!0)),1),S("span",az,B(d(N)),1)])):ge("",!0),f(N)?(x(),E("div",cz,[M[0]||(M[0]=S("span",{class:"au-glyph"},"●",-1)),S("span",uz,B(A(n)("tools.ask.answered")),1)])):ge("",!0)])]))),128))])):(x(),E("div",dz,[(x(!0),E(De,null,rt(e.tool.output??[],($,N)=>(x(),E("div",{key:N},B($),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),pz=dt(hz,[["__scopeId","data-v-a0418f5f"]]),mz=1e6,__=5e3;function S_(e){if(e==="")return[];const t=e.split(`
|
|
68
|
+
`);return t.at(-1)===""&&t.pop(),t}function gz(e,t){const n=S_(e),s=S_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>__||i>__||(o+1)*(i+1)>mz)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 vz(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 r6(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 l6(e){const t=qa(e.name);if(t!=="edit"&&t!=="write")return null;const n=r6(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:gz(s,o)}return null}function yz(e){const t=r6(e);return t&&typeof t.path=="string"?t.path:void 0}function kz(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const bz={key:0,class:"bb-empty"},C_=50,xz=Xe({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),s=D(()=>n.value.length>C_),o={"--tool-output-visible-lines":String(C_)};return(i,r)=>(x(),E("div",{class:He(["bb-code tool-output-block",{scroll:s.value}]),style:o},[n.value.length===0&&e.emptyText?(x(),E("div",bz,B(e.emptyText),1)):ge("",!0),(x(!0),E(De,null,rt(n.value,(l,a)=>(x(),E("div",{key:a},B(l),1))),128))],2))}}),a6=dt(xz,[["__scopeId","data-v-262bbea0"]]),wz={key:0,class:"chip"},_z={key:0,class:"bb-summary"},Sz=Xe({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status),i=D(()=>ja(n.tool.name)),r=D(()=>v1(n.tool.name)),l=D(()=>sf(n.tool.name,n.tool.arg)),a=D(()=>sf(n.tool.name,n.tool.arg,!0)),c=D(()=>l6(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:y,removed:k}=vz(m);if(y||k)return`+${y} −${k}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=se(!1),h=D(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,y)=>(x(),Ae(y1,{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:Fe(()=>[u.value?(x(),E("span",wz,B(u.value),1)):ge("",!0)]),default:Fe(()=>[a.value?(x(),E("div",_z,B(a.value),1)):ge("",!0),ve(a6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),Cz=dt(Sz,[["__scopeId","data-v-bca2d09d"]]),Az={key:0,class:"chip"},Mz={key:0,class:"bb-summary"},Ez=Xe({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=D(()=>!!t.tool.output&&t.tool.output.length>0),o=D(()=>s.value||n.value),i=se(t.tool.defaultExpanded===!0&&o.value),r=D(()=>t.tool.status),l=D(()=>ja(t.tool.name)),a=D(()=>v1(t.tool.name)),c=D(()=>sf(t.tool.name,t.tool.arg)),u=D(()=>sf(t.tool.name,t.tool.arg,!0)),d=D(()=>EW({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 Je(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(x(),Ae(y1,{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:Fe(()=>[d.value?(x(),E("span",Az,B(d.value),1)):ge("",!0)]),default:Fe(()=>[u.value?(x(),E("div",Mz,B(u.value),1)):ge("",!0),ve(a6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),Tz=dt(Ez,[["__scopeId","data-v-140db1a0"]]),Nz={class:"media-title"},Iz=["src","alt"],Lz=["src"],$z=["src"],Fz=Xe({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=o.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=o.value;c?.kind==="image"&&s("openMedia",c)}return(c,u)=>o.value?(x(),E("div",{key:0,class:He(["media-tool",{mob:e.mobile}])},[ve(en,{text:o.value.path||l.value},{default:Fe(()=>[S("div",Nz,B(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(x(),Ae(en,{key:0,text:o.value.path||l.value},{default:Fe(()=>[S("button",{type:"button",class:"media-image-button",onClick:a},[S("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,Iz)])]),_:1},8,["text"])):o.value.kind==="video"?(x(),E("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,Lz)):(x(),E("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,$z))],2)):ge("",!0)}}),Oz=dt(Fz,[["__scopeId","data-v-d7ab177d"]]),Rz=/<summary>([\s\S]*?)<\/summary>/,Bz=/<resume_hint>([\s\S]*?)<\/resume_hint>/,pg=/<subagent\b([^>]*)>|<\/subagent>/g,Dz="</subagent>",A_=/(completed|failed|aborted):\s*(\d+)/g,M_=/([a-z_]+)="([^"]*)"/g;function Pz(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Hz(e){const t={};M_.lastIndex=0;let n;for(;(n=M_.exec(e))!==null;)t[n[1]]=Pz(n[2]);return t}function Wz(e){const t={completed:0,failed:0,aborted:0};A_.lastIndex=0;let n;for(;(n=A_.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function zz(e,t){const n=Hz(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function Uz(e){const t=[],n=[];pg.lastIndex=0;let s;for(;(s=pg.exec(e))!==null;)if(s[0]===Dz){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(zz(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:pg.lastIndex}):n.push(null);return t}function qz(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
69
|
+
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=Rz.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=Wz(n),r=Bz.exec(t)?.[1]?.trim(),l=Uz(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 E_(e){return e?e.split(`
|
|
70
|
+
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function jz(e){return e.suspendedReason||E_(e.text)||E_(e.outputLines?.join(`
|
|
71
|
+
`))||e.summary||""}function Vz(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
72
|
+
`):e.summary??""}function Kz(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function T_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
73
|
+
`)[0]??"",phase:Kz(e.outcome),body:e.body}}function Gz(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function Yz(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:jz(o),phase:o.phase,body:Vz(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>Gz(i,o))).map((o,i)=>T_(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>T_(o,i))}const Zz=["aria-expanded"],Xz={class:"title"},Qz={key:0,class:"meta"},Jz={key:1,class:"sum-txt"},eU={class:"rt"},tU={class:"status"},nU={key:0,class:"chip"},sU={key:1,class:"tm"},oU={class:"body"},iU={class:"overview"},rU={class:"overview-line"},lU={class:"big"},aU={key:0,class:"lbl"},cU={key:1,class:"lbl"},uU={key:2,class:"lbl"},dU={key:0,class:"seg","aria-hidden":"true"},fU={key:1,class:"legend"},hU=["aria-expanded","onClick"],pU={class:"mname"},mU={class:"mact"},gU={class:"mphase"},vU={key:1,class:"fallback-output"},yU={key:2,class:"waiting"},kU=Xe({__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}=Ot(),n=e;function s(N){if(!N)return{};try{const F=JSON.parse(N),_=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:_?.length}}catch{return{}}}const o=jt("resolveSwarmMembers"),i=D(()=>s(n.tool.arg)),r=D(()=>ja(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>o?.(n.tool.id)??[]),c=D(()=>qz(n.tool.output)),u=D(()=>n.tool.status),d=D(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=D(()=>Yz(a.value,c.value)),h=D(()=>{const N={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)N[F.phase]++;return N}),p=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>h.value.completed+h.value.failed),y=D(()=>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=D(()=>k.map(({phase:N,cls:F})=>({phase:N,count:h.value[N],cls:F})).filter(N=>N.count>0)),v=se(u.value==="running"||y.value>0);function b(){v.value=!v.value}const C=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
74
|
+
`).trim()),I=se(new Set);function T(N){const F=new Set(I.value);F.has(N)?F.delete(N):F.add(N),I.value=F}function M(N){return I.value.has(N)}function $(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(x(),E("div",{class:He(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[S("button",{class:"head",type:"button","aria-expanded":v.value,onClick:b},[ve(et,{class:"ic",name:"git-pull-request",size:"sm"}),S("span",Xz,B(r.value),1),l.value?(x(),E("span",Qz,"·")):ge("",!0),l.value?(x(),E("span",Jz,B(l.value),1)):ge("",!0),S("span",eU,[S("span",tU,[d.value==="ok"?(x(),Ae(et,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),Ae(et,{key:1,name:"close",size:"sm"})):(x(),Ae(of,{key:2,status:"running"}))]),m.value>0||p.value>0?(x(),E("span",nU,B(m.value)+" / "+B(p.value),1)):ge("",!0),e.tool.timing?(x(),E("span",sU,B(e.tool.timing),1)):ge("",!0)]),ve(et,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,Zz),Fn(S("div",oU,[S("div",iU,[S("div",rU,[S("span",lU,B(A(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),E("span",aU,B(A(t)("tools.swarm.runningSub",{count:y.value})),1)):c.value?(x(),E("span",cU,B(A(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),E("span",uU,B(A(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(x(),E("div",dU,[(x(!0),E(De,null,rt(g.value,_=>(x(),E("span",{key:_.phase,class:He(_.cls),style:Jt({flex:_.count})},null,6))),128))])):ge("",!0),g.value.length>1?(x(),E("div",fU,[(x(!0),E(De,null,rt(g.value,_=>(x(),E("span",{key:_.phase},[S("i",{class:He(["lg-dot",_.cls])},null,2),tt(B($(_.phase))+" "+B(_.count),1)]))),128))])):ge("",!0)]),f.value.length>0?(x(!0),E(De,{key:0},rt(f.value,_=>(x(),E("div",{key:_.id,class:He(["member",[`phase-${_.phase}`,{open:M(_.id)}]])},[S("button",{class:"member-head",type:"button","aria-expanded":M(_.id),onClick:R=>T(_.id)},[ve(of,{class:"row-dot",status:_.phase},null,8,["status"]),ve(en,{text:_.name},{default:Fe(()=>[S("span",pU,B(_.name),1)]),_:2},1032,["text"]),_.activity?(x(),Ae(en,{key:0,text:_.activity},{default:Fe(()=>[S("span",mU,B(_.activity),1)]),_:2},1032,["text"])):ge("",!0),S("span",gU,B($(_.phase)),1),ve(et,{class:"mcar",name:M(_.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,hU),Fn(S("div",{class:"member-body"},B(_.body),513),[[ci,M(_.id)]])],2))),128)):C.value?(x(),E("div",vU,B(C.value),1)):(x(),E("div",yU,B(A(t)("tools.swarm.waiting")),1))],512),[[ci,v.value]])],2))}}),bU=dt(kU,[["__scopeId","data-v-e7e15c56"]]);function xU(e){if(e.media&&e.status==="ok")return Oz;const t=qa(e.name);return t==="edit"||t==="write"||t==="multi_edit"?Cz:t==="task"?qW:t==="agentswarm"?bU:t==="askuserquestion"?pz:Tz}const c6=Xe({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>xU(n.tool));return(i,r)=>(x(),Ae(Ms(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>s("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>s("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>s("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>s("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function Br(e){if(e>=1024*1024)return`${N_(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):N_(t)}k`}return String(e)}function N_(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function wU(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 k1(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 _U(e){return!(e.tool.status==="ok"&&e.tool.media)}function SU(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function CU(e){const t=k1(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(_U(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),o(),n}function AU(e){return k1(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
75
|
+
|
|
76
|
+
`)}function MU(e){const t=[];for(const n of k1(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
77
|
+
> ${n.thinking.split(`
|
|
78
|
+
`).join(`
|
|
79
|
+
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const s=n.tool.output.join(`
|
|
80
|
+
`);t.push(`\`\`\`
|
|
81
|
+
[${n.tool.name}]
|
|
82
|
+
${s}
|
|
83
|
+
\`\`\``)}return t.join(`
|
|
84
|
+
|
|
85
|
+
`)}function u6(e){return e.tool.id||`tool-${e.sourceIndex}`}function EU(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?u6({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const TU=["aria-expanded"],NU={class:"tg-title"},IU={class:"tg-meta"},LU=["inert"],$U={class:"tool-group-body-inner"},FU=Xe({__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=se(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Ot(),a=D(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){o.value=!o.value}const u=jt("pinScroll",()=>{}),d=se(null);function f(){c();const h=d.value;h&&yt(()=>u(h))}return(h,p)=>(x(),E("div",{class:He(["tool-group",{open:o.value}])},[S("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[ve(of,{status:r.value},null,8,["status"]),ve(et,{class:"tg-ic",name:"list",size:"sm"}),S("span",NU,B(A(l)("tools.group.title",i.value)),1),S("span",IU,"· "+B(a.value),1),ve(et,{class:"tg-car",name:"chevron-right",size:"sm"})],8,TU),S("div",{class:He(["tool-group-body",{open:o.value}]),inert:!o.value},[S("div",$U,[(x(!0),E(De,null,rt(e.tools,(m,y)=>(x(),Ae(c6,{key:A(u6)(m),tool:m.tool,mobile:e.mobile,"stack-position":A(SU)(y,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,LU)],2))}}),OU=dt(FU,[["__scopeId","data-v-1735685f"]]);var RU=Object.create,zk=Object.defineProperty,BU=Object.getOwnPropertyDescriptor,d6=Object.getOwnPropertyNames,DU=Object.getPrototypeOf,PU=Object.prototype.hasOwnProperty,f6=(e,t)=>function(){return t||(0,e[d6(e)[0]])((t={exports:{}}).exports,t),t.exports},h6=e=>{let t={};for(var n in e)zk(t,n,{get:e[n],enumerable:!0});return t},HU=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=d6(t),i=0,r=o.length,l;i<r;i++)l=o[i],!PU.call(e,l)&&l!==n&&zk(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=BU(t,l))||s.enumerable});return e},p6=(e,t,n)=>(n=e!=null?RU(DU(e)):{},HU(zk(n,"default",{value:e,enumerable:!0}),e));function WU(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 zU(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function UU(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 qU(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
86
|
+
`:`<hr class="footnotes-sep">
|
|
87
|
+
`)+`<section class="footnotes">
|
|
88
|
+
<ol class="footnotes-list">
|
|
89
|
+
`}function jU(){return`</ol>
|
|
90
|
+
</section>
|
|
91
|
+
`}function VU(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 KU(){return`</li>
|
|
92
|
+
`}function GU(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 YU(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=UU,e.renderer.rules.footnote_block_open=qU,e.renderer.rules.footnote_block_close=jU,e.renderer.rules.footnote_open=VU,e.renderer.rules.footnote_close=KU,e.renderer.rules.footnote_anchor=GU,e.renderer.rules.footnote_caption=zU,e.renderer.rules.footnote_anchor_name=WU;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 y=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,b=h,C=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let I=C;for(;h<f;){const M=l.src.charCodeAt(h);if(n(M))M===9?I+=4-I%4:I++;else break;h++}l.tShift[a]=h-b,l.sCount[a]=I-C,l.bMarks[a]=b,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]=y;const T=new l.Token("footnote_reference_close","",-1);return T.level=--l.level,l.tokens.push(T),!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 y=new l.Token("footnote_open","",1);if(y.meta={id:p,label:h[p].label},l.tokens.push(y),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const b=new l.Token("inline","",0);b.children=h[p].tokens,b.content=h[p].content,a.push(b);const C=new l.Token("paragraph_close","p",-1);C.block=!0,a.push(C)}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 b=new l.Token("footnote_anchor","",0);b.meta={id:p,subId:v,label:h[p].label},l.tokens.push(b)}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 ZU(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 XU(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 QU=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function JU(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(QU,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function eq(e){e.inline.ruler.after("emphasis","sub",JU)}const tq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function nq(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(tq,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function sq(e){e.inline.ruler.after("emphasis","sup",nq)}var oq=f6({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,b=2;b<g.length;b++)o(g,b)&&(i(g[b],v,y,k.Token),v+=1,n(g[b-2],"class",y.liClass),n(g[s(g,b-2)],"class",y.ulClass))})};function n(m,y,k){var g=m.attrIndex(y),v=[y,k];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,y){for(var k=m[y].level-1,g=y-1;g>=0;g--)if(m[g].level===k)return g;return-1}function o(m,y){return d(m[y])&&f(m[y-1])&&h(m[y-2])&&p(m[y])}function i(m,y,k,g){var v=k.idPrefix+y;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,y,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,y){var k=new y("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,y){var k=new y("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)}})}),iq=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))),rq=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),mg;const lq=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]]),aq=(mg=String.fromCodePoint)!==null&&mg!==void 0?mg: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 cq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=lq.get(e))!==null&&t!==void 0?t:e}var Es;(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"})(Es||(Es={}));const uq=32;var gl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(gl||(gl={}));function ay(e){return e>=Es.ZERO&&e<=Es.NINE}function dq(e){return e>=Es.UPPER_A&&e<=Es.UPPER_F||e>=Es.LOWER_A&&e<=Es.LOWER_F}function fq(e){return e>=Es.UPPER_A&&e<=Es.UPPER_Z||e>=Es.LOWER_A&&e<=Es.LOWER_Z||ay(e)}function hq(e){return e===Es.EQUALS||fq(e)}var As;(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"})(As||(As={}));var hl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(hl||(hl={}));var pq=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=As.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=hl.Strict}startEntity(e){this.decodeMode=e,this.state=As.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case As.EntityStart:return e.charCodeAt(t)===Es.NUM?(this.state=As.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=As.NamedEntity,this.stateNamedEntity(e,t));case As.NumericStart:return this.stateNumericStart(e,t);case As.NumericDecimal:return this.stateNumericDecimal(e,t);case As.NumericHex:return this.stateNumericHex(e,t);case As.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|uq)===Es.LOWER_X?(this.state=As.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=As.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(ay(s)||dq(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(ay(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===Es.SEMI)this.consumed+=1;else if(this.decodeMode===hl.Strict)return 0;return this.emitCodePoint(cq(this.result),this.consumed),this.errors&&(e!==Es.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&gl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=mq(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===hl.Attribute&&(o===0||hq(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&gl.VALUE_LENGTH)>>14,o!==0){if(i===Es.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==hl.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]&gl.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]&~gl.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case As.NamedEntity:return this.result!==0&&(this.decodeMode!==hl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case As.NumericDecimal:return this.emitNumericEntity(0,2);case As.NumericHex:return this.emitNumericEntity(0,3);case As.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case As.EntityStart:return 0}}};function m6(e){let t="";const n=new pq(e,s=>t+=aq(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 mq(e,t,n,s){const o=(t&gl.BRANCH_LENGTH)>>7,i=t&gl.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 gq=m6(iq);m6(rq);function Uk(e,t=hl.Legacy){return gq(e,t)}var vq=p6(oq());const I_={};function yq(e){let t=I_[e];if(t)return t;t=I_[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 b1(e,t){typeof t!="string"&&(t=b1.defaultChars);const n=yq(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})}b1.defaultChars=";/?:@&=+$,#";b1.componentChars="";var cy=b1;const L_={};function kq(e){let t=L_[e];if(t)return t;t=L_[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 x1(e,t,n){typeof t!="string"&&(n=t,t=x1.defaultChars),typeof n>"u"&&(n=!0);const s=kq(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}x1.defaultChars=";/?:@&=+$,-_.!~*'()#";x1.componentChars="-_.!~*'()";var g6=x1;function qk(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 em(){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 bq=/^([a-z0-9.+-]+:)/i,xq=/:[0-9]*$/,wq=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,_q=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
93
|
+
`," "]),Sq=["'"].concat(_q),$_=["%","/","?",";","#"].concat(Sq),F_=["/","?","#"],Cq=255,O_=/^[+a-z0-9A-Z_-]{0,63}$/,Aq=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,R_={javascript:!0,"javascript:":!0},B_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Mq(e,t){if(e&&e instanceof em)return e;const n=new em;return n.parse(e,t),n}em.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=wq.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=bq.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&&R_[r])&&(i=i.substr(2),this.slashes=!0)),!R_[r]&&(o||r&&!B_[r])){let c=-1;for(let p=0;p<F_.length;p++)s=i.indexOf(F_[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<$_.length;p++)s=i.indexOf($_[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,y=p.length;m<y;m++){const k=p[m];if(k&&!k.match(O_)){let g="";for(let v=0,b=k.length;v<b;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(O_)){const v=p.slice(0,m),b=p.slice(m+1),C=k.match(Aq);C&&(v.push(C[1]),b.unshift(C[2])),b.length&&(i=b.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>Cq&&(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),B_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};em.prototype.parseHost=function(e){let t=xq.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 jk=Mq,v6=h6({decode:()=>cy,encode:()=>g6,format:()=>qk,parse:()=>jk}),y6=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,k6=/[\0-\x1F\x7F-\x9F]/,Eq=/[\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]/,b6=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Tq=/[\$\+<->\^`\|~\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]/,x6=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Nq=h6({Any:()=>y6,Cc:()=>k6,Cf:()=>Eq,P:()=>b6,S:()=>Tq,Z:()=>x6}),Iq=Object.defineProperty,w6=e=>{let t={};for(var n in e)Iq(t,n,{get:e[n],enumerable:!0});return t},us=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}`}},Lq=w6({arrayReplaceAt:()=>Pq,assign:()=>Bq,countLines:()=>Zn,escapeHtml:()=>Gq,escapeRE:()=>Zq,fromCodePoint:()=>lf,has:()=>Rq,isMdAsciiPunct:()=>sm,isPunctChar:()=>nm,isPunctCode:()=>uy,isSpace:()=>Dq,isString:()=>Fq,isValidEntityCode:()=>_1,isWhiteSpace:()=>rf,lib:()=>Xq,mdurl:()=>v6,normalizeReference:()=>w1,ucmicro:()=>tm,unescapeAll:()=>af,unescapeMd:()=>Uq});const tm=Nq;function $q(e){return Object.prototype.toString.call(e)}function Fq(e){return $q(e)==="[object String]"}const Oq=Object.prototype.hasOwnProperty;function Rq(e,t){return Oq.call(e,t)}function Bq(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 Dq(e){return e===9||e===32}function rf(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 nm(e){return tm.P.test(e)||tm.S.test(e)}const D_=new Map;function uy(e){if(sm(e))return!0;const t=D_.get(e);if(t!==void 0)return t;const n=nm(String.fromCharCode(e));return D_.set(e,n),n}function sm(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 w1(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Pq(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function _1(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 lf(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 _6=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Hq=new RegExp(`${_6.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Wq=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function zq(e,t){if(t.charCodeAt(0)===35&&Wq.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return _1(s)?lf(s):e}const n=Uk(e);return n!==e?n:e}function Uq(e){return e.includes("\\")?e.replace(_6,"$1"):e}function af(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Hq,(t,n,s)=>n||zq(t,s))}const qq=/[&<>"]/,jq=/[&<>"]/g,Vq={"&":"&","<":"<",">":">",'"':"""};function Kq(e){return Vq[e]}function Gq(e){return qq.test(e)?e.replace(jq,Kq):e}const Yq=/[.?*+^$[\]\\(){}|-]/g;function Zq(e){return e.replace(Yq,"\\$&")}const Xq={mdurl:v6,ucmicro:tm};function Zn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
94
|
+
`,n+1))!==-1;)t++;return t}const Qq=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Jq=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,ej=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Vk=["references","footnotes","abbreviations","abbr","abbrs"],Kk=Symbol.for("markdown-it-ts.global-state"),Gk=Object.prototype.hasOwnProperty;function P_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Ai(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function xl(e){if(Array.isArray(e))return e.map(t=>xl(t));if(Ai(e)){const t={};for(const n of Object.keys(e))t[n]=xl(e[n]);return t}return e}function om(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Ai(e)?Object.keys(e):[]}function dy(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(!dy(e[n],t[n]))return!1;return!0}if(Ai(e)||Ai(t)){if(!Ai(e)||!Ai(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(!Gk.call(t,o)||!dy(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function S6(e,t){if(Array.isArray(e))return e[Number(t)];if(Ai(e))return e[t]}function tj(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=xl(t[n]);return e}if(Ai(e)&&Ai(t)){for(const n of Object.keys(e))Gk.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=xl(t[n]);return e}return xl(t)}function nj(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Ai(o)||Array.isArray(o)){const i=new Set(om(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=xl(S6(n.value,r)):delete o[r];!n.existed&&om(o).length===0&&delete e[t];return}n.existed?e[t]=xl(n.value):delete e[t]}function Yk(e){const t=e[Kk];return P_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&P_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function sj(e,t){Object.defineProperty(e,Kk,{value:t,enumerable:!1,configurable:!0,writable:!0})}function wo(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Qq.test(e)?"footnote-definition":Jq.test(e)?"abbreviation-definition":ej.test(e)?"reference-definition":null}function Mf(e){return Yk(e)?.reason??null}function Zc(e,t,n){if(Mf(e)&&Dr(e),!t)return n();Zk(e,t);try{const s=n();return Xk(e),s}catch(s){throw Dr(e),s}}function Zk(e,t){try{Dr(e);const n={};for(const s of Vk)n[s]=Gk.call(e,s)?{existed:!0,value:xl(e[s])}:{existed:!1};sj(e,{reason:t,snapshot:n})}catch{}}function Xk(e){const t=Yk(e);if(t)for(const n of Vk){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Ai(o)&&!Array.isArray(o))continue;const i=new Set(om(s.existed?s.value:void 0));s.ownedKeys=om(o).filter(r=>i.has(r)?!dy(o[r],S6(s.value,r)):!0)}}function Dr(e){const t=Yk(e);if(t){for(const n of Vk){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){nj(e,n,s);continue}s.existed?e[n]=tj(e[n],s.value):delete e[n]}delete e[Kk]}}const fy=Symbol.for("markdown-it-ts.diagnostics");function S1(e,t){if(e)try{const n=e[fy];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[fy]=s,s}catch{return}}function kr(e){return S1(e,!1)}function oj(e){if(e)try{const t=e[fy];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function to(e){oj(e)}function ls(e,t){const n=S1(e,!0);n&&(n.strategy=t)}function gg(e,t){const n=S1(e,!0);n&&(n.chunk=t)}function C6(e,t){const n=S1(e,!0);n&&(n.unbounded=t)}function ij(e){const t={};e=e||{},t.src_Any=y6.source,t.src_Cc=k6.source,t.src_Z=x6.source,t.src_P=b6.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 hy(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function C1(e){return Object.prototype.toString.call(e)}function rj(e){return C1(e)==="[object String]"}function lj(e){return C1(e)==="[object Object]"}function aj(e){return C1(e)==="[object RegExp]"}function H_(e){return C1(e)==="[object Function]"}function cj(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const A6={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function uj(e){return Object.keys(e||{}).reduce(function(t,n){return t||A6.hasOwnProperty(n)},!1)}const dj={"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}}},fj="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]",hj="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function pj(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function W_(){return function(e,t){t.normalize(e)}}function im(e){const t=e.re=ij(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(fj),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,lj(a)){aj(a.validate)?c.validate=pj(a.validate):H_(a.validate)?c.validate=a.validate:i(l,a),H_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=W_();return}if(rj(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:W_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(cj).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 M6(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 Qo(e,t){if(!(this instanceof Qo))return new Qo(e,t);t||uj(e)&&(t=e,e={}),this.__opts__=hy({},A6,t),this.__schemas__=hy({},dj,e),this.__compiled__={},this.__tlds__=hj,this.__tlds_replaced__=!1,this.re={},im(this)}Qo.prototype.add=function(t,n){return this.__schemas__[t]=n,im(this),this};Qo.prototype.set=function(t){return this.__opts__=hy(this.__opts__,t),this};Qo.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)};Qo.prototype.pretest=function(t){return this.re.pretest.test(t)};Qo.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Qo.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 M6(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};Qo.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 M6(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};Qo.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(),im(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,im(this),this)};Qo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Qo.prototype.onCompile=function(){};var E6=Qo,mj=f6({"../../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,y=Math.floor,k=String.fromCharCode;function g(W){throw new RangeError(p[W])}function v(W,L){const O=[];let q=W.length;for(;q--;)O[q]=L(W[q]);return O}function b(W,L){const O=W.split("@");let q="";O.length>1&&(q=O[0]+"@",W=O[1]),W=W.replace(h,".");const X=v(W.split("."),L).join(".");return q+X}function C(W){const L=[];let O=0;const q=W.length;for(;O<q;){const X=W.charCodeAt(O++);if(X>=55296&&X<=56319&&O<q){const ie=W.charCodeAt(O++);(ie&64512)==56320?L.push(((X&1023)<<10)+(ie&1023)+65536):(L.push(X),O--)}else L.push(X)}return L}const I=W=>String.fromCodePoint(...W),T=function(W){return W>=48&&W<58?26+(W-48):W>=65&&W<91?W-65:W>=97&&W<123?W-97:36},M=function(W,L){return W+22+75*(W<26)-((L!=0)<<5)},$=function(W,L,O){let q=0;for(W=O?y(W/700):W>>1,W+=y(W/L);W>m*26>>1;q+=36)W=y(W/m);return y(q+(m+1)*W/(W+38))},N=function(W){const L=[],O=W.length;let q=0,X=128,ie=72,U=W.lastIndexOf("-");U<0&&(U=0);for(let j=0;j<U;++j)W.charCodeAt(j)>=128&&g("not-basic"),L.push(W.charCodeAt(j));for(let j=U>0?U+1:0;j<O;){const te=q;for(let oe=1,re=36;;re+=36){j>=O&&g("invalid-input");const xe=T(W.charCodeAt(j++));xe>=36&&g("invalid-input"),xe>y((2147483647-q)/oe)&&g("overflow"),q+=xe*oe;const pe=re<=ie?1:re>=ie+26?26:re-ie;if(xe<pe)break;const Ee=36-pe;oe>y(2147483647/Ee)&&g("overflow"),oe*=Ee}const ae=L.length+1;ie=$(q-te,ae,te==0),y(q/ae)>2147483647-X&&g("overflow"),X+=y(q/ae),q%=ae,L.splice(q++,0,X)}return String.fromCodePoint(...L)},F=function(W){const L=[];W=C(W);const O=W.length;let q=128,X=0,ie=72;for(const te of W)te<128&&L.push(k(te));const U=L.length;let j=U;for(U&&L.push("-");j<O;){let te=2147483647;for(const oe of W)oe>=q&&oe<te&&(te=oe);const ae=j+1;te-q>y((2147483647-X)/ae)&&g("overflow"),X+=(te-q)*ae,q=te;for(const oe of W)if(oe<q&&++X>2147483647&&g("overflow"),oe===q){let re=X;for(let xe=36;;xe+=36){const pe=xe<=ie?1:xe>=ie+26?26:xe-ie;if(re<pe)break;const Ee=re-pe,ue=36-pe;L.push(k(M(pe+Ee%ue,0))),re=y(Ee/ue)}L.push(k(M(re,0))),ie=$(X,ae,j===U),X=0,++j}++X,++q}return L.join("")},z={version:"2.3.1",ucs2:{decode:C,encode:I},decode:N,encode:F,toASCII:function(W){return b(W,function(L){return f.test(L)?"xn--"+F(L):L})},toUnicode:function(W){return b(W,function(L){return d.test(L)?N(L.slice(4).toLowerCase()):L})}};t.exports=z})}),T6=p6(mj());function Qk(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=af(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=af(e.slice(t,o)),i.pos=o,i.ok=!0),i}var N6=Qk;const dp=-2;function gj(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 dp}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return dp;if(r===91){o++,i++;continue}i++}return-1}function Jk(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=gj(l,t,a,n);if(f!==dp)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 rm=Jk;function e2(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+=af(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+=af(e.slice(t,i)),r}var I6=e2;function A1(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 t2(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function vj(e,t,n){const s=A1(e,t),o=[t,n];s<0?t2(e,o):e.attrs[s]=o}function yj(e,t){const n=A1(e,t);return n>=0?e.attrs[n][1]:null}function kj(e,t,n){const s=A1(e,t);s<0?t2(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var bj=w6({attrGet:()=>yj,attrIndex:()=>A1,attrJoin:()=>kj,attrPush:()=>t2,attrSet:()=>vj,parseLinkDestination:()=>Qk,parseLinkLabel:()=>Jk,parseLinkTitle:()=>e2});function xj(e){return e.includes("\r")||e.includes("\0")}function L6(e){return typeof e=="string"?e:e.toString()}function wj(e){if(e.inlineMode){const t=new us("inline","",0);t.content=L6(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 _j=/^([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])?)*)$/,Sj=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Cj(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(Sj.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(_j.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 Aj=Cj;function Mj(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(s,c);f.includes(`
|
|
95
|
+
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Ej=Mj;function z_(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 Tj(e){const t=e.tokens_meta,n=e.tokens_meta.length;z_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&z_(t[s].delimiters)}var Nj=Tj;const $6="*",F6="_";function Ij(e,t){if(t)return!1;const n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;const s=e.scanDelims(e.pos,n===42);if(!s||s.length===0)return!1;const o=n===42?$6:F6,i=s.length,r=s.can_open,l=s.can_close,a=e.tokens,c=e.delimiters;for(let u=0;u<i;u++){const d=e.push("text","",0);d.content=o,c.push({marker:n,length:i,token:a.length-1,end:-1,open:r,close:l})}return e.pos+=i,!0}function U_(e,t){const n=t.length,s=e.tokens;for(let o=n-1;o>=0;o--){const i=t[o],r=i.marker;if(r!==95&&r!==42||i.end===-1)continue;const l=t[i.end],a=i.token,c=l.token,u=o>0&&t[o-1].end===i.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[i.end+1].token===c+1,d=r===42?$6:F6,f=s[a];u?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=s[c];u?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),u&&(s[t[o-1].token].content="",s[t[i.end+1].token].content="",o--)}}function Lj(e){const t=e.tokens_meta,n=e.tokens_meta.length;U_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&U_(e,t[s].delimiters)}const q_={tokenize:Ij,postProcess:Lj};function O6(e){return Uk(e)}function n2(e){return e>=48&&e<=57}function $j(e){const t=e|32;return n2(e)||t>=97&&t<=102}function R6(e){const t=e|32;return t>=97&&t<=122}function Fj(e){return R6(e)||n2(e)}function Oj(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?$j(l):n2(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function Rj(e,t,n){let s=t+1;if(s>=n||!R6(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&Fj(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 O6(o)!==o?o:null}function Bj(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=Oj(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=_1(i)?lf(i):lf(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=Rj(e.src,n,s);if(o){const i=O6(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 Dj=Bj;const B6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),py=new Array(128),D6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);py[e]=`\\${t}`,D6[e]=B6[e]?t:py[e]}function j_(e,t,n){e.pending&&e.pushPending();const s=new us("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 Pj(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):(j_(e,D6[i],py[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 j_(e,i<256&&B6[i]?r:l,l),e.pos=n+1,!0}var Hj=Pj;function Wj(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 zj=Wj;const P6=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,H6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Uj=new RegExp(`^(?:${P6}|${H6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),qj=new RegExp(`^(?:${P6}|${H6})`);function W6(e){return e===32||e===9||e===10||e===12||e===13}function jj(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||W6(t)}function Vj(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(!W6(n))return!1}return!1}function Kj(e){const t=e|32;return t>=97&&t<=122}function Gj(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&&!Kj(i))return!1;const r=o.slice(s).match(Uj);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,jj(l)&&e.linkLevel++,Vj(l)&&e.linkLevel--}return e.pos+=l.length,!0}var Yj=Gj;function Zj(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=rm(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=N6(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=I6(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=rm(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[w1(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 y=e.push("image","img",0);y.attrs=[["src",u],["alt",""]],y.children=m,y.content=s,a&&y.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var Xj=Zj;function vg(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==10)break;t++}return t}function Qj(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;const n=e.src,s=e.pos,o=e.posMax,i=e.pos+1,r=rm(e,e.pos,!0);if(r<0)return!1;let l=r+1,a="",c="",u=!0;if(l<o&&n.charCodeAt(l)===40){l=vg(n,l+1,o);const d=N6(n,l,o);if(d.ok){const f=e.md.normalizeLink(d.str);e.md.validateLink(f)&&(a=f,l=d.pos,u=!1)}else l<o&&n.charCodeAt(l)===41&&(a="",u=!1);if(!u){if(l=vg(n,l,o),l<o&&n.charCodeAt(l)!==41){const f=I6(n,l,o);f.ok&&(c=f.str,l=vg(n,f.pos,o))}l<o&&n.charCodeAt(l)===41?l++:u=!0}}if(u){if(typeof e.env.references>"u")return!1;let d;if(l=r+1,l<o&&n.charCodeAt(l)===91){const h=l+1,p=rm(e,l);p>=0?(d=n.slice(h,p),d||(d=n.slice(i,r)),l=p+1):d=n.slice(i,r)}else d=n.slice(i,r);const f=e.env.references[w1(d)];if(!f)return e.pos=s,!1;a=f.href,c=f.title}if(!t){e.pos=i,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=c?[["href",a],["title",c]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var Jj=Qj;function z6(e){const t=e|32;return t>=97&&t<=122}function eV(e){return e>=48&&e<=57}function tV(e){return z6(e)||eV(e)||e===43||e===45||e===46}function nV(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&tV(e.charCodeAt(t));)t--;return t++,t>=e.length||!z6(e.charCodeAt(t))?null:e.slice(t)}function sV(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 oV(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=nV(e.pending);if(!o)return!1;const i=sV(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 iV(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 rV=iV;function lV(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 V_(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 aV(e){const t=e.delimiters;V_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&V_(e,n[s].delimiters)}const K_={tokenize:lV,postProcess:aV};function G_(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 cV(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||G_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!G_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var uV=cV;function s2(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function dV(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 fV(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 U6(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:s2(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function Xc(e,t,n,s,o,i){const r=U6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=fV(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=s2()}function hV(e){const t=U6(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=dV(o.samples)}return t.completedAt=s2(),t}var Y_=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const 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}},q6=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 us("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 us(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 us(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=rf(l),u=rf(a),d=uy(l),f=uy(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}}};q6.prototype.Token=us;const pV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function j6(e){return!pV.test(e)}var mV=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Y_,this.ruler2=new Y_,this.ruler.push("text",uV),this.ruler.push("linkify",oV),this.ruler.push("newline",rV),this.ruler.push("escape",Hj),this.ruler.push("backticks",Ej),this.ruler.push("strikethrough",K_.tokenize),this.ruler.push("emphasis",q_.tokenize),this.ruler.push("link",Jj),this.ruler.push("image",Xj),this.ruler.push("autolink",Aj),this.ruler.push("html_inline",Yj),this.ruler.push("entity",Dj),this.ruler2.push("balance_pairs",Nj),this.ruler2.push("strikethrough",K_.postProcess),this.ruler2.push("emphasis",q_.postProcess),this.ruler2.push("fragments_join",zj),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(Xc(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(Xc(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()&&j6(e)){const a=new us("text","",0);a.content=e,s.push(a);return}const o=new q6(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();Xc(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 gV(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&&j6(i.content)){const r=new us("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const vV=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,yV=/[0-9a-z]/i;function kV(e){return/^<a[>\s]/i.test(e)}function bV(e){return/^<\/a\s*>/i.test(e)}function xV(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(!vV.test(s)||!yV.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 wV(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"&&(kV(l.content)&&i>0&&i--,bV(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=>xV(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 y=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText(`mailto:${y}`).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText(`http://${y}`).replace(/^http:\/\//,"");const k=p.index;if(k>f){const C=new us("text","",0);C.content=a.slice(f,k),C.level=d,u.push(C)}const g=new us("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new us("text","",0);v.content=y,v.level=d,u.push(v);const b=new us("link_close","a",-1);b.level=--d,b.markup="linkify",b.info="auto",u.push(b),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new us("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const _V=/\r\n?|\n/g,SV=/\0/g;function CV(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(_V,`
|
|
96
|
+
`)),s&&(o=o.replace(SV,"�")),e.src=o}const V6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,AV=/\((?:c|tm|r)\)/i,MV=/\((c|tm|r)\)/gi,EV={c:"©",r:"®",tm:"™"};function TV(e,t){return EV[t.toLowerCase()]}function NV(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(MV,TV)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function IV(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&V6.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 LV(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(""):"");AV.test(s)&&NV(n.children||[]),V6.test(s)&&IV(n.children||[])}}var $V=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 FV=/['"]/,Z_=/['"]/g,X_="’";function Nh(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function OV(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;){Z_.lastIndex=c;const d=Z_.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 y=32;if(c<u)y=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const k=sm(m)||nm(String.fromCharCode(m)),g=sm(y)||nm(String.fromCharCode(y)),v=rf(m),b=rf(y);if(b?f=!1:g&&(v||k||(f=!1)),v?h=!1:k&&(b||g||(h=!1)),y===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=k,h=g),!f&&!h){p&&(r.content=Nh(r.content,d.index,X_));continue}if(h)for(n=s.length-1;n>=0;n--){let C=s[n];if(s[n].level<l)break;if(C.single===p&&s[n].level===l){C=s[n];let I,T;p?(I=o[2]||"‘",T=o[3]||"’"):(I=o[0]||"“",T=o[1]||"”"),r.content=Nh(r.content,d.index,T),e[C.token].content=Nh(e[C.token].content,C.pos,I),c+=T.length-1,C.token===i&&(c+=I.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=Nh(r.content,d.index,X_))}}}function RV(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("");!FV.test(s)||!n.children||OV(n.children,e)}}function BV(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 DV=/^(?:vbscript|javascript|file|data):/,PV=/^data:image\/(?:gif|png|jpeg|webp);/,K6=["http:","https:","mailto:"];function G6(e){const t=e.trim().toLowerCase();return DV.test(t)?PV.test(t):!0}function Y6(e){const t=jk(e,!0);if(t.hostname&&(!t.protocol||K6.includes(t.protocol)))try{t.hostname=T6.default.toASCII(t.hostname)}catch{}return g6(qk(t))}function Z6(e){const t=jk(e,!0);if(t.hostname&&(!t.protocol||K6.includes(t.protocol)))try{t.hostname=T6.default.toUnicode(t.hostname)}catch{}return cy(qk(t),`${cy.defaultChars}%`)}function HV(e){switch(e){case 9:case 32:return!0}return!1}function WV(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=[],y=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,b;for(b=t;b<n;b++){const $=a[b]<e.blkIndent;if(u=i[b]+l[b],d=r[b],u>=d)break;if(o.charCodeAt(u++)===62&&!$){let F=a[b]+1,_,R;o.charCodeAt(u)===32?(u++,F++,R=!1,_=!0):o.charCodeAt(u)===9?(_=!0,(c[b]+F)%4===3?(u++,F++,R=!1):R=!0):_=!1;let z=F;for(h.push(i[b]),i[b]=u;u<d;){const W=o.charCodeAt(u);if(HV(W))W===9?z+=4-(z+c[b]+(R?1:0))%4:z++;else break;u++}v=u>=d,p.push(c[b]),c[b]=a[b]+1+(_?1:0),m.push(a[b]),a[b]=z-F,y.push(l[b]),l[b]=u-i[b];continue}if(v)break;let N=!1;for(let F=0,_=k.length;F<_;F++)if(k[F](e,b,n,!0)){N=!0;break}if(N){e.lineMax=b,e.blkIndent!==0&&(h.push(i[b]),p.push(c[b]),y.push(l[b]),m.push(a[b]),a[b]-=e.blkIndent);break}h.push(i[b]),p.push(c[b]),y.push(l[b]),m.push(a[b]),a[b]=-1}const C=e.blkIndent;e.blkIndent=0;const I=e.push("blockquote_open","blockquote",1);I.markup=">";const T=[t,0];I.map=T,e.md.block.tokenize(e,t,b);const M=e.push("blockquote_close","blockquote",-1);M.markup=">",e.lineMax=f,e.parentType=g,T[1]=e.line;for(let $=0;$<y.length;$++)i[$+t]=h[$],l[$+t]=y[$],a[$+t]=m[$],c[$+t]=p[$];return e.blkIndent=C,!0}function zV(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
97
|
+
`,i.map=[t,e.line],!0}function UV(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 Q_=["","h1","h2","h3","h4","h5","h6"],J_=["","#","##","###","####","#####","######"];function eS(e){switch(e){case 9:case 32:return!0}return!1}function qV(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&&!eS(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&eS(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",Q_[d],1);h.markup=J_[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",Q_[d],-1);return m.markup=J_[d],!0}function jV(e){switch(e){case 9:case 32:return!0}return!1}function VV(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&&!jV(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 gc=[[/^<(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(`${qj.source}\\s*$`),/^$/,!1]];function KV(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<gc.length&&!gc[l][0].test(r);l++);if(l===gc.length)return!1;if(s)return gc[l][2];let a=t+1;if(!gc[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),gc[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 tS(e){switch(e){case 9:case 32:return!0}return!1}const Md={Pipe:1,ParagraphTerminator:2};function GV(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 X6=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|=Md.Pipe|Md.ParagraphTerminator),!a)if(tS(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,GV(f)&&(c|=Md.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 us(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new us(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,y=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+y[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 y=i.charCodeAt(p);if(tS(y))y===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("")}};X6.prototype.Token=us;function YV(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function Q6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function J6(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&Md.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:YV(n,s,o)}const nS=["","h1","h2"];function ZV(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=Q6(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 b=i[p]+r[p],C=l[p];if(b>=C)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(b),h===45||h===61)){let T=b+1,M=T;for(;T<C&&o.charCodeAt(T)===h;)T++;for(M=T;T<C;){const $=o.charCodeAt(T);if($!==9&&$!==32)break;T++}if(T>=C){f=h===61?1:2;break}if(M-b>1)continue}if(a[p]<0||u&&!J6(e,p,o,b,C))continue;let I=!1;for(let T=0,M=s.length;T<M;T++)if(s[T](e,p,n,!0)){I=!0;break}if(I)break}if(!f)return!1;let m;if(p===t+1){const b=i[t]+r[t];let C=l[t];for(;C>b;){const I=o.charCodeAt(C-1);if(I!==9&&I!==32)break;C--}m=o.slice(b,C)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const y=h===61?"=":"-",k=e.push("heading_open",nS[f],1);k.markup=y,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",nS[f],-1);return v.markup=y,e.parentType=d,!0}function e5(e){switch(e){case 9:case 32:return!0}return!1}function sS(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&&!e5(i.charCodeAt(l))?-1:l}function oS(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),!e5(c))?-1:a}function XV(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 QV=["0","1","2","3","4","5","6","7","8","9"];function JV(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 eK(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,y=e.eMarks,k=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=y[l])return!1;const b=h.charCodeAt(v);if(b>=48&&b<=57){if(f=oS(e,l),f<0||(u=!0,r=v,d=XV(e,l,f),c&&d!==1))return!1}else if(b===42||b===45||b===43){if(f=sS(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=y[l])return!1;if(s)return!0;const C=h.charCodeAt(f-1),I=String.fromCharCode(C);if(u){const _=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(_.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const T=[l,0];e.tokens[e.tokens.length-1].map=T,e.tokens[e.tokens.length-1].markup=I;let M=!1;const $=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,o=y[l];const _=k[l]+f-(p[l]+m[l]);let R=_;for(;i<o;){const ae=h.charCodeAt(i);if(ae===9)R+=4-(R+g[l])%4;else if(ae===32)R++;else break;i++}const z=i;let W;z>=o?W=1:W=R-_,W>4&&(W=1);const L=_+W,O=e.push("list_item_open","li",1);O.markup=I;const q=[l,0];O.map=q,u&&(O.info=f-r-1===1?QV[h.charCodeAt(r)-48]:h.slice(r,f-1));const X=e.tight,ie=e.tShift[l],U=e.sCount[l],j=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=L,e.tight=!0,e.tShift[l]=z-p[l],e.sCount[l]=R,z>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||M)&&(a=!1),M=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=j,e.tShift[l]=ie,e.sCount[l]=U,e.tight=X,e.push("list_item_close","li",-1).markup=I,l=e.line,q[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let te=!1;for(let ae=0,oe=N.length;ae<oe;ae++)if(N[ae](e,l,n,!0)){te=!0;break}if(te)break;if(u){if(f=oS(e,l),f<0)break;r=p[l]+m[l]}else if(f=sS(e,l),f<0)break;if(C!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=I:e.push("bullet_list_close","ul",-1).markup=I,T[1]=l,e.line=l,e.parentType=F,a&&JV(e,$),!0}function iS(e){return e===9||e===32}function tK(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=Q6(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],b=a[f];if(v<b){const C=i.charCodeAt(v);if(C===42||C===45||C===43){if(v+1>=b||iS(i.charCodeAt(v+1)))break}else if(C>=48&&C<=57&&v+1<b){let I=v+1;for(;;){if(I>=b){I=-1;break}const T=i.charCodeAt(I++);if(T>=48&&T<=57){if(I-v>=10){I=-1;break}continue}if((T===41||T===46)&&(I>=b||iS(i.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const y=r[f]+l[f],k=a[f];if(d&&!J6(e,f,i,y,k))continue;let g=!1;for(let v=0,b=s.length;v<b;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 Ih(e){switch(e){case 9:case 32:return!0}return!1}function nK(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 b=e.lineMax;if(v>=b||e.isEmpty(v))return null;let C=!1;if(e.sCount[v]-e.blkIndent>3&&(C=!0),e.sCount[v]<0&&(C=!0),!C){const M=e.parentType;e.parentType="reference";let $=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,v,b,!0)){$=!0;break}if(e.parentType=M,$)return null}const I=e.bMarks[v]+e.tShift[v],T=e.eMarks[v];return e.src.slice(I,T+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 b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const b=a(r);b!==null&&(c+=b,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 b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!Ih(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 b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!Ih(v))break}let y=e.md.helpers.parseLinkTitle(c,o,i);for(;y.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,y=e.md.helpers.parseLinkTitle(c,o,i,y)}let k;for(o<i&&m!==o&&y.ok?(k=y.str,o=y.pos):(k="",o=h,r=p);o<i&&Ih(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&k)for(k="",o=h,r=p;o<i&&Ih(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=w1(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 yg(e){switch(e){case 9:case 32:return!0}return!1}const sK=65536;function kg(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function oK(e,t){if(e.lineFlags)return(e.lineFlags[t]&Md.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 rS(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 iK(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&&!yg(l)||r===45&&yg(l)||!oK(e,t))return!1;for(;i<e.eMarks[o];){const b=e.src.charCodeAt(i);if(b!==124&&b!==45&&b!==58&&!yg(b))return!1;i++}let a=kg(e,t+1),c=a.split("|");const u=[];for(let b=0;b<c.length;b++){const C=c[b].trim();if(!C){if(b===0||b===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?u.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=kg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=rS(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 y=e.push("thead_open","thead",1);y.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let b=0;b<c.length;b++){const C=e.push("th_open","th",1);u[b]&&(C.attrs=[["style",`text-align:${u[b]}`]]);const I=e.push("inline","",0);I.content=c[b].trim(),I.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 b=!1;for(let I=0,T=h.length;I<T;I++)if(h[I](e,o,n,!0)){b=!0;break}if(b||(a=kg(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=rS(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>sK))break;if(o===t+2){const I=e.push("tbody_open","tbody",1);I.map=g=[t+2,0]}const C=e.push("tr_open","tr",1);C.map=[o,o+1];for(let I=0;I<d;I++){const T=e.push("td_open","td",1);u[I]&&(T.attrs=[["style",`text-align:${u[I]}`]]);const M=e.push("inline","",0);M.content=c[I]?c[I].trim():"",M.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 rK=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 Xc(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 Lh=[["table",iK,["paragraph","reference"]],["code",zV],["fence",UV,["paragraph","reference","blockquote","list"]],["blockquote",WV,["paragraph","reference","blockquote","list"]],["hr",VV,["paragraph","reference","blockquote","list"]],["list",eK,["paragraph","reference","blockquote"]],["reference",nK],["html_block",KV,["paragraph","reference","blockquote"]],["heading",qV,["paragraph","reference","blockquote"]],["lheading",ZV],["paragraph",tK]];var lK=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new rK;for(let e=0;e<Lh.length;e++)this.ruler.push(Lh[e][0],Lh[e][1],{alt:(Lh[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 y=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(Xc(e.env,"block",f[m].name,k-y,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 X6(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}},t5=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}};t5.prototype.Token=us;const lS=[["normalize",CV],["block",wj],["inline",gV],["linkify",wV],["replacements",LV],["smartquotes",RV],["text_join",BV]],aK={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},cK={parseLinkLabel:Jk,parseLinkDestination:Qk,parseLinkTitle:e2};function uK(){return{...aK}}function dK(){return{...cK}}var fK=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new lK,this.inline=new mV,this.ruler=new $V;for(let e=0;e<lS.length;e++){const[t,n]=lS[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:uK(),helpers:dK(),normalizeLink:Y6,normalizeLinkText:Z6,validateLink:G6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new E6),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 t5(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();Xc(e.env,"core",t[n].name,o-s,!0,!1)}hV(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&xj(e))return this.parse(L6(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 hK=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function lm(e){return!hK.test(e)}function dd(e,t){const n=e.indexOf(`
|
|
98
|
+
`,t);return n===-1?e.length:n}function fp(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 aS(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function bg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function pK(e){if(e.length>3)return lm(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 mK=["","h1","h2","h3","h4","h5","h6"],gK=["","#","##","###","####","#####","######"],cS=0,xg=1,wg=2;function jo(e,t,n,s){const o=new us(e,t,n);return o.level=s,o.block=!0,o}function n5(e,t,n){const s=jo("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new us("text","",0);return o.content=e,s.children=[o],s}function vK(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(!lm(u))return!1;const d=mK[i],f=gK[i],h=jo("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(n5(u,o,1));const p=jo("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function yK(e,t,n){const s=jo("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(n5(t,n,1)),e.push(jo("paragraph_close","p",-1,0))}function kK(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function _g(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function bK(e,t){const n=jo("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function xK(e,t,n){const s=jo("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=jo("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=jo("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new us("text","",0);r.content=t,i.children=[r],e.push(i);const l=jo("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=jo("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function wK(e){const t=jo("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function _K(e,t,n,s){if(!aS(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=dd(e,l);if(aS(e,l,c)&&fp(e,l+3,c)){const u=jo("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 SK(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?cS:wg,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=dd(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(!fp(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!vK(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=_g(e,h),l+=1+r-h;continue}if(c===45){if(!bg(e,r,a))return null;const h=l;let p=r,m=l,y=null,k=null;for(;p<e.length;){const b=dd(e,p);if(!bg(e,p,b))break;const C=p+2,I=b===C+1?e[C]:e.slice(C,b);if(!pK(I))return null;y===null&&(y=bK(t,h)),k=xK(t,I,m),p=b<e.length?b+1:b,m++}if(y===null||k===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const b=dd(e,g);if(!fp(e,g,b)){if(bg(e,g,b))return null;break}g=b<e.length?b+1:b,v++}y.map[1]=v,k.map[1]=v,wK(t),r=g,l=v;continue}if(c===96){const h=_K(e,r,a,l);if(!h)return null;t.push(h.token),r=_g(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=kK(e,r,a);let d;if(n===wg?d=lm(u):n===xg&&u===s?d=o:(d=lm(u),n===cS?(i&&(n=u===s?xg:wg),s=u,o=d,i=!0):n===xg&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!fp(e,f,dd(e,f)))return null;yK(t,u,l),r=_g(e,f),l+=1+r-f}return t}const CK=/[&<>"]/,uS=/[&<>"]/g,AK=/&/g,MK=/[<>"]/g,EK={"&":"&","<":"<",">":">",'"':"""};function Sg(e){return EK[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return CK.test(e)?e.replace(uS,Sg):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(AK,"&"):t?e.replace(uS,Sg):e.replace(MK,Sg)}const TK=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),NK=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function s5(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(TK,(t,n,s)=>{if(n)return n;if(NK.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return _1(i)?lf(i):"�"}const o=Uk(t);return o!==t?o:t})}const IK=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,LK=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,$K=/"/g;function Fc(e,t){const n=e.indexOf(`
|
|
99
|
+
`,t);return n===-1?e.length:n}function am(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 $h(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function FK(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!am(e,t,Fc(e,t))}function dS(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function OK(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function o2(e){return LK.test(e)?IK.test(e)?null:e.replace($K,"""):e}function RK(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=o2(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
|
|
100
|
+
`}function fS(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function BK(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
101
|
+
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
102
|
+
`}function DK(e,t,n){const s=t+2;if(n===s+1)return BK(e,s);const o=o2(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
|
|
103
|
+
`}function PK(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 HK(e,t,n,s){if(!dS(e,t,n))return null;const o=PK(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=Fc(e,l);if(dS(e,l,a)&&am(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-${$n(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${$n(c)}</code></pre>
|
|
104
|
+
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function hS(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=Fc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!am(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=RK(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=$h(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Fc(e,m);if(!fS(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const y=e.slice(t,m);let k;if(y===r)k=l;else{let v=t;for(k=`<ul>
|
|
105
|
+
`;v<m;){const b=Fc(e,v),C=DK(e,v,b);if(C===null)return null;k+=C,v=b<e.length?b+1:b}k+=`</ul>
|
|
106
|
+
`,r=y,l=k}let g=$h(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Fc(e,g);if(!am(e,g,v)){if(fS(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=HK(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=$h(e,m.nextPos);continue}const f=OK(e,t,u);let h;if(f===a)h=c;else{const m=o2(f);if(m===null)return null;h=`<p>${m}</p>
|
|
107
|
+
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&FK(e,p))return null;s?o.push(h):n+=h,t=$h(e,p)}return s?o.join(""):n}const WK={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function cm(e,t,n={},s){to(n);const o={...WK,...s||{}},i=wo(t);if(o.fallbackOnGlobalState!==!1&&i)return gg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Zc(n,i,()=>e.core.parse(t,n,e).tokens);let r=hp(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=jK(r,o.maxChunks)),pp(t,r))return gg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Zc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return gg(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Zc(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&&UK(f,l),qK(a,f),l+=u.lineCount}return a})}function hp(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(s.push({start:r,end:f,lineCount:l}),r=f,o=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
108
|
+
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=VK(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const b=e.charCodeAt(g);if(b===32||b===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let b=g;for(;b<h&&e[b]===v;)b++;const C=b-g;C>=3&&(u?u.marker===v&&C>=u.length&&(u=null):u={marker:v,length:C})}}const y=p-f;o+=y,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=y);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 pp(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!zK(e,t[o].end))return!0;return!1}function zK(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 UK(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 qK(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function jK(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 VK(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 o5=4e6,i5=8e4,KK=1e4,GK=200,YK=1e4,ZK=200;function r5(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function XK(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 tl(e){return e.length===0?0:Zn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function QK(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 JK(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
109
|
+
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function eG(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 QK(e,n+1,e.length-1)?!JK(e,t):!1}function tG(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??YK:e.options.fullChunkSizeChars??KK),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??ZK:e.options.fullChunkSizeLines??GK);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 Ef=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=tl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=hp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(pp(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,tl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!eG(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,tl(this.pending)),null;const n=hp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,tl(this.pending)),null;const s=pp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:tl(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=hp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=pp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:tl(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:tl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+tl(this.pending);return tG(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Mf(e)&&Dr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=wo(t);n&&(Zk(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&&XK(r,a),this.options.retainTokens!==!1&&r5(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&&Xk(t),n}catch(s){throw this.markedGlobalStateReason&&(Dr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){C6(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 nG(e,t,n={},s={}){to(n);const o=new Ef(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function sG(e,t,n={},s={}){to(n);const o=new Ef(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function oG(e,t,n,s={},o={}){to(s);const i=new Ef(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 iG(e,t,n,s={},o={}){to(s);const i=new Ef(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 l5(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??o5,o=e.options.autoUnboundedThresholdLines??i5;return t>=s||n>=o}function a5(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??o5))return"yes";const s=e.options.autoUnboundedThresholdLines??i5;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Ed(e,t,n={},s={}){to(n);const o=wo(t);if(Mf(n)&&Dr(n),s.fallbackOnGlobalState!==!1&&o)return C6(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Zn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Zc(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Ef(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){r5(i,l)}});if(o&&Zk(n,o),r.feed(t),r.flushForce(n),o&&(Xk(n),s.fallbackOnGlobalState===!1)){const l=kr(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Qc=(e,t,n)=>e<t?t:e>n?n:e;function c5(e){return e.experimental?{...e,...e.experimental}:e}const pS=[{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"}],mS=[{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 u5(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function rG(e,t=Math.max(0,e/40|0),n={}){const s=c5(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<pS.length;l++){const a=pS[l];if(e<=a.max){if(a.strategy!=="adaptive")return u5(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Qc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Qc(Math.ceil(t/i),150,700),maxChunks:Qc(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 gS(e,t=Math.max(0,e/40|0),n={}){const s=c5(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<mS.length;l++){const a=mS[l];if(e<=a.max){if(a.strategy!=="adaptive")return u5(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Qc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Qc(Math.ceil(t/i),150,700),maxChunks:Qc(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 lG={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"]}}},aG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},cG={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 M1(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function mp(e,t){if(M1(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const vS=e=>M1(e)?e:Promise.resolve(e);function Td(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 $n(e)}}function El(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Td(t[0])}="${$n(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Td(o[0])}="${$n(o[1])}"`}return n}function d5(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 Nd(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
110
|
+
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${$n(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
111
|
+
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${El(r)}>${t}</code></pre>
|
|
112
|
+
`}return`<pre><code${El(e.attrs)}>${t}</code></pre>
|
|
113
|
+
`}function um(e){return!e.attrs||e.attrs.length===0?`<code>${$n(e.content)}</code>`:`<code${El(e.attrs)}>${$n(e.content)}</code>`}function my(e){const t=$n(e.content);return e.attrs?`<pre${El(e.attrs)}><code>${t}</code></pre>
|
|
114
|
+
`:`<pre><code>${t}</code></pre>
|
|
115
|
+
`}function uG(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="${$n(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${$n(n[0][1])}">`}return null}function yS(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Td(t[0][0])}="${$n(t[0][1])}">`:t.length===2?`<a ${Td(t[0][0])}="${$n(t[0][1])}" ${Td(t[1][0])}="${$n(t[1][1])}">`:`<a${El(t)}>`}function dG(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 kS(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 dm(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 fG={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Fh=Object.prototype.hasOwnProperty,In={code_inline(e,t){return um(e[t])},code_block(e,t){return my(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?s5(i.info).trim():"",{langName:l,langAttrs:a}=d5(r),c=n.highlight,u=$n(i.content);if(!c)return Nd(i,u,r,l,n);const d=c(i.content,l,a);return M1(d)?d.then(f=>Nd(i,f||u,r,l,n)):Nd(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]],dm(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
116
|
+
`:`<br>
|
|
117
|
+
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
118
|
+
`:`<br>
|
|
119
|
+
`:`
|
|
120
|
+
`},text(e,t){return $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function bS(e,t,n){const s=e.info?s5(e.info).trim():"",{langName:o,langAttrs:i}=d5(s),r=t.highlight,l=$n(e.content);if(!r)return Nd(e,l,s,o,t);const a=r(e.content,o,i);if(M1(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Nd(e,a||l,s,o,t)}function Oh(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===In.text)return l.content.length===0?"":$n(l.content);break;case"text_special":if(o.text_special===In.text_special)return l.content.length===0?"":$n(l.content);break;case"softbreak":if(o.softbreak===In.softbreak)return r;break;case"hardbreak":if(o.hardbreak===In.hardbreak)return i;break;case"html_inline":if(o.html_inline===In.html_inline)return l.content;break;case"code_inline":if(o.code_inline===In.code_inline)return um(l);break}const a=o[l.type];if(!a)return dm(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:mp(c,l.type)}var hG=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...In}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,y="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,b=k>0&&e[k-1].hidden?`
|
|
121
|
+
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const T=e[k+1],M=e[k+2],$=e[k+3];if(T.type==="paragraph_open"&&T.hidden&&M.type==="inline"&&$.type==="paragraph_close"&&$.hidden){y+=`${b}<li>${this.renderInlineTokens(M.children||[],s,o)}`,k+=3;continue}}if(k+2<e.length){const T=e[k+1],M=e[k+2];if(T.type==="inline"&&M.nesting===-1&&M.tag===g.tag&&!M.hidden){const $=uG(g,b);if($!==null){y+=`${$+this.renderInlineTokens(T.children||[],s,o)}</${g.tag}>
|
|
122
|
+
`,k+=2;continue}}}if(v==="inline"){const T=g.children||[];if(T.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
123
|
+
`:`<br>
|
|
124
|
+
`,p=s.breaks?h:`
|
|
125
|
+
`,m=!0);const M=T[0];switch(M.type){case"text":if(l===In.text){y+=$n(M.content);continue}break;case"text_special":if(a===In.text_special){y+=$n(M.content);continue}break;case"softbreak":if(c===In.softbreak){y+=p;continue}break;case"hardbreak":if(u===In.hardbreak){y+=h;continue}break;case"html_inline":if(d===In.html_inline){y+=M.content;continue}break;case"code_inline":if(f===In.code_inline){y+=um(M);continue}break}}y+=this.renderInlineTokens(T,s,o);continue}const C=i[v];if(!C){const T=g.attrs;if(!g.hidden){if(!T||T.length===0)switch(v){case"hr":y+=r?`<hr />
|
|
126
|
+
`:`<hr>
|
|
127
|
+
`;continue;case"heading_open":y+=`<${g.tag}>`;continue;case"heading_close":y+=`</${g.tag}>
|
|
128
|
+
`;continue;case"paragraph_open":y+=`${b}<p>`;continue;case"paragraph_close":y+=`</p>
|
|
129
|
+
`;continue;case"list_item_open":{const M=e[k+1];y+=b+(M&&(M.type==="inline"||M.hidden||M.nesting===-1&&M.tag==="li")?"<li>":`<li>
|
|
130
|
+
`);continue}case"list_item_close":y+=`</li>
|
|
131
|
+
`;continue;case"bullet_list_open":y+=`${b}<ul>
|
|
132
|
+
`;continue;case"bullet_list_close":y+=`</ul>
|
|
133
|
+
`;continue;case"blockquote_open":y+=b+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
134
|
+
`);continue;case"blockquote_close":y+=`</blockquote>
|
|
135
|
+
`;continue;case"ordered_list_open":y+=`${b}<ol>
|
|
136
|
+
`;continue;case"ordered_list_close":y+=`</ol>
|
|
137
|
+
`;continue;case"table_open":y+=`${b}<table>
|
|
138
|
+
`;continue;case"table_close":y+=`</table>
|
|
139
|
+
`;continue;case"thead_open":y+=`${b}<thead>
|
|
140
|
+
`;continue;case"thead_close":y+=`</thead>
|
|
141
|
+
`;continue;case"tbody_open":y+=`${b}<tbody>
|
|
142
|
+
`;continue;case"tbody_close":y+=`</tbody>
|
|
143
|
+
`;continue;case"tr_open":y+=`${b}<tr>
|
|
144
|
+
`;continue;case"tr_close":y+=`</tr>
|
|
145
|
+
`;continue;case"td_open":y+=`${b}<td>`;continue;case"td_close":y+=`</td>
|
|
146
|
+
`;continue;case"th_open":y+=`${b}<th>`;continue;case"th_close":y+=`</th>
|
|
147
|
+
`;continue}else if(T.length===1){const M=T[0];if(v==="ordered_list_open"&&M[0]==="start"){y+=`${b}<ol start="${$n(M[1])}">
|
|
148
|
+
`;continue}if(v==="td_open"&&M[0]==="style"){y+=`${b}<td style="${$n(M[1])}">`;continue}if(v==="th_open"&&M[0]==="style"){y+=`${b}<th style="${$n(M[1])}">`;continue}}}y+=this.renderToken(e,k,s);continue}if(v==="code_block"&&C===In.code_block){y+=my(g);continue}if(v==="fence"&&C===In.fence){y+=bS(g,s);continue}if(v==="html_block"&&C===In.html_block){y+=g.content;continue}const I=C(e,k,s,o,this);typeof I=="string"?y+=I:y+=mp(I,g.type)}return y}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 vS(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?`
|
|
149
|
+
`:"",u=a?`>
|
|
150
|
+
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+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(Fh.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),Fh.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(Fh.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(Fh.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...fG,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===In.code_block)return my(t);if(i==="html_block"&&o.html_block===In.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):dm(t,r.xhtmlOut===!0);if(i==="fence"&&a===In.fence)return bS(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:mp(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,y=t.xhtmlOut===!0,k=y?`<br />
|
|
151
|
+
`:`<br>
|
|
152
|
+
`,g=t.breaks?k:`
|
|
153
|
+
`;if(e.length===1)return Oh(e,t,n,this,s,k,g);let v="";for(let b=0;b<e.length;b++){const C=e[b];if(C.type==="link_open"&&!u&&!d&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="link_close"&&dG(M)){const $=`${yS(C)+Oh([M],t,n,this,s,k,g)}</a>`;if(r===In.softbreak&&b+3<e.length&&e[b+3].type==="softbreak"){v+=$+g,b+=3;continue}v+=$,b+=2;continue}}if(C.type==="link_open"&&!u&&!d&&b+1<e.length&&e[b+1].type==="link_close"){v+=`${yS(C)}</a>`,b+=1;continue}if(C.type==="em_open"&&!f&&!h&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="em_close"&&kS(M)){v+=`<em>${Oh([M],t,n,this,s,k,g)}</em>`,b+=2;continue}}if(C.type==="strong_open"&&!p&&!m&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="strong_close"&&kS(M)){v+=`<strong>${Oh([M],t,n,this,s,k,g)}</strong>`,b+=2;continue}}switch(C.type){case"text":if(o===In.text){const M=C.content.length===0?"":$n(C.content);if(a===In.html_inline&&b+1<e.length&&e[b+1].type==="html_inline"){for(v+=M+e[++b].content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}v+=M;continue}break;case"text_special":if(i===In.text_special){C.content.length!==0&&(v+=$n(C.content));continue}break;case"softbreak":if(r===In.softbreak){v+=g;continue}break;case"hardbreak":if(l===In.hardbreak){v+=k;continue}break;case"html_inline":if(a===In.html_inline){for(v+=C.content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}break;case"code_inline":if(c===In.code_inline){v+=um(C);continue}break}const I=s[C.type];if(!I){v+=C.block?this.renderToken(e,b,t):dm(C,y);continue}const T=I(e,b,t,n,this);typeof T=="string"?v+=T:v+=mp(T,C.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 vS(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
154
|
+
`;break}}return s}},pG=hG;const mG=[],Cg=4096;function gG(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
|
|
155
|
+
`,n);s===-1&&(s=t);const o=s<t;let i=n,r=0;for(;i<s;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<s){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<s&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<s){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===s&&o)return!0}break}case 62:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 96:case 126:{let a=i;for(;a<s&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<s;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<s&&e.charCodeAt(a)===46){const c=a+1;if(c<s){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===s&&o)return!0}}break}}if(s===t)break;n=s+1}return!1}function vG(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 yG(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(!f5(e[n],t[n]))return!1;return!0}function f5(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||!vG(e.attrs,t.attrs)||!yG(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function xS(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var kG=class{core;cache=null;stats=xS();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=xS(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(to(s??o?.env),!o||s&&s!==o.env){const R=s??{},z=!!n.__explicitStreamChunkFallbackSetting,W=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,L=!!n.options?.streamChunkedFallback,O=!z&&W,q=L||O,X=n.options?.streamChunkAdaptive!==!1,ie=n.options?.streamChunkTargetChunks??8,U=n.options?.streamChunkSizeChars,j=n.options?.streamChunkSizeLines,te=n.options?.streamChunkMaxChunks,ae=!!n.__explicitStreamChunkConfig,oe=n.options?.autoTuneChunks!==!1,re=n.options?.streamChunkFenceAware??!0,xe=n.options?.streamLargeCachePolicy??"retain",pe=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Ee=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let ue,Y=!1;if(xe==="skip"&&(Y=e.length>=pe,!Y&&Ee!==void 0&&(ue=Zn(e),Y=ue>=Ee)),Y){const P=this.parseFullDocument(e,R,n,ue,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!kr(R)?.unbounded}),P.tokens}else if(q){const P=(me,we,Te)=>me<we?we:me>Te?Te:me;ue===void 0&&(ue=Zn(e));const G=oe&&!ae?gS(e.length,ue,n.options):null,ye=G?.maxChunkChars??(X?P(Math.ceil(e.length/ie),8e3,64e3):U??1e4),he=G?.maxChunkLines??(X?P(Math.ceil(ue/ie),150,700):j??200),fe=G?.maxChunks??(X?P(Math.ceil(e.length/64e3),ie,32):te),K=e.length>0&&e.charCodeAt(e.length-1)===10,ne=O&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&G?.strategy!=="plain";if((L||ne)&&(e.length>=ye*2||ue>=he*2)&&K){const me=cm(n,e,R,{maxChunkChars:ye,maxChunkLines:he,fenceAware:G?.fenceAware??re,maxChunks:fe});return this.cache={src:e,tokens:me,env:R,lineCount:ue,lastSegment:void 0,globalStateReason:wo(e)},this.updateCacheLineCount(this.cache,ue),this.recordChunkedParseResult(R,L?"explicit-initial-large-doc":"default-initial-large-doc"),me}}const Q=this.parseFullDocument(e,R,n,ue);return ue=Q.lineCount,this.cache={src:e,tokens:Q.tokens,env:R,lineCount:ue,lastSegment:void 0,globalStateReason:wo(e)},this.updateCacheLineCount(this.cache,ue),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!kr(R)?.unbounded}),Q.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=wo(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):wo(e),a=r||l;if(a){const R=s??o.env;Dr(R);const z=wo(e),W=this.parseFullDocument(e,R,n),L=W.tokens,O=W.lineCount;return this.cache={src:e,tokens:L,env:R,lineCount:O,lastSegment:void 0,globalStateReason:z},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!kr(R)?.unbounded}),L}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 R=s??o.env,z=this.parseFullDocument(e,R,n),W=z.tokens,L=z.lineCount;return this.cache={src:e,tokens:W,env:R,lineCount:L,lastSegment:void 0,globalStateReason:wo(e)},this.updateCacheLineCount(this.cache,L),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(R,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!kr(R)?.unbounded}),W}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const R=o.lineCount??Zn(o.src);let z=3;u.length>5e3?z=8:u.length>1e3?z=6:u.length>200&&(z=4),z=Math.min(z,R);let W=null;const L=n.options?.streamContextParseStrategy??"chars",O=n.options?.streamContextParseMinChars??200,q=n.options?.streamContextParseMinLines??2;let X;const ie=()=>(X===void 0&&(X=Zn(u)),X),U=this.canDirectlyParseAppend(o),j=U&&this.shouldUseUnboundedAppend(e,o,u);let te=!1;if(!U)switch(L){case"lines":te=ie()>=q;break;case"constructs":if(u.length>=O){te=!0;break}if(gG(u)){te=!0;break}te=ie()>=q;break;case"chars":default:te=u.length>=O}if(z>0&&te){const re=this.getTailLines(o.src,z)+u;try{const xe=this.core.parse(re,o.env,n).tokens,pe=xe.findIndex(Ee=>Ee.map&&typeof Ee.map[1]=="number"&&Ee.map[1]>z);if(pe!==-1){const Ee=xe.slice(pe),ue=R-z;ue!==0&&this.shiftTokenLines(Ee,ue),W={tokens:Ee}}}catch{W=null}}else W=null;if(!W){const re=R;if(j)W={tokens:Ed(n,u,o.env,{mode:"stream"})},re>0&&this.shiftTokenLines(W.tokens,re);else{const xe=this.core.parse(u,o.env,n);re>0&&this.shiftTokenLines(xe.tokens,re),W=xe}}let ae=0;if(o.tokens.length>0&&W.tokens.length>0){const re=o.tokens[o.tokens.length-1],xe=W.tokens[0];try{re.type==="inline"&&xe.type==="inline"&&(xe.children&&xe.children.length>0&&(re.children||(re.children=[]),this.appendTokens(re.children,xe.children)),re.content=(re.content||"")+(xe.content||""),ae=1)}catch{ae=0}}const oe=o.tokens.length;if(W.tokens.length>ae){const re=o.tokens,xe=W.tokens,pe=Math.min(re.length,xe.length-ae);let Ee=0;for(let ue=pe;ue>0;ue--){let Y=!0;for(let Q=0;Q<ue;Q++){const P=re[re.length-ue+Q],G=xe[ae+Q];if(!f5(P,G)){Y=!1;break}}if(Y){Ee=ue;break}}Ee>0&&(ae+=Ee),xe.length>ae&&this.appendTokens(o.tokens,xe,ae)}if(o.src=e,o.globalStateReason=null,o.lineCount=R+(X??ie()),o.tokens.length>oe){const re=this.getLastSegment(o.tokens,e,oe,o.tokens.length,e.length-u.length,R);re?o.lastSegment=re:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,j&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ls(o.env,{area:"stream",path:j?"stream-unbounded-append":"stream-append",reason:j?"large-delta":"safe-append",unbounded:j}),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,y=!h&&!u&&p,k=m||y,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,C=n.options?.streamChunkSizeLines,I=n.options?.streamChunkMaxChunks,T=!!n.__explicitStreamChunkConfig,M=n.options?.autoTuneChunks!==!1,$=n.options?.streamChunkFenceAware??!0;let N=u&&o.lineCount!==void 0?o.lineCount+Zn(u):void 0;if(k){N===void 0&&(N=Zn(e));const R=(ie,U,j)=>ie<U?U:ie>j?j:ie,z=M&&!T?gS(e.length,N,n.options):null,W=z?.maxChunkChars??(g?R(Math.ceil(e.length/v),8e3,64e3):b??1e4),L=z?.maxChunkLines??(g?R(Math.ceil(N/v),150,700):C??200),O=z?.maxChunks??(g?R(Math.ceil(e.length/64e3),v,32):I),q=e.length>0&&e.charCodeAt(e.length-1)===10,X=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&z?.strategy!=="plain";if((m||X)&&(e.length>=W*2||N>=L*2)&&q){const ie=cm(n,e,d,{maxChunkChars:W,maxChunkLines:L,fenceAware:z?.fenceAware??$,maxChunks:O});return this.cache={src:e,tokens:ie,env:d,lineCount:N,lastSegment:void 0,globalStateReason:wo(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),ie}}const F=this.parseFullDocument(e,d,n,N),_=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:_,env:d,lineCount:N,lastSegment:void 0,globalStateReason:wo(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!kr(d)?.unbounded}),_}recordChunkedParseResult(e,t){const n=kr(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:!!kr(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=wo(e);Mf(t)&&Dr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?a5(n,e.length,s):"no";if(r==="yes"){const a=Ed(n,e,t);return ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Zn(e):0)}}let l=s;if(r==="need-lines"&&(l=Zn(e),l5(n,e.length,l))){const a=Ed(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?Zn(e):0),{tokens:Zc(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:Zn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
156
|
+
`))return null;const s=n??t.slice(e.length);if(!s)return null;const o=s.length;if(s.charCodeAt(o-1)!==10)return null;let i=0,r=-1;for(let a=0;a<o&&!(s.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?s:s.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
157
|
+
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(s)?null:s}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=o.lineStart+Zn(l),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
158
|
+
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??mG}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??Zn(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(-Cg))+t,s=wo(n);return e.globalStateCarry=n.length>Cg?n.slice(n.length-Cg):n,s&&(e.globalStateReason=s),s}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,s=e.length,o,i){if(s<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=s-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}}return null}getLineStartOffset(e,t,n,s){if(n!==void 0&&s!==void 0&&t>=s)return this.getLineStartOffsetFrom(e,n,t-s);if(t<=0)return 0;let o=t,i=-1;for(;o>0;){if(i=e.indexOf(`
|
|
159
|
+
`,i+1),i===-1)return e.length;o--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let s=n,o=t-1;for(;s>0;){if(o=e.indexOf(`
|
|
160
|
+
`,o+1),o===-1)return e.length;s--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??Zn(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+Zn(i);t.lineCount=m;const y=this.getDocLineCount(e,m);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,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 y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??Zn(t.src);t.tokens.splice(y,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=k+Zn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const b=t.tokens[h.tbodyOpenIndex];b?.map&&(b.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(`
|
|
161
|
+
`);if(t<0)return null;const n=e.indexOf(`
|
|
162
|
+
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e,t=Zn(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 wS={default:aG,zero:cG,commonmark:lG};function bG(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function xG(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 _S(e){return e.experimental?{...e,...e.experimental}:e}function ri(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 SS(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(ri(t,o)||ri(e,o))return!0}return!1}function CS(e,t,n){return ri(t,n)||ri(e,n)}function AS(e,t){const n=kr(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 wG(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=wS[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=_S(n),typeof n.quotes=="string"){const M=n.quotes;M.length>=4?n.quotes=[M[0],M[1],M[2],M[3]]:n.quotes=["“","”","‘","’"]}let r=SS(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=SS(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=CS(i?.options,o,"fullChunkedFallback"),c=CS(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new fK;let p=null;const m=()=>(p||(p=new pG(n)),p);let y=null;const k=()=>(y||(y=new kG(h)),y);let g=null;const v=()=>(g||(g=new E6),g),b=M=>!u&&!!d&&!xG(M,d),C=(M,$)=>s==="default"&&!u&&p===null&&f!==null&&M.parse===f&&b(M)&&!M.stream.enabled&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.xhtmlOut===!1&&M.options.breaks===!1&&M.options.langPrefix==="language-"&&M.options.linkify===!1&&M.options.typographer===!1&&M.options.highlight===null,I=(M,$)=>s==="default"&&!u&&b(M)&&!M.stream.enabled&&!M.options.fullChunkedFallback&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.linkify===!1&&M.options.typographer===!1,T={core:h,block:h.block,inline:h.inline,get linkify(){const M=v();return Object.defineProperty(this,"linkify",{value:M,writable:!0,configurable:!0}),M},get renderer(){const M=m();return Object.defineProperty(this,"renderer",{value:M,writable:!0,configurable:!0}),M},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set(M){const $=_S(M);return this.options={...this.options,...$},(ri(M,"fullChunkSizeChars")||ri(M,"fullChunkSizeLines")||ri(M,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ri(M,"streamChunkSizeChars")||ri(M,"streamChunkSizeLines")||ri(M,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ri(M,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ri(M,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set($),typeof $.stream=="boolean"&&(this.stream.enabled=$.stream,y&&(y.reset(),y.resetStats())),this},configure(M){const $=typeof M=="string"?wS[M]:M;if(!$)throw new Error("Wrong `markdown-it` preset, can't be empty");if($.options&&this.set($.options),$.components){const N=$.components;N.core?.rules&&this.core.ruler.enableOnly(N.core.rules),N.block?.rules&&this.block.ruler.enableOnly(N.block.rules),N.inline?.rules&&this.inline.ruler.enableOnly(N.inline.rules),N.inline2?.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(M,$){const N=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],_=new Set;for(const R of F){if(!R)continue;const z=R.enable(N,!0);for(let W=0;W<z.length;W++)_.add(z[W])}if(!$){const R=N.filter(z=>!_.has(z));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(M,$){const N=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],_=new Set;for(const R of F){if(!R)continue;const z=R.disable(N,!0);for(let W=0;W<z.length;W++)_.add(z[W])}if(!$){const R=N.filter(z=>!_.has(z));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(M,...$){const N=typeof M=="function"?M:M&&typeof M.default=="function"?M.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...$],_=M;return u=!0,N.apply(_,F),this},render(M,$){if(C(this,M.length)){$!==void 0&&to($);const _=hS(M);if(_!==null)return $!==void 0&&ls($,{area:"render",path:"stock-fast",reason:"stock-subset"}),_}const N=$??{},F=this.parse(M,N);return m().render(F,this.options,N)},async renderAsync(M,$){if(C(this,M.length)){$!==void 0&&to($);const _=hS(M);if(_!==null)return $!==void 0&&ls($,{area:"render",path:"stock-fast",reason:"stock-subset"}),_}const N=$??{},F=this.parse(M,N);return m().renderAsync(F,this.options,N)},renderIterable(M,$={}){const N=this.parseIterable(M,$);return m().render(N,this.options,$)},async renderAsyncIterable(M,$={}){const N=await this.parseAsyncIterable(M,$);return m().renderAsync(N,this.options,$)},renderInline(M,$={}){const N=this.parseInline(M,$);return m().render(N,this.options,$)},validateLink:G6,normalizeLink:Y6,normalizeLinkText:Z6,utils:Lq,helpers:{...bj},parse(M,$){if(typeof M!="string")throw new TypeError("Input data should be a String");if($!==void 0&&to($),I(this,M.length)){const R=SK(M);if(R!==null)return $!==void 0&&ls($,{area:"parse",path:"stock-fast",reason:"stock-subset"}),R}const N=$??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const R=a5(this,M.length);if(R==="yes"){const z=Ed(this,M,N);return ls($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),z}R==="need-lines"&&(F=Zn(M))}if(!this.stream.enabled){const R=M.length,z=this.options.autoTuneChunks!==!1,W=r,L=!a&&b(this),O=!!this.options.fullChunkedFallback,q=L&&R>=2e5;let X;(O||q||F!==void 0)&&(X=F??Zn(M));const ie=(O||q)&&z&&!W?rG(R,X,this.options):null;if(O||q){const U=X??0;if(O?R>=(this.options.fullChunkThresholdChars??2e4)||U>=(this.options.fullChunkThresholdLines??400):q){if(ie&&ie.strategy!=="plain"){const j=cm(this,M,N,{maxChunkChars:ie.maxChunkChars,maxChunkLines:ie.maxChunkLines,fenceAware:ie.fenceAware,maxChunks:ie.maxChunks});return $&&AS($,O?"explicit-full-chunk":"default-large-string"),j}if(O){const j=(Y,Q,P)=>Y<Q?Q:Y>P?P:Y,te=this.options.fullChunkAdaptive!==!1,ae=this.options.fullChunkTargetChunks??8,oe=j(Math.ceil(R/ae),8e3,64e3),re=j(Math.ceil(U/ae),150,700),xe=te?oe:this.options.fullChunkSizeChars??1e4,pe=te?re:this.options.fullChunkSizeLines??200,Ee=te?j(Math.ceil(R/64e3),ae,32):this.options.fullChunkMaxChunks,ue=cm(this,M,N,{maxChunkChars:xe,maxChunkLines:pe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ee});return $&&AS($,"explicit-full-chunk"),ue}}}if(F!==void 0&&b(this)&&l5(this,R,X??F)){const U=Ed(this,M,N);return ls($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),U}}const _=wo(M);return ls($,{area:"parse",path:"plain",reason:"default-plain"}),Zc(N,_,()=>h.parse(M,N,this).tokens)},parseIterable(M,$={}){return to($),nG(this,M,$)},parseAsyncIterable(M,$={}){return to($),sG(this,M,$)},parseIterableToSink(M,$,N={}){return to(N),oG(this,M,$,N)},parseAsyncIterableToSink(M,$,N={}){return to(N),iG(this,M,$,N)},parseInline(M,$={}){if(typeof M!="string")throw new TypeError("Input data should be a String");to($),Mf($)&&Dr($);const N=h.createState(M,$,this);return N.inlineMode=!0,h.process(N),N.tokens}};if(T.stream={enabled:!!n.stream,parse(M,$){return T.stream.enabled?k().parse(M,$,T):T.parse(M,$??{})},reset(){k().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},i?.components){const M=i.components;M.core?.rules&&T.core.ruler.enableOnly(M.core.rules),M.block?.rules&&T.block.ruler.enableOnly(M.block.rules),M.inline?.rules&&T.inline.ruler.enableOnly(M.inline.rules),M.inline2?.rules&&T.inline.ruler2.enableOnly(M.inline2.rules)}return d=bG(T),f=T.parse,T}var _G=wG;const h5=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],SG=["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"],p5=["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"],CG=["svg","g","path"],AG=["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"],MG=["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","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],EG=["action","data","href","src","srcset","poster","xlink:href","formaction"],TG=["script"],NG=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Tl=new Set(h5),m5=new Set(p5),cf=new Set([...h5,...SG,...p5,...CG]),g5=new Set([...cf,...AG]),IG=new Set(MG),LG=new Set(EG),Tf=new Set(TG),v5=new Set(NG);function y5(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 $G={amp:"&",bsol:"\\",colon:":",newline:`
|
|
163
|
+
`,sol:"/",tab:" "};function k5(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 $G[String(o??"").toLowerCase()]??t})}const Rh=new Set(["http","https","mailto","tel"]),FG=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),ta=new Set(["http","https"]);function b5(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const OG=/^https?:\/\//i;function RG(e){if(!OG.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function BG(e,t,n){if(!Id(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function Id(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function DG(e,t){return t==="href"||t==="xlink:href"?Id(e,t)?Rh:ta:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ta:(Id(e,t),Rh)}function Ea(e,t={}){if(RG(e))return!1;const n=y5(k5(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=b5(n);return i?i==="file"?!BG(n,s,o):Id(s,o)?FG.has(i):!DG(s,o).has(i):!1}function PG(e){const t=k5(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=b5(y5(t).toLowerCase());return n==="http"||n==="https"}function HG(e,t={}){const n=String(e??"").trim();return n?Ea(n,t)?"":n:""}function MS(e){return HG(e,{tagName:"img",attrName:"src"})}function WG(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,p,m,y)}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 y,k=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(y=g+1;y<=v&&r[(y-g)%a]===f.src[y];y++);const b=Math.floor((y-g)/a);if(b<i)return!1;y-=(y-g)%a;const C=f.src.slice(g,y),I=f.src.slice(y,v);if(!c(I,C))return!1;if(m)return!0;let T=h;for(;T++,!(T>=p||(g=f.bMarks[T]+f.tShift[T],v=f.eMarks[T],g<v&&f.sCount[T]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[T]-f.blkIndent>=4)){for(y=g+1;y<=v&&r[(y-g)%a]===f.src[y];y++);if(!(Math.floor((y-g)/a)<b)&&(y-=(y-g)%a,y=f.skipSpaces(y),!(y<v))){k=!0;break}}const M=f.parentType,$=f.lineMax;f.parentType="container",f.lineMax=T;const N=f.push("container_"+t+"_open","div",1);N.markup=C,N.block=!0,N.info=I,N.map=[h,T],f.md.block.tokenize(f,h+1,T);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,y),F.block=!0,f.parentType=M,f.lineMax=$,f.line=T+(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 zG(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 y=0;y<a.length;y++){const k=a[y];if(k==="\\"){y++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=y;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 x5(e,t,n){for(const s of e){const o=s,i=o.map;if(Array.isArray(i)&&i.length>=2){const r=Number(i[0]),l=Number(i[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&x5(o.children,t,n)}}function UG(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(WG,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
164
|
+
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let I=0,T=-1;for(let M=0;M<m.length;M++)if(m[M]==="{"?I++:m[M]==="}"&&I--,I===0){T=M+1;break}T>0&&(h=m.slice(0,T))}h||(f=d||void 0)}if(o)return!0;const y=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=s;){const I=i.bMarks[k]+i.tShift[k],T=i.eMarks[k];if(i.src.slice(I,T).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.map=[n,g?k:s],v.meta={...v.meta??{},unclosed:!g&&!y},f&&v.attrSet("data-args",f),h)try{const I=JSON.parse(h);for(const[T,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${T}`,$?JSON.stringify(M):String(M))}}catch{const I=zG(h);if(I)for(const[T,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${T}`,$?JSON.stringify(M):String(M))}else v.attrSet("data-attrs",h)}const b=[];for(let I=n+1;I<k;I++){const T=i.bMarks[I]+i.tShift[I],M=i.eMarks[I];b.push(i.src.slice(T,M))}if(b.some(I=>I.trim().length>0)){let I=b.join(`
|
|
165
|
+
`);I.endsWith(`
|
|
166
|
+
`)||(I+=`
|
|
167
|
+
`),I.endsWith(`
|
|
168
|
+
|
|
169
|
+
`)||(I+=`
|
|
170
|
+
`);const T=i.tokens[i.tokens.length-1];T&&(T.raw=I);const M=[];i.md.block.parse(I,i.md,i.env,M),x5(M,n+1,n+1+b.length),i.tokens.push(...M)}const C=i.push("vmr_container_close","div",-1);return g||(C.hidden=!0,C.map=[s,s]),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ii(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 E1(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 qG=/^[a-z][a-z0-9_-]*$/;function ES(e){return qG.test(String(e??"").trim().toLowerCase())}function mi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return ES(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)?"":ES(o)?o:""}function Va(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=mi(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function jG(...e){const t=new Set,n=[];for(const s of e)for(const o of Va(s))t.has(o)||(t.add(o),n.push(o));return n}function VG(e){const t=Va(e);return{key:t.join(","),tags:t}}function w5(e){return mi(e)}function KG(e,t){const n=String(e??""),s=mi(t);if(!s)return!1;const o=Ii(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 _5(e,t){const n=mi(t);return!!n&&!cf.has(n)&&!KG(e,n)}function GG(e,t){const n=String(e??""),s=mi(t);if(!s)return n;const o=Ii(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 S5=Tl,YG=cf,C5=new Set(m5);C5.delete("details");const ZG=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,XG=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,gy=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,QG=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function fm(e){return(e.match(gy)?.[1]??"").toLowerCase()}function i2(e){return/^\s*<\s*\//.test(e)}function r2(e,t){return S5.has(t)||/\/\s*>\s*$/.test(e)}function JG(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=fm(i);if(r===t){if(i2(i)){if(n===0)return s;n--;continue}r2(i,r)||n++}}return-1}function eY(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=fm(o);if(i===t){if(i2(o)){n>0&&n--;continue}r2(o,i)||n++}}return n}function TS(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Ii(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 tY(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ii(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 hm(e){const t=e;return String(t.raw??t.content??t.markup??"")}function nY(e){const t=e;return t.meta||(t.meta={}),t.meta}function Ag(e,t,n){const s=nY(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function sY(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ii(h)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!s.length))for(const p of s)p.raw+=h,p.inner+=h},l=()=>{!s.length||!o||(r(`
|
|
171
|
+
`),o=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<s.length;m++)s[m].raw+=h,m<s.length-1&&(s[m].inner+=h);const p=s.pop();Ag(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*${Ii(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const y=m??(h.type==="html_inline"?fm(p):"");if(!(y&&t.has(y))){r(p);return}const k=i2(p),g=!k&&r2(p,y);if(k){if(!s.length||s[s.length-1].tag!==y){r(p);return}c(p);return}if(r(p),g){Ag(h,p,"");return}s.push({tag:y,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,y=!0;for(const k of h.children){const g=hm(k),v=k.type==="html_inline"?fm(g):"",b=v&&t.has(v);let C=g;if(y&&p&&g&&(s.length||b)){const I=p.indexOf(g,m);if(I!==-1)a(p.slice(m,I)),C=p.slice(I,I+g.length),m=I+g.length;else{if(s.length&&!b)continue;y=!1}}f(k,C,v)}y&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=hm(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
|
|
172
|
+
`:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)Ag(h.token,h.raw,h.inner)}function oY(e){return/^\s*<\s*[!?]/.test(e)}function iY(e){const t=new Set(YG);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 NS(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function rY(e,t){let n=null;for(const i of e.matchAll(ZG)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();NS(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(XG)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();NS(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 lY(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function aY(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(lY(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(gy);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),y=(h[1]??"").toLowerCase();t.has(y)?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=rY(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+=hm(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=hm(a),u=(c.match(gy)?.[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 cY=["a","span","strong","em","b","i","u"];function uY(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=mi(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 b=mi(String(v??""));b&&p.add(b)}const y=iY(Array.from(p)),k=new Set(cY);for(const v of p)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:y,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!y.has(v)||C5.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 y={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[y]},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 y of h){const k=y;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 b=aY(v,p);if(k.children=b.children,b.pendingBuffer){const C=g.lastIndexOf(b.pendingBuffer);if(C!==-1){const I=g.slice(0,C);k.content=I,typeof k.raw=="string"&&(k.raw=I)}}}catch(b){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",b)}}sY(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:y}=s(f),k=[];for(let g=0;g<h.length;g++){const v=h[g];if(k.length>0){const[C,I]=k[k.length-1];if(g!==I){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const T=String(v.content??v.raw??"");if(T){const M=h[I],$=`${String(M.content||"")}
|
|
173
|
+
${T}`,N=Jn($),F=N===-1?null:TS($,C,N+1);if(F){const _=$.slice(0,F.end),R=$.slice(F.end);M.content=_,M.loading=!1,h.splice(g,1),k.pop();const z=d(M,R)?[]:c(R,u(h,g,"paragraph"));z.length&&h.splice(g,0,...z),g--;continue}M.content=$,M.loading!==!1&&(M.loading=!0)}h.splice(g,1),g--;continue}}const b=o(v);if(b){if(oY(b))continue;const C=(b.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(b);if(!C||!y(C))continue;if(i(v,b),!I)C&&!new RegExp(`^\\s*<\\s*${C}\\b[^>]*\\/\\s*>`,"i").test(b)&&tY(b,C)>0&&k.push([C,g]);else if(k.length>0&&C&&k[k.length-1][0]===C){const[,T]=k[k.length-1],M=h[T];M.content=`${String(M.content||"")}
|
|
174
|
+
${b}`,M.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 C=v.content||"",I=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(C);if(C){const[,T]=k[k.length-1],M=h[T];M.content=`${M.content||""}
|
|
175
|
+
${C}`,M.loading!==!1&&(M.loading=!I)}I&&k.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,b=T=>{let M=g.get(T);return M||(M=new RegExp(`<\\s*${T}\\b`,"i"),g.set(T,M)),M},C=T=>{let M=v.get(T);return M||(M=new RegExp(`<\\s*\\/\\s*${T}\\s*>`,"i"),v.set(T,M)),M},I=[];for(let T=0;T<h.length;T++){const M=h[T],$=String(M.content??"");if(I.length>0){const F=I[I.length-1],_=h[F.index],R=M.type==="html_block"?C(F.tag).exec($):null;if(R){const L=R.index+R[0].length,O=$.slice(0,L),q=$.slice(L);_.content=`${String(_.content??"")}
|
|
176
|
+
${O}`,Array.isArray(_.children)&&_.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),I.pop();const X=d(_,q)?[]:c(q,u(h,T,"paragraph"));X.length?h.splice(T,1,...X):(h.splice(T,1),T--);continue}if(M.type!=="inline")continue;const z=Array.isArray(M.children)?M.children:[],W=JG(z,F.tag);if(W!==-1){const L=z.slice(0,W+1),O=z.slice(W+1),q=L.map(X=>String(X?.content??X?.raw??"")).join("");if(_.content=`${String(_.content??"")}
|
|
177
|
+
${q}`,Array.isArray(_.children)&&_.children.push(...L),O.length){const X=O.map(ie=>String(ie.content??ie.raw??"")).join("");if(X.trim()){const ie=X.replace(/^\s+/,"");if(d(_,X))h.splice(T,1),T--;else if(ie.startsWith("<"))h.splice(T,1,{type:"html_block",content:ie});else{const U=c(X,u(h,T,"paragraph"));h.splice(T,1,...U)}}else h.splice(T,1),T--}else h.splice(T,1),T--;I.pop();continue}_.content=`${String(_.content??"")}
|
|
178
|
+
${$}`,Array.isArray(_.children)&&_.children.push(...z),h.splice(T,1),T--;continue}if(M.type!=="inline")continue;const N=Array.isArray(M.children)?M.children:[];for(const F of m)if((N.length?eY(N,F):b(F).test($)&&!C(F).test($)?1:0)>0){I.push({tag:F,index:T});break}}}{let g=0;for(let v=0;v<h.length;v++){const b=h[v];if(b.type==="paragraph_open"){g++;continue}b.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 M=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(M.startsWith("!")||M.startsWith("?")){v.loading=!1;continue}if(m.has(M)){const W=String(v.content??""),L=Jn(W),O=L===-1?null:TS(W,M,L+1);v.loading=O?!1:v.loading!==void 0?v.loading:!0;const q=O?.start??-1,X=O?O.end-O.start:0;if(q!==-1){const ie=W.slice(0,q+X);let U="";L!==-1&&L<q&&(U=W.slice(L+1,q)),v.children=[{type:M,content:U,raw:ie,attrs:[],tag:M,loading:!1}],v.content=ie,v.raw=ie;const j=c(W.slice(q+X)||"","text");j.length&&h.splice(g+1,0,...j)}else v.children=[{type:M,content:"",raw:W,attrs:[],tag:M,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(M))continue;v.type="inline";const $=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=$.exec(v.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(v.content??""),_=new RegExp(`<\\/\\s*${M}\\s*>`,"i").exec(F),R=_?_.index:-1,z=_?_[0].length:0;if(R!==-1){const W=F.slice(0,R+z),L=(F.slice(R+z)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:W,tag:M,loading:!1}],v.content=W,v.raw=W,L&&h.splice(g+1,0,L.startsWith("<")?{type:"html_block",content:L}:{type:"text",content:L,raw:L})}else v.children=[{type:"html_block",content:v.content,tag:M,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),$=v.children[1],N=String($?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if($?.type==="html_inline"&&N===M)continue;p.has(M)?(v.children[0].loading=!0,v.children[0].tag=M,v.children.push({type:"html_inline",tag:M,loading:!0,content:`</${M}>`})):v.children=[{type:"html_block",loading:!0,tag:M,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 M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(M))continue;v.children=[{type:"html_block",loading:!1,tag:M,content:v.children.map($=>$.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const b=String(v.content),C=v,I=C.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(b)&&(C.children.length=0);continue}const T=String(I.content??b).match(QG)?.[1]?.toLowerCase()??"";if(T){if(/\/\s*>\s*$/.test(b)||S5.has(T)){C.children=[{type:"html_inline",content:b}];continue}C.children.length=0}}})}function dY(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 fY(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&&!dY(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 A5=/\.([a-z0-9]{1,15})$/i,hY=/[_()[\]{}<>]/u,pY=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,mY=/[?#@]/u,gY=/[\\/]/u,vY=/^[\p{L}\p{N}./\\-]+$/u,yY=/^[A-Za-z0-9-]{1,63}$/u,kY=/^xn--[a-z0-9-]{2,59}$/i,bY=/^(?:[A-Z]{1,6}|\d{1,8})$/u,xY=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,wY=/文件名\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,_Y=/文件名\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,SY=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,CY=2e3,AY=512,MY={},EY=new Set(["ai","md","py","rs","sh","zip"]),M5=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),TY=new Set([...M5,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),NY=new Set(["com","dev","io","page","site"]),IY=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),LY=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"]),ka=new Map;function IS(e,t){if(!e||e.length>AY)return t;for(ka.set(e,t);ka.size>CY;){const n=ka.keys().next().value;if(!n)break;ka.delete(n)}return t}function uf(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Mg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return uf(n)?n:void 0}function LS(e,t){if(!uf(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 $S(e){const t=Nf(e);return uf(t)?t:void 0}function $Y(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function FS(e,t){if(!uf(t))return;const n=String(e??"").trim().split(/\s+/u).map($Y).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>pm(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>pm(o,{marketTicker:!0}))&&(s.marketTicker=!0),uf(s)?s:void 0}function Bl(e,t=!1){let n;return{options(s){return t||s==null?LS(e,n):LS(e,Mg($S(s),FS(s,n)))},remember(s){const o=$S(s);n=t?Mg(n,o):Mg(o,FS(s,n))},reset(){n=void 0}}}function OS(e){return yY.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function FY(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return OS(n)||kY.test(n)?t.every(OS):!1}function E5(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function OY(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function RY(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function T5(e,t,n){const s=OY(t);return E5(e)&&RY(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function BY(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Nf(e){const t=String(e??""),n=ka.get(t);return n?(ka.delete(t),ka.set(t,n),n):BY(t)?IS(t,{explicitFilename:wY.test(t),filename:_Y.test(t),marketTicker:SY.test(t)}):IS(t,MY)}function DY(e){return FY(e.split(/[\\/]/)[0]??"")}function PY(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function HY(e){if(hY.test(e)||!vY.test(e))return!0;if(gY.test(e))return!DY(e);const t=e.replace(A5,"");return E5(t)?!0:t.split(".").filter(Boolean).some(PY)}function WY(e,t,n){if(!(n?TY:M5).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?xY:bY).test(s)}function pm(e,t={}){if(!e||pY.test(e)||mY.test(e))return!1;const n=e.match(A5);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return WY(e,s,t.marketTicker===!0)?!0:LY.has(s)?!EY.has(s)||t.filename?!0:HY(e):!!(t.explicitFilename&&NY.has(s)||t.filename&&IY.has(s))}const RS=["!"];function bo(e){return{type:"text",content:e,raw:e}}function na(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function sa(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function nl(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 zY(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(bo(t))}}function BS(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 UY(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function qY(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 jY(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 VY(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=KY(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function KY(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=Nf(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=jY(e,s,i),l=UY(o);if(o.markup==="linkify"&&r&&!T5(r,l,t)&&pm(r,n)){e.splice(s,i-s+1,bo(r));continue}const a=BS(l,RS);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=BS(u.content,RS);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 y=l;if(a!==-1)y=l.slice(0,a);else if(p){const k=encodeURI(p);if(k&&l.endsWith(k))y=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(y=l.slice(0,v))}}y!==l&&qY(o,y),p&&e.splice(i+1,0,bo(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(bo(r));const c=i[1],u=l[1].length;na(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(nl(c,d,!e[s+4]?.content?.startsWith(")"))),sa(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(bo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(bo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(h+=e[s+4]?.content||"",e[s+4].content=""),na(a,f),a.push(nl(c,h,!e[s+4]?.content?.startsWith(")"))),sa(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(bo(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(nl(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(bo(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(nl(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(bo(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;na(f,p)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let p=s+1;p<e.length;p++){const m=d?d[1].length:e[s-3].markup.length,y=e[p];if(m===1&&y.type==="em_close")break;if(m===2&&y.type==="strong_close")break;if(m===3&&(y.type==="em_close"||y.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;sa(f,p)}e.splice(s-u,c,...f),s-=f.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(bo(l)),na(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(nl(a,c,u)),sa(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(bo(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(bo(r)),na(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(nl(l,a,c)),sa(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(bo(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(bo(r)),na(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const f=e[s+2].attrs?.find(h=>h[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(f||c)+e[s+5].content,e[s+5].content=""):c=f||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const f=(e[s+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[s+2]?.content?.slice(0,f)||"",e[s+2].content="")}i.push(nl(a,c,d)),sa(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];na(a,2),a.push(nl(r,l,!1)),sa(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;zY(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function GY(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=YY(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function YY(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 ZY(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=XY(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function XY(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 y=u+1;for(;y<e.length&&e[y].type==="text"&&e[y].content==="";)y++;const k=e[y];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 y=u+1;for(;y<e.length&&e[y].type==="text"&&e[y].content==="";)y++;const k=e[y];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=QY(l),l}function QY(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=JY(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 JY(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 eZ(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=rZ(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 DS(){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 PS(){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 HS(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 N5(e,t){if(!e.startsWith("|")||e.includes(`
|
|
179
|
+
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function Eg(e){return N5(e)!==null}function I5(e){return/^:?-+:?$/.test(e.trim())}function tZ(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(I5)}function nZ(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function sZ(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(I5)&&nZ(n)}function oZ(e){return e==="|"||e==="|:"}function iZ(e){const t=N5(e);return t!==null&&t.every(n=>!n.includes(":"))}function rZ(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
180
|
+
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
181
|
+
`),d=!t&&!r.includes(`
|
|
182
|
+
`)&&/\r?\n$/.test(n)&&Eg(r);if(!t&&(r.includes(`
|
|
183
|
+
`)&&u.length===0&&Eg(a)&&sZ(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>HS(p)),h=[...DS(),...f,...PS()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
184
|
+
`)&&u.length===0&&Eg(a)&&tZ(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>HS(p)),h=[...DS(),...f,...PS()];s.splice(o-1,3,...h)}else r.includes(`
|
|
185
|
+
`)&&u.length===0&&iZ(a)&&oZ(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function lZ(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 aZ=lZ;const cZ=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],mm=cZ.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),uZ=/\\[a-z]+/i,L5="(?:\\\\|\\u0008)",dZ=new RegExp(String.raw`${L5}(?:${mm})\s*\{[^}]+\}`,"i"),fZ=new RegExp(String.raw`(?:${L5})?(?:${mm})\s*\{`,"i"),hZ=/\\(?:text|frac|left|right|times)/,pZ=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,mZ=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,gZ=/[A-Z]+\s*\([^)]+\)/i,vZ=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,yZ=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,kZ=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,bZ={"\b":"\\b","\v":"\\v","\f":"\\f"};function xZ(e){let t="";for(const n of e)t+=bZ[n]??n;return t}function pl(e){if(!e)return!1;const t=xZ(e),n=t.trim();if(kZ.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=uZ.test(t),o=dZ.test(t),i=fZ.test(t),r=hZ.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=pZ.test(t)&&!mZ.test(t),c=gZ.test(t),u=vZ.test(n),d=yZ.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 $5="__markstreamMathPluginApplied",vy=80,F5=2e4,WS=F5+4096;function l2(e){return!!e[$5]}function wZ(e){e[$5]=!0}const O5=["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"],_Z=["cdot","mathbf{","partial","mu_{"],R5=O5.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),B5="[ \r\b\f\v]",SZ=new RegExp(`([^\\\\])(${_Z.map(e=>e).join("|")})+`,"g"),CZ=/span\{([^}]+)\}/,AZ=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,MZ=/(^|[^\\])\\\r?\n/g,EZ=/(^|[^\\])\\$/g,TZ=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,NZ=new RegExp(`(${B5})|(${R5})\\b`,"g"),zS=new Map,US=new Map;function IZ(e){if(!e)return NZ;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=zS.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${B5})|(${o})\\b`,"g");return zS.set(n,i),i}function LZ(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=US.get(s);if(o)return o;const i=e?[mm,R5].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),mm].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return US.set(s,r),r}const qS={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function jS(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function $Z(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&TZ.test(n))return t;const s=n?t.slice(n.length):t;return`${n}${"\\!".repeat(s.length)}`})}function VS(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 sl(e,t){const n=t?.commands??O5,s=t?.escapeExclamation??!0,o=t?.commands==null,i=IZ(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&qS[u]!==void 0)return`\\${qS[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=$Z(r));let l=r;const a=LZ(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(CZ,"span\\{$1\\}").replace(AZ,"\\operatorname{span}\\{$1\\}"),l=l.replace(MZ,`$1\\\\
|
|
186
|
+
`),l=l.replace(EZ,"$1\\\\"),l=l.replace(SZ,"$1\\$2"),l}function KS(e){const t=e.trim();return!(!pl(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 D5(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 gm(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function FZ(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 If(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function yy(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(If(e,s)){n=s+1;continue}return s}return-1}function Tg(e,t){let n=t;for(;n<e.length;){const s=yy(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 Tc(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(!If(e,o))return o;s=o+Math.max(1,t.length)}return-1}function GS(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=gm(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}If(e,a)||i++,r=a+Math.max(1,t.length)}return i}function a2(e,t,n){const s=ff(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!ff(s.slice(0,o)).trim()||If(s,o))return-1;const i=D5(s);if(gm(i,o))return-1;const r=GS(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>GS(s,n,0,o,i))return-1;return o}function df(e){return e===" "||e===" "}function ff(e){let t=e.length;for(;t>0&&df(e[t-1]);)t--;return e.slice(0,t)}function YS(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
187
|
+
`&&t++;return t}function ZS(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function OZ(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(!df(o))return!1}return n>=3}function RZ(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 BZ(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(RZ)}function DZ(e){let t=0;if(!ZS(e[t]))return!1;for(;ZS(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:df(e[t+1])}function P5(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&&df(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&df(t[1])||DZ(t)||OZ(t)||BZ(t))}function XS(e,t){return e?t?`${e}
|
|
188
|
+
${t}`:e:t}function ky(e){const t=String(e??"").trim();return t?pl(t):!1}function QS(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function H5(e){if(e.length<=WS)return{source:e,lineOffset:0};let t=e.length-WS;const n=e.indexOf(`
|
|
189
|
+
`,t);return n===-1?{source:"",lineOffset:YS(e)}:(t=n+1,{source:e.slice(t),lineOffset:YS(e.slice(0,t))})}function W5(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=H5(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-vy-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=ff(s[r]);if(l&&!P5(l)){for(const[a,c]of i)if(a2(l,a,c)!==-1)return!0}}return!1}function PZ(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=H5(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-vy-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=ff(o[l]);for(const[c,u]of r){const d=a2(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>vy){h=!0;break}const m=o[p],y=Tc(m,u);if(y!==-1){const k=XS(f,m.slice(0,y));if(!ky(k)){h=!0;break}const g=m.slice(y+u.length),v=g.trim()?`suffix:${QS(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,y,QS(k),v].join(":")}if(P5(m)){h=!0;break}if(f=XS(f,m),f.length>F5){h=!0;break}}if(!h&&ky(f))return["pending",c,s+l,d].join(":")}}return null}function Ng(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function HZ(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 Ig(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function WZ(e,t){wZ(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 b=v;for(;b<g.length&&(g[b]===" "||g[b]===" ");)b++;if(b===v||!(g[b]===`
|
|
190
|
+
`||g[b]==="\r"&&g[b+1]===`
|
|
191
|
+
`))return v;const C=g.slice(v,b),I=a.push("text","",0);return I.content=C,b};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,b=a.src[g];if(v>=3&&(!b||/\s/.test(b))){const C=a.push("text","",0);return C.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,y=p;const k=p;for(const[g,v]of f){const b=a.src,C=D5(b),I=FZ(b,u);let T=!1;g==="$$"&&m!==k&&(m=k);let M=-1,$=-1,N=0;const F=_=>{if((_==="undefined"||_==null)&&(_=""),_==="\\"){a.pos=a.pos+_.length,m=a.pos;return}if(_==="\\)"||_==="\\("){const W=a.push("text_special","",0);W.content=_==="\\)"?")":"(",W.markup=_,a.pos=a.pos+_.length,m=a.pos;return}if(!_)return;if(g==="$$"&&_.includes("$")){let W=0;for(;W<_.length;){const L=yy(_,W);if(L===-1){const re=_.slice(W);if(re){const xe=a.push("text","",0);xe.content=re,a.pos=a.pos+re.length,m=a.pos}break}if(L>0&&_[L-1]==="$"||L+1<_.length&&_[L+1]==="$"){const re=_.slice(W,L+1);if(re){const xe=a.push("text","",0);xe.content=re,a.pos=a.pos+re.length,m=a.pos}W=L+1;continue}const O=_.slice(W,L);if(O){const re=a.push("text","",0);re.content=O,a.pos=a.pos+O.length,m=a.pos}const q=Tg(_,L+1);if(q===-1){const re=_.slice(L),xe=a.push("text","",0);xe.content=re,a.pos=a.pos+re.length,m=a.pos;break}const X=_.slice(L+1,q),ie=X.includes("`"),U=!X||!X.trim(),j=_[q+1],te=Ng(X,j),ae=Ig(X);if(!ie&&!U&&!te&&!ae){const re=a.push("math_inline","math",0);re.content=sl(X,t),re.markup="$",re.raw=`$${X}$`,re.loading=!1,a.pos=a.pos+(q-L+1),m=a.pos,W=q+1;continue}const oe=a.push("text","",0);oe.content="$",a.pos=a.pos+1,m=a.pos,W=L+1}return}const R=_.indexOf("![");if(R!==-1){if(R>0){const O=_.slice(0,R),q=a.push("text","",0);q.content=O,a.pos=a.pos+O.length,m=a.pos}const W=_.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(W){const[,O,q]=W,X=q.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),ie=X?X[1]:q,U=X&&X[2]?X[2]:null,j=a.push("image","img",0);j.attrs=[["src",ie],["alt",O]],U&&j.attrs.push(["title",U]),j.content=O,j.children=[{type:"text",content:O,tag:""}],a.pos=a.pos+W[0].length,m=a.pos;const te=_.slice(R+W[0].length);te&&F(te);return}const L=a.push("text","",0);L.content=_,a.pos=a.pos+_.length,m=a.pos;return}const z=a.push("text","",0);z.content=_,a.pos=a.pos+_.length,m=a.pos};for(;!(m>=b.length);){const _=b.indexOf(g,m);if(_===-1)break;if(If(b,_)){m=_+Math.max(1,g.length);continue}const R=gm(C,_);if(R){m=R[1];continue}const z=gm(I,_);if(z){m=z[1];continue}if(_===M&&m===$){if(N++,N>2){m=_+Math.max(1,g.length);continue}}else N=0,M=_,$=m;if(g==="("&&_>0){let te=_-1;for(;te>=0&&b[te]===" ";)te--;if(te>=0&&b[te]==="]"){m=_+g.length;continue}}if(g==="$"&&_>0&&b[_-1]==="$"){m=_+1;continue}if(g==="$"&&_<b.length-1&&b[_+1]==="$"){m=_+2;continue}const W=g==="$"?Tg(b,_+g.length):aZ(b,_+g.length,g,v);if(W===-1){const te=b.slice(_+g.length);if(te.includes(g)){m=b.indexOf(g,_+g.length);continue}if(W===-1){const ae=g==="$"&&HZ(te);if(u&&!c&&!ae&&pl(te)&&!te.includes("`")){if(m=_+g.length,T=!0,!l){a.pending="";const oe=y?b.slice(y,m):b.slice(0,m),re=jS(oe)%2===1;if(y)F(b.slice(y,m));else{let xe=b.slice(0,m);xe.endsWith(g)&&(xe=xe.slice(0,xe.length-g.length)),F(xe)}if(re){const xe=VS(oe)?.marker??"**",pe=a.push("strong_open","",0);pe.markup=xe;const Ee=a.push("math_inline","math",0);Ee.content=sl(te,t),Ee.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ee.raw=`${g}${te}${v}`,Ee.loading=!0,pe.content=te,a.push("strong_close","",0)}else{const xe=a.push("math_inline","math",0);xe.content=sl(te,t),xe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",xe.raw=`${g}${te}${v}`,xe.loading=!0}a.pos=b.length}m=b.length,y=m}break}}const L=b.slice(_+g.length,W),O=L.includes("`"),q=!L||!L.trim(),X=g==="$",ie=b[W+v.length],U=X&&Ng(L,ie),j=X&&Ig(L);if(c?O||q||U||j:O||q||U||j||!X&&!pl(L)){m=W+v.length;const te=b.slice(a.pos,m);a.pending||(F(te),y=m);continue}if(T=!0,!l){const te=b.slice(a.pos-(a.pending??"").length,_);let ae=b.slice(0,m)?b.slice(y,_):te;const oe=jS(ae)%2===1;_!==a.pos&&oe&&(ae=a.pending+b.slice(a.pos,_));const re=oe?VS(ae):null,xe=re?.marker??"**";if(a.pending!==ae)if(a.pending="",oe)if(re){const pe=ae.slice(re.index+xe.length);F(ae.slice(0,re.index));const Ee=a.push("strong_open","",0);Ee.markup=xe;const ue=a.push("text","",0);ue.content=pe,a.push("strong_close","",0)}else F(ae);else F(ae);if(oe){const pe=a.push("strong_open","",0);pe.markup=xe;const Ee=a.push("math_inline","math",0);Ee.content=sl(L,t),Ee.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ee.raw=`${g}${L}${v}`,Ee.loading=!1;const ue=b.slice(W+v.length).startsWith(xe);return ue&&a.push("strong_close","",0),a.pos=d(b,W+v.length),m=a.pos,y=m,ue||a.push("strong_close","",0),!0}else{const pe=a.push("math_inline","math",0);pe.content=sl(L,t),pe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",pe.raw=`${g}${L}${v}`,pe.loading=!1}}return m=d(b,W+v.length),y=m,a.pos=m,!0}if(T){if(l)a.pos=m;else{if(g==="$$"&&m<b.length&&b.slice(m).includes("$")){let _=m;for(;!(_>=b.length);){const R=yy(b,_);if(R===-1)break;if(R+1<b.length&&b[R+1]==="$"){_=R+2;continue}if(R>0&&b[R-1]==="$"){_=R+1;continue}const z=Tg(b,R+1);if(z===-1)break;const W=b.slice(R+1,z),L=W.includes("`"),O=!W||!W.trim(),q=b[z+1],X=Ng(W,q),ie=Ig(W);if(!L&&!O&&!X&&!ie){const U=b.slice(m,R);U&&F(U);const j=a.push("math_inline","math",0);j.content=sl(W,t),j.markup="$",j.raw=`$${W}$`,j.loading=!1,m=z+1,_=z+1}else F("$"),_=R+1}_<b.length&&F(b.slice(_))}else m<b.length&&F(b.slice(m));a.pos=b.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(),y=!1,k="",g="",v=!1,b="",C=!1;for(const[U,j]of h)if(m.startsWith(U))if(U.includes("[")){const te=U==="\\["?m.slice(U.length):"";if(U==="\\["&&Tc(te,j)===-1&&!/^\s*!\[/.test(te)&&!te.includes("`")&&pl(te)){y=!0,k=U,g=j;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){y=!0,k=U,g=j;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){y=!0,k=U,g=j;break}continue}else{const ae=u.tokens[u.tokens.length-1];if(ae&&ae.type==="list_item_open"&&ae.mark==="-"&&m.slice(U.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const oe=m.indexOf("]");if(m.slice(oe).trim()!=="]")continue;const re=m.slice(U.length,oe);if(U==="["?KS(re):pl(re)){y=!0,k=U,g=j;break}continue}}}else{y=!0,k=U,g=j;break}else if((U==="$$"||U==="\\[")&&m.endsWith(U)&&l+1<a){const te=a2(m,U,j);if(te===-1)continue;b=ff(m.slice(0,te)),C=!0;const ae=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(ae,u.eMarks[l+1]).trim(),v=!0,y=!0,k=U,g=j;break}if(!y)return!1;if(c&&!C)return!0;const I=m.indexOf(k),T=I+k.length,M=!f&&k==="["?m.indexOf("\\]",T):-1,$=M>=0?"\\]":g,N=M>=0?M:Tc(m,g,T);if(!v&&N>k.length){const U=m.slice(I+k.length,N),j=u.push("math_block","math",0);j.content=sl(U),j.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",j.map=[l,l+1],j.raw=`${k}${U}${$}`,j.block=!0,j.loading=!1,u.line=l+1;const te=m.slice(N+$.length);return te.trim()&&n(u,te,l),!0}let F=l,_="",R=!1,z="",W=l;const L=v?m:m===k?"":m.slice(k.length),O=!f&&k==="\\["?"]":"",q=Tc(L,g);if(q!==-1){const U=q;_=L.slice(0,U),z=L.slice(U+g.length),W=v?l+1:l,R=!0,F=W}else for(L&&!v&&(_=L),F=l+1;F<a;F++){const U=u.bMarks[F]+u.tShift[F],j=u.eMarks[F],te=u.src.slice(U,j),ae=te.trim();if(!f&&k==="["&&ae==="\\]"){g="\\]",R=!0;break}if(O&&te.trim()===O){g=O,R=!0;break}if(ae===g){R=!0;break}else if(!f&&k==="["&&te.includes("\\]")){R=!0;const oe=te.indexOf("\\]");g="\\]";const re=te.slice(0,oe);re&&(_+=(_?`
|
|
192
|
+
`:"")+re),z=te.slice(oe+g.length),W=F;break}else if(Tc(te,g)!==-1){R=!0;const oe=Tc(te,g),re=te.slice(0,oe);re&&(_+=(_?`
|
|
193
|
+
`:"")+re),z=te.slice(oe+g.length),W=F;break}_+=(_?`
|
|
194
|
+
`:"")+te}if((!d||f)&&!R)return!1;const X=/^\s*!\[/.test(_);if(!(C?!X&&ky(_):k==="$$"?!X:k==="["?KS(_):pl(_)))return!1;if(c)return!0;b&&n(u,b,l);const ie=u.push("math_block","math",0);return ie.content=sl(_),ie.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ie.raw=`${k}${_}${_.startsWith(`
|
|
195
|
+
`)?`
|
|
196
|
+
`:""}${g}`,ie.map=[l,F+1],ie.block=!0,ie.loading=!R,u.line=F+1,z.trim()&&n(u,z,W),!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 zZ(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>`})}const UZ=/^<a[>\s]/i,qZ=/^<\/a\s*>/i;function jZ(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.pretest(String(e.content??""));let s=0;for(let o=n.length-1;o>=0;o--){const i=n[o];if(i?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==i.level&&n[o]?.type!=="link_open";)o--;continue}if(i?.type==="html_inline"){const r=String(i.content??"");UZ.test(r)&&s>0&&s--,qZ.test(r)&&s++}if(!(s>0)&&i?.type==="text"&&t.pretest(String(i.content??"")))return!0}return!1}function VZ(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(s=>s.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",s=>{if(!s.md?.options?.linkify)return;const o=Array.isArray(s.tokens)?s.tokens:[],i=s.md.linkify;if(!i)return;const r=o.filter(l=>jZ(l,i));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(s)),s,{tokens:r}))})}function KZ(e){const t=e.inline.ruler,n=t.getNamedRules?.(),s=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof s!="function"||typeof o!="function")return;const i=e.validateLink,r=e;r.__markstreamOriginalValidateLink=i,t.at("link",(...l)=>{const a=l[0].md,c=a?.validateLink===i?a.options?.validateLink:a?.validateLink;if(!a||typeof c!="function")return s(...l);const u=a.validateLink;a.validateLink=c;try{return s(...l)}finally{a.validateLink=u}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const c=a.validateLink;a.validateLink=i;try{return o(...l)}finally{a.validateLink=c}})}function GZ(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 _G({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!Ea(r,{tagName:"a",attrName:"href"})}),KZ(i),VZ(i),(e.enableMath??!0)&&WZ(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&UG(i),e.enableFixIndentedCodeBlock!==!1&&fY(i),VY(i),ZY(i),GY(i),eZ(i),zZ(i),uY(i,{customHtmlTags:e.customHtmlTags}),i}function Ta(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=>Ta(n))),t}function YZ(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function ZZ(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 XZ(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Bh(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(...Kn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const JS=/\r?\n[ \t]*`+\s*$/,z5=["diff ","index ","--- ","+++ ","@@ "],QZ=/\r?\n/;function JZ(e){const t=String(e??"");return t?z5.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function eC(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function tC(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function eX(e,t){const n=[],s=[],o=[],i=[],r=e.split(QZ),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!z5.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);o.push(tC(m,a))}else if(p.startsWith("+")){const m=p.slice(1);i.push(tC(m,a))}else{eC(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&&JZ(p)||c(p)}(t||o.length>0||i.length>0)&&eC(n,s,o,i);const d=n.join(`
|
|
197
|
+
`),f=s.join(`
|
|
198
|
+
`);return{original:t&&l&&d?`${d}
|
|
199
|
+
`:d,updated:t&&l&&f?`${f}
|
|
200
|
+
`:f}}function c2(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(JS.test(a)&&(a=a.replace(JS,"")),r){const{original:c,updated:u}=eX(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 tX(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function nX(){return{type:"hardbreak",raw:`\\
|
|
201
|
+
`}}function sX(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(...Kn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let Lg=null;const $g=new WeakMap;function nC(){return Lg||(Lg={customTagSet:null,allowedTagSet:$1()}),Lg}function U5(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function q5(e){return/^<\s*\//.test(e)}function j5(e,t){return/\/\s*>\s*$/.test(t)||Tl.has(e)}function oX(e){if(!e||e.length===0)return nC();const t=$g.get(e);if(t)return t;const n=e.map(mi).filter(Boolean);if(!n.length){const o=nC();return $g.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:$1({customHtmlTags:e})};return $g.set(e,s),s}function V5(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function iX(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function vm(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 rX(e,t,n){const s=e.slice();return vm(s,"href")||s.push(["href",t]),n!=null&&!vm(s,"title")&&s.push(["title",n]),s}function by(e){return e.map(V5).join("")}function gp(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:gp(s.children)});continue}t.push(s)}return t}function lX(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=U5(r),a=q5(r),c=j5(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function Fg(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?lX(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:by(s),innerTokens:o,nextIndex:i}}function aX(e,t,n,s,o,i,r){const l=String(e.content??""),a=U5(l),{customTagSet:c,allowedTagSet:u}=oX(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Fg(t,n,a).closed){const C=V5(e);return[{type:"text",content:C,raw:C},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=q5(l),f=j5(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const C=Fg(t,n,a),I=E1(l),T=C.innerTokens,M=String(vm(I,"href")??""),$=vm(I,"title"),N=$==null?null:String($),F=rX(I,M,N),_=gp(T.length?s(T,o,i,r):[]),R=T.length?by(T):M||"";return!_.length&&R&&_.push({type:"text",content:R,raw:R}),[{type:"link",href:M,title:N,text:R,attrs:F,children:_,loading:!C.closed,raw:C.html||l},C.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=Fg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:gp(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=gp(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,y=!h.closed,k=!1;if(!h.closed){const C=`</${a}>`;m.toLowerCase().includes(C.toLowerCase())||(m+=C),k=!0,y=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=v.exec(l))!==null;){const C=b[1],I=b[2]||b[3]||b[4]||"";g.push([C,I])}if(c?.has(a)){const C=iX(e);return[{type:a,tag:a,attrs:g,content:C?C.inner:h.innerTokens.length?by(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:C?.raw??m,loading:e.loading||y,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:y,autoClosed:k},h.nextIndex]}function K5(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=>K5(t)).join(""):String(e.content??"")}function cX(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>K5(t)).join("")}function sC(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=cX(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 uX(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function dX(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(...Kn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function fX(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 ym(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 hX(e,t,n){const s=e.slice();return ym(s,"href")||s.push(["href",t]),n!=null&&!ym(s,"title")&&s.push(["title",n]),s}function Dh(e,t,n){const s=e[t],o=fX(s.attrs),i=String(ym(o,"href")??""),r=ym(o,"title"),l=r==null?null:String(r),a=hX(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(y=>y.type==="strong_open")){const y=String(h.content??""),k=String(h.raw??y),g=Ta(h);g.content=y.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=Kn(f,void 0,void 0,n),m=p.map(y=>{const k=y;return"content"in y?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 oC(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 pX(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function iC(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(...Kn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const mX=/\\([\\()[\]`$|*_\-!])/g;function gX(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(mX,"$1")===t))return n}function Qu(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(...Kn(l,gX(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function vX(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(...Kn(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 yX(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(...Kn(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 kX(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const bX=/[^~]*~{2,}[^~]+/,xX=/\*\*/,wX=/[[_*^~]/,_X=/\\([\\()[\]`$|*_\-!])/g,u2=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),SX=/\s/u,CX=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,AX=/\p{P}/u,MX=/^[《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,EX=/^[》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,TX=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,NX=/:\/\//,xy=1,G5=2,IX=4,LX=8,Y5=16,al=32,vp=64,fd=128,Z5=256,$X=512,hd=1024,FX=1982;function Ph(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=fd;break;case 36:t|=Z5;break;case 40:t|=hd;break;case 42:t|=G5;break;case 91:t|=al;break;case 92:t|=xy;break;case 93:t|=vp;break;case 95:t|=IX;break;case 96:t|=Y5;break;case 124:t|=$X;break;case 126:t|=LX;break}return t}function OX(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 X5(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&&u2.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Nl(e){return!!e&&SX.test(e)}function Il(e){return!!e&&(CX.test(e)||AX.test(e))}function Q5(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&MX.test(e)}function J5(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&EX.test(e)}function RX(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||Nl(s)?!1:!(Il(s)&&!Q5(s,n)&&n&&!Nl(n)&&!Il(n))}function BX(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||Nl(n)?!1:!(Il(n)&&!J5(n,s)&&s&&!Nl(s)&&!Il(s))}function DX(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?X5(e,s):t.indexOf("*",s);if(i===-1)break;if(BX(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function PX(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||Nl(s)?!1:!(Il(s)&&!Q5(s,n)&&n&&!Nl(n)&&!Il(n))}function HX(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||Nl(n)?!1:!(Il(n)&&!J5(n,s)&&s&&!Nl(s)&&!Il(s))}function WX(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(HX(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function zX(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&&u2.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function UX(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&u2.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function qX(e,t,n){const s=UX(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 jX=/[\p{L}\p{N}]/u,VX=/^[\p{L}\p{N}]+$/u;function wy(e){return e?jX.test(e):!1}function e8(e){return e?VX.test(e):!1}function Ld(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:wy(s)&&wy(o)}}function KX(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=Ld(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(!e8(e.slice(s.end,o.start)))return o.end}return-1}function GX(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function YX(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=Ld(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function ZX(e){return e?TX.test(e)||NX.test(e):!1}function XX(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Kn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=Nf(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(Y,Q){const P=e.length===1?t:String(Q.content??""),G=[],ye=KX(Y);if(ye!==-1){C(Y.slice(0,ye),Y.slice(0,ye));const fe=Y.slice(ye);return fe&&(F({type:"text",content:fe,raw:fe}),u--),u++,!0}if(bX.test(Y)){const fe=Y.indexOf("~~");fe!==-1&&G.push({type:"strikethrough",index:fe})}if(xX.test(Y)){const fe=Y.indexOf("**");fe!==-1&&G.push({type:"strong",index:fe})}if(/[^*]*\*[^*]+/.test(Y)){const fe=P?X5(P,0):Y.indexOf("*");if(P&&fe===-1)return!1;fe!==-1&&G.push({type:"emphasis",index:fe})}G.sort((fe,K)=>fe.index!==K.index?fe.index-K.index:fe.type===K.type?0:fe.type==="strong"?-1:K.type==="strong"?1:0);const he=G[0];if(!he)return!1;if(he.type==="strikethrough"){const fe=he.index,K=fe>-1?Y.slice(0,fe):"";if(K&&C(K,K),fe===-1)return u++,!0;const ne=Y.indexOf("~~",fe+2),me=ne===-1?Y.slice(fe+2):Y.slice(fe+2,ne),we=ne===-1?"":Y.slice(ne+2),{node:Te}=iC([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:me,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),b(Te),we&&(F({type:"text",content:we,raw:we}),u--),u++,!0}if(he.type==="strong"){const fe=he.index,K=fe>-1?Y.slice(0,fe):"";if(K&&C(K,K),fe===-1)return u++,!0;if(t&&fe===0){let be=!1,_e=0;for(;_e<Y.length&&Y[_e]==="*";)_e++;if(t.startsWith("\\*")&&(be=!0),be){let Ke=0,Qe=0;for(;Qe<t.length&&Ke<_e;)if(t[Qe]==="\\"&&Qe+1<t.length&&t[Qe+1]==="*")Ke+=1,Qe+=2;else{if(t[Qe]==="*")break;Qe++}if(Ke>=2)return C(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>OX(t))return C(Y.slice(K.length),Y.slice(K.length)),u++,!0;const ne=Ld(Y,fe);if(ne.len>=3){const be=YX(Y,fe+ne.len);if(be!==-1){const _e=Y.slice(fe+ne.len,be);if(GX(_e)){const{node:Ke}=Qu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:_e,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(),b(Ke);const Qe=Y.slice(be+3);return Qe&&(F({type:"text",content:Qe,raw:Qe}),u--),u++,!0}}}if(!PX(Y,fe)){const be=Y.slice(fe,fe+ne.len);C(be,be);const _e=Y.slice(fe+ne.len);return _e&&(F({type:"text",content:_e,raw:_e}),u--),u++,!0}const me=WX(Y,fe+2);let we="",Te="";if(me.index!==-1){we=Y.slice(fe+2,me.index),Te=Y.slice(me.index+2);const be=me.index,_e=Ld(Y,be);if(ne.intraword&&_e.intraword&&!e8(we)||!we&&ne.len>=4&&ne.intraword)return C(Y.slice(K.length),Y.slice(K.length)),u++,!0}else{if(d||me.sawInvalidClose||ne.intraword)return C(Y.slice(K.length),Y.slice(K.length)),u++,!0;we=Y.slice(fe+2),Te=""}if(!we&&/^\*+$/.test(Te))return C(Y,Y),u++,!0;const{node:Pe}=Qu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:we,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),b(Pe),Te&&(F({type:"text",content:Te,raw:Te}),u--),u++,!0}if(he.type==="emphasis"){let fe=he.index;fe===-1&&(fe=0);const K=Y.slice(0,fe);if(K&&C(K,K),!RX(Y,fe)){C(Y[fe],Y[fe]);const be=Y.slice(fe+1);return be&&(F({type:"text",content:be,raw:be}),u--),u++,!0}const ne=Ld(Y,fe),me=DX(P,Y,fe+1),we=me.index,Te=e[u+1];if(s?.final&&Te?.type==="em_open"&&we!==-1&&Y.slice(fe+1,we).trim()!==Y.slice(fe+1,we)||we===-1&&(me.sawInvalidClose||s?.final||ne.intraword||!wy(Y[fe+1])))return C(Y.slice(fe),Y.slice(fe)),u++,!0;const{node:Pe}=Bh([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:we>-1?Y.slice(fe+1,we):Y.slice(fe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),b(Pe),we!==-1&&we<Y.length-1){const be=Y.slice(we+1);be&&(F({type:"text",content:be,raw:be}),u--)}return u++,!0}return!1}function y(Y,Q){if(!Y.includes("`"))return!1;const G=(Te=>{for(let Pe=0;Pe<Te.length;Pe++){if(Te[Pe]!=="`")continue;let be=0;for(let _e=Pe-1;_e>=0&&Te[_e]==="\\";_e--)be++;if(be%2===0)return Pe}return-1})(Y);if(G===-1)return!1;let ye=1;for(let Te=G+1;Te<Y.length&&Y[Te]==="`";Te++)ye++;const he="`".repeat(ye),fe=G+ye,K=Y.indexOf(he,fe);if(K===-1){if(ye===1){const Pe=Y.slice(0,G),be=Y.slice(G+1);return Pe&&(m(Pe,Q)?u--:C(Pe,Pe)),g({type:"inline_code",code:be,raw:String(be)}),u++,!0}let Te=Y;for(let Pe=u+1;Pe<e.length;Pe++)Te+=String((e[Pe].content??"")+(e[Pe].markup??""));return u=e.length-1,C(Te,Te),u++,!0}p();const ne=Y.slice(0,G),me=Y.slice(G+ye,K),we=Y.slice(K+ye);return ne&&(m(ne,Q)?u--:C(ne,ne)),g({type:"inline_code",code:me,raw:String(me??"")}),we&&(F({type:"text",content:we,raw:we}),u--),u++,!0}function k(Y){const Q=l?.__markdownIt;if(!Q||e.length<=1||!e.some(he=>he?.type==="math_inline")||!wX.test(Y))return null;const P=Q.parseInline(Y,{__markstreamFinal:!!s?.final});if(!Array.isArray(P)||P.length===0)return null;const G=(P.find(he=>he?.type==="inline")?.children??[]).filter(he=>!(he?.type==="text"&&String(he.content??"")===""));if(!G.length||!G.some(he=>he?.type!=="text")||G.length===1&&G[0]?.type==="text"&&String(G[0].content??"")===Y)return null;const ye=Kn(G,Y,n,s);return ye.length?ye:null}function g(Y){p(),a.push(Y)}function v(Y){p();const Q=Ta(Y);a.push(Q)}function b(Y){g(Y)}function C(Y,Q){c?(c.content+=Y,c.raw+=Q??Y):(c={type:"text",content:String(Y??""),raw:String(Q??Y??"")},a.push(c))}function I(Y,Q){if(!Y)return;const P=Kn([{...Q,type:"text",content:Y,raw:Y}],Y,n,s);if(P.length===1&&P[0]?.type==="text"){const G=P[0];C(String(G.content??""),String(G.raw??G.content??""));return}for(const G of P)b(G)}function T(Y,Q){return String(Y.markup??"").startsWith(Q)}function M(Y){if(!c||Y.loading!==!0||Y.markup!=="\\(\\)")return;const Q=e[u-1];!Q||Q.type!=="text"||!T(Q,"\\(")||c.content.endsWith("(")&&(c.content=c.content.slice(0,-1),c.raw.endsWith("(")&&(c.raw=c.raw.slice(0,-1)),!c.content&&a[a.length-1]===c&&(a.pop(),c=null))}function $(Y){return Y.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 N(Y,Q,P=Ph(Y)){let G=Y;const ye=String(Q.content??"");return(P&xy)!==0&&G.endsWith("\\")&&!T(Q,"\\\\")&&!ye.endsWith("\\\\")&&(G=G.slice(0,-1)),(P&hd)!==0&&G.endsWith("(")&&!T(Q,"\\(")&&!ye.endsWith("\\(")&&(G=G.slice(0,-1)),(P&G5)!==0&&/\*+$/.test(G)&&!T(Q,"\\*")&&!ye.endsWith("\\*")&&(G=G.replace(/\*+$/,"")),G}for(;u<e.length;){const Y=e[u];F(Y)}function F(Y){switch(Y.type){case"text":R(Y);break;case"softbreak":c?(c.content+=`
|
|
202
|
+
`,c.raw+=`
|
|
203
|
+
`):(c={type:"text",content:`
|
|
204
|
+
`,raw:`
|
|
205
|
+
`},a.push(c)),u++;break;case"code_inline":b(uX(Y)),u++;break;case"html_inline":{const[Q,P]=aX(Y,e,u,Kn,t,n,s);b(Q),u=P;break}case"link_open":z(Y);break;case"image":ae(Y)||(p(),b(sC(Y)),u++);break;case"strong_open":{p();const{node:Q,nextIndex:P}=Qu(e,u,Y.content,s);b(Q),u=P;break}case"em_open":{p();const{node:Q,nextIndex:P}=Bh(e,u,s);b(Q),u=P;break}case"s_open":{p();const{node:Q,nextIndex:P}=iC(e,u,s);b(Q),u=P;break}case"mark_open":{p();const{node:Q,nextIndex:P}=sX(e,u,s);b(Q),u=P;break}case"ins_open":{p();const{node:Q,nextIndex:P}=dX(e,u,s);b(Q),u=P;break}case"sub_open":{p();const{node:Q,nextIndex:P}=vX(e,u,s);b(Q),u=P;break}case"sup_open":{p();const{node:Q,nextIndex:P}=yX(e,u,s);b(Q),u=P;break}case"sub":p(),b({type:"subscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`~${String(Y.content??"")}~`}),u++;break;case"sup":p(),b({type:"superscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`^${String(Y.content??"")}^`}),u++;break;case"emoji":{p();const Q=e[u-1];Q?.type==="text"&&/\|:-+/.test(String(Q.content??""))?C("",""):b(XZ(Y)),u++;break}case"checkbox":p(),b(YZ(Y)),u++;break;case"checkbox_input":p(),b(ZZ(Y)),u++;break;case"footnote_ref":p(),b(tX(Y)),u++;break;case"footnote_anchor":{p();const Q=Y.meta??{};g({type:"footnote_anchor",id:String(Q.label??Y.content??""),raw:String(Y.content??"")}),u++;break}case"hardbreak":p(),b(nX()),u++;break;case"fence":p(),b(c2(e[u])),u++;break;case"math_inline":M(Y),p(),!Y.content&&Y.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(b(oC({...Y,content:e[u+1].content})),u+=2):b(oC(Y)),u++;break;case"reference":L(Y);break;case"text_special":C(String(Y.content??""),String(Y.content??"")),u++;break;default:{const Q=Y;if(Y.type==="link"&&Q.href!=null&&s?.validateLink&&!s.validateLink(String(Q.href))){p();const P=String(Q.text??"");C(P,P),u++}else oe(Y)||q(Y)||ie(Y)||O(Y)||v(Y),u++;break}}}function _(Y,Q,P,G,ye=Ph(Y)){const he=kX({...Q,content:Y});if(c){c.content+=N(he.content,Q,ye),c.raw+=he.raw;return}const fe=P?.tag==="br"&&e[u-2]?.content==="[";G||(he.content=N(he.content,Q,ye)),c=he,c.center=fe,a.push(c)}function R(Y){const Q=String(Y.content??""),P=Ph(Q),G=(P&xy)!==0,ye=e.length===1&&G&&typeof t=="string"?String(t):"";let he=ye?zX(ye):G?Q.replace(_X,"$1"):Q;const fe=he===Q?P:Ph(he);if(Y.content==="<"||he==="1"&&e[u-1]?.tag==="br"){u++;return}const K=(fe&Z5)!==0?he.indexOf("$"):-1;K!==-1&&K===he.lastIndexOf("$")&&he.endsWith("$")&&(he=he.slice(0,-1)),he.endsWith("undefined")&&!t?.endsWith("undefined")&&(he=he.slice(0,-9));let ne=a.length,me="";for(let be=a.length-1;be>=0;be--){const _e=a[be];if(_e.type!=="text")break;ne=be,me=String(_e.content??"")+me}ne<a.length&&(he.startsWith(me)?(c=null,a.length=ne):c=a[a.length-1]);const we=e[u+1];if((he==="`"||he==="|"||he==="$")&&!T(Y,`\\${he}`)||/^\*+$/.test(he)&&!T(Y,"\\*")){u++;return}if(!we&&(fe&hd)!==0&&/[^\]]\s*\(\s*$/.test(he)&&(he=he.replace(/\(\s*$/,"")),!he){u++;return}if((fe&(al|fd))===(al|fd)&&te(he)||(fe&(vp|hd))===(vp|hd)&&re(he))return;if((fe&FX)===0){_(he,Y,e[u-1],we,fe),u++;return}if((fe&al)!==0&&ue(he))return;const Te=e[u-1];if((fe&al)!==0&&he==="["&&!we?.markup?.includes("*")&&!T(Y,"\\[")||(fe&vp)!==0&&he==="]"&&!Te?.markup?.includes("*")&&!T(Y,"\\]")){u++;return}if((fe&Y5)!==0&&y(Q,Y)||(fe&(fd|al))===(fd|al)&&Ee(he)||(fe&al)!==0&&(e[u+1]?.type!=="link_open"||$(he))&&pe(he,Y))return;const Pe=k(Q);if(Pe){p();for(const be of Pe)b(be);u++;return}m(he,Y)||(_(he,Y,Te,we,fe),u++)}function z(Y){if(W(Y))return;if(xe()){const{node:K,nextIndex:ne}=Dh(e,u,s),me=String(K.text||K.href||"");C(me,me),u=ne;return}p();const{node:Q,nextIndex:P}=Dh(e,u,s);u=P;const G=Q.text||Q.href||"";if(Y.markup==="linkify"&&!T5(G,Q.href,t)&&pm(G,l?.__linkifyDemotionContext)){C(G,G);return}const ye=Q.children.length===1&&Q.children[0]?.type==="text";if(Q.loading&&t&&Q.text===Q.href&&ye){const K=XX(t,Q.href);K&&(Q.text=K,Q.children=[{type:"text",content:K,raw:K}],Q.raw=`[${K}](${Q.href}${Q.title?` "${Q.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(Q.href)){C(Q.text,Q.text);return}const he=Y.attrs?.find(([K])=>K==="href")?.[1],fe=String(he??"");if(t&&fe){const K=t.indexOf("](");if(K!==-1){const ne=t.indexOf(")",K+2);ne===-1?Q.loading=!0:Q.loading&&t.slice(K+2,ne).includes(fe)&&(Q.loading=!1)}}O(Q)||g(Q)}function W(Y){if(Y.markup!=="linkify")return!1;const{node:Q,nextIndex:P}=Dh(e,u,s);return X(Q,P)?(u=P,!0):!1}function L(Y){p(),b(pX(Y)),u++}function O(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1];if(!Q||Q.type!=="text")return!1;const P=String(Q.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!P)return!1;const G=Y,ye=String(G.href??""),he=String(G.text??""),fe=String(P[2]??""),K=ye.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ye||!(he===ye||he===K||ZX(he)))return!1;const ne=String(P[1]??"");return ne?(Q.content=ne,Q.raw=ne):a.pop(),g({...Y,text:fe,children:[{type:"text",content:fe,raw:fe}],raw:`[${fe}](${ye}${G.title?` "${G.title}"`:""})`}),!0}function q(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.href??"");return P?X({href:P,title:Q.title==null||Q.title===""?null:String(Q.title),loading:!!Q.loading},u+1):!1}function X(Y,Q){const P=a[a.length-1];if(P?.type!=="image"||P.src||!P.loading||!String(P.raw??"").endsWith("]("))return!1;const G=e[Q],ye=String(G?.content??"");if(G?.type!=="text"||!ye.startsWith(")"))return!1;a.pop(),c=null;const he=String(P.alt??"");g({type:"image",src:Y.href,alt:he,title:Y.title,raw:``,loading:!!Y.loading});const fe=ye.slice(1),K=Ta(G);return K.content=fe,K.raw=fe,h()[Q]=K,!0}function ie(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1],P=e[u-1];if(!Q||Q.type!=="text"||P?.type!=="text")return!1;const G=String(Q.content??""),ye=String(P.content??"");if(!G.endsWith("!")||!ye.endsWith("!")||T(P,"\\!"))return!1;const he=G.slice(0,-1);he?(Q.content=he,Q.raw=he,c=Q):(a.pop(),c=null);const fe=Y,K=String(fe.text??fe.children?.map(we=>String(we?.content??we?.raw??"")).join("")??""),ne=String(fe.href??""),me=fe.title==null||fe.title===""?null:String(fe.title);return g({type:"image",src:ne,alt:K,title:me,raw:``,loading:!!fe.loading}),!0}function U(Y,Q="",P=null){const G=String(Y.alt??Y.raw??"");return{type:"link",href:Q,title:P,text:G,children:[Y],raw:`[${G}](${Q}${P?` "${P}"`:""})`,loading:!0}}function j(Y){const Q=Y.startsWith(";return{type:"image",src:"",alt:G===-1?P.replace(/\]$/,""):P.slice(0,G),title:null,raw:Q,loading:!0}}function te(Y){const Q=Y.indexOf("[![");if(Q===-1||typeof t=="string"&&e.length===1&&qX(t,Q,"["))return!1;const P=Y.slice(0,Q);return P&&C(P,P),g(U(j(Y.slice(Q+1)))),u++,!0}function ae(Y){if(s?.final)return!1;const Q=e[u-1];if(Q?.type!=="text"||!String(Q.content??"").endsWith("[")||T(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type==="text"&&P.content.endsWith("[")){const G=P.content.slice(0,-1);G?(P.content=G,P.raw=G,c=P):(a.pop(),c=null)}return g(U(sC(Y))),u++,!0}function oe(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.raw??""),G=String(Q.text??"");if(!P.startsWith("[![")&&!G.startsWith("!["))return!1;const ye=Q.title==null||Q.title===""?null:String(Q.title);return g(U({type:"image",src:String(Q.href??""),alt:G.replace(/^!\[/,"").replace(/\]$/,""),title:ye,raw:P.startsWith("[)return!1;const Q=e[u-2];if(Q?.type==="text"&&String(Q.content??"").endsWith("[")&&T(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type!=="image"&&P?.type!=="link")return!1;const G=P,ye=P?.type==="link"&&Array.isArray(G.children)&&G.children.length===1&&G.children[0]?.type==="image"?a.pop():null,he=ye?ye.children[0]:a.pop();if(!he||he.type!=="image")return!1;const fe=e[u+1];let K=String(ye?.href??""),ne=ye?.title==null?null:String(ye.title),me=!0;if(fe?.type==="link_open"){const{node:Te,nextIndex:Pe}=Dh(e,u+1,s);K=Te.href,ne=Te.title,me=!0,u=Pe}else{if(K=Y.slice(2),K.includes('"')){const Te=K.split('"');K=String(Te[0]??"").trim(),ne=Te[1]==null?null:String(Te[1]).trim()}u++}const we=U(he,K,ne);return we.loading=me,g(we),!0}function xe(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&T(Y,"\\[")}function pe(Y,Q){const P=Y.indexOf("[");if(P===-1)return!1;let G=Y.slice(0,P);const ye=Y.indexOf("](",P);if(ye!==-1){const he=e[u+2];let fe=Y.slice(P+1,ye);if(fe.includes("[")){const be=fe.indexOf("[");G+=Y.slice(0,P+be+1);const _e=P+be+1;fe=Y.slice(_e+1,ye)}const K=e[u+1];if(Y.endsWith("](")&&K?.type==="link_open"&&he){const be=e[u+4];let _e=4,Ke=!0;if(be?.type==="text"){const ot=String(be.content??"");if(ot.startsWith(")")){Ke=!1;const at=ot.slice(1);if(at){const ht=Ta(be);ht.content=at,ht.raw=at,h()[u+4]=ht}else _e++}else ot==="."&&_e++}I(G,Q);const Qe=String(he.content??"");return s?.validateLink&&!s.validateLink(Qe)?C(fe,fe):g({type:"link",href:Qe,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:Ke}),u+=_e,!0}const ne=Y.indexOf(")",ye),me=ne!==-1?Y.slice(ye+2,ne):"",we=ne===-1;let Te=G.match(/\*+$/);if(Te&&(G=G.replace(/\*+$/,"")),I(G,Q),Te||(Te=fe.match(/^\*+/)),!d&&Te){const be=Te[0].length;fe=fe.replace(/^\*+/,"").replace(/\*+$/,"");const _e=[];if(be===1?_e.push({type:"em_open",tag:"em",nesting:1}):be===2?_e.push({type:"strong_open",tag:"strong",nesting:1}):be===3&&(_e.push({type:"strong_open",tag:"strong",nesting:1}),_e.push({type:"em_open",tag:"em",nesting:1})),_e.push({type:"link",href:me,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:we}),be===1){_e.push({type:"em_close",tag:"em",nesting:-1});const{node:Ke}=Bh(_e,0,s);b(Ke)}else if(be===2){_e.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ke}=Qu(_e,0,void 0,s);b(Ke)}else if(be===3){_e.push({type:"em_close",tag:"em",nesting:-1}),_e.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ke}=Qu(_e,0,void 0,s);b(Ke)}else{const{node:Ke}=Bh(_e,0,s);b(Ke)}}else s?.validateLink&&!s.validateLink(me)?C(fe,fe):g({type:"link",href:me,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:we});const Pe=ne!==-1?Y.slice(ne+1):"";return Pe&&(F({type:"text",content:Pe,raw:Pe}),u--),u++,!0}return!1}function Ee(Y){const Q=Y.indexOf("![");if(Q===-1)return!1;const P=Y.slice(0,Q);return P&&!c?c={type:"text",content:P,raw:P}:P&&c&&(c.content+=P),c&&(a.push(c),c=null),g(j(Y.slice(Q))),u++,!0}function ue(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Q=Y.slice(1).match(/[^\s\]]/);if(Q===null)return u++,!0;if(Q&&/x/i.test(Q[0])){const P=Q[0]==="x"||Q[0]==="X";return g({type:"checkbox_input",checked:P,raw:P?"[x]":"[ ]"}),u++,!0}return!1}return a}function d2(e,t,n){const s=n?.__sourceLineMapper;if(!s)return{startLine:e,endLine:t};const o=s(e),i=t>e?s(t-1).endLine:s(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,i)}}function rC(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let s=0;for(let o=0;o<n;o++)e[o]===`
|
|
206
|
+
`&&s++;return s}function QX(e,t,n){const s=Math.max(0,Math.min(e.length,Math.trunc(t))),o=Math.max(s,Math.min(e.length,Math.trunc(n))),i=rC(e,s);let r=rC(e,o);return o>s&&e[o-1]!==`
|
|
207
|
+
`&&r++,{startLine:i,endLine:r}}function T1(e,t,n,s){const o=QX(e,t,n);return d2(o.startLine,o.endLine,s)}function JX(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const s=Number(n[0]),o=Number(n[1]);return!Number.isFinite(s)||!Number.isFinite(o)?null:d2(s,o,t)}function on(e,t,n){if(!n?.includeSourceMap)return e;const s=JX(t,n);if(!s)return e;if(e.sourceMap=s,e.type==="code_block"){const o=e;o.startLine=s.startLine,o.endLine=s.endLine}return e}function eQ(e,t,n,s){if(!s?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const i=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=d2(i,Math.max(r,l),s)),e}function tQ(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 nQ(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 sQ(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function gu(e,t,n){const s=e[t],o=[],i=Bl(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 a=[];let c=r+1;for(;c<e.length&&e[c].type!=="list_item_close";)if(e[c].type==="paragraph_open"){const d=e[c+1],f=sQ(d)?Ta(d):d,h=e[c-1];f!==d&&(nQ(f),tQ(f));const p=String(f.content??""),m={type:"paragraph",children:Kn(f.children||[],p,h,i.options()),raw:p};n?.includeSourceMap&&on(m,e[c],n),a.push(m),i.remember(p),c+=3}else if(e[c].type==="blockquote_open"){const[d,f]=vu(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=gu(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else{const d=h2(e,c,i.options(),f2);d?(a.push(d[0]),i.remember(d[0].raw),c=d[1]):c+=1}const u={type:"list_item",children:a,raw:a.map(d=>d.raw).join("")};n?.includeSourceMap&&on(u,e[r],n),o.push(u),r=c+1}else r+=1;const l={type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const a=s.attrs.find(c=>c[0]==="start");if(a){const c=Number(a[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:o,raw:o.map(a=>a.raw).join(`
|
|
208
|
+
`)};return n?.includeSourceMap&&on(l,s,n),[l,r+1]}function oQ(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Bl(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:Kn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};s?.includeSourceMap&&on(u,e[a],s),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]=gu(e,a,l.options());s?.includeSourceMap&&on(c,e[a],s),r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=vu(e,a,l.options());s?.includeSourceMap&&on(c,e[a],s),r.push(c),l.remember(c.raw),a=u}else{const c=N1(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}
|
|
209
|
+
${r.map(c=>c.raw).join(`
|
|
210
|
+
`)}
|
|
211
|
+
:::`},a+1]}const iQ=new Set(["warning","info","note","tip","danger","caution"]);function rQ(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 iQ.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function lQ(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=rQ(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Bl(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 y=f[m];if(y.type==="text"&&/:+/.test(y.content)){h=m;break}}const p={type:"paragraph",children:Kn((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&on(p,e[c],n),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]=gu(e,c,a.options());n?.includeSourceMap&&on(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=vu(e,c,a.options());n?.includeSourceMap&&on(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else{const d=N1(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}
|
|
212
|
+
${l.map(d=>d.raw).join(`
|
|
213
|
+
`)}
|
|
214
|
+
:::`},c+1]}const aQ=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function cQ(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=aQ.exec(String(s.info??""));return o?oQ(e,t,o,n):null}const f2={parseContainer:(e,t,n)=>lQ(e,t,n),matchAdmonition:cQ};function vu(e,t,n){const s=[],o=Bl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";){const l=e[i];switch(l.type){case"paragraph_open":{const a=e[i+1],c={type:"paragraph",children:Kn(a.children||[],String(a.content??""),void 0,o.options()),raw:String(a.content??"")};n?.includeSourceMap&&on(c,l,n),s.push(c),o.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=gu(e,i,o.options());s.push(a),o.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=vu(e,i,o.options());s.push(a),o.remember(a.raw),i=c;break}default:{const a=h2(e,i,o.options(),f2);a?(s.push(a[0]),o.remember(a[0].raw),i=a[1]):i++;break}}}const r={type:"blockquote",children:s,raw:s.map(l=>l.raw).join(`
|
|
215
|
+
`)};return n?.includeSourceMap&&on(r,e[t],n),[r,i+1]}function uQ(e){if(e.info?.startsWith("diff"))return c2(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 dQ(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Bl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Kn(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:Kn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
216
|
+
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
217
|
+
`)},o+1]}function fQ(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Bl(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:Kn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
218
|
+
`)}`},l+1]}function hQ(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:Kn(a.children||[],c,void 0,n),raw:c}}function pQ(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 t8(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=Tl.has(n),l=E1(o),a=(s===-1?-1:pQ(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
219
|
+
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function mQ(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 gQ(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 n8(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function s8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return n8(n)?n:void 0}function vQ(e,t,n){const s=s8(Nf(t),n);if(!n8(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 yQ(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=gQ(e[c].attrs),y=a.length,k=!f&&!r,g=k?o?.cells[y]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Kn(h.children||[],p,void 0,vQ(n,g,k?u:void 0)),raw:p,align:m}),k&&(u=s8(u,Nf(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(`
|
|
220
|
+
`)},s+1]}function kQ(){return{type:"thematic_break",raw:"---"}}let Og=null;const Rg=new WeakMap;function lC(){return Og||(Og={allowedTagSet:$1(),customTagSet:null}),Og}function bQ(e){if(!e||e.length===0)return lC();const t=Rg.get(e);if(t)return t;const n=e.map(mi).filter(Boolean);if(!n.length){const o=lC();return Rg.set(e,o),o}const s={allowedTagSet:$1({customHtmlTags:e}),customTagSet:new Set(n)};return Rg.set(e,s),s}function xQ(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=Bl(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:Kn(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};n?.includeSourceMap&&on(p,e[c],n),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]=gu(e,c,a.options());n?.includeSourceMap&&on(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=vu(e,c,a.options());n?.includeSourceMap&&on(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else{const h=N1(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&&s.meta?.unclosed!==!0||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
221
|
+
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
222
|
+
`),f+=`
|
|
223
|
+
`),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 Bg(e,t,n,s){if(n?.type.endsWith("_close")){let o=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(o)||(o=Array.isArray(t.map)?Number(t.map[1])+1:NaN),eQ(e,t,o,s)}return on(e,t,s)}function wQ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function _Q(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function SQ(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Ii(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ii(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 CQ(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),start:r,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),start:r,end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const y=m+1;return{raw:e.slice(r,y),start:r,end:y}}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),start:r,end:e.length}}function _y(e){return Number.isFinite(e)&&e>0?e:0}function AQ(e,t){const n=_y(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
224
|
+
`&&(s++,s===n))return o+1;return e.length}function N1(e,t,n){const s=e[t],o=n?.includeSourceMap===!0;switch(s.type){case"heading_open":{const i=hQ(e,t,n);return o&&on(i,s,n),[i,t+3]}case"code_block":{const i=uQ(s);return o&&on(i,s,n),[i,t+1]}case"fence":{const i=c2(s);return o&&on(i,s,n),[i,t+1]}case"math_block":{const i=mQ(s);return o&&on(i,s,n),[i,t+1]}case"html_block":{const i=t8(s),r=i.tag?bQ(n?.customHtmlTags):null;if(i.tag&&i.loading&&r&&!r.allowedTagSet.has(i.tag)){const l=String(s.content??"").replace(/\n+$/,""),a={type:"paragraph",children:l?[{type:"text",content:l,raw:l}]:[],raw:l};return o&&on(a,s,n),[a,t+1]}if(i.tag&&r?.customTagSet?.has(i.tag)){const l=i.tag,a=String(n?.__sourceMarkdown??""),c=Number(n?.__customHtmlBlockCursor??0),u=Array.isArray(s.map)?AQ(a,Number(s.map?.[0]??0)):0,d=CQ(a,l,Math.max(_y(c),_y(u)));d&&n&&(n.__customHtmlBlockCursor=d.end);const f=String(d?.raw??i.raw??""),h=Jn(f),p=h!==-1?f.slice(0,h+1):f,m=h!==-1&&/\/\s*>\s*$/.test(p),y=h===-1?null:SQ(f,l,h+1),k=y?.start??-1;let g="";h!==-1&&(k!==-1&&h<k?g=f.slice(h+1,k):g=f.slice(h+1)),k===-1&&(g=_Q(g,l));const v=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let C;for(;(C=b.exec(p))!==null;){const M=C[1];if(!M||M.toLowerCase()===l)continue;const $=C[2]||C[3]||C[4]||"";v.push([M,$])}const I=!n?.final&&!m&&y==null,T={type:l,tag:l,content:wQ(g),raw:String(d?.raw??i.raw??f),loading:I,attrs:v.length?v:void 0};return o&&(d?T.sourceMap=T1(a,d.start,d.end,n):on(T,s,n)),[T,t+1]}return o&&on(i,s,n),[i,t+1]}case"table_open":{const[i,r]=yQ(e,t,n);return o&&on(i,s,n),[i,r]}case"dl_open":{const[i,r]=dQ(e,t,n);return o&&on(i,s,n),[i,r]}case"footnote_open":{const[i,r]=fQ(e,t,n);return o&&on(i,s,n),[i,r]}case"hr":{const i=kQ();return o&&on(i,s,n),[i,t+1]}}return null}function h2(e,t,n,s){const o=N1(e,t,n);if(o)return o;const i=e[t],r=n?.includeSourceMap===!0;switch(i.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){const l=s.parseContainer(e,t,n);return r&&Bg(l[0],i,e[l[1]-1],n),l}break;case"container_open":if(s?.matchAdmonition){const l=s.matchAdmonition(e,t,n);if(l)return r&&Bg(l[0],i,e[l[1]-1],n),l}break;case"vmr_container_open":{const l=xQ(e,t,n);return r&&Bg(l[0],i,e[l[1]-1],n),l}}return null}function MQ(){return{type:"hardbreak",raw:`\\
|
|
225
|
+
`}}function EQ(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Kn(s.children||[],o,void 0,n),raw:o}}const aC=new WeakMap,o8=new WeakMap,cC=new WeakMap,uC=new WeakMap;function Wi(e,t,n){const s=t?.map,o=n?.__sourceMarkdown;if(!Array.isArray(s)||s.length<2||typeof o!="string"||!n)return;const i=Number(s[0]),r=Number(s[1]);if(!Number.isFinite(i)||!Number.isFinite(r))return;let l=cC.get(n);if(!l){l=[0];for(let a=0;a<o.length;a++)o[a]===`
|
|
226
|
+
`&&l.push(a+1);cC.set(n,l)}o8.set(e,{start:l[Math.max(0,Math.trunc(i))]??o.length,end:l[Math.max(0,Math.trunc(r))]??o.length})}const I1=new WeakMap,dC=new WeakMap,TQ=["$$","\\["],NQ=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/,km=new WeakMap,pd=new WeakMap,IQ=new Set(["code_inline","em_close","em_open","emoji","hardbreak","ins_close","ins_open","mark_close","mark_open","s_close","s_open","softbreak","strong_close","strong_open","sub","sup","text"]),LQ=new Map([["paragraph_open","paragraph_close"],["heading_open","heading_close"],["bullet_list_open","bullet_list_close"],["ordered_list_open","ordered_list_close"],["blockquote_open","blockquote_close"],["table_open","table_close"]]),$Q=new Set(["code_block","fence","hr","math_block"]);function uu(){return typeof performance<"u"?performance.now():Date.now()}function hf(e,t,n){e&&(e[t]=(e[t]??0)+n)}function i8(e){return e.__timing}function r8(e,t,n){return t&&hf(t,"parseMarkdownToStructureTotalMs",uu()-n),e}function l8(e,t){const n=t.postTransformNodes;if(typeof n!="function")return e;const s=n(e);return Array.isArray(s)?s:e}function fC(e,t,n,s){return r8(l8(e,t),n,s)}function yp(e,t,n){if(!n)return SC(e,t);hf(n,"processTokensInputTokens",e.length);const s=uu(),o=SC(e,t);return hf(n,"processTokensMs",uu()-s),o}function a8(e){return e.every(t=>{if(!IQ.has(t.type))return!1;const n=t.children;return!Array.isArray(n)||a8(n)})}function FQ(e){const t=[];let n=!1,s=0;for(;s<e.length;){const o=e[s];if(!o||o.level!==0)return null;const i=LQ.get(o.type);let r=s+1;if(i){if(o.nesting!==1)return null;for(;r<e.length;){const l=e[r];if(l.level===0){if(l.type!==i||l.nesting!==-1)return null;r++;break}r++}if(e[r-1]?.type!==i)return null;if(o.type==="paragraph_open"||o.type==="heading_open"){if(r!==s+3||e[s+1]?.type!=="inline")return null}else n=!0}else if($Q.has(o.type)){if(o.nesting!==0)return null;n=!0}else return null;for(let l=s;l<r;l++){const a=e[l];if(a.type!=="inline")continue;const c=a.children;if(!Array.isArray(c)||!a8(c))return null}t.push(s),s=r}return{mixed:n,starts:t}}function OQ(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function RQ(e){return e.__reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!e.customHtmlTags?.length&&e.includeSourceMap!==!0}function hC(e,t,n,s,o,i){const r=s.starts;if(r.length===0||o.length!==r.length){km.delete(e);return}const l=r.map((a,c)=>{const u=r[c+1]??n.length;return{firstToken:n[a],lastToken:n[u-1],tokenCount:u-a}});km.set(e,{groupBoundaries:l,source:t,nodes:o,stableGroupCount:s.mixed?Math.max(0,r.length-1):OQ(t)?r.length:Math.max(0,r.length-1),requireClosingStrong:i.requireClosingStrong})}function BQ(e,t,n,s){for(let o=0;o<s;o++){const i=n[o],r=n[o+1]??t.length,l=e.groupBoundaries[o];if(!l||l.firstToken!==t[i]||l.lastToken!==t[r-1]||l.tokenCount!==r-i)return!1}return!0}function DQ(e,t,n,s,o){const i=e,r=FQ(n);if(!(p2(e,s)&&RQ(s)&&r!==null))return km.delete(i),yp(n,s,o);const l=r.starts,a=km.get(i),c=pd.get(i),u=a&&r.mixed?Math.min(a.stableGroupCount,Math.max(0,a.groupBoundaries.length-1)):a?.stableGroupCount??0;if(a&&u>0&&a.requireClosingStrong===s.requireClosingStrong&&t.startsWith(a.source)&&l.length>=u&&(c==="append"||c==="tail")&&BQ(a,n,l,u)){const f=l[u]??n.length,h=yp(n.slice(f),s,o),p=l.length-u;if(h.length===p){const m=a.nodes.slice(0,u).concat(h);return hf(o,"processTokensReusedTopLevelNodes",u),hC(e,t,n,r,m,s),m}}const d=yp(n,s,o);return hC(e,t,n,r,d,s),d}function PQ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Va(t);return n.length?new Set(n):null}function HQ(e,t){const n=e;let s=aC.get(n);s||(s=new Map,aC.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 WQ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Hh(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]=fa(o.value,n))}}function fa(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(fa(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(fa(l,t),fa(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(fa(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),Hh(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Hh(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),Hh(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!WQ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Hh(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=fa(i[r],t);return o}function c8(e,t=!0){if(!t)return Ta(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=>c8(a,t)):t&&r&&typeof r=="object"&&(l=fa(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function pC(e,t=!0){return e.map(n=>c8(n,t))}function p2(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function zQ(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function UQ(e){I1.delete(e)}function qQ(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function $d(e){return{...e}}function jQ(e,t,n,s=L1(t).state){I1.set(e,{explicitBracketMath:s,source:t,key:n,pendingCandidate:n===null&&W5(t)})}function VQ(e){return e.endsWith("$")||e.endsWith("\\")}function KQ(e){const t=Math.max(e.lastIndexOf(`
|
|
227
|
+
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return TQ.some(s=>n.endsWith(s))}function GQ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||KQ(e)&&/[\r\n]/.test(t)):!1}function Ju(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Sy(e){return e===" "||e===" "}function u8(e,t){return t===" "?e+1:e+4-e%4}function m2(e){let t=0,n=0;for(;t<e.length&&Sy(e[t]);)n=u8(n,e[t]),t++;return{index:t,column:n}}function yu(e){const t=m2(e);return t.column>3?null:t}function Dg(e){const t=yu(e);if(!t)return null;const n=t.index,s=e[n];if(s!=="`"&&s!=="~")return null;let o=n;for(;o<e.length&&e[o]===s;)o++;const i=o-n;if(i<3)return null;const r=e.slice(o);return s==="`"&&r.includes("`")?null:{markerChar:s,markerLen:i,rest:r}}function g2(e){const t=yu(e);if(!t)return null;const n=e.slice(t.index),s=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n)?.[0];if(!s)return null;let o=t.index+s.length,i=t.column+s.length;if(!Sy(e[o]))return null;for(;o<e.length&&Sy(e[o]);)i=u8(i,e[o]),o++;return{content:e.slice(o),contentIndent:i}}function v2(e){let t=e,n=!1;for(;;){const s=yu(t);if(!s)return n?t:null;let o=s.index;if(t[o]!==">")return n?t:null;n=!0,o++,(t[o]===" "||t[o]===" ")&&o++,t=t.slice(o)}}function d8(e){const t=Dg(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=v2(e),s=n==null?null:Dg(n);if(s)return{...s,inBlockquote:!0,inList:!1,listIndent:0};const o=g2(e);if(!o)return null;const i=Dg(o.content);return i==null?null:{...i,inBlockquote:!1,inList:!0,listIndent:o.contentIndent}}function YQ(e,t){let n=!1,s="",o=0,i=!1,r=!1,l=0,a=null,c=0;for(;c<t;){const u=e.indexOf(`
|
|
228
|
+
`,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=m2(h),m=g2(h);n&&i&&h.trim()&&v2(h)==null&&(n=!1,s="",o=0,i=!1,r=!1,l=0),n&&r&&h.trim()&&p.column<l&&!m&&(n=!1,s="",o=0,i=!1,r=!1,l=0),m?a=m.contentIndent:h.trim()&&a!=null&&p.column<a&&!n&&(a=null);const y=d8(h);if(y&&(n?y.markerChar===s&&y.markerLen>=o&&/^\s*$/.test(y.rest)&&(n=!1,s="",o=0,i=!1,r=!1,l=0):(n=!0,s=y.markerChar,o=y.markerLen,i=y.inBlockquote,r=y.inList||a!=null&&!y.inBlockquote&&p.column>=a,l=y.listIndent||a||0)),u===-1||u>=t)break;c=u+1}return n}function ZQ(e,t){const n=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"||d===":"},o=d=>{if(d[0]!=="<")return null;let f=1;for(;f<d.length&&n(d[f]);)f++;const h=d[f]==="/";if(h)for(f++;f<d.length&&n(d[f]);)f++;const p=f;for(;f<d.length&&s(d[f]);)f++;if(f===p)return null;const m=d.slice(p,f).toLowerCase();if(!m5.has(m))return null;const y=d[f];if(y&&y!==" "&&y!==" "&&y!==">"&&y!=="/")return null;const k=Jn(d);if(k===-1)return null;let g=k-1;for(;g>=0&&n(d[g]);)g--;return{closing:h,tag:m,selfClosing:!h&&d[g]==="/",after:d.slice(k+1)}},i=(d,f)=>{const h=d.toLowerCase();let p=0;for(;p<h.length;){const m=h.indexOf("</",p);if(m===-1)return!1;for(p=m+2;p<h.length&&n(h[p]);)p++;if(h.startsWith(f,p)){const y=h[p+f.length];if(!y||y===" "||y===" "||y===">")return!0}}return!1},r=[];let l=!1,a=!1,c=!1,u=0;for(;u<t;){const d=e.indexOf(`
|
|
229
|
+
`,u),f=d===-1||d>=t?t:d,h=e.slice(u,f),p=h.endsWith("\r")?h.slice(0,-1):h,m=yu(p);if(m){const y=p.slice(m.index);if(l)l=!y.includes("-->");else if(a)a=!y.includes(">");else if(c)c=!y.includes("?>");else if(y.startsWith("<!--"))l=!y.includes("-->");else if(y.startsWith("<?"))c=!y.includes("?>");else if(y.startsWith("<!"))a=!y.includes(">");else{const k=o(y);if(k)if(k.closing){for(let g=r.length-1;g>=0;g--)if(r[g]===k.tag){r.length=g;break}}else k.selfClosing||i(k.after,k.tag)||r.push(k.tag)}}if(d===-1||d>=t)break;u=d+1}return l||a||c||r.length>0}function XQ(e,t,n){if(!n?.length)return!1;const s=new Set(Va(n));if(!s.size)return!1;const o=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"||u===":"},i=u=>u===" "||u===" ",r=u=>{if(u[0]!=="<")return null;let d=1;for(;d<u.length&&i(u[d]);)d++;const f=u[d]==="/";if(f)for(d++;d<u.length&&i(u[d]);)d++;const h=d;for(;d<u.length&&o(u[d]);)d++;if(d===h)return null;const p=u.slice(h,d).toLowerCase();if(!s.has(p))return null;const m=u[d];if(m&&m!==" "&&m!==" "&&m!==">"&&m!=="/")return null;const y=u.indexOf(">",d);if(y===-1)return null;let k=y-1;for(;k>=0&&i(u[k]);)k--;return{closing:f,tag:p,selfClosing:!f&&u[k]==="/",after:u.slice(y+1)}},l=(u,d)=>{const f=u.toLowerCase();let h=0;for(;h<f.length;){const p=f.indexOf("</",h);if(p===-1)return!1;for(h=p+2;h<f.length&&i(f[h]);)h++;if(f.startsWith(d,h)){const m=f[h+d.length];if(!m||m===" "||m===" "||m===">")return!0}}return!1},a=[];let c=0;for(;c<t;){const u=e.indexOf(`
|
|
230
|
+
`,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=yu(h);if(p){const m=r(h.slice(p.index));if(m)if(m.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===m.tag){a.length=y;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(u===-1||u>=t)break;c=u+1}return a.length>0}function QQ(e,t){const n=NQ.exec(e);if(!n)return null;const s=n[1]??"",o=n.index+s.length,i=e.indexOf(`
|
|
231
|
+
`,o),r=e.slice(o,i===-1?e.length:i);return!yu(r.endsWith("\r")?r.slice(0,-1):r)||YQ(e,o)||ZQ(e,o)||XQ(e,o,t)?null:`${e.slice(0,n.index)}${s}`}function f8(e,t,n){let s=t;for(;s<e.length&&e[s]===n;)s++;return s-t}function JQ(e,t,n){let s=t;for(;s<e.length;){const o=e.indexOf("`",s);if(o===-1)return-1;const i=f8(e,o,"`");if(i===n)return o;s=o+i}return-1}function Pg(e){e.inFence=!1,e.fenceChar="",e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function mC(e,t,n,s,o){let i=0,r=!1;for(;i<e.length;){const l=i;if(t.inMath){if(e.startsWith("\\]",i)&&!Ju(e,l)){s!=null&&o&&n+i+2>s&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,i+=2;continue}i++;continue}if(t.inDollarMath){if(e.startsWith("$$",i)&&!Ju(e,l)){s!=null&&o&&n+i+2>s&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,i+=2;continue}i++;continue}if(e[i]==="`"&&!Ju(e,l)){const a=f8(e,i,"`"),c=JQ(e,i+a,a);if(c===-1)break;i=c+a;continue}if(e.startsWith("\\[",i)&&!Ju(e,l)){t.inMath=!0,t.mathOpenOffset=n+i,i+=2;continue}if(e.startsWith("$$",i)&&!Ju(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+i,i+=2;continue}i++}return r}function eJ(e,t){if(!l2(t))return e;const n=t,s=dC.get(n),o=s?.source===e?s.state:s&&e.startsWith(s.source)?h8(s.state,e.slice(s.source.length),s.source.length-s.state.lineBuffer.length).state:L1(e).state;dC.set(n,{source:e,state:o});const{context:i}=o,r=i.inMath?i.mathOpenOffset:i.inDollarMath?i.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(`
|
|
232
|
+
`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const c=l.trim(),u=/^(?:[a-z]|pi)$/i.test(c);return pl(l)&&!u?e:e.slice(0,r)}function tJ(e,t,n,s,o){const i=m2(e),r=g2(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&v2(e)==null&&Pg(t),t.inFence&&t.fenceInList&&e.trim()&&i.column<t.fenceListIndent&&!r&&Pg(t),r?t.listContentIndent=r.contentIndent:e.trim()&&t.listContentIndent!=null&&i.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){const l=d8(e);if(l)t.inFence?l.markerChar===t.fenceChar&&l.markerLen>=t.fenceLen&&/^\s*$/.test(l.rest)&&Pg(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&i.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return mC(e,t,n,s,o)}else return mC(e,t,n,s,o);return!1}function L1(e,t=qQ(),n=null,s=!1,o=0){const i=$d(t);let r=$d(t),l="",a=!1,c=0;for(;c<e.length;){const u=e.indexOf(`
|
|
233
|
+
`,c),d=u!==-1,f=d&&u>c&&e[u-1]==="\r"?u-1:d?u:e.length,h=e.slice(c,f);tJ(h,i,o+c,n,s)&&(a=!0),d?(r=$d(i),l=""):l=h,c=d?u+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:i,lineBuffer:l}}}function h8(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:$d(e.committedContext),context:$d(e.context),lineBuffer:e.lineBuffer+t}}:L1(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function nJ(e,t){if(!l2(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=I1.get(s);if(o?.source===t)return;const i=o?t.startsWith(o.source):!1,r=i&&o?t.slice(o.source.length):"",l=i&&o?h8(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):L1(t),a=l.state,c=i&&o?l.closedOpenMath:!1;if(o&&i&&o.key===null&&o.pendingCandidate===!1&&!c&&!GQ(o.source,r)&&!VQ(t)){o.source=t,o.explicitBracketMath=a;return}const u=PZ(t);(o&&(o&&!i||o.key!==u||c)||!o&&u)&&n.reset(),jQ(e,t,u,a)}function sJ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function oJ(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 Hg(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&&oJ(e,t)}function gC(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function iJ(e){for(let t=0;t+5<e.length;t++)if(gC(e,t)&&gC(e,t+3)&&Hg(e[t],e[t+3])&&Hg(e[t+1],e[t+4])&&Hg(e[t+2],e[t+5]))return!0;return!1}function rJ(e,t,n){return l2(e)&&W5(t)&&iJ(n)}function lJ(e){const t=I1.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function vC(e,t,n,s){const o=e;if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!p2(e,s)||(nJ(e,t),lJ(e)))return pd.set(o,"sync"),e.parse(t,n);const i=e.stream.parse(t,HQ(e,n));if(rJ(e,t,i))return e.stream?.reset?.(),pd.set(o,"sync"),e.parse(t,n);const r=e.stream?.stats?.();if(pd.set(o,r?.lastMode??"stream"),!sJ(s))return i;const l=i8(s);if(!l)return pC(i,!0);const a=uu(),c=pC(i,!0);return hf(l,"tokenCloneMs",uu()-a),c}function $1(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return cf;const n=new Set(cf);for(const s of Va(t))s&&n.add(s);return n}function aJ(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 yC(e){return{type:"paragraph",children:e,raw:e.map(aJ).join("")}}function kC(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function bC(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=PQ(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(yC(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(yC(c)),a}function cJ(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 Fd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function uJ(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*${Ii(t)}\s*>\s*$`,"i").test(n)}const Wg=new Set(["iframe","script","style","textarea","title"]);function Lf(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=f=>{if(e.startsWith("<!--",f)){const v=e.indexOf("-->",f+4);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}if(e.startsWith("<![CDATA[",f)){const v=e.indexOf("]]>",f+9);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}const h=Jn(e.slice(f));if(h===-1)return null;const p=f+h+1,m=e.slice(f,p);if(/^<\s*[!?]/.test(m))return{closing:!1,end:p,selfClosing:!1,tag:""};let y=m.slice(1).trimStart();const k=y.startsWith("/");k&&(y=y.slice(1).trimStart());const g=y.match(/^([A-Z][\w:-]*)/i);return g?.[1]?{closing:k,end:p,selfClosing:/\/\s*>$/.test(m),tag:g[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},i=(f,h)=>{const p=new RegExp(String.raw`<\s*\/\s*${Ii(f)}(?=\s|>)`,"gi");p.lastIndex=h;const m=p.exec(e);if(!m||m.index==null)return null;const y=o(m.index);return y?{start:m.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a<e.length;){const f=e.indexOf("<",a);if(f===-1)return null;const h=o(f);if(!h)return null;if(!h.closing&&h.tag===s){r=f,l=h.end-1;break}if(!h.closing&&Wg.has(h.tag)){a=i(h.tag,h.end)?.end??e.length;continue}a=h.end}if(r===-1||l===-1)return null;const c=e.slice(r,l+1);if(Tl.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:l+1,closed:!0};if(Wg.has(s)){const f=i(s,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let u=1,d=l+1;for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};const h=o(f);if(!h)return null;if(h.closing&&h.tag===s){u--;const p=h.end;if(u===0)return{raw:e.slice(r,p),start:r,end:p,closeStart:f,closed:!0};d=p;continue}if(!h.closing&&h.tag===s){!h.selfClosing&&!Tl.has(h.tag)&&u++,d=h.end;continue}if(!h.closing&&Wg.has(h.tag)){d=i(h.tag,h.end)?.end??e.length;continue}d=h.end}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function dJ(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]===`
|
|
234
|
+
`){n++;continue}return-1}return s===t.length?n:-1}function fJ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
235
|
+
</${t}>`}function xC(e){return e.replace(/\r\n/g,`
|
|
236
|
+
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function hJ(e,t,n){return n?e.includes(n,t)?!0:xC(e.slice(Math.max(0,t))).includes(xC(n)):!1}function pJ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
237
|
+
`&&n++,n):e[n]===`
|
|
238
|
+
`?n+1:t}function wC(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 mJ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function p8(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ii(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function m8(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const gJ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),vJ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function yJ(e){return/\n\s*\n/.test(e)||vJ.test(e)}function kJ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>gJ.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(!yJ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function bJ(e){const t=[];let n=0;for(;n<e.length;){for(;/\s/.test(e[n]??"");)n++;if(n>=e.length)break;const s=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!s?.[1])return null;const o=Lf(e,s[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function xJ(e,t,n,s){const o=n.customHtmlTags?.join("\0")??"",i=t,r=uC.get(i),l=r&&r.final===s&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((c,u)=>l&&r.blocks[u]===c?r.children[u]:Jc(c,t,n));return uC.set(i,{blocks:e,children:a,customHtmlTags:o,final:s,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function wJ(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"||v5.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=Lf(l,r,0),u=c?.closeStart??-1,d=c?.closed===!0&&u>=a+1,f=d?l.slice(a+1,u):l.slice(a+1);if(!f.trim())return o;const h=m8(n,s),p=d?null:bJ(f),m=p?xJ(p,t,h,s):Jc(f,t,h);return kJ(f,m)?{...o,children:m}:o})}function _J(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function Jc(e,t,n){return e.trim()?v8(e,t,{...n,__disableStreamParse:!0}):[]}function SJ(e,t,n){const s=Jc(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function CJ(e,t,n){const s=t8({content:e}),o=Jn(e),i=p8(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=SJ(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function AJ(e,t,n){const s=Jn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=Lf(o,"summary",0);if(!i)return Jc(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Jc(r,t,n),CJ(i.raw,t,n),...Jc(l,t,n)]}function g8(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=Fd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!wC(c)){r.push(c);continue}const f=String(c.raw??Fd(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 ie=a+1;ie<e.length;ie++){const U=e[ie];if(wC(U)){p++;continue}if(mJ(U)&&(p--,p===0)){m=ie;break}}const y=Lf(t,"details",h),k=m===-1&&y?.closed===!0,g=k?(()=>{const ie=p8(f,"details");return ie!==-1?f.slice(0,ie):f})():f,[v]=g8(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),b=AJ(g,n,m8(s,o)),C=m===-1?"</details>":String(e[m].raw??Fd(e[m])??"</details>"),I=k||m!==-1&&y?.closed===!0,T=C.replace(/[\t\r\n ]+$/,""),M=I?(()=>{const ie=(y?.raw??"").lastIndexOf(T);return ie===-1?t.length:h+ie})():t.length,$=Jn(f),N=k&&$!==-1?h+$+1:h+f.length,F=t.slice(N,M===-1?t.length:M),_=n.parse(F,{__markstreamFinal:o}),R=n.renderer.render(_,n.options,{__markstreamFinal:o}),z=M+T.length,W=I?Math.max(M+C.length,pJ(t,z)):t.length,L=I?t.slice(M,W):C,O=I?t.slice(h,W):t.slice(h),q=k&&$!==-1?f.slice(0,$+1):f,X={...c,tag:"details",attrs:E1(f.slice(0,$+1)),raw:O,content:`${q}${R}${L}`,children:[...b,...v],loading:!o&&!I};if(s.includeSourceMap&&(X.sourceMap=T1(t,h,I?W:t.length,s)),r.push(X),l=I?W:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function MJ(e,t,n,s){if(!n)return e;const o=e.slice();let i=0;for(let r=0;r<o.length;r++){const l=o[r],a=Fd(l),c=a?n.indexOf(a,i):-1;if(l?.type!=="html_block"){c!==-1&&(i=c+a.length);continue}const u=String(l.tag??"").toLowerCase();if(!u)continue;if(u==="details"){c!==-1&&(i=c+a.length);continue}const d=Lf(n,u,c!==-1?c:i);if(!d)continue;i=d.end;const f=String(l.content??a),h=String(l.raw??f),p=fJ(d.raw,u,d.closed),m=!t&&!d.closed,y=f!==p||h!==d.raw||!!l.loading!==m,k=Jn(d.raw),g=k===-1?"":d.raw.slice(0,k+1),v=g?E1(g):[];if(l.content=p,l.raw=d.raw,l.loading=m,l.attrs=v.length?v:void 0,s?.includeSourceMap&&(l.sourceMap=T1(n,d.start,d.end,s)),!y)continue;let b=dJ(d.raw,h);b===-1&&(b=0);const C=r+1;for(;C<o.length;){if(d.closed&&uJ(o[C],u)){o.splice(C,1);continue}const I=Fd(o[C]);if(!I)break;const T=d.raw.indexOf(I,b);if(T===-1){if(hJ(n,d.end,I))break;const M=o8.get(o[C]);if(!M)break;if(M.start>=d.start&&M.end<=d.end){o.splice(C,1);continue}break}b=T+I.length,o.splice(C,1)}}return o}function EJ(e){const t=l=>l===" "||l===" "||l===`
|
|
239
|
+
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l.startsWith("<!--")||l.startsWith("<?")||l.startsWith("<!")||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const y=m.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},u=m=>{const y=m.charCodeAt(0);return y>=48&&y<=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 y=l[a];if(t(y)||y==="<"||y===">"||y==='"'||y==="'"||y==="`")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 b=g[v];if(b!=="`"&&b!=="~")return null;let C=v;for(;C<g.length&&g[C]===b;)C++;const I=C-v;return I<3?null:{markerChar:b,markerLen:I,rest:g.slice(C)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let b=!1;for(;v<g.length&&g[v]===">";)for(b=!0,v++;v<g.length&&f(g[v]);)v++;return b?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const b=p(g);return b==null?null:h(b)};let y=0;const k=l.split(/\r?\n/);for(const g of k){const v=y,b=y+g.length;if(a<v)break;const C=m(g);if(C){const I=C.markerChar,T=C.markerLen;c?I===u&&T>=d&&/^\s*$/.test(C.rest)&&(c=!1,u="",d=0):(c=!0,u=I,d=T)}if(a<=b)break;y=b+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===`
|
|
240
|
+
`||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]===`
|
|
241
|
+
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function _C(e,t){if(e===t)return;const n=e.split(/\r?\n/),s=t.split(/\r?\n/),o=[];let i=0;for(let r=0;r<s.length;r++){const l=s[r]??"";if(n[i]===l){o[r]={startLine:i,endLine:i+1},i++;continue}const a=n[i]??"";if(l!==""&&a!==l&&a.startsWith(l)){let h=l,p=-1;for(let m=r+1;m<s.length;m++){if(h+=s[m]??"",h===a){p=m;break}if(!a.startsWith(h))break}if(p!==-1){for(let m=r;m<=p;m++)o[m]={startLine:i,endLine:i+1};i++,r=p;continue}o[r]={startLine:i,endLine:i+1};continue}let c=n[i]??"",u=-1;for(let h=i+1;h<n.length;h++){if(c+=`\\n${n[h]??""}`,c===l){u=h+1;break}if(!l.startsWith(c))break}if(u!==-1){o[r]={startLine:i,endLine:u},i=u;continue}let d=-1;if(l!==""){const h=Math.min(n.length,i+80);for(let p=i;p<h;p++)if(n[p]===l){d=p;break}}if(d!==-1){o[r]={startLine:d,endLine:d+1},i=d+1;continue}const f=Math.min(Math.max(0,n.length-1),Math.max(0,i-1));o[r]={startLine:f,endLine:f+1}}return r=>{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(l<o.length)return o[l]??{startLine:0,endLine:0};const a=o[o.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},c=Math.min(n.length,a.endLine+l-o.length);return{startLine:c,endLine:Math.min(n.length,c+1)}}}function TJ(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 y=0;y<p.length;y++){const k=p[y];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=p=>{let m=!1,y=!1;for(let k=0;k<p.length;k++){const g=p[k];if(g==="\\"){k++;continue}if(!y&&g==="'"){m=!m;continue}if(!m&&g==='"'){y=!y;continue}if(!m&&!y&&g===">")return k}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const y=p[m];if(y!=="`"&&y!=="~")return null;let k=m;for(;k<p.length&&p[k]===y;)k++;const g=k-m;return g<3?null:{markerChar:y,markerLen:g,rest:p.slice(k)}},a=(p,m)=>{if(i(p))return-1;const y=p.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let k=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(k=!0),g++;continue}const b=r(p.slice(g));if(b===-1){k=!0,g++;continue}const C=p.slice(g,g+b+1);let I=1;for(;I<C.length&&s(C[I]);)I++;if(I>=C.length){k=!0,g++;continue}const T=C[I];if(T==="!"||T==="?"){k=!0,g+=b+1;continue}if(T==="/"){k=!0,g+=b+1;continue}const M=I;for(;I<C.length&&o(C[I]);)I++;if(I===M){k=!0,g++;continue}const $=C.slice(M,I).toLowerCase(),N=C[I];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${$}\s*>`,"i"),_=/\/\s*>$/.test(C),R=F.test(p.slice(g+b+1)),z=F.test(e.slice(m+g+b+1)),W=/[\r\n]/.test(e.slice(m+g+b+1));if(k&&n.has($)&&!_&&!R&&(z||W))return g;k=!0,g+=b+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
242
|
+
`,h),m=p!==-1,y=m&&p>h&&e[p-1]==="\r",k=m?y?p-1:p:e.length,g=e.slice(h,k),v=m?y?`\r
|
|
243
|
+
`:`
|
|
244
|
+
`:"",b=l(g);let C=g;if(!c&&!b){const I=a(g,h);if(I!==-1){const T=v||`
|
|
245
|
+
`;C=`${g.slice(0,I).replace(/[ \t]+$/,"")}${T}${T}${g.slice(I).replace(/^[ \t]+/,"")}`}}f+=C,f+=v,b&&(c?b.markerChar===u&&b.markerLen>=d&&/^\s*$/.test(b.rest)&&(c=!1,u="",d=0):(c=!0,u=b.markerChar,d=b.markerLen)),h=m?p+1:e.length}return f}function NJ(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 y=m+1;for(;y<d.length&&s(d[y]);)y++;if(y>=d.length||d[y]!=="/"){m=d.indexOf("<",m+1);continue}for(y++;y<d.length&&s(d[y]);)y++;if(y+p.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<p.length;v++){const b=d[y+v];if((b>="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==p[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=y+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 y=f+m;if(l(d,y+1,p))return d;const k=i(d.slice(y+1));return k?`${d.slice(0,y+1)}
|
|
246
|
+
${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
247
|
+
`,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
|
|
248
|
+
`:`
|
|
249
|
+
`,u=d+1}return c}function IJ(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 y=m-h;return y<3?null:{markerChar:p,markerLen:y,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(`
|
|
250
|
+
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,y=e.slice(d,m),k=h?p?`\r
|
|
251
|
+
`:`
|
|
252
|
+
`:"",g=o(y),v=g?.prefix??"",b=g?.content??y,C=i(b);C&&(l?C.markerChar===a&&C.markerLen>=c&&/^\s*$/.test(C.rest)&&(l=!1,a="",c=0):(l=!0,a=C.markerChar,c=C.markerLen));let I=b;if(!l&&I.includes("</"))for(const T of r)I=I.replace(T,(M,$,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return M;const _=F.slice(0,N).replace(/^[\t ]+/,"");if(_.length>0){const R=$.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",z=_.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!z||R!==z)return M}return`${$}
|
|
253
|
+
|
|
254
|
+
`});if(v){const T=v+I.split(`
|
|
255
|
+
`).join(`
|
|
256
|
+
${v}`);u+=T}else u+=I;u+=k,d=h?f+1:e.length}return u}function LJ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(_=>String(_??"").toLowerCase()));if(!n.size)return e;const s=_=>_===" "||_===" ",o=_=>{if(!_)return!1;if(_[0]===" ")return!0;let R=0;for(let z=0;z<_.length;z++){const W=_[z];if(W===" "){if(R++,R>=4)return!0;continue}if(W===" ")return!0;break}return!1},i=_=>{const R=_.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||_==="_"||_==="-"||_===":"},r=_=>{let R=0;for(;R<_.length&&s(_[R]);)R++;return _.slice(R)},l=_=>{let R=0,z=!1,W=0;for(;R<_.length;){for(;R<_.length&&s(_[R]);)R++;if(R>=_.length||_[R]!==">")break;for(z=!0,R++;R<_.length&&s(_[R]);)R++;W=R}if(!z)return null;const L=_.slice(0,W);return{prefix:L,key:L.replace(/[ \t]+$/,""),content:_.slice(W)}},a=_=>r(_).startsWith("<"),c=_=>{for(let R=0;R<_.length;R++){const z=_[R];if(z!==" "&&z!==" ")return!1}return!0},u=_=>{if(o(_))return"";const R=r(_);if(!R.startsWith("<"))return"";let z=1;for(;z<R.length&&s(R[z]);)z++;if(z>=R.length||R[z]==="/"||R[z]==="!"||R[z]==="?")return"";const W=z;for(;z<R.length&&i(R[z]);)z++;if(z===W)return"";const L=R.slice(W,z).toLowerCase();if(!n.has(L))return"";const O=R[z];return O&&O!==" "&&O!==" "&&O!==">"&&O!=="/"?"":L},d=_=>{if(o(_))return null;const R=r(_);if(!R.startsWith("<"))return null;let z=1;for(;z<R.length&&s(R[z]);)z++;if(z>=R.length)return null;const W=R[z]==="/";if(W)for(z++;z<R.length&&s(R[z]);)z++;const L=R[z];if(!L||L==="!"||L==="?")return null;const O=z;for(;z<R.length&&i(R[z]);)z++;if(z===O)return null;const q=R.slice(O,z).toLowerCase();if(!n.has(q))return null;const X=R[z];if(X&&X!==" "&&X!==" "&&X!==">"&&X!=="/")return null;if(W)return{type:"close",name:q};if(/\/\s*>\s*$/.test(R))return{type:"open",name:q,complete:!0};const ie=R.indexOf(">",z);if(ie!==-1){const U=R.slice(ie+1);if(new RegExp(`<\\s*\\/\\s*${q}\\s*>`,"i").test(U))return{type:"open",name:q,complete:!0}}return{type:"open",name:q,complete:!1}},f=_=>{if(o(_))return null;const R=r(_).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(z?.[1])return z[1].toLowerCase();const W=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!W?.[1]||!W[2])return null;const L=W[1].toLowerCase();return L===W[2].toLowerCase()?L:null};let h=!1,p="",m=0;const y=_=>{let R=0;for(;R<_.length&&s(_[R]);)R++;const z=_[R];if(z!=="`"&&z!=="~")return null;let W=R;for(;W<_.length&&_[W]===z;)W++;const L=W-R;return L<3?null:{markerChar:z,markerLen:L,rest:_.slice(W)}},k=_=>y(_),g=_=>{const R=r(_);return R?o(_)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},v=(_,R,z)=>{let W=_,L=0;for(;W<e.length;){const O=e.indexOf(`
|
|
257
|
+
`,W),q=O!==-1,X=q&&O>W&&e[O-1]==="\r",ie=q?X?O-1:O:e.length,U=e.slice(W,ie),j=l(U),te=j?.key??"";if(L>0&&R&&te!==R)break;const ae=j?.content??U,oe=d(ae);if(oe?.name===z){if(oe.type==="open")oe.complete||L++;else if(L>0&&(L--,L===0))return!1}else if(L>0&&(c(ae)||g(ae)))return!0;if(q)W=O+1;else break}return!1};let b="",C=0,I=!0,T=!1,M=!1,$=`
|
|
258
|
+
`;const N=[];let F="";for(;C<e.length;){const _=e.indexOf(`
|
|
259
|
+
`,C),R=_!==-1,z=R&&_>C&&e[_-1]==="\r",W=R?z?_-1:_:e.length,L=e.slice(C,W),O=R?z?`\r
|
|
260
|
+
`:`
|
|
261
|
+
`:"",q=l(L),X=q?.key??"",ie=q?.content??L,U=k(ie);U&&(h?U.markerChar===p&&U.markerLen>=m&&/^\s*$/.test(U.rest)&&(h=!1,p="",m=0):(h=!0,p=U.markerChar,m=U.markerLen));const j=N.length>0;if(!h&&!j){const ae=u(ie),oe=!!ae&&!I&&T&&M&&v(C,X,ae);ae&&!I&&(!T||oe)&&(X&&F&&X===F?b+=`${X}${$}`:X||(b+=$))}if(b+=L,b+=O,O&&($=O),!h){const ae=d(ie);if(ae){if(ae.type==="open")ae.complete||N.push(ae.name);else for(let oe=N.length-1;oe>=0;oe--)if(N[oe]===ae.name){N.length=oe;break}}}const te=c(ie);I=te,T=!te&&a(ie),M=!te&&!!f(ie),F=X,C=R?_+1:e.length}return b}function v8(e,t,n={}){const s=i8(n),o=s?uu():0,i=!!n.final,r=(e??"").toString();let l=r.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,"$1\\n$2");if(zQ(t,n)&&(t.stream.reset(),UQ(t)),i||(l.endsWith("- *")&&(l=l.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*-\s*$/,g=>g.startsWith(`
|
|
262
|
+
`)?`
|
|
263
|
+
`:""):/(?:^|\n)\s*--\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*--\s*$/,g=>g.startsWith(`
|
|
264
|
+
`)?`
|
|
265
|
+
`:""):/(?:^|\n)\s*>\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*>\s*$/,g=>g.startsWith(`
|
|
266
|
+
`)?`
|
|
267
|
+
`:""):/\n\s*[*+]\s*$/.test(l)?l=l.replace(/\n\s*[*+]\s*$/,`
|
|
268
|
+
`):/(?:^|\n)\s*\d+\s*$/.test(l)?/^\d+$/.test(l.trim())||(l=l.replace(/(?:^|\n)\s*\d+\s*$/,g=>g.startsWith(`
|
|
269
|
+
`)?`
|
|
270
|
+
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(l)?l=l.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(g,v,b)=>`${v}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*\d+[.)]\s*$/,g=>g.startsWith(`
|
|
271
|
+
`)?`
|
|
272
|
+
`:""):/\n[[(]\n*$/.test(l)&&(l=l.replace(/(\n\[|\n\()+\n*$/g,`
|
|
273
|
+
`)),l=eJ(l,t),l=QQ(l,n.customHtmlTags)??l),n.customHtmlTags?.length&&l.includes("<")){const g=Va(n.customHtmlTags);if(g.length&&(l=TJ(l,g),l=NJ(l,g),l=LJ(l,g),l=IJ(l,g),l.includes("</")))for(const v of g){const b=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");l=l.replace(b,"$1$2$2")}}i||(l=EJ(l));const a=cJ(l);if(a){if(n.includeSourceMap){const b={...n,__sourceLineMapper:_C(r,l)};a[0].sourceMap=T1(l,0,l.length,b)}const g=n.preTransformTokens,v=n.postTransformTokens;if(p2(t,n)||typeof g=="function"||typeof v=="function"){const b=vC(t,l,{__markstreamFinal:i},n),C=typeof g=="function"&&g(b)||b;typeof v=="function"&&v(C)}return fC(a,n,s,o)}const c=vC(t,l,{__markstreamFinal:i},n);if(!c||!Array.isArray(c))return fC([],n,s,o);const u=n.preTransformTokens,d=n.postTransformTokens;let f=c;u&&typeof u=="function"&&(f=u(f)||f);const h=t,p=typeof h.validateLink=="function"&&h.__markstreamOriginalValidateLink&&h.validateLink!==h.__markstreamOriginalValidateLink?h.validateLink:void 0,m=n.validateLink??p??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),y={...n,validateLink:m,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?_C(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let k=DQ(t,l,f,y,s);if(d&&typeof d=="function"){const g=d(f);if(Array.isArray(g)){const v=g[0],b=v?.type;v&&typeof b=="string"?k=yp(g,{...y,__customHtmlBlockCursor:0},s):k=g}}if(_J(k)&&(k=MJ(k,i,l,y),k=g8(k,l,t,y,i)[0],k=wJ(k,t,y,i)),i){const g=new WeakSet,v=b=>{if(!b||typeof b!="object"||g.has(b))return;if(g.add(b),Array.isArray(b)){for(const I of b)v(I);return}const C=b;C.type==="html_block"&&C.loading===!0&&(C.loading=!1);for(const I of Object.values(C))v(I)};v(k)}return k=l8(k,n),n.debug&&console.log("Parsed Markdown Tree Structure:",k),r8(k,s,o)}function SC(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Bl(t),o=t?.includeSourceMap===!0;let i=0;for(;i<e.length;){const r=h2(e,i,s.options(),f2);if(r){Wi(r[0],e[i],t),n.push(r[0]),s.remember(r[0].raw),i=r[1];continue}const l=e[i];switch(l.type){case"paragraph_open":{const a=String(e[i+1]?.content??""),c=EQ(e,i,s.options(a));o&&on(c,l,t);const u=bC(c,t);if(u){o&&kC(u,c);for(const d of u)Wi(d,l,t);n.push(...u)}else Wi(c,l,t),n.push(c);s.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=gu(e,i,s.options());o&&on(a,l,t),Wi(a,l,t),n.push(a),s.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=vu(e,i,s.options());o&&on(a,l,t),Wi(a,l,t),n.push(a),s.remember(a.raw),i=c;break}case"footnote_anchor":{const a=l.meta??{},c={type:"footnote_anchor",id:String(a.label??l.content??""),raw:String(l.content??"")};o&&on(c,l,t),Wi(c,l,t),n.push(c),s.remember(String(l.content??"")),i++;break}case"hardbreak":n.push(MQ()),s.reset(),i++;break;case"text":{const a=String(l.content??""),c={type:"paragraph",raw:a,children:a?[{type:"text",content:a,raw:a}]:[]};o&&on(c,l,t),Wi(c,l,t),n.push(c),s.remember(a),i++;break}case"inline":{const a=String(l.content??""),c=Kn(l.children||[],a,void 0,s.options(a));if(c.length!==0)if(c.every(u=>u.type==="html_block")){if(o)for(const u of c)on(u,l,t);for(const u of c)Wi(u,l,t);n.push(...c)}else{const u={type:"paragraph",raw:a,children:c};o&&on(u,l,t);const d=bC(u,t);if(d){o&&kC(d,u);for(const f of d)Wi(f,l,t);n.push(...d)}else Wi(u,l,t),n.push(u)}s.remember(a)}i+=1;break;default:i+=1;break}}return n}const $J=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,FJ=new Set([...Tf,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),OJ=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","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function CC(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function RJ(e){return typeof e=="string"?e:e==null?"":String(e)}function y8(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ml(e){return RJ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function k8(e){return ml(e).replace(/`/g,"`")}function F1(e){return String(e??"").trim().toLowerCase()}function y2(e,t="safe"){const n=F1(e);return n?t==="escape"?!0:t==="trusted"?Tf.has(n):!OJ.has(n):!1}function b8(e,t="safe"){const n=F1(e);return n?t==="escape"?!0:t==="trusted"?Tf.has(n):FJ.has(n):!1}function AC(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${k8(s)}"`).join("")}function x8(e){const t=e.startsWith("/"),n=t?e.slice(1):e,s=n.match($J);return s?{attrsStr:t?"":n.slice(s[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:s[1]}:null}function BJ(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||Ea(o,{tagName:t,attrName:"srcset"})})}function w8(e,t,n,s){return IG.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?BJ(t,s):!!(LG.has(e)&&t&&Ea(t,{tagName:s,attrName:e}))}function ha(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function _8(e,t,n,s=!1){if(t!=="safe"||F1(n)!=="a")return e;const o=ha(e,"href");if(s&&(!o||!e[o])){const a=ha(e,"target"),c=ha(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=ha(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=ha(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 MC(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!y8(r)||w8(l,i,t,n)||(s[r]=i)}return _8(s,t,n,!!ha(e,"href"))}function S8(e,t){const n=e.toLowerCase();return g5.has(n)?!1:CC(t,n)||CC(t,e)}function k2(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!y8(r)||w8(l,i,t,n)||(s[r]=i)}return _8(s,t,n,!!ha(e,"href"))}function Od(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 kp(e,t="safe",n){const s=k2(Od(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function DJ(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 PJ(e){const t={};for(const[n,s]of Object.entries(e))t[n]=DJ(s,n);return t}function zg(e){return e.trim().length>0}function C8(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const r=e.indexOf("-->",n);if(r!==-1){n=r+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const r=e.slice(n);zg(r)&&t.push({type:"text",content:r})}break}if(s>n){const r=e.slice(n,s);zg(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",s+1)){const r=e.indexOf("]]>",s);if(r!==-1){t.push({type:"text",content:e.slice(s,r+3)}),n=r+3;continue}break}if(e.startsWith("!",s+1)){const r=e.indexOf(">",s);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=x8(e.slice(s+1,o));if(!i){const r=e.slice(s,o+1);zg(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(i.isClosing)t.push({type:"tag_close",tagName:i.tagName});else{const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Tl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r})}n=o+1}return t}function HJ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const l=e.indexOf("-->",n);if(l!==-1){n=l+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 l=e.indexOf("]]>",s);if(l!==-1){t.push({type:"text",content:e.slice(s,l+3)}),n=l+3;continue}break}if(e.startsWith("!",s+1)){const l=e.indexOf(">",s);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=x8(e.slice(s+1,o));if(!i){t.push({type:"text",content:e.slice(s,o+1)}),n=o+1;continue}if(i.isClosing){t.push({type:"tag_close",tagName:i.tagName}),n=o+1;continue}const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Tl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r}),n=o+1}return t}function WJ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${ml(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${ml(s)}`:` ${ml(s)}="${k8(o)}"`).join("");return e.type==="self_closing"?`<${ml(t)}${n} />`:`<${ml(t)}${n}>`}function zJ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of C8(e))if((n.type==="tag_open"||n.type==="self_closing")&&S8(n.tagName??"",t))return!0;return!1}function eu(e,t="safe"){if(!e)return"";if(t==="escape")return ml(e);const n=HJ(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(ml(r.content??""));continue}const l=F1(r.tagName);if(!l)continue;if(b8(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"&&y2(l,t)){o.push(WJ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${AC(MC(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${AC(MC(r.attrs??{},t,l))}>`),Tl.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 UJ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],EC="http://www.w3.org/2000/svg",qJ=new Set(["script","style","iframe","object","embed","link","meta"]),jJ=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"]),VJ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),KJ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),GJ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function YJ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function ZJ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function XJ(e){const t=e.nodeName.toLowerCase();return t==="use"?YJ(e):t==="image"?ZJ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():GJ.has(t)}function QJ(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 JJ(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")?Ea(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?Ea(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":Ea(i,{tagName:s,attrName:o})?"":i:""}function eee(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 A8(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 M8(e){const t=A8(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=eee(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function TC(e){const t=A8(e);return UJ.some(n=>n.test(t))||M8(t)}function tee(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 Wh(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function E8(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(!qJ.has(s)){if(s==="br"){t.push(`
|
|
274
|
+
`);return}for(const o of Array.from(n.childNodes))E8(o,t)}}function nee(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];E8(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Wh(t.getAttribute("width")),i=Wh(t.getAttribute("height")),r=Wh(t.getAttribute("x")),l=Wh(t.getAttribute("y")),a=e.ownerDocument.createElementNS(EC,"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(EC,"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 see(e){nee(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!jJ.has(s)){n.remove();continue}if(s==="style"&&TC(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&&TC(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(VJ.has(r)&&i.value){const l=JJ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(KJ.has(r)&&i.value&&M8(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=QJ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}tee(n)}}function t4e(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 see(n),oee(n)?null:n}catch{return null}}function oee(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){XJ(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 zh=[];function Ug(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function iee(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function ree(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function NC(e=`editor-${Date.now()}`,t={}){const n=GZ(t),s=n;s.__markstreamRegisteredPluginCount=zh.length,s.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||zh.length);const o={"common.copy":"Copy"};let i;if(typeof t.i18n=="function")i=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;i=m=>p[m]??o[m]??m}else i=p=>o[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[y,...k]=m;typeof y=="function"&&n.use(y,...k)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(zh.length)for(const p of zh)if(Array.isArray(p)){const[m,...y]=p;typeof m=="function"&&n.use(m,...y)}else typeof p=="function"&&n.use(p);n.use(eq),n.use(sq),n.use(XU);const r=vq,l=r.default??r;n.use(l),n.use(ZU),n.use(YU),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,y=m.src,k=!!m.env?.__markstreamFinal,g=y.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const b=v.map[0],C=v.map[1],I=v.markup,T=I[0],M=I.length,$=g[Math.max(0,C-1)]??"";let N=0;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;let F=0;for(;N+F<$.length&&$[N+F]===T;)F++;let _=N+F;for(;_<$.length&&($[_]===" "||$[_]===" ");)_++;const R=k?!0:C>b+1&&F>=M&&_===$.length,z=v;z.meta=z.meta??{},z.meta.unclosed=!R,z.meta.closed=!!R}});const a=(p,m)=>{const y=p,k=y.pos;if(y.src[k]!=="~")return!1;const g=y.src[k-1],v=y.src[k+1];if(/\d/.test(g)&&/\d/.test(v)){if(!m){const b=y.push("text","",0);b.content="~"}return y.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",a),n.renderer.rules.fence=(p,m)=>{const y=p[m],k=String(y.info??"").trim(),g=String(y.content??""),v=btoa(unescape(encodeURIComponent(g))),b=iee(k),C=Ug(b),I=ree(`editor-${e}-${m}-${b}`),T=Ug(i("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${C}" id="${I}">
|
|
275
|
+
<div class="code-header">
|
|
276
|
+
<span class="code-lang">${Ug(b.toUpperCase())}</span>
|
|
277
|
+
<button class="copy-button" data-code="${v}">${T}</button>
|
|
278
|
+
</div>
|
|
279
|
+
<div class="code-editor"></div>
|
|
280
|
+
</div>`};const c=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,d=p=>{if(!p.startsWith("["))return!1;const m=u.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const y=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(y)},f=(p,m)=>{const y=p;if(y.src[y.pos]!=="[")return!1;const k=c.exec(y.src.slice(y.pos));if(!k)return!1;const g=y.src.slice(Math.max(0,y.pos-120),y.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(g))return!1;const v=y.src.slice(y.pos+k[0].length);if(v.startsWith("](")||v.startsWith("(")||d(v))return!1;if(!m){const b=k[1],C=y.push("reference","span",0);C.content=b,C.markup=k[0],C.raw=k[0]}return y.pos+=k[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(p,m)=>{const k=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${k}" role="button" tabindex="0" title="Click to view reference">${k}</span>`};const h=n.use.bind(n);return n.use=((...p)=>(s.__markstreamHasCustomParserExtensions=!0,h(...p))),n}function lee({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 T8({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}:lee({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const aee={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 cee(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function N8(e){const t=cee(e);return aee[t]??t}function uee(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>N8(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function dee(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 fee(e){return dee(e)?.join("\0")??""}function hee(e,t){return`${fee(e)}\0\0${uee(t)?.join("\0")??""}`}function vc(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function IC(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var pee=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=LC();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=LC();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,y=yee(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-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=vee(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=vc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,vc(s,1e3,1)),this.normalizedTargetLatencyMs=vc(o,900,1),this.normalizedCatchUpLatencyMs=vc(i,350,1),this.normalizedCatchUpThreshold=IC(r,600),this.normalizedStartDelayMs=IC(a,80),this.maxCommitFps=Math.trunc(vc(l,30,1)),this.maxCharsPerCommit=Math.trunc(vc(c,80,1)),this.flushOnFinish=u,this.segmenter=gee(),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 mee(e={},t){const n=new pee(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 gee(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function vee(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 LC(){return typeof performance<"u"?performance.now():Date.now()}function yee(e,t,n){return Math.min(n,Math.max(t,e))}var kee=(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 Cy=Symbol.for("markstream-vue:node-lifecycle");function n4e(){}const b2=new Map;let I8="material";const Oc=new Map,$C=new Map;let Ay=null;function bee(e){b2.set(e.id,e)}function xee(e){const t=b2.get(I8);if(!t)return;const n=t.core[e];if(n)return n;const s=Oc.get(t.id);if(s){const o=s[e];if(o)return o}t.loadExtended&&!Oc.has(t.id)&&_ee(t)}function wee(){var e,t;return(t=(e=b2.get(I8))==null?void 0:e.fallback)!=null?t:""}function _ee(e){return kee(this,null,function*(){var t,n,s;if(Oc.has(e.id))return(t=Oc.get(e.id))!=null?t:null;let o=$C.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Oc.set(e.id,i),Ay?.(),i)).catch(()=>(Oc.set(e.id,null),null)),$C.set(e.id,o)),o})}const FC='<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>',OC='<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>',See={id:"material",core:{"":OC,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:OC,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:FC,csharp:FC,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:()=>io(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Cee=tr(0);Ay=()=>{Cee.value++},bee(See);const Aee={"":"",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 O1(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=Aee[n])!=null?t:n}function s4e(e){const t=O1(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function o4e(e){return xee(O1(e))||wee()}const RC={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"};var R1=(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 oo=null,ba=!1,xa=null,B1=w2;function $f(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function x2(){try{const e=globalThis;return $f(e?.katex)}catch{return null}}function w2(){return R1(null,null,function*(){const e=x2();if(e)return e;const t=yield io(()=>import("./katex-DnlPpQZa.js"),[]);try{yield io(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return $f(t)})}function L8(e){const t=Promise.resolve(e).then(n=>{var s;return xa===t&&n?(oo=(s=$f(n))!=null?s:n,oo):null}).catch(()=>null).finally(()=>{xa===t&&(xa=null)});return xa=t,ba=!0,t}function Mee(e){B1=e,oo=null,ba=!1,xa=null}function Eee(e){Mee(w2)}function $8(){return typeof B1=="function"}function i4e(){var e;const t=B1;if(!t||t===w2)return null;if(oo)return oo;const n=x2();if(n)return oo=n,oo;if(ba)return null;try{const s=t();return s?typeof s?.then=="function"?(L8(s),null):(oo=(e=$f(s))!=null?e:s,oo):null}catch{return null}}function F8(){return R1(this,null,function*(){var e;const t=x2();if(t)return oo=t,oo;if(oo)return oo;if(xa)return xa;if(ba)return null;const n=B1;if(!n)return ba=!0,null;try{const s=n();if(typeof s?.then=="function")return L8(s);if(s)return oo=(e=$f(s))!=null?e:s,ba=!0,oo}catch{}return ba=!0,null})}function O8(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let vl=null,dl=null;const Rs=new Map,Nr=new Map;let pf=5;const Na=new Set;function Rd(){if(Rs.size<pf&&Na.size){let e=pf-Rs.size;for(const t of Array.from(Na)){if(e<=0)break;Na.delete(t),e--;try{t()}catch{}}}}function R8(){for(const e of Array.from(Na)){Na.delete(e);try{e()}catch{}}}function Tee(e){vl=e,dl=null,vl.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=Rs.get(n);if(i)if(Rs.delete(n),clearTimeout(i.timeoutId),i.cleanup(),Rd(),o)i.aborted||i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Nr.set(a,s),Nr.size>200){const c=Nr.keys().next().value;Nr.delete(c)}}i.aborted||i.resolve(s)}},vl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of Rs.entries())clearTimeout(s.timeoutId),s.cleanup(),s.aborted||s.reject(new Error(`Worker error: ${t.message}`));Rs.clear(),R8()}}function Nee(){var e;for(const t of Rs.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Rs.clear(),R8(),vl&&((e=vl.terminate)==null||e.call(vl)),vl=null,dl=null}function Iee(e,t=!0,n=2e3,s){return R1(this,null,function*(){performance.now();const o=O8(e);if(!$8()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(dl)return Promise.reject(dl);const i=`${t?"d":"i"}:${o}`,r=Nr.get(i);if(r)return Rd(),Promise.resolve(r);const l=vl||(dl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),dl.name="WorkerInitError",dl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(dl);if(Rs.size>=pf){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Rs.size,a.max=pf,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const m=new Error("Aborted");return m.name="AbortError",void c(m)}const u=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=Rs.get(u);if(!m)return;Rs.delete(u),m.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",m.aborted||m.reject(y),Rd()},n);d=()=>{const m=Rs.get(u);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const y=new Error("Aborted");y.name="AbortError",c(y)},s&&s.addEventListener("abort",d,{once:!0});const h=a,p=c;Rs.set(u,{resolve:m=>{h(m)},reject:m=>{p(m)},timeoutId:f,aborted:!1,cleanup:()=>{s&&d&&s.removeEventListener("abort",d),d=null}});try{l.postMessage({id:u,content:o,displayMode:t})}catch(m){const y=Rs.get(u);Rs.delete(u),clearTimeout(f),y?.cleanup(),y?.reject(m),Rd()}})})}function r4e(e,t=!0,n){const s=`${t?"d":"i"}:${O8(e)}`;if(Nr.set(s,n),Nr.size>200){const o=Nr.keys().next().value;Nr.delete(o)}}const Lee="WORKER_BUSY";function $ee(e=2e3,t){return Rs.size<pf?Promise.resolve():new Promise((n,s)=>{let o,i=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),Na.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},Na.add(l),o=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const c=new Error("Wait for worker slot timed out");c.name="WorkerBusyTimeout",c.code="WORKER_BUSY_TIMEOUT",s(c)},e),queueMicrotask(()=>Rd()),t&&(r=()=>{if(i)return;i=!0,a();const c=new Error("Aborted");c.name="AbortError",s(c)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const ed={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function l4e(e){return R1(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!$8()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:ed.timeout,c=(i=s.waitTimeout)!=null?i:ed.waitTimeout,u=(r=s.backoffMs)!=null?r:ed.backoffMs,d=(l=s.maxRetries)!=null?l:ed.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ed.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield Iee(t,n,a,h)}catch(m){if(m?.code!==Lee||p>=f)throw m;if(p++,yield $ee(c,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}u>0&&(yield new Promise(y=>globalThis.setTimeout(y,u*p)))}}})}function Rc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Fee(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 bm(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=Fee(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 xm(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 B8(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function wm(e,t=360,n=500){return B8(e,t,n)}function _m(e,t=360,n=500){return B8(e,t,n)}var Oee=Object.defineProperty,Ree=Object.defineProperties,Bee=Object.getOwnPropertyDescriptors,BC=Object.getOwnPropertySymbols,Dee=Object.prototype.hasOwnProperty,Pee=Object.prototype.propertyIsEnumerable,DC=(e,t,n)=>t in e?Oee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D8=(e,t)=>{for(var n in t||(t={}))Dee.call(t,n)&&DC(e,n,t[n]);if(BC)for(var n of BC(t))Pee.call(t,n)&&DC(e,n,t[n]);return e},PC=(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 Sm=()=>io(()=>import("./mermaid.core-B_k0q1Z5.js").then(e=>e.bn),[]);let gr=null,Bc=Sm,md=null,My=!1,Ey=!1,gd=0;function Hee(e){Bc=e,gd++,gr=null,md=null,My=!1,Ey=!1}function Wee(e){Hee(Sm)}function HC(){return typeof Bc=="function"}function WC(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=D8({},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},Ree(n,Bee(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function zC(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=D8({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 a4e(){return PC(this,null,function*(){if(gr)return gr;const e=(function(){try{const s=globalThis;return WC(s?.mermaid)}catch{return null}})();if(e)return gr=e,zC(gr),gr;const t=Bc,n=gd;return t?t===Sm&&My?null:md||(md=PC(null,null,function*(){let s;try{s=yield t()}catch(o){if(t===Sm)return n===gd&&t===Bc&&(My=!0,(function(i){Ey||(Ey=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(o)),null;throw o}finally{n===gd&&t===Bc&&(md=null)}return n!==gd||t!==Bc?null:s?(gr=WC(s),zC(gr),gr):null}),md):null})}let _o=null,fl=null;const wi=new Map,ca=new Map;function bp(e){for(const t of wi.values())t.reject(e);wi.clear(),ca.clear()}let UC=5,qC=!1;const zee="WORKER_BUSY",jC="MERMAID_DISABLED";function Uee(e){if(_o&&_o!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",bp(n)}_o=e,fl=null;const t=e;_o.onmessage=n=>{if(_o!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=wi.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},_o.onerror=n=>{var s,o;if(_o===t)if(wi.size!==0){try{qC?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}bp(new Error(`Worker error: ${n.message}`))}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},_o.onmessageerror=n=>{var s,o;if(_o===t)if(wi.size!==0){try{qC?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}bp(new Error("Worker messageerror"))}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function qee(){var e;if(_o)try{bp(new Error("Worker cleared")),(e=_o.terminate)==null||e.call(_o)}catch{}_o=null,fl=null}function P8(e,t,n,s){if(!HC()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=jC,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=ca.get(o);return i||(i=(function(r,l,a=1400){if(!HC()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=jC,Promise.reject(u)}if(fl)return Promise.reject(fl);const c=_o||(fl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),fl.name="WorkerInitError",fl.code="WORKER_INIT_ERROR",null);if(!c)return Promise.reject(fl);if(wi.size>=UC){const u=new Error("Worker busy");return u.name="WorkerBusy",u.code=zee,u.inFlight=wi.size,u.max=UC,Promise.reject(u)}return new Promise((u,d)=>{const f=Math.random().toString(36).slice(2);let h,p=!1;const m=()=>{p||(p=!0,h!=null&&globalThis.clearTimeout(h),wi.delete(f))},y={resolve:k=>{m(),u(k)},reject:k=>{m(),d(k)}};wi.set(f,y);try{c.postMessage({id:f,action:r,payload:l})}catch(k){return wi.delete(f),void d(k)}h=globalThis.setTimeout(()=>{const k=new Error("Worker call timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT";const g=wi.get(f);g&&g.reject(k)},a)})})(e,t,n),ca.set(o,i),i.then(()=>{ca.get(o)===i&&ca.delete(o)},()=>{ca.get(o)===i&&ca.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,c)=>{let u=()=>{};const d=()=>l.removeEventListener("abort",u);u=()=>{d();const f=new Error("Aborted");f.name="AbortError",c(f)},l.addEventListener("abort",u,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),c(f)})})})(i,s)}function c4e(e,t,n=1400,s){return P8("canParse",{code:e,theme:t},n,s)}function u4e(e,t,n=1400,s){return P8("findPrefix",{code:e,theme:t},n,s)}var jee=Object.defineProperty,Vee=Object.defineProperties,Kee=Object.getOwnPropertyDescriptors,VC=Object.getOwnPropertySymbols,Gee=Object.prototype.hasOwnProperty,Yee=Object.prototype.propertyIsEnumerable,KC=(e,t,n)=>t in e?jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t)=>{for(var n in t||(t={}))Gee.call(t,n)&&KC(e,n,t[n]);if(VC)for(var n of VC(t))Yee.call(t,n)&&KC(e,n,t[n]);return e},Rt=(e,t)=>Vee(e,Kee(t)),Hn=(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 Zee="__global__",qg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Ty=(()=>{const e=globalThis;if(e[qg])return e[qg];const t={scopedCustomComponents:{},revision:tr(0)};return e[qg]=t,t})(),GC=Ty.revision,Xee=Symbol("markstreamCustomComponents"),Qee=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 Ff(e){return Qee.has(String(e).trim().toLowerCase())}function Jee(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function jg(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([mi(n),mi(Jee(n))]))!o||Ff(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function ms(e){const t=jt(Xee,null);return D(()=>{var n;return GC.value,(function(s,o={}){return GC.value,st(st(st({},jg(Ty.scopedCustomComponents[Zee]||{})),jg(o)),jg((function(i){return i&&Ty.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const ete=["aria-label"],tte={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"},nte={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},Ko=gn(Xe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),E("svg",nte,[...n[1]||(n[1]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),S("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),E("svg",tte,[...n[0]||(n[0]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,ete))}),[["__scopeId","data-v-be21ab83"]]);Ko.install=e=>{e.component(Ko.__name,Ko)};const ste={class:"emoji-node"},Eo=gn(Xe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",ste,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Eo.install=e=>{e.component(Eo.__name,Eo)};const ote=["id"],ite=["title"],Go=gn(Xe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(x(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[S("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,ite)],8,ote))}}),[["__scopeId","data-v-c1463a29"]]);Go.install=e=>{e.component(Go.__name,Go)};const H8=(()=>{try{return!1}catch{}return!1})();function Vg(e){H8&&console.warn(e)}function YC(e,t="safe",n){return k2(e,t,n)}function W8(e){return PJ(e)}function Kg(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function _2(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=kp((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Kg(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Kg(r.value)]):Object.entries(o).map(([r,l])=>[r,Kg(l)]):null,t,n);var o;if(!s)return;const i=W8(Od(s));return Object.keys(i).length>0?i:void 0}function ZC(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 td(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Gg(e,t,n,s,o,i,r=!1){const l=(function(d,f){return S8(d,f)})(e,s);if(Tf.has(e.toLowerCase())||!l&&b8(e,i))return null;if(!l&&y2(e,i))return r?[ZC(e,t,!0)]:[ZC(e,t),...n,`</${e}>`];const a=k2(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=W8(a);return Ft(d,Rt(st({},f),{key:u}),n.length>0?n:void 0)}return Ft(e,Rt(st({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function z8(e,t){return zJ(e,t)}function Cm(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=Gg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);td(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=Gg(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?td(c[c.length-1].children,m):td(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&Vg(`Auto-closing unclosed tag: <${p.tagName}>`)}else Vg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Gg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?td(c[c.length-1].children,f):td(u,f),Vg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(C8(e),t,n)}catch(o){return s=o,H8&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const rte=["innerHTML"],Yo=gn(Xe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),s=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ms(()=>t.customId),i=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:eu(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Cm(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!z8(l,o.value))return{mode:"html",content:eu(l,s.value)};const a=Cm(l,o.value,s.value);return a===null?{mode:"html",content:eu(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),E("span",{key:0,class:He(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ve(A(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),E("span",{key:1,class:He(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(x(),E("span",{key:2,class:He(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,rte))}}),[["__scopeId","data-v-d17f12b0"]]);Yo.install=e=>{e.component(Yo.__name,Yo)};const lte={class:"inline-code"},ate={key:0},Ys=gn(Xe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Sf(),s=jt("markstreamFade",void 0),o=jt("markstreamTextStreamState",void 0),i=jt("markstreamStreamVersion",void 0),r=D(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=D(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=D(()=>!l.value),u=D(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=se(t.node.code),f=se(""),h=se(0);let p;function m(){p?.(),p=void 0}function y(){m(),f.value&&(d.value=d.value+f.value,f.value="")}Je([()=>t.node.code,u,l],([g])=>{const v=String(g??""),b=u.value,C=T8({nextContent:v,persistedContent:b?o?.get(b):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=C.settledContent,f.value=C.streamedDelta,C.appended?(h.value+=1,(function(){if(!f.value||p||!i)return;const I=i.value;p=Je(()=>i.value,T=>{T!==I&&y()},{flush:"sync"})})()):f.value||m(),b&&o?.set(b,v)},{immediate:!0}),bf(m);const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(x(),E("code",lte,[c.value?(x(),E(De,{key:0},[tt(B(a.value),1)],64)):(x(),E(De,{key:1},[d.value?(x(),E("span",ate,B(d.value),1)):ge("",!0),f.value?(x(),E("span",{key:1,class:He(["inline-code-stream-delta",[k.value]]),onAnimationend:y},B(f.value),35)):ge("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const Ny=se(!1),XC=se(""),QC=se("top"),Bd=se(null),Dd=se(null),Iy=se(null),Ly=se(null),JC=se(null);let xp=null,wp=null,$y=0;function U8(){xp&&(clearTimeout(xp),xp=null),wp&&(clearTimeout(wp),wp=null)}let Uh=!1,qh=null,e4=!1;function cte(e,t,n="top",s=!1,o,i){if(!e)return;const r=++$y;U8();const l=()=>Hn(null,null,function*(){var a,c;if(yield(function(){return Hn(this,null,function*(){if(!Uh&&!e4&&typeof document<"u"){qh!=null||(qh=Hn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([io(()=>import("./vue.runtime.esm-bundler-CNUOXmj4.js"),[]),io(()=>import("./Tooltip-S8S-9806.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Ny.value,"anchor-el":Bd.value,content:XC.value,placement:QC.value,id:Dd.value,originX:Iy.value,originY:Ly.value,isDark:(p=JC.value)!=null?p:void 0})}}).mount(h),Uh=!0}));try{yield qh}catch(u){Uh=!1,qh=null,e4=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Uh&&r===$y){Dd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Bd.value=e,XC.value=t,QC.value=n,Iy.value=(a=o?.x)!=null?a:null,Ly.value=(c=o?.y)!=null?c:null,JC.value=typeof i=="boolean"?i:null,Ny.value=!0;try{e.setAttribute("aria-describedby",Dd.value)}catch{}}});s?l():xp=setTimeout(l,80)}function ute(e=!1){$y+=1,U8();const t=()=>{if(Bd.value&&Dd.value)try{Bd.value.removeAttribute("aria-describedby")}catch{}Ny.value=!1,Bd.value=null,Dd.value=null,Iy.value=null,Ly.value=null};e?t():wp=setTimeout(t,120)}const dte={"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..."},fte=Symbol("markstreamI18nFallback");function q8(e,t){var n;return(n=t?.[e])!=null?n:dte[e]}const Fy=(e,t)=>{var n;return(n=q8(e,t))!=null?n:(function(s){return(s.split(".").pop()||s).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function t4(e,t){return{t(n){const s=q8(n,t);if(e.te&&s!=null&&!e.te(n))return Fy(n,t);const o=e.t(n);return o===n&&s!=null?Fy(n,t):o}}}function hte(){const e=(function(){var n,s,o;try{const i=hs(),r=fte,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(o=(s=l?.[r])!=null?s:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,s;try{const o=hs(),i=o?.proxy,r=i?.$t;if(typeof r=="function"){const c=i?.$te;return{t:r.bind(i),te:typeof c=="function"?c.bind(i):void 0}}const l=(s=(n=o?.appContext)==null?void 0:n.config)==null?void 0:s.globalProperties,a=l?.$t;if(typeof a=="function"){const c=l?.$te;return{t:a.bind(l),te:typeof c=="function"?c.bind(l):void 0}}}catch{}return null})();if(t)return t4(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const s=n();if(s&&typeof s.t=="function")return t4({t:s.t.bind(s),te:typeof s.te=="function"?s.te.bind(s):void 0},e)}catch{}}catch{}return{t:n=>Fy(n,e)}}const j8=Symbol("ViewportPriority"),V8=Symbol("ViewportPriorityOptions"),K8=Symbol("OffscreenHeavyNodeDeferral"),pte=D(()=>!1),Ra="400px";function S2(){return jt(V8,void 0)}function C2(){return jt(K8,pte)}function mte(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?se(t):t,r=o?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:T=>window.clearTimeout(T):null,a=new WeakMap;let c=1;const u=new Map,d=new Map,f=new Set;let h=null,p=null;function m(T){if(!T)return"viewport";let M=a.get(T);return M||(M=c++,a.set(T,M)),String(M)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function k(T){if(T){const M=u.get(T);if(M&&!M.targets.size){try{M.io.disconnect()}catch{}u.delete(T)}}d.size||f.size||y()}function g(T){const M=d.get(T);if(!M)return;const $=u.get(M.bucketKey);if(!M.visible.value){M.visible.value=!0;try{M.resolve()}catch{}}try{$?.io.unobserve(T)}catch{}$?.targets.delete(T),d.delete(T),f.delete(T),k(M.bucketKey)}function v(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const T=f.values().next().value;T&&(f.delete(T),g(T),f.size&&v())},{timeout:1200}))}function b(T,M){if(!o||typeof IntersectionObserver>"u")return null;const $=(function(W,L){var O,q,X;return{root:(O=e?.(W??null))!=null?O:null,rootMargin:(q=L?.rootMargin)!=null?q:Ra,threshold:(X=L?.threshold)!=null?X:0}})(T,M),N=[m((F=$).root),F.rootMargin,F.threshold].join("\0");var F;const _=u.get(N);if(_)return{key:N,bucket:_};let R;try{R=new IntersectionObserver(W=>{for(const L of W)(L.isIntersecting||L.intersectionRatio>0)&&g(L.target)},{root:$.root,rootMargin:$.rootMargin,threshold:$.threshold})}catch{return null}const z={io:R,targets:new Map};return u.set(N,z),{key:N,bucket:z}}function C(){if(o&&i.value)for(const[T,M]of Array.from(d.entries())){const $=b(T,M.opts);if(!$){g(T);continue}if($.key===M.bucketKey)continue;const N=M.bucketKey,F=u.get(N);try{F?.io.unobserve(T)}catch{}F?.targets.delete(T),M.bucketKey=$.key,$.bucket.targets.set(T,M),$.bucket.io.observe(T),k(N)}}Je(i,T=>{if(!T){for(const M of Array.from(d.keys()))g(M);y()}},{flush:"sync"});const I=(T,M)=>{const $=se(!1);let N,F=!1;const _=new Promise(L=>{N=()=>{F||(F=!0,L())}}),R=()=>{const L=d.get(T);if(!L)return f.delete(T),void k();const O=u.get(L.bucketKey);try{O?.io.unobserve(T)}catch{}O?.targets.delete(T),d.delete(T),f.delete(T),k(L.bucketKey)};if(!o||!i.value)return $.value=!0,N(),{isVisible:$,whenVisible:_,destroy:R};const z=b(T,M);if(!z)return $.value=!0,N(),{isVisible:$,whenVisible:_,destroy:R};const W={resolve:N,visible:$,bucketKey:z.key,opts:M};return d.set(T,W),z.bucket.targets.set(T,W),z.bucket.io.observe(T),o&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,C()})),M?.allowIdle!==!1&&(f.add(T),v()),{isVisible:$,whenVisible:_,destroy:R}};return I.refresh=C,wn(j8,I),I}function A2(){var e,t;const n=jt(j8,void 0);if(n)return n;const s=new WeakMap,o=new Map,i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=h=>{if(!h)return;const p=o.get(h);if(p&&!p.targets.size){try{p.io.disconnect()}catch{}o.delete(h)}},d=h=>{const p=s.get(h);if(!p)return;const m=o.get(p.bucketKey);if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{m?.io.unobserve(h)}catch{}s.delete(h),m?.targets.delete(h),i.delete(h),u(p.bucketKey),i.size||c()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),d(h),i.size&&f())},{timeout:1200}))};return(h,p)=>{const m=se(!1);let y,k=!1;const g=new Promise(C=>{y=()=>{k||(k=!0,C())}}),v=()=>{const C=s.get(h);if(!C)return i.delete(h),void(i.size||c());const I=o.get(C.bucketKey);try{I?.io.unobserve(h)}catch{}s.delete(h),I?.targets.delete(h),i.delete(h),u(C.bucketKey),i.size||c()},b=(C=>{var I,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const M=(R=>{var z,W;return[(z=R?.rootMargin)!=null?z:Ra,(W=R?.threshold)!=null?W:0].join("\0")})(C),$=o.get(M);if($)return{key:M,bucket:$};const N=(I=C?.rootMargin)!=null?I:Ra;let F;try{F=new IntersectionObserver(R=>{for(const z of R)(z.isIntersecting||z.intersectionRatio>0)&&d(z.target)},{root:null,rootMargin:N,threshold:(T=C?.threshold)!=null?T:0})}catch{return null}const _={io:F,targets:new Set};return o.set(M,_),{key:M,bucket:_}})(p);return b?(s.set(h,{resolve:y,visible:m,bucketKey:b.key}),b.bucket.targets.add(h),b.bucket.io.observe(h),p?.allowIdle!==!1&&(i.add(h),f()),{isVisible:m,whenVisible:g,destroy:v}):(m.value=!0,y(),{isVisible:m,whenVisible:g,destroy:v})}}function gte(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 vte=["data-markstream-viewport-pending"],yte=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],kte={key:1,class:"image-placeholder"},bte={key:1,class:"image-node__raw-text"},xte={key:2,class:"image-shimmer-overlay"},wte={key:1,class:"image-node__raw-text"},_te={key:3,class:"image-error"},wl=gn(Xe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,s,o;const i=e,r=t,l=se(!1),a=se(!1),c=se(""),u=se("primary"),d=se(null),f=Sf(),h=jt(Cy,null),p=A2(),m=S2(),y=C2(),k=D(()=>MS(i.node.src)),g=D(()=>MS(i.fallbackSrc)),v=(o=(s=(n=hs())==null?void 0:n.vnode.el)==null?void 0:s.querySelector)==null?void 0:o.call(s,"img"),b=typeof window<"u"&&v?.getAttribute("src")===(k.value||g.value),C=se(typeof window>"u"||b||!y.value),I=tr(null);let T="",M=null;const $=D(()=>c.value),N=D(()=>!i.lazy),F=D(()=>typeof window<"u"&&y.value&&!b),_=D(()=>!F.value||C.value),R=D(()=>_.value?$.value:""),z=D(()=>{var pe,Ee;return(Ee=(pe=m?.value.heavyBlockMargin)!=null?pe:m?.value.rootMargin)!=null?Ee:Ra}),W=D(()=>!i.node.loading&&u.value!=="failed"&&c.value.length>0),L=D(()=>u.value==="failed"),O=D(()=>(!N.value||F.value&&!C.value)&&!l.value&&!a.value&&u.value!=="failed"&&c.value.length>0),q=D(()=>gte(i,f));function X(pe=q.value){pe&&d.value&&h?.reportHeight(pe,d.value.offsetHeight)}function ie(pe=q.value){pe&&yt(()=>{X(pe)})}function U(){M&&(clearTimeout(M),M=null)}function j(){const pe=q.value;pe&&T!==pe&&(T&&h?.markSettled(T),U(),T=pe,h?.markPending(pe),typeof window<"u"&&(M=window.setTimeout(()=>{T===pe&&(ie(pe),te())},8e3)))}function te(){return Hn(this,null,function*(){const pe=T;pe&&(U(),T="",yield yt(),X(pe),h?.markSettled(pe))})}function ae(){if(u.value==="primary"&&g.value&&g.value!==c.value)return u.value="fallback",c.value=g.value,l.value=!1,a.value=!1,void ie();u.value="failed",a.value=!0,r("error",c.value),ie()}function oe(){l.value=!0,a.value=!1,r("load",$.value),ie()}function re(pe){pe.preventDefault(),l.value&&!a.value&&r("click",[pe,$.value])}const{t:xe}=hte();return Je([k,g,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||k.value?(c.value=k.value,void(u.value="primary")):g.value?(c.value=g.value,void(u.value="fallback")):(c.value="",u.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Je([d,F],([pe,Ee],ue,Y)=>{var Q;if((Q=I.value)==null||Q.destroy(),I.value=null,!Ee||C.value)return void(C.value=!0);if(!pe)return void(C.value=!1);let P=!0;const G=p(pe,{rootMargin:z.value,allowIdle:!1});I.value=G,C.value=G.isVisible.value,G.whenVisible.then(()=>{P&&I.value===G&&(C.value=!0)}),Y(()=>{P=!1,G.destroy(),I.value===G&&(I.value=null)})},{immediate:!0}),Je([W,l,a,$,()=>i.lazy,_],([pe,Ee,ue,Y,Q,P])=>pe&&Y&&!ue&&P?Ee?(te(),void ie()):Q?(j(),void ie()):void(Ee||ue||j()):(te(),void ie()),{flush:"post",immediate:!0}),Qn(()=>{var pe;(pe=I.value)==null||pe.destroy(),I.value=null,(function(){const Ee=T;Ee&&(U(),T="",h?.markSettled(Ee))})()}),(pe,Ee)=>{var ue,Y,Q,P,G;return x(),E("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":F.value&&!C.value?"true":void 0},[W.value?(x(),E("img",{key:0,src:R.value||void 0,alt:String((Y=(ue=i.node.alt)!=null?ue:i.node.title)!=null?Y:""),title:String((P=(Q=i.node.title)!=null?Q:i.node.alt)!=null?P:""),class:He(["image-node__img",{"is-loading":!N.value&&!l.value,"is-loaded":N.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:N.value?"high":void 0,decoding:N.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(G=i.node.alt)!=null?G:A(xe)("image.preview"),onError:ae,onLoad:oe,onClick:re},null,42,yte)):ge("",!0),e.node.loading&&!a.value?(x(),E("span",kte,[i.usePlaceholder?Rn(pe.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ee[0]||(Ee[0]=S("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",bte,B(e.node.raw),1))])):ge("",!0),O.value&&!e.node.loading?(x(),E("span",xte,[i.usePlaceholder?Rn(pe.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ee[1]||(Ee[1]=S("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",wte,B(e.node.raw),1))])):ge("",!0),L.value?(x(),E("span",_te,[Rn(pe.$slots,"error",{node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ee[2]||(Ee[2]=S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[S("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)),S("span",null,B(A(xe)("image.loadError")),1)],!0)])):ge("",!0)],8,vte)}}}),[["__scopeId","data-v-046e82ac"]]);wl.install=e=>{e.component(wl.__name,wl)};const Ste={key:2},nr=Xe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ms(()=>t.customId),s=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const y=(p=o?.value)!=null?p:{};return Rt(st({},y),{customId:(m=t.customId)!=null?m:y.customId,htmlPolicy:i.value})}),l=Ci({loader:()=>Promise.resolve().then(()=>B2),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Ff(String(t.node.type)))),u=D(()=>c.value?_2(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=D(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(x(),Ae(Ms(a.value),hn({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:Fe(()=>[d.value?(x(),Ae(A(l),hn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(x(),Ae(A(l),hn({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"])):ge("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),Ae(Ms(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),E("span",Ste,B(h.value),1)):ge("",!0)}}),n4=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Cte(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Rt(st(st({},n4),n),{enabled:(t=n.enabled)==null||t})}return st({},n4)}function M2(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,s=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=s}function G8(e){var t,n;const s=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(s.length<3)return"";const o=s[0];if(o!=="`"&&o!=="~"||s[1]!==o||s[2]!==o)return"";let i=3;for(;s[i]===o;)i+=1;return s.slice(i).trim()}function s4(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function Ate(e){var t;return e.diff===!0||s4(e.language)||s4(G8(String((t=e.raw)!=null?t:"")))}function Mte(e,t,n){const s=(function(o){const i=G8(o);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const c=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(c&&/[./\\-]/.test(c))return c}return""})(e);return{title:s||t,caption:s?n?`Diff / ${t}`:t:""}}const Ete=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Tte={key:0,translate:"no",class:"markstream-pre__diff-code"},Nte={class:"markstream-pre__diff-pane-content"},Ite={class:"markstream-pre__diff-number","aria-hidden":"true"},Lte={class:"markstream-pre__diff-content"},$te={class:"markstream-pre__diff-content-inner"},Fte={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Ote=["textContent"],Rte=["textContent"],So=Xe({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(oe,re){const xe=String(oe??"");return re?xe:xe.replace(/\r\n$|\n$|\r$/,"")}const s=D(()=>{var oe,re,xe;const pe=String((re=(oe=t.node)==null?void 0:oe.language)!=null?re:"");return String((xe=String(pe).split(/\s+/g)[0])!=null?xe:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${s.value}`),i=D(()=>{var oe;return t.loading===!0||((oe=t.node)==null?void 0:oe.loading)===!0}),r=D(()=>{var oe;return n((oe=t.node)==null?void 0:oe.code,i.value)});let l="",a=1;const c=D(()=>(function(oe){let re=0,xe=1;oe.startsWith(l)&&(re=l.length,xe=a,re>0&&oe[re-1]==="\r"&&oe[re]===`
|
|
281
|
+
`&&re++);for(let pe=re;pe<oe.length;pe++)oe[pe]===`
|
|
282
|
+
`?xe++:oe[pe]==="\r"&&(xe++,oe[pe+1]===`
|
|
283
|
+
`&&pe++);return l=oe,a=xe,xe})(r.value)),u=D(()=>r.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const oe=c.value;oe<d&&(d=0,f="");for(let re=d+1;re<=oe;re++)f+=`${f?`
|
|
284
|
+
`:""}${re}`;return d=oe,f}),p=D(()=>{var oe;return t.showLineNumbers===!0&&((oe=t.node)==null?void 0:oe.diff)===!0}),m=D(()=>p.value&&t.diffInline===!0),y=D(()=>{const oe=Number(t.reservedHeightPx);if(!Number.isFinite(oe)||oe<=0)return;const re=`${Math.ceil(oe)}px`;return i.value?{maxHeight:re,overflow:"auto"}:{height:re,minHeight:re,maxHeight:re,overflow:"auto"}}),k=["diff ","index ","--- ","+++ ","@@ "];function g(oe){return String(oe??"").trim().length===0}function v(oe,re="context",xe={}){const pe=g(oe);return{code:oe,kind:pe&&re!=="hunk"&&re!=="spacer"&&!xe.preserveBlankKind?"context":re,empty:pe}}function b(oe){const re=n(oe,i.value);return re?re.split(/\r\n|\n|\r/):[]}function C(oe,re){return!g(oe[re])||re<oe.length-1}function I(oe){return oe.startsWith("-")&&!oe.startsWith("---")}function T(oe){return oe.startsWith("+")&&!oe.startsWith("+++")}function M(oe){return oe.some(re=>k.some(xe=>re.startsWith(xe)))}function $(oe,re){return re||!oe.startsWith(" ")||oe.startsWith(" ")?oe:` ${oe}`}function N(oe,re){const xe=oe.length,pe=re.length,Ee=[];let ue=0;for(;ue<xe&&ue<pe&&oe[ue]===re[ue];)Ee.push({originalIndex:ue,modifiedIndex:ue}),ue++;const Y=[];let Q=xe-1,P=pe-1;for(;Q>=ue&&P>=ue&&oe[Q]===re[P];)Y.unshift({originalIndex:Q,modifiedIndex:P}),Q--,P--;const G=Q-ue+1,ye=P-ue+1;if(G<=0||ye<=0||i.value||(G+1)*(ye+1)>15e5)return Ee.concat(Y);const he=ye+1,fe=new Uint32Array((G+1)*(ye+1));for(let we=G-1;we>=0;we--)for(let Te=ye-1;Te>=0;Te--){const Pe=we*he+Te;if(oe[ue+we]===re[ue+Te])fe[Pe]=fe[(we+1)*he+Te+1]+1;else{const be=fe[(we+1)*he+Te],_e=fe[we*he+Te+1];fe[Pe]=be>=_e?be:_e}}const K=[];let ne=0,me=0;for(;ne<G&&me<ye;)oe[ue+ne]===re[ue+me]?(K.push({originalIndex:ue+ne,modifiedIndex:ue+me}),ne++,me++):fe[(ne+1)*he+me]>=fe[ne*he+me+1]?ne++:me++;return Ee.concat(K,Y)}function F(oe){var re;const xe=(function(){var P,G;const ye=t.diffHideUnchangedRegions;if(ye==null||ye===!1)return null;const he=ye===!0?{}:ye;return he.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((P=he.contextLineCount)!=null?P:2)),minimumLineCount:Math.max(1,Math.floor((G=he.minimumLineCount)!=null?G:4))}})();if(!xe||oe.length<1||oe.length>2||oe.length===2&&oe[0].lines.length!==oe[1].lines.length)return oe;const pe=oe[0].lines,Ee=(re=oe[1])==null?void 0:re.lines,ue=P=>pe[P].kind==="context"&&(Ee===void 0||Ee[P].kind==="context"&&pe[P].code===Ee[P].code),Y=[];let Q=0;for(;Q<pe.length;){const P=Q;for(;Q<pe.length&&ue(Q);)Q++;const G=Q;if(G-P>=xe.minimumLineCount){const ye=P+(P===0?0:xe.contextLineCount),he=G-(G===pe.length?0:xe.contextLineCount);he-ye>=xe.minimumLineCount&&Y.push({start:ye,end:he})}Q===P&&Q++}return Y.length?oe.map((P,G)=>{const ye=[];let he=0;for(const fe of Y)ye.push(...P.lines.slice(he,fe.start)),ye.push({code:G===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${P.key}-collapsed-${fe.start}-${fe.end}`,number:""}),he=fe.end;return ye.push(...P.lines.slice(he)),Rt(st({},P),{lines:ye})}):oe}const _=D(()=>{var oe,re,xe,pe;if(!p.value)return[];const Ee=(function(G){const ye=G.some(fe=>I(fe)),he=G.some(fe=>T(fe));return ye&&he||(function(){var fe,K,ne,me;if(s.value==="diff")return!0;const we=(me=(ne=String((K=(fe=t.node)==null?void 0:fe.raw)!=null?K:"").split(/\r?\n/,1)[0])==null?void 0:ne.trim())!=null?me:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(we)})()&&(ye||he)})(u.value),ue=(function(){var G,ye;return((G=t.node)==null?void 0:G.originalCode)!=null||((ye=t.node)==null?void 0:ye.updatedCode)!=null})();if(m.value){const G=ue?(function(ye,he){const fe=b(ye),K=b(he),ne=N(fe,K);if(ne.length>0){const _e=[];let Ke=0,Qe=0;for(const ot of ne){for(;Ke<ot.originalIndex;)_e.push(Rt(st({},v(fe[Ke],"removed",{preserveBlankKind:C(fe,Ke)})),{key:`inline-removed-source-${Ke}`,number:Ke+1})),Ke++;for(;Qe<ot.modifiedIndex;)_e.push(Rt(st({},v(K[Qe],"added",{preserveBlankKind:C(K,Qe)})),{key:`inline-added-source-${Qe}`,number:Qe+1})),Qe++;_e.push(Rt(st({},v(K[ot.modifiedIndex])),{key:`inline-context-source-${ot.originalIndex}-${ot.modifiedIndex}`,number:ot.modifiedIndex+1})),Ke=ot.originalIndex+1,Qe=ot.modifiedIndex+1}for(;Ke<fe.length;)_e.push(Rt(st({},v(fe[Ke],"removed",{preserveBlankKind:C(fe,Ke)})),{key:`inline-removed-source-${Ke}`,number:Ke+1})),Ke++;for(;Qe<K.length;)_e.push(Rt(st({},v(K[Qe],"added",{preserveBlankKind:C(K,Qe)})),{key:`inline-added-source-${Qe}`,number:Qe+1})),Qe++;return _e}const me=[];let we=0,Te=fe.length-1,Pe=K.length-1;for(;we<=Te&&we<=Pe&&fe[we]===K[we];)me.push(Rt(st({},v(K[we])),{key:`inline-prefix-${we}`,number:we+1})),we++;const be=[];for(;Te>=we&&Pe>=we&&fe[Te]===K[Pe];)be.unshift(Rt(st({},v(K[Pe])),{key:`inline-suffix-${Pe}`,number:Pe+1})),Te--,Pe--;for(let _e=we;_e<=Te;_e++)me.push(Rt(st({},v(fe[_e],"removed",{preserveBlankKind:C(fe,_e)})),{key:`inline-removed-source-${_e}`,number:_e+1}));for(let _e=we;_e<=Pe;_e++)me.push(Rt(st({},v(K[_e],"added",{preserveBlankKind:C(K,_e)})),{key:`inline-added-source-${_e}`,number:_e+1}));return me.concat(be)})((oe=t.node)==null?void 0:oe.originalCode,(re=t.node)==null?void 0:re.updatedCode):(function(ye){const he=[];let fe=1,K=1;const ne=M(ye);for(const[me,we]of ye.entries())if(we.startsWith("@@")){const Te=we.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Te&&(fe=Number(Te[1]),K=Number(Te[2])),he.push(Rt(st({},v(we,"hunk")),{key:`inline-hunk-${me}`,number:""}))}else if(I(we))he.push(Rt(st({},v($(we.slice(1),ne),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${me}`,number:fe++}));else if(T(we))he.push(Rt(st({},v($(we.slice(1),ne),"added",{preserveBlankKind:!0})),{key:`inline-added-${me}`,number:K++}));else{const Te=ne&&we.startsWith(" ")?we.slice(1):we;he.push(Rt(st({},v(Te)),{key:`inline-context-${me}`,number:K})),fe++,K++}return he})(u.value);return F([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:G}])}if(!Ee&&ue)return(function(G,ye){const he=b(G),fe=b(ye),K=N(he,fe),ne=[],me=[];let we=0,Te=0,Pe=0;const be=(_e,Ke)=>{const Qe=Math.max(_e-we,Ke-Te);for(let ot=0;ot<Qe;ot++){const at=we+ot,ht=Te+ot;ne.push(at<_e?Rt(st({},v(he[at],"removed",{preserveBlankKind:C(he,at)})),{key:`original-changed-${Pe}-${at}`,number:at+1}):Rt(st({},v("","spacer")),{key:`original-spacer-${Pe}-${ot}`,number:""})),me.push(ht<Ke?Rt(st({},v(fe[ht],"added",{preserveBlankKind:C(fe,ht)})),{key:`modified-changed-${Pe}-${ht}`,number:ht+1}):Rt(st({},v("","spacer")),{key:`modified-spacer-${Pe}-${ot}`,number:""}))}we=_e,Te=Ke,Pe++};for(const _e of K)be(_e.originalIndex,_e.modifiedIndex),ne.push(Rt(st({},v(he[_e.originalIndex])),{key:`original-context-${_e.originalIndex}-${_e.modifiedIndex}`,number:_e.originalIndex+1})),me.push(Rt(st({},v(fe[_e.modifiedIndex])),{key:`modified-context-${_e.originalIndex}-${_e.modifiedIndex}`,number:_e.modifiedIndex+1})),we=_e.originalIndex+1,Te=_e.modifiedIndex+1;return be(he.length,fe.length),F([{key:"original",className:"markstream-pre__diff-pane--original",lines:ne},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:me}])})((xe=t.node)==null?void 0:xe.originalCode,(pe=t.node)==null?void 0:pe.updatedCode);const Y=[],Q=[],P=M(u.value);for(const G of u.value)if(G.startsWith("@@"))Y.push(v(G,"hunk")),Q.push(v(G,"hunk"));else if(G.startsWith("-")&&!G.startsWith("---"))Y.push(v($(G.slice(1),P),"removed",{preserveBlankKind:!0}));else if(G.startsWith("+")&&!G.startsWith("+++"))Q.push(v($(G.slice(1),P),"added",{preserveBlankKind:!0}));else{const ye=P&&G.startsWith(" ")?G.slice(1):G;Y.push(v(ye)),Q.push(v(ye))}return F([{key:"original",className:"markstream-pre__diff-pane--original",lines:Y.map((G,ye)=>Rt(st({},G),{key:`original-${ye}`,number:ye+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((G,ye)=>Rt(st({},G),{key:`modified-${ye}`,number:ye+1}))}])}),R=D(()=>_.value.some(oe=>oe.lines.some(re=>re.kind==="collapsed"))),z=D(()=>{const oe=s.value;return oe?`Code block: ${oe}`:"Code block"}),W=se(null),L=se([]);let O=null,q=!1,X=null;function ie(oe){const re=Number.parseFloat(String(oe??""));return Number.isFinite(re)&&re>0?re:0}function U(oe,re){var xe;if(!oe)return re;if(oe.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const pe=oe.querySelector(".markstream-pre__diff-content"),Ee=pe?.getBoundingClientRect(),ue=(xe=Ee?.height)!=null?xe:0;return Math.max(re,Math.ceil(ue))}function j(){q||typeof window>"u"||(O!=null&&window.cancelAnimationFrame(O),O=window.requestAnimationFrame(()=>{O=null,q||(function(){var oe,re;O=null;const xe=W.value;if(!xe||!p.value||m.value||!xe.classList.contains("is-wrap"))return void(L.value.length&&(L.value=[]));const pe=(function(ye){const he=window.getComputedStyle(ye),fe=ie(he.getPropertyValue("--markstream-pre-diff-line-height"));if(fe>0)return fe;const K=ie(he.lineHeight);return K>0?K:18})(xe),Ee=Array.from(xe.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),ue=Array.from(xe.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Y=Math.max(Ee.length,ue.length),Q=[];for(let ye=0;ye<Y;ye++){const he=U((oe=Ee[ye])!=null?oe:null,pe),fe=U((re=ue[ye])!=null?re:null,pe),K=Math.max(pe,he,fe);Q.push({rowHeight:K,originalHeight:he,modifiedHeight:fe})}var P,G;P=L.value,G=Q,P.length===G.length&&P.every((ye,he)=>{const fe=G[he];return fe&&Math.abs(ye.rowHeight-fe.rowHeight)<=.5&&Math.abs(ye.originalHeight-fe.originalHeight)<=.5&&Math.abs(ye.modifiedHeight-fe.modifiedHeight)<=.5})||(L.value=Q)})()}))}function te(oe){X?.disconnect(),X=null,oe&&p.value&&!m.value&&typeof ResizeObserver<"u"&&(X=new ResizeObserver(()=>{j()}),X.observe(oe))}function ae(oe,re){const xe=L.value[oe];if(!xe)return;const pe=re==="original"?xe.originalHeight:xe.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(xe.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(pe)}px`}}return Je(W,oe=>{te(oe),yt(()=>j())},{flush:"post"}),Je([p,m,_],()=>{te(W.value),yt(()=>j())},{flush:"post",immediate:!0}),Qn(()=>{q=!0,O!=null&&(window.cancelAnimationFrame(O),O=null),X?.disconnect(),X=null}),(oe,re)=>(x(),E("pre",{ref_key:"preRef",ref:W,style:Jt(y.value),class:He([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":p.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":R.value}]),"aria-busy":i.value,"aria-label":z.value,"data-language":s.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[p.value?(x(),E("code",Tte,[(x(!0),E(De,null,rt(_.value,xe=>(x(),E("span",{key:xe.key,class:He(["markstream-pre__diff-pane",xe.className])},[S("span",Nte,[(x(!0),E(De,null,rt(xe.lines,(pe,Ee)=>(x(),E("span",{key:pe.key,class:He(["markstream-pre__diff-line",[`markstream-pre__diff-line--${pe.kind}`,{"markstream-pre__diff-line--empty":pe.empty}]]),style:Jt(ae(Ee,xe.key))},[re[0]||(re[0]=S("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),S("span",Ite,B(pe.number),1),S("span",Lte,[S("span",$te,B(pe.code),1)])],6))),128))])],2))),128))])):(x(),E(De,{key:1},[t.showLineNumbers?(x(),E("span",Fte,[S("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,Ote)])):ge("",!0),S("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,Rte)],64))],14,Ete))}});So.install=e=>{e.component(So.__name,So)};const Bte={key:0},es=gn(Xe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Sf(),s=jt("markstreamFade",void 0),o=jt("markstreamTextStreamState",void 0),i=jt("markstreamStreamVersion",void 0),r=D(()=>{const y=n.fade;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=D(()=>{var y;const k=(y=n["index-key"])!=null?y:n.indexKey;return k==null||k===""?"":String(k)}),c=se(t.node.content),u=se(""),d=se(0);let f;function h(){f?.(),f=void 0}function p(){h(),u.value&&(c.value=c.value+u.value,u.value="")}Je([()=>t.node.content,a,l],([y])=>{const k=String(y??""),g=a.value,v=T8({nextContent:k,persistedContent:g?o?.get(g):void 0,currentState:{settledContent:c.value,streamedDelta:u.value},typewriterEnabled:l.value});c.value=v.settledContent,u.value=v.streamedDelta,v.appended?(d.value+=1,(function(){if(!u.value||f||!i)return;const b=i.value;f=Je(()=>i.value,C=>{C!==b&&p()},{flush:"sync"})})()):u.value||h(),g&&o?.set(g,k)},{immediate:!0}),bf(h);const m=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(y,k)=>(x(),E("span",{class:He([[e.node.center?"text-node-center":""],"text-node"])},[c.value?(x(),E("span",Bte,B(c.value),1)):ge("",!0),u.value?(x(),E("span",{key:1,class:He(["text-node-stream-delta",[m.value]]),onAnimationend:p},B(u.value),35)):ge("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function vd(e,t,n){return Xe({name:e,inheritAttrs:!1,setup(s,{attrs:o,slots:i}){var r,l;const a=A2(),c=S2(),u=C2(),d=typeof window<"u"&&((l=(r=hs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=se(typeof window>"u"||d||!u.value),h=tr(null);let p=null;function m(y){const k=y&&"$el"in y?y.$el:y;h.value=k instanceof HTMLElement?k:null}return typeof window<"u"&&Je([h,u],([y,k],g,v)=>{if(p?.destroy(),p=null,!k||f.value)return void(f.value=!0);if(!y)return;let b=!0;const C=a(y,{rootMargin:c?.value.heavyBlockMargin,allowIdle:!1});p=C,f.value=C.isVisible.value,C.whenVisible.then(()=>{b&&p===C&&(f.value=!0)}),v(()=>{b=!1,C.destroy(),p===C&&(p=null)})},{immediate:!0}),Qn(()=>{p?.destroy(),p=null}),()=>Ft(f.value?t:n,Rt(st({},o),{ref:m}),i)}})}es.install=e=>{e.component(es.__name,es)};const Am=Xe({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var s,o,i,r,l,a,c;const u=O1(String((o=(s=n.node)==null?void 0:s.language)!=null?o:"")),d=RC[u]||(u?u.charAt(0).toUpperCase()+u.slice(1):RC[""]),f=Ate(n.node),h=Mte(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),p=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:M2(p??{},typeof window>"u"?0:window.innerWidth)),y=p?.diffAppearance,k=y==="dark"||y!=="light"&&n.isDark===!0,g=typeof p?.fontSize=="number"&&Number.isFinite(p.fontSize)&&p.fontSize>0?p.fontSize:12,v=typeof p?.lineHeight=="number"&&Number.isFinite(p.lineHeight)&&p.lineHeight>0?p.lineHeight:g===12?18:Math.max(12,Math.round(1.5*g)),b=typeof p?.tabSize=="number"&&Number.isFinite(p.tabSize)&&p.tabSize>0?p.tabSize:4,C=f?0:8,I=typeof((a=p?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(p.padding.top)&&p.padding.top>=0?p.padding.top:C,T=typeof((c=p?.padding)==null?void 0:c.bottom)=="number"&&Number.isFinite(p.padding.bottom)&&p.padding.bottom>=0?p.padding.bottom:C,M=typeof p?.fontFamily=="string"?p.fontFamily.trim():"",$=st(st({fontSize:`${g}px`,lineHeight:`${v}px`,tabSize:b,paddingTop:`${I}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${I}px`},f?{"--markstream-pre-diff-line-height":`${v}px`}:{}),M?{"--markstream-code-font-family":M}:{}),N=()=>Ft("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Ft("svg",{class:"action-icon"})]),F=n.isShowPreview!==!1&&(u==="html"||u==="svg"),_=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||F&&n.showPreviewButton!==!1,R=W=>{if(W!=null)return typeof W=="number"?`${W}px`:String(W)},z=st(st(st({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Ft("div",Rt(st({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":k,"is-diff":f,"is-plain-text":u===""||u==="plaintext"||u==="text"},t.class],style:[z,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Ft("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Ft("div",{class:"code-header-main"},[Ft("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),Ft("div",{class:"code-header-copy"},[Ft("div",{class:"code-header-title"},h.title),h.caption?Ft("div",{class:"code-header-caption"},h.caption):null])]),Ft("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Ft("div",{class:"code-diff-stats","aria-hidden":"true"},[Ft("span",{class:"code-diff-stat removed"},"-0"),Ft("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:N(),n.showCollapseButton===!1?null:N(),_?Ft("div",{class:"relative"},[N()]):null])]),Ft("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Ft(So,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?Cte(p?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:$,"data-markstream-code-loading":"1"})]),Ft("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Ft("div",{class:"loading-skeleton"},[Ft("div",{class:"skeleton-line"}),Ft("div",{class:"skeleton-line"}),Ft("div",{class:"skeleton-line short"})])]),Ft("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),Yg=vd("ViewportDeferredCodeBlockNode",Ci({loader:()=>Hn(null,null,function*(){try{return(yield io(()=>import("./CodeBlockNode-BaWzfCy0.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),So}}),loadingComponent:Am,delay:0,suspensible:!1}),Am),Li=Ci(()=>Hn(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 Ft(es,Rt(st({},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{return yield F8(),(yield io(()=>import("./index7-CtaXn3W4.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 Ft(es,Rt(st({},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:""}$`}}))}})),Y8=Ci(()=>Hn(null,null,function*(){try{return yield F8(),(yield io(()=>import("./index6-xetF8e8c.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 Ft(es,Rt(st({},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:""}$$`}}))}})),ao=gn(Xe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),E("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=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))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ao.install=e=>{e.component(ao.__name,ao)};const Dte={class:"superscript-node"},To=gn(Xe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,strong:co,emphasis:ho,footnote_reference:Go,strikethrough:uo,highlight:Zo,insert:Io,subscript:No,emoji:Eo,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("sup",Dte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);To.install=e=>{e.component(To.__name,To)};const Pte={class:"subscript-node"},No=gn(Xe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,strong:co,emphasis:ho,footnote_reference:Go,strikethrough:uo,highlight:Zo,insert:Io,superscript:To,emoji:Eo,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("sub",Pte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);No.install=e=>{e.component(No.__name,No)};const Hte={class:"strong-node"},co=gn(Xe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,emphasis:ho,strikethrough:uo,highlight:Zo,insert:Io,subscript:No,superscript:To,emoji:Eo,footnote_reference:Go,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("strong",Hte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);co.install=e=>{e.component(co.__name,co)};const Wte={class:"strikethrough-node"},uo=gn(Xe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,strong:co,emphasis:ho,highlight:Zo,insert:Io,subscript:No,superscript:To,emoji:Eo,footnote_reference:Go,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("del",Wte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);uo.install=e=>{e.component(uo.__name,uo)};const zte=["href","title","aria-label","aria-hidden","target","rel"],Ute=["aria-hidden"],qte={class:"link-text-wrapper relative inline-flex"},jte={class:"leading-[normal] link-text"},fo=gn(Xe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=jt("markstreamShowTooltips",void 0),s=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,g,v,b,C;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(k=t.animationOpacity)!=null?k:.35,M=Math.max(.12,Math.min(.5*T,T)),$={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":I,"--underline-opacity":String(T),"--underline-rest-opacity":String(M),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(C=t.animationIteration)!=null?C:"infinite"};return t.color&&($["--link-color"]=t.color),$}),i=ms(()=>t.customId),r=D(()=>st({text:es,strong:co,strikethrough:uo,emphasis:ho,image:wl,html_inline:Yo,inline_code:Ys},i.value)),l=Sf(),a=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const b={};if(Array.isArray(v))for(const C of v)Array.isArray(C)&&C[0]&&(b[String(C[0])]=String((g=C[1])!=null?g:""));else for(const[C,I]of Object.entries(v))C&&I!=null&&I!==!1&&(b[C]=I===!0?"":String(I));return YC(b,"safe","a")}),c=D(()=>st(st({},l),a.value)),u=D(()=>{var k,g;return YC({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=D(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(PG(u.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{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(b=>b.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=D(()=>{const k=st({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&ute()}const y=D(()=>{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,b;return e.node.loading?(x(),E("span",hn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},A(l),{style:o.value}),[S("span",qte,[S("span",jte,[ve(A(es),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=S("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Ute)):(x(),E("a",hn({key:0,class:"link-node",href:u.value,title:s.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=C=>(function(I){var T,M,$,N;if(!s.value)return;const F=I,_=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,R=((T=t.node)==null?void 0:T.title)||((M=u.value)!=null&&M.includes("xn--")&&((N=($=t.node)==null?void 0:$.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";cte(I.currentTarget,R,"top",!1,_)})(C)),onMouseleave:m}),[(x(!0),E(De,null,rt(e.node.children,(C,I)=>(x(),Ae(A(nr),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:C,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,zte))}}}),[["__scopeId","data-v-367e6ca4"]]);fo.install=e=>{e.component(fo.__name,fo)};const Vte={class:"insert-node"},Io=gn(Xe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,strong:co,emphasis:ho,strikethrough:uo,highlight:Zo,subscript:No,superscript:To,emoji:Eo,footnote_reference:Go,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("ins",Vte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);Io.install=e=>{e.component(Io.__name,Io)};const Kte={class:"highlight-node"},Zo=gn(Xe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,strong:co,emphasis:ho,strikethrough:uo,insert:Io,subscript:No,superscript:To,emoji:Eo,footnote_reference:Go,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("mark",Kte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);Zo.install=e=>{e.component(Zo.__name,Zo)};const Gte={class:"emphasis-node"},ho=gn(Xe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>st({text:es,inline_code:Ys,link:fo,html_inline:Yo,strong:co,strikethrough:uo,highlight:Zo,insert:Io,subscript:No,superscript:To,emoji:Eo,footnote_reference:Go,math_inline:Li,reference:ao},n.value));return(o,i)=>(x(),E("em",Gte,[(x(!0),E(De,null,rt(e.node.children,(r,l)=>(x(),Ae(A(nr),{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"]]);ho.install=e=>{e.component(ho.__name,ho)};const Yte={class:"hard-break"},_l=gn(Xe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("br",Yte))}),[["__scopeId","data-v-50c58f70"]]);_l.install=e=>{e.component(_l.__name,_l)};const mf=Xe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=vt({checkbox:Ko,checkbox_input:Ko,emoji:Eo,emphasis:ho,hardbreak:_l,highlight:Zo,inline_code:Ys,insert:Io,link:fo,reference:ao,strikethrough:uo,strong:co,subscript:No,superscript:To,text:es}),s=ms(()=>t.customId),o=D(()=>{const i=s.value;return Object.keys(i).length>0?st(st({},n),i):n});return(i,r)=>(x(!0),E(De,null,rt(e.nodes,(l,a)=>(x(),Ae(A(nr),{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 Oy(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(Oy)}function Mm(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Oy))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(Oy)?o:null}function Ba(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 Zte=["cite"],Xte={key:0,dir:"auto",class:"paragraph-node"},Qte=["custom-id"],_p=gn(Xe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ms(()=>t.customId),s=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),i=D(()=>Mm(t.node.children,!s.value)),r=D(()=>t.fade!==!1||o.value?null:Ba(i.value));return wn("markstreamShowTooltips",D(()=>t.showTooltips)),wn("markstreamFade",D(()=>t.fade)),(l,a)=>(x(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),E("p",Xte,[r.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Qte)):(x(),Ae(A(mf),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),Ae(A(Lo),{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,Zte))}}),[["__scopeId","data-v-abfecebc"]]);_p.install=e=>{e.component(_p.__name,_p)};const Jte={class:"definition-list"},ene={class:"definition-term"},tne={class:"definition-desc"},Sp=gn(Xe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),E("dl",Jte,[(x(!0),E(De,null,rt(t.node.items,(o,i)=>(x(),E(De,{key:i},[S("dt",ene,[ve(A(Lo),{"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"])]),S("dd",tne,[ve(A(Lo),{"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"]]);Sp.install=e=>{e.component(Sp.__name,Sp)};const nne=["href","title"],Pd=gn(Xe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(x(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,nne))}}),[["__scopeId","data-v-e1eb37b6"]]);Pd.install=e=>{e.component(Pd.__name,Pd)};const sne=["id"],one={class:"flex-1"},Cp=Xe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[S("div",one,[ve(A(Lo),{"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,sne))}});Cp.install=e=>{e.component(Cp.__name,Cp)};const ine=["custom-id"],Ry=gn(Xe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),s=jt("markstreamFade",void 0),o=D(()=>s?.value!==!1||n.value.text?null:Ba(t.node.children)),i=D(()=>st({text:es,inline_code:Ys,link:fo,image:wl,strong:co,emphasis:ho,strikethrough:uo,highlight:Zo,insert:Io,subscript:No,superscript:To,emoji:Eo,checkbox:Ko,checkbox_input:Ko,footnote_reference:Go,hardbreak:_l,math_inline:Li,reference:ao},n.value));return(r,l)=>(x(),Ae(Ms(`h${e.node.level}`),hn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Fe(()=>[o.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,ine)):(x(!0),E(De,{key:1},rt(e.node.children,(a,c)=>(x(),Ae(A(nr),{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"]]),D1=Ry;D1.install=e=>{e.component(Ry.__name,Ry)};const rne={key:0,dir:"auto",class:"paragraph-node"},lne=["custom-id"],ane={dir:"auto",class:"paragraph-node"},cne=["custom-id"],tu=gn(Xe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),s=ms(()=>t.customId),o=D(()=>!!s.value.paragraph),i=D(()=>!!s.value.text),r=D(()=>{var h;return Mm((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const y=p.slice(1);if(!y.every(g=>g?.type==="list"))return null;const k=Mm([m]);return k?{paragraphChildren:k,nestedLists:y}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Ba(r.value):null),u=D(()=>{var h;return a()?Ba((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return wn("markstreamShowTooltips",D(()=>t.showTooltips)),wn("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,y;return x(),E("li",hn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),E("p",rne,[c.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,lne)):(x(),Ae(A(mf),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(x(),E(De,{key:1},[S("p",ane,[u.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,cne)):(x(),Ae(A(mf),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),E(De,null,rt(l.value.nestedLists,(k,g)=>(x(),Ae(A(Lo),{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)):(x(),Ae(A(Lo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(m=n.value)==null?void 0:m.children)!=null?y:[],"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"]]);tu.install=e=>{e.component(tu.__name,tu)};const nu=gn(Xe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ms(()=>e.customId),n=D(()=>t.value.list_item||tu);return(s,o)=>(x(),Ae(Ms(e.node.ordered?"ol":"ul"),{class:He(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Fe(()=>[(x(!0),E(De,null,rt(e.node.items,(i,r)=>{var l;return x(),Ae(Ms(n.value),hn({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"]]);nu.install=e=>{e.component(nu.__name,nu)};const une={key:2,class:"html-block-node__raw"},dne=["innerHTML"],fne={key:1,class:"html-block-node__placeholder"},Hd=gn(Xe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamNestedRendererProps",void 0),o=D(()=>{var _,R;return(R=(_=t.htmlPolicy)!=null?_:n?.value)!=null?R:"safe"}),i=D(()=>{var _,R;const z=(_=s?.value)!=null?_:{};return Rt(st({},z),{customId:(R=t.customId)!=null?R:z.customId,htmlPolicy:o.value})}),r=Ci({loader:()=>Promise.resolve().then(()=>B2),suspensible:!1}),l=D(()=>{const _=kp(t.node.attrs,o.value);if(!_)return;const R=Od(_);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const _=String(t.node.tag||"").trim(),R=kp(t.node.attrs,o.value,_);if(!R)return;const z=Od(R);return Object.keys(z).length>0?z:void 0}),c=ms(()=>t.customId),u=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=se(null),f=se(typeof window>"u"),h=se(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),y=D(()=>{var _;if(m.value.trim().toLowerCase()!=="details"||(_=t.node.attrs)!=null&&_.some(([z])=>String(z).toLowerCase()==="open"))return null;const R=p.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),k=D(()=>{var _;return Ba((_=y.value)==null?void 0:_.children)}),g=D(()=>{const _=y.value;if(!_)return;const R=kp(_.attrs,o.value,"summary");if(!R)return;const z=Od(R);return Object.keys(z).length>0?z:void 0}),v=D(()=>k.value==null?p.value:p.value.slice(1)),b=D(()=>{const _=m.value.trim().toLowerCase();return v5.has(_)||y2(_,o.value)}),C=D(()=>p.value.length>0&&!!t.node.tag&&!b.value),I=D(()=>{var _,R,z;if(C.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(_=h.value)!=null?_:""};const W=(R=h.value)!=null?R:t.node.content;if(!W)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:eu(W,o.value)};if(t.node.loading){const O=Cm(W,c.value,o.value);return O===null?{mode:"text",content:(z=t.node.raw)!=null?z:W}:{mode:"dynamic",nodes:O}}if(!z8(W,c.value))return{mode:"html",content:eu(W,o.value)};const L=Cm(W,c.value,o.value);return L===null?{mode:"html",content:eu(W,o.value)}:{mode:"dynamic",nodes:L}}),T=A2(),M=S2(),$=C2(),N=tr(null),F=!!t.node.loading;return typeof window<"u"?(Je([()=>d.value,()=>M?.value.heavyBlockMargin,()=>M?.value.rootMargin],([_],R,z)=>{var W,L,O,q;if((L=(W=N.value)==null?void 0:W.destroy)==null||L.call(W),N.value=null,!F)return f.value=!0,void(h.value=t.node.content);if(!_)return void(f.value=!1);let X=!0;const ie=(q=(O=M?.value.heavyBlockMargin)!=null?O:M?.value.rootMargin)!=null?q:Ra,U=T(_,{rootMargin:ie,allowIdle:!$.value});N.value=U,f.value=f.value||U.isVisible.value,U.whenVisible.then(()=>{X&&N.value===U&&(f.value=!0)}),z(()=>{X=!1,U.destroy(),N.value===U&&(N.value=null)})},{immediate:!0}),Je(()=>t.node.content,_=>{F&&!f.value||(h.value=_)})):f.value=!0,Qn(()=>{var _,R;(R=(_=N.value)==null?void 0:_.destroy)==null||R.call(_),N.value=null}),(_,R)=>(x(),Ae(Ms(C.value?m.value:"div"),hn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":A($)&&!f.value?"true":void 0},C.value?a.value:void 0),{default:Fe(()=>[f.value?(x(),E(De,{key:0},[I.value.mode==="structured"?(x(),E(De,{key:0},[k.value!==null?(x(),E(De,{key:0},[S("summary",XN(sM(g.value)),B(k.value),17),v.value.length?(x(),Ae(A(r),hn({key:0},i.value,{nodes:v.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ge("",!0)],64)):(x(),Ae(A(r),hn({key:1},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):I.value.mode==="dynamic"?(x(),Ae(A(u),{key:1,nodes:I.value.nodes},null,8,["nodes"])):I.value.mode==="text"?(x(),E("pre",une,B(I.value.content),1)):(x(),E("div",hn({key:3},l.value,{innerHTML:I.value.content}),null,16,dne))],64)):(x(),E("div",fne,[Rn(_.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=S("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=S("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=S("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Hd.install=e=>{e.component(Hd.__name,Hd)};const hne={dir:"auto",class:"paragraph-node"},pne=["custom-id"],Ia=gn(Xe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ms(()=>t.customId),s=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamFade",void 0),i=jt("markstreamParseOptions",void 0),r=jt("markstreamCustomMarkdownIt",void 0),l=jt("markstreamNestedRendererProps",void 0),a=D(()=>{var M;return(M=s?.value)!=null?M:"safe"}),c=D(()=>{var M;return(M=t.parseOptions)!=null?M:i?.value}),u=D(()=>{var M;return(M=t.customMarkdownIt)!=null?M:r?.value}),d=D(()=>{var M,$;return($=t.customHtmlTags)!=null?$:(M=l?.value)==null?void 0:M.customHtmlTags}),f=D(()=>{var M,$;const N=(M=l?.value)!=null?M:{};return Rt(st({},N),{customId:($=t.customId)!=null?$:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Ci({loader:()=>Promise.resolve().then(()=>B2),suspensible:!1});function p(M){var $;return M.type==="text"&&String(($=M.content)!=null?$:"").trim()===""}const m=D(()=>t.node.children.filter(M=>!p(M))),y=D(()=>m.value.length>0&&m.value.every(M=>M.type==="image"||(function($){var N;const F=(function(_){return _.type==="link"&&Array.isArray(_.children)?_.children.filter(R=>!p(R)):[]})($);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(M))),k=D(()=>new Set(Va(d.value))),g=D(()=>{if(!y.value||m.value.length<=1)return t.node.children;const M=[];for(let $=0;$<t.node.children.length;$++){const N=t.node.children[$];if(!p(N)){M.push(N);continue}const F=M.length>0,_=t.node.children.slice($+1).some(R=>!p(R));F&&_&&M.push(Rt(st({},N),{content:" ",raw:" "}))}return M}),v=D(()=>o?.value===!1&&!n.value.text),b=D(()=>v.value?Ba(g.value):null);function C(M,$){return{node:M,"index-key":`${t.indexKey}-${$}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=D(()=>st({inline_code:Ys,image:wl,link:fo,hardbreak:_l,emphasis:ho,strong:co,strikethrough:uo,highlight:Zo,insert:Io,subscript:No,superscript:To,html_inline:Yo,html_block:Hd,emoji:Eo,checkbox:Ko,math_inline:Li,checkbox_input:Ko,reference:ao,footnote_anchor:Pd,footnote_reference:Go,text:es},n.value)),T=D(()=>g.value.map((M,$)=>{var N;const F=(function(_){var R,z,W,L;if(_.type==="html_block"||_.type==="html_inline"){const O=String((R=_.tag)!=null?R:"").trim().toLowerCase()||w5(_.content);if(O&&!k.value.has(O)&&_5((z=_.content)!=null?z:_.raw,O)){const q=String((L=(W=_.content)!=null?W:_.raw)!=null?L:"");return{child:{type:"text",content:q,raw:q},component:es,isCustomComponent:!1}}}return{child:_,component:I.value[_.type],isCustomComponent:!!(n.value[_.type]&&!Ff(String(_.type)))}})(M);return Rt(st({},F),{index:$,key:`${t.indexKey||"paragraph"}-${$}`,customAttrs:F.isCustomComponent?_2(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:M})}));return(M,$)=>(x(),E("p",hne,[b.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(b.value),9,pne)):(x(!0),E(De,{key:1},rt(T.value,N=>{return x(),E(De,{key:N.key},[y.value&&p(N.originalChild)?(x(),E(De,{key:0},[tt(B((F=N.originalChild,String((_=F.content)!=null?_:""))),1)],64)):N.isCustomComponent?(x(),Ae(Ms(N.component),hn({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Fe(()=>[N.hasSlotChildren?(x(),Ae(A(h),hn({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(x(),Ae(A(h),hn({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ge("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),Ae(Ms(N.component),hn({key:2,ref_for:!0},C(N.child,N.index)),null,16))],64);var F,_}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ia.install=e=>{e.component(Ia.__name,Ia)};const mne={class:"table-node-wrapper"},gne=["aria-busy"],vne={key:0},yne=["custom-id"],kne=["aria-label","onPointerdown"],bne=["custom-id"],xne={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Wd=gn(Xe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var k;return(k=t.node.loading)!=null&&k}),s=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=se(null),i=se([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=D(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);wn("markstreamShowTooltips",D(()=>t.showTooltips)),wn("markstreamFade",D(()=>t.fade));const u=ms(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),h=new WeakMap;function p(k){const g=t.fade===!1&&!d.value,v=!f.value,b=h.get(k);if(b?.children===k.children&&b.textFastPath===g&&b.paragraphFastPath===v)return b.info;const C=Mm(k.children,v,!0),I={simpleChildren:C,plainText:C&&g?Ba(C):null};return h.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:I}),I}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),b=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),C=[...r.widths];C[r.index]=b,C[r.index+1]=g-b,i.value=C}function y(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return Je(l,()=>{y(),i.value=[]}),Qn(y),(k,g)=>(x(),E("div",mne,[S("table",{ref_key:"tableRef",ref:o,class:He(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),E("colgroup",vne,[(x(!0),E(De,null,rt(e.node.header.cells,(v,b)=>(x(),E("col",{key:b,style:Jt(c.value[b])},null,4))),128))])):ge("",!0),S("thead",null,[S("tr",null,[(x(!0),E(De,null,rt(e.node.header.cells,(v,b)=>(x(),E("th",{key:b,dir:"auto",class:He([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(p(v).plainText),9,yne)):p(v).simpleChildren?(x(),Ae(A(mf),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(x(),Ae(A(Lo),{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]=C=>k.$emit("copy",C))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b<e.node.header.cells.length-1?(x(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${b+1} and ${b+2}`,onPointerdown:C=>(function(I,T){if(T.button!==0)return;const M=(function(){var F;const _=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(_??[],R=>Math.round(R.getBoundingClientRect().width))})(),$=M[I],N=M[I+1];$&&N&&(T.preventDefault(),r={index:I,startX:T.clientX,startWidth:$,nextStartWidth:N,widths:M},i.value=M,window.addEventListener("pointermove",m),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(b,C)},null,40,kne)):ge("",!0)],2))),128))])]),S("tbody",null,[(x(!0),E(De,null,rt(s.value,(v,b)=>(x(),E("tr",{key:b},[(x(!0),E(De,null,rt(v.cells,(C,I)=>(x(),E("td",{key:I,class:He([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(C).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(p(C).plainText),9,bne)):p(C).simpleChildren?(x(),Ae(A(mf),{key:1,nodes:p(C).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${I}`},null,8,["nodes","custom-id","index-key"])):(x(),Ae(A(Lo),{key:2,nodes:C.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]=T=>k.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,gne),ve(Fa,{name:"table-node-fade"},{default:Fe(()=>[n.value?(x(),E("div",xne,[Rn(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=S("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=S("span",{class:"sr-only"},"Loading",-1))],!0)])):ge("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Wd.install=e=>{e.component(Wd.__name,Wd)};const wne={class:"hr-node"},Ap=gn({},[["render",function(e,t){return x(),E("hr",wne)}],["__scopeId","data-v-39b2349c"]]);Ap.install=e=>{e.component(Ap.__name,Ap)};const _ne={class:"unknown-node"},By=Xe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),E("div",_ne,B(e.node.raw),1))}),Mp=gn(Xe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),s=ms(()=>t.customId),o=D(()=>st({text:es,paragraph:Ia,heading:D1,inline_code:Ys,link:fo,image:wl,strong:co,emphasis:ho,strikethrough:uo,insert:Io,subscript:No,superscript:To,checkbox:Ko,checkbox_input:Ko,hardbreak:_l,math_inline:Li,reference:ao,list:nu,math_block:Y8,table:Wd},s.value));return(i,r)=>(x(),E("div",hn({class:n.value},e.node.attrs),[(x(!0),E(De,null,rt(e.node.children,(l,a)=>{return x(),Ae(Ms((c=l.type,o.value[c]||By)),{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"]]);Mp.install=e=>{e.component(Mp.__name,Mp)};const Sne=["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"],o4=[[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 Cne(e){if(e<=255)return Sne[e];let t=0,n=o4.length-1;for(;t<=n;){const s=t+n>>1,o=o4[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const Ane=/[ \t\n\r\f]+/g,Mne=/[\t\n\r\f]| {2,}|^ | $/;let Zg=null;const Ene=new RegExp("\\p{Script=Arabic}","u"),Ll=new RegExp("\\p{M}","u"),E2=new RegExp("\\p{Nd}","u");function i4(e){return Ene.test(e)}function r4(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Zi(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(r4(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(r4(n))return!0}}return!1}const Tne=new Set([" "," ","","\uFEFF"]),Nne=new Set(["-","‐","–","—"]);function Z8(e,t){return!((function(n){const s=zd(n);return s!==null&&Tne.has(s)})(e)||t&&((function(n){const s=zd(n);return s!==null&&(T2.has(s)||Da.has(s))})(e)||(function(n){const s=zd(n);return s!==null&&Nne.has(s)})(e)))}const T2=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),P1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),N2=new Set(["'","’"]),Da=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Ine=new Set([":",".","،","؛"]),Lne=new Set(["၏"]),$ne=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Fne(e){if(I2(e))return!0;let t=!1;for(const n of e)if(Da.has(n)||Tm(n))t=!0;else if(!t||!Ll.test(n))return!1;return t}function One(e){for(const t of e)if(!T2.has(t)&&!Da.has(t))return!1;return e.length>0}function Rne(e){if(I2(e))return!0;for(const t of e)if(!(P1.has(t)||N2.has(t)||Ll.test(t)||Tm(t)))return!1;return e.length>0}function I2(e){let t=!1;for(const n of e)if(n!=="\\"&&!Ll.test(n)){if(!(P1.has(n)||Da.has(n)||N2.has(n)))return!1;t=!0}return t}function Em(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 zd(e){if(e.length===0)return null;const t=Em(e,e.length);return e.slice(t)}const Bne=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Tm(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,s){for(let o=0;o<s.length;o+=2)if(n>=s[o]&&n<=s[o+1])return!0;return!1})(t,Bne)}function Dne(e){const t=(function(n){for(const s of n)if(!Ll.test(s))return s;return null})(e);return t!==null&&E2.test(t)}function Pne(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Ll.test(s))n--;else{if(!P1.has(s)&&!N2.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Hne(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function l4(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 a4(e,t){return e&&t!==null&&Ine.has(t)}function Wne(e){const t=zd(e);return t!==null&&Lne.has(t)}function zne(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 Dy(e){let t=e.length;for(;t>0;){const n=Em(e,t),s=e.slice(n,t);if($ne.has(s))return!0;if(!Da.has(s))return!1;t=n}return!1}function Une(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
285
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const qne=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function xi(e){return e.length===1?e[0]:e.join("")}function jne(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),xi(n)}function Vne(e,t,n,s){if(!qne.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=Une(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:xi(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:xi(r),isWordLike:a,kind:i,start:l}),o}function Xg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Kne=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Gne(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Kne.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Yne(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Zne=new Set([":","-","/","×",",",".","+","–","—"]),Xne=/[\p{P}\p{S}\p{Co}]/u,Qne=new RegExp("\\p{Emoji_Presentation}","u"),Jne=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function X8(e){const t=e.charCodeAt(0);return t<128?(function(n){return n>=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Jne.has(e)&&!Qne.test(e)&&Xne.test(e)}function c4(e){let t=!1;for(const n of e)if(!Ll.test(n)){if(!X8(n))return!1;t=!0}return t}function ese(e,t,n,s){const o=!t&&c4(e),i=!s&&c4(n),r=(function(a){const c=(function(u){for(let d=u.length;d>0;){const f=Em(u,d),h=u.slice(f,d);if(!Ll.test(h))return h;d=f}return null})(a);return c!==null&&Tm(c)})(e),l=(t||r)&&(function(a){for(let c=a.length;c>0;){const u=Em(a,c),d=a.slice(u,c);if(!Ll.test(d))return X8(d)||Tm(d);c=u}return!1})(e);return!!(o||i||l)&&!Zi(e)&&!Zi(n)&&(t||o||r)&&(s||i)}function u4(e){for(const t of e)if(E2.test(t))return!0;return!1}function Ep(e){if(e.length===0)return!1;for(const t of e)if(!E2.test(t)&&!Zne.has(t))return!1;return!0}function tse(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function nse(e,t,n="normal",s="normal"){const o=(function(a){const c=a??"normal";return c==="pre-wrap"?{mode:c,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:c,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(n),i=o.mode==="pre-wrap"?(function(a){return/[\r\f]/.test(a)?a.replace(/\r\n/g,`
|
|
286
|
+
`).replace(/[\r\f]/g,`
|
|
287
|
+
`):a})(e):(function(a){if(!Mne.test(a))return a;let c=a.replace(Ane," ");return c.charCodeAt(0)===32&&(c=c.slice(1)),c.length>0&&c.charCodeAt(c.length-1)===32&&(c=c.slice(0,-1)),c})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,c,u){var d,f,h;const p=(Zg===null&&(Zg=new Intl.Segmenter(void 0,{granularity:"word"})),Zg);let m=0;const y=[],k=[],g=[],v=[],b=[],C=[],I=[],T=[],M=[],$=[],N=[],F=[];for(const L of p.segment(a))for(const O of Vne(L.segment,(d=L.isWordLike)!=null&&d,L.index,u)){let q=function(){C[re]!==null&&(k[re]=[l4(y,C,I,re)],C[re]=null),k[re].push(O.text),g[re]=g[re]||O.isWordLike,T[re]=T[re]||U,M[re]=M[re]||j,$[re]=ae,N[re]=oe,F[re]=a4(M[re],te)};const X=O.kind==="text",ie=Hne(O.text,O.isWordLike,O.kind),U=Zi(O.text),j=i4(O.text),te=zd(O.text),ae=Dy(O.text),oe=Wne(O.text),re=m-1;c.carryCJKAfterClosingQuote&&X&&m>0&&v[re]==="text"&&U&&T[re]&&$[re]||X&&m>0&&v[re]==="text"&&One(O.text)&&T[re]||X&&m>0&&v[re]==="text"&&N[re]?q():X&&m>0&&v[re]==="text"&&O.isWordLike&&j&&F[re]?(q(),g[re]=!0):ie!==null&&m>0&&v[re]==="text"&&C[re]===ie?I[re]=((f=I[re])!=null?f:1)+1:X&&!O.isWordLike&&m>0&&v[re]==="text"&&!T[re]&&(Fne(O.text)||O.text==="-"&&g[re])?q():(y[m]=O.text,k[m]=[O.text],g[m]=O.isWordLike,v[m]=O.kind,b[m]=O.start,C[m]=ie,I[m]=ie===null?0:1,T[m]=U,M[m]=j,$[m]=ae,N[m]=oe,F[m]=a4(j,te),m++)}for(let L=0;L<m;L++)C[L]===null?y[L]=xi(k[L]):y[L]=l4(y,C,I,L);for(let L=1;L<m;L++)v[L]!=="text"||g[L]||!I2(y[L])||v[L-1]!=="text"||T[L-1]||(y[L-1]+=y[L],g[L-1]=g[L-1]||g[L],y[L]="");const _=Array.from({length:m},()=>null);let R=-1;for(let L=m-1;L>=0;L--){const O=y[L];if(O.length!==0){if(v[L]==="text"&&!g[L]&&R>=0&&v[R]==="text"&&(Rne(O)||O==="-"&&Dne(y[R]))){const q=(h=_[R])!=null?h:[];q.push(O),_[R]=q,b[R]=b[L],y[L]="";continue}R=L}}for(let L=0;L<m;L++){const O=_[L];O!=null&&(y[L]=jne(O,y[L]))}let z=0;for(let L=0;L<m;L++){const O=y[L];O.length!==0&&(z!==L&&(y[z]=O,g[z]=g[L],v[z]=v[L],b[z]=b[L]),z++)}y.length=z,g.length=z,v.length=z,b.length=z;const W=(function(L){const O=L.texts.slice(),q=L.isWordLike.slice(),X=L.kinds.slice(),ie=L.starts.slice();for(let U=0;U<O.length-1;U++){if(X[U]!=="text"||X[U+1]!=="text"||!Zi(O[U])||!Zi(O[U+1]))continue;const j=Pne(O[U]);j!==null&&(O[U]=j.head,O[U+1]=j.tail+O[U+1],ie[U+1]=ie[U]+j.head.length)}return{len:O.length,texts:O,isWordLike:q,kinds:X,starts:ie}})((function(L){const O=[],q=[],X=[],ie=[];let U=0;for(;U<L.len;){const j=L.texts[U],te=L.kinds[U],ae=L.isWordLike[U];if(te==="text"){const oe=[j];let re=U+1,xe=ae;for(;re<L.len&&L.kinds[re]==="text"&&ese(L.texts[re-1],L.isWordLike[re-1],L.texts[re],L.isWordLike[re]);){const pe=L.texts[re];oe.push(pe),xe=xe||L.isWordLike[re],re++}if(re>U+1){O.push(xi(oe)),q.push(xe),X.push("text"),ie.push(L.starts[U]),U=re;continue}}O.push(j),q.push(ae),X.push(te),ie.push(L.starts[U]),U++}return{len:O.length,texts:O,isWordLike:q,kinds:X,starts:ie}})((function(L){const O=[],q=[],X=[],ie=[];for(let U=0;U<L.len;U++){const j=L.texts[U];if(L.kinds[U]==="text"&&j.includes("-")){const te=j.split("-");let ae=te.length>1;for(let oe=0;oe<te.length;oe++){const re=te[oe];if(!ae)break;re.length!==0&&u4(re)&&Ep(re)||(ae=!1)}if(ae){let oe=0;for(let re=0;re<te.length;re++){const xe=te[re],pe=re<te.length-1?`${xe}-`:xe;O.push(pe),q.push(!0),X.push("text"),ie.push(L.starts[U]+oe),oe+=pe.length}continue}}O.push(j),q.push(L.isWordLike[U]),X.push(L.kinds[U]),ie.push(L.starts[U])}return{len:O.length,texts:O,isWordLike:q,kinds:X,starts:ie}})((function(L){const O=[],q=[],X=[],ie=[];for(let U=0;U<L.len;U++){const j=L.texts[U],te=L.kinds[U];if(te==="text"&&Ep(j)&&u4(j)){const ae=[j];let oe=U+1;for(;oe<L.len&&L.kinds[oe]==="text"&&Ep(L.texts[oe]);)ae.push(L.texts[oe]),oe++;O.push(xi(ae)),q.push(!0),X.push("text"),ie.push(L.starts[U]),U=oe-1;continue}O.push(j),q.push(L.isWordLike[U]),X.push(te),ie.push(L.starts[U])}return{len:O.length,texts:O,isWordLike:q,kinds:X,starts:ie}})((function(L){const O=[],q=[],X=[],ie=[];for(let U=0;U<L.len;U++){const j=L.texts[U];if(O.push(j),q.push(L.isWordLike[U]),X.push(L.kinds[U]),ie.push(L.starts[U]),!Yne(j))continue;const te=U+1;if(te>=L.len||Xg(L.kinds[te]))continue;const ae=[],oe=L.starts[te];let re=te;for(;re<L.len&&!Xg(L.kinds[re]);)ae.push(L.texts[re]),re++;ae.length>0&&(O.push(xi(ae)),q.push(!0),X.push("text"),ie.push(oe),U=re-1)}return{len:O.length,texts:O,isWordLike:q,kinds:X,starts:ie}})((function(L){const O=L.texts.slice(),q=L.isWordLike.slice(),X=L.kinds.slice(),ie=L.starts.slice();for(let j=0;j<L.len;j++){if(X[j]!=="text"||!Gne(L,j))continue;const te=[O[j]];let ae=j+1;for(;ae<L.len&&!Xg(X[ae]);){te.push(O[ae]),q[j]=!0;const oe=O[ae].includes("?");if(X[ae]="text",O[ae]="",ae++,oe)break}O[j]=xi(te)}let U=0;for(let j=0;j<O.length;j++){const te=O[j];te.length!==0&&(U!==j&&(O[U]=te,q[U]=q[j],X[U]=X[j],ie[U]=ie[j]),U++)}return O.length=U,q.length=U,X.length=U,ie.length=U,{len:U,texts:O,isWordLike:q,kinds:X,starts:ie}})((function(L){const O=[],q=[],X=[],ie=[];let U=0;for(;U<L.len;){const j=[L.texts[U]];let te=L.isWordLike[U],ae=L.kinds[U],oe=L.starts[U];if(ae==="glue"){const re=[j[0]],xe=oe;for(U++;U<L.len&&L.kinds[U]==="glue";)re.push(L.texts[U]),U++;const pe=xi(re);if(!(U<L.len&&L.kinds[U]==="text")){O.push(pe),q.push(!1),X.push("glue"),ie.push(xe);continue}j[0]=pe,j.push(L.texts[U]),te=L.isWordLike[U],ae="text",oe=xe,U++}else U++;if(ae==="text")for(;U<L.len&&L.kinds[U]==="glue";){const re=[];for(;U<L.len&&L.kinds[U]==="glue";)re.push(L.texts[U]),U++;const xe=xi(re);U<L.len&&L.kinds[U]==="text"?(j.push(xe,L.texts[U]),te=te||L.isWordLike[U],U++):j.push(xe)}O.push(xi(j)),q.push(te),X.push(ae),ie.push(oe)}return{len:O.length,texts:O,isWordLike:q,kinds:X,starts:ie}})({len:z,texts:y,isWordLike:g,kinds:v,starts:b})))))));for(let L=0;L<W.len-1;L++){const O=zne(W.texts[L]);O!==null&&(W.kinds[L]!=="space"&&W.kinds[L]!=="preserved-space"||W.kinds[L+1]!=="text"||!i4(W.texts[L+1])||(W.texts[L]=O.space,W.isWordLike[L]=!1,W.kinds[L]=W.kinds[L]==="preserved-space"?"preserved-space":"space",W.texts[L+1]=O.marks+W.texts[L+1],W.starts[L+1]=W.starts[L]+O.space.length))}return W})(i,t,o),l=s==="keep-all"?(function(a,c,u){if(c.len<=1)return c;const d=[],f=[],h=[],p=[];let m=-1,y=!1;function k(v){d.push(c.texts[v]),f.push(c.isWordLike[v]),h.push("text"),p.push(c.starts[v])}function g(v){if(!(m<0)){if(y)m+1===v?k(m):(function(b,C){let I=!1;for(let $=b;$<C;$++)I=I||c.isWordLike[$];const T=c.starts[b],M=C<c.len?c.starts[C]:a.length;d.push(a.slice(T,M)),f.push(I),h.push("text"),p.push(T)})(m,v);else for(let b=m;b<v;b++)k(b);m=-1,y=!1}}for(let v=0;v<c.len;v++){const b=c.texts[v],C=c.kinds[v];C!=="text"?(g(v),d.push(b),f.push(c.isWordLike[v]),h.push(C),p.push(c.starts[v])):(m>=0&&!Z8(c.texts[v-1],u)&&g(v),m<0&&(m=v),y=y||Zi(b))}return g(c.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:p}})(i,r,t.breakKeepAllAfterPunctuation):r;return st({normalized:i,chunks:tse(l,o)},l)}let yc=null;const d4=new Map;let kc=null;const sse=new RegExp("\\p{Emoji_Presentation}","u"),ose=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Qg=null;const f4=new Map;function Py(){if(yc!==null)return yc;if(typeof OffscreenCanvas<"u")return yc=new OffscreenCanvas(1,1).getContext("2d"),yc;if(typeof document<"u")return yc=document.createElement("canvas").getContext("2d"),yc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ol(e,t){let n=t.get(e);return n===void 0&&(n={width:Py().measureText(e).width,containsCJK:Zi(e)},t.set(e,n)),n}function Nm(){if(kc!==null)return kc;if(typeof navigator>"u")return kc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},kc;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 kc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},kc}function Q8(){return Qg===null&&(Qg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Qg}function ise(e){return sse.test(e)||e.includes("️")}function oa(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=Q8();for(const a of l.segment(i))ise(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function rse(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function h4(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function p4(e,t,n=e.widths.length){for(;t<n&&rse(e.kinds[t]);)t++;return t}function lse(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function ase(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function L2(e,t){return t===0?0:e+t}function cse(e,t,n,s,o){return L2(s,t==="tab"?o+(function(i,r){return i.letterSpacing!==0&&i.spacingGraphemeCounts[r]>0?i.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function m4(e,t,n,s){return L2(s,t==="tab"?0:e.lineEndFitAdvances[n])}function g4(e,t,n,s,o){return L2(s,t==="tab"?o:e.lineEndPaintAdvances[n])}function use(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function dse(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function jh(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function fse(e,t){return(function(n,s){if(n.simpleLineWalkFastPath)return(function(_,R){const{widths:z,kinds:W,breakableFitAdvances:L,breakablePreferredBreaks:O}=_;if(z.length===0)return 0;const q=R+Nm().lineFitEpsilon;let X=0,ie=0,U=!1,j=0,te=0,ae=-1,oe=0;function re(Q=j,P=te,G=ie){X++,ie=0,U=!1,ae=-1,oe=0}function xe(Q,P){U=!0,j=Q+1,te=0,ie=P}function pe(Q,P,G){U=!0,j=Q,te=P+1,ie=G}function Ee(Q,P){U?(ie+=P,j=Q+1,te=0):xe(Q,P)}function ue(Q,P){var G;const ye=L[Q],he=(G=O[Q])!=null?G:null;let fe=he===null?-1:jh(he,0,P+1),K=-1,ne=0,me=P;for(;me<ye.length;){const we=ye[me];if(U)if(ie+we>q){if(he!==null&&K>P){re(Q,K,ne),me=K,fe=jh(he,fe,me+1),K=-1,ne=0;continue}re(),pe(Q,me,we)}else ie+=we,j=Q,te=me+1;else pe(Q,me,we);const Te=me+1;he!==null&&he[fe]===Te&&(K=Te,ne=ie,fe++),me++}U&&j===Q&&te===ye.length&&(j=Q+1,te=0)}let Y=0;for(;Y<z.length&&(U||(Y=p4(_,Y),!(Y>=z.length)));){const Q=z[Y],P=h4(W[Y]);if(U)if(ie+Q>q){if(P){Ee(Y,Q),re(Y+1,0,ie-Q),Y++;continue}if(ae>=0){if(j>ae||j===ae&&te>0){re();continue}re(ae,0,oe);continue}if(Q>q&&L[Y]!==null){re(),ue(Y,0),Y++;continue}re()}else Ee(Y,Q),P&&(ae=Y+1,oe=ie-Q),Y++;else Q>q&&L[Y]!==null?ue(Y,0):xe(Y,Q),P&&(ae=Y+1,oe=ie-Q),Y++}return U&&re(),X})(n,s);const{widths:o,kinds:i,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:c}=n;if(o.length===0||c.length===0)return 0;const u=Nm(),d=s+u.lineFitEpsilon;let f=0,h=0,p=!1,m=0,y=0,k=-1,g=0,v=null;function b(){k=-1,g=0,v=null}function C(_=m,R=y,z){f++,h=0,p=!1,b()}function I(_,R){p=!0,m=_+1,y=0,h=R}function T(_,R,z){p=!0,m=_,y=R+1,h=z}function M(_,R){p?(h+=R,m=_+1,y=0):I(_,R)}function $(_,R,z,W,L,O){if(!R)return;const q=m4(n,_,z,L);g4(n,_,z,L,W),k=z+1,g=h-O+q,v=_}function N(_,R){var z;const W=r[_],L=(z=l[_])!=null?z:null;let O=L===null?-1:jh(L,0,R+1),q=-1,X=R;for(;X<W.length;){const ie=W[X];if(p){const j=use(n,!0,ie),te=h+j;if(dse(n,te)>d){if(L!==null&&q>R){C(_,q),X=q,O=jh(L,O,X+1),q=-1;continue}C(),T(_,X,ie)}else h=te,m=_,y=X+1}else T(_,X,ie);const U=X+1;L!==null&&L[O]===U&&(q=U,O++),X++}p&&m===_&&y===W.length&&(m=_+1,y=0)}function F(_){f++,b()}for(let _=0;_<c.length;_++){const R=c[_];if(R.startSegmentIndex===R.endSegmentIndex){F();continue}p=!1,h=0,R.startSegmentIndex,m=R.startSegmentIndex,y=0,b();let z=R.startSegmentIndex;for(;z<R.endSegmentIndex&&(p||(z=p4(n,z,R.endSegmentIndex),!(z>=R.endSegmentIndex)));){const W=i[z],L=h4(W),O=ase(n,p,z),q=W==="tab"?lse(h+O,n.tabStopAdvance):o[z],X=O+q,ie=cse(n,W,z,O,q);if(W!=="soft-hyphen")if(p){if(h+ie>d){const U=h+m4(n,W,z,O);if(g4(n,W,z,O,q),v==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&g<=d){C(k,0);continue}if(L&&U<=d){M(z,X),C(z+1,0),z++;continue}if(k>=0&&g<=d){if(m>k||m===k&&y>0){C();continue}const j=k;C(j,0),z=j;continue}if(ie>d&&r[z]!==null){C(),N(z,0),z++;continue}C();continue}M(z,X),$(W,L,z,q,O,X),z++}else ie>d&&r[z]!==null?N(z,0):I(z,q),$(W,L,z,q,O,X),z++;else p&&(m=z+1,y=0,k=z+1,g=h+a,v=W),z++}p&&(R.consumedEndSegmentIndex,C(R.consumedEndSegmentIndex,0))}return f})(e,t)}let Jg=null;function $2(){return Jg===null&&(Jg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Jg}function hse(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=Dy(d),l=P1.has(d)}function u(d,f){s.push(d),i=i||f;const h=Dy(d);r=d.length===1&&Da.has(d)&&r||h,l=!1}for(const d of $2().segment(e)){const f=d.segment,h=Zi(f);s.length!==0?l||T2.has(f)||Da.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 pse(e,t,n){if(t.length<=1)return t;const s=[];let o=-1,i=!1;function r(l){if(!(o<0)){if(i)o+1===l?s.push(t[o]):(function(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;s.push({text:e.slice(u,d),start:u})})(o,l);else for(let a=o;a<l;a++)s.push(t[a]);o=-1,i=!1}}for(let l=0;l<t.length;l++){const a=t[l];o>=0&&!Z8(t[l-1].text,n)&&r(l),o<0&&(o=l),i=i||Zi(a.text)}return r(t.length),s}function v4(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const s=$2();for(const o of s.segment(e))n++;return n}function mse(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function gse(e,t,n,s,o){const i=Nm(),{cache:r,emojiCorrection:l}=(function(F,_){Py().font=F;const R=(function(L){let O=d4.get(L);return O||(O=new Map,d4.set(L,O)),O})(F),z=(function(L){const O=L.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(F),W=_?(function(L,O){let q=f4.get(L);if(q!==void 0)return q;const X=Py();X.font=L;const ie=X.measureText("😀").width;if(q=0,ie>O+.5&&typeof document<"u"&&document.body!==null){const U=document.createElement("span");U.style.font=L,U.style.display="inline-block",U.style.visibility="hidden",U.style.position="absolute",U.textContent="😀",document.body.appendChild(U);const j=U.getBoundingClientRect().width;document.body.removeChild(U),ie-j>.5&&(q=ie-j)}return f4.set(L,q),q})(F,z):0;return{cache:R,fontSize:z,emojiCorrection:W}})(t,(a=e.normalized,ose.test(a)));var a;const c=oa("-",ol("-",r),l)+(o===0?0:2*o),u=8*oa(" ",ol(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],p=[],m=[];let y=e.chunks.length<=1&&!d;const k=null,g=[],v=[],b=[],C=null,I=Array.from({length:e.len});function T(F,_,R,z,W,L,O,q,X){W!=="text"&&W!=="space"&&W!=="zero-width-break"&&(y=!1),f.push(_),h.push(R),p.push(z),m.push(W),g.push(O),v.push(q),d&&b.push(X)}function M(F,_,R,z,W){const L=ol(F,r),O=d?v4(F,_):0,q=(function(j,te,ae){return te>1?j+(te-1)*ae:j})(oa(F,L,l),O,o),X=_==="space"||_==="preserved-space"||_==="zero-width-break"?0:q,ie=X===0?0:X+(O>0?o:0),U=_==="space"||_==="zero-width-break"?0:q;if(W&&z&&F.length>1){let j="sum-graphemes";o!==0?j="segment-prefixes":Ep(F)?j="pair-context":i.preferPrefixWidthsForBreakableRuns&&(j="segment-prefixes");const te=(function(oe,re,xe,pe,Ee){if(re.breakableFitAdvances!==void 0&&re.breakableFitMode===Ee)return re.breakableFitAdvances;re.breakableFitMode=Ee;const ue=Q8(),Y=[];for(const ye of ue.segment(oe))Y.push(ye.segment);if(Y.length<=1)return re.breakableFitAdvances=null,re.breakableFitAdvances;if(Ee==="sum-graphemes"){const ye=[];for(const he of Y){const fe=ol(he,xe);ye.push(oa(he,fe,pe))}return re.breakableFitAdvances=ye,re.breakableFitAdvances}if(Ee==="pair-context"||Y.length>96){const ye=[];let he=null,fe=0;for(const K of Y){const ne=oa(K,ol(K,xe),pe);if(he===null)ye.push(ne);else{const me=he+K,we=ol(me,xe);ye.push(oa(me,we,pe)-fe)}he=K,fe=ne}return re.breakableFitAdvances=ye,re.breakableFitAdvances}const Q=[];let P="",G=0;for(const ye of Y){P+=ye;const he=oa(P,ol(P,xe),pe);Q.push(he-G),G=he}return re.breakableFitAdvances=Q,re.breakableFitAdvances})(F,L,r,l,j),ae=te===null||s==="keep-all"?null:(function(oe){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(oe))return null;const re=[];let xe=0;for(const pe of $2().segment(oe))xe++,mse(pe.segment)&&re.push(xe);return re.length===0?null:re})(F);return void T(F,q,ie,U,_,R,te,ae,O)}T(F,q,ie,U,_,R,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const _=e.texts[F],R=e.isWordLike[F],z=e.kinds[F],W=e.starts[F];if(z==="soft-hyphen"){T(_,0,c,c,z,W,null,null,0);continue}if(z==="hard-break"){T(_,0,0,0,z,W,null,null,0);continue}if(z==="tab"){T(_,0,0,0,z,W,null,null,d?v4(_,z):0);continue}const L=ol(_,r);if(z==="text"&&L.containsCJK){const O=hse(_,i),q=s==="keep-all"?pse(_,O,i.breakKeepAllAfterPunctuation):O;for(let X=0;X<q.length;X++){const ie=q[X];M(ie.text,"text",W+ie.start,R,s==="keep-all"||!Zi(ie.text))}continue}M(_,z,W,R,!0)}const $=(function(F,_,R){const z=[];for(let W=0;W<F.length;W++){const L=F[W],O=L.startSegmentIndex<_.length?_[L.startSegmentIndex]:R,q=L.endSegmentIndex<_.length?_[L.endSegmentIndex]:R,X=L.consumedEndSegmentIndex<_.length?_[L.consumedEndSegmentIndex]:R;z.push({startSegmentIndex:O,endSegmentIndex:q,consumedEndSegmentIndex:X})}return z})(e.chunks,I,f.length),N=k===null?null:(function(F,_){const R=(function(W){const L=W.length;if(L===0)return null;const O=new Array(L);let q=!1;for(let ae=0;ae<L;){const oe=W.charCodeAt(ae);let re=oe,xe=1;if(oe>=55296&&oe<=56319&&ae+1<L){const Ee=W.charCodeAt(ae+1);Ee>=56320&&Ee<=57343&&(re=Ee-56320+(oe-55296<<10)+65536,xe=2)}const pe=Cne(re);pe!=="R"&&pe!=="AL"&&pe!=="AN"||(q=!0);for(let Ee=0;Ee<xe;Ee++)O[ae+Ee]=pe;ae+=xe}if(!q)return null;let X=0;for(let ae=0;ae<L;ae++){const oe=O[ae];if(oe==="L"){X=0;break}if(oe==="R"||oe==="AL"){X=1;break}}const ie=new Int8Array(L);for(let ae=0;ae<L;ae++)ie[ae]=X;const U=1&X?"R":"L",j=U;let te=j;for(let ae=0;ae<L;ae++)O[ae]==="NSM"?O[ae]=te:te=O[ae];te=j;for(let ae=0;ae<L;ae++){const oe=O[ae];oe==="EN"?O[ae]=te==="AL"?"AN":"EN":oe!=="R"&&oe!=="L"&&oe!=="AL"||(te=oe)}for(let ae=0;ae<L;ae++)O[ae]==="AL"&&(O[ae]="R");for(let ae=1;ae<L-1;ae++)O[ae]==="ES"&&O[ae-1]==="EN"&&O[ae+1]==="EN"&&(O[ae]="EN"),O[ae]!=="CS"||O[ae-1]!=="EN"&&O[ae-1]!=="AN"||O[ae+1]!==O[ae-1]||(O[ae]=O[ae-1]);for(let ae=0;ae<L;ae++){if(O[ae]!=="EN")continue;let oe;for(oe=ae-1;oe>=0&&O[oe]==="ET";oe--)O[oe]="EN";for(oe=ae+1;oe<L&&O[oe]==="ET";oe++)O[oe]="EN"}for(let ae=0;ae<L;ae++){const oe=O[ae];oe!=="WS"&&oe!=="ES"&&oe!=="ET"&&oe!=="CS"||(O[ae]="ON")}te=j;for(let ae=0;ae<L;ae++){const oe=O[ae];oe==="EN"?O[ae]=te==="L"?"L":"EN":oe!=="R"&&oe!=="L"||(te=oe)}for(let ae=0;ae<L;ae++){if(O[ae]!=="ON")continue;let oe=ae+1;for(;oe<L&&O[oe]==="ON";)oe++;const re=(ae>0?O[ae-1]:j)!=="L"?"R":"L";if(re===((oe<L?O[oe]:j)!=="L"?"R":"L"))for(let xe=ae;xe<oe;xe++)O[xe]=re;ae=oe-1}for(let ae=0;ae<L;ae++)O[ae]==="ON"&&(O[ae]=U);for(let ae=0;ae<L;ae++){const oe=O[ae];1&ie[ae]?oe!=="L"&&oe!=="AN"&&oe!=="EN"||ie[ae]++:oe==="R"?ie[ae]++:oe!=="AN"&&oe!=="EN"||(ie[ae]+=2)}return ie})(F);if(R===null)return null;const z=new Int8Array(_.length);for(let W=0;W<_.length;W++)z[W]=R[_[W]];return z})(e.normalized,k);return C!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$,segments:C}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$}}const ev="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",vse=["diff ","index ","--- ","+++ ","@@ "],vs=(()=>{const e=globalThis;if(e[ev])return e[ev];const t={configs:{},controllers:{},revision:tr(0),preparedCache:new Map,blockEstimateCache:new Map};return e[ev]=t,t})();let nd=null;const tv=vs.revision;function y4(e){var t;return e&&(t=vs.configs[e])!=null?t:null}function k4(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function yse(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function nv(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!yse(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+=`
|
|
288
|
+
`)}return o.length>0?o:null}function sv(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(nd!=null)return nd;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return nd=!!((i=r.getContext)!=null&&i.call(r,"2d")),nd}catch{return nd=!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=vs.blockEstimateCache.get(r);if(l)return vs.blockEstimateCache.delete(r),vs.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 y=`${m}\0${p}\0${h}`,k=vs.preparedCache.get(y);if(k)return vs.preparedCache.delete(y),vs.preparedCache.set(y,k),k.prepared;const g=(function(v,b,C){return(function(I,T,M,$){var N,F;const _=(N=$?.wordBreak)!=null?N:"normal",R=(F=$?.letterSpacing)!=null?F:0;return gse(nse(I,Nm(),$?.whiteSpace,_),T,!1,_,R)})(v,b,0,C)})(h,p,{whiteSpace:m});for(vs.preparedCache.set(y,{prepared:g});vs.preparedCache.size>240;){const v=vs.preparedCache.keys().next().value;if(!v)break;vs.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const y=fse(h,p);return{lineCount:y,height:y*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(vs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});vs.blockEstimateCache.size>4e3;){const h=vs.blockEstimateCache.keys().next().value;if(!h)break;vs.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function J8(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=nv(e.children);return i&&n.paragraph?sv(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=nv(e.children),l=n.headings[i];return r&&l?sv(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=nv((o=i[0])==null?void 0:o.children);return r?sv(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=J8(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function sd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function ia(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function ov(e,t,n=0){return e.diff?M2(t??{},n)?(function(s){const o=ia(s.raw);if(o){const i=o.split(/\r?\n/);return s.originalCode!=null||s.updatedCode!=null?Math.max(1,i.filter(r=>!vse.some(l=>r.startsWith(l))).length):Math.max(1,i.length)}return sd(ia(s.originalCode))+sd(ia(s.updatedCode))})(e):(function(s){const o=s.originalCode,i=s.updatedCode;if(o!=null||i!=null)return Math.max(sd(ia(o)),sd(ia(i)));const r=ia(s.code).split(/\r?\n/);let l=0,a=0;for(const c of r)c.startsWith("+")&&!c.startsWith("+++")?a++:c.startsWith("-")&&!c.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):sd(ia(e.code,e.loading===!0))}function kse(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function iv(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=k4(s.lineHeight,1.5*k4(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:kse(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const bse=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function b4(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))bse.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}function x4(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)}function w4(e,t){let n=0,s=null,o=null;const i=()=>{const r=o;o=null,s=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(s&&(clearTimeout(s),s=null),n=l,o=null,e(...r)):s||(s=setTimeout(i,a))}}function _4(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const eE=Symbol("MarkstreamMathBlockMinHeightCache");function d4e(){return jt(eE,null)}const xse=new Set(["text","inline_code","emoji","footnote_reference"]),wse=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function od(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function ra(e,t,n,s=22){const o=String(e??"");if(!o)return n;const i=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/i),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*s+12))}function tE(e){var t;if(!e||typeof e!="object")return!1;const n=e,s=String((t=n.type)!=null?t:"");if(xse.has(s))return!0;if(!wse.has(s))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(tE)}function Hy(e){var t,n,s,o,i,r,l,a;if(!e||typeof e!="object")return"";const c=e,u=String((t=c.type)!=null?t:"");if(u==="text")return String((s=(n=c.content)!=null?n:c.raw)!=null?s:"");if(u==="inline_code")return String((r=(i=(o=c.code)!=null?o:c.content)!=null?i:c.raw)!=null?r:"");if(u==="emoji")return String((a=(l=c.name)!=null?l:c.raw)!=null?a:"");if(typeof c.text=="string")return c.text;const d=[];for(const f of["children","items","cells","rows"]){const h=c[f];if(Array.isArray(h)){const p=h.map(Hy).filter(Boolean).join(" ");p&&d.push(p)}}return d.join(" ").replace(/\s+/g," ").trim()}function nE(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const s=t[n];return Array.isArray(s)&&s.some(nE)})}function _se(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),s=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),i=Math.max(1,s,o);return 30+26*Math.max(0,i-1)}function Sse(e,t){var n,s,o,i,r,l,a,c,u,d,f,h,p,m;if(!e||typeof e!="object")return 32;const y=e,k=String((n=y.type)!=null?n:""),g=Number.isFinite(t)&&t>0?t:640;switch(k){case"heading":return(function(v){var b;const C=Number((b=v.level)!=null?b:v.depth);return C>=4?20:C===3?30:C===2?32:44})(y);case"paragraph":return(function(v,b){const C=String(v??"");if(!C)return 28;const I=Math.max(18,Math.floor(Math.max(320,b)/8)),T=C.split(/\r?\n/).length,M=Math.ceil(C.length/I);return Math.max(1,T,M)<=1?28:ra(C,b,34)})(String((o=(s=y.raw)!=null?s:y.content)!=null?o:""),g);case"list":return(function(v,b){var C;const I=Array.isArray(v.items)?v.items:[];if(!I.length)return 48;const T=Math.max(48,30*I.length+12);let M=12;for(const F of I)M+=_se(Hy(F)||String((C=F.raw)!=null?C:""),b);const $=Math.max(0,M-T);if(I.length>20){const F=Math.round(2.4*I.length);return Math.round(T+Math.max(F,Math.min($,3*I.length)))}if($<=0)return T;const N=I.length>8?8*I.length:$;return Math.round(T+Math.min($,N))})(y,g);case"list_item":return ra(String((r=(i=y.raw)!=null?i:y.content)!=null?r:""),g,34);case"blockquote":return ra(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),g,56);case"table":return(function(v,b){const C=[...v.header?[v.header]:[],...Array.isArray(v.rows)?v.rows:[]];if(!C.length){const I=Array.isArray(v.children)?v.children.length:3;return Math.max(120,38*I+48)}return Math.max(120,Math.round(4+C.reduce((I,T)=>I+(function(M,$){const N=Math.max(1,M.length),F=Math.max(80,($-32)/N),_=Math.max(10,Math.floor(F/8)),R=Math.max(1,...M.map(z=>{var W;const L=Hy(z)||String((W=z?.raw)!=null?W:"");return Math.ceil(L.length/_)||1}));return 54+34*Math.max(0,R-1)+(N<=3&&M.some(nE)?14:0)})((function(M){var $;return Array.isArray(M?.cells)&&($=M.cells)!=null?$:[]})(T),b),0)))})(y,g);case"code_block":{const v=String((c=y.language)!=null?c:"").trim().toLowerCase(),b=String((d=(u=y.code)!=null?u:y.raw)!=null?d:"");return v==="mermaid"?wm(bm(b)):v==="infographic"?_m(xm(b)):ra(b,g,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(v,b){var C,I,T;const M=v.match(/^\s*<details\b([^>]*)>/i);return M&&!/(?:^|\s)open(?:\s|=|$)/i.test((C=M[1])!=null?C:"")?ra(((T=(I=v.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i))==null?void 0:I[1])==null?void 0:T.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):ra(v,b,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),g);case"thematic_break":return 24;default:return ra(String((m=(p=y.raw)!=null?p:y.content)!=null?m:""),g,40)}}function S4(e,t,n){return Math.min(Math.max(e,t),n)}const Cse=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Ase=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","parseMarkdownToStructureTotalMs"],Mse=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),sE=["raw","content","code","originalCode","updatedCode"],C4=new WeakMap,A4=new WeakMap;let Ese=1;function ki(){return typeof performance<"u"?performance.now():Date.now()}function M4(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function qo(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=C4.get(t);return n||(n=Ese++,C4.set(t,n)),String(n)}function E4(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:qo(t),customMarkdownIt:qo(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:qo(e.validateLink),preTransformTokens:qo(e.preTransformTokens),postTransformTokens:qo(e.postTransformTokens),postTransformNodes:qo(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function T4(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
289
|
+
`,t-1)+1;return e.slice(n,t).trim()}function N4(e){const t=oE(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function oE(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function iE(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 F2(e){const t=String(e??"");return`${t.length}:${iE(t)}`}function Wy(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?F2(r):`${r.length}:${iE(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${qo(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:${qo(s)}`;const i=qo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Wy(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}:${Wy(r[c],t,n+1)}`).join(";")}`}return typeof e}function Im(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function rE(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Im(s)?$l(s,t,n+1):rE(s,t,n+1)).join(",")}`:Im(e)?$l(e,t,n):Wy(e,t,n)}function Tse(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!sE.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${F2(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${qo(o)}`:Mse.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${rE(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${qo(o)}`:""}).filter(Boolean).join(";")}function Nse(e){return sE.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${F2(n)}`:""}).filter(Boolean).join(";")}function $l(e,t=new WeakMap,n=0){const s=A4.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}:${qo(o)}`;const r=qo(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=>$l(p,c,u+1)).join("|"):"";return[a.type,Nse(d),Tse(d,c,u),f.length,h].join(":")})(e,t,n);return A4.set(o,l),l}function lE(e,t){return $l(e)===$l(t)}function O2(e,t,n){const s=ki(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ki()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function I4(e,t,n){return O2(t,n,()=>$l(e))}function aE(e,t,n){return I4(e,n,"stabilizeSignatureMs")===I4(t,n,"stabilizeSignatureMs")}function Vh(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function L4(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function $4(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function Ise(e,t){return e.length===t.length&&e===t}function R2(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"||!Ise(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(!Im(d)||!Im(f))return null;const h=R2(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function Lse(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=R2(e,t);return n??lE(e,t)}function $se(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return O2(n,"stabilizeSignatureMs",()=>{s=R2(e,t)}),s??aE(e,t,n)}function Fse(e,t){const n={};for(const s of Cse){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function Ose(e,t){var n;const s=NC(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=se(t.renderContent.value);let l=[],a="",c="",u="",d=!1;const f=(function(){let z="",W=0,L=!1,O=!1,q=!1,X=!1;function ie(){z="",W=0,L=!1,O=!1,q=!1,X=!1}function U(j){let te=!1;for(let ae=0;ae<j.length;ae++){const oe=j.charCodeAt(ae);if(oe===10||oe===13){const xe=oe===10&&X;X=oe===13,L=!1,xe||(q||(O=!1,W=0),q=!1);continue}X=!1;const re=oe===9||oe===32;if(re||(q=!0,O&&(te=!0)),W)if(W!==1)re||(oe!==58?W=oe===91?1:0:(te=!0,O=!0));else{if(L){L=!1;continue}if(oe===92){L=!0;continue}oe===93&&(W=2)}else oe===91&&(W=1)}return te}return(j,te)=>{if(!j||!te.startsWith(j)||te.length<=j.length)return ie(),[!0,0];let ae=0;z!==j&&(ie(),U(j),ae=j.length);const oe=te.slice(j.length),re=U(oe);return z=te,[re,ae+oe.length]}})();let h,p=0,m=0,y=ki(),k=-1,g=0;function v(z){k=Number.isInteger(z)?z:0,g+=1}function b(){h&&(clearTimeout(h),h=void 0)}function C(){b();const z=t.renderContent.value;r.value!==z&&(r.value=z),y=ki()}Je([t.renderContent,t.effectiveFinal,i],([z,W,L])=>{r.value!==z&&(!L||W||(function(O,q){if(!O&&q||q.length<=80||q.length<O.length||!q.startsWith(O))return!0;const X=q.slice(O.length);return!!X&&(!!N4(T4(q))||!(!X.includes(`
|
|
290
|
+
|
|
291
|
+
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(X))||X.endsWith(`
|
|
292
|
+
`)&&!(function(ie){const U=T4(ie);if(N4(U))return!1;const j=oE(U);return j.length>=2&&j.some(te=>te.trim())})(q))})(r.value,z)?C():(function(){if(m+=1,h)return;const O=Math.max(0,(function(q){const X=q.parseCoalesceMs;return typeof X=="number"&&Number.isFinite(X)&&X>=0?X:80})(e)-(ki()-y));O<=0?C():h=setTimeout(C,O)})())},{flush:"sync",immediate:!0}),bf(b);const I=D(()=>{var z,W,L,O;return jG(e.customHtmlTags,(z=e.parseOptions)==null?void 0:z.customHtmlTags,(O=(L=(W=t.customComponentsMap)==null?void 0:W.value)!=null?L:{},Object.entries(O).map(([q,X])=>{const ie=mi(q);return X==null||!ie||Ff(ie)||g5.has(ie)||Tf.has(ie)?"":ie}).filter(Boolean)))}),T=D(()=>{const{key:z,tags:W}=VG(I.value);if(!z)return s;const L=o.get(z);if(L)return L;const O=NC(t.instanceMsgId,{customHtmlTags:W});return o.set(z,O),O}),M=D(()=>{const z=T.value;if(!e.customMarkdownIt)return z;const W=e.customMarkdownIt(z);return z.__markstreamHasCustomParserExtensions=!0,W.__markstreamHasCustomParserExtensions=!0,W}),$=D(()=>{var z,W;const L=(z=e.parseOptions)!=null?z:{},O=t.effectiveFinal.value,q=I.value,X=O!=null,ie=q.length>0;return X||ie||L.streamParse==null?st(st(Rt(st({},L),{streamParse:(W=L.streamParse)==null||W}),X?{final:O}:{}),ie?{customHtmlTags:q}:{}):L}),N=D(()=>{var z;return new Set(((z=$.value.customHtmlTags)!=null?z:[]).map(W=>String(W).trim().toLowerCase()).filter(Boolean))}),F=D(()=>E4($.value,M.value,e.customMarkdownIt,{includeFinal:!0})),_=D(()=>E4($.value,M.value,e.customMarkdownIt,{includeFinal:!1}));Je([F,_],([z,W],[L,O])=>{L&&(z===L&&W===O||(C(),W!==O&&(l=[],u="")))},{flush:"sync"});const R=D(()=>{var z,W,L,O,q,X,ie,U,j,te,ae;if((z=e.nodes)!=null&&z.length)return l=[],u="",v(0),vt(e.nodes.slice());const oe=r.value;if(!oe)return l=[],u="",v(-1),[];const re=t.debugPerformanceEnabled.value,xe=re?ki():0,pe=M.value,Ee=F.value,ue=_.value;a&&Ee!==a&&(function(Qe){var ot,at;(at=(ot=Qe.stream)==null?void 0:ot.reset)==null||at.call(ot)})(pe),c&&ue!==c&&(l=[],u="");const Y=Object.keys((L=(W=t.customComponentsMap)==null?void 0:W.value)!=null?L:{}).length>0||typeof $.value.postTransformNodes=="function";Y!==d&&(l=[],u="");const Q=!Y&&l.length>0&&oe.startsWith(u)&&ue===c,P=re?M4(pe):null,G=re?{}:void 0,ye=$4(pe),he=!ye&&!Y,fe=st(st(Rt(st({},$.value),{__reuseStableTopLevelNodes:he}),ye?{__disableStreamParse:!0}:{}),G?{__timing:G}:{}),K=v8(oe,pe,fe),ne=re?ki():0,me=re?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let we,Te=re?Vh(K.length):void 0,Pe=0,be=0,_e=0;if(Q){const Qe=re?ki():0,[ot,at]=(function(Et){var Tt,$t;const[rn,vn]=Et.scanGlobalReferenceAppend(Et.previousContent,Et.content),Ht=Et.parseOptions;return[Et.previousDirtyStartIndex>0&&Ht.final!==!0&&!Et.customMarkdownIt&&!$4(Et.md)&&!rn&&typeof Ht.preTransformTokens!="function"&&typeof Ht.postTransformTokens!="function"&&typeof Ht.postTransformNodes!="function"&&(($t=(Tt=Ht.customHtmlTags)==null?void 0:Tt.length)!=null?$t:0)===0?Et.previousDirtyStartIndex:0,vn]})({content:oe,previousContent:u,previousDirtyStartIndex:k,parseOptions:$.value,customMarkdownIt:e.customMarkdownIt,md:pe,scanGlobalReferenceAppend:f});_e=at;const ht=ot<=0;if(me){const Et=(function(Tt,$t,rn,vn={}){var Ht;if(!$t.length)return{nodes:Tt,metrics:Vh(Tt.length)};const Zt=(Ht=vn.scanStartIndex)!=null?Ht:0,tn=vn.reuseDirtyTail!==!1,Gt=(function(qe,It,Ut,Vt=0){const kn=Math.min(qe.length,It.length);for(let ft=Math.min(kn,Math.max(0,Vt));ft<kn;ft++)if(!$se(It[ft],qe[ft],Ut))return ft;return qe.length===It.length?-1:kn})(Tt,$t,rn,Zt);if(Gt<0)return{nodes:$t,metrics:{reusedNodeCount:Tt.length,dirtyStartIndex:Gt,stablePrefixNodeCount:Tt.length,dirtyTailNodeCount:0}};const An=Tt.slice();let Ye=Gt;for(let qe=0;qe<Gt;qe++)An[qe]=$t[qe];if(tn)for(let qe=Gt;qe<Tt.length;qe++){const It=$t[qe],Ut=Tt[qe];It&&aE(It,Ut,rn)&&(An[qe]=It,Ye+=1)}return{nodes:An,metrics:{reusedNodeCount:Ye,dirtyStartIndex:Gt,stablePrefixNodeCount:Gt,dirtyTailNodeCount:L4(Gt,Tt,$t)}}})(K,l,me,{reuseDirtyTail:ht,scanStartIndex:ot});we=Et.nodes,Te=Et.metrics}else{const Et=(function(Tt,$t,rn={}){var vn;if(!$t.length)return{nodes:Tt,metrics:Vh(Tt.length)};const Ht=(vn=rn.scanStartIndex)!=null?vn:0,Zt=rn.reuseDirtyTail!==!1,tn=(function(Ye,qe,It=0){const Ut=Math.min(Ye.length,qe.length);for(let Vt=Math.min(Ut,Math.max(0,It));Vt<Ut;Vt++)if(!Lse(qe[Vt],Ye[Vt]))return Vt;return Ye.length===qe.length?-1:Ut})(Tt,$t,Ht);if(tn<0)return{nodes:$t,metrics:{reusedNodeCount:Tt.length,dirtyStartIndex:tn,stablePrefixNodeCount:Tt.length,dirtyTailNodeCount:0}};const Gt=Tt.slice();let An=tn;for(let Ye=0;Ye<tn;Ye++)Gt[Ye]=$t[Ye];if(Zt)for(let Ye=tn;Ye<Tt.length;Ye++){const qe=$t[Ye],It=Tt[Ye];qe&&lE(qe,It)&&(Gt[Ye]=qe,An+=1)}return{nodes:Gt,metrics:{reusedNodeCount:An,dirtyStartIndex:tn,stablePrefixNodeCount:tn,dirtyTailNodeCount:L4(tn,Tt,$t)}}})(K,l,{reuseDirtyTail:ht,scanStartIndex:ot});we=Et.nodes,Te=Et.metrics}Pe=re?ki()-Qe:0,be=ht?Te?.dirtyStartIndex==null||Te.dirtyStartIndex<0?we.length:Te.dirtyStartIndex:we.length}else we=K,Te=Vh(we.length);t.effectiveFinal.value!==!0&&(me?(function(Qe,ot,at=0){for(let ht=Math.max(0,at);ht<Qe.length;ht++)O2(ot,"primeSignatureMs",()=>$l(Qe[ht]))})(we,me,be):(function(Qe,ot=0){for(let at=Math.max(0,ot);at<Qe.length;at++)$l(Qe[at])})(we,be));const Ke=re?ki()-ne:0;if(p+=1,u=oe,a=Ee,c=ue,d=Y,l=we,v((O=Te?.dirtyStartIndex)!=null?O:0),re){const Qe=M4(pe),ot=typeof Qe?.total=="number"&&Qe.total>((q=P?.total)!=null?q:0);t.logPerf(ot?"parse(stream)":"parse(sync)",st(st(st({rendererId:t.instanceMsgId,ms:Math.round(ki()-xe),nodes:we.length,contentLength:oe.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:Ke,referenceDefinitionScanChars:_e,signatureMs:(X=me?.signatureMs)!=null?X:0,stabilizeSignatureMs:(ie=me?.stabilizeSignatureMs)!=null?ie:0,primeSignatureMs:(U=me?.primeSignatureMs)!=null?U:0,signatureCallCount:(j=me?.signatureCallCount)!=null?j:0,stabilizeSignatureCallCount:(te=me?.stabilizeSignatureCallCount)!=null?te:0,primeSignatureCallCount:(ae=me?.primeSignatureCallCount)!=null?ae:0,stabilizeMs:Pe},Te??{}),G?Object.fromEntries(Ase.map(at=>{var ht;return[at,(ht=G[at])!=null?ht:0]})):{}),Qe?{streamMode:Qe.lastMode,streamDelta:Fse(Qe,P),streamStats:Qe}:{}))}return vt(we)});return{effectiveCustomHtmlTags:I,effectiveCustomHtmlTagsSet:N,mdBase:T,mdInstance:M,mergedParseOptions:$,getParsedNodesDirtyStartIndex:()=>k,getParsedNodesRevision:()=>g,parsedNodes:R}}function Rse(e){const{isClient:t}=e,n=se(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 y=n.value,k=y.has(f);if(h){if(k)return;const v=new Set(y);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(y);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 Bse(e={}){const t=se(""),n=se(""),s=se(!1),o=mee(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),c=D(()=>s.value&&a.value);return hk()&&bf(()=>{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 Dse={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},F4=/auto|scroll|overlay/i;function Pse(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return F4.test(t)||F4.test(n)}function Hse(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 Wse={class:"m-0 p-0"},zse=["data-probe"],Use=gn(Xe(Rt(st({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(s){var o,i;return(i=(o=t.headingNodes)==null?void 0:o[s])!=null?i:null}return(s,o)=>(x(),E("div",{class:"height-estimation-probes",style:Jt({width:`${e.width}px`}),"aria-hidden":"true"},[S("div",{ref:i=>e.setParagraphWrapper(i),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[ve(A(Ia),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),S("div",{ref:i=>e.setListItemWrapper(i),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[S("ul",Wse,[ve(A(tu),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),S("div",{ref:i=>e.setListWrapper(i),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[ve(A(nu),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(x(),E(De,null,rt(6,i=>S("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[ve(A(D1),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,zse)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),O4=Xe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return _m((s=Rc(e.estimatedPreviewHeightPx))!=null?s:xm(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Ft("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?Ft("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)"}},[Ft("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ft("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Ft("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Ft("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},()=>Ft("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,Ft("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Ft("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Ft("div",{class:"absolute inset-0"},[Ft("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),R4=Xe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return wm((s=Rc(e.estimatedPreviewHeightPx))!=null?s:bm(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Ft("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?Ft("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)"}},[Ft("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ft("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Ft("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},()=>Ft("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Ft("span",{class:"action-icon block"})])))]):null,Ft("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)"}},[Ft("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Ft("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"}})])])}}}),qse={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:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Cs(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const jse=["data-custom-id"],Vse=["data-node-index","data-node-type"],B4="typewriter-simple-cursor-target",cE=gn(Xe(Rt(st({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},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,String],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","copy-code","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;function i(w){if(!(typeof Event<"u"&&w instanceof Event))return typeof w=="string"&&o("copy-code",w),void o("copy",w)}const r=hs(),l=jt("markstreamNestedRendererProps",void 0);function a(w){const H=r?.vnode.props;return!!H&&(Object.prototype.hasOwnProperty.call(H,w)||Object.prototype.hasOwnProperty.call(H,String(w).replace(/[A-Z]/g,Z=>`-${Z.toLowerCase()}`)))}function c(w){var H,Z;const ee=s[w];return a(w)?ee:(Z=(H=l?.value)==null?void 0:H[w])!=null?Z:ee}const u=D(()=>{return(w=c("mode"))==="chat"||w==="minimal"||w==="docs"?w:"docs";var w}),d=D(()=>_4(c("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>c("domMode")==="minimal"?"minimal":"full"),p=D(()=>{return(w={mode:u.value,codeRenderer:c("codeRenderer"),renderCodeBlocksAsPre:c("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":w.codeRenderer==="pre"||w.codeRenderer==="shiki"||w.codeRenderer==="monaco"?w.codeRenderer:w.renderCodeBlocksAsPre===!1||w.mode==="docs"?"monaco":"pre";var w}),m=D(()=>qse[u.value]),y=D(()=>{var w;return(w=c("showTooltips"))!=null?w:m.value.showTooltips}),k=D(()=>{var w;return(w=c("fade"))!=null?w:m.value.fade}),g=D(()=>{var w;return(w=c("batchRendering"))!=null?w:m.value.batchRendering}),v=D(()=>{var w;return(w=c("initialRenderBatchSize"))!=null?w:m.value.initialRenderBatchSize}),b=D(()=>{var w;return(w=c("renderBatchSize"))!=null?w:m.value.renderBatchSize}),C=D(()=>{var w;return(w=c("renderBatchDelay"))!=null?w:m.value.renderBatchDelay}),I=D(()=>{var w;return(w=c("renderBatchBudgetMs"))!=null?w:m.value.renderBatchBudgetMs}),T=D(()=>{var w;return(w=c("renderBatchIdleTimeoutMs"))!=null?w:m.value.renderBatchIdleTimeoutMs}),M=D(()=>{var w;return(w=c("deferNodesUntilVisible"))!=null?w:m.value.deferNodesUntilVisible}),$=D(()=>{var w;return(w=c("maxLiveNodes"))!=null?w:m.value.maxLiveNodes}),N=D(()=>{var w;return(w=c("liveNodeBuffer"))!=null?w:m.value.liveNodeBuffer}),F=D(()=>{var w;return(w=c("nodeVirtual"))!=null?w:m.value.nodeVirtual}),_={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return c("parseOptions")},get customMarkdownIt(){return c("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return c("customHtmlTags")},get mode(){return c("mode")},get domMode(){return h.value},get htmlPolicy(){return c("htmlPolicy")},get viewportPriority(){return c("viewportPriority")},get viewportPriorityOptions(){return c("viewportPriorityOptions")},get codeBlockStream(){return c("codeBlockStream")},get codeBlockDarkTheme(){return c("codeBlockDarkTheme")},get codeBlockLightTheme(){return c("codeBlockLightTheme")},get codeBlockMonacoOptions(){return c("codeBlockMonacoOptions")},get codeRenderer(){return c("codeRenderer")},get renderCodeBlocksAsPre(){return c("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return c("codeBlockMinWidth")},get codeBlockMaxWidth(){return c("codeBlockMaxWidth")},get codeBlockProps(){return c("codeBlockProps")},get mermaidProps(){return c("mermaidProps")},get d2Props(){return c("d2Props")},get infographicProps(){return c("infographicProps")},get showTooltips(){return y.value},get themes(){return c("themes")},get langs(){return c("langs")},get isDark(){return c("isDark")},get customId(){return c("customId")},get indexKey(){return s.indexKey},get typewriter(){return c("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return c("smoothStreamingOptions")},get parseCoalesceMs(){return c("parseCoalesceMs")},get fade(){return k.value},get batchRendering(){return g.value},get initialRenderBatchSize(){return v.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return C.value},get renderBatchBudgetMs(){return I.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return M.value},get maxLiveNodes(){return $.value},get liveNodeBuffer(){return N.value},get nodeVirtual(){return F.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function R(w){o("height-change",w)}function z(w){o("virtual-state-change",w)}function W(w){o("anchor-change",w)}const L=se(),O=se(null),q=se(null),X=se(null),ie=Ts({1:null,2:null,3:null,4:null,5:null,6:null}),U=se(!1),j=new Map,te=se(0),ae=se(0),oe=se({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function re(w,H){return typeof w!="string"?H:w.trim()||H}function xe(w){const H=Number(w);return Number.isFinite(H)&&H>0?Math.max(1,Math.trunc(H)):640}const pe=D(()=>{var w;const H=(w=_.viewportPriorityOptions)!=null?w:{},Z=re(H.rootMargin,Ra);return{rootMargin:Z,heavyBlockMargin:re(H.heavyBlockMargin,Z),maxTargets:xe(H.maxTargets)}}),Ee=D(()=>{var w;return(w=pe.value.rootMargin)!=null?w:Ra}),ue=D(()=>{var w;return(w=pe.value.maxTargets)!=null?w:640});function Y(){var w,H;if(((w=s.virtualScroll)==null?void 0:w.enabled)!==!0)return null;const Z=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return Q(typeof Z=="function"?Z():Z)}function Q(w){return w?typeof HTMLElement<"u"&&w instanceof HTMLElement?w:typeof w=="object"&&"value"in w?Q(w.value):typeof w=="object"&&"$el"in w?Q(w.$el):null:null}wn(V8,pe);const{isClient:P,renderAsFragment:G,debugPerformanceEnabled:ye,resolvedShowTooltips:he,resolvedHtmlPolicy:fe,inheritedSmoothStreaming:K,ownsTypewriterCursor:ne}=(function(w){const H=typeof window<"u",Z=Sf(),ee=jt("markstreamHtmlPolicy",void 0),de=jt("markstreamTypewriterCursor",void 0),Ce=jt("markstreamSmoothStreaming",void 0),Ne=D(()=>w.renderAsFragment===!0),Le=D(()=>!!(w.debugPerformance&&H&&typeof console<"u")),ze=D(()=>{var We;if(typeof w.showTooltips=="boolean")return w.showTooltips;const Ie=(We=Z.showTooltips)!=null?We:Z["show-tooltips"];return Ie===""||Ie===!0||Ie==="true"||Ie!==!1&&Ie!=="false"&&void 0}),$e=D(()=>{var We,Ie;return(Ie=(We=w.htmlPolicy)!=null?We:ee?.value)!=null?Ie:"safe"}),Re=D(()=>de?.value!==!0);return{isClient:H,renderAsFragment:Ne,debugPerformanceEnabled:Le,resolvedShowTooltips:ze,resolvedHtmlPolicy:$e,inheritedSmoothStreaming:Ce,inheritedTypewriterCursor:de,ownsTypewriterCursor:Re}})(_),{resolveViewportRoot:me,resolveScrollContainer:we,isReverseFlexScrollRoot:Te,getNormalizedScrollTop:Pe,getOffsetTopWithinRoot:be}=(function(w,H){function Z(){var Le,ze;return(ze=(Le=H.scrollRoot)==null?void 0:Le.call(H))!=null?ze:null}function ee(Le){if(typeof window>"u")return null;const ze=Z();if(ze)return ze;const $e=Le??w.value;if(!$e)return null;const Re=$e.ownerDocument||document,We=Re.scrollingElement||Re.documentElement;let Ie=$e;for(;Ie&&Ie!==Re.body&&Ie!==We;){if(Pse(window.getComputedStyle(Ie))&&Hse(Ie))return Ie;Ie=Ie.parentElement}return null}function de(Le){if(!H.isClient)return!1;try{const ze=window.getComputedStyle(Le);return!!(ze.display||"").toLowerCase().includes("flex")&&(ze.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ce(Le,ze,$e){var Re,We;if($e)return Ne(ze);const Ie=Le.scrollTop;if(!de(Le))return Ie;const Be=Ie<0?-Ie:Ie;return Math.max(0,((Re=Le.scrollHeight)!=null?Re:0)-((We=Le.clientHeight)!=null?We:0))-Be}function Ne(Le){var ze,$e,Re,We,Ie;const Be=Number((ze=Le.scrollingElement)==null?void 0:ze.scrollTop),Ge=Number((Re=($e=Le.documentElement)==null?void 0:$e.scrollTop)!=null?Re:0),Ve=Number((Ie=(We=Le.body)==null?void 0:We.scrollTop)!=null?Ie:0);return Math.max(0,Number.isFinite(Be)?Be:0,Number.isFinite(Ge)?Ge:0,Number.isFinite(Ve)?Ve:0)}return{resolveViewportRoot:ee,resolveScrollContainer:function(Le){var ze,$e,Re,We;const Ie=Z();if(Ie)return Ie;const Be=ee((ze=Le??w.value)!=null?ze:null);if(Be)return Be;const Ge=(We=(Re=Le?.ownerDocument)!=null?Re:($e=w.value)==null?void 0:$e.ownerDocument)!=null?We:typeof document<"u"?document:null;return Ge?.scrollingElement||Ge?.documentElement||null},isReverseFlexScrollRoot:de,getNormalizedScrollTop:Ce,getOffsetTopWithinRoot:function(Le,ze){const $e=ze.ownerDocument||Le.ownerDocument||document;if((function(Be,Ge){return Be===Ge.documentElement||Be===Ge.body||Be===Ge.scrollingElement})(ze,$e))return Le.getBoundingClientRect().top+Ne($e);const Re=ze.getBoundingClientRect(),We=Le.getBoundingClientRect(),Ie=Ce(ze,$e,!1);return We.top-Re.top+Ie}}})(L,{isClient:P,scrollRoot:Y});wn("markstreamShowTooltips",he),wn("markstreamHtmlPolicy",fe),wn("markstreamTypewriter",f),wn("markstreamFade",D(()=>_.fade!==!1)),wn("markstreamTypewriterCursor",D(()=>!0)),wn("markstreamTextStreamState",j),wn("markstreamStreamVersion",te),wn("markstreamParseOptions",D(()=>_.parseOptions)),wn("markstreamCustomMarkdownIt",D(()=>_.customMarkdownIt));const{smoothStreamingEnabled:_e,renderContent:Ke,requestedFinal:Qe,effectiveFinal:ot}=(function(w,H){const Z=Bse(st(st({},Dse),w.smoothStreamingOptions)),ee=D(()=>{var Ie,Be,Ge;return w.smoothStreaming!==!1&&!((Ie=w.nodes)!=null&&Ie.length)&&(w.smoothStreaming===!0||!((Be=H.inheritedSmoothStreaming)!=null&&Be.value))&&(w.smoothStreaming===!0||_4(w.typewriter)!=="off"||((Ge=w.maxLiveNodes)!=null?Ge:0)<=0)}),de=se(!H.isClient||w.smoothStreaming===!0);mn(()=>{de.value=!0});const Ce=D(()=>de.value&&ee.value),Ne=D(()=>{var Ie;return Ce.value?Z.visible.value:(Ie=w.content)!=null?Ie:""}),Le=D(()=>{var Ie,Be;const Ge=(Ie=w.parseOptions)!=null?Ie:{};return(Be=w.final)!=null?Be:Ge.final}),ze=D(()=>{const Ie=Le.value;return Ce.value&&Ie!=null?!!Ie&&Z.caughtUp.value:Ie});let $e=0,Re=!1;function We(){$e=0,Re=!1}return Je([()=>w.content,()=>w.nodes,Ce,Le],([Ie,Be,Ge,Ve])=>{if(Be?.length)return We(),void Z.reset("");const lt=Ie??"";if(!Ge)return We(),Z.reset(lt),void(Ve&&Z.finish({flush:!0}));const nt=Z.source.value;if(lt){if(lt!==nt)if(lt.startsWith(nt)){const pt=lt.slice(nt.length),kt=Z.pendingChars.value;pt.length<=8?($e++,Re||$e>=2&&kt<=8?(Re=!0,Z.reset(lt)):Z.enqueue(pt)):(We(),Z.enqueue(pt))}else We(),Z.reset(lt)}else We(),Z.reset("");Ve&&Z.finish()},{immediate:!0}),{smoothStream:Z,smoothStreamingEligible:ee,smoothStreamingEnabled:Ce,renderContent:Ne,requestedFinal:Le,effectiveFinal:ze}})(_,{isClient:P,inheritedSmoothStreaming:K}),at=Qe.value===!0;wn("markstreamSmoothStreaming",_e);const ht=se(!1),Et=se(!1),Tt=se(!1);let $t="",rn=!1,vn=null;function Ht(){P&&vn!=null&&(window.clearTimeout(vn),vn=null)}function Zt(){ht.value=!1,Ht()}function tn(w,H){if(!ye.value)return;const Z=(function(){if(!ye.value)return null;const ee=It(Gt),de=It(An),Ce=Math.max(qe,de);if(ee<=0&&Ce<=0)return null;const Ne={total:ee,maxPerFrame:Ce,byLabel:(Le=Gt,Object.fromEntries(Array.from(Le.entries()).sort((ze,$e)=>$e[1]-ze[1]||ze[0].localeCompare($e[0]))))};var Le;return Gt.clear(),An.clear(),qe=0,Ne})();console.info(`[markstream-vue][perf] ${w}`,Z?Rt(st({},H),{layoutReads:Z}):H)}Je([()=>_.indexKey,()=>_.customId],()=>{var w,H;Zt(),Et.value=!1,Tt.value=!((w=s.nodes)!=null&&w.length)&&Qe.value!==!0&&!!s.content,$t=(H=Ke.value)!=null?H:"",rn=$t.length>0},{flush:"sync"}),Je([()=>s.content,()=>s.nodes,Qe],([w,H,Z])=>{!H?.length&&Z!==!0&&w&&(Tt.value=!0)},{flush:"sync",immediate:!0}),Je([Ke,()=>s.nodes,Qe],([w,H,Z])=>{const ee=w??"";return H?.length||Z===!0?(Zt(),Et.value=!1,$t=ee,void(rn=!0)):(ee.length>0&&(Tt.value=!0),rn?($t&&ee.length>$t.length&&ee.startsWith($t)?(ht.value=!0,Et.value=!0,P&&(Ht(),vn=window.setTimeout(()=>{var de;vn=null,ot.value===!0||(de=s.nodes)!=null&&de.length||(ac(),ht.value=!1,ar())},1200))):(ee.length<$t.length||!ee.startsWith($t))&&(Zt(),Et.value=!1),void($t=ee)):($t=ee,void(rn=!0)))},{flush:"sync",immediate:!0});const Gt=new Map,An=new Map;let Ye=!1,qe=0;function It(w){let H=0;for(const Z of w.values())H+=Z;return H}function Ut(){qe=Math.max(qe,It(An)),An.clear(),Ye=!1}function Vt(w){w.maxPerFrame=Math.max(Number(w.maxPerFrame||0),Number(w.currentFrameTotal||0)),w.currentFrameTotal=0,w.frameScheduled=!1}function kn(w){var H,Z;ye.value&&(Gt.set(w,((H=Gt.get(w))!=null?H:0)+1),An.set(w,((Z=An.get(w))!=null?Z:0)+1),(function(ee){const de=(function(){if(!P||typeof window>"u")return null;const Ce=window;if(Ce.__markstreamLayoutReadPerformance)return Ce.__markstreamLayoutReadPerformance;const Ne={total:0,maxPerFrame:0,byLabel:{}};return Ce.__markstreamLayoutReadPerformance=Ne,Ne})();de&&(de.total=Number(de.total||0)+1,de.byLabel[ee]=Number(de.byLabel[ee]||0)+1,de.currentFrameTotal=Number(de.currentFrameTotal||0)+1,de.frameScheduled||(de.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>Vt(de),0):queueMicrotask(()=>Vt(de)):window.requestAnimationFrame(()=>Vt(de))))})(w),Ye||(Ye=!0,P&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ut):typeof queueMicrotask!="function"?setTimeout(Ut,0):queueMicrotask(Ut)))}function ft(w,H){return kn(w),H()}const cn=_.customId?`renderer-${_.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,un=(function(w){const H=new Map;return{scope:w,cache:H,clear:()=>H.clear()}})(cn),Bn=cn;wn(eE,un);const Mn=ms(()=>_.customId),{effectiveCustomHtmlTagsSet:Ns,mergedParseOptions:bs,parsedNodes:ct,getParsedNodesDirtyStartIndex:sr,getParsedNodesRevision:xs}=Ose(_,{instanceMsgId:cn,renderContent:Ke,effectiveFinal:ot,smoothStreamingEnabled:_e,debugPerformanceEnabled:ye,customComponentsMap:Mn,logPerf:tn});Je(ct,()=>{ht.value||un.clear(),te.value+=1},{immediate:!0});const bn=D(()=>({customId:_.customId,customHtmlTags:bs.value.customHtmlTags,parseOptions:_.parseOptions,customMarkdownIt:_.customMarkdownIt,htmlPolicy:fe.value,viewportPriority:_.viewportPriority,viewportPriorityOptions:pe.value,mode:u.value,domMode:_.domMode,codeRenderer:p.value,codeBlockStream:_.codeBlockStream,codeBlockDarkTheme:_.codeBlockDarkTheme,codeBlockLightTheme:_.codeBlockLightTheme,codeBlockMonacoOptions:_.codeBlockMonacoOptions,renderCodeBlocksAsPre:_.renderCodeBlocksAsPre,codeBlockMinWidth:_.codeBlockMinWidth,codeBlockMaxWidth:_.codeBlockMaxWidth,codeBlockProps:_.codeBlockProps,mermaidProps:_.mermaidProps,d2Props:_.d2Props,infographicProps:_.infographicProps,showTooltips:he.value,themes:_.themes,langs:_.langs,isDark:_.isDark,typewriter:f.value,smoothStreamingOptions:_.smoothStreamingOptions,parseCoalesceMs:_.parseCoalesceMs,fade:_.fade}));wn("markstreamNestedRendererProps",bn);const gs=D(()=>ct.value),ws=D(()=>ct.value.length),Ws=se(null),Zs=se(null),Gn=se(null),mo=se(null),Xs=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),_s=!Xs&&_.customId?y4(_.customId):null,Fo=D(()=>_s?(tv.value,y4(_.customId)):null),Jo=D(()=>{var w;return!!(!G.value&&_.customId&&!Xs&&((w=Fo.value)!=null&&w.enabled))}),Qs=D(()=>!!(P&&Jo.value)),os=D(()=>{var w;return!!(!G.value&&((w=s.virtualScroll)!=null&&w.enabled))}),Fi=D(()=>os.value),ei=se(!1);mn(()=>{ei.value=!0});const Xt=D(()=>!!(P&&os.value));wn("markstreamHostScrollManaged",Xt);const Is=D(()=>!!(ei.value&&Xt.value)),Yn=D(()=>Qs.value||Xt.value),Oo=D(()=>Qs.value||Is.value),Ro=D(()=>{var w;return Yn.value&&((w=Fo.value)==null?void 0:w.textEstimation)!==!1});function Bo(){const w=ae.value||ft("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=L.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(w)&&w>0?w:0}const ti=D(()=>{const w=Bo();return w>0?Math.max(1,Math.round(w)):640}),Do=D(()=>{var w,H;return!(ot.value!==!0||os.value||u.value!=="chat"&&u.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(w=s.nodes)!=null&&w.length||Tt.value||!(((H=_.maxLiveNodes)!=null?H:0)<=0))}),go=D(()=>{var w;return Do.value?50:Math.max(1,(w=_.maxLiveNodes)!=null?w:320)}),Ue=D(()=>{var w;return Do.value?16:Math.max(0,(w=_.liveNodeBuffer)!=null?w:60)}),Ze=D(()=>{var w;return!G.value&&_.nodeVirtual!==!1&&!(((w=_.maxLiveNodes)!=null?w:0)<=0&&!Do.value)&&(_.nodeVirtual===!0?ct.value.length>0:ct.value.length>go.value)}),ut=D(()=>Ze.value||Qs.value||Xt.value),Wt=D(()=>_.viewportPriority!==!1),zs=D(()=>!!Wt.value&&!U.value);var vo;vo=D(()=>Wt.value),wn(K8,vo);const zr=D(()=>{var w;return!(G.value||_.deferNodesUntilVisible===!1||((w=_.maxLiveNodes)!=null?w:0)<=0||Ze.value||ct.value.length>900||_.viewportPriority===!1)}),ce=mte(w=>{var H;return me((H=w??L.value)!=null?H:null)},Wt),{requestFrame:V,cancelFrame:le,hasIdleCallback:J,isTestEnv:ke}=(function(w){const H=w.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,Z=w.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ee=w.isClient&&typeof window.requestIdleCallback=="function",de=(function(){var Ce;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ne=(Ce=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ce.value;return Ne?.env})();return{requestFrame:H,cancelFrame:Z,hasIdleCallback:ee,isTestEnv:de?.NODE_ENV==="test"}})({isClient:P}),Se=D(()=>ot.value===!0&&!os.value),{resolvedBatchSize:Oe,resolvedInitialBatch:je,batchingEnabled:it,incrementalRenderingActive:Nt,renderedCount:Bt,previousRenderContext:ts,adaptiveBatchSize:Yt,previousBatchConfig:zn}=(function(w,H){var Z;const ee=D(()=>{var We;const Ie=Math.trunc((We=w.renderBatchSize)!=null?We:80);return Number.isFinite(Ie)?Math.max(0,Ie):0}),de=D(()=>{var We;const Ie=Math.trunc((We=w.initialRenderBatchSize)!=null?We:ee.value);return Number.isFinite(Ie)?Math.max(0,Ie):ee.value}),Ce=D(()=>!H.renderAsFragment.value&&w.batchRendering!==!1&&ee.value>0&&H.isClient&&!H.isTestEnv),Ne=se(0),Le=se({key:w.indexKey,total:0}),ze=se(Math.max(1,ee.value||1)),$e=D(()=>{var We,Ie,Be;return Ce.value&&!((We=H.continuousStreaming)!=null&&We.value)&&!((Ie=H.forceFullRenderFinalContent)!=null&&Ie.value)&&((Be=w.maxLiveNodes)!=null?Be:0)<=0}),Re=se({batchSize:ee.value,initial:de.value,delay:(Z=w.renderBatchDelay)!=null?Z:16,enabled:$e.value});return{resolvedBatchSize:ee,resolvedInitialBatch:de,batchingEnabled:Ce,incrementalRenderingActive:$e,renderedCount:Ne,previousRenderContext:Le,adaptiveBatchSize:ze,previousBatchConfig:Re}})(_,{isClient:P,isTestEnv:ke,renderAsFragment:G,forceFullRenderFinalContent:Se,continuousStreaming:D(()=>Et.value&&ot.value!==!0)}),Us=D(()=>{var w;return!G.value&&_.batchRendering!==!1&&Oe.value>0&&!ke&&((w=_.maxLiveNodes)!=null?w:0)<=0&&!Se.value}),Lt=D(()=>Us.value),wt=D(()=>Yn.value||Lt.value),Un=D(()=>{var w;return wt.value&&((w=Fo.value)==null?void 0:w.codeBlockEstimation)!==!1}),Nn=new Map,qs=new Map,or=new WeakMap;let Po=null;const Hl=new WeakMap,Js=new Map,Pf=[];let Ur=[],bu=[],xu=-1;const Ka=tr(Pf),qr=new Set,wb=se(0);let Hf=0;const _b=se(0),OT=D(()=>(_b.value,Array.from(Nn.entries()).sort((w,H)=>w[0]-H[0]))),wu=se(null),Ho=se(null);let jr,Wl=null,e0=0,_u=null;function ni(){jr.markFallbackHeightPrefixDirty()}function t0(w){return jr.getFallbackNodeHeight(w)}function Ga(w,H){return jr.estimateHeightRange(w,H)}function n0(w){return jr.estimateIndexForOffset(w)}const{activeRestoreAnchor:Ya,getRelativeScrollTopWithinContainer:RT,setRelativeScrollTopWithinContainer:BT,resolveAnchorOffset:DT,clearRestoreReconcile:Wf,scheduleRestoreReconcile:Su,captureRestoreAnchor:Sb,restoreAnchor:Cb,getAnchorDrift:PT}=(function(w){const{isClient:H,containerRef:Z,parsedNodeCount:ee,requestFrame:de,cancelFrame:Ce,resolveScrollContainer:Ne,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:ze,isReverseFlexScrollRoot:$e,estimateIndexForOffset:Re,estimateHeightRange:We,getFallbackNodeHeight:Ie,clamp:Be}=w,Ge=se(null);let Ve=null,lt=[];function nt(){const At=Ne(),zt=Z.value;if(!At||!zt)return null;const qt=At.ownerDocument||zt.ownerDocument||document;if(At===qt.documentElement||At===qt.body||At===qt.scrollingElement){const xn=zt.getBoundingClientRect();return Math.max(0,-xn.top)}return Math.max(0,Le(At,qt,!1)-ze(zt,At))}function pt(At){var zt;const qt=Ne(),xn=Z.value;if(!qt||!xn)return;const Fs=Math.max(0,At),Ss=qt.ownerDocument||xn.ownerDocument||document,vi=Ss.defaultView||(typeof window<"u"?window:null);if(qt===Ss.documentElement||qt===Ss.body||qt===Ss.scrollingElement){const Di=Le(qt,Ss,!0)+xn.getBoundingClientRect().top;return void((zt=vi?.scrollTo)==null||zt.call(vi,0,Math.max(0,Di+Fs)))}x4(qt,Ss,ze(xn,qt)+Fs,{isReverseFlexScrollRoot:Di=>{var ju;return(ju=$e?.(Di))!=null&&ju},getNormalizedScrollTop:Le})}function kt(At){const zt=ee.value,qt=Be(At.nodeIndex,0,Math.max(0,zt-1));return We(0,qt)+Math.max(0,At.offsetWithinNodePx)}function Ct(){if(Ve!=null&&(Ce?.(Ve),Ve=null),H)for(const At of lt)window.clearTimeout(At);lt=[]}function _t(At){const zt=kt(At),qt=nt();qt!=null&&Math.abs(qt-zt)<=.5||pt(zt)}return{activeRestoreAnchor:Ge,getRelativeScrollTopWithinContainer:nt,setRelativeScrollTopWithinContainer:pt,resolveAnchorOffset:kt,clearRestoreReconcile:Ct,applyRestoreAnchor:_t,scheduleRestoreReconcile:function(){Ge.value&&H&&Ve==null&&(Ve=de?de(()=>{Ve=null,Ge.value&&_t(Ge.value)}):null,Ve==null&&Ge.value&&_t(Ge.value))},captureRestoreAnchor:function(){const At=nt(),zt=ee.value;if(At==null||zt<=0)return null;const qt=Be(Re(At+1),0,zt-1),xn=We(0,qt),Fs=Ie(qt);return{nodeIndex:qt,offsetWithinNodePx:Be(At-xn,0,Math.max(0,Fs-1))}},restoreAnchor:function(At){const zt=ee.value;if(Ge.value={nodeIndex:Be(At.nodeIndex,0,Math.max(0,zt-1)),offsetWithinNodePx:Math.max(0,At.offsetWithinNodePx)},Ct(),_t(Ge.value),H)for(const qt of[0,120,280,480])lt.push(window.setTimeout(()=>{Ge.value&&_t(Ge.value)},qt))},getAnchorDrift:function(At){const zt=nt();return zt==null?null:zt-kt(At)}}})({isClient:P,containerRef:L,parsedNodeCount:ws,requestFrame:V,cancelFrame:le,resolveScrollContainer:()=>wu.value||we(),getNormalizedScrollTop:Pe,getOffsetTopWithinRoot:be,isReverseFlexScrollRoot:Te,estimateIndexForOffset:n0,estimateHeightRange:Ga,getFallbackNodeHeight:t0,clamp:$s}),{nodeHeights:Za,heightStats:si,heightTreeSize:s0,heightSumTree:HT,heightKnownTree:WT,averageNodeHeight:Ab,resetHeightMeasurements:zT,pruneHeightMeasurements:UT,rebuildHeightTrees:zf,recordNodeHeight:qT,removeNodeHeights:jT,exportHeightCache:VT,importHeightCache:KT,fenwickRangeSum:GT}=(function(w={}){const H=Ts({}),Z=Ts({total:0,count:0}),ee=se(0),de=se([]),Ce=se([]);function Ne(){for(const Ie of Object.keys(H))delete H[Number(Ie)];Z.total=0,Z.count=0,ee.value=0,de.value=[],Ce.value=[]}function Le(Ie,Be,Ge){for(let Ve=Be+1;Ve<Ie.length;Ve+=Ve&-Ve)Ie[Ve]+=Ge}function ze(Ie,Be){let Ge=0;for(let Ve=Be+1;Ve>0;Ve-=Ve&-Ve)Ge+=Ie[Ve];return Ge}function $e(Ie){ee.value=Ie;const Be=new Array(Ie+1).fill(0),Ge=new Array(Ie+1).fill(0);for(const[Ve,lt]of Object.entries(H)){const nt=Number(Ve),pt=Number(lt);!Number.isFinite(nt)||nt<0||nt>=Ie||!Number.isFinite(pt)||pt<=0||(Le(Be,nt,pt),Le(Ge,nt,1))}de.value=Be,Ce.value=Ge}function Re(Ie){if(!Number.isInteger(Ie)||Ie<0)return!1;const Be=H[Ie];if(!Number.isFinite(Be)||Be<=0)return!1;if(delete H[Ie],Z.total=Math.max(0,Z.total-Be),Z.count=Math.max(0,Z.count-1),ee.value>Ie){const Ge=de.value,Ve=Ce.value;Ge.length&&Ve.length&&(Le(Ge,Ie,-Be),Le(Ve,Ie,-1))}return!0}const We=D(()=>Z.count>0?Math.max(12,Z.total/Z.count):32);return{nodeHeights:H,heightStats:Z,heightTreeSize:ee,heightSumTree:de,heightKnownTree:Ce,averageNodeHeight:We,resetHeightMeasurements:Ne,pruneHeightMeasurements:function(Ie){if(Ie<=0)return void Ne();let Be=0,Ge=0;for(const[Ve,lt]of Object.entries(H)){const nt=Number(Ve),pt=Number(lt);!Number.isFinite(nt)||nt<0||nt>=Ie||!Number.isFinite(pt)||pt<=0?delete H[nt]:(Be+=pt,Ge++)}Z.total=Be,Z.count=Ge},rebuildHeightTrees:$e,recordNodeHeight:function(Ie,Be,Ge={}){(function(Ve,lt,nt={}){var pt;if(!Number.isFinite(lt)||lt<=0)return!1;const kt=H[Ve];if(kt&&(nt.allowShrink===!1&<<kt||Math.abs(lt-kt)<=1))return!1;if(H[Ve]=lt,kt?Z.total+=lt-kt:(Z.total+=lt,Z.count++),ee.value>Ve){const Ct=de.value,_t=Ce.value;if(Ct.length&&_t.length)if(kt){const At=lt-kt;At!==0&&Le(Ct,Ve,At)}else Le(Ct,Ve,lt),Le(_t,Ve,1)}nt.notify!==!1&&((pt=w.onHeightRecorded)==null||pt.call(w))})(Ie,Be,Rt(st({},Ge),{notify:!0}))},removeNodeHeight:function(Ie,Be={}){var Ge;const Ve=Re(Ie);return Ve&&Be.notify!==!1&&((Ge=w.onHeightRecorded)==null||Ge.call(w)),Ve},removeNodeHeights:function(Ie,Be={}){var Ge;let Ve=0;for(const lt of Ie)Re(Number(lt))&&Ve++;return Ve>0&&Be.notify!==!1&&((Ge=w.onHeightRecorded)==null||Ge.call(w)),Ve},exportHeightCache:function(){return Object.entries(H).map(([Ie,Be])=>({index:Number(Ie),height:Number(Be)})).filter(Ie=>Number.isFinite(Ie.index)&&Ie.index>=0&&Number.isFinite(Ie.height)&&Ie.height>0).sort((Ie,Be)=>Ie.index-Be.index)},importHeightCache:function(Ie,Be={}){var Ge;if(!Array.isArray(Ie))return;const Ve=ee.value;let lt=!1;if(Be.mode!=="merge"){const nt=Object.keys(H);if(nt.length>0){for(const pt of nt)delete H[Number(pt)];lt=!0}}for(const nt of Ie){const pt=Number(nt.index),kt=Number(nt.height);if(!Number.isInteger(pt)||pt<0||Ve>0&&pt>=Ve||!Number.isFinite(kt)||kt<=0)continue;const Ct=H[pt];Ct&&Math.abs(Ct-kt)<=1||(H[pt]=kt,lt=!0)}lt&&((function(){let nt=0,pt=0;const kt=ee.value;for(const[Ct,_t]of Object.entries(H)){const At=Number(Ct),zt=Number(_t);!Number.isFinite(At)||At<0||kt>0&&At>=kt||!Number.isFinite(zt)||zt<=0?delete H[At]:(nt+=zt,pt++)}Z.total=nt,Z.count=pt})(),Ve>0&&$e(Ve),(Ge=w.onHeightRecorded)==null||Ge.call(w))},fenwickRangeSum:function(Ie,Be,Ge){if(Ge<=Be)return 0;const Ve=ze(Ie,Ge-1);return Be<=0?Ve:Ve-ze(Ie,Be-1)}}})({onHeightRecorded:()=>{ni(),Xt.value&&Pu(),Ya.value&&Su(),Ho.value&&ic(),Dn("node-resize")}});function Mb(w){Number.isInteger(w)&&w>=0&&qr.add(w)}function Eb(w){for(const H of w)Mb(Number(H))}function Xa(w){Hf++;let H=!0;try{const Z=w();return H=Z!==!1,Z}finally{Hf--,Hf===0&&H&&wb.value++}}function o0(){Ur=[],bu=[],xu=-1,qr.clear(),Ka.value=Pf}function Uf(){o0(),Xa(()=>zT()),Js.clear()}function Tb(w){!Number.isInteger(w)||w<0||w>=ct.value.length||Js.set(w,Eu(w))}function Nb(w,H,Z={}){const ee=Za[w];Mb(w),qT(w,H,Z);const de=Za[w];return Object.is(ee,de)?(qr.delete(w),!1):(de&&de>0?Tb(w):ee&&Js.delete(w),!0)}function Ib(w,H){const Z=ft("getNodeLayoutHeight.slot.offsetHeight",()=>{var ee,de;return(de=(ee=Nn.get(w))==null?void 0:ee.offsetHeight)!=null?de:0});return Z>0?Z:ft("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Lb(w,H={}){H.mode!=="merge"?o0():Eb(w.map(Z=>Z.index)),Xa(()=>KT(w,H)),L0()}const Oi=D(()=>zr.value&&zs.value),YT=D(()=>{var w;return!G.value&&_.batchRendering!==!1&&Oe.value>0&&((w=_.maxLiveNodes)!=null?w:0)<=0}),ZT=D(()=>!G.value&&at&&ot.value===!0&&!Ze.value&&!os.value&&!Jo.value&&!Oi.value&&!YT.value),$b=D(()=>!!ce&&Oi.value),Fb=D(()=>Ze.value||Xt.value),{focusIndex:ir,liveRange:Ls,updateLiveRange:Cu}=(function(w,H){const{parsedNodeCount:Z,virtualizationEnabled:ee,maxLiveNodesResolved:de,liveNodeBufferResolved:Ce,clamp:Ne}=H,Le=Ce??D(()=>{var Re;return Math.max(0,(Re=w.liveNodeBuffer)!=null?Re:60)}),ze=se(0),$e=Ts({start:0,end:0});return{liveNodeBufferResolved:Le,focusIndex:ze,liveRange:$e,updateLiveRange:function(){const Re=Z.value;if(!ee.value||Re===0)return $e.start=0,void($e.end=Re);const We=Math.min(de.value,Re),Ie=Le.value,Be=Ne(ze.value-Ie,0,Math.max(0,Re-We));$e.start=Be,$e.end=Math.min(Re,Be+We)}}})(_,{parsedNodeCount:ws,virtualizationEnabled:Ze,maxLiveNodesResolved:go,liveNodeBufferResolved:Ue,clamp:$s}),Ri=new Map,zl=new Map,Vr=new Map,qf=[],rr=new Map,Kr=new Set,Ob=se(0);let i0=!1;const Rb=D(()=>(Ob.value,Kr.size)),Wo=new Map,Bi=new Map,Bb=se(0),r0=D(()=>{Bb.value;let w=0;for(const H of Wo.values())w+=Math.max(0,H);return w});let zo=null;const jf=D(()=>{if(!Ze.value)return ct.value.length;const w=Ue.value,H=Math.max(Ls.end+w,je.value),Z=Math.min(ct.value.length,H);return Math.max(Bt.value,Z)});function Vf(){i0||(i0=!0,queueMicrotask(()=>{i0=!1,Ob.value+=1}))}function Db(w,H,Z="node-resize"){if(!P||typeof window>"u")return null;const ee=window.setTimeout(()=>{Kr.delete(ee)&&Vf();try{H()}finally{Dn(Z)}},Math.max(0,w));return Kr.add(ee),Vf(),ee}function Kf(w){P&&w!=null&&(Kr.delete(w)&&Vf(),window.clearTimeout(w))}function Pb(){if(P&&typeof window<"u")for(const w of Kr)window.clearTimeout(w);Kr.size&&(Kr.clear(),Vf()),qf.length=0,Vr.clear()}function XT(w){O.value=w}function QT(w){q.value=w}function JT(w){X.value=w}const{cancelScheduledFocusSync:l0,scheduleFocusSync:gi}=(function(w){const{isClient:H,containerRef:Z,virtualizationEnabled:ee,requestFrame:de,cancelFrame:Ce,syncFocusToScroll:Ne}=w;let Le=null;function ze(){var Re,We,Ie;return(Ie=(We=(Re=Z.value)==null?void 0:Re.ownerDocument)==null?void 0:We.defaultView)!=null?Ie:typeof window<"u"?window:null}function $e(){if(!Le)return;const Re=ze();Le.viaTimeout?Re?Re.clearTimeout(Le.id):clearTimeout(Le.id):Ce?.(Le.id),Le=null}return{cancelScheduledFocusSync:$e,scheduleFocusSync:function(Re={}){if(!ee.value)return;if(!H)return void Ne(!0);if(Re.immediate)return $e(),void Ne(!0);if(Le)return;const We=()=>{Le=null,Ne()};if(de)return void(Le={id:de(We),viaTimeout:!1});const Ie=ze();Le={id:Ie?Ie.setTimeout(We,16):setTimeout(We,16),viaTimeout:!0}}}})({isClient:P,containerRef:L,virtualizationEnabled:Ze,requestFrame:V,cancelFrame:le,syncFocusToScroll:function(w=!1){var H;if(!Ze.value)return;const Z=wu.value||we();if(!Z)return;const ee=Z.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,de=ee?.defaultView||(typeof window<"u"?window:null),Ce=Z===ee?.documentElement||Z===ee?.body,Ne=ct.value.length;if(Ne<=0)return;if(!Ce&&Ne>0&&Te(Z)){const Ve=ft("syncFocusToScroll.clientHeight",()=>Z.clientHeight||0),lt=ft("syncFocusToScroll.scrollTop",()=>Z.scrollTop),nt=lt<0?-lt:lt;return void Zf($s((Le=Math.max(0,nt)+.5*Math.max(0,Ve),jr.estimateIndexForOffsetFromEnd(Le)),0,Math.max(0,Ne-1)),w)}var Le;const ze=(function(Ve,lt,nt,pt){const kt=L.value;if(!kt)return null;const Ct=pt?0:ft("syncFocusToScroll.model.root.getBoundingClientRect",()=>Ve.getBoundingClientRect().top),_t=ft("syncFocusToScroll.model.container.getBoundingClientRect",()=>kt.getBoundingClientRect().top),At=Math.max(0,Ct-_t),zt=pt?ft("syncFocusToScroll.model.viewport.clientHeight",()=>{var qt,xn,Fs,Ss;return(Ss=(Fs=(xn=nt?.innerHeight)!=null?xn:(qt=lt.documentElement)==null?void 0:qt.clientHeight)!=null?Fs:Ve.clientHeight)!=null?Ss:0}):ft("syncFocusToScroll.model.root.clientHeight",()=>Ve.clientHeight);return $s(n0(At+.5*Math.max(0,zt)),0,Math.max(0,ct.value.length-1))})(Z,ee,de,Ce);if(ze!=null)return void Zf(ze,w);const $e=Ce?null:ft("syncFocusToScroll.root.getBoundingClientRect",()=>Z.getBoundingClientRect()),Re=Ce?0:$e.top,We=Ce?ft("syncFocusToScroll.viewport.clientHeight",()=>{var Ve,lt;return(lt=(Ve=de?.innerHeight)!=null?Ve:Z.clientHeight)!=null?lt:0}):$e.bottom,Ie=OT.value;let Be=null,Ge=null;for(const[Ve,lt]of Ie){if(!lt)continue;const nt=ft("syncFocusToScroll.slot.getBoundingClientRect",()=>lt.getBoundingClientRect());nt.bottom<=Re||nt.top>=We||(Be==null&&(Be=Ve),Ge=Ve)}if(Be==null||Ge==null){const Ve=L.value;if(!Ve)return;const lt=Ce?{top:0}:ft("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>Z.getBoundingClientRect()),nt=ft("syncFocusToScroll.fallback.scrollTop",()=>Pe(Z,ee,Ce)),pt=Ce?(()=>{const Ct=ft("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ve.getBoundingClientRect()),_t=(Ce?0:lt.top)-Ct.top;return Math.max(0,_t)})():(()=>{const Ct=be(Ve,Z);return Math.max(0,nt-Ct)})(),kt=Ce?ft("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,_t,At,zt;return(zt=(At=(_t=de?.innerHeight)!=null?_t:(Ct=ee?.documentElement)==null?void 0:Ct.clientHeight)!=null?At:Z.clientHeight)!=null?zt:0}):ft("syncFocusToScroll.fallback.root.clientHeight",()=>Z.clientHeight);return void Zf($s(n0(pt+.5*Math.max(0,kt)),0,Math.max(0,ct.value.length-1)),!0)}Zf(Math.round((Be+Ge)/2),w)}}),{visibleNodeIndices:a0,nodeVisibilityHandles:Qa,nodeVisibilityWatchStops:Gf,nodeVisibilityFallbackTimers:Hb,clearVisibilityFallback:Yf,markNodeVisible:Gr,cleanupNodeVisibility:eN,destroyNodeVisibilityState:c0}=Rse({isClient:P,shouldTrackVisibleNodeIndices:()=>Oi.value,shouldCleanupNodeVisibility:()=>Ze.value,onNodeMarkedVisible:w=>{Ze.value?gi():ir.value=$s(w,0,Math.max(0,ct.value.length-1))},onNodeVisibilityCleaned:w=>{Nn.delete(w)&&px()}}),{cleanupScrollListener:Wb,setupScrollListener:tN}=(function(w){const{isClient:H,virtualizationEnabled:Z,listenerEnabled:ee,scrollRootElement:de,resolveScrollContainer:Ce,scheduleFocusSync:Ne,onScroll:Le}=w;let ze=null,$e=null;function Re(){ze&&(ze(),ze=null),$e=null,de.value=null}function We(Ie){const Be=w.getScrollTop?w.getScrollTop(Ie):Ie.scrollTop;return Math.max(0,Number.isFinite(Be)?Math.abs(Be):0)}return{cleanupScrollListener:Re,setupScrollListener:function(){if(!H)return;if(!((Ie=ee?.value)!=null?Ie:Z.value))return void Re();var Ie;const Be=Ce();if(!Be)return void Re();if(de.value===Be&&ze)return;Re(),$e=We(Be);const Ge=()=>{if(Le?.(),Z.value){const Ve=(function(lt){const nt=We(lt),pt=$e;$e=nt;const kt=Math.max(480,.75*(lt.clientHeight||0));return pt==null?nt>kt?{immediate:!0}:void 0:Math.abs(nt-pt)>kt?{immediate:!0}:void 0})(Be);Ve?Ne(Ve):Ne()}};Be.addEventListener("scroll",Ge,{passive:!0}),de.value=Be,ze=()=>{Be.removeEventListener("scroll",Ge)}}}})({isClient:P,virtualizationEnabled:Ze,listenerEnabled:Fb,scrollRootElement:wu,resolveScrollContainer:we,scheduleFocusSync:gi,onScroll:function(){const w=Ho.value;if(!w)return;const H=Mu();if(!H||(function(ee){if($u()>=e0)return _u=null,!1;const de=_u;if(de==null)return!0;const Ce=Math.abs(ee.scrollTop-de)<=2;return Ce||(_u=null),Ce})(H))return;const Z=nx(H);Z!=null?(Z<-32||Math.abs(Math.max(0,Z)-Math.max(0,w.distanceFromBottomPx))>32)&&oc("restore"):oc("restore")},getScrollTop:w=>{var H;const Z=w.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,ee=w===Z.documentElement||w===Z.body||w===Z.scrollingElement;return ft("scrollListener.getScrollTop",()=>Pe(w,Z,ee))}});function Zf(w,H=!1){const Z=$s(w,0,Math.max(0,ct.value.length-1));!H&&Math.abs(Z-ir.value)<=1||(ir.value=Z,Cu())}function $s(w,H,Z){return Math.min(Math.max(w,H),Z)}function u0(w=ct.value.length){const H=sr();return!Number.isInteger(H)||H<0?w:$s(H,0,w)}function d0(w){return w?.firstElementChild}function zb(w,H){var Z;return w?(Z=w.matches)!=null&&Z.call(w,H)?w:w.querySelector(H):null}function nN(w,H){w<1||w>6||(ie[w]=H)}function Ub(){if(!Yn.value)return void(ae.value=0);const w=ft("updateExperimentContainerWidth.clientWidth",()=>{var H,Z;return(Z=(H=L.value)==null?void 0:H.clientWidth)!=null?Z:0});ae.value=w>0?w:0}let Au=null;function f0(){Au?.disconnect(),Au=null}const qb=vd("ViewportDeferredMarkdownCodeBlockNode",Ci({loader:()=>Hn(null,null,function*(){return(yield io(()=>import("./index5-B1-fjW_m.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Am,delay:0,suspensible:!1}),Am);function jb(w){return w===qb}const Vb=D(()=>p.value==="pre"?So:p.value==="shiki"?qb:Yg);function Kb(){var w;return((w=_.codeBlockProps)==null?void 0:w.showHeader)!==!1}function Gb(w,H,Z){const ee=Za[H],de=typeof ee=="number"&&ee>0;if(Ro.value&&!de&&!(function(Ce){return!!Mn.value.paragraph&&(Ce.type==="paragraph"||Ce.type==="list_item"||Ce.type==="list")})(w)){const Ce=J8(w,Z,oe.value);if(Ce)return Ce}if(Un.value&&w.type==="code_block"){const Ce=(function(Ne){if(Ne.type!=="code_block")return null;const Le=Ax(Ne,rh(Ne));return jb(Le)?"markdown":Le===So?"pre":Le===Vb.value||Le===Yg?"monaco":null})(w);if(Ce==="monaco"||Ce==="markdown"||Ce==="pre")return(function(Ne,Le){var ze,$e,Re;if(!Ne||Ne.type!=="code_block")return null;const We=Le.rendererKind,Ie=We!=="pre"&&Le.showHeader!==!1,Be=!!Ne.diff;let Ge=0,Ve=500;if(We==="monaco"){const nt=(ze=Le.monacoOptions)!=null?ze:{},pt=ov(Ne,nt,Le.width),kt=(function(_t){const At=typeof _t?.fontSize=="number"&&_t.fontSize>0?_t.fontSize:12;return typeof _t?.lineHeight=="number"&&_t.lineHeight>0?_t.lineHeight:Math.round(1.5*At)})(nt),Ct=(function(_t,At){var zt,qt;const xn=typeof((zt=_t?.padding)==null?void 0:zt.top)=="number"?_t.padding.top:At?0:8,Fs=typeof((qt=_t?.padding)==null?void 0:qt.bottom)=="number"?_t.padding.bottom:At?0:8;return Math.max(0,xn)+Math.max(0,Fs)})(nt,Be);Ve=typeof nt.MAX_HEIGHT=="number"&&nt.MAX_HEIGHT>0?nt.MAX_HEIGHT:500,Ge=Math.round(pt*kt+Ct)}else if(We==="markdown"){const nt=ov(Ne);Ge=Math.round(21*nt+32)}else{const nt=ov(Ne);Ge=Math.round(28*nt),Ve=Number.POSITIVE_INFINITY}const lt=Math.max(1,Math.min(Ge,Ve));return st({kind:"code-block",height:Math.round(lt+(Ie?40:0)),contentHeight:lt,rendererKind:We},Be&&We==="monaco"?{diffInline:M2(($e=Le.monacoOptions)!=null?$e:{},(Re=Le.width)!=null?Re:0)}:{})})(w,{rendererKind:Ce,monacoOptions:_.codeBlockMonacoOptions,showHeader:Kb(),width:Z})}return null}xA(()=>{if(wb.value,Hf>0)return;const w=ct.value,H=xs();if(!w.length||!wt.value)return Ur=[],bu=[],xu=-1,qr.clear(),void(Ka.value=Pf);const Z=ae.value||ft("estimatedNodeHeights.clientWidth",()=>{var $e;return(($e=L.value)==null?void 0:$e.clientWidth)||0});if(!Number.isFinite(Z)||Z<=0)return Ur=[],bu=[],xu=-1,qr.clear(),void(Ka.value=Pf);const ee=(function($e){return[Math.round($e),Ro.value,Un.value,oe.value,_.codeBlockMonacoOptions,Kb(),p.value,Mn.value,tv.value]})(Z),de=Ur.length<=w.length&&(Ne=ee,(Ce=bu).length===Ne.length&&Ce.every(($e,Re)=>Object.is($e,Ne[Re])));var Ce,Ne;const Le=de&&xu===H?w.length:de?u0(w.length):0,ze=de?Array.from(qr):[];Ur.length=w.length;for(let $e=Le;$e<w.length;$e++)Ur[$e]=Gb(w[$e],$e,Z);for(const $e of ze)$e>=0&&$e<w.length&&$e<Le&&(Ur[$e]=Gb(w[$e],$e,Z));qr.clear(),bu=ee,xu=H,Ka.value=Ur,_9(Ka)},{flush:"sync"});const Ja=D(()=>Ka.value);jr=(function(w){let H=!0,Z=[0],ee="";function de(Re){var We;const Ie=w.nodeHeights[Re];if(Number.isFinite(Ie)&&Ie>0)return Ie;const Be=w.parsedNodes.value[Re],Ge=Be?.type,Ve=!!((We=w.hasCustomParagraphComponent)!=null&&We.call(w)),lt=w.estimatedNodeHeights.value[Re],nt=lt?.height;if(!(function(kt,Ct,_t){return!!(_t&&Ct?.kind==="simple-text"&&(kt==="paragraph"||kt==="list_item"||kt==="list"))})(Ge,lt,Ve)&&Number.isFinite(nt)&&nt>0)return nt;const pt=Sse(Be,w.getContainerWidth()||640);return Ge==="heading"||Ge==="paragraph"&&pt<=28&&(function(kt,Ct){if(Ct)return!1;const _t=kt.children;return!Array.isArray(_t)||!_t.length||_t.every(tE)})(Be,Ve)?pt:Math.max(w.averageNodeHeight.value,pt)}function Ce(){var Re;const We=w.parsedNodes.value.length,Ie=w.getPrefixCacheKeyParts().join(":");if(!H&&ee===Ie)return Z;const Be=new Array(We+1);Be[0]=0;for(let Ge=0;Ge<We;Ge++)Be[Ge+1]=Be[Ge]+(w.heightEstimationActive.value?de(Ge):(Re=w.nodeHeights[Ge])!=null?Re:w.averageNodeHeight.value);return Z=Be,ee=Ie,H=!1,Be}function Ne(Re){var We,Ie;const Be=w.parsedNodes.value.length;if(Be<=0||Re<=0)return 0;const Ge=Ce();if(Re>=((We=Ge[Be])!=null?We:0))return Be-1;let Ve=0,lt=Be-1,nt=Be-1;for(;Ve<=lt;){const pt=Ve+lt>>1;((Ie=Ge[pt+1])!=null?Ie:0)>=Re?(nt=pt,lt=pt-1):Ve=pt+1}return nt}function Le(Re,We){var Ie,Be;if(Re>=We)return 0;if(w.heightEstimationActive.value)return(function(lt,nt){var pt,kt;const Ct=w.parsedNodes.value.length,_t=S4(Math.trunc(lt),0,Ct),At=S4(Math.trunc(nt),_t,Ct);if(_t>=At)return 0;const zt=Ce();return((pt=zt[At])!=null?pt:0)-((kt=zt[_t])!=null?kt:0)})(Re,We);if(w.heightTreeSize.value!==w.parsedNodes.value.length){let lt=0;for(let nt=Re;nt<We;nt++)lt+=(Ie=w.nodeHeights[nt])!=null?Ie:w.averageNodeHeight.value;return lt}const Ge=w.heightSumTree.value,Ve=w.heightKnownTree.value;if(!Ge.length||!Ve.length){let lt=0;for(let nt=Re;nt<We;nt++)lt+=(Be=w.nodeHeights[nt])!=null?Be:w.averageNodeHeight.value;return lt}return w.fenwickRangeSum(Ge,Re,We)+(We-Re-w.fenwickRangeSum(Ve,Re,We))*w.averageNodeHeight.value}function ze(Re){var We;if(Re<=0)return 0;const Ie=w.parsedNodes.value;if(w.heightEstimationActive.value)return Ne(Re);if(w.heightTreeSize.value===Ie.length&&w.heightSumTree.value.length&&w.heightKnownTree.value.length){const Ge=w.averageNodeHeight.value,Ve=w.heightSumTree.value,lt=w.heightKnownTree.value,nt=_t=>_t<=0?0:w.fenwickRangeSum(Ve,0,_t)+(_t-w.fenwickRangeSum(lt,0,_t))*Ge;let pt=0,kt=Ie.length-1,Ct=Ie.length-1;for(;pt<=kt;){const _t=pt+kt>>1;nt(_t+1)>=Re?(Ct=_t,kt=_t-1):pt=_t+1}return Ct}let Be=Re;for(let Ge=0;Ge<Ie.length;Ge++){const Ve=(We=w.nodeHeights[Ge])!=null?We:w.averageNodeHeight.value;if(Be<=Ve)return Ge;Be-=Ve}return Math.max(0,Ie.length-1)}function $e(){if(!w.heightEstimationActive.value)return 0;let Re=0;const We=w.estimatedNodeHeights.value;for(let Ie=0;Ie<We.length;Ie++){if(!We[Ie])continue;const Be=w.nodeHeights[Ie];Number.isFinite(Be)&&Be>0||Re++}return Re}return{markFallbackHeightPrefixDirty:function(){H=!0},getFallbackNodeHeight:de,estimateHeightRange:Le,estimateIndexForOffset:ze,estimateIndexForOffsetFromEnd:function(Re){var We,Ie;const Be=w.parsedNodes.value;if(!Be.length)return 0;if(Re<=0)return Math.max(0,Be.length-1);if(w.heightEstimationActive.value){const Ve=(We=Ce()[Be.length])!=null?We:0;return Ne(Math.max(0,Ve-Re))}if(w.heightTreeSize.value===Be.length){const Ve=Le(0,Be.length);return ze(Math.max(0,Ve-Re))}let Ge=Re;for(let Ve=Be.length-1;Ve>=0;Ve--){const lt=(Ie=w.nodeHeights[Ve])!=null?Ie:w.averageNodeHeight.value;if(Ge<=lt)return Ve;Ge-=lt}return 0},getEstimatedNodeHeightCount:$e,buildVirtualHeightSummary:function(Re){var We;const Ie=w.parsedNodes.value.length;return{totalNodes:Ie,measuredCount:w.heightStats.count,estimatedCount:$e(),averageNodeHeight:w.averageNodeHeight.value,topSpacerHeight:Re.topSpacerHeight,bottomSpacerHeight:Re.bottomSpacerHeight,estimatedTotalHeight:Le(0,Ie),width:(We=Re.width)!=null?We:w.getContainerWidth()}}}})({parsedNodes:ct,nodeHeights:Za,heightStats:si,heightTreeSize:s0,heightSumTree:HT,heightKnownTree:WT,averageNodeHeight:Ab,heightEstimationActive:Yn,estimatedNodeHeights:Ja,getContainerWidth:Bo,hasCustomParagraphComponent:()=>!!Mn.value.paragraph,getPrefixCacheKeyParts:()=>{var w;const H=od(ae.value||ft("getFallbackHeightPrefix.clientWidth",()=>{var ee;return((ee=L.value)==null?void 0:ee.clientWidth)||0})),Z=((w=s.virtualScroll)==null?void 0:w.measurementKey)==null?"":String(s.virtualScroll.measurementKey);return[ct.value.length,si.count,Math.round(si.total),Math.round(100*Ab.value),Z,H,Yn.value?1:0,tv.value,te.value,Mn.value.paragraph?1:0]},fenwickRangeSum:GT}),Je(()=>ct.value.length,w=>{var H;ni(),w<=0?Uf():(w<s0.value&&(H=w,o0(),Xa(()=>UT(H))),w!==s0.value&&zf(w))},{immediate:!0});const sN=D(()=>{if(!Ze.value)return ct.value.map((ee,de)=>({node:ee,index:de}));const w=ct.value.length,H=$s(Ls.start,0,w),Z=$s(Ls.end,H,w);return ct.value.slice(H,Z).map((ee,de)=>({node:ee,index:H+de}))}),h0=D(()=>Ze.value?Ga(0,Math.min(Ls.start,ct.value.length)):0),p0=D(()=>{if(!Ze.value)return 0;const w=ct.value.length;return Ga(Math.min(Ls.end,w),w)});function Yb(){return jr.buildVirtualHeightSummary({topSpacerHeight:h0.value,bottomSpacerHeight:p0.value,width:Ul()})}function oN(){const w=ct.value,H=Yb();return Rt(st({},H),{probe:{paragraphReady:!!oe.value.paragraph,listItemReady:!!oe.value.listItem,listWrapperOverhead:oe.value.listWrapperOverhead,headingReadyLevels:Object.entries(oe.value.headings).filter(([,Z])=>!!Z).map(([Z])=>Number(Z))},nodes:w.map((Z,ee)=>{var de,Ce,Ne,Le,ze,$e,Re,We,Ie;return{index:ee,type:Z.type,estimateKind:(Ce=(de=Ja.value[ee])==null?void 0:de.kind)!=null?Ce:null,rendererKind:(Le=(Ne=Ja.value[ee])==null?void 0:Ne.rendererKind)!=null?Le:null,estimatedHeight:($e=(ze=Ja.value[ee])==null?void 0:ze.height)!=null?$e:null,estimatedContentHeight:(We=(Re=Ja.value[ee])==null?void 0:Re.contentHeight)!=null?We:null,measuredHeight:(Ie=Za[ee])!=null?Ie:null}})})}function m0(){return s.indexKey!=null?String(s.indexKey):os.value?`virtual-${qn()}`:"markdown-renderer"}function Zb(w){const H=String(w),Z=`${m0()}-`;if(!H.startsWith(Z))return null;const ee=H.slice(Z.length).match(/^(\d+)(?:$|-)/);if(!ee)return null;const de=Number(ee[1]);return!Number.isInteger(de)||de<0||de>=ct.value.length?null:de}function qn(){var w,H,Z;const ee=(w=s.virtualScroll)==null?void 0:w.sessionKey;return String(ee!=null&&ee!==""?ee:(Z=(H=s.indexKey)!=null?H:_.customId)!=null?Z:cn)}function is(){var w;const H=(w=s.virtualScroll)==null?void 0:w.threadKey;return H==null||H===""?void 0:String(H)}const iN=D(()=>{var w,H,Z;return(Z=is())!=null?Z:String((H=(w=s.indexKey)!=null?w:_.customId)!=null?H:cn)});function g0(w){var H;return(w??"")===((H=is())!=null?H:"")}function lr(){var w,H,Z;return H=(w=s.virtualScroll)==null?void 0:w.measurementKey,Z=(function(){const ee=p.value;return(function(de){var Ce,Ne;const Le=de.renderer,ze=Le==="monaco"?de.codeBlockMonacoOptions:void 0,$e=de.codeBlockProps,Re=Le==="shiki";return[de.isDark?"dark":"light",Le==="monaco"?"code-rich":Le==="pre"?"code-pre":"code-shiki",de.codeBlockStream===!1?"code-static":"code-stream",Cs(de.codeBlockMinWidth),Cs(de.codeBlockMaxWidth),...Re?[hee((Ce=$e?.themes)!=null?Ce:de.themes,(Ne=$e?.langs)!=null?Ne:de.langs)]:[],Cs(ze?.fontSize),Cs(ze?.lineHeight),Cs(ze?.fontFamily),Cs(ze?.tabSize),Cs(ze?.MAX_HEIGHT),Cs(ze?.wordWrap),Cs(ze?.wrappingIndent),Cs(ze?.padding),Cs($e?.showHeader),Cs($e?.showCopyButton),Cs($e?.showExpandButton),Cs($e?.showPreviewButton),Cs($e?.showCollapseButton),Cs($e?.showFontSizeButtons)].join("\0")})({renderer:ee,isDark:_.isDark,codeBlockStream:_.codeBlockStream,codeBlockMinWidth:_.codeBlockMinWidth,codeBlockMaxWidth:_.codeBlockMaxWidth,codeBlockMonacoOptions:ee==="monaco"?_.codeBlockMonacoOptions:void 0,codeBlockProps:_.codeBlockProps,themes:ee==="shiki"?_.themes:void 0,langs:ee==="shiki"?_.langs:void 0})})(),[H==null?"":String(H),Z].join("\0")}function Ul(){return Bo()}const Xf=D(()=>od(Ul())),Uo=D(()=>[lr(),Xf.value].join("\0")),rN=D(()=>{var w;return os.value?["virtual",(w=is())!=null?w:"",qn(),Uo.value].join("\0"):s.indexKey});function ec(){Bb.value+=1}function v0(w){return!(!w||!Number.isInteger(w.index)||w.index<0||w.index>=ct.value.length||w.sessionKey!==qn()||w.threadKey!==is()||w.layoutEpochKey!==Uo.value)}function Xb(w){const H=String(w),Z=Bi.get(H);return Z?v0(Z)?Z.index:null:Zb(H)}function Qb(w="async-node"){(Wo.size||Bi.size)&&(Wo.clear(),Bi.clear(),ec(),Dn(w))}const tc=jt(Cy,null),y0={reportHeight(w,H){if(!Xt.value)return;const Z=Xb(w);if(Z==null)return;const ee=Ri.get(Z);if(!ee)return;const de=Number(H),Ce=Ib(Z,ee);(function(Ne,Le,ze={}){Xa(()=>Nb(Ne,Le,ze))})(Z,Number.isFinite(de)&&de>0?Math.max(de,Ce||0):Ce)},markPending(w){if(!Xt.value)return;const H=Zb(w);H!=null&&(function(Z,ee){var de;const Ce=Bi.get(Z);if(Ce&&v0(Ce))return Wo.set(Z,Math.max(0,(de=Wo.get(Z))!=null?de:0)+1),ec(),void Dn("async-node");Wo.set(Z,1),Bi.set(Z,(function(Ne){return{index:Ne,sessionKey:qn(),threadKey:is(),layoutEpochKey:Uo.value}})(ee)),ec(),Dn("async-node")})(String(w),H)},markSettled(w){if(!Xt.value)return;const H=String(w),Z=Xb(w);(Z!=null||(function(ee){return Wo.has(String(ee))})(H))&&(function(ee){var de;const Ce=(de=Wo.get(ee))!=null?de:0;return!(Ce<=0||(Ce<=1?(Wo.delete(ee),Bi.delete(ee)):Wo.set(ee,Ce-1),ec(),Ce===1&&Dn("async-node"),0))})(H)&&Z!=null&&ar()}};function lN(){let w=0;for(const H of Ri.values())w+=ft("getVisibleDomHeight.offsetHeight",()=>{var Z;return(Z=H?.offsetHeight)!=null?Z:0});return Math.ceil(Math.max(0,w))}wn(Cy,{reportHeight(w,H){y0.reportHeight(w,H),tc?.reportHeight(w,H)},markPending(w){y0.markPending(w),tc?.markPending(w)},markSettled(w){y0.markSettled(w),tc?.markSettled(w)}});let k0,b0=null,nc=null;function Qf(w){return w!==!1&&w!=null&&w!==""}function Jb(){return Ze.value?(function(){if(!Ze.value)return!0;const w=ct.value.length,H=$s(Ls.start,0,w),Z=$s(Ls.end,H,w);if(H>=Z)return!0;for(let ee=H;ee<Z;ee++)if(!Nn.has(ee)||nh(ee)&&!Ri.has(ee))return!1;return!0})():Bt.value>=jf.value}function x0(){return ot.value===!0&&!ht.value&&r0.value===0&&Kr.size===0&&rr.size===0&&zo==null&&Jb()}function ex(){var w,H;if(((w=s.virtualScroll)==null?void 0:w.settleMode)!=="manual"||b0===qn()&&k0===is())return!0;const Z=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!Qf(Z)&&nc===Hu(Z)}function w0(){return x0()&&ex()}function aN(w,H){return H.totalNodes<=0?w==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?w==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function ql(w="manual",H){const Z=Yb(),ee=(function(de){return de||(ot.value!==!0?ct.value.length>0?"streaming":"estimating":!Jb()||rr.size>0||zo!=null?"measuring":w0()?"settled":"settling")})(H);return{sessionKey:qn(),threadKey:is(),phase:ee,nodeCount:Z.totalNodes,liveRange:{start:Ls.start,end:Ls.end},renderedCount:Bt.value,measuredCount:Z.measuredCount,estimatedCount:Z.estimatedCount,averageNodeHeight:Z.averageNodeHeight,topSpacerHeight:Z.topSpacerHeight,bottomSpacerHeight:Z.bottomSpacerHeight,visibleDomHeight:lN(),totalHeight:tx(),width:Z.width,final:ot.value===!0,stable:w0(),confidence:aN(ee,Z),reason:w}}function Mu(){const w=wu.value||we(),H=L.value;if(!w||!H)return null;const Z=w.ownerDocument||H.ownerDocument||document,ee=w===Z.documentElement||w===Z.body||w===Z.scrollingElement,de=ft("getScrollBox.scrollTop",()=>Pe(w,Z,ee)),Ce=ft("getScrollBox.scrollHeight",()=>{var Le,ze,$e,Re,We;return ee?Math.max((ze=(Le=Z.documentElement)==null?void 0:Le.scrollHeight)!=null?ze:0,(Re=($e=Z.body)==null?void 0:$e.scrollHeight)!=null?Re:0,(We=w.scrollHeight)!=null?We:0):w.scrollHeight}),Ne=ft("getScrollBox.clientHeight",()=>{var Le;return ee?((Le=Z.documentElement)==null?void 0:Le.clientHeight)||w.clientHeight||0:w.clientHeight});return{root:w,doc:Z,isViewportRoot:ee,scrollTop:de,scrollHeight:Ce,clientHeight:Ne}}function tx(){const w=ct.value.length,H=Math.max(0,Ga(0,w)),Z=ft("getRendererLogicalHeight.offsetHeight",()=>{var de,Ce;return(Ce=(de=L.value)==null?void 0:de.offsetHeight)!=null?Ce:0}),ee=Math.max(0,Z>0?Z:ft("getRendererLogicalHeight.scrollHeight",()=>{var de,Ce;return(Ce=(de=L.value)==null?void 0:de.scrollHeight)!=null?Ce:0}));return w<=0?Math.ceil(Z):Ze.value?H>0?Math.max(1,Math.ceil(H),(function(){let de=h0.value+p0.value;for(const Ce of Nn.values())Ce&&(de+=Math.max(0,ft("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ce.offsetHeight||0)));return Math.ceil(Math.max(0,de))})(),(function(de,Ce){return de<=0||Ce<=0?0:Ce<=de+Math.max(512,.05*de)?Math.ceil(Ce):0})(H,ee)):Math.max(1,Math.ceil(ee)):Xt.value?H>0||si.count>0||jr.getEstimatedNodeHeightCount()>0?(Nt.value&&Bt.value,Math.max(1,Math.ceil(ee),Math.ceil(H))):Math.ceil(ee):Math.max(1,Math.ceil(ee),Math.ceil(H))}function nx(w){const H=L.value;if(!H)return null;const Z=ft("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(de){return de.isViewportRoot?de.clientHeight:ft("getViewportBottomInRoot.getBoundingClientRect",()=>de.root.getBoundingClientRect().bottom)})(w)-Z.bottom}function cN(w={}){const H=w.requireViewport!==!1,Z=(function(Ce=64){const Ne=Mu(),Le=L.value;if(!Ne||!Le)return!1;const ze=(function(Re){if(Re.isViewportRoot)return{top:0,bottom:Re.clientHeight};const We=ft("getVirtualViewportRect.getBoundingClientRect",()=>Re.root.getBoundingClientRect());return{top:We.top,bottom:We.bottom}})(Ne),$e=ft("isRendererNearVirtualViewport.getBoundingClientRect",()=>Le.getBoundingClientRect());return $e.bottom>=ze.top-Ce&&$e.top<=ze.bottom+Ce})();if(H&&!Z)return null;const ee=(function(){const Ce=Mu(),Ne=L.value;if(!Ce||!Ne||Math.max(0,Ce.scrollHeight-Ce.scrollTop-Ce.clientHeight)>64)return null;const Le=nx(Ce);return Le==null?null:Le>=-8&&Le<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Le)}:null})();if(ee)return{anchor:ee,captured:!0};const de=Sb();if(de)return{anchor:{type:"node",nodeIndex:de.nodeIndex,offsetWithinNodePx:de.offsetWithinNodePx},captured:Z};if(w.allowFallback===!0){const Ce=(function(){const Ne=ct.value.length;return Ne<=0?null:{type:"node",nodeIndex:$s(ir.value,0,Math.max(0,Ne-1)),offsetWithinNodePx:0}})();return Ce?{anchor:Ce,captured:!1}:null}return null}function _0(w){let H=2166136261;for(let Z=0;Z<w.length;Z++)H^=w.charCodeAt(Z),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function uN(w,H){let Z=w;for(let ee=0;ee<H.length;ee++)Z^=H.charCodeAt(ee),Z=Math.imul(Z,16777619);return Z^=31,Z=Math.imul(Z,16777619),Z}const dN=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Jf(w,H=new WeakSet,Z=0){if(w==null||typeof w=="number"||typeof w=="boolean")return String(w);if(typeof w=="string")return`s:${(function(ee){const de=ee.length>8192?`${ee.slice(0,8192)}...${ee.length}`:ee;return`${ee.length}:${_0(de)}`})(w)}`;if(typeof w=="function")return"fn";if(typeof w!="object")return typeof w;if(H.has(w))return"cycle";if(Z>=6)return"max-depth";H.add(w);try{if(Array.isArray(w)){if(w.length<=160){const $e=[];for(let Re=0;Re<w.length;Re++)$e.push(Jf(w[Re],H,Z+1));return`a:${w.length}:${$e.join(",")}`}const Ce=[],Ne=[],Le=Math.max(0,w.length-32);let ze=2166136261;for(let $e=0;$e<w.length;$e++){const Re=Jf(w[$e],H,Z+1);ze=uN(ze,Re),$e<32&&Ce.push(Re),$e>=Le&&Ne.push(Re)}return[`a:${w.length}`,`h=${Ce.join(",")}`,`t=${Ne.join(",")}`,`all=${(ze>>>0).toString(36)}`].join(":")}const ee=w,de=Object.keys(ee).filter(Ce=>{const Ne=ee[Ce];return Ce!=="parent"&&Ce!=="el"&&Ce!=="component"&&(Ne==null||typeof Ne=="string"||typeof Ne=="number"||typeof Ne=="boolean"||dN.has(Ce))}).sort();return`o:${de.length}:${de.map(Ce=>`${Ce}=${Jf(ee[Ce],H,Z+1)}`).join(";")}`}finally{H.delete(w)}}let S0=-1,C0="",jl=[2166136261];function Eu(w){const H=ct.value[w];return H?_0(Jf(H)):""}function fN(w,H){let Z=w;for(let ee=0;ee<H.length;ee++)Z^=H.charCodeAt(ee),Z=Math.imul(Z,16777619);return Z>>>0}function A0(){var w,H;const Z=te.value;if(S0===Z)return C0;const ee=ct.value.length;let de=u0(ee);(S0!==Z-1||de>ee||jl.length<de+1)&&(de=0),de===0?jl=[2166136261]:jl.length=de+1;for(let Ce=de;Ce<ee;Ce++){const Ne=Eu(Ce);jl[Ce+1]=fN((w=jl[Ce])!=null?w:2166136261,Ne)}return jl.length=ee+1,C0=(((H=jl[ee])!=null?H:2166136261)>>>0).toString(36),S0=Z,C0}function sc(w,H={}){var Z;const ee=H.includeHeightCache===!0,de=(Z=H.includeContentHash)!=null?Z:ee,Ce=ee?(function(Le){const ze=(function(){var Ve,lt;const nt=Number((lt=(Ve=s.virtualScroll)==null?void 0:Ve.heightCacheLimit)!=null?lt:5e3);return!Number.isFinite(nt)||nt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(nt))})();if(!Number.isFinite(ze)||Le.length<=ze)return Le;const $e=new Map,Re=Ve=>{!Ve||$e.size>=ze||$e.set(Ve.index,Ve)},We=ct.value.length,Ie=$s(Ls.start-2*Ue.value,0,We),Be=$s(Ls.end+2*Ue.value,Ie,We);for(const Ve of Le)Ve.index>=Ie&&Ve.index<Be&&Re(Ve);const Ge=Math.max(1,Math.ceil(Le.length/ze));for(let Ve=0;Ve<Le.length&&$e.size<ze;Ve+=Ge)Re(Le[Ve]);for(let Ve=Le.length-1;Ve>=0&&$e.size<ze;Ve-=Ge)Re(Le[Ve]);return Array.from($e.values()).sort((Ve,lt)=>Ve.index-lt.index).slice(0,ze)})(VT().map(Le=>{var ze;const $e=ct.value[Le.index];return $e?Rt(st({},Le),{nodeType:String((ze=$e.type)!=null?ze:""),signature:Eu(Le.index)}):null}).filter(Le=>!!Le)):[],Ne=cN({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Ne||Ce.length||H.includeEmptyState===!0?Rt(st({sessionKey:w.sessionKey,threadKey:w.threadKey},Ne?{anchor:Ne.anchor,anchorCaptured:Ne.captured}:{anchorCaptured:!1}),{metrics:w,width:w.width,contentHash:de?A0():void 0,measurementKey:lr()||void 0,heightCache:Ce.length?Ce:void 0}):null}function M0(w){var H,Z;const ee=Mu();if(!ee)return;const de=(function(Le){const ze=L.value;if(!ze)return null;const $e=be(ze,Le.root),Re=ct.value.length,We=ft("getRendererBottomOffsetWithinRoot.offsetHeight",()=>ze.offsetHeight||0),Ie=Math.max(0,We>0?We:Re>0?ft("getRendererBottomOffsetWithinRoot.scrollHeight",()=>ze.scrollHeight||0):0),Be=tx();return $e+Math.max(Ie,Be)})(ee);if(de==null)return;const Ce=Math.max(0,w.distanceFromBottomPx),Ne=Math.max(0,de-ee.clientHeight-Ce);(function(Le){e0=$u()+120,_u=Le})(Ne),ee.isViewportRoot?(Z=(H=ee.doc.defaultView)==null?void 0:H.scrollTo)==null||Z.call(H,0,Ne):x4(ee.root,ee.doc,Ne,{isReverseFlexScrollRoot:Te,getNormalizedScrollTop:Pe})}const E0=[];function sx(){if(P)for(Wl!=null&&(le?.(Wl),Wl=null);E0.length;){const w=E0.pop();w!=null&&window.clearTimeout(w)}}function oc(w){const H=!!Ho.value;Ho.value=null,e0=0,_u=null,sx(),H&&w&&Dn(w)}function ic(){if(!Ho.value||!P||Wl!=null)return;const w=()=>{Wl=null;const H=Ho.value;H&&M0(H)};Wl=V?V(w):null,Wl==null&&w()}function ox(w,H={}){const Z=ct.value.length;return Z<=0?[]:w.filter(ee=>!(!Number.isInteger(ee.index)||ee.index<0||ee.index>=Z)&&!(!Number.isFinite(ee.height)||ee.height<=0)&&!(H.requireSignature&&!ee.signature)&&!(H.requireCompatibilityMetadata&&!ee.nodeType&&!ee.signature)&&(function(de){var Ce;const Ne=ct.value[de.index];return!(!Ne||de.nodeType&&de.nodeType!==String((Ce=Ne.type)!=null?Ce:"")||de.signature&&de.signature!==Eu(de.index))})(ee))}function ix(w){const H=od(Ul()),Z=od(w);return H!==-1&&Z!==-1&&H===Z}function T0(w){var H;const Z=Number(w?.width);if(Number.isFinite(Z)&&Z>0)return Z;const ee=Number((H=w?.metrics)==null?void 0:H.width);return Number.isFinite(ee)&&ee>0?ee:null}function rx(w){var H;return w.sessionKey===qn()&&!!g0(w.threadKey)&&((H=w.measurementKey)!=null?H:"")===lr()&&!!ix(T0(w))&&!!(function(Z){const ee=Z.heightCache;return!!ee?.length&&(lx(Z)?ee.some(de=>!!(de.nodeType||de.signature)):ee.some(de=>!!de.signature))})(w)}function lx(w){return!!(w.contentHash&&w.contentHash===A0())}function hN(w){return!lx(w)}let Vl=null,Kl=null,eh=null,Tu=null,Nu=null;function N0(w){var H;const Z=w.map(de=>{var Ce,Ne;return[de.index,Math.round(10*de.height),(Ce=de.nodeType)!=null?Ce:"",(Ne=de.signature)!=null?Ne:""].join("")}).join(""),ee=od(Ul());return[(H=is())!=null?H:"",qn(),lr(),ct.value.length,ee,w.length,_0(Z)].join(":")}function ax(w=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Xt.value||!w?.length||ct.value.length<=0||!ix((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const Z=ox(w,{requireSignature:!0});if(!Z.length)return!1;const ee=N0(Z);return ee===Vl?(Kl="standalone",!0):(Lb(Z,{mode:"merge"}),ni(),Vl=ee,Kl="standalone",Ou(),Dn("restore"),!0)}function I0(w,H={}){var Z,ee,de;if(!Xt.value||!w||w.sessionKey!==qn()||!g0(w.threadKey)||ct.value.length<=0)return!1;const Ce=!!((Z=w.heightCache)!=null&&Z.length)&&!th(),Ne=!w.anchor||w.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:w.anchor,Le=H.restoreAnchor===!0&&!!Ne&&!th()&&Number(T0(w))>0;let ze=!1;if((ee=w.heightCache)!=null&&ee.length&&rx(w)){const Re=ox(w.heightCache,{requireCompatibilityMetadata:!w.contentHash,requireSignature:hN(w)});Re.length&&(Lb(Re,{mode:"merge"}),ni(),Vl=N0(Re),Kl="restore",Ou(),ze=!0)}if(Ce||Le)return!1;if(!H.restoreAnchor||!Ne)return ze&&Dn("restore"),!0;const $e=(function(Re,We){var Ie;const Be=Re.anchor,Ge=Be?Be.type==="bottom"?`bottom:${Math.round(Be.distanceFromBottomPx)}`:`node:${Be.nodeIndex}:${Math.round(Be.offsetWithinNodePx)}`:"none";return[(Ie=is())!=null?Ie:"",qn(),lr(),Xf.value,We,Ge].join(":")})(w,(de=H.restoreToken)!=null?de:"imperative");return eh===$e?(ze&&Dn("restore"),!0):(eh=$e,(function(Re){const We=()=>{if(Re.type==="node")return oc(),void Cb({nodeIndex:Re.nodeIndex,offsetWithinNodePx:Re.offsetWithinNodePx});if(Wf(),Ya.value=null,Ho.value=Re,sx(),M0(Re),P)for(const Ie of[0,120,280,480])E0.push(window.setTimeout(()=>{const Be=Ho.value;Be&&M0(Be)},Ie))};(function(Ie){if(!Ze.value)return!1;const Be=ct.value.length;return!(Be<=0||(ir.value=Ie.type==="node"?$s(Ie.nodeIndex,0,Be-1):Be-1,Cu(),0))})(Re)?yt(We):We()})(Ne),Dn("restore"),!0)}function th(){const w=Ul();return Number.isFinite(w)&&w>0}function cx(w){var H;return w.sessionKey===qn()&&!!g0(w.threadKey)&&(ct.value.length<=0||!(!((H=w.heightCache)!=null&&H.length)||th())||!(!(w.anchor&&Number(T0(w))>0)||th()))}function L0(){Js.clear();for(const w of Object.keys(Za)){const H=Number(w);Number.isInteger(H)&&H>=0&&H<ct.value.length&&Tb(H)}}function Iu(){zo!=null&&(le?.(zo),zo=null),W0()}function ux(){return!P||ke?Promise.resolve():new Promise(w=>{let H=!1,Z=null;const ee=()=>{H||(H=!0,Z!=null&&window.clearTimeout(Z),w())};if(V)return V(ee),void(Z=window.setTimeout(ee,50));Z=window.setTimeout(ee,0)})}function $0(w,H=is(),Z=Uo.value){return qn()===w&&is()===H&&Uo.value===Z}function F0(){return Hn(this,arguments,function*(w={}){var H,Z,ee,de,Ce;const Ne=qn(),Le=is(),ze=Uo.value,$e=(H=w.frames)!=null?H:2,Re=(Z=w.timeoutMs)!=null?Z:120,We=(ee=w.reason)!=null?ee:"manual",Ie=w.expectedSettledTokenKey,Be=w.flushPendingTimers===!0,Ge=ql(We),Ve=()=>Rt(st({},Ge),{phase:Ge.final?"settling":Ge.phase,stable:!1,confidence:Ge.confidence==="final"?"mixed":Ge.confidence,reason:We}),lt=()=>$0(Ne,Le,ze)&&(Ie==null||Fu()===Ie);for(let Ct=0;Ct<$e;Ct++){if(yield yt(),!lt()||(yield ux(),!lt()))return Ve();ar(),Iu()}if(yield(function(Ct){return!P||Ct<=0?Promise.resolve():new Promise(_t=>window.setTimeout(_t,Ct))})(Re),!lt()||(Be&&Pb(),ar(),Iu(),!lt()))return Ve();const nt=x0();nt&&(b0=Ne,k0=Le,((de=s.virtualScroll)==null?void 0:de.settleMode)==="manual"&&Ie!=null&&Qf((Ce=s.virtualScroll)==null?void 0:Ce.settledToken)&&Fu()===Ie&&(nc=Hu(s.virtualScroll.settledToken)));const pt=lt()&&nt&&ex(),kt=ql(We,pt?"final":void 0);return P0(kt,!0),kt})}let O0="content",Gl=null,Yl=null,R0=0,Lu=null,rc=null,B0=null,D0=null;function $u(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function dx(w){var H,Z;const ee=Lu;if(!ee)return!0;const de=(Z=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?Z:1;return Math.abs(w.totalHeight-ee.totalHeight)>de||w.sessionKey!==ee.sessionKey||w.phase!==ee.phase||w.stable!==ee.stable||w.final!==ee.final||w.threadKey!==ee.threadKey||w.nodeCount!==ee.nodeCount||w.measuredCount!==ee.measuredCount||w.width!==ee.width}function Fu(w=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return Cs(w)}function fx(w,H){var Z,ee;return[w,H.sessionKey,(Z=H.threadKey)!=null?Z:"",lr(),A0(),Cs((ee=s.virtualScroll)==null?void 0:ee.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Ou(){B0=null,D0=null,rc=null}function pN(w){const H=w.heightCache;return H?.length?N0(H):""}function Ru(w){var H,Z,ee;const de=w.metrics,Ce=w.anchor?(Ne=w.anchor).type==="bottom"?`bottom:${Math.round(Ne.distanceFromBottomPx)}`:`node:${Ne.nodeIndex}:${Math.round(Ne.offsetWithinNodePx)}`:"none";var Ne;return[w.sessionKey,(H=w.threadKey)!=null?H:"",(Z=w.measurementKey)!=null?Z:lr(),(ee=w.contentHash)!=null?ee:"",pN(w),Ce,w.anchorCaptured?1:0,de.liveRange.start,de.liveRange.end,de.renderedCount,de.nodeCount,Math.round(de.totalHeight),Math.round(de.width),de.phase,de.stable?1:0].join("\0")}function P0(w,H=!1){if(!Xt.value||(function(Ne=!1){return!Ne&&os.value&&!Is.value})(H))return;const Z=H||dx(w),ee=(function(Ne,Le=!1){return Le||Ne.stable||Ne.phase==="final"?{state:sc(Ne,{includeHeightCache:!0})}:{state:sc(Ne)}})(w,H),de=ee.state,Ce=!!(de&&(Z||(function(Ne,Le=!1){return!!Le||Ru(Ne)!==rc})(de,H)));if(Z&&(R(w),Lu=w,R0=$u()),de&&Ce&&(z(de),de.anchor&&W(de.anchor),rc=Ru(de)),w.stable){const Ne=fx("settled",w);if(Ne!==B0){B0=Ne;const Le=sc(w,{includeHeightCache:!0});Le&&(z(Le),rc=Ru(Le)),(function(ze){o("render-settled",ze)})(w)}}if(w.phase==="final"){const Ne=fx("final",w);if(Ne!==D0){D0=Ne;const Le=sc(w,{includeHeightCache:!0});Le&&(z(Le),rc=Ru(Le)),(function(ze){o("render-final",ze)})(w)}}}function H0(){Gl!=null&&(le?.(Gl),Gl=null),Yl!=null&&P&&(window.clearTimeout(Yl),Yl=null)}function hx(){Gl=null,Yl=null,(function(w){if(rr.size>0||zo!=null)return!0;switch(w){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(O0)&&(ar(),Iu()),P0(ql(O0))}function Dn(w){var H,Z;if(!Xt.value||(O0=w,Gl!=null||Yl!=null))return;const ee=Math.max(0,(Z=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?Z:32),de=Math.max(0,ee-($u()-R0)),Ce=()=>{Yl=null,Gl=V?V(hx):null,Gl==null&&hx()};P&&de>0?Yl=window.setTimeout(Ce,de):Ce()}function px(){_b.value+=1}function nh(w){if(Nt.value&&w>=Bt.value){const H=ct.value[w],Z=Qe.value===!0&&ot.value!==!0&&w>=ct.value.length-2,ee=H?.type==="code_block"||H?.type==="image"||H?.type==="mermaid"||H?.type==="infographic";if(!Z||ee)return!1}return!Oi.value||w<je.value||a0.value.has(w)}function lc(w){const H=Gf.get(w);H&&(H(),Gf.delete(w));const Z=Qa.get(w);Z&&(Z.destroy(),Qa.delete(w)),Yf(w)}function sh(w,H){let Z=!1;if(H){const Ce=Nn.get(w);Nn.set(w,H),Ce!==H&&(Z=!0)}else Nn.delete(w)&&(Z=!0);if(Z&&px(),H||Yf(w),!$b.value||!ce)return lc(w),void(H&&Oi.value&&Gr(w,!0));if(!Ze.value&&Oi.value&&!U.value&&Qa.size>=ue.value&&(U.value||(U.value=!0,c0()),!$b.value||!ce))return lc(w),void(H&&Gr(w,!0));if(w<je.value&&!Ze.value||a0.value.has(w))return lc(w),void Gr(w,!0);if(!H)return void lc(w);lc(w);const ee=ce(H,{rootMargin:Ee.value});if(!ee)return;Qa.set(w,ee),Gr(w,ee.isVisible.value),Oi.value&&(function(Ce){if(!P||!Oi.value)return;Yf(Ce);const Ne=Ce%17*23,Le=window.setTimeout(()=>{if(Hb.delete(Ce),!Oi.value||a0.value.has(Ce))return;const ze=Nn.get(Ce);if(!ze)return;const $e=we(ze),Re=ze.ownerDocument||document,We=Re.defaultView||window,Ie=!$e||$e===Re.documentElement||$e===Re.body,Be=!Ie&&$e?ft("nodeVisibilityFallback.root.getBoundingClientRect",()=>$e.getBoundingClientRect()):null,Ge=Ie?0:Be.top,Ve=Ie?ft("nodeVisibilityFallback.clientHeight",()=>{var nt,pt;return(pt=(nt=We.innerHeight)!=null?nt:$e?.clientHeight)!=null?pt:0}):Be.bottom,lt=ft("nodeVisibilityFallback.node.getBoundingClientRect",()=>ze.getBoundingClientRect());lt.bottom>=Ge-500&<.top<=Ve+500&&Gr(Ce,!0)},1800+Ne);Hb.set(Ce,Le)})(w);let de=null;de=Je(()=>ee.isVisible.value,Ce=>{if(Ce){Yf(w),Gr(w,!0),de?.(),Gf.delete(w),Qa.get(w)===ee&&Qa.delete(w);try{ee.destroy()}catch{}}},{immediate:!0}),Gf.set(w,de),Ze.value&&gi()}function W0(){zo=null,Xa(()=>{let w=!1;for(const[H,Z]of rr)rr.delete(H),Ri.get(H)===Z.el&&zl.get(H)===Z.version&&(w=Nb(H,Z.height,{allowShrink:Z.allowShrink})||w);return w})}function ac(){zo!=null&&(le?.(zo),zo=null),rr.clear()}function oh(w,H){(function(Z,ee,de){var Ce;if(!Number.isFinite(de)||de<=0||Ri.get(Z)!==ee)return;const Ne=zl.get(Z);if(Ne==null)return;const Le=ct.value[Z],ze=ht.value&&ot.value!==!0&&!((Ce=s.nodes)!=null&&Ce.length)&&Z>=ct.value.length-2,$e=!(Le?.loading===!0||ze),Re=rr.get(Z),We=Re?Re.allowShrink&&$e:$e,Ie=Re&&!We?Math.max(Re.height,de):de;rr.set(Z,{height:Ie,allowShrink:We,version:Ne,el:ee}),zo==null&&(zo=V?V(W0):null,zo==null&&W0())})(w,H,Ib(w,H))}function ar(){for(const[w,H]of Ri)H&&oh(w,H)}function mx(){Po?.disconnect(),Po=null,qs.clear()}function z0(){for(;qf.length;)Kf(qf.pop())}Je(Is,w=>{w&&Dn("content")},{flush:"post"}),t({getVirtualMetrics:ql,captureVirtualState:function(w={}){var H;return sc(ql("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:w.allowFallbackAnchor===!0,requireViewport:w.requireViewport===!0,includeEmptyState:(H=w.includeEmptyState)==null||H})},restoreVirtualState:function(w,H={}){const Z=H.restoreAnchor===!0,ee=H.restoreToken==null?"imperative":String(H.restoreToken);Tu=w,Nu={restoreAnchor:Z,restoreToken:ee,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!I0(w,{restoreAnchor:Z,restoreToken:ee,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&cx(w)||(Tu=null,Nu=null)},forceMeasure:function(w="manual"){return Hn(this,null,function*(){yield yt(),yield ux(),ar(),Iu(),yield yt();const H=ql(w);return P0(H,!0),H})},settle:F0,scrollToNode:function(w,H="start"){oc(),Wf();const Z=ct.value.length;if(Z<=0)return;const ee=$s(w,0,Z-1),de=()=>{var Ce;const Ne=DT({nodeIndex:ee,offsetWithinNodePx:0}),Le=t0(ee),ze=Mu(),$e=(Ce=ze?.clientHeight)!=null?Ce:0,Re=RT();let We=Ne;if(H==="center")We=Ne-$e/2+Le/2;else if(H==="end")We=Ne-$e+Le;else if(H==="nearest"&&Re!=null){if(Ne>=Re&&Ne+Le<=Re+$e)return;We=Ne<Re?Ne:Ne-$e+Le}BT(Math.max(0,We)),gi({immediate:!0}),Ze.value&&(ir.value=ee,Cu())};if(Ze.value)return ir.value=ee,Cu(),void yt(de);de()}}),Je(()=>ut.value,w=>{if(!w){mx();for(const H of Vr.values())for(const Z of H)Kf(Z);Vr.clear(),zl.clear(),z0(),ac()}},{immediate:!0}),Je(ot,w=>{w&&(function(){if(P&&ot.value&&Ri.size){z0();for(const H of[80,240,640]){const Z=Db(H,()=>{for(const[ee,de]of Ri)de&&oh(ee,de)},"final");Z!=null&&qf.push(Z)}}})(),Dn(w?"final":"content")});const mN=w4(()=>Dn("content"),16),gN=w4(()=>Dn("batch"),16);Je([()=>ct.value.length,()=>Bt.value],()=>{Ho.value&&ic(),mN()},{flush:"post",immediate:!0}),Je([()=>Ls.start,()=>Ls.end],()=>{gN()},{flush:"post"});const{cleanupBatchScheduler:vN}=(function(w){const{props:H,isClient:Z,isTestEnv:ee,parsedNodesIdentity:de,parsedNodeCount:Ce,desiredRenderedCount:Ne,datasetKey:Le,batchingEnabled:ze,incrementalRenderingActive:$e,resolvedBatchSize:Re,resolvedInitialBatch:We,renderedCount:Ie,adaptiveBatchSize:Be,previousRenderContext:Ge,previousBatchConfig:Ve,requestFrame:lt,cancelFrame:nt,hasIdleCallback:pt,cleanupNodeVisibility:kt,onDatasetKeyChanged:Ct,onDatasetChanged:_t}=w;let At=null,zt="raf",qt=null,xn=0,Fs=!1,Ss=!1;const vi=new Set,Di=new Set;function ju(){if(Z){At!=null&&(zt==="raf"&&nt?nt(At):zt==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(At):zt==="timeout"&&window.clearTimeout(At),At=null),xn+=1;for(const js of vi)nt&&nt(js);for(const js of Di)window.clearTimeout(js);vi.clear(),Di.clear(),qt=null,Fs=!1,Ss=!1}}function hh(){return typeof performance<"u"?performance.now():Date.now()}function $x(js){(function(cr){var Zr;if(!$e.value)return;const ur=Math.max(2,(Zr=H.renderBatchBudgetMs)!=null?Zr:6),dr=Math.max(1,Re.value||1),yi=Math.max(1,Math.floor(dr/4));cr>1.5*ur?Be.value=Math.max(yi,Math.floor(.8*Be.value)):cr<.6*ur&&Be.value<dr&&(Be.value=Math.min(dr,Math.ceil(1.2*Be.value)))})(js),Fs=!1;const ko=Ss||Ie.value<Ne.value;Ss=!1,ko&&Rx()}function Fx(js,ko={}){var cr,Zr;if(!$e.value)return;const ur=Ne.value;if(Ie.value>=ur)return;const dr=Math.max(1,js),yi=()=>{const dc=hh();At=null;const Vu=qt??dr;qt=null;const fc=hh();Ie.value=Math.min(ur,Ie.value+Vu),kt(Ie.value),(function(Y0,ph){if(!Z)return void $x(ph);Fs=!0;const Bx=++xn;yt().then(()=>{var Dx;if(Bx!==xn)return;const DN=hh(),PN=Math.max(ph,DN-Y0),Px=()=>{Bx===xn&&$x(PN)};if(lt){let Xl=null,hc=null,Wx=!1;const zx=()=>{Wx||(Wx=!0,Xl!==null&&(vi.delete(Xl),Xl=null),hc!==null&&(Di.delete(hc),window.clearTimeout(hc),hc=null),Px())};return Xl=lt(()=>{zx()}),vi.add(Xl),hc=window.setTimeout(()=>{Xl!==null&&nt&&nt(Xl),zx()},Math.max(32,(Dx=H.renderBatchIdleTimeoutMs)!=null?Dx:120)),void Di.add(hc)}const Hx=window.setTimeout(()=>{Di.delete(Hx),Px()},0);Di.add(Hx)})})(dc,hh()-fc)};if(!Z||ko.immediate)return void yi();const Xr=Math.max(0,(cr=H.renderBatchDelay)!=null?cr:16);if(qt=qt!=null?Math.max(qt,dr):dr,At==null){if(!ee&&pt&&window.requestIdleCallback){const dc=Math.max(0,(Zr=H.renderBatchIdleTimeoutMs)!=null?Zr:120);return zt="idle",void(At=window.requestIdleCallback(()=>yi(),{timeout:dc}))}if(lt&&!ee)return zt="raf",void(At=lt(()=>{Xr===0?yi():(zt="timeout",At=window.setTimeout(()=>yi(),Xr))}));zt="timeout",At=window.setTimeout(()=>yi(),Xr)}}function Ox(js,ko={}){Fs?Ss=!0:js==null?Rx():Fx(js,ko)}function Rx(){$e.value&&Fx(ze.value?Math.max(1,Math.round(Be.value)):Math.max(1,Re.value))}return Je([de,Ce,Le,$e,Re,We,()=>H.renderBatchDelay],()=>{var js;const ko=Ce.value,cr=Ge.value,Zr=Le.value,ur=!Object.is(Zr,cr.key),dr=ko!==cr.total,yi=ur||dr;Ge.value={key:Zr,total:ko};const Xr=Ve.value,dc=(js=H.renderBatchDelay)!=null?js:16,Vu=Xr.batchSize!==Re.value||Xr.initial!==We.value||Xr.delay!==dc||Xr.enabled!==$e.value;Ve.value={batchSize:Re.value,initial:We.value,delay:dc,enabled:$e.value},ur&&Ct(ko),(yi||Vu||!$e.value)&&ju(),(yi||Vu)&&(Be.value=Math.max(1,Re.value||1)),yi&&_t();const fc=Ne.value;if(!ko)return Ie.value=0,void kt(0);if(!$e.value)return Ie.value=fc,void kt(Ie.value);const Y0=ur||cr.total===0;Ie.value=Y0||Vu?Math.min(fc,We.value):Math.min(Ie.value,fc);const ph=Math.max(1,We.value||Re.value||ko);Ie.value<fc?Ox(ph,{immediate:!Z}):kt(Ie.value)},{immediate:!0}),Je(Ne,(js,ko)=>{$e.value&&(typeof ko=="number"&&js<=ko||js>Ie.value&&Ox())}),{cleanupBatchScheduler:ju}})({props:_,isClient:P,isTestEnv:ke,parsedNodesIdentity:gs,parsedNodeCount:ws,desiredRenderedCount:jf,datasetKey:rN,batchingEnabled:it,incrementalRenderingActive:Nt,resolvedBatchSize:Oe,resolvedInitialBatch:je,renderedCount:Bt,adaptiveBatchSize:Yt,previousRenderContext:ts,previousBatchConfig:zn,requestFrame:V,cancelFrame:le,hasIdleCallback:J,cleanupNodeVisibility:eN,onDatasetKeyChanged:w=>{ac(),Uf(),ni(),Ou(),w>0&&zf(w)},onDatasetChanged:()=>{Ze.value&&gi({immediate:!0})}});Je([Fb,Ze,()=>L.value,()=>Y()],([w,H])=>{if(!w)return Wb(),void l0();tN(),H?gi({immediate:!0}):l0()},{flush:"post",immediate:!0}),Je([()=>ct.value.length,()=>Ze.value],w=>Hn(null,[w],function*([H,Z]){Z&&H&&P&&(yield yt(),gi({immediate:!0}))}),{flush:"post"}),Je(Yn,w=>{w&&(function(){var H;if(Ws.value&&Zs.value&&Gn.value&&((H=mo.value)!=null&&H[1]))return;const Z=vt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ee=vt({type:"list_item",children:[Z],raw:"- Probe paragraph text"}),de=vt({type:"list",ordered:!1,items:[ee],raw:"- Probe paragraph text"});Ws.value=Z,Zs.value=ee,Gn.value=de;const Ce={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ne=1;Ne<=6;Ne++)Ce[Ne]=vt({type:"heading",level:Ne,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ne)} Probe heading`});mo.value=Ce})()},{immediate:!0}),Je([()=>L.value,Yn],()=>{if(!Yn.value)return f0(),void(ae.value=0);Ub(),f0(),Yn.value&&L.value&&typeof ResizeObserver<"u"&&(Au=new ResizeObserver(()=>{Ub(),Ya.value&&Su(),Ho.value&&ic(),Dn("resize")}),Au.observe(L.value))},{immediate:!0}),Je([Yn,ti,Uo],()=>Hn(null,null,function*(){if(!Yn.value)return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ni();yield yt(),(function(){if(!Yn.value||typeof window>"u")return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ni();const w={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=zb(d0(O.value),".paragraph-node");w.paragraph=iv(O.value,H,"pre-wrap");const Z=d0(q.value),ee=Z?.querySelector(".paragraph-node");w.listItem=iv(q.value,ee,"pre-wrap");const de=ft("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ne,Le;return(Le=(Ne=X.value)==null?void 0:Ne.offsetHeight)!=null?Le:0}),Ce=ft("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ne,Le;return(Le=(Ne=q.value)==null?void 0:Ne.offsetHeight)!=null?Le:0});w.listWrapperOverhead=Math.max(0,de-Ce);for(let Ne=1;Ne<=6;Ne++){const Le=zb(d0(ie[Ne]),`h${Ne}`);w.headings[Ne]=iv(ie[Ne],Le,"pre-wrap")}oe.value=w,ni()})()}),{flush:"post",immediate:!0}),Je(()=>ct.value.length,()=>{Ze.value&&gi({immediate:!0})}),Je([Yn,ae],()=>{ni(),Ze.value&&gi({immediate:!0}),Ya.value&&Su(),Ho.value&&ic(),Dn("resize")},{immediate:!1}),Je(()=>Oi.value,w=>{if(w)for(const[H,Z]of Nn)sh(H,Z);else if(c0(),Ze.value)gi({immediate:!0});else for(const[H,Z]of Nn)Z&&Gr(H,!0)},{immediate:!1}),Je([Ee,ue,()=>Y()],()=>{var w;(w=ce.refresh)==null||w.call(ce);for(const[H,Z]of Nn)sh(H,Z)},{immediate:!1}),Je([()=>_.viewportPriority,()=>ct.value.length,ue],([w,H,Z])=>{if(w!==!1){if(U.value&&(H<=200||H<=Z)){U.value=!1;for(const[ee,de]of Nn)sh(ee,de)}}else U.value=!1}),Je(()=>Bt.value,()=>{Ze.value&&gi({immediate:!0})}),Je([ir,go,Ue,()=>ct.value.length,Ze],()=>{Cu()},{immediate:!0});let Bu=null,Du=!1,cc=null;function Pu(){Bu=null,b0=null,k0=void 0,nc=null,Ou()}function U0(){ac(),Uf(),ni(),Js.clear();const w=ct.value.length;w>0&&zf(w),L0()}function q0(){H0(),Pb(),Lu=null,Vl=null,Kl=null,eh=null,Tu=null,Nu=null,Du=!1,Pu(),Qb("restore"),Wf(),oc()}function Hu(w){var H;return[(H=is())!=null?H:"",qn(),lr(),Xf.value,Fu(w),ct.value.length,Math.round(Ga(0,ct.value.length)),Math.round(Ul()),si.count,Math.round(si.total)].join(":")}function gx(){return Hn(this,null,function*(){var w,H,Z,ee;const de=(w=s.virtualScroll)==null?void 0:w.settledToken,Ce=Fu(de),Ne=qn(),Le=is(),ze=Uo.value;if(Xt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&Qf(de))if(x0()){if(Hu(de)!==nc&&!Du){Du=!0;try{const $e=yield F0({reason:"manual",expectedSettledTokenKey:Ce}),Re=Fu()===Ce;$0(Ne,Le,ze)&&$e.sessionKey===Ne&&$e.threadKey===Le&&Re&&$e.stable&&$e.phase==="final"&&(nc=Hu((Z=s.virtualScroll)==null?void 0:Z.settledToken))}finally{Du=!1,yield yt();const $e=(ee=s.virtualScroll)==null?void 0:ee.settledToken,Re=Qf($e)?Hu($e):"";$0(Ne,Le,ze)&&Re&&nc!==Re&&gx()}}}else Dn("manual")})}Je(Xt,(w,H)=>{if(w!==H){if(!w)return q0(),void H0();q0(),U0(),cc=Uo.value,Dn("content")}},{flush:"post"}),Je([Xt,Uo],([w,H])=>{w?cc!=null?cc!==H&&(cc=H,(function(Z="resize"){ac(),Uf(),ni(),Js.clear();const ee=ct.value.length;ee>0&&zf(ee),L0(),Vl=null,Kl=null,eh=null,Lu=null,Du=!1,Pu(),ax(),yt(()=>{ar(),Ya.value&&Su(),Ho.value&&ic(),Dn(Z)})})("resize")):cc=H:cc=null},{flush:"post",immediate:!0}),Je([Xt,()=>qn(),()=>is()],([w])=>{w&&(q0(),U0(),Qb("content"),Dn("content"))}),Je([Xt,()=>qn(),()=>is(),Uo,()=>ct.value.length],([w])=>{w&&(function(H="async-node"){let Z=!1;for(const[ee,de]of Array.from(Bi.entries()))v0(de)||(Bi.delete(ee),Wo.delete(ee),Z=!0);Z&&(ec(),Dn(H))})("async-node")},{flush:"post"}),Je([Xt,()=>{var w;return(w=s.virtualScroll)==null?void 0:w.sessionKey},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.measurementKey},()=>s.indexKey,()=>te.value],([w])=>{w&&(Ou(),(function(H="content"){if(!Xt.value)return;const Z=[],ee=ct.value.length,de=u0(ee);for(const Ce of Array.from(Js.keys())){if(Ce>=ee){Z.push(Ce);continue}if(Ce<de)continue;const Ne=Eu(Ce),Le=Js.get(Ce);Le!=null&&Le!==Ne&&Z.push(Ce),Js.set(Ce,Ne)}for(const Ce of Array.from(Js.keys()))Ce>=ee&&Js.delete(Ce);Z.length&&((function(Ce,Ne={}){const Le=Array.from(Ce,Number);Eb(Le);let ze=0;if(Xa(()=>(ze=jT(Le,Ne),ze>0)),ze>0)(function($e){for(const Re of $e)Js.delete(Re)})(Le);else for(const $e of Le)qr.delete($e)})(Z,{notify:!1}),ni(),Pu(),Ya.value&&Su(),Ho.value&&ic(),Dn(H))})("content"))},{flush:"post",immediate:!0}),Je([Xt,()=>ct.value.length,()=>qn(),()=>is()],([w,H,Z,ee],[de,Ce,Ne,Le])=>{w&&de&&Z===Ne&&ee===Le&&H!==Ce&&Pu()},{flush:"post"}),Je([Xt,()=>{var w;return(w=s.virtualScroll)==null?void 0:w.heightCache},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.heightCacheWidth},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.restoreState},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.measurementKey},()=>ct.value.length,()=>qn(),ae],()=>{ax()},{flush:"post",immediate:!0}),Je([Xt,()=>{var w;return(w=s.virtualScroll)==null?void 0:w.restoreState},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.restoreAnchor},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.measurementKey},()=>ct.value.length,()=>qn(),ae],w=>Hn(null,[w],function*([H,Z]){if(!H||!Z)return;yield yt();const ee=(function(){var de;const Ce=(de=s.virtualScroll)==null?void 0:de.restoreAnchor;return Ce==null||Ce===!1?null:Ce===!0?"true":String(Ce)})();I0(Z,{restoreAnchor:ee!=null,restoreToken:ee??void 0})}),{flush:"post",immediate:!0}),Je([Xt,ae,()=>{var w;return(w=s.virtualScroll)==null?void 0:w.restoreState},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.measurementKey}],([w])=>{var H;if(!w)return;const Z=(H=s.virtualScroll)==null?void 0:H.restoreState;Z&&Vl&&Kl==="restore"&&(rx(Z)||(U0(),Vl=null,Kl=null,Dn("resize")))},{flush:"post"}),Je([Xt,()=>ct.value.length,()=>qn(),ae],w=>Hn(null,[w],function*([H]){var Z;const ee=Tu,de=Nu;H&&ee&&(yield yt(),!I0(ee,{restoreAnchor:de?.restoreAnchor===!0,restoreToken:(Z=de?.restoreToken)!=null?Z:"imperative",allowUncapturedAnchor:de?.allowUncapturedAnchor===!0})&&cx(ee)||(Tu=null,Nu=null))}),{flush:"post",immediate:!0}),Je([Xt,ot,()=>{var w;return(w=s.virtualScroll)==null?void 0:w.settleMode},()=>qn(),()=>is(),Uo,r0,Rb,()=>Bt.value,jf,()=>si.count,()=>si.total],([w,H,Z])=>{if(!w||H!==!0||Z==="manual"||!w0())return;const ee=(function(){var de;const Ce=ct.value.length;return[(de=is())!=null?de:"",qn(),lr(),Xf.value,Ce,Math.round(Ga(0,Ce)),Math.round(Ul()),si.count,Math.round(si.total)].join(":")})();Bu!==ee&&(Bu=ee,F0({reason:"final"}).then(de=>{de.stable||Bu!==ee||(Bu=null)}))},{flush:"post",immediate:!0}),Je([Xt,ot,()=>{var w;return(w=s.virtualScroll)==null?void 0:w.settleMode},()=>{var w;return(w=s.virtualScroll)==null?void 0:w.settledToken},()=>qn(),()=>is(),Uo,r0,Rb,()=>Bt.value,jf,()=>ct.value.length,()=>si.count,()=>si.total],()=>{gx()},{flush:"post",immediate:!0}),Je([()=>ct.value.length,Ze,go,Ue,()=>Ls.start,()=>Ls.end],([w,H,Z,ee,de,Ce])=>{ye.value&&tn("virtualization",{nodes:w,virtualization:H,maxLiveNodes:Z,buffer:ee,focusIndex:ir.value,scroll:H?(()=>{const Ne=wu.value||we();return Ne?{reverse:Te(Ne),scrollTop:Math.round(Ne.scrollTop),scrollTopAbs:Math.round(Math.abs(Ne.scrollTop)),scrollHeight:Math.round(Ne.scrollHeight),clientHeight:Math.round(Ne.clientHeight)}:null})():null,liveRange:{start:de,end:Ce},rendered:Bt.value})}),Je([()=>_.customId],([w],H,Z)=>{if(!w||Xs)return;const ee=(function(de,Ce){return de?(vs.controllers[de]=Ce,()=>{vs.controllers[de]===Ce&&delete vs.controllers[de]}):()=>{}})(w,{captureRestoreAnchor:Sb,restoreAnchor:Cb,getAnchorDrift:PT,getReport:oN});Z(()=>{ee()})},{immediate:!0}),Qn(()=>{(function(){if(Xt.value)try{ar(),Iu();const w=ql("manual");dx(w)&&(R(w),Lu=w,R0=$u());const H=sc(w,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(z(H),H.anchor&&W(H.anchor),rc=Ru(H))}catch{}})(),vN(),c0(),Ht(),mx();for(const w of Vr.values())for(const H of w)Kf(H);Vr.clear(),zl.clear(),Js.clear(),z0(),ac(),f0(),Wf(),oc(),H0(),Wb(),l0()});const yN=vd("ViewportDeferredMermaidBlockNode",Ci({loader:()=>Hn(null,null,function*(){try{return(yield io(()=>import("./index11-Bndq68af.js"),__vite__mapDeps([7,5]))).default}catch(w){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".',w),So}}),loadingComponent:R4,delay:0}),R4),kN=vd("ViewportDeferredInfographicBlockNode",Ci({loader:()=>Hn(null,null,function*(){try{return(yield io(()=>import("./index10-cnUP9s6C.js"),[])).default}catch(w){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.',w),So}}),loadingComponent:O4,delay:0}),O4),bN=vd("ViewportDeferredD2BlockNode",Ci(()=>Hn(null,null,function*(){try{return(yield io(()=>import("./index8-d5uRV0AF.js"),[])).default}catch(w){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".',w),So}})),So),vx={text:es,paragraph:Ia,heading:D1,code_block:Yg,list:nu,list_item:tu,blockquote:_p,table:Wd,definition_list:Sp,footnote:Cp,footnote_reference:Go,footnote_anchor:Pd,admonition:Tp,vmr_container:Mp,hardbreak:_l,link:fo,image:wl,thematic_break:Ap,math_inline:Li,math_block:Y8,strong:co,emphasis:ho,strikethrough:uo,highlight:Zo,insert:Io,subscript:No,superscript:To,emoji:Eo,checkbox:Ko,checkbox_input:Ko,inline_code:Ys,html_inline:Yo,reference:ao,html_block:Hd},xN=D(()=>m0()),yx=D(()=>b4(_.codeBlockProps)),wN=D(()=>b4(_.codeBlockProps,{omit:["langs"]})),kx=D(()=>st(st({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,monacoOptions:_.codeBlockMonacoOptions,themes:_.themes,langs:p.value==="shiki"?_.langs:void 0,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof he.value=="boolean"?{showTooltips:he.value}:{}),wN.value)),bx=D(()=>st(Rt(st({},kx.value),{langs:_.langs}),yx.value));function xx(w){return typeof w=="boolean"?w:void 0}const _N=D(()=>{const w=_.codeBlockProps||{},H={},Z=xx(w.showLineNumbers);Z!==void 0&&(H.showLineNumbers=Z);const ee=xx(w.diffInline);ee!==void 0&&(H.diffInline=ee);const de=(function(Ce){const Ne=Number(Ce);return Number.isFinite(Ne)&&Ne>0?Ne:void 0})(w.reservedHeightPx);return de!==void 0&&(H.reservedHeightPx=de),H}),SN=D(()=>st(st({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,themes:_.themes,langs:_.langs,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof he.value=="boolean"?{showTooltips:he.value}:{}),yx.value)),CN=D(()=>st({},_.mermaidProps||{})),wx=D(()=>st({},_.d2Props||{})),AN=D(()=>st({},_.infographicProps||{})),Wu=D(()=>({typewriter:f.value,fade:_.fade,customHtmlTags:bs.value.customHtmlTags})),MN=D(()=>st(st({},Wu.value),typeof he.value=="boolean"?{showTooltip:he.value}:{})),EN=D(()=>st(st({},Wu.value),typeof he.value=="boolean"?{showTooltips:he.value}:{})),TN=D(()=>st(st({},Wu.value),typeof he.value=="boolean"?{showTooltips:he.value}:{})),NN=D(()=>st(st({},Wu.value),typeof he.value=="boolean"?{showTooltips:he.value}:{}));function IN(w){return Array.isArray(w.children)&&w.children.length>0}const ih=D(()=>sN.value.map(w=>{var H,Z,ee,de,Ce,Ne,Le,ze;let $e=(function(nt){var pt,kt,Ct,_t,At,zt,qt;if(nt.type!=="code_block")return nt;const xn=nt,Fs=[String((pt=xn.language)!=null?pt:""),String((kt=xn.loading)!=null?kt:""),String((Ct=xn.diff)!=null?Ct:""),String((_t=xn.code)!=null?_t:""),String((At=xn.originalCode)!=null?At:""),String((zt=xn.updatedCode)!=null?zt:""),String((qt=xn.raw)!=null?qt:"")].join("\0"),Ss=Hl.get(xn);if(Ss&&Ss.signature===Fs)return Ss.node;const vi=st({},xn);return Hl.set(xn,{signature:Fs,node:vi}),vi})(w.node);const Re=rh($e);let We=Ax($e,Re);if(($e.type==="html_block"||$e.type==="html_inline")&&We===vx[$e.type]){const nt=$e,pt=String((H=nt.tag)!=null?H:"").trim().toLowerCase()||w5(nt.content);if(pt){const kt=Mn.value[pt];if(Ns.value.has(pt)&&kt)We=kt,$e=Rt(st({},nt),{type:pt,tag:pt,content:GG(nt.content,pt)});else if(_5((Z=nt.content)!=null?Z:nt.raw,pt)){const Ct=String((de=(ee=nt.content)!=null?ee:nt.raw)!=null?de:"");$e.type==="html_inline"?(We=es,$e={type:"text",content:Ct,raw:Ct}):(We=Ia,$e={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Ie=$e.type==="code_block"&&p.value==="pre"&&We===So&&!j0(Mn.value,Re);let Be=st({},(function(nt,pt,kt){const Ct=pt??rh(nt);if(nt.type==="code_block"){const _t=Ct?j0(Mn.value,Ct):void 0;if(kt&&p.value==="pre"&&!_t&&kt===So)return _N.value;if(kt&&Ct&&kt===_t)return Ct==="mermaid"?Sx(nt):Ct==="infographic"?Cx(nt):Ct==="d2"||Ct==="d2lang"?wx.value:bx.value;if(kt&&kt===Mn.value.code_block)return bx.value;if(jb(kt))return SN.value}return Ct==="mermaid"?Sx(nt):Ct==="infographic"?Cx(nt):Ct==="d2"||Ct==="d2lang"?wx.value:nt.type==="link"?MN.value:nt.type==="list"?EN.value:nt.type==="blockquote"?TN.value:nt.type==="table"?NN.value:nt.type==="code_block"?kx.value:Wu.value})($e,Re,We));const Ge=Yn.value?Ja.value[w.index]:null;$e.type==="code_block"&&Ge?.kind==="code-block"&&(Be=Rt(st({},Be),Ie?{reservedHeightPx:(Ce=Ge.height)!=null?Ce:Ge.contentHeight}:{estimatedHeightPx:Ge.height,estimatedContentHeightPx:Ge.contentHeight,estimatedDiffInline:Ge.diffInline})),Ie||$e.type!=="code_block"||Re!=="mermaid"||Rc(Be.estimatedPreviewHeightPx)!=null||(Be=Rt(st({},Be),{estimatedPreviewHeightPx:wm(bm(String((Ne=$e.code)!=null?Ne:"")))})),Ie||$e.type!=="code_block"||Re!=="infographic"||Rc(Be.estimatedPreviewHeightPx)!=null||(Be=Rt(st({},Be),{estimatedPreviewHeightPx:_m(xm(String((Le=$e.code)!=null?Le:"")))})),$e.type==="math_block"&&(Be=Rt(st({},Be),{cacheScope:Bn}));const Ve=(function(nt,pt){const kt=String(nt.type);return!Ff(kt)&&Mn.value[kt]===pt})($e,We),lt=Ve?_2($e,fe.value):void 0;return Rt(st({},w),{node:$e,component:We,bindings:Be,customBindings:st(st({},lt??{}),Be),rendersCustomNode:Ve,hasSlotChildren:IN($e),slotContent:String((ze=$e.content)!=null?ze:""),isCodeBlock:$e.type==="code_block",indexKey:`${xN.value}-${w.index}`,vnodeKey:`${iN.value}\0${w.index}\0${$e.type}`})}));function rh(w){var H;return w?.type==="code_block"?String((H=w.language)!=null?H:"").trim().toLowerCase():""}function j0(w,H){const Z=H.trim().toLowerCase();if(Z)for(const ee of[Z,O1(Z),N8(Z)]){const de=ee&&w[ee];if(de)return de}}function _x(w,H,Z,ee){var de,Ce;const Ne=st({},w.value);return Rc(Ne.estimatedPreviewHeightPx)==null&&(Ne.estimatedPreviewHeightPx=ee(Z(String((de=H?.code)!=null?de:"")),void 0,Ne.maxHeight==="none"?null:(Ce=Rc(Ne.maxHeight))!=null?Ce:void 0)),Ne}function Sx(w){return _x(CN,w,bm,wm)}function Cx(w){return _x(AN,w,xm,_m)}function Ax(w,H){if(!w)return By;const Z=Mn.value,ee=Z[String(w.type)];if(w.type==="code_block"){const de=H??rh(w),Ce=de?j0(Z,de):void 0;return Ce||(p.value==="pre"?Z.code_block||So:de==="mermaid"?Z.mermaid||yN:de==="infographic"?Z.infographic||kN:de==="d2"||de==="d2lang"?Z.d2||bN:ee||Z.code_block||Vb.value)}return ee||vx[String(w.type)]||By}function V0(w){o("click",w)}function LN(w){var H;(H=w.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",w)}function $N(w){var H;(H=w.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",w)}function Mx(w){o("mouseover",w)}function Ex(w){o("mouseout",w)}const Zl=se(null),yo=se(!1),zu=se(null),FN=D(()=>!(_.domMode!=="minimal"||G.value||_.fade!==!1||f.value||yo.value||Us.value||Ze.value||Fi.value||Jo.value||zr.value||Object.keys(Mn.value).length!==0));let Uu,uc=null,K0=0,lh=0,ah=0;const Tx=["code_block","admonition","table","math_block","html_block","image","thematic_break"],ON=new Set(Tx),Nx=[".typewriter-cursor",".height-estimation-probes",...Tx.map(w=>`[data-node-type="${w}"]`),"script","style"].join(",");function Ix(w){if(!w||typeof w!="object")return!1;const H=w.type;return typeof H=="string"&&ON.has(H)}function ch(w){var H,Z;if(!w||typeof w!="object")return 0;const ee=w,de=(Z=(H=ee.raw)!=null?H:ee.content)!=null?Z:ee.code;if(typeof de=="string")return de.length;const Ce=ee.children;if(Array.isArray(Ce))return Ce.reduce((Le,ze)=>Le+ch(ze),0);const Ne=ee.items;return Array.isArray(Ne)?Ne.reduce((Le,ze)=>Le+ch(ze),0):0}function uh(){Uu&&(clearTimeout(Uu),Uu=void 0)}function G0(){K0+=1,uc!=null&&(le?.(uc),uc=null)}function qu(){G0(),Yr(),Zl.value&&(Zl.value.style.visibility="hidden")}function RN(w){var H;if(w.nodeType!==Node.TEXT_NODE||!((H=w.textContent)!=null?H:"").trim())return!1;const Z=w.parentElement;return!!Z&&!Z.closest(Nx)}function BN(w){let H=w.lastChild;for(;H;){if(RN(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const Z=H;if(!Z.matches(Nx)&&Z.lastChild){H=Z.lastChild;continue}}for(;H&&H!==w&&!H.previousSibling;)H=H.parentNode;if(!H||H===w)break;H=H.previousSibling}return null}function Lx(){const w=ih.value;for(let H=w.length-1;H>=0;H--){const Z=w[H];if(!Z||Ix(Z.node)||!nh(Z.index))continue;const ee=Nn.get(Z.index);if(!ee)continue;const de=BN(ee);if(de)return de}return null}function Yr(){zu.value&&(zu.value.classList.remove(B4),zu.value=null)}function dh(){if(d.value!=="simple"||!P||!yo.value||!L.value)return void Yr();const w=Lx(),H=w?(function(Z){var ee;const de=(ee=Z.parentElement)==null?void 0:ee.closest(".text-node");return de instanceof HTMLElement?de:Z.parentElement})(w):null;H!==zu.value&&(Yr(),H&&(H.classList.add(B4),zu.value=H))}function fh(){if(d.value!=="precise"||!P||!yo.value||uc!=null)return;const w=K0,H=()=>{uc=null,w===K0&&(function(){var Z,ee;if(d.value!=="precise"||!(P&&yo.value&&L.value&&Zl.value))return;const de=L.value,Ce=Zl.value;Ce.style.visibility="hidden";const Ne=Lx();if(!Ne)return;let Le=0,ze=0,$e=20,Re=!1;if(Ne?.textContent){const We=Ne.textContent.length,Ie=document.createRange();Ie.setStart(Ne,Math.max(0,We-1)),Ie.setEnd(Ne,We);const Be=typeof Ie.getClientRects=="function"?Ie.getClientRects():void 0,Ge=(ee=Be?.[Be.length-1])!=null?ee:(Z=Ne.parentElement)==null?void 0:Z.getBoundingClientRect();if(Ge){const Ve=ft("typewriterCursor.root.getBoundingClientRect",()=>de.getBoundingClientRect());Le=Ge.right-Ve.left+de.scrollLeft,ze=Ge.top-Ve.top+de.scrollTop,$e=Ge.height||$e,Re=!0}Ie.detach()}Re&&(Ce.style.transform=`translate(${Math.max(0,Le)}px, ${Math.max(0,ze)}px)`,Ce.style.height=`${$e}px`,Ce.style.visibility="visible")})()};V?uc=V(H):H()}return Je([Ke,()=>s.content,()=>s.nodes,()=>_.typewriter,ot],()=>Hn(null,null,function*(){var w,H;if(!P||G.value||!ne.value)return;if(ot.value)return yo.value=!1,uh(),void qu();if((w=s.nodes)!=null&&w.length)return yo.value=!1,uh(),qu(),lh=((H=s.content)!=null?H:"").length,void(ah=Ke.value.length);const Z=(function(){var Le,ze;return(Le=s.nodes)!=null&&Le.length?s.nodes.reduce(($e,Re)=>$e+ch(Re),0):((ze=s.content)!=null?ze:"").length})(),ee=(function(){var Le;return(Le=s.nodes)!=null&&Le.length?s.nodes.reduce((ze,$e)=>ze+ch($e),0):Ke.value.length})(),de=!Ix(ct.value[ct.value.length-1]),Ce=Z>lh,Ne=ee>ah;if(!f.value||!de||!Ce&&!Ne)return f.value&&de||(yo.value=!1,qu()),lh=Z,void(ah=ee);lh=Z,ah=ee,yo.value=!0,d.value==="precise"&&Zl.value&&(Zl.value.style.visibility="hidden"),uh(),yield yt(),d.value==="simple"?dh():(Yr(),fh()),Uu=setTimeout(()=>{Uu=void 0,yo.value=!1},3e3)}),{flush:"post",immediate:!0}),Je(yo,w=>Hn(null,null,function*(){w?(yield yt(),d.value!=="simple"?(Yr(),d.value==="precise"&&fh()):dh()):qu()}),{flush:"post"}),Je(d,()=>Hn(null,null,function*(){if(P&&!G.value&&ne.value&&yo.value){if(yield yt(),d.value==="simple")return G0(),void dh();Yr(),d.value!=="precise"?qu():fh()}}),{flush:"post"}),Je([()=>Bt.value,()=>Ls.start,()=>Ls.end],()=>Hn(null,null,function*(){P&&!G.value&&ne.value&&yo.value&&(yield yt(),d.value!=="simple"?(Yr(),d.value==="precise"&&fh()):dh())}),{flush:"post"}),Qn(()=>{uh(),G0(),Yr(),un.clear()}),(w,H)=>{const Z=dI("NodeRenderer",!0);return A(G)?(x(!0),E(De,{key:0},rt(ih.value,ee=>(x(),E(De,{key:ee.vnodeKey},[ee.rendersCustomNode?(x(),Ae(Ms(ee.component),hn({key:0,ref_for:!0},ee.customBindings,{node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onClick:V0,onMouseover:Mx,onMouseout:Ex,onCopy:H[0]||(H[0]=de=>i(de)),onHandleArtifactClick:H[1]||(H[1]=de=>o("handleArtifactClick",de))}),{default:Fe(()=>[ee.hasSlotChildren?(x(),Ae(Z,hn({key:0,ref_for:!0},bn.value,{nodes:ee.node.children,"index-key":ee.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ee.slotContent?(x(),Ae(Z,hn({key:1,ref_for:!0},bn.value,{content:ee.slotContent,final:!ee.node.loading,"index-key":`${ee.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ge("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ms(ee.component),hn({key:1,node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey},{ref_for:!0},ee.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onClick:V0,onMouseover:Mx,onMouseout:Ex,onCopy:H[2]||(H[2]=de=>i(de)),onHandleArtifactClick:H[3]||(H[3]=de=>o("handleArtifactClick",de))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),E("div",{key:1,ref_key:"containerRef",ref:L,class:He(["markstream-vue markdown-renderer",[{dark:_.isDark},{virtualized:Ze.value},{"virtual-scroll-coordinated":Is.value},{"stable-layout":ZT.value},{"typewriter-simple-cursor":yo.value&&d.value==="simple"}]]),"data-custom-id":_.customId,onClick:V0,onMouseover:LN,onMouseout:$N},[Oo.value||Ze.value?(x(),E(De,{key:0},[Oo.value?(x(),Ae(Use,{key:0,width:ti.value,"flow-root":Ze.value||Is.value,"paragraph-node":Ws.value,"list-item-node":Zs.value,"list-node":Gn.value,"heading-nodes":mo.value,"set-paragraph-wrapper":XT,"set-list-item-wrapper":QT,"set-list-wrapper":JT,"set-heading-wrapper":nN},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ge("",!0),Ze.value?(x(),E("div",{key:1,class:"node-spacer",style:Jt({height:`${h0.value}px`}),"aria-hidden":"true"},null,4)):ge("",!0)],64)):ge("",!0),FN.value?(x(!0),E(De,{key:1},rt(ih.value,ee=>(x(),E(De,{key:ee.vnodeKey},[nh(ee.index)?(x(),Ae(Ms(ee.component),hn({key:0,node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey},{ref_for:!0},ee.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onMouseover:H[4]||(H[4]=de=>o("mouseover",de)),onMouseout:H[5]||(H[5]=de=>o("mouseout",de)),onCopy:H[6]||(H[6]=de=>i(de)),onHandleArtifactClick:H[7]||(H[7]=de=>o("handleArtifactClick",de))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ge("",!0)],64))),128)):(x(!0),E(De,{key:2},rt(ih.value,ee=>(x(),E("div",{key:ee.vnodeKey,ref_for:!0,ref:de=>sh(ee.index,de),class:"node-slot","data-node-index":ee.index,"data-node-type":ee.node.type},[nh(ee.index)?(x(),E("div",{key:0,ref_for:!0,ref:de=>(function(Ce,Ne){var Le;Ne||(function(We){const Ie=`${m0()}-${We}`;let Be=!1;for(const Ge of Array.from(Wo.keys())){const Ve=Bi.get(Ge);(Ve?.index===We||Ge===Ie||Ge.startsWith(`${Ie}-`))&&(Wo.delete(Ge),Bi.delete(Ge),Be=!0)}Be&&(ec(),Dn("async-node"))})(Ce),rr.delete(Ce),(function(We){var Ie;const Be=((Ie=zl.get(We))!=null?Ie:0)+1;zl.set(We,Be)})(Ce);const ze=Vr.get(Ce);if(ze){for(const We of ze)Kf(We);Vr.delete(Ce)}if((function(We){const Ie=qs.get(We);Ie&&(Po?.unobserve(Ie),or.delete(Ie),qs.delete(We))})(Ce),!Ne||!ut.value)return Ri.delete(Ce),void zl.delete(Ce);Ri.set(Ce,Ne);const $e=()=>{oh(Ce,Ne)};queueMicrotask($e);const Re=(Po||typeof ResizeObserver>"u"||(Po=new ResizeObserver(We=>{if(We.length)for(const Ie of We){const Be=or.get(Ie.target),Ge=qs.get(Be??-1);Be!=null&&Ge&&oh(Be,Ge)}else ar()})),Po);if(Re&&(qs.set(Ce,Ne),or.set(Ne,Ce),Re.observe(Ne)),typeof window<"u"){const We=((Le=ct.value[Ce])==null?void 0:Le.type)==="code_block"?[16,80,240,800]:ot.value?[80]:[];if(We.length){const Ie=We.map(Be=>Db(Be,$e,"node-resize")).filter(Be=>Be!=null);Ie.length&&Vr.set(Ce,Ie)}}})(ee.index,de),class:"node-content"},[ee.isCodeBlock?ee.rendersCustomNode?(x(),Ae(Ms(ee.component),hn({key:1,ref_for:!0},ee.customBindings,{node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[12]||(H[12]=de=>i(de)),onHandleArtifactClick:H[13]||(H[13]=de=>o("handleArtifactClick",de))}),{default:Fe(()=>[ee.hasSlotChildren?(x(),Ae(Z,hn({key:0,ref_for:!0},bn.value,{nodes:ee.node.children,"index-key":ee.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ee.slotContent?(x(),Ae(Z,hn({key:1,ref_for:!0},bn.value,{content:ee.slotContent,final:!ee.node.loading,"index-key":`${ee.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ge("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ms(ee.component),hn({key:2,node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey},{ref_for:!0},ee.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[14]||(H[14]=de=>i(de)),onHandleArtifactClick:H[15]||(H[15]=de=>o("handleArtifactClick",de))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Fa,{key:0,name:"fade",css:_.fade!==!1,appear:_.fade!==!1},{default:Fe(()=>[ee.rendersCustomNode?(x(),Ae(Ms(ee.component),hn({key:0,ref_for:!0},ee.customBindings,{node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[8]||(H[8]=de=>i(de)),onHandleArtifactClick:H[9]||(H[9]=de=>o("handleArtifactClick",de))}),{default:Fe(()=>[ee.hasSlotChildren?(x(),Ae(Z,hn({key:0,ref_for:!0},bn.value,{nodes:ee.node.children,"index-key":ee.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ee.slotContent?(x(),Ae(Z,hn({key:1,ref_for:!0},bn.value,{content:ee.slotContent,final:!ee.node.loading,"index-key":`${ee.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ge("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ms(ee.component),hn({key:1,node:ee.node,loading:ee.node.loading,"index-key":ee.indexKey},{ref_for:!0},ee.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[10]||(H[10]=de=>i(de)),onHandleArtifactClick:H[11]||(H[11]=de=>o("handleArtifactClick",de))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),E("div",{key:1,class:"node-placeholder",style:Jt({height:`${t0(ee.index)}px`})},null,4))],8,Vse))),128)),yo.value&&d.value==="precise"?(x(),E("span",{key:3,ref_key:"typewriterCursorRef",ref:Zl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ge("",!0),Ze.value?(x(),E("div",{key:4,class:"node-spacer",style:Jt({height:`${p0.value}px`}),"aria-hidden":"true"},null,4)):ge("",!0)],42,jse))}}})),[["__scopeId","data-v-a9489508"]]),Lo=cE;Lo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Lo.__name,Lo.name].filter(n=>!!n));for(const n of t)e.component(n,cE)};const B2=Object.freeze(Object.defineProperty({__proto__:null,default:Lo},Symbol.toStringTag,{value:"Module"})),Kse={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"},Gse={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"},Yse={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"},Zse={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"},Xse={class:"admonition-title"},Qse=["aria-expanded","aria-controls"],Jse=["id"],Tp=gn(Xe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=D(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=se(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),E("div",{class:He(["admonition",[`admonition-${s.node.kind}`]])},[S("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(x(),E("svg",Kse,[...u[1]||(u[1]=[S("circle",{cx:"12",cy:"12",r:"10"},null,-1),S("path",{d:"M12 16v-4"},null,-1),S("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(x(),E("svg",Gse,[...u[2]||(u[2]=[S("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),S("path",{d:"M9 18h6"},null,-1),S("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(x(),E("svg",Yse,[...u[3]||(u[3]=[S("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),S("path",{d:"M12 9v4"},null,-1),S("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(x(),E("svg",Zse,[...u[4]||(u[4]=[S("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),S("path",{d:"M12 8v4"},null,-1),S("path",{d:"M12 16h.01"},null,-1)])])):ge("",!0),S("span",Xse,B(i.value),1),s.node.collapsible?(x(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),E("svg",{style:Jt({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]=[S("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Qse)):ge("",!0)]),Fn(S("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ve(A(Lo),{"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,Jse),[[ci,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Tp.install=e=>{e.component(Tp.__name,Tp)};const zy=()=>io(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Kh=null,Gh=zy,Yh=null,D4=!1,P4=!1;function f4e(){return Hn(this,null,function*(){if(Kh)return Kh;const e=Gh;return e?e===zy&&D4?null:Yh||(Yh=Hn(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===zy)return e===Gh&&(D4=!0,(function(s){P4||(P4=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',s))})(n)),null;throw n}finally{e===Gh&&(Yh=null)}return e!==Gh?null:t?(Kh=(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),Kh):null}),Yh):null})}let Zh=null,uE=null,Xh=null;function h4e(){return typeof uE=="function"}function p4e(){return Hn(this,null,function*(){if(Zh)return Zh;const e=uE;return e?Xh||(Xh=Hn(null,null,function*(){const t=yield e(),n=(function(s){var o,i,r;if(!s)return null;const l=(o=s.default)!=null?o:s,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=s.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(Zh=n,Zh):null}).finally(()=>{Xh=null}),Xh):null})}const m4e=Symbol("markstreamLanguageIconResolver"),Qh=se(!1);let H4=!1;function rv(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function eoe(){return!H4&&typeof window<"u"&&typeof document<"u"&&(H4=!0,Qh.value=rv(),new MutationObserver(()=>{Qh.value=rv()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Qh.value=rv()})),Qh}const dE=["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"],toe=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Uy=[...dE].sort((e,t)=>t.length-e.length).join("|"),lv=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Uy}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Uy})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),fE=/[),.;!?,。;!?)]+$/;function noe(e){const t=e.toLowerCase();return dE.some(n=>t.endsWith(`.${n}`))}function soe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Uy}))["']`,"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 ooe(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(fE,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=toe.has(i),a=noe(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 ioe(e,t={}){const n=[];lv.lastIndex=0;let s;for(;(s=lv.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(fE,""),u=a.length-c.length;a=c;const d=ooe(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&&(lv.lastIndex-=u)}return n}const roe=12e4,loe=6e4,aoe=32,coe=3e4,W4=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function uoe(e){let t=0,n=0,s=0;W4.lastIndex=0;let o;for(;(o=W4.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=roe||n>=loe||t>=aoe||s>=coe?"pre":"shiki",codeFenceCount:t,codeChars:n}}function doe(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function foe(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const hoe={key:1,class:"diff-wrap"},poe={class:"diff-bar"},moe=["aria-label","onClick"],goe={class:"diff-pre"},voe={key:0,class:"diff-sign"},yoe={class:"diff-text"},koe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",z4="github-light",U4="github-dark",boe=Xe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){Eee(),Wee(),Nee(),qee(),Tee(new doe),Uee(new foe);function t(z){return z.inline.ruler.disable("math"),z}const{t:n}=Ot(),s=jt("resolveImage"),o=se(null),i=e,r=D(()=>!i.streaming),l=D(()=>soe(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:uoe(i.text??"")),c=eoe(),u=D(()=>!i.streaming),d=Ts(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(z){return!/^(https?:|data:|blob:)/i.test(z)}function y(z){if(!s)return;const W=[];for(const L of[h,p]){L.lastIndex=0;let O;for(;(O=L.exec(z))!==null;)W.push(O[2]??"")}for(const L of W)!L||!m(L)||d.has(L)||f.has(L)||(f.add(L),s(L).then(O=>{d.set(L,O!==L?O:"")}).catch(()=>{d.set(L,"")}).finally(()=>{f.delete(L)}))}function k(z){if(!s)return z;const W=L=>{if(!m(L))return null;const O=d.get(L);return O===void 0?koe:O===""?null:O};return z.replace(h,(L,O,q,X)=>{const ie=W(q);return ie===null?L:`${O}${ie}${X}`}).replace(p,(L,O,q,X)=>{const ie=W(q);return ie===null?L:`${O}${ie}${X}`})}Je(()=>i.text,z=>y(z??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const z=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),W=[];let L=z.nextNode();for(;L;){const O=L,q=O.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&O.data.trim().length>0&&W.push(O),L=z.nextNode()}for(const O of W){const q=ioe(O.data,{aliases:l.value});if(q.length===0||!O.parentNode)continue;const X=document.createDocumentFragment();let ie=0;for(const U of q){U.start>ie&&X.append(document.createTextNode(O.data.slice(ie,U.start)));const j=document.createElement("button");j.type="button",j.className="md-file-link",j.textContent=U.text,j.title=U.line?`${U.path}:${U.line}`:U.path,j.addEventListener("click",te=>{te.preventDefault(),te.stopPropagation(),i.openFile?.({path:U.path,line:U.line})}),X.append(j),ie=U.end}ie<O.data.length&&X.append(document.createTextNode(O.data.slice(ie))),O.parentNode.replaceChild(X,O)}}function v(z){return!(!z||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(z))}function b(z){let W=z.length;for(const L of["#","?"]){const O=z.indexOf(L);O!==-1&&O<W&&(W=O)}return z.slice(0,W)}function C(){if(!o.value||!i.openFile||i.streaming)return;const z=o.value.querySelectorAll("a[href]");for(const W of z){if(W.dataset.mdLinkHandled==="true"||W.closest("svg"))continue;const L=W.getAttribute("href")??"";v(L)&&(W.dataset.mdLinkHandled="true",W.addEventListener("click",O=>{O.preventDefault(),O.stopPropagation(),i.openFile?.({path:b(L)})}))}}function I(){yt().then(()=>{g(),C()})}Je(()=>i.text,I),Je(()=>i.streaming,I);let T=null;mn(()=>{I(),o.value&&(T=new MutationObserver(I),T.observe(o.value,{childList:!0,subtree:!0}))}),Cn(()=>{T?.disconnect()});const M={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},$=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=D(()=>{const z=k(i.text??""),W=[];let L=0;$.lastIndex=0;let O;for(;(O=$.exec(z))!==null;){const X=O[1]??"",ie=z.slice(L,O.index)+(X||"");ie.trim()&&W.push({kind:"md",text:ie}),W.push({kind:"diff",code:O[2]??""}),L=$.lastIndex}const q=z.slice(L);return(q.trim()||W.length===0)&&W.push({kind:"md",text:q}),W});function F(z){return z.split(`
|
|
293
|
+
`).map(W=>W.startsWith("@@")?{type:"hunk",sign:"",text:W}:/^\+(?!\+\+)/.test(W)?{type:"add",sign:"+",text:W.slice(1)}:/^-(?!--)/.test(W)?{type:"del",sign:"-",text:W.slice(1)}:W.startsWith(" ")?{type:"ctx",sign:"",text:W.slice(1)}:{type:"ctx",sign:"",text:W})}const _=se(null);function R(z,W){Hs(z).then(L=>{L&&(_.value=W,setTimeout(()=>{_.value=null},1400))})}return(z,W)=>(x(),E("div",{ref_key:"mdRef",ref:o,class:"md"},[(x(!0),E(De,null,rt(N.value,(L,O)=>(x(),E(De,{key:O},[L.kind==="md"?(x(),Ae(A(Lo),{key:0,content:L.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":A(c),"code-block-light-theme":z4,"code-block-dark-theme":U4,themes:[z4,U4],"code-block-props":M,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:A(H$)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(x(),E("div",hoe,[S("div",poe,[W[0]||(W[0]=S("span",{class:"diff-lang"},"diff",-1)),ve(en,{text:A(n)("filePreview.copyCode")},{default:Fe(()=>[S("button",{class:"diff-copy","aria-label":A(n)("filePreview.copyCode"),onClick:q=>R(L.code,O)},[ve(et,{name:_.value===O?"check":"copy",size:"sm"},null,8,["name"])],8,moe)]),_:2},1032,["text"])]),S("pre",goe,[S("code",null,[(x(!0),E(De,null,rt(F(L.code),(q,X)=>(x(),E("span",{key:X,class:He(["diff-line",`diff-${q.type}`])},[q.type!=="hunk"?(x(),E("span",voe,B(q.sign),1)):ge("",!0),S("span",yoe,B(q.text),1)],2))),128))])])]))],64))),128))],512))}}),H1=dt(boe,[["__scopeId","data-v-f76b9522"]]),xoe={class:"tc-anim"},woe={class:"prev-anim"},_oe={class:"prev"},Soe=Xe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&o.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>o.value.at(-1)??""),a=se(null);return mn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Je(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||yt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),E("div",{class:He(["think",{mob:e.mobile}])},[i.value?(x(),E("div",{key:0,class:He(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[S("div",xoe,[S("pre",{ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513)]),S("div",woe,[S("span",_oe,B(l.value),1)])],2)):(x(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513))],2))}}),Coe=dt(Soe,[["__scopeId","data-v-334a29b0"]]),Aoe={class:"activity-notice",role:"status"},Moe={"aria-hidden":"true"},Eoe={class:"an-label"},Toe=Xe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),E("div",Aoe,[S("span",Moe,[ve($o,{size:"sm"})]),S("span",Eoe,B(e.label),1)]))}}),Noe=dt(Toe,[["__scopeId","data-v-8f0cdbe4"]]);function Ioe(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 Loe=Xe({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Ot(),s=se(!1),o=D(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=D(()=>s.value?o.value:Ioe(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(x(),E("button",{type:"button",class:"msg-time",onClick:Mt(r,["stop"])},B(i.value),1))}}),hE=dt(Loe,[["__scopeId","data-v-7db81849"]]);function $oe(e){return e.length===1?`0${e}`:e}function Foe(e,t){return`${String(Number(e))}:${$oe(t)}`}const q4=e=>/^\d+$/.test(e);function Ooe(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(q4(s)&&q4(o)&&c){const f=Foe(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const Roe=["data-turn-id"],Boe={class:"cn-bubble"},Doe={class:"cn-title"},Poe={key:0,class:"cn-prompt"},Hoe={class:"cn-meta"},Woe={key:0,class:"cn-meta-item"},zoe={key:1,class:"cn-meta-item"},Uoe=["aria-label"],qoe=["title"],joe=Xe({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Ot(),s=D(()=>t.cron),o=D(()=>s.value?.missedCount!==void 0),i=D(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const u=s.value?.cron;return u?Ooe(u,n):""}),l=D(()=>o.value?"error":"ok"),a=D(()=>{const u=s.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=D(()=>t.text??"");return(u,d)=>(x(),E("div",{class:He(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[S("div",Boe,[S("span",Doe,B(i.value),1),c.value?(x(),E("span",Poe,B(c.value),1)):ge("",!0)]),S("div",Hoe,[ve(et,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),E("span",Woe,B(r.value),1)):ge("",!0),a.value?(x(),E("span",zoe,B(a.value),1)):ge("",!0),S("span",{class:He(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),Ae(et,{key:0,name:"check",size:"sm"})):(x(),Ae(et,{key:1,name:"close",size:"sm"}))],10,Uoe),s.value?.jobId?(x(),E("span",{key:2,class:"cn-meta-item cn-id",title:A(n)("conversation.cron.job",{id:s.value.jobId})},B(s.value.jobId),9,qoe)):ge("",!0),e.createdAt?(x(),Ae(hE,{key:3,time:e.createdAt},null,8,["time"])):ge("",!0)])],10,Roe))}}),Voe=dt(joe,[["__scopeId","data-v-5de7e25d"]]),j4=Pt.clientId,Koe="dimi-web",Goe="web";function Yoe(){return{serverHttpUrl:Xoe(),clientId:tie(),clientName:Koe,clientVersion:nie(),clientUiMode:Goe}}function Zoe(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function Xoe(e){const t=Zoe(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function Qoe(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function Joe(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return Qoe(e)}function Dc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function eie(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 tie(){const e=ss(j4);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ps(j4,t),t}function nie(){return"0.1.0".trim()?"0.1.0":"0.0.0-dev"}const sie=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],pE=500,Lm=256*1024,V4=200,av=16384,cv=500,uv=50,dv=50,oie=6,iie=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,rie=/^[A-Za-z0-9+/=_-]{200,}$/;let fv=null;function $i(){if(fv!==null)return fv;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=ss(Pt.debug)==="1"),fv=e,e}const Sl=[],Pc=[];let yd=0;const pa=[];let kd=0,lie=1;const $m=new TextEncoder,aie=new Set(sie),D2=se(0),bd=tr(!1);function cie(){return Sl}function uie(){Sl.length=0,Pc.length=0,yd=0,pa.length=0,kd=0,D2.value++}function Wr(e){if(!bd.value){try{const t={id:lie++,ts:Date.now(),source:e.source,kind:String(su(e.kind)),label:String(su(e.label)),sessionId:e.sessionId===void 0?void 0:String(su(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Dl(e.detail)},n=JSON.stringify(t),s=$m.encode(n).byteLength;if(s>Lm)return;for(Sl.push(t),Pc.push(n),yd+=s+(Pc.length>1?1:0);Sl.length>pE||yd>Lm;){const o=Pc.shift();Sl.shift(),o!==void 0&&(yd-=$m.encode(o).byteLength,Pc.length>0&&(yd-=1))}}catch{return}D2.value++}}function la(e){if(typeof e=="string")return e.length<=V4?e:e.slice(0,V4)}function ii(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function die(e,t){if(aie.has(e))try{const n={ts:Date.now(),event:e,sessionId:la(t?.sessionId),status:la(t?.status),operation:la(t?.operation),seq:ii(t?.seq),durationMs:ii(t?.durationMs),messageCount:ii(t?.messageCount),contentCount:ii(t?.contentCount),mediaCount:ii(t?.mediaCount),sessionCount:ii(t?.sessionCount),workspaceCount:ii(t?.workspaceCount),promptId:la(t?.promptId),zipBytes:ii(t?.zipBytes),errorName:la(t?.errorName),errorCode:ii(t?.errorCode),requestId:la(t?.requestId),phase:la(t?.phase),httpStatus:ii(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:ii(t?.line),col:ii(t?.col)},s=JSON.stringify(n),o=$m.encode(s).byteLength;if(o>Lm)return;for(pa.push(s),kd+=o+(pa.length>1?1:0);pa.length>pE||kd>Lm;){const i=pa.shift();i!==void 0&&(kd-=$m.encode(i).byteLength,pa.length>0&&(kd-=1))}}catch{return}}function su(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return rie.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>cv?`${i.slice(0,cv)}… [+${i.length-cv} chars]`:i}if(n!=="object")return String(e);if(t>=oie)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,uv).map(r=>su(r,t+1));return e.length>uv&&i.push(`[+${e.length-uv} more items]`),i}const s={},o=Object.entries(e);for(const[i,r]of o.slice(0,dv))s[i]=iie.test(i)?"[redacted]":su(r,t+1);return o.length>dv&&(s._truncatedKeys=o.length-dv),s}function Dl(e){if(e===void 0)return;const t=su(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>av)return{_truncated:`detail JSON was ${n.length} chars; first ${av} kept`,preview:n.slice(0,av)}}catch{return"[unserializable detail]"}return t}function Jh(e){$i()&&Wr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Dl(e.body)}})}function bc(e){if(!$i())return;const t=e.code!==0;Wr({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:Dl(e.data)}})}function il(e){$i()&&Wr({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 xc(e,t){$i()&&Wr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Dl(t)})}function fie(e){if(!$i())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;Wr({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Dl(e)})}function hie(e){if(!$i())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);Wr({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Dl(t.payload)})}const pie={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function mie(e,t,n){$i()&&Wr({source:"client",kind:`client:${e}`,label:`${pie[e]} ${t}`,detail:Dl(n)})}function Sr(e,t){$i()&&Wr({source:"client",kind:"client:event",label:`· ${e}`,detail:Dl(t)})}function as(e,t){die(e,t),Wr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let hv=!1,ep=null;function gie(){if(hv)return()=>ep?.();hv=!0;const e=[];try{if(typeof window<"u"){const n=o=>{as("window:error",{status:"failed",errorName:o.error instanceof Error?o.error.name:"Error",line:o.lineno,col:o.colno})},s=o=>{const i=o.reason;as("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",s),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",s)})}}catch{}if($i())for(const n of["error","warn","log","info","debug"]){const s=console[n];if(typeof s!="function")continue;const o=(...i)=>{try{mie(n,i.map(vie).join(" "),i.length>1?i:i[0])}catch{}s.apply(console,i)};console[n]=o,e.push(()=>{console[n]===o&&(console[n]=s)})}const t=()=>{if(ep===t){for(const n of e.toReversed())n();ep=null,hv=!1}};return ep=t,t}function vie(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 mE(e=Sl){if(typeof document>"u")return;const t=new Blob([yie(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let s;try{s=document.createElement("a"),s.href=n,s.download=`dimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(s),s.click()}finally{s?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function yie(e=Sl){return e===Sl?Pc.join(`
|
|
294
|
+
`):e.map(t=>JSON.stringify(t)).join(`
|
|
295
|
+
`)}function kie(){return pa.join(`
|
|
296
|
+
`)}function gE(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 qy(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function bi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:gE(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 Ud(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function K4(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,id:e.id}}function P2(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:K4(e.source)};case"video":return{type:"video",source:K4(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 jy(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(P2),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function bie(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,id:t.id},{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 xie(e){return{content:e.content.map(bie),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}}function wie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function vE(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 _ie(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Sie(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(_ie),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function yE(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Sie),createdAt:e.created_at}}function Cie(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 Aie(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=Cie(s);return{answers:t,method:e.method,note:e.note}}function Np(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function G4(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 Mie(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:bi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:bi(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:Ud(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Ud(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:gE(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.message.created":return{type:"messageCreated",message:jy(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(P2),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:vE(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:yE(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:Np(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:Vy(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 Eie(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 pv(e){return{id:e.id,name:e.name,baseUrl:e.base_url,defaultModel:e.default_model,authMethods:e.auth_methods,credentialType:e.credential_type,status:e.status,models:e.models}}function Vy(e){return{defaultProvider:e.default_provider,defaultModel:e.default_model,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 Tie(e){return e.session_id}function Nie(e){return e.seq}const Iie="main",Lie=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","prompt.aborted","error"]);function br(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 $ie(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 Y4(){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,retryReuseMsgId:void 0}}function ma(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Fie(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ga(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 Oie(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ma(t,"name")??ma(t,"toolName")??"tool",s=ja(Rie(n)),o=Bie(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=ma(n,"text");if(o)return mv(o);const i=ma(n,"message");if(i)return mv(i)}const s=ma(t,"message");if(s)return mv(s)}return null}function Rie(e){return e.replace(/_\d+$/,"")}const Z4=2e3;function mv(e){return e.length>Z4?`${e.slice(0,Z4)}…`:e}function Bie(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return sf(e,n)}function Die(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=ma(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ga(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=Oie(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ga(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 id(e){return{...e,content:e.content.map(t=>({...t}))}}function X4(e,t,n){const s={id:br("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Pie(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 Hie(e){return Array.isArray(e)?e.map(t=>P2(t)):[]}function Q4(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 Wie(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 zie(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 J4(e,t){e.messages.find(n=>n.id===t)}function Uie(e,t,n,s,o,i){const r={id:br("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 rd(e,t){return e.messages.find(n=>n.id===t)}function e3(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 qie(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=Y4(),e.set(u,d)),d}function s(u){e.set(u,Y4())}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??br("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=X4(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 y=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:y}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:id(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,y=[],k=m?.agentId;if(typeof k=="string"&&k!==Iie){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(Lie.has(u))return Die(p,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,b={};typeof g=="string"&&g.length>0&&(b.title=g),typeof v=="string"&&(b.lastPrompt=v),(b.title!==void 0||b.lastPrompt!==void 0)&&y.push({type:"sessionMetaUpdated",sessionId:f,...b});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const b=Hie(m?.content);if(b.length===0)break;p.currentPromptId=g;const C=Pie(p,f,g,v,b,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());y.push({type:"messageCreated",message:id(C)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??br("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,y.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;if(v||(v=br("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const C=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,rd(p,C)!==void 0){p.currentAssistantMsgId=C;break}}const b=X4(p,f,v);p.currentAssistantMsgId=b.id,y.push({type:"messageCreated",message:id(b)});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 b=a(p.turnThinkLen,h?.offset);if(b==="skip")break;if(b==="gap"){y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=Q4(p,g,"thinking",v);if(C<0)break;p.turnThinkLen+=v.length,y.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,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 b=a(p.turnTextLen,h?.offset);if(b==="skip")break;if(b==="gap"){y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=Q4(p,g,"text",v);if(C<0)break;p.turnTextLen+=v.length,y.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,b=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!b)break;const C=m?.toolCallId,I=m?.name??m?.toolName??"",T=m?.args??m?.input??{};Wie(p,g,C,I,T);const M=rd(p,g);M&&M.content.length-1,p.toolStartTimes.set(C,Date.now()),M&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:M.content.map($=>({...$})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=zie(m??{});g&&v&&y.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=br("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const b=m?.toolCallId,C=m?.output,I=m?.isError??!1;p.toolStartTimes.get(b)??Date.now(),p.toolStartTimes.delete(b);const T=Uie(p,f,b,C,I,v);y.push({type:"messageCreated",message:id(T)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=$ie(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){J4(p,g);const b=rd(p,g);b&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:b.content.map(C=>({...C})),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),y.push({type:"sessionUsageUpdated",sessionId:f,usage:e3(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,thinking:typeof m?.thinkingEffort=="string"&&m.thinkingEffort.length>0?m.thinkingEffort:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",b=Fie(m??{},"durationMs");if(y.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:m?.reason}),g){J4(p,g);const I=rd(p,g);I&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:I.content.map(T=>({...T})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:b})}p.turnCount++;const C=e3(p);y.push({type:"sessionUsageUpdated",sessionId:f,usage:C}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const g=m?.promptId;typeof g=="string"&&g.length>0&&y.push({type:"promptCompleted",sessionId:f,promptId:g,reason:m?.reason??"completed"});break}case"prompt.aborted":{const g=m?.promptId;typeof g=="string"&&g.length>0&&y.push({type:"promptAborted",sessionId:f,promptId:g});break}case"turn.step.retrying":{const g=p.currentAssistantMsgId;if(g!==void 0){const v=rd(p,g);v!==void 0&&(v.content=v.content.filter(b=>b.type!=="text"&&b.type!=="thinking"&&b.type!=="toolUse"),y.push({type:"messageUpdated",sessionId:f,messageId:g,content:v.content.map(b=>({...b})),status:"pending"}),p.retryReuseMsgId=g)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:br("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),y.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=ga(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&y.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=ga(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&y.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=ga(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&y.push({type:"taskCreated",sessionId:f,task:v}),y.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=ga(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&y.push({type:"taskCreated",sessionId:f,task:v}),y.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{y.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message,name:m?.name,details:m?.details,retryable:m?.retryable}});break}case"warning":{y.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,b=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):br("task_"),C=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:On.global.t("tasks.defaultDescription");if(g.kind==="agent"){const T=typeof g.agentId=="string"&&g.agentId.length>0?g.agentId:void 0;if(T!==void 0){const M=ga(p,f,T,{description:C,backgroundTaskId:b,runInBackground:!0});M&&y.push({type:"taskCreated",sessionId:f,task:M})}else y.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"subagent",description:C,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,subagentPhase:"queued",runInBackground:!0}});break}const I=typeof g.command=="string"?g.command:void 0;y.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"bash",description:C,command:I,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:I!==void 0?`$ ${I}`:void 0}});break}case"task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;y.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??{};y.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}),y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{y.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{y.push({type:"compactionCancelled",sessionId:f});break}case"cron.fired":{const g=m?.origin,v=ma(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const b={id:br("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(b),y.push({type:"messageCreated",message:id(b)})}break}}return y}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const jie=new Set(["server_hello","ack","ping","resync_required","error","pong"]),t3=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","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","cron.fired"]),Vie=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"]),Kie=new Set(["assistant.delta","thinking.delta"]);function Gie(e,t){if(jie.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Kie.has(s)?Yie(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Vie.has(s)?{route:"protocol"}:t3.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:t3.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Yie(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 xd 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 vr 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 Si(e){return e instanceof xd||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function H2(e){return e instanceof vr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Os="dimi-web.server-credential",Zie="token",Xie=10080*60*1e3;let Xi;const Ky=new Set;function Qie(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Zie);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 Gy(e){return{version:1,credential:e,expiresAt:Date.now()+Xie}}function Jie(e){return JSON.stringify(e)}function W2(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Yy(e){globalThis.localStorage?.setItem(Os,Jie(e))}function ere(){try{const e=globalThis.localStorage?.getItem(Os);if(e){const n=W2(e);if(n===void 0){const s=Gy(e);let o=!1;try{Yy(s),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Os)===e&&globalThis.localStorage?.removeItem(Os),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Os)}catch{}return o?s:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Os),globalThis.localStorage?.getItem(Os)===e&&globalThis.localStorage?.removeItem(Os);return}const t=globalThis.sessionStorage?.getItem(Os);if(t){const n=Gy(t);let s=!1;try{Yy(n),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Os),s=!0}catch{}return s?n:void 0}return}catch{return}}function tre(){const e=Qie();return e?(bE(e),!0):(Xi=ere(),Xi!==void 0)}function kE(){if(Xi!==void 0){if(Xi.expiresAt<=Date.now()){nre(Xi);return}return Xi.credential}}function nre(e){Xi=void 0;try{globalThis.sessionStorage?.removeItem(Os);const t=globalThis.localStorage?.getItem(Os),n=t==null?void 0:W2(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Os)}catch{}}function bE(e){const t=Gy(e);Xi=t;try{Yy(t)}catch{}try{globalThis.sessionStorage?.removeItem(Os)}catch{}}function sre(){const e=Xi;Xi=void 0;try{const t=globalThis.localStorage?.getItem(Os),s=(t==null?void 0:W2(t))?.credential??t;e!==void 0&&s===e.credential&&globalThis.localStorage?.removeItem(Os),globalThis.sessionStorage?.removeItem(Os)}catch{}}function ore(e){return Ky.add(e),()=>{Ky.delete(e)}}function ire(){sre();for(const e of Ky)try{e()}catch{}}const Nc=3e4,tp=5*6e4,xE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",n3=500,wE=40101;function np(e=Nc){try{return AbortSignal.timeout(e)}catch{return}}function rre(e,t){let n="",s=e;for(let o=0;o<t;o++)n=xE[s%32]+n,s=Math.floor(s/32);return n}function lre(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=>xE[n%32]).join("")}function sp(){return`${rre(Date.now(),10)}${lre(16)}`}function are(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 gv(e){try{const t=await e.text();return t?t.length>n3?`${t.slice(0,n3)}...`:t:void 0}catch{return}}class cre{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=Dc(this.origin,t),s=sp(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();Jh({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:np()})}catch(a){throw il({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new vr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:Nc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return bc({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),bc({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 xd({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postZip(t,n,s){const o="POST",i=Dc(this.origin,t),r=sp(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();Jh({method:o,path:t,url:i,requestId:r,body:s});let c;try{c=await fetch(i,{method:o,headers:l,body:JSON.stringify(n),signal:np(tp)})}catch(h){throw il({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new vr({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:tp,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const y=h?.code??c.status,k=h?.msg??c.statusText;throw bc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:y,msg:k,envelopeRequestId:h?.request_id}),new xd({code:y,msg:k,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw il({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new vr({message:`Invalid ZIP response from ${o} ${t}`,cause:m,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:tp,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await gv(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw il({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new vr({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:tp,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return bc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const s=Dc(this.origin,t),o=sp(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Jh({method:"POST",path:t,url:s,requestId:o,body:are(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:np()})}catch(u){throw il({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new vr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:Nc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw il({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new vr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:Nc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await gv(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(bc({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 xd({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=Dc(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,y]of Object.entries(o))y!==void 0&&h.set(m,String(y));const p=h.toString();p&&(r=`${r}?${p}`)}const l=sp(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Jh({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:np()})}catch(h){throw il({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new vr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Nc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw il({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new vr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Nc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await gv(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(bc({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 xd({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=kE();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Dimi-Client-Id"]=this.identity.clientId,t["X-Dimi-Client-Name"]=this.identity.clientName,t["X-Dimi-Client-Version"]=this.identity.clientVersion,t["X-Dimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===wE)&&ire()}}const ure="dimi.bearer.",dre=3e4;class fre{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(),xc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=kE(),n=t!==void 0?[`${ure}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{xc("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));hie(i),this.handleFrame(i)}catch(i){xc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{xc("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{xc("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,xc("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=op(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(op(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(op(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,dre),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=op(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=Gie(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)),fie(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function op(e,t){return`${e}\0${t}`}function hre(e,t){if(e===void 0)return t;let n;const s=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(s!==void 0)try{n=decodeURIComponent(s.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function s3(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function vv(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 o3(e){return e==="auto_compact"||e==="manual_compact"}class pre{http;config;constructor(t){this.config=t,this.http=new cre(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,busy:t?.busy,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(bi),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 bi(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return bi(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.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 bi(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 bi(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(jy),hasMore:o.has_more}}async getSessionSnapshot(t){const n=Date.now();as("session:snapshot:start",{sessionId:t});try{const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),o={asOfSeq:s.as_of_seq,epoch:s.epoch,session:bi(s.session),messages:s.messages.items.map(jy),hasMoreMessages:s.messages.has_more,inFlightTurn:s.in_flight_turn===null?null:{turnId:s.in_flight_turn.turn_id,assistantText:s.in_flight_turn.assistant_text,thinkingText:s.in_flight_turn.thinking_text,runningTools:s.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:s.in_flight_turn.current_prompt_id},pendingApprovals:s.pending_approvals.map(vE),pendingQuestions:s.pending_questions.map(yE),subagents:(s.subagents??[]).map(Np)};return as("session:snapshot:accepted",{sessionId:t,busy:o.session.busy,seq:o.asOfSeq,messageCount:o.messages.length,durationMs:Date.now()-n}),o}catch(s){throw as("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...s3(s)}),s}}async exportSession(t,n){const s=n===void 0?0:new TextEncoder().encode(n).byteLength,o=n===void 0||n.length===0?0:n.split(`
|
|
297
|
+
`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:s,web_log_entries:o}),r=`${t}.zip`;return{blob:i.blob,fileName:hre(i.contentDisposition,r)}}async submitPrompt(t,n){const s=Date.now();as("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,xie(n));return as("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-s}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw as("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-s,...s3(o)}),o}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return bi(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 bi(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(bi)}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)}`,wie(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)}`,Aie(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(Np)}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 Np(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(vv)}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 vv(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return vv(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(G4)])):void 0;return{items:o.items.map(G4),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 Dc(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(Ud)}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 Ud(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 Ud(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}))}}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(Eie)}async listProviders(){return(await this.http.get("/providers")).items.map(pv)}async loginProviderApiKey(t,n){const s=await this.http.post(`/providers/${encodeURIComponent(t)}:login`,{method:"api_key",value:n});return pv(s)}async logoutProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:logout`,{});return pv(n)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return i3(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return i3(t)}async getConfig(){const t=await this.http.get("/config");return Vy(t)}async setConfig(t){const n={},s={defaultProvider:"default_provider",defaultModel:"default_model",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 Vy(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,authenticatedProviders:t.authenticated_providers}}async startOAuthLogin(t){const n=await this.http.post("/oauth/login",{provider:t});return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(t){const n=await this.http.get(`/oauth/login?provider=${encodeURIComponent(t)}`);return n?{flowId:n.flow_id,status:n.status,resolvedAt:n.resolved_at}:null}async cancelOAuthLogin(t){const n=await this.http.delete(`/oauth/login?provider=${encodeURIComponent(t)}`);return{cancelled:n.cancelled,status:n.status}}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 Dc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=eie(this.config.serverHttpUrl,this.config.clientId),s=qie(),o=new fre(n,this.config.clientId,{onWireEvent:i=>{const r=Tie(i),l=Nie(i),a=Mie(i);a.type==="historyCompacted"&&!o3(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!o3(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function i3(e){return{refreshed:e.refreshed,failed:e.failed}}let r3;function mt(){return r3??=new pre(Yoe()),r3}const mre=["src","controls","muted"],gre=["src","alt"],_E=Xe({__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=se(t.fileId?"":t.url),s=se(null),o=se(!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 mt().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 Je(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),mn(()=>{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}),Qn(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),E("video",{key:0,ref_key:"mediaEl",ref:s,class:He(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,mre)):(x(),E("img",{key:1,ref_key:"mediaEl",ref:s,class:He(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,gre))}}),vre=["title","data-kind"],yre=["aria-label"],kre={class:"att-tile"},bre={class:"att-name"},xre={key:1,class:"att-err"},wre=["aria-label"],_re=Xe({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=D(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=D(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=D(()=>n.name?n.name:n.kind==="image"?o("composer.attachmentImage"):n.kind==="video"?o("composer.attachmentVideo"):o("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=D(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(x(),E("span",{class:He(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[S("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>s("activate"))},[S("span",kre,[e.kind==="image"&&e.url?(x(),Ae(_E,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(x(),Ae(et,{key:1,name:"play",size:"sm"})):e.kind==="image"?(x(),Ae(et,{key:2,name:"image",size:"sm"})):(x(),Ae(et,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),S("span",bre,B(l.value),1),e.uploading?(x(),Ae($o,{key:0,size:"sm",label:A(o)("composer.uploading")},null,8,["label"])):e.error?(x(),E("span",xre,[ve(et,{name:"info",size:"sm"})])):ge("",!0)],8,yre),e.removable?(x(),Ae(en,{key:0,text:e.removeLabel??A(o)("composer.remove")},{default:Fe(()=>[S("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??A(o)("composer.remove"),onClick:d[1]||(d[1]=f=>s("remove"))},[ve(et,{name:"close",size:"sm"})],8,wre)]),_:1},8,["text"])):ge("",!0)],10,vre))}}),SE=dt(_re,[["__scopeId","data-v-2bbeba01"]]),Sre=["aria-label"],Cre=120,Are=60,Mre=Xe({__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*Cre}ms`,"--moon-frame-fast-delay":`${s*Are}ms`}}return(s,o)=>(x(),E("span",{class:He(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),E(De,null,rt(t,(i,r)=>S("span",{key:i,class:"ui-moon__frame",style:Jt(n(r)),"aria-hidden":"true"},B(i),5)),64))],10,Sre))}}),CE=dt(Mre,[["__scopeId","data-v-87f2e4d9"]]),Gi=se(null),ou=se(!1);function z2(e){const t=Gi.value;!t||ou.value||(Gi.value=null,t.resolve(e))}async function Ere(){const e=Gi.value;if(!(!e||ou.value)){if(!e.action){z2(!0);return}ou.value=!0;try{await e.action(),Gi.value===e&&(Gi.value=null),e.resolve(!0)}catch(t){Gi.value===e&&(Gi.value=null),e.reject(t)}finally{ou.value=!1}}}function Tre(e){return ou.value?Promise.resolve(!1):(Gi.value&&z2(!1),new Promise((t,n)=>{Gi.value={...e,resolve:t,reject:n}}))}function W1(){return{current:Gi,busy:ou,confirm:Tre,settle:z2,runAction:Ere}}const Nre=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,Ire=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,Lre=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,l3="text/plain;charset=utf-8";function $re(e,t){const n=(t??"").toLowerCase();if(Nre.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:l3;const s=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return s===void 0?null:Ire.test(s)?l3:Lre.test(s)?`image/${s==="jpg"?"jpeg":s==="ico"?"x-icon":s}`:s==="pdf"?"application/pdf":null}async function AE(e,t,n){const s=$re(t,n);if(s===null)return"unsupported";const o=window.open("","_blank");o!==null&&(o.opener=null);const i=await mt().getFileBlob(e).catch(()=>null);if(i===null)return o?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:s}));if(o!==null)o.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const Fre={class:"chat"},Ore={key:0,class:"chat-loading"},Rre={class:"chat-loading-text"},Bre={key:1,class:"chat-empty"},Dre={key:1,class:"top-sentinel-text"},Pre={key:0,class:"u-turn"},Hre=["data-turn-id"],Wre={key:0,class:"u-atts"},zre={key:1,class:"skill-act"},Ure={class:"skill-act-head"},qre={key:0,class:"skill-act-args"},jre={key:2,class:"skill-act"},Vre={class:"skill-act-head"},Kre={key:0,class:"skill-act-args"},Gre={key:3,class:"u-text"},Yre={key:0,class:"u-meta"},Zre=["aria-label","onClick"],Xre=["aria-label","onClick"],Qre=["data-turn-id"],Jre=["onClick"],ele={class:"cd-view"},tle={key:1,class:"cd-label"},nle=["data-turn-id"],sle={key:1,class:"msg"},ole={key:0,class:"a-msg-ft"},ile={key:0,class:"a-duration"},rle=["aria-label","onClick"],lle={key:4,class:"sending-placeholder"},ale={key:5,class:"q-stack"},cle={class:"q-head"},ule={class:"q-title"},dle={class:"q-hint"},fle=["onDragover","onDrop"],hle={class:"u-bub q-bub"},ple=["title","onDragstart"],mle=["title","onClick"],gle={key:0,class:"u-text q-text"},vle={key:1,class:"q-text q-text-placeholder"},yle={key:0,class:"q-imgs"},kle={key:0,class:"q-file"},ble={key:1,class:"q-tag q-tag-next"},xle={key:2,class:"q-tag q-tag-idx"},wle=["aria-label","onClick"],_le={key:0,class:"open-unsupported",role:"status"},Sle=2500,Cle=Xe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{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}=Ot(),{confirm:o}=W1();Cn(()=>{ie!==null&&(clearTimeout(ie),ie=null),R!==null&&(clearTimeout(R),R=null),$!==null&&(clearTimeout($),$=null),oe!==null&&(clearTimeout(oe),oe=null)});const i=e,r=se(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(pe=>{pe[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))}mn(a),Cn(()=>{l?.disconnect(),l=null}),Je(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{yt().then(a)});const c=D(()=>{if(!i.turnActive||i.turns.length===0)return null;const pe=i.turns.at(-1);return pe.role==="assistant"?pe.id:null}),u=D(()=>i.working),d=n,f=se(null),h=se(null);function p(pe){return(pe.attachments?.length??0)>0}function m(pe){d("editQueued",pe)}function y(pe,Ee){if(f.value=pe,!Ee.dataTransfer)return;Ee.dataTransfer.effectAllowed="move",Ee.dataTransfer.setData("text/plain",String(pe));const ue=Ee.currentTarget?.closest(".q-turn");ue&&Ee.dataTransfer.setDragImage(ue,24,24)}function k(pe,Ee){if(f.value===null)return;Ee.preventDefault(),Ee.dataTransfer&&(Ee.dataTransfer.dropEffect="move");const ue=Ee.currentTarget.getBoundingClientRect(),Y=Ee.clientY<ue.top+ue.height/2?"before":"after";h.value={index:pe,position:Y}}function g(pe,Ee){Ee.preventDefault();const ue=f.value,Y=h.value?.position??"before";if(f.value=null,h.value=null,ue===null)return;let Q=Y==="before"?pe:pe+1;ue<Q&&(Q-=1),ue!==Q&&d("reorderQueue",{from:ue,to:Q})}function v(){f.value=null,h.value=null}const b=D(()=>{for(let pe=i.turns.length-1;pe>=0;pe--)if(i.turns[pe].role==="user")return i.turns[pe].id;return null});function C(pe){return pe.role==="user"&&pe.id===b.value&&!i.working&&!pe.skillActivation&&!pe.pluginCommand}function I(pe){const Ee=pe.compaction,ue=Ee?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof Ee?.tokensBefore=="number"&&typeof Ee?.tokensAfter=="number"?ue+s("conversation.compactedTokens",{before:Br(Ee.tokensBefore),after:Br(Ee.tokensAfter)}):ue}const T=se(null),M=se(null);let $=null;async function N(pe){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(pe)}function F(pe){M.value===null&&(M.value=pe.id,d("editMessage",{text:pe.text,attachments:pe.attachments}),$=setTimeout(()=>{$=null,M.value=null},Sle))}Je(()=>i.turns,pe=>{M.value!==null&&(pe.some(Ee=>Ee.id===M.value)||(M.value=null,$!==null&&(clearTimeout($),$=null)))},{flush:"post"});const _=se(!1);let R=null;function z(){if(i.turns.length===0)return;const pe=[];for(const ue of i.turns){if(ue.role==="compaction"||ue.role==="cron")continue;const Y=ue.role==="user"?"User":"Assistant",Q=MU(ue);Q.trim()&&pe.push(`**${Y}**
|
|
298
|
+
|
|
299
|
+
${Q}`)}const Ee=pe.join(`
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
`);Hs(Ee).then(ue=>{ue&&(_.value=!0,d("copyConversationCopied"),R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,_.value=!1},2e3))}).catch(()=>{})}function W(pe){const Ee=[];for(let ue=pe;ue>=0;ue--){const Y=i.turns[ue];if(!Y||Y.role!=="assistant")break;Ee.unshift(Y)}return Ee}function L(pe){return W(pe).map(Ee=>AU(Ee)).filter(Boolean).join(`
|
|
304
|
+
|
|
305
|
+
`)}function O(){for(let pe=i.turns.length-1;pe>=0;pe-=1)if(i.turns[pe]?.role==="assistant")return L(pe);return""}function q(){const pe=O();pe.trim()&&Hs(pe).then(Ee=>{Ee&&(_.value=!0,d("copyConversationCopied"),R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,_.value=!1},2e3))}).catch(()=>{})}t({copyConversation:z,copyFinalSummary:q});function X(pe){const Ee=i.turns[pe];if(!Ee||Ee.role!=="assistant")return!1;const ue=i.turns[pe+1];return!ue||ue.role!=="assistant"}let ie=null;function U(pe){const Ee=i.turns[pe];if(!Ee)return;const ue=L(pe);ue.trim()&&Hs(ue).then(Y=>{Y&&(T.value=Ee.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,T.value=null},1400))}).catch(()=>{})}function j(pe){const Ee=pe.text;Ee.trim()&&Hs(Ee).then(ue=>{ue&&(T.value=pe.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,T.value=null},1400))}).catch(()=>{})}function te(pe){return{kind:pe.kind==="video"?"video":"image",url:pe.url,path:pe.name,fileId:pe.fileId}}const ae=se(null);let oe=null;function re(pe){if(pe.kind==="image"||pe.kind==="video"){d("openMedia",te(pe));return}pe.fileId!==void 0&&AE(pe.fileId,pe.name,pe.mediaType).then(Ee=>{Ee==="unsupported"&&(ae.value=pe.name??pe.fileId??"",oe!==null&&clearTimeout(oe),oe=setTimeout(()=>{oe=null,ae.value=null},2400))})}function xe(pe,Ee){return pe.id!==c.value?!1:Ee.sourceIndex===k1(pe).length-1}return(pe,Ee)=>(x(),E(De,null,[S("div",Fre,[e.sessionLoading?(x(),E("div",Ore,[ve($o,{size:"sm"}),S("span",Rre,B(A(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),E("div",Bre)):ge("",!0),e.hasMoreMessages||e.loadingMore?(x(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:He(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),E("span",Dre,[ve($o,{size:"sm"}),tt(" "+B(A(s)("conversation.loadingOlder")),1)])):(x(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ee[0]||(Ee[0]=ue=>d("loadOlderMessages"))},B(A(s)("conversation.loadOlder")),1))],2)):ge("",!0),(x(!0),E(De,null,rt(e.turns,(ue,Y)=>(x(),E(De,{key:ue.id},[ue.role==="user"?(x(),E("div",Pre,[S("div",{class:He(["u-bub turn-anchor",{undoing:M.value===ue.id}]),"data-turn-id":ue.id},[ue.attachments&&ue.attachments.length>0?(x(),E("div",Wre,[(x(!0),E(De,null,rt(ue.attachments,(Q,P)=>(x(),Ae(SE,{key:P,kind:Q.kind,name:Q.name,url:Q.url,"file-id":Q.fileId,"media-type":Q.mediaType,size:Q.size,onActivate:G=>re(Q)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ge("",!0),ue.skillActivation?(x(),E("div",zre,[S("div",Ure,[Ee[9]||(Ee[9]=S("span",{class:"skill-act-arrow"},"▶",-1)),S("span",null,B(A(s)("conversation.activatedSkill",{name:ue.skillActivation.name})),1)]),ue.skillActivation.args?(x(),E("div",qre,B(ue.skillActivation.args),1)):ge("",!0)])):ue.pluginCommand?(x(),E("div",jre,[S("div",Vre,[Ee[10]||(Ee[10]=S("span",{class:"skill-act-arrow"},"▶",-1)),S("span",null,"/"+B(ue.pluginCommand.pluginId)+":"+B(ue.pluginCommand.commandName),1)]),ue.pluginCommand.args?(x(),E("div",Kre,B(ue.pluginCommand.args),1)):ge("",!0)])):(x(),E("div",Gre,B(ue.text),1))],10,Hre),ue.createdAt||C(ue)?(x(),E("div",Yre,[C(ue)?(x(),E("div",{key:0,class:He(["u-edit-wrap",{undoing:M.value===ue.id}])},[S("button",{type:"button",class:"u-edit","aria-label":A(s)("conversation.undoTooltip"),onClick:Q=>N(ue)},[ve(et,{name:"undo",size:"sm"})],8,Zre)],2)):ge("",!0),ue.text.trim().length>0?(x(),E("button",{key:1,type:"button",class:"u-copy","aria-label":A(s)("filePreview.copy"),onClick:Mt(Q=>j(ue),["stop"])},[T.value!==ue.id?(x(),Ae(et,{key:0,name:"copy",size:"sm"})):(x(),Ae(et,{key:1,name:"check",size:"sm"}))],8,Xre)):ge("",!0),ue.createdAt?(x(),Ae(hE,{key:2,time:ue.createdAt},null,8,["time"])):ge("",!0)])):ge("",!0)])):ue.role==="compaction"?(x(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ue.id,role:"separator"},[Ee[11]||(Ee[11]=S("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ue.text?(x(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:Q=>d("openCompaction",{turnId:ue.id})},[S("span",null,B(I(ue)),1),S("span",ele,B(A(s)("conversation.viewSummary")),1)],8,Jre)):(x(),E("span",tle,B(I(ue)),1)),Ee[12]||(Ee[12]=S("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Qre)):ue.role==="cron"?(x(),Ae(Voe,{key:2,text:ue.text,cron:ue.cron,"turn-id":ue.id,"created-at":ue.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),E("div",{key:3,class:"a-msg turn-anchor","data-turn-id":ue.id},[(x(!0),E(De,null,rt(A(CU)(ue),(Q,P)=>(x(),E(De,{key:A(EU)(Q,P)},[Q.kind==="thinking"?(x(),Ae(Coe,{key:0,text:Q.thinking,mobile:"",streaming:xe(ue,Q),onOpen:G=>d("openThinking",{turnId:ue.id,blockIndex:Q.sourceIndex})},null,8,["text","streaming","onOpen"])):Q.kind==="text"&&Q.text?(x(),E("div",sle,[ve(H1,{text:Q.text,streaming:xe(ue,Q),"open-file":G=>d("openFile",G)},null,8,["text","streaming","open-file"])])):Q.kind==="tool-stack"?(x(),Ae(OU,{key:2,tools:Q.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ee[1]||(Ee[1]=G=>d("openMedia",G)),onOpenFile:Ee[2]||(Ee[2]=G=>d("openFile",G)),onOpenToolDiff:Ee[3]||(Ee[3]=G=>d("openToolDiff",G)),onOpenAgent:Ee[4]||(Ee[4]=G=>d("openAgent",G))},null,8,["tools","tool-diff-panel"])):Q.kind==="tool"?(x(),Ae(c6,{key:3,tool:Q.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ee[5]||(Ee[5]=G=>d("openMedia",G)),onOpenFile:Ee[6]||(Ee[6]=G=>d("openFile",G)),onOpenToolDiff:Ee[7]||(Ee[7]=G=>d("openToolDiff",G)),onOpenAgent:Ee[8]||(Ee[8]=G=>d("openAgent",G))},null,8,["tool","tool-diff-panel"])):ge("",!0)],64))),128)),ue.id!==c.value&&X(Y)&&(L(Y).trim().length>0||ue.durationMs!==void 0)?(x(),E("div",ole,[ve(en,{text:`${ue.durationMs} ms`},{default:Fe(()=>[ue.durationMs!==void 0?(x(),E("span",ile,B(A(wU)(ue.durationMs)),1)):ge("",!0)]),_:2},1032,["text"]),L(Y).trim().length>0?(x(),E("button",{key:0,class:"a-cpbtn","aria-label":A(s)("filePreview.copy"),onClick:Q=>U(Y)},[T.value!==ue.id?(x(),Ae(et,{key:0,name:"copy",size:"sm"})):(x(),Ae(et,{key:1,name:"check",size:"sm"}))],8,rle)):ge("",!0)])):ge("",!0)],8,nle))],64))),128)),e.compaction?(x(),Ae(Noe,{key:3,label:A(s)("conversation.compacting")},null,8,["label"])):ge("",!0),u.value?(x(),E("div",lle,[ve(CE,{fast:e.fastMoon},null,8,["fast"])])):ge("",!0),e.queued.length>0?(x(),E("div",ale,[S("div",cle,[S("span",ule,[ve(et,{name:"mail",size:"sm"}),tt(" "+B(A(s)("composer.queueLabel"))+" · ",1),S("b",null,B(e.queued.length),1)]),S("span",dle,B(A(s)("composer.queueAutoDrain")),1)]),(x(!0),E(De,null,rt(e.queued,(ue,Y)=>(x(),E("div",{key:Y,class:He(["u-turn q-turn",{"q-dragging":f.value===Y,"drop-before":h.value?.index===Y&&h.value.position==="before","drop-after":h.value?.index===Y&&h.value.position==="after"}]),onDragover:Q=>k(Y,Q),onDrop:Q=>g(Y,Q)},[S("div",hle,[S("span",{class:"q-grip",title:A(s)("composer.queueDragTitle"),draggable:"true",onDragstart:Q=>y(Y,Q),onDragend:v},[ve(et,{name:"grip",size:"sm"})],40,ple),S("button",{type:"button",class:"q-body",title:A(s)("composer.editQueued"),onClick:Q=>m(Y)},[ue.text?(x(),E("span",gle,B(ue.text),1)):(x(),E("span",vle,[ve(et,{name:"file",size:"sm"}),tt(" "+B(A(s)("composer.queuedAttachments",{n:ue.attachments?.length??0})),1)]))],8,mle),p(ue)?(x(),E("div",yle,[(x(!0),E(De,null,rt(ue.attachments,(Q,P)=>(x(),E(De,{key:P},[Q.kind==="file"?(x(),E("span",kle,[ve(et,{name:"file",size:"sm"}),tt(" "+B(Q.name??Q.fileId),1)])):(x(),Ae(_E,{key:1,url:Q.url,kind:Q.kind,"file-id":Q.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ge("",!0),Y===0?(x(),E("span",ble,B(A(s)("composer.queueNext")),1)):(x(),E("span",xle,"#"+B(Y+1),1)),S("button",{type:"button",class:"q-rm","aria-label":A(s)("composer.remove"),onClick:Mt(Q=>d("unqueue",Y),["stop"])},[ve(et,{name:"close",size:"sm"})],8,wle)])],42,fle))),128))])):ge("",!0)]),ae.value!==null?(x(),E("div",_le,B(A(s)("composer.attachmentOpenUnsupported",{name:ae.value})),1)):ge("",!0)],64))}}),ME=dt(Cle,[["__scopeId","data-v-10ab1f89"]]),Ale={class:"ch-id"},Mle={key:0,class:"ch-ws"},Ele={key:1,class:"ch-sep"},Tle=["onKeydown"],Nle={class:"ch-ses"},Ile={key:0,class:"ch-pill ch-sync-pill"},Lle={key:0,class:"ch-ahead"},$le={key:1,class:"ch-behind"},Fle={key:1,class:"ch-pill ch-diff-pill"},Ole={key:0,class:"ch-add"},Rle={key:1,class:"ch-del"},Ble=Xe({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=D(()=>s.ahead??0),r=D(()=>s.behind??0),l=D(()=>s.gitDiffStats?.totalAdditions??0),a=D(()=>s.gitDiffStats?.totalDeletions??0),c=D(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(X){return X.trim().toLowerCase().replaceAll("_","-")}function f(X){const ie=d(X);return u[ie]?`pr-${ie}`:"pr-unknown"}function h(X){return n(u[d(X)]??"header.prStatusUnknown")}const p=se(!1),m=se(null),y=se(null),k=se({});function g(X){const ie=X.target;y.value?.el?.contains(ie)||m.value?.el?.contains(ie)||C()}function v(){C()}async function b(X){if(X.stopPropagation(),p.value){C();return}p.value=!0,document.addEventListener("mousedown",g),window.addEventListener("resize",v),await yt();const ie=m.value?.el,U=y.value?.el;if(!ie||!U)return;const j=ie.getBoundingClientRect(),te=4,ae=8,oe=U.offsetWidth,re=U.offsetHeight;let xe=j.bottom+te;xe+re>window.innerHeight-ae&&(xe=Math.max(ae,j.top-re-te));let pe=j.left;pe+oe>window.innerWidth-ae&&(pe=Math.max(ae,j.right-oe)),k.value={top:`${Math.round(xe)}px`,left:`${Math.round(pe)}px`}}function C(){p.value=!1,document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)}Cn(()=>{document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)});function I(){o("copyAll"),C()}function T(){o("copyFinalSummary"),C()}const M=se(!1);function $(){s.sessionId&&Hs(s.sessionId).then(X=>{X&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const N=se(!1),F=se(""),_=se(null);async function R(){if(C(),!!s.sessionId){N.value=!0,F.value=s.sessionTitle??"",await yt();try{_.value?.focus(),_.value?.select()}catch{}}}function z(){const X=F.value.trim();X&&s.sessionId&&X!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,X),N.value=!1}function W(){N.value=!1}function L(){s.sessionId&&(C(),o("forkSession",s.sessionId))}function O(){s.sessionId&&(C(),o("exportSession",s.sessionId))}function q(){s.sessionId&&(C(),o("archiveSession",s.sessionId))}return(X,ie)=>(x(),E("header",{class:He(["chat-header",{"macos-desktop":A(Gc)}])},[S("div",Ale,[e.workspaceName?(x(),E("span",Mle,B(e.workspaceName),1)):ge("",!0),e.workspaceName&&e.sessionTitle?(x(),E("span",Ele,"/")):ge("",!0),N.value?Fn((x(),E("input",{key:2,ref_key:"renameInputRef",ref:_,"onUpdate:modelValue":ie[0]||(ie[0]=U=>F.value=U),class:"ch-rename",type:"text",onKeydown:[Yi(Mt(z,["stop"]),["enter"]),Yi(Mt(W,["stop"]),["esc"])],onBlur:z,onClick:ie[1]||(ie[1]=Mt(()=>{},["stop"]))},null,40,Tle)),[[po,F.value]]):e.sessionTitle?(x(),Ae(en,{key:3,text:e.sessionTitle},{default:Fe(()=>[S("span",Nle,B(e.sessionTitle),1)]),_:1},8,["text"])):ge("",!0)]),ve(Wn,{ref_key:"kebabRef",ref:m,class:He(["ch-act-more",{open:p.value}]),label:A(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:ie[2]||(ie[2]=Mt(U=>b(U),["stop"]))},{default:Fe(()=>[ve(et,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(x(),Ae(Ma,{key:0,ref_key:"menuRef",ref:y,class:"ch-menu",style:Jt(k.value),onClick:ie[3]||(ie[3]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{onClick:I},{default:Fe(()=>[ve(et,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),tt(" "+B(e.copied?A(n)("header.copied"):A(n)("header.copyAll")),1)]),_:1}),ve(_n,{onClick:T},{default:Fe(()=>[ve(et,{name:"file-text",size:"sm"}),tt(" "+B(A(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),E(De,{key:0},[ve(_n,{separator:""}),ve(_n,{onClick:$},{default:Fe(()=>[ve(et,{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),tt(" "+B(M.value?A(n)("header.copied"):A(n)("header.copySessionId")),1)]),_:1}),ve(_n,{onClick:R},{default:Fe(()=>[ve(et,{name:"pencil",size:"sm"}),tt(" "+B(A(n)("header.renameSession")),1)]),_:1}),ve(_n,{onClick:L},{default:Fe(()=>[ve(et,{name:"git-fork",size:"sm"}),tt(" "+B(A(n)("header.forkSession")),1)]),_:1}),ve(_n,{onClick:O},{default:Fe(()=>[ve(et,{name:"download",size:"sm"}),tt(" "+B(A(n)("header.exportSession")),1)]),_:1}),ve(_n,{danger:"",onClick:q},{default:Fe(()=>[ve(et,{name:"archive",size:"sm"}),tt(" "+B(A(n)("header.archiveSession")),1)]),_:1})],64)):ge("",!0)]),_:1},8,["style"])):ge("",!0),ie[6]||(ie[6]=S("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),E("button",{key:1,type:"button",class:"ch-git",onClick:ie[4]||(ie[4]=U=>o("openChanges"))},[S("span",{class:He(["ch-branch",{"ch-detached":!e.branch}])},B(e.branch||A(n)("header.detached")),3),i.value>0||r.value>0?(x(),E("span",Ile,[i.value>0?(x(),E("span",Lle,"↑"+B(i.value),1)):ge("",!0),r.value>0?(x(),E("span",$le,"↓"+B(r.value),1)):ge("",!0)])):ge("",!0),c.value?(x(),E("span",Fle,[l.value>0?(x(),E("span",Ole,"+"+B(l.value),1)):ge("",!0),a.value>0?(x(),E("span",Rle,"-"+B(a.value),1)):ge("",!0)])):ge("",!0)])):ge("",!0),e.pr?(x(),E("button",{key:2,type:"button",class:He(["ch-pill ch-pr",f(e.pr.state)]),onClick:ie[5]||(ie[5]=U=>e.pr&&o("openPr",e.pr.url))},[ve(et,{name:"git-pull-request",size:"sm"}),S("span",null,"PR #"+B(e.pr.number)+" · "+B(h(e.pr.state)),1)],2)):ge("",!0)],2))}}),Dle=dt(Ble,[["__scopeId","data-v-999779db"]]),Ple=["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"],a3=[[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 Hle(e){if(e<=255)return Ple[e];let t=0,n=a3.length-1;for(;t<=n;){const s=t+n>>1,o=a3[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function Wle(e){const t=e.length;if(t===0)return null;const n=new Array(t);let s=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=Hle(d);(h==="R"||h==="AL"||h==="AN")&&(s=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!s)return null;let o=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){o=0;break}if(u==="R"||u==="AL"){o=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;const r=o&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function zle(e,t){const n=Wle(e);if(n===null)return null;const s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}const Ule=/[ \t\n\r\f]+/g,qle=/[\t\n\r\f]| {2,}|^ | $/;function jle(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Vle(e){if(!qle.test(e))return e;let t=e.replace(Ule," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Kle(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
306
|
+
`).replace(/[\r\f]/g,`
|
|
307
|
+
`):e}let yv=null,Gle;function Yle(){return yv===null&&(yv=new Intl.Segmenter(Gle,{granularity:"word"})),yv}const Zle=/\p{Script=Arabic}/u,Pl=/\p{M}/u,U2=/\p{Nd}/u;function c3(e){return Zle.test(e)}function u3(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function er(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){const o=(n-55296<<10)+(s-56320)+65536;if(u3(o))return!0;t++;continue}}if(u3(n))return!0}}return!1}function Xle(e){const t=Of(e);return t!==null&&(q2.has(t)||Pa.has(t))}const Qle=new Set([" "," ","","\uFEFF"]),Jle=new Set(["-","‐","–","—"]);function eae(e){const t=Of(e);return t!==null&&Qle.has(t)}function tae(e){const t=Of(e);return t!==null&&Jle.has(t)}function EE(e,t){return eae(e)?!1:t?!(Xle(e)||tae(e)):!0}const q2=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),z1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),j2=new Set(["'","’"]),Pa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),nae=new Set([":",".","،","؛"]),sae=new Set(["၏"]),oae=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function iae(e){if(V2(e))return!0;let t=!1;for(const n of e){if(Pa.has(n)||q1(n)){t=!0;continue}if(!(t&&Pl.test(n)))return!1}return t}function rae(e){for(const t of e)if(!q2.has(t)&&!Pa.has(t))return!1;return e.length>0}function lae(e){if(V2(e))return!0;for(const t of e)if(!z1.has(t)&&!j2.has(t)&&!Pl.test(t)&&!q1(t))return!1;return e.length>0}function V2(e){let t=!1;for(const n of e)if(!(n==="\\"||Pl.test(n))){if(z1.has(n)||Pa.has(n)||j2.has(n)){t=!0;continue}return!1}return t}function U1(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 Of(e){if(e.length===0)return null;const t=U1(e,e.length);return e.slice(t)}function aae(e){for(const t of e)if(!Pl.test(t))return t;return null}function cae(e){for(let t=e.length;t>0;){const n=U1(e,t),s=e.slice(n,t);if(!Pl.test(s))return s;t=n}return null}const uae=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function dae(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function q1(e){const t=e.codePointAt(0);return t!==void 0&&dae(t,uae)}function fae(e){const t=cae(e);return t!==null&&q1(t)}function hae(e){const t=aae(e);return t!==null&&U2.test(t)}function pae(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Pl.test(s)){n--;continue}if(z1.has(s)||j2.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function mae(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function d3(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 f3(e,t){return e&&t!==null&&nae.has(t)}function gae(e){const t=Of(e);return t!==null&&sae.has(t)}function vae(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Zy(e){let t=e.length;for(;t>0;){const n=U1(e,t),s=e.slice(n,t);if(oae.has(s))return!0;if(!Pa.has(s))return!1;t=n}return!1}function yae(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
308
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const kae=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ti(e){return e.length===1?e[0]:e.join("")}function bae(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Ti(n)}function xae(e,t,n,s){if(!kae.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=yae(u,s),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&o.push({text:Ti(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&o.push({text:Ti(r),isWordLike:a,kind:i,start:l}),o}function Xy(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const wae=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function _ae(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:wae.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Sae(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Cae(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let r=0;r<e.len;r++){if(s[r]!=="text"||!_ae(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!Xy(s[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(s[a]="text",t[a]="",a++,c)break}t[r]=Ti(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],s[i]=s[r],o[i]=o[r]),i++)}return t.length=i,n.length=i,s.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:s,starts:o}}function Aae(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i]),!Sae(r))continue;const l=i+1;if(l>=e.len||Xy(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!Xy(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Ti(a)),n.push(!0),s.push("text"),o.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}const Mae=new Set([":","-","/","×",",",".","+","–","—"]),Eae=/[\p{P}\p{S}\p{Co}]/u,Tae=/\p{Emoji_Presentation}/u,Nae=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function Iae(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function TE(e){const t=e.charCodeAt(0);return t<128?Iae(t):!Nae.has(e)&&!Tae.test(e)&&Eae.test(e)}function h3(e){let t=!1;for(const n of e)if(!Pl.test(n)){if(!TE(n))return!1;t=!0}return t}function Lae(e){for(let t=e.length;t>0;){const n=U1(e,t),s=e.slice(n,t);if(Pl.test(s)){t=n;continue}return TE(s)||q1(s)}return!1}function $ae(e,t,n,s){const o=!t&&h3(e),i=!s&&h3(n),r=fae(e),l=(t||r)&&Lae(e);return!o&&!i&&!l||er(e)||er(n)?!1:(t||o||r)&&(s||i)}function NE(e){for(const t of e)if(U2.test(t))return!0;return!1}function Fm(e){if(e.length===0)return!1;for(const t of e)if(!(U2.test(t)||Mae.has(t)))return!1;return!0}function Fae(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Fm(r)&&NE(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Fm(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Ti(a)),n.push(!0),s.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),s.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Oae(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&$ae(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(Ti(c)),n.push(d),s.push("text"),o.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),s.push(l),o.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Rae(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!NE(u)||!Fm(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),s.push("text"),o.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Bae(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Ti(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),s.push("glue"),o.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Ti(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(Ti(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Dae(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!er(t[i])||!er(t[i+1]))continue;const r=pae(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],o[i+1]=o[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Pae(e,t,n){const s=Yle();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],y=[];for(const I of s.segment(e))for(const T of xae(I.segment,I.isWordLike??!1,I.index,n)){let L=function(){u[W]!==null&&(r[W]=[d3(i,u,d,W)],u[W]=null),r[W].push(T.text),l[W]=l[W]||T.isWordLike,f[W]=f[W]||N,h[W]=h[W]||F,p[W]=R,m[W]=z,y[W]=f3(h[W],_)};const M=T.kind==="text",$=mae(T.text,T.isWordLike,T.kind),N=er(T.text),F=c3(T.text),_=Of(T.text),R=Zy(T.text),z=gae(T.text),W=o-1;t.carryCJKAfterClosingQuote&&M&&o>0&&a[W]==="text"&&N&&f[W]&&p[W]||M&&o>0&&a[W]==="text"&&rae(T.text)&&f[W]||M&&o>0&&a[W]==="text"&&m[W]?L():M&&o>0&&a[W]==="text"&&T.isWordLike&&F&&y[W]?(L(),l[W]=!0):$!==null&&o>0&&a[W]==="text"&&u[W]===$?d[W]=(d[W]??1)+1:M&&!T.isWordLike&&o>0&&a[W]==="text"&&!f[W]&&(iae(T.text)||T.text==="-"&&l[W])?L():(i[o]=T.text,r[o]=[T.text],l[o]=T.isWordLike,a[o]=T.kind,c[o]=T.start,u[o]=$,d[o]=$===null?0:1,f[o]=N,h[o]=F,p[o]=R,m[o]=z,y[o]=f3(F,_),o++)}for(let I=0;I<o;I++){if(u[I]!==null){i[I]=d3(i,u,d,I);continue}i[I]=Ti(r[I])}for(let I=1;I<o;I++)a[I]==="text"&&!l[I]&&V2(i[I])&&a[I-1]==="text"&&!f[I-1]&&(i[I-1]+=i[I],l[I-1]=l[I-1]||l[I],i[I]="");const k=Array.from({length:o},()=>null);let g=-1;for(let I=o-1;I>=0;I--){const T=i[I];if(T.length!==0){if(a[I]==="text"&&!l[I]&&g>=0&&a[g]==="text"&&(lae(T)||T==="-"&&hae(i[g]))){const M=k[g]??[];M.push(T),k[g]=M,c[g]=c[I],i[I]="";continue}g=I}}for(let I=0;I<o;I++){const T=k[I];T!=null&&(i[I]=bae(T,i[I]))}let v=0;for(let I=0;I<o;I++){const T=i[I];T.length!==0&&(v!==I&&(i[v]=T,l[v]=l[I],a[v]=a[I],c[v]=c[I]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const b=Bae({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),C=Dae(Oae(Rae(Fae(Aae(Cae(b))))));for(let I=0;I<C.len-1;I++){const T=vae(C.texts[I]);T!==null&&(C.kinds[I]!=="space"&&C.kinds[I]!=="preserved-space"||C.kinds[I+1]!=="text"||!c3(C.texts[I+1])||(C.texts[I]=T.space,C.isWordLike[I]=!1,C.kinds[I]=C.kinds[I]==="preserved-space"?"preserved-space":"space",C.texts[I+1]=T.marks+C.texts[I+1],C.starts[I+1]=C.starts[I]+T.space.length))}return C}function Hae(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Wae(e,t,n){if(t.len<=1)return t;const s=[],o=[],i=[],r=[];let l=-1,a=!1;function c(f){s.push(t.texts[f]),o.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let k=f;k<h;k++)p=p||t.isWordLike[k];const m=t.starts[f],y=h<t.len?t.starts[h]:e.length;s.push(e.slice(m,y)),o.push(p),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!EE(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||er(h);continue}d(f),s.push(h),o.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function zae(e,t,n="normal",s="normal"){const o=jle(n),i=o.mode==="pre-wrap"?Kle(e):Vle(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=Pae(i,t,o),l=s==="keep-all"?Wae(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:Hae(l,o),...l}}let wc=null;const p3=new Map;let _c=null;const Uae=96,qae=/\p{Emoji_Presentation}/u,jae=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let kv=null;const m3=new Map;function K2(){if(wc!==null)return wc;if(typeof OffscreenCanvas<"u")return wc=new OffscreenCanvas(1,1).getContext("2d"),wc;if(typeof document<"u")return wc=document.createElement("canvas").getContext("2d"),wc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Vae(e){let t=p3.get(e);return t||(t=new Map,p3.set(e,t)),t}function yl(e,t){let n=t.get(e);return n===void 0&&(n={width:K2().measureText(e).width,containsCJK:er(e)},t.set(e,n)),n}function j1(){if(_c!==null)return _c;if(typeof navigator>"u")return _c={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},_c;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),s=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return _c={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},_c}function Kae(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function IE(){return kv===null&&(kv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),kv}function Gae(e){return qae.test(e)||e.includes("️")}function Yae(e){return jae.test(e)}function Zae(e,t){let n=m3.get(e);if(n!==void 0)return n;const s=K2();s.font=e;const o=s.measureText("😀").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),o-r>.5&&(n=o-r)}return m3.set(e,n),n}function Xae(e){let t=0;const n=IE();for(const s of n.segment(e))Gae(s.segment)&&t++;return t}function Qae(e,t){return t.emojiCount===void 0&&(t.emojiCount=Xae(e)),t.emojiCount}function wa(e,t,n){return n===0?t.width:t.width-Qae(e,t)*n}function Jae(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=IE(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const u=[];for(const d of r){const f=yl(d,n);u.push(wa(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>Uae){const u=[];let d=null,f=0;for(const h of r){const p=yl(h,n),m=wa(h,p,s);if(d===null)u.push(m);else{const y=d+h,k=yl(y,n);u.push(wa(y,k,s)-f)}d=h,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=yl(a,n),f=wa(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function ece(e,t){const n=K2();n.font=e;const s=Vae(e),o=Kae(e),i=t?Zae(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function tce(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function LE(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function $E(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!tce(s))break;t++}return t}function nce(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function sce(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function G2(e,t){return t===0?0:e+t}function oce(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function ice(e,t,n,s,o){const i=t==="tab"?o+oce(e,n):e.lineEndFitAdvances[n];return G2(s,i)}function g3(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return G2(s,o)}function v3(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return G2(s,i)}function rce(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function lce(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Om(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function ace(e,t,n,s,o){if(e.letterSpacing===0)return 0;if(o>0)return e.spacingGraphemeCounts[s]>0?e.letterSpacing:0;for(let i=s-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===s-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function cce(e,t,n,s,o,i){return t+ace(e,n,s,o,i)}function uce(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=j1().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,y=0,k=-1,g=0;function v(){k=-1,g=0}function b(N=m,F=y,_=d){u++,n?.(_,h,p,N,F),d=0,f=!1,v()}function C(N,F){f=!0,h=N,p=0,m=N+1,y=0,d=F}function I(N,F,_){f=!0,h=N,p=F,m=N,y=F+1,d=_}function T(N,F){if(!f){C(N,F);return}d+=F,m=N+1,y=0}function M(N,F){const _=i[N],R=r[N]??null;let z=R===null?-1:Om(R,0,F+1),W=-1,L=0,O=F;for(;O<_.length;){const q=_[O];if(!f)I(N,O,q);else if(d+q>c){if(R!==null&&W>F){b(N,W,L),O=W,z=Om(R,z,O+1),W=-1,L=0;continue}b(),I(N,O,q)}else d+=q,m=N,y=O+1;const X=O+1;R!==null&&R[z]===X&&(W=X,L=d,z++),O++}f&&m===N&&y===_.length&&(m=N+1,y=0)}let $=0;for(;$<s.length&&!(!f&&($=$E(e,$),$>=s.length));){const N=s[$],F=o[$],_=LE(F);if(!f){N>c&&i[$]!==null?M($,0):C($,N),_&&(k=$+1,g=d-N),$++;continue}if(d+N>c){if(_){T($,N),b($+1,0,d-N),$++;continue}if(k>=0){if(m>k||m===k&&y>0){b();continue}b(k,0,g);continue}if(N>c&&i[$]!==null){b(),M($,0),$++;continue}b();continue}T($,N),_&&(k=$+1,g=d-N),$++}return f&&b(),u}function dce(e,t,n){if(e.simpleLineWalkFastPath)return uce(e,t,n);const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(s.length===0||a.length===0)return 0;const c=j1(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,y=0,k=0,g=0,v=-1,b=0,C=0,I=null;function T(){v=-1,b=0,C=0,I=null}function M(){return I==="soft-hyphen"&&v===k&&g===0?C:h}function $(L=k,O=g,q){f++,n!==void 0&&n(cce(e,q??M(),m,y,L,O),m,y,L,O),h=0,p=!1,T()}function N(L,O){p=!0,m=L,y=0,k=L+1,g=0,h=O}function F(L,O,q){p=!0,m=L,y=O,k=L,g=O+1,h=q}function _(L,O){if(!p){N(L,O);return}h+=O,k=L+1,g=0}function R(L,O,q,X,ie,U){if(!O)return;const j=g3(e,L,q,ie),te=v3(e,L,q,ie,X);v=q+1,b=h-U+j,C=h-U+te,I=L}function z(L,O){const q=i[L],X=r[L]??null;let ie=X===null?-1:Om(X,0,O+1),U=-1,j=0,te=O;for(;te<q.length;){const ae=q[te];if(!p)F(L,te,ae);else{const re=rce(e,!0,ae),xe=h+re;if(lce(e,xe)>d){if(X!==null&&U>O){$(L,U,j),te=U,ie=Om(X,ie,te+1),U=-1,j=0;continue}$(),F(L,te,ae)}else h=xe,k=L,g=te+1}const oe=te+1;X!==null&&X[ie]===oe&&(U=oe,j=h,ie++),te++}p&&k===L&&g===q.length&&(k=L+1,g=0)}function W(L){f++,n?.(0,L.startSegmentIndex,0,L.consumedEndSegmentIndex,0),T()}for(let L=0;L<a.length;L++){const O=a[L];if(O.startSegmentIndex===O.endSegmentIndex){W(O);continue}p=!1,h=0,m=O.startSegmentIndex,y=0,k=O.startSegmentIndex,g=0,T();let q=O.startSegmentIndex;for(;q<O.endSegmentIndex&&!(!p&&(q=$E(e,q,O.endSegmentIndex),q>=O.endSegmentIndex));){const X=o[q],ie=LE(X),U=sce(e,p,q),j=X==="tab"?nce(h+U,e.tabStopAdvance):s[q],te=U+j,ae=ice(e,X,q,U,j);if(X==="soft-hyphen"){p&&(k=q+1,g=0,v=q+1,b=h+l,C=h+l,I=X),q++;continue}if(!p){ae>d&&i[q]!==null?z(q,0):N(q,j),R(X,ie,q,j,U,te),q++;continue}if(h+ae>d){const re=h+g3(e,X,q,U),xe=h+v3(e,X,q,U,j);if(I==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){$(v,0,C);continue}if(ie&&re<=d){_(q,te),$(q+1,0,xe),q++;continue}if(v>=0&&b<=d){if(k>v||k===v&&g>0){$();continue}const pe=v;$(pe,0,C),q=pe;continue}if(ae>d&&i[q]!==null){$(),z(q,0),q++;continue}$();continue}_(q,te),R(X,ie,q,j,U,te),q++}if(p){const X=v===O.consumedEndSegmentIndex?C:h;$(O.consumedEndSegmentIndex,0,X)}}return f}let bv=null;function Y2(){return bv===null&&(bv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),bv}function fce(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function hce(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=Zy(d),l=z1.has(d)}function u(d,f){s.push(d),i=i||f;const h=Zy(d);d.length===1&&Pa.has(d)?r=r||h:r=h,l=!1}for(const d of Y2().segment(e)){const f=d.segment,h=er(f);if(s.length===0){c(f,d.index,h);continue}if(l||q2.has(f)||Pa.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function pce(e,t,n){if(t.length<=1)return t;const s=[];let o=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;s.push({text:e.slice(u,d),start:u})}function l(a){if(!(o<0)){if(i)o+1===a?s.push(t[o]):r(o,a);else for(let c=o;c<a;c++)s.push(t[c]);o=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];o>=0&&!EE(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||er(c.text)}return l(t.length),s}function y3(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const s=Y2();for(const o of s.segment(e))n++;return n}function mce(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function gce(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of Y2().segment(e))n++,mce(s.segment)&&t.push(n);return t.length===0?null:t}function vce(e,t,n){return t>1?e+(t-1)*n:e}function yce(e,t,n,s,o){const i=j1(),{cache:r,emojiCorrection:l}=ece(t,Yae(e.normalized)),a=wa("-",yl("-",r),l)+(o===0?0:o*2),u=wa(" ",yl(" ",r),l)*8,d=o!==0;if(e.len===0)return fce();const f=[],h=[],p=[],m=[];let y=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],b=[],C=n?[]:null,I=Array.from({length:e.len});function T(F,_,R,z,W,L,O,q,X){W!=="text"&&W!=="space"&&W!=="zero-width-break"&&(y=!1),f.push(_),h.push(R),p.push(z),m.push(W),k?.push(L),g.push(O),v.push(q),d&&b.push(X),C!==null&&C.push(F)}function M(F,_,R,z,W){const L=yl(F,r),O=d?y3(F,_):0,q=vce(wa(F,L,l),O,o),X=_==="space"||_==="preserved-space"||_==="zero-width-break"?0:q,ie=X===0?0:X+(O>0?o:0),U=_==="space"||_==="zero-width-break"?0:q;if(W&&z&&F.length>1){let j="sum-graphemes";o!==0?j="segment-prefixes":Fm(F)?j="pair-context":i.preferPrefixWidthsForBreakableRuns&&(j="segment-prefixes");const te=Jae(F,L,r,l,j),ae=te===null||s==="keep-all"?null:gce(F);T(F,q,ie,U,_,R,te,ae,O);return}T(F,q,ie,U,_,R,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const _=e.texts[F],R=e.isWordLike[F],z=e.kinds[F],W=e.starts[F];if(z==="soft-hyphen"){T(_,0,a,a,z,W,null,null,0);continue}if(z==="hard-break"){T(_,0,0,0,z,W,null,null,0);continue}if(z==="tab"){T(_,0,0,0,z,W,null,null,d?y3(_,z):0);continue}const L=yl(_,r);if(z==="text"&&L.containsCJK){const O=hce(_,i),q=s==="keep-all"?pce(_,O,i.breakKeepAllAfterPunctuation):O;for(let X=0;X<q.length;X++){const ie=q[X];M(ie.text,"text",W+ie.start,R,s==="keep-all"||!er(ie.text))}continue}M(_,z,W,R,!0)}const $=kce(e.chunks,I,f.length),N=k===null?null:zle(e.normalized,k);return C!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$,segments:C}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$}}function kce(e,t,n){const s=[];for(let o=0;o<e.length;o++){const i=e[o],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;s.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return s}function bce(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=zae(e,j1(),s?.whiteSpace,o);return yce(r,t,n,o,i)}function xce(e,t,n){return bce(e,t,!0,n)}function wce(e){let t=0;return dce(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const _ce={key:0,class:"slash-menu",role:"listbox"},Sce=["aria-selected","onMouseenter","onMousedown"],Cce={class:"slash-name"},Ace={class:"slash-desc"},Mce=Xe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=se([]);return Je(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),E("div",_ce,[(x(!0),E(De,null,rt(e.items,(a,c)=>(x(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:He(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Mt(u=>o("select",a),["prevent"])},[S("span",Cce,B(a.name),1),S("span",Ace,B(a.isSkill?a.desc:A(n)(a.desc)),1)],42,Sce))),128))])):ge("",!0)}}),Ece=dt(Mce,[["__scopeId","data-v-00a5ab11"]]),Tce={class:"mention-menu",role:"listbox"},Nce={key:0,class:"mention-state dim"},Ice={key:1,class:"mention-state dim"},Lce=["aria-selected","onMouseenter","onMousedown"],$ce=["innerHTML"],Fce={class:"mention-name"},Oce={class:"mention-path"},Rce=Xe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=Ec("folder","sm"),r=Ec("code","sm"),l=Ec("file-text","sm"),a=Ec("image","sm"),c=Ec("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 y=p.name||m.split("/").pop()||m,k=y.lastIndexOf("."),g=k>0?y.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(x(),E("div",Tce,[n.loading?(x(),E("div",Nce,B(A(o)("mention.searching")),1)):n.items.length===0?(x(),E("div",Ice,B(A(o)("mention.noMatch")),1)):(x(!0),E(De,{key:2},rt(n.items,(y,k)=>(x(),E("div",{key:y.path,class:He(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>s("hover",k),onMousedown:Mt(g=>s("select",y),["prevent"])},[S("span",{class:"mention-icon",innerHTML:h(y),"aria-hidden":"true"},null,8,$ce),S("span",Fce,B(y.name),1),S("span",Oce,B(y.path),1)],42,Lce))),128))]))}}),Bce=dt(Rce,[["__scopeId","data-v-63291ac0"]]),FE=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function Dce(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Rm="skill:";function Pce(e){return e.startsWith(Rm)?e.slice(Rm.length):e}function OE(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Rm}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...FE,...t]}function Hce(e,t=FE){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 V1(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 RE(e){return e?.supportEfforts??[]}function Wce(e){return e[Math.floor(e.length/2)]}function gf(e){if(V1(e)==="unsupported")return"off";const t=RE(e);return t.length>0?e?.defaultEffort??Wce(t):"on"}function K1(e){const t=RE(e),n=V1(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Qy(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function zce(e){return e!=="off"}function Uce(e,t){return K1(e).includes(t)}function Z2(e,t){return t==="off"?"off":t==="on"?gf(e):t}function Bm(e,t){return t??gf(e)}function qce(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function jce(e,t,n){return!n||e===void 0?t:gf(e)}const Dm=100;function Vce(e){const t=g1(Pt.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>Dm?n.slice(-Dm):n,o={[e]:s};return Af(Pt.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function Kce(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=se(Vce(o())),r=D(()=>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 b=i.value[g]??[];if(b.at(-1)===v)return;const C=[...b,v],I=C.length>Dm?C.slice(-Dm):C;i.value={...i.value,[g]:I},Af(Pt.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,yt(()=>{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 y(){return r.value.length>0}return Je(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:y}}function Gce(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=se(!1),c=se([]),u=se(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=Hce(h,OE(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} `,yt(()=>{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 Yce(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=se(!1),r=se([]),l=se(0),a=se(!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 y=h.slice(m,p);return y.startsWith("@")?{token:y.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,yt(()=>{const y=n.value;if(!y)return;const k=p.start+h.path.length;y.setSelectionRange(k,k),y.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Zce(e){const{sessionId:t}=e;function n(c){return ss(u_(c))??""}function s(c,u){const d=u_(c);u?ps(d,u):Oa(d)}const o=se(n(t())),i=se(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Je(o,c=>{yt(r),s(t(),c)}),Je(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),yt(r))});function l(c){o.value=c,yt(()=>{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 Xce(e){const{uploadImage:t,sessionId:n}=e,s=se({}),o=D(()=>s.value[n()??""]??[]),i=se(null),r=se(null),l=se(!1);let a=0;function c(){return`att_${++a}`}function u(O,q){s.value={...s.value,[O]:q}}function d(O){if(O.previewUrl!==void 0)try{URL.revokeObjectURL(O.previewUrl)}catch{}}function f(O){return O.startsWith("image/")?"image":O.startsWith("video/")?"video":"file"}async function h(O){const q=t();if(!q)return;const X=n()??"";if(O.length!==0)for(const ie of O){const U=f(ie.type),j=c(),te=U==="file"?void 0:URL.createObjectURL(ie),ae={localId:j,name:ie.name,kind:U,previewUrl:te,mediaType:ie.type||"application/octet-stream",size:ie.size,uploading:!0};u(X,[...s.value[X]??[],ae]),q(ie,ie.name).then(oe=>{const re=s.value[X]??[];u(X,re.map(xe=>xe.localId===j?{...xe,uploading:!1,fileId:oe?.fileId,mediaType:oe?.mediaType??xe.mediaType,error:oe===null}:xe))}).catch(()=>{const oe=s.value[X]??[];u(X,oe.map(re=>re.localId===j?{...re,uploading:!1,error:!0}:re))})}}function p(O){const q=n()??"",X=s.value[q]??[],ie=X.find(U=>U.localId===O);i.value?.localId===O&&(i.value=null),ie&&d(ie),u(q,X.filter(U=>U.localId!==O))}function m(O){i.value=O}function y(){i.value=null}function k(){r.value?.click()}function g(O){const q=O.target,X=Array.from(q.files??[]);h(X),q.value=""}function v(O){if(!t())return;const q=O.clipboardData;if(!q)return;const X=[],ie=new Set,U=(j,te)=>{const ae=`${j.size}:${j.type}:${te}`;if(ie.has(ae))return;ie.add(ae);const oe=j.type.split("/")[1]??"png",re=te.includes(".")?te:`paste-${Date.now()}.${oe}`;X.push(j instanceof File?j:new File([j],re,{type:j.type}))};for(const j of Array.from(q.items))if(j.kind==="file"){const te=j.getAsFile();te&&U(te,te.name||`paste-${Date.now()}.${j.type.split("/")[1]??"png"}`)}for(const j of Array.from(q.files))U(j,j.name);X.length!==0&&(O.preventDefault(),h(X))}let b=0;function C(O){!t()||!Array.from(O.dataTransfer?.items??[]).some(X=>X.kind==="file")||(O.preventDefault(),O.stopPropagation(),l.value=!0)}function I(){l.value=!1}function T(O){if(b=0,l.value=!1,!t())return;O.preventDefault(),O.stopPropagation();const q=Array.from(O.dataTransfer?.files??[]);h(q)}function M(O){return Array.from(O.dataTransfer?.items??[]).some(q=>q.kind==="file")}function $(O){!t()||!M(O)||(O.preventDefault(),b+=1,l.value=!0)}function N(O){!t()||!M(O)||O.preventDefault()}function F(O){!t()||!M(O)||(b=Math.max(0,b-1),b===0&&(l.value=!1))}function _(O){if(b=0,l.value=!1,!t())return;O.preventDefault();const q=Array.from(O.dataTransfer?.files??[]);h(q)}function R(){const O=n()??"";for(const q of s.value[O]??[])d(q);u(O,[])}function z(O,q,X){const ie=s.value[O]??[];ie.some(U=>U.localId===q)&&u(O,ie.map(U=>U.localId===q?{...U,...X}:U))}function W(O){return fetch(O).then(q=>{if(!q.ok)throw new Error(`fetch failed: ${q.status}`);return q.blob()})}function L(O){const q=n()??"";for(const X of s.value[q]??[])d(X);u(q,[]);for(const X of O){const ie=c(),U=/^data:/i.test(X.url),j=/^blob:/i.test(X.url),te=X.name??X.kind;if(X.fileId){const ae={localId:ie,name:te,kind:X.kind,previewUrl:X.kind==="file"?void 0:X.url,uploading:!1,fileId:X.fileId};u(q,[...s.value[q]??[],ae]),X.kind!=="file"&&!U&&!j&&mt().getFileBlob(X.fileId).then(oe=>{const re=URL.createObjectURL(oe);if(!(s.value[q]??[]).some(pe=>pe.localId===ie)){URL.revokeObjectURL(re);return}z(q,ie,{previewUrl:re})}).catch(()=>{})}else{if(!X.url)continue;const ae=t();if(!ae)continue;const oe={localId:ie,name:te,kind:X.kind,previewUrl:X.url,uploading:!0};u(q,[...s.value[q]??[],oe]),W(X.url).then(re=>{const xe=te.includes(".")?te:`${te}.${re.type.split("/")[1]??"bin"}`;return ae(re,xe)}).then(re=>{if(re===null){const xe=s.value[q]??[];u(q,xe.filter(pe=>pe.localId!==ie));return}z(q,ie,{uploading:!1,fileId:re.fileId})}).catch(()=>{const re=s.value[q]??[];u(q,re.filter(xe=>xe.localId!==ie))})}}}return Je(n,()=>{i.value=null}),mn(()=>{document.addEventListener("paste",v),document.addEventListener("dragenter",$),document.addEventListener("dragover",N),document.addEventListener("dragleave",F),document.addEventListener("drop",_)}),Cn(()=>{document.removeEventListener("paste",v),document.removeEventListener("dragenter",$),document.removeEventListener("dragover",N),document.removeEventListener("dragleave",F),document.removeEventListener("drop",_);for(const O of Object.values(s.value))for(const q of O)d(q);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:y,openFilePicker:k,handleFileInputChange:g,handleDragOver:C,handleDragLeave:I,handleDrop:T,clearAfterSubmit:R,loadAttachments:L}}const Qce={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Jce=["stroke-dasharray","stroke-dashoffset"],xv=7,eue=Xe({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*xv;return(s,o)=>(x(),E("svg",Qce,[S("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:xv,fill:"none","stroke-width":"2.5"}),S("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:xv,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Jce)]))}}),tue=dt(eue,[["__scopeId","data-v-56ca5e24"]]),nue={key:0,class:"att-strip"},sue={class:"att-lightbox-card"},oue=["src"],iue=["src","alt"],rue={class:"att-lightbox-name"},lue={class:"composer-card"},aue={class:"cin-wrap"},cue={class:"input-row"},uue=["placeholder","disabled"],due=["aria-label"],fue={class:"toolbar-left"},hue=["onKeydown"],pue=["onClick"],mue={class:"pd-check"},gue={class:"pd-info"},vue={class:"pd-desc"},yue={class:"mode-label"},kue={key:0,class:"mode-tag"},bue={key:1,class:"mode-tag"},xue={class:"mode-row-icon"},wue={class:"mode-row-info"},_ue={class:"mode-row-name"},Sue={class:"mode-row-desc"},Cue={class:"mode-row-icon"},Aue={class:"mode-row-info"},Mue={class:"mode-row-name"},Eue={class:"mode-row-desc"},Tue={class:"toolbar-right"},Nue=["aria-label"],Iue=["onKeydown"],Lue={key:0,class:"think-suffix"},$ue=["aria-label"],Fue=["aria-label","disabled"],Oue={key:0,class:"md-section"},Rue=["onClick"],Bue={class:"md-check"},Due={class:"md-name"},Pue={class:"md-provider"},Hue={key:1,class:"md-divider"},Wue={key:2,class:"md-section"},zue=["onClick"],Uue={class:"md-check"},que={class:"md-name"},jue={key:3,class:"md-divider"},Vue={class:"md-name"},Kue={key:0,class:"md-note"},Gue=["aria-label"],Yue=["disabled","onClick"],Zue={class:"md-cache-note"},Xue={class:"md-name"},Que={class:"drop-card"},k3=36,Jue=Xe({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","openBtw","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=D(()=>s.starting?r("composer.starting"):s.running?r("composer.placeholderRunning"):r("composer.placeholder")),i=n,{t:r,locale:l}=Ot(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Zce({sessionId:()=>s.sessionId}),h=se(!1);function p(){h.value=!h.value,yt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,yt(u))}function y(Ue){if(typeof getComputedStyle>"u")return k3;const Ze=Number.parseFloat(getComputedStyle(Ue).minHeight);return Number.isFinite(Ze)&&Ze>0?Ze:k3}const k=se(!1);function g(){const Ue=c.value;k.value=!!Ue&&Ue.scrollHeight>y(Ue)}Je(a,()=>{yt(g)}),Je(()=>s.sessionId,()=>{h.value=!1});const v=Kce({text:a,textareaRef:c,autosize:u,sessionId:()=>s.sessionId}),{open:b,items:C,active:I,update:T,select:M}=Gce({text:a,textareaRef:c,autosize:u,skills:()=>s.skills,emitCommand:Ue=>i("command",Ue),historyPush:Ue=>v.push(Ue),clearDraft:f}),{open:$,items:N,active:F,loading:_,update:R,select:z}=Yce({text:a,textareaRef:c,autosize:u,searchFiles:()=>s.searchFiles});function W(){v.resetBrowsing(),T(),R()}const{attachments:L,previewAttachment:O,fileInputRef:q,isDragOver:X,removeAttachment:ie,openAttachmentPreview:U,closeAttachmentPreview:j,openFilePicker:te,handleFileInputChange:ae,handleDragOver:oe,handleDragLeave:re,handleDrop:xe,clearAfterSubmit:pe,loadAttachments:Ee}=Xce({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});mn(()=>{a.value&&yt(()=>{u(),g()})}),Cn(()=>{document.removeEventListener("mousedown",ct),K()});function ue(){c.value?.focus({preventScroll:!0})}function Y(Ue){Ee(Ue)}t({loadForEdit:d,loadAttachmentsForEdit:Y,focus:ue});function Q(Ue){return{fileId:Ue.fileId,kind:Ue.kind,name:Ue.name,mediaType:Ue.mediaType,size:Ue.size}}function P(Ue){if(Ue.kind==="file"){Ue.fileId!==void 0&&AE(Ue.fileId,Ue.name,Ue.mediaType);return}U(Ue)}function G(){const Ue=a.value.trim();if(L.value.some(Wt=>Wt.uploading))return;const Ze=L.value.filter(Wt=>!Wt.uploading&&!Wt.error&&Wt.fileId);if(!Ue&&Ze.length===0)return;if(v.push(Ue),Ue){const Wt=Dce(Ue),zs=Wt?OE(s.skills).some(vo=>vo.name===Wt.cmd||vo.name===`/${Rm}${Wt.cmd.slice(1)}`):!1;if(Wt&&zs){a.value="",f(),b.value=!1,m(),i("command",Wt.arg?`${Wt.cmd} ${Wt.arg}`:Wt.cmd);return}}const ut={text:Ue,attachments:Ze.map(Wt=>Q(Wt))};O.value=null,pe(),a.value="",f(),b.value=!1,$.value=!1,m(),i("submit",ut)}function ye(){if(!s.running||L.value.some(Wt=>Wt.uploading))return;const Ue=a.value.trim(),Ze=L.value.filter(Wt=>!Wt.uploading&&!Wt.error&&Wt.fileId);if(!Ue&&Ze.length===0&&s.queued.length===0)return;const ut={text:Ue,attachments:Ze.map(Wt=>Q(Wt))};pe(),v.push(Ue),a.value="",f(),b.value=!1,$.value=!1,m(),i("steer",ut)}let he=!1,fe=null;function K(){fe!==null&&(clearTimeout(fe),fe=null)}function ne(){K(),he=!0}function me(){K(),fe=setTimeout(()=>{fe=null,he=!1},0)}function we(Ue){return he||Ue.isComposing||Ue.keyCode===229}function Te(Ue){if(!we(Ue)){if(Ue.key==="Escape"){if(_e.value){Ue.preventDefault(),at();return}if(Ke.value){Ue.preventDefault(),Et();return}}if(b.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),I.value=(I.value+1)%C.value.length;return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),I.value=(I.value-1+C.value.length)%C.value.length;return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Ze=C.value[I.value];Ze&&M(Ze);return}if(Ue.key==="Escape"){Ue.preventDefault(),b.value=!1;return}}if($.value&&!_.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Ze=N.value[F.value];Ze&&z(Ze);return}if(Ue.key==="Escape"){Ue.preventDefault(),$.value=!1;return}}if(Ue.key==="s"&&(Ue.ctrlKey||Ue.metaKey)&&!Ue.shiftKey&&!Ue.altKey){s.running&&(Ue.preventDefault(),ye());return}if(!h.value&&!b.value&&!$.value&&!Ue.shiftKey&&!Ue.altKey&&!Ue.metaKey&&!Ue.ctrlKey){const Ze=v.isBrowsing();if(Ue.key==="ArrowUp"&&v.hasHistory()&&(Ze||v.caretAtTextStart())){Ue.preventDefault(),v.recallOlder();return}if(Ue.key==="ArrowDown"&&Ze){Ue.preventDefault(),v.recallNewer();return}}if(Ue.key==="Enter"&&!Ue.shiftKey){if(h.value&&!(Ue.metaKey||Ue.ctrlKey))return;Ue.preventDefault(),G()}}}const Pe=D(()=>r("composer.send")),be=D(()=>!!s.uploadImage),_e=se(!1),Ke=se(!1),Qe=se(null);function ot(){_e.value=!_e.value,_e.value?(Ke.value=!1,bs(),document.addEventListener("click",Tt,!0)):document.removeEventListener("click",Tt,!0)}function at(){_e.value=!1,Ke.value||document.removeEventListener("click",Tt,!0)}function ht(){Ke.value=!Ke.value,Ke.value?(_e.value=!1,bs(),document.addEventListener("click",Tt,!0)):document.removeEventListener("click",Tt,!0)}function Et(){Ke.value=!1,_e.value||document.removeEventListener("click",Tt,!0)}function Tt(Ue){Qe.value&&!Qe.value.contains(Ue.target)&&(at(),Et())}Cn(()=>{document.removeEventListener("click",Tt,!0)});const $t=D(()=>{const Ue=s.status?.ctxMax??0;return Ue<=0?0:Math.min(100,Math.max(0,Math.ceil((s.status?.ctxUsed??0)/Ue*100)))}),rn=D(()=>{const Ue=Br(s.status?.ctxUsed??0),Ze=Br(s.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ue,max:Ze,pct:$t.value})}),vn=D(()=>$t.value>=80),Ht=D(()=>s.models?.find(Ue=>Ue.id===s.status?.modelId)),Zt=D(()=>V1(Ht.value)),tn=D(()=>K1(Ht.value)),Gt=D(()=>Bm(Ht.value,s.thinking)),An=D(()=>tn.value.includes(Gt.value)?Gt.value:""),Ye=D(()=>zce(Gt.value)),qe=D(()=>Zt.value==="unsupported"||tn.value.length<=1),It=D(()=>{if(!Ye.value)return"";const Ue=(Ht.value?.supportEfforts?.length??0)>0,Ze=Gt.value;return Ue&&Ze!=="on"?r("composer.thinkingSuffixEffort",{level:Ze}):r("composer.thinkingSuffix")});function Ut(Ue){qe.value||i("setThinking",Z2(Ht.value,Ue))}function Vt(Ue){return Ue==="on"?r("status.thinkingOn"):Ue==="off"?r("status.thinkingOff"):Qy(Ue)}const kn=D(()=>s.planMode===!0),ft=D(()=>s.swarmMode===!0),cn=se(!1),un=se(null),Bn=se(null),Mn=se({}),Ns=D(()=>kn.value||ft.value);function bs(){cn.value=!1,document.removeEventListener("mousedown",ct)}function ct(Ue){const Ze=Ue.target;un.value?.contains(Ze)||Bn.value?.contains(Ze)||bs()}function sr(){if(cn.value){bs();return}at(),Et();const Ue=un.value?.getBoundingClientRect();Ue&&(Mn.value={left:`${Math.round(Ue.left)}px`,bottom:`${Math.round(window.innerHeight-Ue.top+8)}px`}),cn.value=!0,setTimeout(()=>document.addEventListener("mousedown",ct),0)}const xs=[{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"}],bn=["status.planDesc","status.swarmDesc"],gs=se(null),ws=se(""),Ws=se("");function Zs(Ue){const Ze={};return Ue&&(Ze["--composer-menu-desc-width"]=Ue),Ze}const Gn=D(()=>Zs(ws.value)),mo=D(()=>Zs(Ws.value)),Xs=D(()=>({...Mn.value,...mo.value}));let _s=null;function Fo(Ue){const Ze=Number.parseFloat(Ue);return Number.isFinite(Ze)?Ze:0}function Jo(Ue){return`${Ue.fontStyle||"normal"} ${Ue.fontWeight||"400"} ${Ue.fontSize} ${Ue.fontFamily}`}function Qs(Ue){return Ue.letterSpacing==="normal"?0:Fo(Ue.letterSpacing)}function os(Ue,Ze){if(!Ue)return 0;const ut=xce(Ue,Jo(Ze),{letterSpacing:Qs(Ze)});return wce(ut)}function Fi(){const Ue=gs.value?.querySelector(".pd-desc");if(!Ue)return;const Ze=getComputedStyle(Ue),ut=Math.max(0,...xs.map(zs=>os(r(zs.descKey),Ze))),Wt=Math.max(0,...bn.map(zs=>os(r(zs),Ze)));ws.value=ut>0?`${Math.ceil(ut)}px`:"",Ws.value=Wt>0?`${Math.ceil(Wt)}px`:""}function ei(){typeof window>"u"||(_s!==null&&window.cancelAnimationFrame(_s),yt(()=>{_s=window.requestAnimationFrame(()=>{_s=null,Fi()})}))}Je(l,ei,{immediate:!0}),mn(()=>{ei(),document.fonts?.ready.then(ei)}),Cn(()=>{_s!==null&&(window.cancelAnimationFrame(_s),_s=null)});function Xt(Ue){i("setPermission",Ue),Et()}const Is=D(()=>xs.find(Ue=>Ue.mode===s.status?.permission)),Yn=D(()=>Is.value?r(Is.value.labelKey):""),Oo=D(()=>Ht.value?.provider??""),Ro=D(()=>!Oo.value||!s.models?.length?[]:s.models.filter(Ue=>Ue.provider===Oo.value)),Bo=D(()=>new Set(s.starredIds??[]));function ti(Ue){return Bo.value.has(Ue)}const Do=D(()=>s.models?.length?s.models.filter(Ue=>ti(Ue.id)&&Ue.provider!==Oo.value):[]);function go(Ue){i("selectModel",Ue),at()}return(Ue,Ze)=>(x(),E("div",{class:He(["composer",{"drag-over":A(X),expanded:h.value}]),onDragover:Ze[14]||(Ze[14]=(...ut)=>A(oe)&&A(oe)(...ut)),onDragleave:Ze[15]||(Ze[15]=(...ut)=>A(re)&&A(re)(...ut)),onDrop:Ze[16]||(Ze[16]=(...ut)=>A(xe)&&A(xe)(...ut))},[A(L).length>0?(x(),E("div",nue,[(x(!0),E(De,null,rt(A(L),ut=>(x(),Ae(SE,{key:ut.localId,kind:ut.kind,name:ut.name,url:ut.previewUrl,"file-id":ut.fileId,"media-type":ut.mediaType,size:ut.size,uploading:ut.uploading,error:ut.error,removable:"","remove-label":A(r)("composer.removeNamed",{name:ut.name}),onActivate:Wt=>P(ut),onRemove:Wt=>A(ie)(ut.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ge("",!0),A(O)?(x(),E("div",{key:1,class:"att-lightbox",onClick:Ze[1]||(Ze[1]=Mt((...ut)=>A(j)&&A(j)(...ut),["self"]))},[S("div",sue,[ve(en,{text:A(r)("model.close")},{default:Fe(()=>[S("button",{type:"button",class:"att-lightbox-close",onClick:Ze[0]||(Ze[0]=(...ut)=>A(j)&&A(j)(...ut))},"✕")]),_:1},8,["text"]),A(O).kind==="video"?(x(),E("video",{key:0,class:"att-lightbox-media",src:A(O).previewUrl,controls:"",playsinline:""},null,8,oue)):(x(),E("img",{key:1,class:"att-lightbox-media",src:A(O).previewUrl,alt:A(O).name},null,8,iue)),S("div",rue,B(A(O).name),1)])])):ge("",!0),S("div",lue,[S("div",aue,[A(b)?(x(),Ae(Ece,{key:0,items:A(C),"active-index":A(I),onSelect:A(M),onHover:Ze[2]||(Ze[2]=ut=>I.value=ut)},null,8,["items","active-index","onSelect"])):ge("",!0),A($)?(x(),Ae(Bce,{key:1,items:A(N),"active-index":A(F),loading:A(_),onSelect:A(z),onHover:Ze[3]||(Ze[3]=ut=>F.value=ut)},null,8,["items","active-index","loading","onSelect"])):ge("",!0),S("div",cue,[Fn(S("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Ze[4]||(Ze[4]=ut=>ns(a)?a.value=ut:null),class:"ph",placeholder:o.value,disabled:e.starting,rows:"1",onKeydown:Te,onCompositionstart:ne,onCompositionend:me,onInput:W},null,40,uue),[[po,A(a)]]),h.value||k.value?(x(),E("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?A(r)("composer.collapseTitle"):A(r)("composer.expandTitle"),onClick:p},[h.value?(x(),Ae(et,{key:0,name:"collapse",size:"sm"})):(x(),Ae(et,{key:1,name:"expand",size:"sm"}))],8,due)):ge("",!0)])]),be.value?(x(),E("input",{key:0,ref_key:"fileInputRef",ref:q,type:"file",multiple:"",class:"file-input-hidden",onChange:Ze[5]||(Ze[5]=(...ut)=>A(ae)&&A(ae)(...ut))},null,544)):ge("",!0),S("div",{ref_key:"toolbarRef",ref:Qe,class:"toolbar"},[S("div",{ref_key:"menuMeasureRef",ref:gs,class:"menu-measure","aria-hidden":"true"},[...Ze[17]||(Ze[17]=[S("span",{class:"pd-desc"},null,-1)])],512),S("div",fue,[be.value?(x(),Ae(Wn,{key:0,size:"md",label:A(r)("composer.attachFile"),onClick:A(te)},{default:Fe(()=>[ve(et,{name:"attachment"})]),_:1},8,["label","onClick"])):ge("",!0),e.status?(x(),E("span",{key:1,class:He(["perm-pill",["perm-"+e.status.permission,{open:Ke.value}]]),role:"button",tabindex:"0",onClick:Mt(ht,["stop"]),onKeydown:[Yi(ht,["enter"]),Yi(Mt(ht,["prevent"]),["space"])]},B(Yn.value),43,hue)):ge("",!0),Ke.value&&e.status?(x(),E("div",{key:2,class:"perm-dropdown",style:Jt(Gn.value),role:"menu",onClick:Ze[6]||(Ze[6]=Mt(()=>{},["stop"]))},[(x(),E(De,null,rt(xs,ut=>S("button",{key:ut.mode,class:He(["pd-row",{"is-current":ut.mode===e.status.permission}]),role:"menuitem",onClick:Wt=>Xt(ut.mode)},[S("span",mue,[ut.mode===e.status.permission?(x(),Ae(et,{key:0,name:"check",size:"sm"})):ge("",!0)]),S("span",gue,[S("span",{class:"pd-name",style:Jt({color:ut.color})},B(A(r)(ut.labelKey)),5),S("span",vue,B(A(r)(ut.descKey)),1)])],10,pue)),64))],4)):ge("",!0),e.status?(x(),E("div",{key:3,ref_key:"modesRef",ref:un,class:"modes"},[S("button",{type:"button",class:He(["mode-pill",{on:Ns.value,open:cn.value}]),onClick:Mt(sr,["stop"])},[S("span",yue,B(A(r)("status.modesLabel")),1),kn.value?(x(),E("span",kue,B(A(r)("status.planLabel")),1)):ge("",!0),ft.value?(x(),E("span",bue,B(A(r)("status.swarmLabel")),1)):ge("",!0)],2),cn.value?(x(),E("div",{key:0,ref_key:"modesMenuRef",ref:Bn,class:"modes-menu",style:Jt(Xs.value),role:"menu"},[S("button",{type:"button",class:He(["mode-row",{on:kn.value}]),role:"menuitem",onClick:Ze[7]||(Ze[7]=ut=>i("togglePlan"))},[S("span",xue,[ve(et,{name:"file-edit",size:"sm"})]),S("span",wue,[S("span",_ue,B(A(r)("status.planLabel")),1),S("span",Sue,B(A(r)("status.planDesc")),1)]),S("span",{class:He(["mode-switch",{on:kn.value}])},[...Ze[18]||(Ze[18]=[S("span",{class:"mode-knob"},null,-1)])],2)],2),S("button",{type:"button",class:He(["mode-row",{on:ft.value}]),role:"menuitem",onClick:Ze[8]||(Ze[8]=ut=>i("toggleSwarm"))},[S("span",Cue,[ve(et,{name:"sparkles",size:"sm"})]),S("span",Aue,[S("span",Mue,B(A(r)("status.swarmLabel")),1),S("span",Eue,B(A(r)("status.swarmDesc")),1)]),S("span",{class:He(["mode-switch",{on:ft.value}])},[...Ze[19]||(Ze[19]=[S("span",{class:"mode-knob"},null,-1)])],2)],2)],4)):ge("",!0)],512)):ge("",!0)]),S("div",Tue,[vn.value?(x(),E("button",{key:0,class:"compact-chip",onClick:Ze[9]||(Ze[9]=Mt(ut=>i("compact"),["stop"]))},"/compact")):ge("",!0),ve(en,{text:rn.value},{default:Fe(()=>[e.status&&!e.hideContext?(x(),E("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":rn.value},[ve(tue,{pct:$t.value},null,8,["pct"])],8,Nue)):ge("",!0)]),_:1},8,["text"]),e.status?(x(),E("span",{key:1,class:He(["model-pill",{open:_e.value}]),role:"button",tabindex:"0",onClick:Mt(ot,["stop"]),onKeydown:[Yi(ot,["enter"]),Yi(Mt(ot,["prevent"]),["space"])]},[S("b",null,B(e.status.model),1),It.value?(x(),E("span",Lue,B(It.value),1)):ge("",!0),ve(et,{class:"cv",name:"chevron-down",size:"sm"})],42,Iue)):ge("",!0),e.running?(x(),Ae(en,{key:2,text:A(r)("composer.interruptTitle")},{default:Fe(()=>[S("button",{class:"stop","aria-label":A(r)("composer.interrupt"),onClick:Ze[10]||(Ze[10]=ut=>i("interrupt"))},[ve(et,{name:"stop",size:"sm"})],8,$ue)]),_:1},8,["text"])):ge("",!0),S("button",{class:He(["send",{"is-starting":e.starting}]),"aria-label":Pe.value,disabled:e.starting,onClick:Ze[11]||(Ze[11]=ut=>G())},[e.starting?(x(),Ae($o,{key:0,size:"sm"})):(x(),Ae(et,{key:1,name:"send",size:"sm"}))],10,Fue)]),_e.value&&e.status?(x(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:Ze[13]||(Ze[13]=Mt(()=>{},["stop"]))},[Do.value.length>0?(x(),E("div",Oue,B(A(r)("status.starredModels")),1)):ge("",!0),(x(!0),E(De,null,rt(Do.value,ut=>(x(),E("button",{key:ut.id,class:He(["md-row",{"is-current":ut.id===e.status.modelId}]),role:"menuitem",onClick:Wt=>go(ut.id)},[S("span",Bue,[ut.id===e.status.modelId?(x(),Ae(et,{key:0,name:"check",size:"sm"})):ge("",!0)]),S("span",Due,B(ut.displayName??ut.model),1),S("span",Pue,B(ut.provider),1),ve(et,{class:"md-star",name:"star",size:"sm"})],10,Rue))),128)),Do.value.length>0?(x(),E("div",Hue)):ge("",!0),Ro.value.length>0?(x(),E("div",Wue,B(Oo.value),1)):ge("",!0),(x(!0),E(De,null,rt(Ro.value,ut=>(x(),E("button",{key:ut.id,class:He(["md-row",{"is-current":ut.id===e.status.modelId}]),role:"menuitem",onClick:Wt=>go(ut.id)},[S("span",Uue,[ut.id===e.status.modelId?(x(),Ae(et,{key:0,name:"check",size:"sm"})):ge("",!0)]),S("span",que,B(ut.displayName??ut.model),1),ti(ut.id)?(x(),Ae(et,{key:0,class:"md-star",name:"star",size:"sm"})):ge("",!0)],10,zue))),128)),Ro.value.length>0?(x(),E("div",jue)):ge("",!0),S("div",{class:He(["md-thinking",{"is-readonly":qe.value}])},[S("span",Vue,B(A(r)("status.thinkingLabel")),1),Zt.value==="unsupported"?(x(),E("span",Kue,B(A(r)("status.modeNotSupported")),1)):(x(),E("div",{key:1,class:"effort-segments",role:"group","aria-label":A(r)("status.thinkingLabel")},[(x(!0),E(De,null,rt(tn.value,ut=>(x(),E("button",{key:ut,type:"button",class:He(["effort-seg",{"is-active":ut===An.value}]),disabled:qe.value,onClick:Wt=>Ut(ut)},B(Vt(ut)),11,Yue))),128))],8,Gue))],2),Ze[20]||(Ze[20]=S("div",{class:"md-divider"},null,-1)),S("div",Zue,B(A(r)("status.cacheNote")),1),Ze[21]||(Ze[21]=S("div",{class:"md-divider"},null,-1)),S("button",{class:"md-row md-row-more",role:"menuitem",onClick:Ze[12]||(Ze[12]=ut=>{at(),i("pickModel")})},[S("span",Xue,B(A(r)("status.moreModels")),1)])])):ge("",!0)],512)]),S("div",{class:He(["drop-overlay",{show:A(X)}]),"aria-hidden":"true"},[S("div",Que,[ve(et,{name:"file-plus",size:"lg"}),S("span",null,B(A(r)("composer.dropToAttach")),1)])],2)],34))}}),BE=dt(Jue,[["__scopeId","data-v-6885c2e2"]]),ede={key:0,class:"ui-card__head"},tde={class:"ui-card__body"},nde={key:1,class:"ui-card__foot"},sde=Xe({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),E("div",{class:He(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),E("div",ede,[Rn(t.$slots,"head",{},void 0,!0)])):ge("",!0),S("div",tde,[Rn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),E("div",nde,[Rn(t.$slots,"foot",{},void 0,!0)])):ge("",!0)],2))}}),DE=dt(sde,[["__scopeId","data-v-afa05a68"]]),ode=["type","disabled"],ide={class:"ui-button__content"},rde=Xe({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),E("button",{class:He(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),Ae($o,{key:0,size:"sm",class:"ui-button__spinner"})):ge("",!0),S("span",ide,[Rn(t.$slots,"default",{},void 0,!0)])],10,ode))}}),Kt=dt(rde,[["__scopeId","data-v-432a0181"]]),lde={class:"qh"},ade={class:"qtitle"},cde={key:0,class:"qstep"},ude={key:1,class:"qmin-peek"},dde={class:"qbody"},fde=["aria-label"],hde=["aria-selected","aria-label","onClick"],pde={class:"qstep-num"},mde={key:1,class:"qheader-chip"},gde={class:"qtext"},vde={class:"qopts"},yde=["onClick"],kde={class:"qopt-key"},bde={class:"qopt-glyph"},xde={key:0,class:"chk"},wde={key:1,class:"rad"},_de={class:"qopt-text"},Sde={class:"qopt-label"},Cde={key:0,class:"qopt-desc"},Ade={class:"qopt-glyph"},Mde={key:0,class:"chk"},Ede={key:1,class:"rad"},Tde={class:"qopt-label"},Nde=["placeholder"],Ide={class:"qfoot"},Lde=Xe({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Ot(),o=t,i=se(0),r=se(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(L){L>=0&&L<a.value&&(i.value=L)}function f(L){const O=p.value[L];return O?O.kind==="multi"?O.optionIds.length>0:O.kind==="multiWithOther"?O.optionIds.length>0||O.otherText.trim().length>0:O.kind==="other"?O.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=se({});function m(L){return L.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${L.label} ${L.description??""}`.toLowerCase())}function y(){const L={...p.value};let O=!1;for(const q of n.question.questions){if(L[q.id])continue;const X=q.options.filter(m);X.length!==0&&(L[q.id]=q.multiSelect?{kind:"multi",optionIds:X.map(ie=>ie.id)}:{kind:"single",optionId:X[0].id},O=!0)}O&&(p.value=L)}Je(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Je(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),y()},{immediate:!0,deep:!0});function k(L,O){const q=p.value[L];if(q&&q.kind==="single"&&q.optionId===O){const X={...p.value};delete X[L],p.value=X}else p.value={...p.value,[L]:{kind:"single",optionId:O}}}function g(L,O){const q=p.value[L],X=q&&(q.kind==="multi"||q.kind==="multiWithOther")?q.kind==="multi"?[...q.optionIds]:[...q.optionIds]:[],ie=X.indexOf(O);ie>=0?X.splice(ie,1):X.push(O);const U=p.value[L],j=U&&U.kind==="multiWithOther"?U.otherText:"";j?p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:X,otherText:j}}:p.value={...p.value,[L]:{kind:"multi",optionIds:X}}}const v=se({}),b=se(null);function C(L){const O=n.question.questions.find(X=>X.id===L),q=v.value[L]??"";if(O.multiSelect){const X=p.value[L],ie=X&&(X.kind==="multi"||X.kind==="multiWithOther")?X.kind==="multi"?[...X.optionIds]:[...X.optionIds]:[];p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:ie,otherText:q}}}else p.value={...p.value,[L]:{kind:"other",text:q}}}function I(L){C(L),yt(()=>b.value?.focus())}function T(L,O){const q=p.value[L];return q?q.kind==="single"?q.optionId===O:q.kind==="multi"||q.kind==="multiWithOther"?q.optionIds.includes(O):!1:!1}function M(L){const O=p.value[L];return!!(O&&(O.kind==="other"||O.kind==="multiWithOther"))}function $(){return n.question.questions.every(L=>f(L.id))}const N=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),_=D(()=>!!n.busyKind);function R(){if(_.value||!$())return;const L={answers:p.value,method:"click"};o("answer",n.question.questionId,L)}function z(){_.value||o("dismiss",n.question.questionId)}function W(L){const O=(document.activeElement?.tagName??"").toLowerCase(),q=O==="input"||O==="textarea";if(_.value)return;if(L.key==="Enter"){if(L.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():$()&&R();return}if(q)return;if(L.key==="Escape"){L.preventDefault(),z();return}if(r.value)return;const X=parseInt(L.key,10);if(!isNaN(X)&&X>=1&&X<=9){L.preventDefault();const ie=l.value,U=X-1,j=ie.options[U];j&&(ie.multiSelect?g(ie.id,j.id):k(ie.id,j.id))}}return mn(()=>document.addEventListener("keydown",W)),Cn(()=>document.removeEventListener("keydown",W)),(L,O)=>(x(),Ae(DE,{class:He(["qcard",{minimized:r.value}])},$A({head:Fe(()=>[S("div",lde,[O[5]||(O[5]=S("span",{class:"qh-ic"},"?",-1)),S("span",ade,B(A(s)("question.title")),1),a.value>1&&!r.value?(x(),E("span",cde,B(A(s)("question.step",{current:i.value+1,total:a.value})),1)):ge("",!0),r.value?(x(),E("span",ude,B(l.value.question),1)):ge("",!0),ve(Wn,{class:"qmin",size:"sm",label:r.value?A(s)("question.expand"):A(s)("question.minimize"),onClick:O[0]||(O[0]=q=>r.value=!r.value)},{default:Fe(()=>[r.value?(x(),Ae(et,{key:0,name:"chevron-up",size:"md"})):(x(),Ae(et,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Fe(()=>[S("div",dde,[a.value>1?(x(),E("div",{key:0,class:"qsteps",role:"tablist","aria-label":A(s)("question.step",{current:i.value+1,total:a.value})},[(x(!0),E(De,null,rt(n.question.questions,(q,X)=>(x(),E("button",{key:q.id,type:"button",class:He(["qstep-dot",{active:X===i.value,answered:f(q.id)}]),"aria-selected":X===i.value,"aria-label":A(s)("question.step",{current:X+1,total:a.value}),onClick:ie=>d(X)},[S("span",pde,B(X+1),1)],10,hde))),128))],8,fde)):ge("",!0),l.value.header?(x(),E("div",mde,[ve(Ji,{variant:"neutral",size:"sm"},{default:Fe(()=>[tt(B(l.value.header),1)]),_:1})])):ge("",!0),S("div",gde,B(l.value.question),1),l.value.body?(x(),Ae(H1,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ge("",!0),S("div",vde,[(x(!0),E(De,null,rt(l.value.options,(q,X)=>(x(),E("label",{key:q.id,class:He(["qopt",{selected:T(l.value.id,q.id)}]),onClick:Mt(ie=>l.value.multiSelect?g(l.value.id,q.id):k(l.value.id,q.id),["prevent"])},[S("span",kde,B(X+1),1),S("span",bde,[l.value.multiSelect?(x(),E("span",xde,B(T(l.value.id,q.id)?"■":"□"),1)):(x(),E("span",wde,B(T(l.value.id,q.id)?"●":"○"),1))]),S("span",_de,[S("span",Sde,B(q.label),1),q.description?(x(),E("span",Cde,B(q.description),1)):ge("",!0)])],10,yde))),128)),l.value.allowOther?(x(),E("label",{key:0,class:He(["qopt",{selected:M(l.value.id)}]),onClick:O[4]||(O[4]=Mt(q=>I(l.value.id),["prevent"]))},[O[6]||(O[6]=S("span",{class:"qopt-key"},null,-1)),S("span",Ade,[l.value.multiSelect?(x(),E("span",Mde,B(M(l.value.id)?"■":"□"),1)):(x(),E("span",Ede,B(M(l.value.id)?"●":"○"),1))]),S("span",Tde,B(l.value.otherLabel??A(s)("question.otherDefault")),1),Fn(S("input",{ref_key:"otherInputEl",ref:b,"onUpdate:modelValue":O[1]||(O[1]=q=>v.value[l.value.id]=q),class:"other-input",type:"text",placeholder:l.value.otherLabel??A(s)("question.otherDefault"),onInput:O[2]||(O[2]=q=>C(l.value.id)),onFocus:O[3]||(O[3]=q=>C(l.value.id))},null,40,Nde),[[po,v.value[l.value.id]]])],2)):ge("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Fe(()=>[S("div",Ide,[i.value<a.value-1?(x(),Ae(Kt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Fe(()=>[tt(B(A(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),Ae(Kt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!$(),loading:N.value,onClick:R},{default:Fe(()=>[tt(B(A(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),Ae(Kt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||_.value,onClick:c},{default:Fe(()=>[tt(B(A(s)("question.back")),1)]),_:1},8,["disabled"])):ge("",!0),ve(Kt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:_.value,onClick:z},{default:Fe(()=>[tt(B(A(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),$de=dt(Lde,[["__scopeId","data-v-672d70d1"]]),Fde={class:"ah"},Ode={class:"akind"},Rde={class:"apath"},Bde={class:"ah-path"},Dde={key:1,class:"diff"},Pde={class:"dg"},Hde={class:"dc"},Wde={key:2,class:"body-shell"},zde={class:"shell-cmd"},Ude={key:0,class:"shell-cwd"},qde={key:1,class:"shell-danger"},jde={key:3,class:"body-file"},Vde={class:"file-bar"},Kde={class:"file-lang"},Gde={class:"file-content"},Yde={class:"file-ln"},Zde={class:"file-text"},Xde={key:4,class:"body-chip"},Qde={class:"chip-label"},Jde={class:"chip-value"},efe={key:0,class:"chip-detail"},tfe={key:5,class:"body-chip"},nfe={key:0,class:"chip-label"},sfe={class:"chip-value"},ofe={key:6,class:"body-chip"},ife={class:"chip-label"},rfe={class:"chip-value"},lfe={key:0,class:"chip-detail"},afe={key:7,class:"body-chip"},cfe={class:"chip-label"},ufe={class:"chip-value"},dfe={key:0,class:"chip-detail"},ffe={key:8,class:"body-todo"},hfe={class:"todo-glyph"},pfe={key:9,class:"body-plan"},mfe={key:10,class:"body-generic"},gfe={class:"gen-text"},vfe={key:11,class:"feedback-wrap"},yfe=["placeholder"],kfe={class:"feedback-hint"},bfe={key:0,class:"plan-actions"},xfe={key:1,class:"abtn"},wfe=Xe({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=D(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=se(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const N=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${N}`)}const c=se(!1),u=se(""),d=se(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const N=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:N||void 0}):k("feedback",{decision:"rejected",feedback:N||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(N){N.key==="Enter"&&!N.shiftKey?(N.preventDefault(),h()):N.key==="Escape"&&(N.preventDefault(),p())}const y=se(null);Je(()=>n.busy,N=>{N||(y.value=null)});function k(N,F){n.busy||(y.value=N,s("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function b(){k("reject",{decision:"rejected"})}function C(){k("approvePlan",{decision:"approved"})}function I(N){k(`option:${N}`,{decision:"approved",selectedLabel:N})}function T(){n.busy||f()}function M(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function $(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const _=i.value;if(_){if(_.options.length===0){N.key==="1"?(N.preventDefault(),C()):N.key==="2"?(N.preventDefault(),T()):N.key==="3"&&(N.preventDefault(),M());return}N.key==="1"&&_.options[0]?(N.preventDefault(),I(_.options[0].label)):N.key==="2"&&_.options[1]?(N.preventDefault(),I(_.options[1].label)):N.key==="3"&&_.options[2]&&(N.preventDefault(),I(_.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),v()):N.key==="3"?(N.preventDefault(),b()):N.key==="4"&&(N.preventDefault(),f())}return mn(()=>document.addEventListener("keydown",$)),Cn(()=>document.removeEventListener("keydown",$)),(N,F)=>(x(),Ae(DE,{class:He(["appr",{minimized:r.value}])},$A({head:Fe(()=>[S("div",Fde,[F[2]||(F[2]=S("span",{class:"ah-ic"},"!",-1)),S("span",Ode,B(a()),1),S("span",Rde,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),E(De,{key:0},[tt(B(e.block.path),1)],64)):e.block.kind==="shell"?(x(),E(De,{key:1},[tt(B(e.block.command),1)],64)):e.block.kind==="url"?(x(),E(De,{key:2},[tt(B(e.block.url),1)],64)):e.block.kind==="search"?(x(),E(De,{key:3},[tt(B(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),E(De,{key:4},[tt(B(e.block.name),1)],64)):e.block.kind==="generic"?(x(),E(De,{key:5},[tt(B(e.block.summary),1)],64)):ge("",!0)]),e.agentName&&!r.value?(x(),Ae(Ji,{key:0,variant:"neutral",size:"sm"},{default:Fe(()=>[tt(B(A(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ge("",!0),r.value?ge("",!0):(x(),Ae(Ji,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Fe(()=>[tt(B(A(o)("approval.required")),1)]),_:1})),ve(Wn,{class:"amin",size:"sm",label:r.value?A(o)("question.expand"):A(o)("question.minimize"),onClick:F[0]||(F[0]=_=>r.value=!r.value)},{default:Fe(()=>[r.value?(x(),Ae(et,{key:0,name:"chevron-up",size:"md"})):(x(),Ae(et,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Fe(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),Ae(en,{key:0,text:e.block.path},{default:Fe(()=>[S("div",Bde,B(e.block.path),1)]),_:1},8,["text"])):ge("",!0),e.block.kind==="diff"?(x(),E("div",Dde,[(x(!0),E(De,null,rt(e.block.diff,(_,R)=>(x(),E("div",{key:R,class:He(["dl",_.kind==="add"?"add":_.kind==="rem"?"del":""])},[S("span",Pde,B(_.gutter),1),S("span",Hde,B(_.text),1)],2))),128))])):e.block.kind==="shell"?(x(),E("div",Wde,[S("div",zde,[F[3]||(F[3]=S("span",{class:"shell-dollar"},"$",-1)),tt(" "+B(e.block.command),1)]),e.block.cwd?(x(),E("div",Ude,"cwd: "+B(e.block.cwd),1)):ge("",!0),e.block.danger?(x(),E("div",qde,B(A(o)("approval.danger",{detail:e.block.danger})),1)):ge("",!0)])):e.block.kind==="file"?(x(),E("div",jde,[S("div",Vde,[S("span",Kde,B(e.block.language??""),1)]),S("div",Gde,[(x(!0),E(De,null,rt(e.block.content.split(`
|
|
309
|
+
`),(_,R)=>(x(),E("div",{key:R,class:"file-line"},[S("span",Yde,B(R+1),1),S("span",Zde,B(_),1)]))),128))])])):e.block.kind==="fileop"?(x(),E("div",Xde,[S("span",Qde,B(e.block.op),1),S("span",Jde,B(e.block.path),1),e.block.detail?(x(),E("span",efe,B(e.block.detail),1)):ge("",!0)])):e.block.kind==="url"?(x(),E("div",tfe,[e.block.method?(x(),E("span",nfe,B(e.block.method),1)):ge("",!0),S("span",sfe,B(e.block.url),1)])):e.block.kind==="search"?(x(),E("div",ofe,[S("span",ife,B(A(o)("approval.searchQueryLabel")),1),S("span",rfe,B(e.block.query),1),e.block.scope?(x(),E("span",lfe,B(A(o)("approval.searchScope",{scope:e.block.scope})),1)):ge("",!0)])):e.block.kind==="invocation"?(x(),E("div",afe,[S("span",cfe,B(e.block.kind2),1),S("span",ufe,B(e.block.name),1),e.block.description?(x(),E("span",dfe,B(e.block.description),1)):ge("",!0)])):e.block.kind==="todo"?(x(),E("div",ffe,[(x(!0),E(De,null,rt(e.block.items,(_,R)=>(x(),E("div",{key:R,class:"todo-item"},[S("span",hfe,B(_.status==="done"||_.status==="completed"?"✓":"○"),1),S("span",{class:He(["todo-title",{"todo-done":_.status==="done"||_.status==="completed"}])},B(_.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),E("div",pfe,[ve(H1,{text:e.block.plan},null,8,["text"])])):(x(),E("div",mfe,[S("span",gfe,B(e.block.summary),1)])),c.value?(x(),E("div",vfe,[Fn(S("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=_=>u.value=_),class:"feedback-ta",placeholder:A(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,yfe),[[po,u.value]]),S("div",kfe,B(A(o)("approval.feedbackHint")),1)])):ge("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Fe(()=>[i.value?(x(),E("div",bfe,[i.value.options.length>0?(x(!0),E(De,{key:0},rt(i.value.options,(_,R)=>(x(),Ae(en,{key:R,text:_.description},{default:Fe(()=>[ve(Kt,{class:"kbtn",size:"sm",variant:"primary",loading:y.value===`option:${_.label}`,disabled:e.busy,onClick:z=>I(_.label)},{default:Fe(()=>[tt(B(_.label),1),ve(mr,{class:"k",keys:[String(R+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),Ae(Kt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:y.value==="approvePlan",disabled:e.busy,onClick:C},{default:Fe(()=>[tt(B(A(o)("approval.approvePlan")),1),ve(mr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ve(Kt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:T},{default:Fe(()=>[tt(B(A(o)("approval.revise")),1),i.value.options.length===0?(x(),Ae(mr,{key:0,class:"k",keys:["2"]})):ge("",!0)]),_:1},8,["disabled"]),ve(Kt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:y.value==="rejectAndExit",disabled:e.busy,onClick:M},{default:Fe(()=>[tt(B(A(o)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),Ae(mr,{key:0,class:"k",keys:["3"]})):ge("",!0)]),_:1},8,["loading","disabled"])])):(x(),E("div",xfe,[ve(Kt,{class:"kbtn",size:"sm",variant:"primary",loading:y.value==="approve",disabled:e.busy,onClick:g},{default:Fe(()=>[tt(B(A(o)("approval.approve")),1),ve(mr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ve(Kt,{class:"kbtn",size:"sm",variant:"secondary",loading:y.value==="approveSession",disabled:e.busy,onClick:v},{default:Fe(()=>[tt(B(A(o)("approval.approveSession")),1),ve(mr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ve(Kt,{class:"kbtn",size:"sm",variant:"secondary",loading:y.value==="reject",disabled:e.busy,onClick:b},{default:Fe(()=>[tt(B(A(o)("approval.reject")),1),ve(mr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ve(Kt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Fe(()=>[tt(B(A(o)("approval.feedback")),1),ve(mr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),_fe=dt(wfe,[["__scopeId","data-v-9ab30d7f"]]),Sfe=Xe({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(x(),E("span",{class:He(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},B(n[t.status]),3))}}),PE=dt(Sfe,[["__scopeId","data-v-f7213288"]]),Cfe={class:"taskspane"},Afe={class:"tp-head"},Mfe={class:"tp-title"},Efe={class:"tp-count"},Tfe={class:"tp-list"},Nfe={key:0,class:"tp-empty"},Ife=["role","onClick"],Lfe={class:"tp-name"},$fe={class:"tp-time"},Ffe=["onClick"],Ofe={key:0,class:"tp-detail"},Rfe={key:0,class:"tp-codebox"},Bfe=["onClick"],Dfe={class:"tp-pre"},Pfe={class:"tp-cmd"},Hfe={key:1,class:"tp-codebox"},Wfe=["onClick"],zfe={class:"tp-pre"},Ufe=Xe({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Ot(),o=Ts(new Set),i=Ts(new Set),r=Ts(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,y){await Hs(p)&&(y.add(m),setTimeout(()=>y.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(`
|
|
310
|
+
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(x(),E("div",Cfe,[S("div",Afe,[S("span",Mfe,B(A(s)("tasks.tag")),1),S("span",Efe,B(e.tasks.length),1)]),S("div",Tfe,[e.tasks.length===0?(x(),E("div",Nfe,B(A(s)("tasks.emptyTasks")),1)):(x(!0),E(De,{key:1},rt(e.tasks,y=>(x(),E("div",{key:y.id,class:He(["tp-row",{done:y.state==="done",fail:y.state==="fail",expandable:c(y)}])},[S("div",{class:"tp-main",role:c(y)?"button":void 0,onClick:k=>a(y)},[ve(PE,{status:u(y.state)},null,8,["status"]),S("span",Lfe,B(y.name),1),ve(Ji,{variant:"neutral",size:"sm"},{default:Fe(()=>[tt(B(y.kind),1)]),_:2},1024),S("span",$fe,B(y.timing),1),y.state==="run"?(x(),E("button",{key:0,class:"tp-stop",onClick:Mt(k=>n("cancel",y.id),["stop"])},B(A(s)("tasks.stop")),9,Ffe)):ge("",!0),y.kind==="subagent"?(x(),Ae(et,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(y)?(x(),Ae(et,{key:2,class:He(["tp-chevron",{open:o.has(y.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ge("",!0)],8,Ife),o.has(y.id)&&l(y)?(x(),E("div",Ofe,[y.meta?(x(),E("div",Rfe,[S("button",{class:He(["tp-copy",{copied:i.has(y.id)}]),onClick:Mt(k=>f(y),["stop"])},B(i.has(y.id)?"已复制":"复制"),11,Bfe),S("pre",Dfe,[S("code",null,[S("span",Pfe,B(y.meta),1)])])])):ge("",!0),y.output&&y.output.length>0?(x(),E("div",Hfe,[S("button",{class:He(["tp-copy",{copied:r.has(y.id)}]),onClick:Mt(k=>h(y),["stop"])},B(r.has(y.id)?"已复制":"复制"),11,Wfe),S("pre",zfe,[S("code",null,[m[0]||(m[0]=tt(`
|
|
311
|
+
`,-1)),(x(!0),E(De,null,rt(y.output,(k,g)=>(x(),E("span",{key:g,class:"tp-line"},B(k),1))),128)),m[1]||(m[1]=tt(`
|
|
312
|
+
`,-1))])])])):ge("",!0)])):ge("",!0)],2))),128))])]))}}),b3=dt(Ufe,[["__scopeId","data-v-a7458569"]]),qfe={class:"todo-card"},jfe={key:0,class:"tc-empty"},Vfe={class:"tc-name"},Kfe=Xe({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Ot();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(x(),E("div",qfe,[t.todos.length===0?(x(),E("div",jfe,[i[0]||(i[0]=S("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"},[S("path",{d:"M9 11l2 2 4-4"}),S("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),S("span",null,B(A(n)("tasks.emptyTodo")),1)])):ge("",!0),(x(!0),E(De,null,rt(t.todos,(r,l)=>(x(),E("div",{key:l,class:He(["tc-row",`s-${r.status}`])},[ve(PE,{status:s(r.status)},null,8,["status"]),S("span",Vfe,B(r.title),1)],2))),128))]))}}),Gfe=dt(Kfe,[["__scopeId","data-v-7c1dfd30"]]),Yfe=["disabled","aria-pressed"],Zfe=Xe({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),E("button",{key:0,class:He(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Rn(t.$slots,"default",{},void 0,!0)],10,Yfe)):(x(),E("span",{key:1,class:He(["ui-pill",{"is-active":e.active}])},[Rn(t.$slots,"default",{},void 0,!0)],2))}}),wv=dt(Zfe,[["__scopeId","data-v-64fdc56d"]]),Xfe={class:"dock-work-head"},Qfe={key:0,class:"dock-work-tab static"},Jfe={key:1,class:"dock-work-tab static"},ehe={key:2,class:"dock-work-tab static"},the={class:"dock-work-body"},nhe={class:"dw-count"},she={class:"dw-count"},ohe={class:"dw-count"},ihe=Xe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},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","openBtw","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}=Ot(),r=se(null),l=se(null),a=se(null),c=se(null);function u(y){return r.value?(r.value.loadForEdit(y),!0):!1}function d(y){r.value?.loadAttachmentsForEdit(y)}function f(){r.value?.focus()}function h(y){if(!s.dockPanel)return;const k=y.target;k&&(l.value?.contains(k)||a.value?.contains(k)||o("close-dock-panel"))}Je(()=>s.dockPanel,y=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),y&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function m(){const y=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${y}px`)}return mn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(m),p.observe(c.value),m())}),Cn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(y,k)=>(x(),E("div",{ref_key:"dockRef",ref:c,class:He(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:k[23]||(k[23]=Mt(()=>{},["stop"]))},[ve(Fa,{name:"dock-panel"},{default:Fe(()=>[e.dockPanel?(x(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:k[3]||(k[3]=Mt(()=>{},["stop"]))},[S("div",Xfe,[e.dockPanel==="bash"?(x(),E("span",Qfe,B(A(i)("tasks.dockBash"))+" · "+B(e.bashRunning)+" "+B(A(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),E("span",Jfe,B(A(i)("tasks.dockSubagent"))+" · "+B(e.subagentRunning)+" "+B(A(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),E("span",ehe,B(A(i)("tasks.dockTodos"))+" · "+B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1)):ge("",!0)]),S("div",the,[e.dockPanel==="bash"?(x(),Ae(b3,{key:0,tasks:e.bashTasks,onCancel:k[0]||(k[0]=g=>o("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),Ae(b3,{key:1,tasks:e.subagentTasks,onCancel:k[1]||(k[1]=g=>o("cancelTask",g)),onOpen:k[2]||(k[2]=g=>o("openAgent",g))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),Ae(Gfe,{key:2,todos:e.todos??[]},null,8,["todos"])):ge("",!0)])],512)):ge("",!0)]),_:1}),e.hasDockWork?(x(),E("div",{key:0,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),Ae(wv,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:k[4]||(k[4]=g=>o("toggle-dock-panel","bash"))},{default:Fe(()=>[ve(et,{name:"clock",size:"md"}),S("span",null,B(A(i)("tasks.dockBash")),1),S("span",nhe,[k[24]||(k[24]=tt("(",-1)),S("b",null,B(e.bashTasks.length),1),k[25]||(k[25]=tt(")",-1))])]),_:1},8,["active","aria-pressed"])):ge("",!0),e.subagentTasks.length>0?(x(),Ae(wv,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:k[5]||(k[5]=g=>o("toggle-dock-panel","subagent"))},{default:Fe(()=>[ve(et,{name:"sparkles",size:"md"}),S("span",null,B(A(i)("tasks.dockSubagent")),1),S("span",she,[k[26]||(k[26]=tt("(",-1)),S("b",null,B(e.subagentTasks.length),1),k[27]||(k[27]=tt(")",-1))])]),_:1},8,["active","aria-pressed"])):ge("",!0),(e.todos?.length??0)>0?(x(),Ae(wv,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:k[6]||(k[6]=g=>o("toggle-dock-panel","todos"))},{default:Fe(()=>[ve(et,{name:"check-list",size:"md"}),S("span",null,B(A(i)("tasks.dockTodos")),1),S("span",ohe,[k[28]||(k[28]=tt("(",-1)),S("b",null,B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1),k[29]||(k[29]=tt(")",-1))])]),_:1},8,["active","aria-pressed"])):ge("",!0)],512)):ge("",!0),e.pendingQuestion?(x(),Ae($de,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:k[7]||(k[7]=(g,v)=>o("answer",g,v)),onDismiss:k[8]||(k[8]=g=>o("dismiss",g))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),Ae(_fe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:k[9]||(k[9]=g=>o("approval",e.pendingApproval.approvalId,g))},null,8,["block","agent-name","busy"])):(x(),Ae(BE,{key:3,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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:k[10]||(k[10]=g=>o("submit",g)),onSteer:k[11]||(k[11]=g=>o("steer",g)),onCommand:k[12]||(k[12]=g=>o("command",g)),onInterrupt:k[13]||(k[13]=g=>o("interrupt")),onSetPermission:k[14]||(k[14]=g=>o("setPermission",g)),onSetThinking:k[15]||(k[15]=g=>o("setThinking",g)),onTogglePlan:k[16]||(k[16]=g=>o("togglePlan")),onToggleSwarm:k[17]||(k[17]=g=>o("toggleSwarm")),onOpenBtw:k[18]||(k[18]=g=>o("openBtw")),onFocusSwarm:k[19]||(k[19]=g=>o("focusSwarm")),onCompact:k[20]||(k[20]=g=>o("compact")),onPickModel:k[21]||(k[21]=g=>o("pickModel")),onSelectModel:k[22]||(k[22]=g=>o("selectModel",g))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","activation-badges","models","starred-ids","skills","starting"]))],2))}}),rhe=dt(ihe,[["__scopeId","data-v-bd55bad9"]]),lhe=["aria-label","aria-hidden"],ahe={class:"toc-scroll"},che=["onClick"],uhe={class:"toc-label"},dhe=240,fhe=Xe({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=se(null),r=se(!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>=dhe}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Je(c,u=>{l?.disconnect(),l=null,u&&yt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),Qn(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),E("nav",{key:0,ref_key:"navRef",ref:i,class:He(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":A(o)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[S("div",ahe,[(x(!0),E(De,null,rt(e.items,f=>(x(),E("button",{key:f.id,type:"button",class:He(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=S("span",{class:"toc-bar"},null,-1)),S("span",uhe,B(f.title),1)],10,che))),128))])],10,lhe)):ge("",!0)}}),hhe=dt(fhe,[["__scopeId","data-v-ad916253"]]),phe=5;function mhe(e,t,n,s=phe){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 ghe={class:"chat-layout"},vhe={class:"empty-hint"},yhe={key:0,class:"empty-hint-text"},khe={key:1,class:"ws-pick"},bhe={class:"ws-pick-name"},xhe={key:1,class:"ws-pick-menu"},whe=["onClick"],_he={class:"ws-pick-item-name"},She={class:"ws-pick-item-path"},Che=["aria-label"],Ahe={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Mhe={class:"abort-toast-text"},_v=80,x3=1e3,Ehe=420,The=3e3,Nhe=Xe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:s}=Ot(),o=e,i=n,r=se(!1),l=se(!1),a=D(()=>o.workspaces?.find(V=>V.id===o.activeWorkspaceId)?.name??o.workspaceName??""),c=D(()=>(o.workspaces?.length??0)>0),u=D(()=>mhe(o.workspaces??[],o.activeWorkspaceId,l.value)),d=D(()=>(o.workspaces?.length??0)-u.value.length);Je(r,ce=>{ce||(l.value=!1)});function f(ce){r.value=!1,ce!==o.activeWorkspaceId&&i("selectWorkspace",ce)}Oa(Pt.contentAlign);const h=se(null),p=se(null),m=se(null),y=se(!1);let k=null;function g(ce,V){const le=m.value??p.value;return!le||le.loadForEdit(ce)===!1?!1:(le.loadAttachmentsForEdit(V??[]),!0)}function v(){y.value=!0,k!==null&&clearTimeout(k),k=setTimeout(()=>{k=null,y.value=!1},2e3)}const b=D(()=>o.tasks.filter(ce=>ce.kind!=="subagent")),C=D(()=>o.tasks.filter(ce=>ce.kind==="subagent"&&ce.runInBackground)),I=D(()=>b.value.filter(ce=>ce.state==="run").length),T=D(()=>C.value.filter(ce=>ce.state==="run").length);function M(ce){const V=o.tasks,le=V.find(ke=>ke.id===ce)??V.find(ke=>ke.parentToolCallId===ce);if(le)return le.id;const J=V.filter(ke=>ke.kind==="subagent"&&!ke.parentToolCallId);if(J.length===1)return J[0].id}wn("resolveAgentTaskId",M),wn("pinScroll",Ut);const $=D(()=>(o.todos??[]).filter(ce=>ce.status==="done").length),N=D(()=>b.value.length>0||C.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),F=se(null),_=D(()=>o.gitInfo?o.changes?.length??0:0);function R(ce){F.value=F.value===ce?null:ce}function z(){F.value=null}Je(N,ce=>{ce||z()});function W(ce){if(ce.role==="compaction")return s("conversation.compactedPlain");if(ce.role==="user"){if(ce.skillActivation)return`/${ce.skillActivation.name}`;if(ce.pluginCommand)return`/${ce.pluginCommand.pluginId}:${ce.pluginCommand.commandName}`;const le=ce.text.trim().replaceAll(/\s+/g," ");return le.length>0?le:"user"}const V=(ce.text||ce.thinking||"").trim().replaceAll(/\s+/g," ");return V.length>0?V:(ce.tools?.length??0)>0?`${ce.tools.length} tools`:"dimi"}const L=D(()=>o.turns.filter(ce=>ce.role==="user").map((ce,V)=>({id:ce.id,role:ce.role,no:V+1,title:W(ce)}))),O=se(null);function q(){const ce=xe.value;if(!ce)return;const V=ce.querySelectorAll(".turn-anchor[data-turn-id]");if(V.length===0)return;const le=L.value;if(le.length===0)return;const J=new Set(le.map(je=>je.id));if(K()<=_v){O.value=le[le.length-1].id;return}const ke=ce.getBoundingClientRect(),Se=ke.height/2;let Oe=null;V.forEach(je=>{const it=je.dataset.turnId;if(!it||!J.has(it))return;je.getBoundingClientRect().top-ke.top<=Se&&(Oe=it)}),O.value=Oe??le[0].id}const X=se(!1);let ie=0;function U(){ie||(ie=Zt(()=>{ie=0,j()}))}function j(){const ce=xe.value,V=!o.mobile&&o.conversationToc&&ce?ce.closest(".con")?.querySelector(".conversation-toc"):null,le=V?.querySelector(".toc-bar");let J=!1;if(ce&&V&&le){const ke=le.getBoundingClientRect(),Se=V.getBoundingClientRect(),Oe=ke.left+ke.width/2;J=Array.from(ce.querySelectorAll(".table-node-wrapper")).some(je=>{const it=je.getBoundingClientRect();return it.left<=Oe&&Oe<=it.right&&it.top<Se.bottom&&it.bottom>Se.top})}X.value!==J&&(X.value=J)}const te=D(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),ae=D(()=>{const ce=te.value;if(ce)return o.pendingQuestionActions?.[ce.questionId]}),oe=D(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),re=D(()=>{const ce=oe.value;return ce?!!o.pendingApprovalActions?.[ce.approvalId]:!1}),xe=se(null),pe=se(null),Ee=se(0),ue=se(0),Y=D(()=>({"--panes-scrollbar-width":`${Ee.value}px`}));function Q(ce){return ce instanceof HTMLElement?ce:ce&&"$el"in ce&&ce.$el instanceof HTMLElement?ce.$el:null}function P(){const ce=xe.value;Ee.value=ce?Math.max(0,ce.offsetWidth-ce.clientWidth):0,ue.value=pe.value?.offsetHeight??0}function G(ce){const V=Q(ce);xe.value=V,V&&ti()}function ye(ce){const V=Q(ce);pe.value=V??null,ce&&"loadForEdit"in ce&&typeof ce.loadForEdit=="function"&&"focus"in ce&&typeof ce.focus=="function"?m.value={loadForEdit:ce.loadForEdit.bind(ce),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ce&&typeof ce.loadAttachmentsForEdit=="function"?ce.loadAttachmentsForEdit.bind(ce):()=>{},focus:ce.focus.bind(ce)}:m.value=null,Bo()}const he=se(!0),fe=se(!1);function K(){const ce=xe.value;return ce?ce.scrollHeight-ce.scrollTop-ce.clientHeight:0}let ne=0,me=0,we=0,Te=0,Pe=0,be=0;function _e(){return Date.now()<me}function Ke(){U();const ce=xe.value;if(!ce)return;const V=ce.scrollTop;if(It()){ne=V;return}if(performance.now()-we<100){ne=V;return}const le=K();if(_e()){he.value=!0,fe.value=!1,ne=V;return}V<ne-1&&le>1?(he.value=!1,fe.value=!0):le<=_v&&V>ne+1&&(he.value=!0,fe.value=!1),ne=V,q()}function Qe(ce=!1){const V=xe.value;he.value=!0,fe.value=!1,V&&(!ce&&performance.now()<Te||(ce&&typeof V.scrollTo=="function"?(we=performance.now(),Te=performance.now()+Ehe,V.scrollTo({top:V.scrollHeight,behavior:"smooth"})):V.scrollTop=V.scrollHeight,ne=V.scrollTop))}function ot(ce,V){return(V.closest("[inert]")?.closest(".tool-group")??V).getBoundingClientRect().top-ce.getBoundingClientRect().top+ce.scrollTop}function at(ce,V){const le=Array.from(ce.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(Se=>({node:Se,top:ot(ce,Se)})),J=le.findIndex(Se=>Se.top>=V),ke=J<0?Math.max(0,le.length-1):J;return le.slice(ke,ke+2).flatMap(Se=>{const Oe=Se.node.dataset.scrollAnchorId,je=Oe??Se.node.dataset.turnId;return je?[{kind:Oe?"tool":"turn",id:je,top:Se.top}]:[]})}const ht=new Map;function Et(ce,V){for(const le of V.anchors){const J=le.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",ke=ce.querySelector(`[${J}="${rn(le.id)}"]`);if(ke)return ot(ce,ke)-le.top}return ce.scrollHeight-V.oldHeight}function Tt(ce,V,le=ce.scrollTop){return ce.scrollTop=le+Et(ce,V),ne=ce.scrollTop,ce.scrollTop}async function $t(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||Xs.value||!o.hasMoreMessages)return;const ce=o.sessionId,V=xe.value,le=V?.scrollTop??0,J={anchors:V?at(V,le):[],oldHeight:V?.scrollHeight??0};_s(ce,!0),Jo();try{if(await yt(),await o.loadOlderMessages(ce),await yt(),o.sessionId!==ce){ht.set(ce,J);return}const ke=xe.value;if(!ke)return;Tt(ke,J),ht.delete(ce)}finally{_s(ce,!1)}}function rn(ce){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ce):ce.replaceAll(/["\\]/g,"\\$&")}function vn(ce){const V=xe.value;if(!V)return;const le=V.querySelector(`.turn-anchor[data-turn-id="${rn(ce)}"]`);le&&(Qs(),he.value=!1,fe.value=K()>_v,le.scrollIntoView({behavior:"smooth",block:"center"}))}function Ht(){const ce=xe.value;if(!ce)return"none";const V=ce.firstElementChild,le=V instanceof HTMLElement?V.offsetHeight:0,J=pe.value?.offsetHeight??0;return`${ce.scrollHeight}:${ce.clientHeight}:${le}:${J}`}function Zt(ce){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ce):setTimeout(ce,16)}function tn(ce){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ce):clearTimeout(ce)}let Gt=0,An=0,Ye=null,qe=0;function It(){return performance.now()<Gt}function Ut(ce,V=260){const le=xe.value;if(!le||(Ye=ce,qe=ce.getBoundingClientRect().top,Gt=performance.now()+V,An))return;const J=()=>{if(An=0,performance.now()>=Gt||!Ye){Ye=null;return}const ke=Ye.getBoundingClientRect().top-qe;ke&&(le.scrollTop+=ke),An=Zt(J)};An=Zt(J)}function Vt(ce=36){if(!he.value&&!_e())return;const V=++be;let le="",J=0,ke=0;Pe&&(tn(Pe),Pe=0);const Se=()=>{if(Pe=0,V!==be||!he.value&&!_e())return;Qe(!1);const Oe=Ht();J=Oe===le?J+1:0,le=Oe,ke++,J<3&&ke<ce&&(Pe=Zt(Se))};Pe=Zt(Se)}function kn(ce,V){return ce!==void 0&&ce.length>0&&V.length>=ce.length&&ce.firstId!==V.firstId&&ce.lastId===V.lastId&&ce.lastTextLen===V.lastTextLen&&ce.lastThinkingLen===V.lastThinkingLen&&ce.lastToolsLen===V.lastToolsLen&&ce.approvalIds===V.approvalIds}const ft=D(()=>{const ce=(o.approvals??[]).map(Se=>Se.approvalId).join(","),V=o.turns,le=V.at(-1),J=le?.thinking?.length??0,ke=le?.tools?.reduce((Se,Oe)=>Se+Oe.name.length+(Oe.arg?.length??0)+(Oe.output?.join("").length??0),0)??0;return{length:V.length,firstId:V[0]?.id??"",lastId:le?.id??"",lastTextLen:le?.text.length??0,lastThinkingLen:J,lastToolsLen:ke,approvalIds:ce}});Je(ft,async(ce,V)=>{if(Xs.value&&kn(V,ce)){q();return}await yt(),he.value||_e()?Qe(ce.length<V.length):fe.value=!0,q()}),Je(pe,()=>{Bo()}),Je(()=>o.mobile,async()=>{await yt(),P()});const cn=new Map;Je(()=>o.fileReloadKey,async(ce,V)=>{const le=xe.value;V&&le&&cn.set(String(V),{top:le.scrollTop,following:he.value}),Qs(),await yt();const J=xe.value,ke=ce?cn.get(String(ce)):void 0;if(ke&&J){const Se=ht.get(String(ce)),Oe=Se?Tt(J,Se,ke.top):ke.top;Se&&ht.delete(String(ce)),he.value=ke.following,J.scrollTop=Oe,ne=J.scrollTop,fe.value=!ke.following&&K()>1,ke.following&&Vt()}else he.value=!0,ne=0,Qe(!1),Vt();q()}),Je(()=>o.sessionLoading,async(ce,V)=>{ce||!V||(he.value=!0,await yt(),Vt(),q())}),Je(()=>o.turnActive,async(ce,V)=>{ce||!V||!he.value&&!_e()||(await yt(),Vt(48),q())});function un(){he.value=!0,fe.value=!1,me=Date.now()+x3,yt(()=>{Qe(!0),Vt(16)})}function Bn(ce){un(),i("submit",ce)}function Mn(ce){he.value=!0,fe.value=!1,me=Date.now()+x3,i("editMessage",ce)}function Ns(ce){const V=o.queued?.[ce],le=V?.text??"";g(le,V?.attachments)&&i("editQueued",ce)}function bs(ce){i("reorderQueue",ce)}function ct(ce,V){un(),i("answer",ce,V)}function sr(ce,V){!ce||!V||i("approval",ce,V)}let xs=null,bn=null,gs=null,ws=null,Ws=0,Zs=0,Gn=0;const mo=se(new Set),Xs=D(()=>!!o.sessionId&&mo.value.has(o.sessionId));function _s(ce,V){const le=new Set(mo.value);V?le.add(ce):le.delete(ce),mo.value=le}function Fo(){Xs.value||Gn||(Gn=Zt(()=>{Gn=0,!Xs.value&&(It()||(he.value||_e())&&Qe(!1))}))}function Jo(){be++,Pe&&(tn(Pe),Pe=0),Gn&&(tn(Gn),Gn=0)}function Qs(){const ce=xe.value;if(me=0,Jo(),Gt=0,Ye=null,ce){const V=ce.scrollTop;typeof ce.scrollTo=="function"?ce.scrollTo({top:V,behavior:"auto"}):ce.scrollTop=V}Te=0,we=Number.NEGATIVE_INFINITY,ce&&(ne=ce.scrollTop)}function os(){const ce=xe.value;!ce||ce.scrollHeight-ce.clientHeight<=1&&!o.hasMoreMessages||(he.value=!1,Qs(),ce.scrollHeight-ce.clientHeight>1&&(fe.value=!0))}function Fi(ce){const V=xe.value;if(!V)return!1;for(const le of ce.composedPath()){if(le===V)return!1;if(le instanceof HTMLElement&&le.scrollHeight>le.clientHeight+1&&le.scrollTop>1)return!0}return!1}function ei(ce){ce.defaultPrevented||ce.ctrlKey||ce.shiftKey||ce.deltaY>=0||Fi(ce)||os()}function Xt(ce){const V=xe.value;if(!V||ce.defaultPrevented||ce.button!==0||ce.pointerType==="touch")return;const le=V.getBoundingClientRect(),J=V.offsetWidth-V.clientWidth,ke=J>0?J:12;ce.target===V&&ce.clientX>=le.right-ke&&os()}let Is=null;function Yn(ce){Is=ce.touches.length===1?ce.touches[0].clientY:null}function Oo(ce){const V=ce.touches.length===1?ce.touches[0].clientY:null;V!==null&&Is!==null&&V>Is+2&&!Fi(ce)&&os(),Is=V}function Ro(){if(!bn)return;const ce=xe.value?.firstElementChild??null;ce!==gs&&(gs&&bn.unobserve(gs),gs=ce,ce&&bn.observe(ce))}function Bo(){if(!bn)return;const ce=pe.value;ce!==ws&&(ws&&bn.unobserve(ws),ws=ce,ce&&bn.observe(ce))}function ti(){const ce=xe.value;P(),xs&&(xs.disconnect(),ce&&xs.observe(ce,{childList:!0,subtree:!0,characterData:!0})),bn&&(bn.disconnect(),gs=null,ws=null,ce&&bn.observe(ce),Ro(),Bo()),Ws=ce?.scrollHeight??0,Zs=ce?.clientHeight??0,U()}function Do(){Ro(),Fo(),U()}function go(){typeof document>"u"||document.visibilityState==="visible"&&he.value&&Vt()}const Ue=se(!1);let Ze=null;function ut(){Ue.value=!0,Ze!==null&&clearTimeout(Ze),Ze=setTimeout(()=>{Ue.value=!1},The)}function Wt(){ut(),i("interrupt")}function zs(ce){ce.key==="Escape"&&(o.running||o.working)&&(ce.preventDefault(),Wt())}function vo(){he.value&&Fo()}mn(()=>{yt(()=>{typeof MutationObserver=="function"&&(xs=new MutationObserver(Do)),typeof ResizeObserver=="function"&&(bn=new ResizeObserver(()=>{U(),P();const ce=xe.value;if(!ce)return;const{scrollHeight:V,clientHeight:le}=ce,J=V>Ws+1,ke=le<Zs-1;Ws=V,Zs=le,!It()&&(J||ke)&&Fo()})),ti(),Vt(48),q(),typeof document<"u"&&(document.addEventListener("visibilitychange",go),document.addEventListener("keydown",zs)),window.visualViewport?.addEventListener("resize",vo)})}),Cn(()=>{xs&&xs.disconnect(),bn&&bn.disconnect(),Gn&&tn(Gn),Pe&&tn(Pe),An&&tn(An),ie&&tn(ie),Ze!==null&&clearTimeout(Ze),k!==null&&(clearTimeout(k),k=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",go),document.removeEventListener("keydown",zs)),window.visualViewport?.removeEventListener("resize",vo)});function zr(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:g,focusComposer:zr}),(ce,V)=>(x(),E("section",{class:He(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),Ae(Dle,{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":_.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:y.value,onOpenChanges:V[0]||(V[0]=le=>i("openChanges")),onCopyAll:V[1]||(V[1]=le=>h.value?.copyConversation()),onCopyFinalSummary:V[2]||(V[2]=le=>h.value?.copyFinalSummary()),onOpenPr:V[3]||(V[3]=le=>e.pr&&i("openPr",e.pr.url)),onRenameSession:V[4]||(V[4]=(le,J)=>i("renameSession",le,J)),onForkSession:V[5]||(V[5]=le=>i("forkSession",le)),onArchiveSession:V[6]||(V[6]=le=>i("archiveSession",le)),onExportSession:V[7]||(V[7]=le=>i("exportSession",le))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ge("",!0),e.conversationToc?(x(),Ae(hhe,{key:1,items:L.value,"active-turn-id":O.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:X.value,onSelect:vn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ge("",!0),S("div",ghe,[S("div",{ref:G,class:He(["panes chat-scroll",{"is-following":he.value,"history-prepending":Xs.value}]),onScrollPassive:Ke,onWheelPassive:ei,onPointerdownPassive:Xt,onTouchstartPassive:Yn,onTouchmovePassive:Oo},[S("div",{class:He(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),E(De,{key:0},[V[49]||(V[49]=S("div",{class:"empty-spacer"},null,-1)),S("div",vhe,[S("span",{class:He(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),Ae($o,{key:0,size:"sm"})):ge("",!0),S("span",null,B(e.starting?A(s)("conversation.starting"):A(s)("composer.emptyConversationTitle")),1)],2),e.starting?ge("",!0):(x(),E("span",yhe,B(A(s)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),E("div",khe,[ve(en,{text:A(s)("conversation.switchWorkspace")},{default:Fe(()=>[S("button",{type:"button",class:"ws-pick-btn",onClick:V[8]||(V[8]=Mt(le=>r.value=!r.value,["stop"]))},[ve(et,{name:"folder",size:"sm"}),S("span",bhe,B(a.value),1),ve(et,{class:He(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),E("div",{key:0,class:"ws-pick-backdrop",onClick:V[9]||(V[9]=le=>r.value=!1)})):ge("",!0),r.value?(x(),E("div",xhe,[(x(!0),E(De,null,rt(u.value,le=>(x(),E("button",{key:le.id,type:"button",class:He(["ws-pick-item",{on:le.id===e.activeWorkspaceId}]),onClick:Mt(J=>f(le.id),["stop"])},[S("span",_he,B(le.name),1),S("span",She,B(le.shortPath),1)],10,whe))),128)),d.value>0?(x(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:V[10]||(V[10]=Mt(le=>l.value=!l.value,["stop"]))},[S("span",null,B(A(s)("conversation.moreWorkspaces",{count:d.value})),1)])):ge("",!0),V[48]||(V[48]=S("div",{class:"ws-pick-divider"},null,-1)),S("button",{type:"button",class:"ws-pick-action",onClick:V[11]||(V[11]=Mt(le=>{r.value=!1,i("addWorkspace")},["stop"]))},[ve(et,{name:"plus",size:"sm"}),S("span",null,B(A(s)("conversation.addWorkspace")),1)])])):ge("",!0)])):e.starting?ge("",!0):(x(),E("button",{key:2,type:"button",class:"empty-add-workspace",onClick:V[12]||(V[12]=le=>i("addWorkspace"))},[ve(et,{name:"folder-plus",size:"sm"}),S("span",null,B(A(s)("conversation.addWorkspace")),1)]))]),ve(BE,{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,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Bn,onSteer:V[13]||(V[13]=le=>i("steer",le)),onCommand:V[14]||(V[14]=le=>i("command",le)),onInterrupt:Wt,onUnqueue:V[15]||(V[15]=le=>i("unqueue",le)),onEditQueued:V[16]||(V[16]=le=>i("editQueued",le)),onSetPermission:V[17]||(V[17]=le=>i("setPermission",le)),onSetThinking:V[18]||(V[18]=le=>i("setThinking",le)),onTogglePlan:V[19]||(V[19]=le=>i("togglePlan")),onToggleSwarm:V[20]||(V[20]=le=>i("toggleSwarm")),onOpenBtw:V[21]||(V[21]=le=>i("command","/btw")),onCompact:V[22]||(V[22]=le=>i("compact")),onPickModel:V[23]||(V[23]=le=>i("pickModel")),onSelectModel:V[24]||(V[24]=le=>i("selectModel",le))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","activation-badges","models","starred-ids","skills","starting"]),V[50]||(V[50]=S("div",{class:"empty-spacer"},null,-1))],64)):(x(),Ae(ME,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"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":he.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:V[25]||(V[25]=le=>i("openFile",le)),onOpenMedia:V[26]||(V[26]=le=>i("openMedia",le)),onCopyConversationCopied:v,onOpenThinking:V[27]||(V[27]=le=>i("openThinking",le)),onOpenCompaction:V[28]||(V[28]=le=>i("openCompaction",le)),onOpenAgent:V[29]||(V[29]=le=>i("openAgent",le)),onOpenToolDiff:V[30]||(V[30]=le=>i("openToolDiff",le)),onEditMessage:Mn,onLoadOlderMessages:$t,onUnqueue:V[31]||(V[31]=le=>i("unqueue",le)),onEditQueued:Ns,onReorderQueue:bs},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ge("",!0):(x(),Ae(rhe,{key:0,ref:ye,style:Jt(Y.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"dock-panel":F.value,"bash-tasks":b.value,"subagent-tasks":C.value,"bash-running":I.value,"subagent-running":T.value,"todo-done-count":$.value,"has-dock-work":N.value,todos:e.todos,"pending-question":te.value,"question-busy-kind":ae.value,"pending-approval":oe.value,"approval-busy":re.value,mobile:e.mobile,onToggleDockPanel:V[32]||(V[32]=le=>R(le)),onCloseDockPanel:V[33]||(V[33]=le=>z()),onOpenAgent:V[34]||(V[34]=le=>i("openAgent",le)),onAnswer:ct,onDismiss:V[35]||(V[35]=le=>i("dismiss",le)),onApproval:sr,onCancelTask:V[36]||(V[36]=le=>i("cancelTask",le)),onSubmit:Bn,onSteer:V[37]||(V[37]=le=>i("steer",le)),onCommand:V[38]||(V[38]=le=>i("command",le)),onInterrupt:Wt,onSetPermission:V[39]||(V[39]=le=>i("setPermission",le)),onSetThinking:V[40]||(V[40]=le=>i("setThinking",le)),onTogglePlan:V[41]||(V[41]=le=>i("togglePlan")),onToggleSwarm:V[42]||(V[42]=le=>i("toggleSwarm")),onOpenBtw:V[43]||(V[43]=le=>i("command","/btw")),onCompact:V[44]||(V[44]=le=>i("compact")),onPickModel:V[45]||(V[45]=le=>i("pickModel")),onSelectModel:V[46]||(V[46]=le=>i("selectModel",le))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","activation-badges","models","starred-ids","skills","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"]))]),ve(Fa,{name:"pill"},{default:Fe(()=>[fe.value?(x(),E("button",{key:0,class:"newmsg-pill",style:Jt({bottom:`${ue.value+12}px`}),"aria-label":A(s)("conversation.jumpToLatestAria"),onClick:V[47]||(V[47]=le=>Qe(!0))},[ve(et,{class:"pill-chevron",name:"chevron-down",size:"md"}),tt(" "+B(A(s)("conversation.newMessages")),1)],12,Che)):ge("",!0)]),_:1}),ve(Fa,{name:"abort-toast"},{default:Fe(()=>[Ue.value?(x(),E("div",Ahe,[S("span",Mhe,B(A(s)("conversation.manuallyAborted")),1)])):ge("",!0)]),_:1})],2))}}),Ihe=dt(Nhe,[["__scopeId","data-v-1da4f3e0"]]),Lhe=["aria-selected","onClick"],$he=Xe({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(x(),E("div",{class:He(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),E(De,null,rt(e.options,i=>(x(),E("button",{key:i.value,class:He(["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)},B(i.label),11,Lhe))),128))],2))}}),ro=dt($he,[["__scopeId","data-v-67c67fe2"]]),Fhe={class:"ui-panel-header__title"},Ohe={key:0,class:"ui-panel-header__sub"},Rhe=Xe({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),E("div",{class:He(["ui-panel-header",{wrap:e.wrap}])},[S("span",Fhe,B(e.title),1),ve(en,{text:e.subtitle},{default:Fe(()=>[e.subtitle?(x(),E("span",Ohe,B(e.subtitle),1)):ge("",!0)]),_:1},8,["text"]),Rn(t.$slots,"default",{},void 0,!0),e.closable?(x(),Ae(Wn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Fe(()=>[ve(et,{name:"close",size:"sm"})]),_:1},8,["label"])):ge("",!0)],2))}}),Ha=dt(Rhe,[["__scopeId","data-v-62b5f713"]]),Bhe={key:0,class:"fp-empty fp-error"},Dhe={key:1,class:"fp-empty"},Phe={key:2,class:"fp-loading"},Hhe={class:"fp-path"},Whe={class:"fp-meta"},zhe={key:0,class:"fp-lines"},Uhe={class:"fp-size"},qhe={key:3,class:"fp-search"},jhe=["placeholder"],Vhe={key:0,class:"fp-search-count"},Khe=["href","aria-label"],Ghe={key:1,class:"fp-code"},Yhe={class:"fp-line-table"},Zhe=["data-line"],Xhe={class:"fp-gutter"},Qhe=["innerHTML"],Jhe={key:1,class:"fp-body fp-code"},epe={class:"fp-line-table"},tpe=["data-line"],npe={class:"fp-gutter"},spe=["innerHTML"],ope={key:2,class:"fp-body"},ipe=["srcdoc","title"],rpe={key:1,class:"fp-code"},lpe={class:"fp-line-table"},ape=["data-line"],cpe={class:"fp-gutter"},upe=["innerHTML"],dpe={key:3,class:"fp-body fp-pdf-wrap"},fpe=["src","title"],hpe={key:1,class:"fp-binary-card"},ppe={class:"fp-binary-label"},mpe={key:4,class:"fp-body fp-table-wrap"},gpe={class:"fp-table"},vpe=["data-line"],ype={key:5,class:"fp-body fp-image-wrap"},kpe=["src","alt"],bpe={key:1,class:"fp-binary-card"},xpe={class:"fp-binary-icon"},wpe={class:"fp-binary-label"},_pe={key:6,class:"fp-body fp-image-wrap"},Spe=["src"],Cpe={key:1,class:"fp-binary-card"},Ape={class:"fp-binary-icon"},Mpe={class:"fp-binary-label"},Epe={key:7,class:"fp-body fp-code"},Tpe={class:"fp-line-table"},Npe=["data-line"],Ipe={class:"fp-gutter"},Lpe=["innerHTML"],$pe={key:8,class:"fp-body fp-binary-wrap"},Fpe={class:"fp-binary-card"},Ope={class:"fp-binary-icon"},Rpe={class:"fp-binary-label"},Bpe=Xe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Ot();function s(ue,Y){const Q=Y?Y.split("/").filter(Boolean):[];for(const P of ue.split("/"))P===""||P==="."||(P===".."?Q.pop():Q.push(P));return Q.join("/")}const o=jt("resolveImage",async ue=>ue),i=D(()=>{const ue=c.file?.path??"",Y=ue.lastIndexOf("/");return Y>0?ue.slice(0,Y):""});function r(ue){if(/^(https?:|data:|blob:)/i.test(ue)||ue.startsWith("/"))return ue;const Y=i.value;return Y?s(ue,Y):ue}async function l(ue){const Y=r(ue);return o?o(Y):Y}wn("resolveImage",l);function a(ue){let Y=ue.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(Y)||Y.startsWith("/"))return ue;for(const P of["#","?"]){const G=Y.indexOf(P);G!==-1&&(Y=Y.slice(0,G))}const Q=i.value;return{...ue,path:s(Y,Q)}}const c=e,u=t;function d(ue){c.openFile?.(a(ue))}const f=se(null),h=D(()=>{const ue=c.file;if(!ue)return"binary";const Y=ue.mime??"",Q=ue.languageId??"",P=ue.path.toLowerCase();return Y==="text/markdown"||Q==="markdown"||Q==="md"||P.endsWith(".mdx")?"markdown":Y==="application/json"||Q==="json"?"json":Y==="text/html"||Q==="html"||P.endsWith(".html")||P.endsWith(".htm")?"html":Y==="application/pdf"||P.endsWith(".pdf")?"pdf":Y==="text/csv"||Q==="csv"||P.endsWith(".csv")?"csv":Y.startsWith("image/")?"image":Y.startsWith("video/")?"video":ue.isBinary?"binary":Y.startsWith("text/")||Q!==""?"text":"binary"});function p(ue){const Y=atob(ue),Q=Uint8Array.from(Y,P=>P.charCodeAt(0));return new TextDecoder().decode(Q)}const m=D(()=>{const ue=c.file;if(!ue)return"";if(ue.encoding==="base64")try{return p(ue.content)}catch{return ue.content}return ue.content}),y=D(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=D(()=>c.file?(h.value==="json"?y.value:m.value).split(`
|
|
313
|
+
`):[]),g=D(()=>c.file?h.value==="json"?y.value:m.value:""),v=se(""),b=se(0),C=D(()=>{const ue=v.value.trim().toLowerCase();if(!ue)return[];const Y=[];return k.value.forEach((Q,P)=>{Q.toLowerCase().includes(ue)&&Y.push(P+1)}),Y});Je(v,()=>{b.value=0});function I(ue,Y=!1){ue&&yt(()=>{const Q=f.value?.querySelector(".fp-body"),P=Q?.querySelector(`[data-line="${ue}"]`);if(!Q||!P)return;Y&&(Q.scrollTop=0);const G=Q.getBoundingClientRect(),ye=P.getBoundingClientRect(),he=ye.top-G.top+Q.scrollTop;Q.scrollTop=he-Q.clientHeight/2+ye.height/2})}Je(()=>[c.file?.path,c.line],()=>I(c.line,!0),{immediate:!0});function T(ue){const Y=C.value;Y.length!==0&&(b.value=(b.value+ue+Y.length)%Y.length,I(Y[b.value]))}function M(ue){const Y=C.value;return{target:c.line===ue,hit:Y.includes(ue),active:Y[b.value]===ue}}function $(ue){return ue<1024?`${ue} B`:ue<1024*1024?`${(ue/1024).toFixed(1)} KB`:`${(ue/(1024*1024)).toFixed(1)} MB`}const N=se(!1),F=se(!1);function _(){c.file&&Hs(g.value).then(ue=>{ue&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function R(){c.file&&Hs(c.file.path).then(ue=>{ue&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const z=se("preview"),W=se("preview"),L=se("fit");function O(ue){z.value=ue}function q(ue){W.value=ue}function X(ue){L.value=ue}Je(h,ue=>{z.value=ue==="html"?"preview":"source",W.value="preview",L.value="fit"});const ie=D(()=>{const ue=c.file;return!ue||h.value!=="image"?null:ue.sourceUrl?ue.sourceUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:ue.mime==="image/svg+xml"?`data:${ue.mime};charset=utf-8,${encodeURIComponent(ue.content)}`:null}),U=D(()=>{const ue=c.file;return!ue||h.value!=="video"?null:ue.sourceUrl?ue.sourceUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:null}),j=D(()=>{const ue=c.file;return!ue||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:null}),te=D(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function ae(ue){const Y=[];let Q="",P=!1;for(let G=0;G<ue.length;G++){const ye=ue[G];ye==='"'&&ue[G+1]==='"'?(Q+='"',G++):ye==='"'?P=!P:ye===","&&!P?(Y.push(Q),Q=""):Q+=ye}return Y.push(Q),Y}const oe=D(()=>k.value.slice(0,200).map(ae));function re(ue){return ue.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function xe(){const ue=c.file;if(!ue)return"";const Y=ue.languageId?.toLowerCase();return Y||(ue.path.split(".").pop()?.toLowerCase()??"")}function pe(ue){const Y=xe();let Q=re(ue);return h.value==="json"||Y==="json"||Y==="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"||Y==="html"||Y==="xml"||Y==="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 Ee(ue,Y=55){return!ue||ue.length<=Y?ue:"…"+ue.slice(ue.length-Y+1)}return(ue,Y)=>(x(),E("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),E("div",Bhe,[S("span",null,B(e.error),1),e.closable?(x(),Ae(Kt,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=Q=>u("close"))},{default:Fe(()=>[tt(B(A(n)("filePreview.close")),1)]),_:1})):ge("",!0)])):!e.file&&!e.loading?(x(),E("div",Dhe,B(A(n)("filePreview.empty")),1)):e.loading?(x(),E("div",Phe,[Y[7]||(Y[7]=S("span",{class:"spinner"},null,-1)),S("span",null,B(A(n)("filePreview.loading")),1)])):e.file?(x(),E(De,{key:3},[ve(Ha,{wrap:"",title:A(n)("common.preview"),closable:e.closable,"close-label":A(n)("filePreview.close"),onClose:Y[6]||(Y[6]=Q=>u("close"))},{default:Fe(()=>[ve(en,{text:e.file.path},{default:Fe(()=>[S("span",Hhe,B(Ee(e.file.path)),1)]),_:1},8,["text"]),S("span",Whe,[e.file.lineCount?(x(),E("span",zhe,B(A(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ge("",!0),S("span",Uhe,B($(e.file.size)),1)]),h.value==="html"?(x(),Ae(ro,{key:0,"model-value":z.value,size:"sm",options:[{value:"preview",label:A(n)("filePreview.preview")},{value:"source",label:A(n)("filePreview.source")}],"onUpdate:modelValue":O},null,8,["model-value","options"])):ge("",!0),h.value==="markdown"?(x(),Ae(ro,{key:1,"model-value":W.value,size:"sm",options:[{value:"preview",label:A(n)("filePreview.preview")},{value:"source",label:A(n)("filePreview.source")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):ge("",!0),h.value==="image"?(x(),Ae(ro,{key:2,"model-value":L.value,size:"sm",options:[{value:"fit",label:A(n)("filePreview.fit")},{value:"actual",label:A(n)("filePreview.actual")}],"onUpdate:modelValue":X},null,8,["model-value","options"])):ge("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),E("div",qhe,[Fn(S("input",{"onUpdate:modelValue":Y[1]||(Y[1]=Q=>v.value=Q),class:"fp-search-input",type:"search",placeholder:A(n)("filePreview.search")},null,8,jhe),[[po,v.value]]),v.value.trim()?(x(),E("span",Vhe,B(C.value.length),1)):ge("",!0),ve(Wn,{size:"sm",disabled:C.value.length===0,label:A(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=Q=>T(-1))},{default:Fe(()=>[ve(et,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ve(Wn,{size:"sm",disabled:C.value.length===0,label:A(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=Q=>T(1))},{default:Fe(()=>[ve(et,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ge("",!0),ve(Wn,{size:"sm",class:He({copied:F.value}),label:F.value?A(n)("filePreview.copied"):A(n)("filePreview.copyPath"),onClick:R},{default:Fe(()=>[F.value?(x(),Ae(et,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Ae(et,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),Ae(Wn,{key:4,size:"sm",label:A(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=Q=>u("openExternal"))},{default:Fe(()=>[ve(et,{name:"external-link",size:"md"})]),_:1},8,["label"])):ge("",!0),e.externalActions?(x(),Ae(Wn,{key:5,size:"sm",label:A(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=Q=>u("reveal"))},{default:Fe(()=>[ve(et,{name:"folder",size:"md"})]),_:1},8,["label"])):ge("",!0),e.downloadUrl?(x(),E("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":A(n)("filePreview.download")},[ve(et,{name:"download",size:"md"})],8,Khe)):ge("",!0),!e.file.isBinary&&h.value!=="image"?(x(),Ae(Wn,{key:7,size:"sm",class:He({copied:N.value}),label:N.value?A(n)("filePreview.copied"):A(n)("filePreview.copy"),onClick:_},{default:Fe(()=>[N.value?(x(),Ae(et,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Ae(et,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ge("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),E("div",{key:0,class:He(["fp-body",{"fp-markdown":W.value==="preview"}])},[W.value==="preview"?(x(),Ae(H1,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),E("div",Ghe,[S("div",Yhe,[(x(!0),E(De,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:He(["fp-line-row",M(P+1)]),"data-line":P+1},[S("span",Xhe,B(P+1),1),S("span",{class:"fp-line-text",innerHTML:pe(Q)},null,8,Qhe)],10,Zhe))),128))])]))],2)):h.value==="json"?(x(),E("div",Jhe,[S("div",epe,[(x(!0),E(De,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:He(["fp-line-row",M(P+1)]),"data-line":P+1},[S("span",npe,B(P+1),1),S("span",{class:"fp-line-text",innerHTML:pe(Q)},null,8,spe)],10,tpe))),128))])])):h.value==="html"?(x(),E("div",ope,[z.value==="preview"?(x(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:te.value,title:e.file.path},null,8,ipe)):(x(),E("div",rpe,[S("div",lpe,[(x(!0),E(De,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:He(["fp-line-row",M(P+1)]),"data-line":P+1},[S("span",cpe,B(P+1),1),S("span",{class:"fp-line-text",innerHTML:pe(Q)},null,8,upe)],10,ape))),128))])]))])):h.value==="pdf"?(x(),E("div",dpe,[j.value?(x(),E("iframe",{key:0,class:"fp-pdf-frame",src:j.value,title:e.file.path},null,8,fpe)):(x(),E("div",hpe,[S("span",ppe,B(A(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),E("div",mpe,[S("table",gpe,[S("tbody",null,[(x(!0),E(De,null,rt(oe.value,(Q,P)=>(x(),E("tr",{key:P,class:He(M(P+1)),"data-line":P+1},[S("th",null,B(P+1),1),(x(!0),E(De,null,rt(Q,(G,ye)=>(x(),E("td",{key:ye},B(G),1))),128))],10,vpe))),128))])])])):h.value==="image"?(x(),E("div",ype,[ie.value?(x(),E("img",{key:0,src:ie.value,alt:e.file.path,class:He(["fp-image",{actual:L.value==="actual"}])},null,10,kpe)):(x(),E("div",bpe,[S("span",xpe,[ve(et,{name:"image-off",size:"lg"})]),S("span",wpe,B(A(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="video"?(x(),E("div",_pe,[U.value?(x(),E("video",{key:0,src:U.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,Spe)):(x(),E("div",Cpe,[S("span",Ape,[ve(et,{name:"image-off",size:"lg"})]),S("span",Mpe,B(A(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="text"?(x(),E("div",Epe,[S("div",Tpe,[(x(!0),E(De,null,rt(k.value,(Q,P)=>(x(),E("div",{key:P,class:He(["fp-line-row",M(P+1)]),"data-line":P+1},[S("span",Ipe,B(P+1),1),S("span",{class:"fp-line-text",innerHTML:pe(Q)},null,8,Lpe)],10,Npe))),128))])])):(x(),E("div",$pe,[S("div",Fpe,[S("span",Ope,[ve(et,{name:"file-off",size:"lg"})]),S("span",Rpe,B(A(n)("filePreview.binaryNoPreview",{mime:e.file.mime||A(n)("filePreview.unknownType"),size:$(e.file.size)})),1)])]))],64)):ge("",!0)],512))}}),Dpe=dt(Bpe,[["__scopeId","data-v-b4f28f25"]]),Ppe={class:"tp"},Hpe=Xe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=se(null);return Je(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||yt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),E("div",Ppe,[ve(Ha,{title:A(o)("common.preview"),subtitle:e.subtitle??A(o)("thinking.panelTitle"),"close-label":A(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),S("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},B(e.text),513)]))}}),w3=dt(Hpe,[["__scopeId","data-v-98fe6e80"]]),Wpe={class:"ap"},zpe={key:0,class:"ap-type"},Upe={key:1,class:"ap-reason"},qpe={key:2,class:"ap-field"},jpe={class:"ap-field-body"},Vpe={key:3,class:"ap-field"},Kpe={class:"ap-field-body ap-live"},Gpe={key:4,class:"ap-field"},Ype={class:"ap-field-body ap-progress"},Zpe={key:0,class:"ap-call"},Xpe={key:1,class:"ap-output"},Qpe=["onClick"],Jpe={key:5,class:"ap-field"},eme={class:"ap-field-body"},tme=8,_3=5,S3=2,nme=Xe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const y=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},y.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},y.push(k));return y}const a=D(()=>l(i.value)),c=se(new Set);function u(m){return c.value.has(m)}function d(m){const y=new Set(c.value);y.has(m)?y.delete(m):y.add(m),c.value=y}function f(m){return m.output.length-_3-S3}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=se(null);return Je(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||yt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,y)=>(x(),E("div",Wpe,[ve(Ha,{title:A(o)("common.preview"),subtitle:e.member.name,"close-label":A(o)("thinking.close"),onClose:y[0]||(y[0]=k=>s("close"))},{default:Fe(()=>[ve(Ji,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Fe(()=>[tt(B(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),S("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),E("div",zpe,B(e.member.subagentType),1)):ge("",!0),e.member.suspendedReason?(x(),E("div",Upe,B(e.member.suspendedReason),1)):ge("",!0),e.member.prompt?(x(),E("div",qpe,[y[1]||(y[1]=S("span",{class:"ap-field-label"},"Task",-1)),S("div",jpe,B(e.member.prompt),1)])):ge("",!0),r.value?(x(),E("div",Vpe,[y[2]||(y[2]=S("span",{class:"ap-field-label"},"Output",-1)),S("div",Kpe,B(r.value),1)])):ge("",!0),a.value.length>0?(x(),E("div",Gpe,[y[4]||(y[4]=S("span",{class:"ap-field-label"},"Progress",-1)),S("div",Ype,[(x(!0),E(De,null,rt(a.value,k=>(x(),E("div",{key:k.key,class:"ap-group"},[k.call?(x(),E("div",Zpe,[y[3]||(y[3]=S("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),tt(" "+B(k.call),1)])):ge("",!0),k.output.length>0?(x(),E("div",Xpe,[k.output.length<=tme||u(k.key)?(x(!0),E(De,{key:0},rt(k.output,(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},B(g),1))),128)):(x(),E(De,{key:1},[(x(!0),E(De,null,rt(k.output.slice(0,_3),(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},B(g),1))),128)),S("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+B(f(k))+" more) ",9,Qpe),(x(!0),E(De,null,rt(k.output.slice(-S3),(g,v)=>(x(),E("div",{key:"t"+v,class:"ap-out-line"},B(g),1))),128))],64))])):ge("",!0)]))),128))])])):ge("",!0),e.member.summary?(x(),E("div",Jpe,[y[5]||(y[5]=S("span",{class:"ap-field-label"},"Result",-1)),S("div",eme,B(e.member.summary),1)])):ge("",!0)],512)]))}}),sme=dt(nme,[["__scopeId","data-v-6f6dc328"]]),ome={class:"diff-lines"},ime={key:0,class:"hunk-text"},rme={class:"dl-gutter old"},lme={class:"dl-gutter new"},ame={class:"dl-sign"},cme={class:"dl-text"},ume=Xe({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(x(),E("div",ome,[(x(!0),E(De,null,rt(e.lines,(r,l)=>(x(),E("div",{key:l,class:He(["dl",s(r)])},[r.type==="hunk"?(x(),E("span",ime,B(r.text),1)):(x(),E(De,{key:1},[S("span",rme,B(t(r)),1),S("span",lme,B(n(r)),1),S("span",ame,B(r.type==="add"?"+":r.type==="del"?"-":" "),1),S("span",cme,B(r.text),1)],64))],2))),128))]))}}),HE=dt(ume,[["__scopeId","data-v-ceae1af5"]]),dme={class:"tdp"},fme={class:"tdp-body"},hme={key:1,class:"tdp-output"},pme={key:2,class:"tdp-empty"},mme=Xe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Ot();return(o,i)=>(x(),E("div",dme,[ve(Ha,{title:e.target.title,subtitle:e.target.path,"close-label":A(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),S("div",fme,[e.target.lines&&e.target.lines.length>0?(x(),Ae(HE,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),E("div",hme,[(x(!0),E(De,null,rt(e.target.output,(r,l)=>(x(),E("div",{key:l},B(r),1))),128))])):(x(),E("div",pme,B(A(s)("diff.noDiff")),1))])]))}}),gme=dt(mme,[["__scopeId","data-v-567c17f4"]]),vme={class:"sc"},yme={key:0,class:"sc-empty"},kme={key:2,class:"sc-loading","aria-hidden":"true"},bme={class:"sc-composer"},xme=["placeholder"],wme=["disabled"],_me=Xe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot(),i=D(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=D(()=>n.title?.trim()||o("sideChat.title")),l=D(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=se(""),c=se(null),u=se(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",yt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const h=D(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,b=g.tools?.reduce((C,I)=>C+I.name.length+(I.arg?.length??0)+(I.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${b}`});Je(h,async()=>{!n.running&&!n.sending||(await yt(),f())});const p=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function y(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(x(),E("div",vme,[ve(Ha,{title:r.value,subtitle:l.value,"close-label":A(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),S("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),E("div",yme,B(A(o)("sideChat.empty")),1)):(x(),Ae(ME,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(x(),E("div",kme,[ve(CE)])):ge("",!0)],512),S("div",bme,[Fn(S("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:A(o)("sideChat.placeholder"),onInput:y,onKeydown:m},null,40,xme),[[po,a.value]]),ve(en,{text:A(o)("sideChat.send")},{default:Fe(()=>[S("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ve(et,{name:"arrow-right",size:"sm"})],8,wme)]),_:1},8,["text"])])]))}}),Sme=dt(_me,[["__scopeId","data-v-142addaa"]]),Cme={class:"changes-pane"},Ame={class:"dv-path"},Mme={class:"diff-head"},Eme={class:"back-label"},Tme={key:0,class:"empty-state"},Nme={key:1,class:"dv-lines-wrap"},Ime={key:2,class:"empty-state"},Lme={class:"dv-change-count"},$me={class:"ch-head"},Fme={class:"br-label"},Ome={class:"br-name"},Rme={key:0,class:"sync-info"},Bme={key:0,class:"ahead"},Dme={key:0,class:"behind"},Pme={key:1,class:"empty-head"},Hme={key:0,class:"ch-list"},Wme=["onClick"],zme={class:"fpath"},Ume={key:1,class:"ch-list ch-tree"},qme={class:"tree-list"},jme=["onClick"],Vme={class:"tree-name"},Kme=["onClick"],Gme={class:"tree-name"},Yme={key:2,class:"empty-state"},Zme={key:3,class:"empty-state"},Xme=Xe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t;function i(F){const _=F.toLowerCase();return _==="modified"?"modified":_==="added"?"added":_==="deleted"?"deleted":_==="renamed"?"renamed":_==="untracked"?"untracked":_==="conflicted"?"conflicted":_==="ignored"?"ignored":_==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,_=60){return F.length<=_?F:"…"+F.slice(F.length-_+1)}const c=D(()=>s.gitInfo!==null),u=D(()=>s.changes.length>0),d=D(()=>(s.selectedDiffPath??null)!==null),f=D(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=D(()=>s.fileDiff??[]),p=D(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function y(){o("back")}function k(){o("close")}const g=se("list");function v(F){g.value=F}function b(F){const _={children:[]},R=[...F].sort((z,W)=>z.path.localeCompare(W.path));for(const z of R){const W=z.path.split("/");let L=_;for(let O=0;O<W.length;O++){const q=W[O],X=O===W.length-1,ie=W.slice(0,O+1).join("/");let U=L.children.find(j=>j.name===q&&j.kind===(X?"file":"folder"));U||(U={name:q,path:ie,kind:X?"file":"folder",status:X?z.status:void 0,children:[]},L.children.push(U)),L=U}}return _.children}const C=D(()=>b(s.changes)),I=se(new Set);function T(F){return!I.value.has(F)}const M=D(()=>{const F=[];function _(R,z){for(const W of R)F.push({node:W,depth:z}),W.kind==="folder"&&T(W.path)&&_(W.children,z+1)}return _(C.value,0),F});function $(F){const _=new Set(I.value);_.has(F.path)?_.delete(F.path):_.add(F.path),I.value=_}function N(F){return`${16+F*16}px`}return(F,_)=>(x(),E("div",Cme,[f.value?(x(),E(De,{key:0},[ve(Ha,{title:A(n)("diff.title"),closable:e.closable,"close-label":A(n)("diff.close"),onClose:k},{default:Fe(()=>[ve(en,{text:e.selectedDiffPath??""},{default:Fe(()=>[S("span",Ame,B(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),S("div",Mme,[e.hideBack?ge("",!0):(x(),Ae(Kt,{key:0,variant:"ghost",size:"sm",onClick:y},{default:Fe(()=>[_[0]||(_[0]=S("span",{"aria-hidden":"true"},"←",-1)),S("span",Eme,B(A(n)("diff.back")),1)]),_:1}))]),p.value?(x(),E("div",Tme,B(A(n)("diff.loading")),1)):h.value.length>0?(x(),E("div",Nme,[ve(HE,{lines:h.value},null,8,["lines"])])):(x(),E("div",Ime,B(A(n)("diff.noDiff")),1))],64)):(x(),E(De,{key:1},[ve(Ha,{title:A(n)("diff.title"),closable:e.closable,"close-label":A(n)("diff.close"),onClose:k},{default:Fe(()=>[S("span",Lme,B(A(n)("diff.changeCount",{count:e.changes.length})),1),ve(ro,{"model-value":g.value,size:"sm",options:[{value:"list",label:A(n)("diff.list")},{value:"tree",label:A(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),S("div",$me,[c.value?(x(),E(De,{key:0},[S("span",Fme,B(A(n)("diff.branch")),1),S("span",Ome,B(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),E("span",Rme,[ve(en,{text:A(n)("diff.aheadTitle")},{default:Fe(()=>[e.gitInfo.ahead>0?(x(),E("span",Bme,"↑"+B(e.gitInfo.ahead),1)):ge("",!0)]),_:1},8,["text"]),ve(en,{text:A(n)("diff.behindTitle")},{default:Fe(()=>[e.gitInfo.behind>0?(x(),E("span",Dme,"↓"+B(e.gitInfo.behind),1)):ge("",!0)]),_:1},8,["text"])])):ge("",!0)],64)):(x(),E("span",Pme,B(A(n)("diff.empty")),1))]),u.value&&g.value==="list"?(x(),E("div",Hme,[(x(!0),E(De,null,rt(e.changes,R=>(x(),Ae(en,{key:R.path,text:R.path},{default:Fe(()=>[S("button",{type:"button",class:"ch-row",onClick:z=>m(R.path)},[S("span",{class:He(["badge",i(R.status)])},B(l(R.status)),3),S("span",zme,B(a(R.path)),1)],8,Wme)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(x(),E("div",Ume,[S("ul",qme,[(x(!0),E(De,null,rt(M.value,({node:R,depth:z})=>(x(),E("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(x(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:Jt({paddingLeft:N(z)}),onClick:W=>$(R)},[ve(et,{class:"tree-icon",name:"folder-solid",size:"sm"}),S("span",Vme,B(R.name),1)],12,jme)):(x(),Ae(en,{key:1,text:R.path},{default:Fe(()=>[S("button",{type:"button",class:"tree-row tree-file",style:Jt({paddingLeft:N(z)}),onClick:W=>m(R.path)},[S("span",{class:He(["badge",i(R.status)])},B(l(R.status)),3),S("span",Gme,B(R.name),1)],12,Kme)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),E("div",Yme,B(A(n)("diff.clean")),1)):(x(),E("div",Zme,B(A(n)("diff.empty")),1))],64))]))}}),Qme=dt(Xme,[["__scopeId","data-v-335a33c8"]]);function X2(e,t){let n=null;mn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,yt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),Qn(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const Jme=["type","value","placeholder","disabled","readonly"],e1e=Xe({__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=se();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(x(),E("input",{ref_key:"el",ref:o,class:He(["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,Jme))}}),G1=dt(e1e,[["__scopeId","data-v-479f73c4"]]),t1e={class:"search-wrap"},n1e={key:0,class:"tab-strip"},s1e={key:1,class:"state-row"},o1e={key:2,class:"state-row unavail"},i1e={key:3,class:"model-list"},r1e=["aria-selected","onClick","onMouseenter"],l1e={class:"check"},a1e={class:"model-main"},c1e={class:"model-name"},u1e={class:"model-id"},d1e={key:0,class:"caps"},f1e={class:"model-provider"},h1e={class:"model-ctx"},p1e={key:0,class:"empty"},m1e={class:"footer-hint"},g1e=Xe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=D(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=se(""),a=se(null),c=se(null),u=se("all");X2(c,a);const d=D(()=>{const v=new Set,b=[{id:"all",label:n("model.allTab")}];for(const C of s.models)v.has(C.provider)||(v.add(C.provider),b.push({id:C.provider,label:C.provider}));return b}),f=D(()=>{const v=l.value.toLowerCase().trim(),b=s.models.filter(C=>{if(u.value!=="all"&&C.provider!==u.value)return!1;const I=(C.displayName??C.model).toLowerCase().includes(v),T=C.provider.toLowerCase().includes(v),M=C.id.toLowerCase().includes(v);return!v||I||T||M});return u.value!=="all"?b:b.sort((C,I)=>{const T=r(C.id)?1:0;return(r(I.id)?1:0)-T})}),h=D(()=>f.value),p=se(0);Je([l,u],()=>{p.value=0}),Je(d,v=>{v.some(b=>b.id===u.value)||(u.value="all")}),Je(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 b=h.value[p.value];b&&o("select",b.id)}}mn(()=>{document.addEventListener("keydown",m)}),Cn(()=>{document.removeEventListener("keydown",m)});function y(v){o("select",v)}function k(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,b)=>(x(),Ae(Hr,{open:!0,"close-on-esc":!1,title:A(n)("model.title"),size:"xl",height:"fixed",onClose:b[1]||(b[1]=C=>o("close"))},{default:Fe(()=>[S("div",{ref_key:"dialogRef",ref:c,class:"mp"},[S("div",t1e,[ve(G1,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=C=>l.value=C),placeholder:A(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),E("div",n1e,[(x(!0),E(De,null,rt(d.value,C=>(x(),Ae(Kt,{key:C.id,variant:C.id===u.value?"secondary":"ghost",size:"sm",onClick:I=>g(C.id)},{default:Fe(()=>[tt(B(C.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ge("",!0),e.loading?(x(),E("div",s1e,[ve($o,{size:"sm"}),S("span",null,B(A(n)("model.loading")),1)])):e.unavailable?(x(),E("div",o1e,[ve(et,{name:"alert-triangle",size:"lg"}),S("span",null,B(A(n)("model.unavailable")),1)])):(x(),E("div",i1e,[(x(!0),E(De,null,rt(h.value,C=>(x(),E("div",{key:C.id,class:He(["model-row",{"is-current":C.id===e.current,"is-selected":k(C)===p.value}]),role:"option","aria-selected":C.id===e.current,onClick:I=>y(C.id),onMouseenter:I=>p.value=k(C)},[S("span",l1e,[C.id===e.current?(x(),Ae(et,{key:0,name:"check",size:"sm"})):ge("",!0)]),S("span",a1e,[S("span",c1e,B(C.displayName??C.model),1),S("span",u1e,B(C.id),1),C.capabilities&&C.capabilities.length>0?(x(),E("span",d1e,[(x(!0),E(De,null,rt(C.capabilities,I=>(x(),Ae(Ji,{key:I,variant:"info",size:"sm"},{default:Fe(()=>[tt(B(I),1)]),_:2},1024))),128))])):ge("",!0)]),S("span",f1e,B(C.provider),1),S("span",h1e,B(A(n)("model.contextSuffix",{size:A(Br)(C.maxContextSize)})),1),ve(Wn,{size:"sm",label:r(C.id)?A(n)("model.unstarTitle"):A(n)("model.starTitle"),onClick:Mt(I=>o("toggle-star",C.id),["stop"])},{default:Fe(()=>[r(C.id)?(x(),Ae(et,{key:0,name:"star",size:"md"})):(x(),Ae(et,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,r1e))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),E("div",p1e,B(s.models.length===0?A(n)("model.emptyNoModels"):A(n)("model.emptyNoMatch")),1)):ge("",!0)])),S("div",m1e,B(A(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),v1e=dt(g1e,[["__scopeId","data-v-0d8e0be0"]]),y1e={key:0,class:"ui-field__label"},k1e={key:1,class:"ui-field__error"},b1e={key:2,class:"ui-field__hint"},x1e=Xe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),E("div",{class:He(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),E("label",y1e,B(e.label),1)):ge("",!0),Rn(t.$slots,"default",{},void 0,!0),e.error?(x(),E("span",k1e,B(e.error),1)):e.hint?(x(),E("span",b1e,B(e.hint),1)):ge("",!0)],2))}}),w1e=dt(x1e,[["__scopeId","data-v-3b312583"]]),_1e={class:"prov-list"},S1e={key:0,class:"state-row"},C1e={key:1,class:"state-row unavail"},A1e={key:2,class:"empty"},M1e={class:"prov-info"},E1e={class:"prov-type"},T1e={key:0,class:"prov-url"},N1e={class:"prov-meta"},I1e={key:0},L1e={class:"prov-actions"},$1e={key:0,class:"add-section"},F1e={class:"add-form"},O1e={key:0,class:"add-error"},R1e={class:"form-btns"},B1e={class:"footer-hint"},D1e=Xe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["loginApiKey","refresh","logout","openLogin","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=se(null);X2(s);const o=t,i=se(!1),r=Ts({providerId:"",apiKey:""}),l=se("");function a(p){r.providerId=p,r.apiKey="",l.value="",i.value=!0}function c(){i.value=!1}function u(){if(!r.apiKey.trim()){l.value=n("providers.apiKeyRequired");return}l.value="",o("loginApiKey",{providerId:r.providerId,value:r.apiKey.trim()}),i.value=!1}function d(p){if(p.key==="Escape"){if(i.value){c();return}o("close")}}mn(()=>document.addEventListener("keydown",d)),Cn(()=>document.removeEventListener("keydown",d));function f(p){return p==="connected"?"var(--color-success)":p==="error"?"var(--color-danger)":"var(--color-text-faint)"}function h(p){return n(p==="connected"?"providers.status.connected":p==="error"?"providers.status.error":"providers.status.unconfigured")}return(p,m)=>(x(),Ae(Hr,{open:!0,"close-on-esc":!1,title:A(n)("providers.title"),size:"xl",height:"fixed",onClose:m[1]||(m[1]=y=>o("close"))},{default:Fe(()=>[S("div",{ref_key:"dialogRef",ref:s,class:"pm"},[S("div",_1e,[e.loading?(x(),E("div",S1e,[ve($o,{size:"sm"}),S("span",null,B(A(n)("providers.loading")),1)])):e.unavailable?(x(),E("div",C1e,[ve(et,{name:"alert-triangle",size:"md"}),S("span",null,B(A(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),E("div",A1e,B(A(n)("providers.empty")),1)):(x(!0),E(De,{key:3},rt(e.providers,y=>(x(),E("div",{key:y.id,class:"prov-row"},[ve(en,{text:h(y.status)},{default:Fe(()=>[S("span",{class:He(["status-dot",{"status-dot--empty":y.status!=="connected"&&y.status!=="error"}]),style:Jt(y.status==="connected"||y.status==="error"?{background:f(y.status)}:void 0)},null,6)]),_:2},1032,["text"]),S("div",M1e,[S("span",E1e,B(y.name),1),y.baseUrl?(x(),E("span",T1e,B(y.baseUrl),1)):ge("",!0),S("span",N1e,[ve(Ji,{variant:y.status==="connected"?"success":"neutral",size:"sm"},{default:Fe(()=>[tt(B(y.credentialType??A(n)("providers.notConnected")),1)]),_:2},1032,["variant"]),y.models&&y.models.length>0?(x(),E("span",I1e," · "+B(A(n)("providers.modelCount",{count:y.models.length})),1)):ge("",!0)])]),S("div",L1e,[y.status!=="connected"&&y.authMethods.includes("oauth")?(x(),Ae(Kt,{key:0,variant:"primary",size:"sm",onClick:k=>o("openLogin",y.id)},{default:Fe(()=>[tt(B(A(n)("providers.signIn")),1)]),_:1},8,["onClick"])):ge("",!0),y.status!=="connected"&&y.authMethods.includes("api_key")?(x(),Ae(Kt,{key:1,variant:"secondary",size:"sm",onClick:k=>a(y.id)},{default:Fe(()=>[tt(B(A(n)("providers.enterApiKey")),1)]),_:1},8,["onClick"])):ge("",!0),ve(en,{text:A(n)("providers.refreshTitle",{type:y.name})},{default:Fe(()=>[ve(Kt,{variant:"secondary",size:"sm",onClick:k=>o("refresh",y.id)},{default:Fe(()=>[tt(B(A(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),y.status==="connected"?(x(),Ae(en,{key:2,text:A(n)("providers.logoutTitle",{type:y.name})},{default:Fe(()=>[ve(Kt,{variant:"danger-soft",size:"sm",onClick:k=>o("logout",y.id)},{default:Fe(()=>[tt(B(A(n)("providers.logout")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])):ge("",!0)])]))),128))]),!e.unavailable&&i.value?(x(),E("div",$1e,[S("template",null,[S("div",F1e,[ve(w1e,{label:`${e.providers.find(y=>y.id===r.providerId)?.name??r.providerId} · ${A(n)("providers.fieldApiKey")}`},{default:Fe(()=>[ve(G1,{modelValue:r.apiKey,"onUpdate:modelValue":m[0]||(m[0]=y=>r.apiKey=y),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),l.value?(x(),E("div",O1e,B(l.value),1)):ge("",!0),S("div",R1e,[ve(Kt,{variant:"primary",size:"sm",onClick:u},{default:Fe(()=>[tt(B(A(n)("providers.connect")),1)]),_:1}),ve(Kt,{variant:"secondary",size:"sm",onClick:c},{default:Fe(()=>[tt(B(A(n)("common.cancel")),1)]),_:1})])])])])):ge("",!0),S("div",B1e,B(A(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),P1e=dt(D1e,[["__scopeId","data-v-9db396a7"]]),H1e={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},W1e={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},z1e={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Sv=Xe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),E("svg",H1e,[...n[0]||(n[0]=[S("circle",{cx:"18",cy:"18",r:"15"},null,-1),S("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),E("svg",W1e,[...n[1]||(n[1]=[S("circle",{cx:"14",cy:"14",r:"12"},null,-1),S("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),S("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),E("svg",z1e,[...n[2]||(n[2]=[S("path",{d:"M14 3 L26 24 H2 Z"},null,-1),S("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),S("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),U1e={key:0,class:"center-body"},q1e={class:"center-text"},j1e={key:1,class:"nb"},V1e={class:"nb-lead"},K1e=["href"],G1e={class:"nb-or"},Y1e={class:"nb-fallback"},Z1e={class:"nb-fb-text"},X1e=["href"],Q1e={class:"nb-code-row"},J1e={class:"nb-code"},e0e={class:"nb-status"},t0e={class:"nb-status-text"},n0e={class:"nb-countdown"},s0e={key:2,class:"center-body"},o0e={class:"center-text success-text"},i0e={class:"center-hint"},r0e={class:"center-body"},l0e={class:"center-text err-text"},a0e={class:"center-hint"},c0e={class:"actions"},u0e={class:"center-body"},d0e={class:"center-text warn-text"},f0e={class:"center-hint"},h0e={class:"actions"},p0e=3,m0e=Xe({__name:"LoginDialog",props:{providerName:{},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=se(!0),o=t,i=e,r=se("starting"),l=se(!1),a=se(null),c=se(0),u=se(!1);let d=null,f=null,h=0;mn(async()=>{await p()}),Cn(()=>{k()});async function p(){k(),a.value=null,l.value=!1,h=0,r.value="starting";const I=await i.onStartOAuthLogin();if(!I){r.value="error";return}if(I.status==="authenticated"){k(),r.value="success",setTimeout(()=>{o("success"),o("close")},800);return}a.value={flowId:I.flowId,verificationUri:I.verificationUri,verificationUriComplete:I.verificationUriComplete,userCode:I.userCode,expiresIn:I.expiresIn,interval:I.interval},c.value=I.expiresIn,r.value="device-code",m(),y(I.interval)}function m(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function y(I){d&&clearTimeout(d),d=setTimeout(async()=>{const T=await i.onPollOAuthLogin();if(T===null){if(h+=1,h>=p0e){k(),l.value=!0,r.value="error";return}y(I);return}h=0,T.status==="authenticated"?(k(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):T.status==="expired"||T.status==="cancelled"?(k(),r.value="expired"):y(I)},I*1e3)}function k(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function g(){await p()}async function v(){!a.value||!await Hs(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function b(){k(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function C(I){const T=Math.floor(I/60),M=I%60;return`${T}:${String(M).padStart(2,"0")}`}return(I,T)=>(x(),Ae(Hr,{open:s.value,"onUpdate:open":T[0]||(T[0]=M=>s.value=M),title:A(n)("login.title",{provider:e.providerName}),"close-on-overlay":!1,onClose:b},{default:Fe(()=>[r.value==="starting"?(x(),E("div",U1e,[ve($o,{size:"md"}),S("span",q1e,B(A(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),E("div",j1e,[S("div",V1e,B(A(n)("login.lead")),1),S("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[tt(B(A(n)("login.authorizeInBrowser"))+" ",1),ve(et,{name:"external-link",size:"sm"})],8,K1e),S("div",G1e,B(A(n)("login.orDivider")),1),S("div",Y1e,[S("div",Z1e,[tt(B(A(n)("login.fallbackPrefix")),1),S("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},B(a.value.verificationUri),9,X1e),tt(B(A(n)("login.fallbackSuffix")),1)]),S("div",Q1e,[S("span",J1e,B(a.value.userCode),1),ve(Kt,{class:He(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:v},{default:Fe(()=>[u.value?(x(),E(De,{key:0},[ve(et,{name:"check",size:"sm"}),tt(" "+B(A(n)("login.copied")),1)],64)):(x(),E(De,{key:1},[ve(et,{name:"copy",size:"sm"}),tt(" "+B(A(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),S("div",e0e,[ve($o,{size:"sm",label:A(n)("login.waitingAuth")},null,8,["label"]),S("span",t0e,B(A(n)("login.waitingAutoClose")),1),S("span",n0e,B(C(c.value)),1)])])):r.value==="success"?(x(),E("div",s0e,[ve(Sv,{kind:"success"}),S("span",o0e,B(A(n)("login.success")),1),S("span",i0e,B(A(n)("login.successHint")),1)])):r.value==="expired"?(x(),E(De,{key:3},[S("div",r0e,[ve(Sv,{kind:"expired"}),S("span",l0e,B(A(n)("login.expiredTitle")),1),S("span",a0e,B(A(n)("login.expiredHint")),1)]),S("div",c0e,[ve(Kt,{variant:"primary",onClick:g},{default:Fe(()=>[tt(B(A(n)("login.retry")),1)]),_:1}),ve(Kt,{variant:"secondary",onClick:b},{default:Fe(()=>[tt(B(A(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),E(De,{key:4},[S("div",u0e,[ve(Sv,{kind:"error"}),S("span",d0e,B(l.value?A(n)("login.pollErrorTitle"):A(n)("login.errorTitle")),1),S("span",f0e,B(l.value?A(n)("login.pollErrorHint"):A(n)("login.errorHint")),1)]),S("div",h0e,[ve(Kt,{variant:"primary",onClick:g},{default:Fe(()=>[tt(B(A(n)("login.retry")),1)]),_:1}),ve(Kt,{variant:"secondary",onClick:b},{default:Fe(()=>[tt(B(A(n)("login.closeBtn")),1)]),_:1})])],64)):ge("",!0)]),_:1},8,["open","title"]))}}),g0e=dt(m0e,[["__scopeId","data-v-e3693edc"]]);function v0e(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const y0e=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Mi(e){const t=e.replaceAll("\\","/"),n=y0e.test(t),s=t.replace(/\/+$/,"");return n?s.toLowerCase():s}function k0e(e,t){const n=Mi(t.cwd);return e.find(s=>Mi(s.root)===n)?.id??t.workspaceId??t.cwd}function b0e(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,sessionsHasMoreByWorkspace:o}=e,i=new Set(s.map(Mi)),r=new Map;for(const d of t){const f=Mi(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const h=Mi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:v0e(f),sessionCount:0})}const l=new Map;for(const d of n){const f=k0e(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Mi(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),h=l.get(f.id)??l.get(f.root)??0,p=o[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function x0e(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const s=new Set(t.map(r=>r.id)),o=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||s.has(r.id)||r.role==="user"&&r.promptId!==void 0&&o.has(r.promptId))});return i.length>0?[...i,...t]:t}function C3(e,t){const n=new Set(e.map(a=>a.id)),s=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(s.length===0)return e;const o=new Map(e.map(a=>[a.id,a])),i=new Set,r=s.map(a=>{const c=a.backgroundTaskId!==void 0?o.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function w0e(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),s=new Set(e.map(r=>r.id)),o=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!s.has(r.id));return i.length===0?o:[...o,...i]}function _0e(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 S0e=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function C0e(e){return S0e.has(e.type)}const A0e=50,M0e=100,Jy=32*1024,E0e={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,A0e)},cancelTask(e){clearTimeout(e)}};function T0e(e,t,n={}){const s=n.scheduler??E0e,o=Math.max(1,Math.floor(n.maxItemsPerSlice??M0e)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(s.cancelFrame(l),l=null),a!==null&&(s.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const k=++c,g=()=>{k===c&&p()};l=s.requestFrame(g),a=s.requestTask(g)};p=()=>{f();let k=0;for(;!u&&k<o&&r<i.length;){const g=i[r++];e(g),k+=1}h(),m()};const y=(k=>{if(!u){if(t(k)){const g=i.length>r?i.at(-1):void 0,v=g===void 0?void 0:n.coalesce?.(g,k);v===void 0?i.push(k):i[i.length-1]=v,m();return}if(d()===0){e(k);return}i.push(k),p()}});return y.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},y.discard=k=>{if(u||d()===0)return;let g=r;for(let v=r;v<i.length;v+=1){const b=i[v];k(b)||(i[g++]=b)}i.length=g,h(),d()===0?f():m()},y.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},y}function ek(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function N0e(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,s=ek(t);if(n===void 0||s===void 0||n.kind!==s.kind||s.value.length<=Jy)return[e];const o=[];let i=0;for(;i<s.value.length;){let r=Math.min(i+Jy,s.value.length);r<s.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(s.value[r-1])&&/[\uDC00-\uDFFF]/u.test(s.value[r])&&(r-=1);const l=s.value.slice(i,r);o.push({appEvent:{...t,delta:s.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return o}function I0e(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,s=t.meta.stream,o=ek(e.appEvent),i=ek(t.appEvent);if(n===void 0||s===void 0||o===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==s.turnId||n.kind!==s.kind||o.kind!==i.kind||n.kind!==o.kind||s.kind!==i.kind||s.offset!==n.offset+o.value.length||o.value.length+i.value.length>Jy)return;const r=o.value+i.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const WE=["blue","mono"],zE=["light","dark","system"],UE=14,L0e=12,$0e=20;function F0e(){const e=ss(Pt.accent);return e&&WE.includes(e)?e:"blue"}function O0e(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function R0e(){const e=ss(Pt.colorScheme);return e&&zE.includes(e)?e:"system"}function B0e(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 Q2(e){return Number.isFinite(e)?Math.min($0e,Math.max(L0e,Math.round(e))):UE}function D0e(){const e=ss(Pt.uiFontSize);return e===null?UE:Q2(Number(e))}function P0e(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Q2(e)}px`)}const J2=se(R0e()),eb=se(F0e()),tb=se(D0e());Je(J2,B0e,{immediate:!0});Je(eb,O0e,{immediate:!0});Je(tb,P0e,{immediate:!0});function H0e(e){zE.includes(e)&&(J2.value=e,ps(Pt.colorScheme,e))}function W0e(e){WE.includes(e)&&(eb.value=e,ps(Pt.accent,e))}function z0e(e){const t=Q2(e);tb.value=t,ps(Pt.uiFontSize,String(t))}const U0e=600,q0e=250,Y1=250,j0e=1e3,V0e=160,Pm=se(!1);let va=[],_a=null,Hm=-Y1;function K0e(){va=[],Hm=-Y1,Pm.value=!1,_a!==null&&(clearTimeout(_a),_a=null)}function G0e(){Pm.value=!0,_a!==null&&clearTimeout(_a),_a=setTimeout(()=>{_a=null,va=[],Hm=-Y1,Pm.value=!1},j0e)}function Y0e(e){if(e<=0)return;const t=Date.now();va.push({time:t,chars:e});const n=t-U0e;if(va=va.filter(l=>l.time>=n),t-Hm<Y1)return;Hm=t;const s=va[0]?.time??t,o=Math.max(t-s,q0e);va.reduce((l,a)=>l+a.chars,0)/o*1e3>=V0e&&G0e()}function qE(){return{colorScheme:J2,accent:eb,uiFontSize:tb,fastMoon:Pm,setColorScheme:H0e,setAccent:W0e,setUiFontSize:z0e,resetFastMoon:K0e,recordMoonDelta:Y0e}}function Z0e(e,t,n){return e==="idle"&&!t&&!n}function nb(e,t){const n=ss(e);return n===null?t:n==="1"}const sb=se(nb(Pt.notifyOnComplete,!0)),ob=se(nb(Pt.notifyOnQuestion,!1)),ib=se(nb(Pt.notifyOnApproval,!1)),rb=se(typeof Notification<"u"?Notification.permission:"denied"),X0e="/favicon.ico";async function lb(e,t,n){if(!n){e.value=!1,ps(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}rb.value=s,s==="granted"&&(e.value=!0,ps(t,"1"))}function Q0e(e){return lb(sb,Pt.notifyOnComplete,e)}function J0e(e){return lb(ob,Pt.notifyOnQuestion,e)}function ege(e){return lb(ib,Pt.notifyOnApproval,e)}function ab(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function tge(e){return{title:On.global.t("settings.notifyTitle"),body:ab(e,On.global.t("settings.notifyFallback"))}}function nge(e,t){return{title:On.global.t("settings.notifyQuestionTitle"),body:ab(t,e,On.global.t("settings.notifyQuestionFallback"))}}function sge(e,t){return{title:On.global.t("settings.notifyApprovalTitle"),body:ab(t,e,On.global.t("settings.notifyApprovalFallback"))}}function cb(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{rb.value=i,i==="granted"&&A3(t,n,s)});return}A3(t,n,s)}}function A3(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:X0e});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function oge(e,t){cb(sb.value,t,tge(t.sessionTitle),`dimi-complete-${e}-${t.promptId??Date.now()}`)}function ige(e){cb(ob.value,e,nge(e.sessionTitle,e.questionPreview),`dimi-question-${e.questionId}`)}function rge(e){cb(ib.value,e,sge(e.sessionTitle,e.toolName),`dimi-approval-${e.approvalId}`)}function lge(){return{notifyOnComplete:sb,notifyOnQuestion:ob,notifyOnApproval:ib,notifyPermission:rb,setNotifyOnComplete:Q0e,setNotifyOnQuestion:J0e,setNotifyOnApproval:ege,maybeNotifyCompletion:oge,maybeNotifyQuestion:ige,maybeNotifyApproval:rge}}function age(){return ss(Pt.soundOnComplete)==="1"}const ku=se(age());function cge(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let Cv=null;function jE(){const e=cge();if(!e)return null;if(Cv===null)try{Cv=new e}catch{return null}return Cv}function VE(){if(!ku.value)return;const e=jE();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Sr("sound: audio context resumed",{state:e.state})},t=>{Sr("sound: audio context resume rejected",{error:String(t)})})}let M3=!1;function uge(){if(M3||typeof window>"u")return;M3=!0;const e=()=>{VE()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}uge();function dge(e){ku.value=e,ps(Pt.soundOnComplete,e?"1":"0"),e&&VE()}function E3(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 ub(){const e=jE();if(e===null){Sr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Sr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Sr("sound: context resumed for next time",{state:e.state})},t=>{Sr("sound: resume rejected",{error:String(t)})});return}try{E3(e,880,0,.16,.18),E3(e,1320,.1,.22,.16),Sr("sound: chime scheduled",{state:e.state})}catch(t){Sr("sound: failed to play",{error:String(t)})}}function fge(){ku.value&&ub()}function hge(){ku.value&&ub()}function pge(){ku.value&&ub()}function mge(){return{soundOnComplete:ku,setSoundOnComplete:dge,maybePlayCompletionSound:fge,maybePlayQuestionSound:hge,maybePlayApprovalSound:pge}}const gge=1e3,vge=4096,T3=32*1024;function yge(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await mt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:C3(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=mt(),y=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 b=await m.getTask(f,g.id,{withOutput:!0,outputBytes:T3});b.outputPreview!==void 0&&y.set(g.id,{preview:b.outputPreview,bytes:b.outputBytes}),o.add(g.id)}catch{}})),y.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=y.get(g.id)??(g.backgroundTaskId!==void 0?y.get(g.backgroundTaskId):void 0);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=mt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const b=v.status==="running",C=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!b&&!C)&&!(C&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const I=await h.getTask(f,v.id,{withOutput:!0,outputBytes:b?vge:T3});I.outputPreview!==void 0&&m.set(v.id,{preview:I.outputPreview,bytes:I.outputBytes}),C&&o.add(v.id)}catch{}}));const y=e.tasksBySession[f]??[],k=new Map(y.map(v=>[v.id,v])),g=p.map(v=>{const b=k.get(v.id),C=m.get(v.id);return{...v,outputLines:b?.outputLines,text:b?.text,outputPreview:C?.preview??b?.outputPreview,outputBytes:C?.bytes??b?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:C3(g,y)}}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())},gge))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=se(0);let d=null;return Je(()=>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}),Je(()=>{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 y;h&&f!==void 0?a(f):f!==void 0?y=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{y!==void 0&&clearTimeout(y)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function kge(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 bge(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
314
|
+
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&kge(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 tk="/sessions/";function N3(e){const{pathname:t}=e;if(!t.startsWith(tk))return;const n=t.slice(tk.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function xge(e){return e===void 0||e.length===0?"/":`${tk}${encodeURIComponent(e)}`}const wge=50,nk=5,_ge=40402,Sge=40410,Cge=40902,Age=2e3;function Av(e){return Si(e)&&e.code===Cge}const Mge=40904;function Ege(e){return Si(e)&&e.code===Mge}const aa=Ts({}),ip=Ts({}),Mv=Ts({}),zi=Ts(new Set),Z1=new Map,Wa=new Map,Wm=new Map;let Tge=0;const ua=new Map,Nge=3;let I3=0;function Ige(){return I3+=1,`${Date.now().toString(36)}-${I3}`}function Lge(e){return{generation:Z1.get(e)??0,pending:(Wa.get(e)?.size??0)>0}}function sk(e){const t=++Tge;Z1.set(e,t);const n=Wa.get(e)??new Set;return n.add(t),Wa.set(e,n),t}function ok(e,t){const n=Wa.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Wa.delete(e);const s=Wm.get(e);Wm.delete(e),s?.()}function $ge(e){Z1.delete(e),Wa.delete(e),Wm.delete(e),ua.delete(e)}function Fge(e,t){return!t.pending&&t.generation===(Z1.get(e)??0)}function Oge(e,t){if((Wa.get(e)?.size??0)===0){t();return}Wm.set(e,t)}function Rge(e,t){const{t:n}=On.global,{confirm:s}=W1(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:m,updateSessionMessages:y,nextOptimisticMsgId:k,getEventConn:g,syncSessionFromSnapshot:v,reopenSession:b,hasLoadedMessages:C,refreshSessionStatus:I,persistSessionProfile:T,mergedWorkspaces:M,workspacesView:$,status:N,workspaceIdForSession:F,savePermissionToStorage:_,savePlanModeToStorage:R,saveSwarmModeToStorage:z,draftModes:W,saveUnread:L,saveActiveWorkspaceToStorage:O,saveHiddenWorkspacesToStorage:q,resetFastMoon:X,initialized:ie,connectIssue:U,selectedDiffPath:j,fileDiffLines:te,fileDiffLoading:ae}=t;let oe=!1;async function re(J){if(e.messagesLoadingMoreBySession[J])return;const ke=e.messagesBySession[J];if(!ke||ke.length===0)return;const Se=ke[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[J]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[J]:!1};try{const Oe=await mt().listMessages(J,{beforeId:Se,pageSize:wge}),je=[...Oe.items].reverse();y(J,it=>[...je,...it]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[J]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[J]:!0},l("loadOlderMessages",Oe,{sessionId:J})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[J]:!1}}}function xe(J){o.loadTasksForSession(J),ue(J),I(J),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,J)||r.loadSkillsForSession(J)}async function pe(J){const ke=e.activeSessionId;if(ke){j.value=J,te.value=[],ae.value=!0;try{const Oe=await mt().getFileDiff(ke,J);if(j.value!==J)return;te.value=bge(Oe.diff)}catch(Se){j.value===J&&(te.value=[]),console.warn("[loadFileDiff] diff unavailable for",J,Se)}finally{j.value===J&&(ae.value=!1)}}}function Ee(){j.value=null,te.value=[],ae.value=!1}async function ue(J){try{const Se=await mt().getGitStatus(J);e.gitStatusBySession={...e.gitStatusBySession,[J]:Se}}catch{}}async function Y(){try{const ke=await mt().getAuth();return e.authReady=ke.ready,e.defaultModel=ke.defaultModel,e.authenticatedProviders=ke.authenticatedProviders,U.value=null,"proceed"}catch(J){return Si(J)&&(J.code===401||J.code===wE)?(U.value=null,"server-auth-required"):(U.value=(J instanceof Error?J.message:String(J)).slice(0,140),"retry")}}async function Q(){let J=!0;for(;;){const ke=await Y();if(ke!=="retry")return ke;J&&(U.value=null,J=!1),await new Promise(Se=>{setTimeout(Se,Age)})}}async function P(){try{const J=mt();e.config=await J.getConfig()}catch{}}async function G(J){try{const Se=await mt().setConfig(J);return e.config=Se,e.defaultModel=Se.defaultModel??null,!0}catch(ke){return l("setConfig",ke),!1}}const ye=100,he=30,fe=720*60*1e3;async function K(){const J=mt(),ke=[];let Se,Oe;for(;;){let je;try{je=await J.listSessions({pageSize:ye,beforeId:Se,excludeEmpty:!0})}catch(it){if(ke.length===0)throw it;Oe=it;break}if(ke.push(...je.items),!je.hasMore||je.items.length===0)break;Se=je.items[je.items.length-1].id}return{sessions:ke,error:Oe}}function ne(J){const ke=new Map(e.sessions.map(Se=>[Se.id,Se.usage]));u(J.map(Se=>{const Oe=ke.get(Se.id);return Oe!==void 0&&qy(Se.usage)&&!qy(Oe)?{...Se,usage:Oe}:Se}))}function me(J){const ke=[...J],Se=new Set(ke.map(Oe=>Oe.id));for(const Oe of e.sessions)Se.has(Oe.id)||(ke.push(Oe),Se.add(Oe.id));return ke.sort((Oe,je)=>new Date(je.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),ke}async function we(J){const ke=mt(),Se=[],Oe=Date.now(),je=Yt=>Oe-new Date(Yt.updatedAt).getTime();let it,Nt=!1,Bt=!0,ts;for(;;){let Yt;try{Yt=await ke.listSessions({workspaceId:J,pageSize:nk,beforeId:it,excludeEmpty:!0})}catch(Lt){if(Bt)throw Lt;ts=Lt,Nt=!0;break}if(Nt=Yt.hasMore,Yt.items.length===0)break;const zn=Yt.items[Yt.items.length-1],Us=je(zn)>=fe;if(!Bt&&Us){const Lt=Yt.items.findIndex(Un=>je(Un)>=fe),wt=Lt>=0?Lt+1:Yt.items.length;Se.push(...Yt.items.slice(0,wt)),Nt=Yt.hasMore||wt<Yt.items.length;break}if(Se.push(...Yt.items),Bt=!1,!Yt.hasMore||Us)break;it=zn.id}return{workspaceId:J,page:{items:Se,hasMore:Nt},error:ts}}async function Te(){const J=e.workspaces;if(J.length===0){const Lt=await K(),wt=Lt.error===void 0?Lt.sessions:me(Lt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Lt.error===void 0,Lt.error!==void 0&&l("load",Lt.error),wt}const ke=await Promise.allSettled(J.map(Lt=>we(Lt.id))),Se=[],Oe=new Set,je=new Map,it=new Set;let Nt;for(let Lt=0;Lt<ke.length;Lt++){const wt=ke[Lt];if(wt.status==="fulfilled"){je.set(wt.value.workspaceId,wt.value.page),wt.value.error!==void 0&&(it.size===0&&(Nt=wt.value.error),it.add(wt.value.workspaceId));for(const Un of wt.value.page.items)Oe.has(Un.id)||(Se.push(Un),Oe.add(Un.id));continue}it.size===0&&(Nt=wt.reason),it.add(J[Lt].id)}if(je.size===0){l("load",Nt);return}const Bt=new Set(J.filter(Lt=>it.has(Lt.id)).map(Lt=>Lt.root)),ts=new Set(J.map(Lt=>Lt.id));for(const Lt of e.sessions)!(Lt.workspaceId!==void 0&&ts.has(Lt.workspaceId)?it.has(Lt.workspaceId):Bt.has(Lt.cwd)||it.has(F(Lt)))||Oe.has(Lt.id)||(Se.push(Lt),Oe.add(Lt.id));const Yt={},zn={},Us={};for(const{id:Lt}of J){const wt=je.get(Lt);if(wt===void 0){const Un=e.sessionsHasMoreByWorkspace[Lt],Nn=e.sessionsCursorByWorkspace[Lt],qs=e.sessionsInitialCountByWorkspace[Lt];Un!==void 0&&(Yt[Lt]=Un),Nn!==void 0&&(zn[Lt]=Nn),qs!==void 0&&(Us[Lt]=qs);continue}Yt[Lt]=wt.hasMore,zn[Lt]=wt.items.length>0?wt.items[wt.items.length-1].id:void 0,Us[Lt]=Math.max(wt.items.length,nk)}return e.sessionsHasMoreByWorkspace=Yt,e.sessionsCursorByWorkspace=zn,e.sessionsInitialCountByWorkspace=Us,e.sessionsFullyLoaded=!1,Se.sort((Lt,wt)=>new Date(wt.updatedAt).getTime()-new Date(Lt.updatedAt).getTime()),it.size>0&&l("load",Nt),Se}async function Pe(J){if(e.sessionsLoadingMoreByWorkspace[J]||e.sessionsHasMoreByWorkspace[J]===!1)return;const ke=e.sessionsCursorByWorkspace[J];if(ke!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[J]:!0};try{const Se=await mt().listSessions({workspaceId:J,pageSize:he,beforeId:ke,excludeEmpty:!0}),Oe=new Set(e.sessions.map(it=>it.id)),je=Se.items.filter(it=>!Oe.has(it.id));je.length>0&&u([...e.sessions,...je]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[J]:Se.items.length>0?Se.items[Se.items.length-1].id:ke},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[J]:Se.hasMore}}catch(Se){l("loadMoreSessions",Se)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[J]:!1}}}}async function be(){if(e.sessionsFullyLoaded)return;const J=await K().catch(Oe=>(console.warn("[dimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(J===null)return;const ke=J.error===void 0?J.sessions:me(J.sessions);if(ne(ke),e.sessionsFullyLoaded=J.error===void 0,J.error!==void 0)return;const Se={};for(const Oe of e.workspaces)Se[Oe.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function _e(){const J=await mt().getMeta().catch(()=>null);J!==null&&(e.serverVersion=J.serverVersion,e.availableOpenInApps=J.openInApps,e.dangerousBypassAuth=J.dangerousBypassAuth)}async function Ke(){const J=Date.now();let ke="accepted";as("app:load:start"),e.loading=!0;const Se=!ie.value;let Oe=!0;try{if(Se&&await Q()==="server-auth-required"){Oe=!1,ke="auth-required";return}const je=mt();await Promise.all([je.getHealth().catch(()=>null),_e(),r.loadModels()]),Se||await Y(),await P(),await Qe();const it=await Te(),Nt=it??e.sessions;it!==void 0&&ne(it);const Bt=Nt[0],ts=e.activeWorkspaceId;!(ts!==null&&M.value.some(Us=>Us.id===ts))&&Bt&&at(F(Bt)),kn();const zn=typeof window<"u"?N3(window.location):void 0;!e.activeSessionId&&zn!==void 0&&(e.sessions.some(Lt=>Lt.id===zn)||await It(zn))&&await ft(zn,{urlMode:"replace"}),!e.activeSessionId&&Nt.length>0&&await ft(Nt[0].id,{urlMode:"replace"})}catch(je){ke="failed",l("load",je)}finally{e.loading=!1,Oe&&(ie.value=!0),as("app:load:complete",{status:ke,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-J})}}async function Qe(){try{const J=mt(),[ke,Se]=await Promise.all([J.listWorkspaces().catch(()=>[]),J.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=ot(ke),e.fsHome=Se.home||null,e.recentRoots=Se.recentRoots}catch{}}function ot(J){const ke=Eh();return Object.keys(ke).length===0?J:J.map(Se=>{const Oe=ke[Se.root];return Oe!==void 0?{...Se,name:Oe}:Se})}function at(J){e.activeWorkspaceId=J,O(J)}function ht(J){at(J);const ke=e.sessions.filter(Se=>F(Se)===J);if(ke.length>0){const Se=ke[0];Se&&Se.id!==e.activeSessionId&&ft(Se.id)}else m(void 0),qe(void 0,"push")}function Et(J){const ke=Eh()[J.root],Se=ke!==void 0?{...J,name:ke}:J,Oe=Mi(Se.root);e.hiddenWorkspaceRoots.some(Nt=>Mi(Nt)===Oe)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Nt=>Mi(Nt)!==Oe),q(e.hiddenWorkspaceRoots));const je=e.workspaces.findIndex(Nt=>Nt.id===Se.id||Nt.root===Se.root);if(je===-1){e.workspaces=[Se,...e.workspaces];return}const it=[...e.workspaces];it[je]=Se,e.workspaces=it}function Tt(J){if(J.type==="workspaceCreated"||J.type==="workspaceUpdated"){Et(J.workspace);return}const ke=e.workspaces.find(Oe=>Oe.id===J.workspaceId)?.root??J.root;if(ke&&!e.hiddenWorkspaceRoots.includes(ke)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ke],q(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==J.workspaceId&&Oe.root!==ke),e.activeWorkspaceId===J.workspaceId||e.activeWorkspaceId===ke){const Oe=$.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)O(Oe);else try{Oa(Pt.activeWorkspace)}catch{}m(void 0),e.sessionLoading=!1,Ee(),qe(void 0,"replace")}}function $t(){m(void 0),qe(void 0,"push")}function rn(J){at(J),$t(),Ee()}async function vn(J){const ke=M.value.find(zn=>zn.id===J);if(!ke)return null;const Se=e.thinking,Oe=mt();let je,it=ke.root;try{const zn=await Oe.addWorkspace({root:ke.root});je=zn.id,it=zn.root,Et(zn)}catch{}const Nt=r.draftModel.value??void 0,Bt=await Oe.createSession({workspaceId:je,cwd:it,model:Nt});r.draftModel.value=null;const ts=Nt!==void 0&&(!Bt.model||Bt.model.length===0)?{...Bt,model:Nt}:Bt;f(ts),at(Bt.workspaceId??je??J),await ft(Bt.id);const Yt=Bt.id;return Se!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[Yt]:Se}),W.planMode&&(e.planModeBySession={...e.planModeBySession,[Yt]:!0},R()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Yt]:!0},z()),W.planMode=!1,W.swarmMode=!1,Yt}async function Ht(J,ke,Se){if(!zi.has(J)){zi.add(J);try{const Oe=await vn(J);if(!Oe)return;await cn(Oe,ke,Se)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{zi.delete(J)}}}async function Zt(J,ke,Se){if(!zi.has(J)){zi.add(J);try{const Oe=await vn(J);if(!Oe)return;const je=e.planModeBySession[Oe]??!1,it=e.swarmModeBySession[Oe]??!1,Nt=e.sessions.find(Yt=>Yt.id===Oe),Bt=(Nt?.model&&Nt.model.length>0?Nt.model:e.defaultModel)??void 0;if(!await T({model:Bt,planMode:je,swarmMode:it,permissionMode:e.permission},Oe))return;await r.activateSkill(ke,Se,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{zi.delete(J)}}}async function tn(J,ke){if(!zi.has(J)){zi.add(J);try{const Se=await vn(J);if(!Se)return;await i.openSideChatOn(Se,ke)}catch(Se){l("startSessionAndOpenSideChat",Se)}finally{zi.delete(J)}}}async function Gt(J){const ke=J.trim();if(!ke)return!1;const Se=mt();try{const Oe=await Se.addWorkspace({root:ke});return Et(Oe),rn(Oe.id),!0}catch(Oe){return console.warn("[dimi-web] addWorkspaceByPath failed for",ke,Oe),!1}}async function An(J){try{return await mt().browseFs(J)}catch{return{path:"",parent:null,entries:[]}}}async function Ye(){try{return await mt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function qe(J,ke){if(ke==="none"||typeof window>"u"||!window.history)return;const Se=xge(J);if(window.location.pathname!==Se)try{ke==="push"?window.history.pushState(null,"",Se):window.history.replaceState(null,"",Se)}catch{}}async function It(J){try{const ke=await mt().getSession(J);return e.sessions.some(Se=>Se.id===ke.id)||h(ke),!0}catch{return!1}}function Ut(){const J=N3(window.location);if(J===void 0){m(void 0);return}if(J!==e.activeSessionId){if(e.sessions.some(ke=>ke.id===J)){ft(J,{urlMode:"none"});return}(async()=>{if(await It(J)){await ft(J,{urlMode:"none"});return}const ke=e.sessions[0];ke?await ft(ke.id,{urlMode:"replace"}):(m(void 0),qe(void 0,"replace"))})()}}let Vt=!1;function kn(){Vt||typeof window>"u"||(Vt=!0,window.addEventListener("popstate",Ut))}async function ft(J,ke){const Se=C(J),Oe=!Se&&c.has(J);c.delete(J);try{qe(J,ke?.urlMode??"push"),e.sessionLoading=!Se&&!Oe,m(J),X(),e.unreadBySession[J]&&(e.unreadBySession={...e.unreadBySession,[J]:!1},L({[J]:!1})),Ee();const je=e.sessions.find(it=>it.id===J);if(je){const it=F(je);e.activeWorkspaceId!==it&&at(it)}if(Se){if(await b(J)==="not-found")return}else if(await v(J)==="not-found")return;xe(J)}catch(je){l("selectSession",je,{sessionId:J})}finally{e.activeSessionId===J&&(e.sessionLoading=!1)}}async function cn(J,ke,Se){const Oe=sk(J);e.inFlightBySession={...e.inFlightBySession,[J]:!0};const je=k();try{const it=mt(),Nt=[];ke&&Nt.push({type:"text",text:ke});for(const wt of Se??[])wt.kind==="video"?Nt.push({type:"video",source:{kind:"file",fileId:wt.fileId}}):wt.kind==="file"?Nt.push({type:"file",fileId:wt.fileId,name:wt.name??"",mediaType:wt.mediaType||"application/octet-stream",size:wt.size??0}):Nt.push({type:"image",source:{kind:"file",fileId:wt.fileId}});if(Nt.length===0)return e.inFlightBySession={...e.inFlightBySession,[J]:!1},"rejected";const Bt={id:je,sessionId:J,role:"user",content:Nt,createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0}};y(J,wt=>[...wt,Bt]);const ts=e.sessions.find(wt=>wt.id===J),Yt=(ts?.model&&ts.model.length>0?ts.model:e.defaultModel)??void 0,zn=e.planModeBySession[J]??!1,Us=e.swarmModeBySession[J]??!1,Lt=await it.submitPrompt(J,{content:Nt,model:Yt,thinking:await r.resolveThinkingForPrompt(J,Yt)??e.thinking,permissionMode:e.permission,planMode:zn,swarmMode:Us});return e.promptIdBySession={...e.promptIdBySession,[J]:Lt.promptId},y(J,wt=>{const Un=wt.findIndex(qs=>qs.id===je);if(Un===-1)return wt;const Nn=[...wt];return Nn[Un]={...Nn[Un],promptId:Nn[Un].promptId??Lt.promptId},Nn}),g()?.bindNextPromptId(J,Lt.promptId),"ok"}catch(it){return e.inFlightBySession={...e.inFlightBySession,[J]:!1},y(J,Nt=>Nt.some(Bt=>Bt.id===je)?Nt.filter(Bt=>Bt.id!==je):Nt),l("sendPrompt",it,{sessionId:J}),Si(it)?"rejected":"uncertain"}finally{ok(J,Oe)}}async function un(J,ke){const Se=e.activeSessionId;if(Se){if(a.value!=="idle"||e.inFlightBySession[Se]){Ns(J,ke);return}if((e.queuedBySession[Se]?.length??0)>0){Ns(J,ke),bs(Se);return}await cn(Se,J,ke)}}async function Bn(J,ke){const Se=e.activeSessionId;if(!Se)return;const Oe=e.queuedBySession[Se]??[],je=[],it=[];for(const wt of Oe){const Un=wt.text.trim();Un&&je.push(Un),wt.attachments?.length&&it.push(...wt.attachments)}const Nt=J.trim();if(Nt&&je.push(Nt),ke?.length&&it.push(...ke),je.length===0&&it.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[Se]:[]});const Bt=je.join(`
|
|
315
|
+
|
|
316
|
+
`),ts=()=>{if(Oe.length===0)return;const wt=e.queuedBySession[Se]??[];e.queuedBySession={...e.queuedBySession,[Se]:[...Oe,...wt]}};if(a.value==="idle"&&!e.inFlightBySession[Se]){await cn(Se,Bt,it)==="rejected"&&ts();return}const Yt=[];Bt&&Yt.push({type:"text",text:Bt});for(const wt of it)wt.kind==="video"?Yt.push({type:"video",source:{kind:"file",fileId:wt.fileId}}):wt.kind==="file"?Yt.push({type:"file",fileId:wt.fileId,name:wt.name??"",mediaType:wt.mediaType||"application/octet-stream",size:wt.size??0}):Yt.push({type:"image",source:{kind:"file",fileId:wt.fileId}});const zn=k(),Us={id:zn,sessionId:Se,role:"user",content:Yt,createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0}};y(Se,wt=>[...wt,Us]);const Lt=sk(Se);try{const wt=mt(),Un=e.sessions.find(or=>or.id===Se),Nn=(Un?.model&&Un.model.length>0?Un.model:e.defaultModel)??void 0,qs=await wt.submitPrompt(Se,{content:Yt,model:Nn,thinking:await r.resolveThinkingForPrompt(Se,Nn)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Se]??!1,swarmMode:e.swarmModeBySession[Se]??!1});if(y(Se,or=>{const Po=or.findIndex(Js=>Js.id===zn);if(Po===-1)return or;const Hl=[...or];return Hl[Po]={...Hl[Po],promptId:Hl[Po].promptId??qs.promptId},Hl}),qs.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Se]:qs.promptId},g()?.bindNextPromptId(Se,qs.promptId);return}try{await wt.steerPrompts(Se,[qs.promptId])}catch{}}catch(wt){y(Se,Un=>Un.filter(Nn=>Nn.id!==zn)),Si(wt)&&ts(),l("steer",wt,{sessionId:Se})}finally{ok(Se,Lt)}}async function Mn(J,ke){try{const Oe=await mt().uploadFile({file:J,name:ke});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(Se){return l("uploadImage",Se),null}}function Ns(J,ke){const Se=e.activeSessionId;if(!Se)return;const Oe=e.queuedBySession[Se]??[],je={text:J,attachments:ke,id:Ige()};e.queuedBySession={...e.queuedBySession,[Se]:[...Oe,je]}}function bs(J){const[ke,...Se]=e.queuedBySession[J]??[];ke!==void 0&&(e.queuedBySession={...e.queuedBySession,[J]:Se},cn(J,ke.text,ke.attachments).then(Oe=>{if(Oe==="ok"){ua.delete(J);return}if(Oe==="uncertain"){ua.delete(J);return}if(!e.sessions.some(ts=>ts.id===J)){ua.delete(J);return}const je=ke.id??ke.text,it=ua.get(J),Nt=it!==void 0&&it.key===je?it.count+1:1;if(Nt>=Nge){ua.delete(J),(e.queuedBySession[J]?.length??0)>0&&bs(J);return}ua.set(J,{key:je,count:Nt});const Bt=e.queuedBySession[J]??[];e.queuedBySession={...e.queuedBySession,[J]:[ke,...Bt]}}))}function ct(J,ke){const Se=e.inFlightBySession[J]===!0;if(e.inFlightBySession={...e.inFlightBySession,[J]:!1},e.promptIdBySession[J]!==void 0){const je={...e.promptIdBySession};delete je[J],e.promptIdBySession=je}return J===e.activeSessionId&&X(),(Se||ke?.turnWasActive===!0||(e.turnActiveBySession[J]??!1))&&bs(J),Se}function sr(J,ke){ke.inFlightTurn!==null&&ke.busy||ct(J)}async function xs(){const J=e.activeSessionId;if(!J)return;const ke=e.sessions.find(je=>je.id===J);let Se=e.promptIdBySession[J];if(Se===void 0){const je=ke?.currentPromptId;je!==void 0&&je.length>0&&!je.startsWith("pr_")&&(Se=je)}const Oe=mt();if(Se!==void 0)try{if((await Oe.abortPrompt(J,Se)).aborted)return;const it={...e.promptIdBySession};delete it[J],e.promptIdBySession=it}catch(je){if(Si(je)&&je.code===_ge){const it={...e.promptIdBySession};delete it[J],e.promptIdBySession=it}else{l("abortCurrentPrompt",je,{sessionId:J});return}}try{await Oe.abortSession(J)}catch(je){l("abortCurrentPrompt",je,{sessionId:J})}}function bn(J,ke){const Se=e.approvalsBySession[J]??[];e.approvalsBySession={...e.approvalsBySession,[J]:Se.filter(Oe=>Oe.approvalId!==ke)}}function gs(J,ke){const Se=e.questionsBySession[J]??[];e.questionsBySession={...e.questionsBySession,[J]:Se.filter(Oe=>Oe.questionId!==ke)}}async function ws(J,ke){const Se=e.activeSessionId;if(Se&&!ip[J]){ip[J]=!0;try{const Oe=mt(),je={decision:ke.decision,scope:ke.scope,feedback:ke.feedback,selectedLabel:ke.selectedLabel};await Oe.respondApproval(Se,J,je),bn(Se,J)}catch(Oe){Av(Oe)?bn(Se,J):l("respondApproval",Oe,{sessionId:Se})}finally{delete ip[J]}}}async function Ws(J,ke){const Se=e.activeSessionId;if(Se&&!aa[J]){aa[J]="answer";try{await mt().respondQuestion(Se,J,ke),gs(Se,J)}catch(Oe){Av(Oe)?gs(Se,J):l("respondQuestion",Oe,{sessionId:Se})}finally{delete aa[J]}}}async function Zs(J){const ke=e.activeSessionId;if(ke&&!aa[J]){aa[J]="dismiss";try{await mt().dismissQuestion(ke,J),gs(ke,J)}catch(Se){Av(Se)?gs(ke,J):l("dismissQuestion",Se,{sessionId:ke})}finally{delete aa[J]}}}async function Gn(J){const ke=e.activeSessionId;if(ke&&!Mv[J]){Mv[J]=!0;try{const Se=mt(),Oe=(e.tasksBySession[ke]??[]).find(it=>it.id===J)?.backgroundTaskId;await Se.cancelTask(ke,Oe??J);const je=e.tasksBySession[ke]??[];e.tasksBySession={...e.tasksBySession,[ke]:je.map(it=>it.id===J?{...it,status:"cancelled"}:it)}}catch(Se){Ege(Se)||l("cancelTask",Se,{sessionId:ke})}finally{delete Mv[J]}}}function mo(J){const ke=e.activeSessionId;ke?(e.planModeBySession={...e.planModeBySession,[ke]:J},R(),T({planMode:J})):W.planMode=J}function Xs(){const J=e.activeSessionId,ke=J?e.planModeBySession[J]??!1:W.planMode;mo(!ke)}function _s(J){const ke=e.activeSessionId;ke?(e.swarmModeBySession={...e.swarmModeBySession,[ke]:J},z(),T({swarmMode:J})):W.swarmMode=J}async function Fo(){const J=e.activeSessionId,Se=!(J?e.swarmModeBySession[J]??!1:W.swarmMode);Se&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||_s(Se)}function Jo(J){e.permission=J,_(J),T({permissionMode:J})}function Qs(J){const ke=[...e.warnings];ke.splice(J,1),e.warnings=ke}async function os(J,ke){try{await mt().updateSession(J,{title:ke}),d(J,Oe=>({...Oe,title:ke}))}catch(Se){l("renameSession",Se,{sessionId:J})}}async function Fi(J,ke){const Se=e.workspaces.find(je=>je.id===J)?.root,Oe=()=>{e.workspaces=e.workspaces.map(je=>je.id===J?{...je,name:ke}:je)};try{if(await mt().updateWorkspace(J,{name:ke}),Se!==void 0){const je=Eh();Se in je&&(delete je[Se],d_(je))}Oe()}catch(je){if(Se!==void 0&&Si(je)&&je.code===Sge){d_({...Eh(),[Se]:ke}),Oe();return}l("renameWorkspace",je)}}async function ei(J){const ke=e.workspaces.find(it=>it.id===J)?.root??M.value.find(it=>it.id===J)?.root??J,Se=e.activeSessionId?e.sessions.find(it=>it.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===J||e.activeWorkspaceId===ke,je=!!(Se&&(Se.cwd===ke||Se.workspaceId===J||F(Se)===J));ke&&!e.hiddenWorkspaceRoots.includes(ke)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ke],q(e.hiddenWorkspaceRoots));try{await mt().deleteWorkspace(J)}catch(it){console.warn("[dimi-web] deleteWorkspace registry cleanup failed for",J,it)}if(e.workspaces=e.workspaces.filter(it=>it.id!==J&&it.root!==ke),Oe||je){const it=$.value[0]?.id??null;if(e.activeWorkspaceId=it,it)O(it);else try{Oa(Pt.activeWorkspace)}catch{}}(Oe||je)&&(m(void 0),e.sessionLoading=!1,Ee(),qe(void 0,"replace"))}async function Xt(J){try{await mt().archiveSession(J),p(J),i.clearSideChatForSession(J);const{[J]:Se,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===J){const je=e.sessions[0];je?await ft(je.id,{urlMode:"replace"}):(m(void 0),qe(void 0,"replace"))}}catch(ke){l("archiveSession",ke,{sessionId:J})}}async function Is(J){if(oe)return;const ke=J??e.activeSessionId;if(!ke){const Oe=n("commands.export.noSession");as("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}oe=!0;const Se=Date.now();as("export:start",{sessionId:ke});try{const Oe=kie(),{blob:je,fileName:it}=await mt().exportSession(ke,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const Nt=URL.createObjectURL(je);let Bt;try{Bt=document.createElement("a"),Bt.href=Nt,Bt.download=it,document.body.append(Bt),Bt.click()}finally{Bt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Nt)}catch{}},0)}as("export:accepted",{sessionId:ke,status:"accepted",zipBytes:je.size,durationMs:Date.now()-Se})}catch(Oe){const je=typeof Oe=="object"&&Oe!==null?Oe:void 0;as("export:failed",{sessionId:ke,status:"failed",durationMs:Date.now()-Se,errorName:typeof je?.name=="string"?je.name:typeof Oe,errorCode:typeof je?.code=="number"?je.code:void 0,requestId:typeof je?.requestId=="string"?je.requestId:void 0,phase:typeof je?.phase=="string"?je.phase:void 0,httpStatus:typeof je?.status=="number"?je.status:void 0}),l("exportSession",Oe,{sessionId:ke})}finally{oe=!1}}async function Yn(J){try{const ke=await mt().restoreSession(J);return f(ke),!0}catch(ke){return l("restoreSession",ke,{sessionId:J}),!1}}function Oo(J){return mt().listSessions({archivedOnly:!0,beforeId:J?.beforeId,pageSize:J?.pageSize??50})}async function Ro(J){try{const ke=mt(),Se=e.defaultModel?.includes("/")?e.defaultModel.slice(0,e.defaultModel.indexOf("/")):void 0,Oe=J??e.authenticatedProviders.find(je=>je.id===Se)?.id??e.authenticatedProviders[0]?.id;if(Oe===void 0)return;await ke.logoutProvider(Oe),await Y(),await Ke()}catch(ke){l("logout",ke)}}function Bo(J){const ke=e.activeSessionId;ke&&mt().compactSession(ke,J).catch(Se=>{l("compact",Se,{sessionId:ke})})}async function ti(J){const ke=J??e.activeSessionId;if(ke)try{const Se=await mt().forkSession(ke);f(Se),await ft(Se.id)}catch(Se){l("fork",Se,{sessionId:ke})}}async function Do(J=1){const ke=e.activeSessionId;if(!ke)return null;const Se=(()=>{const Oe=e.messagesBySession[ke]??[];for(let je=Oe.length-1;je>=0;je--){const it=Oe[je];if(it.role==="user"&&!(it.metadata?.origin&&it.metadata.origin.kind!=="user"))return it.content.filter(Nt=>Nt.type==="text").map(Nt=>Nt.text).join(`
|
|
317
|
+
`)}return null})();try{return await mt().undoSession(ke,J),await v(ke),Se}catch(Oe){return l("undo",Oe,{sessionId:ke}),null}}function go(J){const ke=e.activeSessionId;if(!ke)return;const Se=e.queuedBySession[ke]??[];if(J<0||J>=Se.length)return;const Oe=[...Se];Oe.splice(J,1),e.queuedBySession={...e.queuedBySession,[ke]:Oe}}function Ue(J,ke){const Se=e.activeSessionId;if(!Se)return;const Oe=e.queuedBySession[Se]??[];if(J===ke||J<0||J>=Oe.length||ke<0||ke>=Oe.length)return;const je=[...Oe],[it]=je.splice(J,1);it!==void 0&&(je.splice(ke,0,it),e.queuedBySession={...e.queuedBySession,[Se]:je})}async function Ze(J){const ke=e.activeSessionId;if(!ke)return[];try{return(await mt().listDirectory(ke,{path:J,includeGitStatus:!0})).items}catch{return[]}}async function ut(J){const ke=e.activeSessionId;if(!ke)return null;try{const Oe=await mt().readFile(ke,{path:J});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(Se){return console.warn("[dimi-web] readFileContent failed for",J,Se),null}}const Wt=10485760;function zs(J){const ke=e.activeSessionId;return ke?mt().getFileDownloadUrl(ke,J):null}async function vo(J,ke){const Se=e.activeSessionId;if(!Se)return!1;try{return await mt().openFile(Se,{path:J,line:ke}),!0}catch(Oe){return l("openFile",Oe,{sessionId:Se}),!1}}async function zr(J){const ke=e.activeSessionId;if(!ke)return;const Se=N.value.cwd||".";try{await mt().openInApp(ke,J,Se)}catch(Oe){l("openInApp",Oe,{sessionId:ke})}}async function ce(J){const ke=e.activeSessionId;if(!ke)return!1;try{return await mt().revealFile(ke,{path:J}),!0}catch(Se){return l("revealFile",Se,{sessionId:ke}),!1}}async function V(J){if(/^(https?:|data:|blob:)/i.test(J))return J;const ke=e.activeSessionId;if(!ke)return J;let Se=J;if(Se.startsWith("/")){const Oe=e.sessions.find(je=>je.id===ke)?.cwd;if(Oe&&(Se===Oe||Se.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(Se=Se.slice(Oe.length).replace(/^\//,""),!Se)return J}else return J}try{const je=await mt().readFile(ke,{path:Se,length:Wt});return!je.isBinary||je.encoding!=="base64"||je.truncated?J:`data:${je.mime};base64,${je.content}`}catch{return J}}async function le(J){const ke=e.activeSessionId;if(!ke)return[];try{return(await mt().searchFiles(ke,{query:J,limit:20})).items.map(je=>({path:je.path,name:je.name}))}catch{return[]}}return{loadFileDiff:pe,clearFileDiff:Ee,loadGitStatus:ue,checkAuth:Y,loadConfig:P,updateConfig:G,listAllSessionsGlobal:K,load:Ke,refreshServerMeta:_e,loadWorkspaces:Qe,loadMoreSessions:Pe,loadAllSessions:be,selectWorkspace:at,openWorkspace:ht,upsertWorkspacePreserveOrder:Et,applyWorkspaceEvent:Tt,clearActiveSession:$t,openWorkspaceDraft:rn,startSessionAndSendPrompt:Ht,startSessionAndActivateSkill:Zt,startSessionAndOpenSideChat:tn,addWorkspaceByPath:Gt,browseFs:An,getFsHome:Ye,writeSessionUrl:qe,fetchSessionIntoList:It,onSessionRoutePopState:Ut,bindSessionRoute:kn,selectSession:ft,submitPromptInternal:cn,finishPromptLocal:ct,localTurnStartState:Lge,isLocalTurnSnapshotCurrent:Fge,afterLocalTurnStartsSettle:Oge,handleSessionSnapshot:sr,sendPrompt:un,steerPrompt:Bn,uploadImage:Mn,enqueue:Ns,unqueue:go,reorderQueue:Ue,abortCurrentPrompt:xs,respondApproval:ws,respondQuestion:Ws,dismissQuestion:Zs,pendingQuestionActions:aa,pendingApprovalActions:ip,cancelTask:Gn,setPlanMode:mo,togglePlanMode:Xs,setSwarmMode:_s,toggleSwarmMode:Fo,setPermission:Jo,dismissWarning:Qs,renameSession:os,renameWorkspace:Fi,deleteWorkspace:ei,archiveSession:Xt,exportSession:Is,restoreSession:Yn,loadArchivedSessions:Oo,logout:Ro,compact:Bo,forkSession:ti,undo:Do,listDir:Ze,readFileContent:ut,getFileDownloadUrl:zs,openWorkspaceFile:vo,openInApp:zr,revealWorkspaceFile:ce,resolveImageUrl:V,searchFiles:le,loadOlderMessages:re,refreshSessionSidecars:xe,isStartingFirstPrompt:()=>zi.size>0}}const KE=Pt.starredModels,L3=new Error("profile persist failed");function Bge(){try{const e=ss(KE);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Dge(e){try{ps(KE,JSON.stringify(e))}catch{}}function Pge(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,updateSession:r,updateSessionMessages:l}=t,a=se([]),c=se(Bge()),u=se({}),d=se({}),f=se([]),h=se(null);function p(U){if(!(U==null||U.length===0))return a.value.find(j=>j.id===U)??a.value.find(j=>j.model===U)}function m(){const U=e.activeSessionId?e.sessions.find(te=>te.id===e.activeSessionId):void 0,j=U===void 0?h.value??e.defaultModel:U.model||e.defaultModel;return p(j)?.id??j??void 0}function y(U){if(U===void 0)return;const j=p(U);return j===void 0?void 0:gf(j)}function k(U,j){const te=U==null?void 0:e.thinkingBySession[U];return te!==void 0&&Uce(j,te)?te:gf(j)}function g(U,j){if(j===void 0)return;const te=p(j);return te===void 0?void 0:k(U,te)}async function v(U,j){return U!=null&&e.thinkingBySession[U]===void 0&&await s(U),g(U,j)}function b(U){e.thinking=U;const j=e.activeSessionId;return U!==void 0&&j!==null&&j!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[j]:U}),U}Je([()=>e.activeSessionId,()=>m(),()=>{const U=e.activeSessionId;return U==null?void 0:e.thinkingBySession[U]}],()=>{const U=p(m());U!==void 0&&(e.thinking=k(e.activeSessionId,U))});function C(U){mt().setConfig({thinking:qce(U,p(m())?.supportEfforts)}).catch(j=>n("setConfig",j))}async function I(U){try{const te=await mt().listSkills(U);u.value={...u.value,[U]:te}}catch{}}async function T(U){try{const te=await mt().listSkillsForWorkspace(U);d.value={...d.value,[U]:te}}catch{}}async function M(){try{const U=mt();a.value=await U.listModels();const j=p(m());j!==void 0&&(e.thinking=k(e.activeSessionId,j))}catch(U){n("loadModels",U)}}async function $(){try{const U=mt();f.value=await U.listProviders()}catch(U){n("loadProviders",U)}}async function N(U){const j=e.activeSessionId,te=p(U),ae=e.thinking,oe=j?e.sessions.find(pe=>pe.id===j)?.model:void 0,re=m()!==(te?.id??U),xe=jce(te,ae,re);if(!j)return h.value=U,e.thinking=xe,xe!==ae&&xe!==void 0&&C(xe),!0;r(j,pe=>({...pe,model:U})),xe!==ae&&(e.thinking=xe,xe!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[j]:xe}));try{await mt().updateSession(j,{model:U,thinking:xe!==ae?xe:void 0})}catch(pe){return r(j,Ee=>({...Ee,model:oe??Ee.model})),xe!==ae&&(e.thinking=ae,ae!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[j]:ae})),n("setModel",pe,{sessionId:j}),!1}return xe!==ae&&xe!==void 0&&C(xe),await s(j),!0}function F(U){const j=new Set(c.value);j.has(U)?j.delete(U):j.add(U),c.value=Array.from(j),Dge(c.value)}async function _(U,j,te){const ae=te??e.activeSessionId;if(!ae)return;const oe=i.value==="idle"&&!e.inFlightBySession[ae],re=`msg_skill_opt_${Date.now().toString(36)}`,xe=oe?sk(ae):void 0;if(oe){e.inFlightBySession={...e.inFlightBySession,[ae]:!0};const pe={id:re,sessionId:ae,role:"user",content:[{type:"text",text:`/${U}${j?` ${j}`:""}`}],createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:U,skillArgs:j}}};l(ae,Ee=>[...Ee,pe])}try{const pe=e.sessions.find(Y=>Y.id===ae)?.model,Ee=(pe&&pe.length>0?pe:e.defaultModel)??void 0;if(!await o({thinking:await v(ae,Ee)??e.thinking},ae))throw L3;await mt().activateSkill(ae,U,j)}catch(pe){oe&&(e.inFlightBySession={...e.inFlightBySession,[ae]:!1},l(ae,Ee=>Ee.filter(ue=>ue.id!==re))),pe!==L3&&n("activateSkill",pe,{sessionId:ae})}finally{xe!==void 0&&ok(ae,xe)}}async function R(U,j){try{return await mt().loginProviderApiKey(U,j),await Promise.all([$(),M()]),!0}catch(te){return n("loginProviderApiKey",te,{message:U}),!1}}async function z(U){try{await mt().logoutProvider(U),await Promise.all([$(),M()])}catch(j){n("logoutProvider",j,{message:U})}}async function W(U){try{const j=await mt().refreshProvider(U);for(const te of j.failed)n("refreshProvider",new Error(te.message),{message:te.provider});await Promise.all([$(),M()])}catch(j){n("refreshProvider",j)}}async function L(){try{const U=await mt().refreshAllProviders();for(const j of U.failed)n("refreshAllProviders",new Error(j.message),{message:j.provider});await Promise.all([$(),M()])}catch(U){n("refreshAllProviders",U)}}async function O(U){try{return await mt().startOAuthLogin(U)}catch{return null}}async function q(U){try{return await mt().pollOAuthLogin(U)}catch(j){return console.warn("[dimi-web] pollOAuthLogin failed",j),null}}async function X(U){try{await mt().cancelOAuthLogin(U)}catch{}}function ie(U){const j=b(U);o({thinking:j}),j!==void 0&&C(j)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:I,loadSkillsForWorkspace:T,loadModels:M,loadProviders:$,setModel:N,thinkingLevelForModelId:y,thinkingLevelForSessionId:g,resolveThinkingForPrompt:v,toggleStarModel:F,activateSkill:_,loginProviderApiKey:R,logoutProvider:z,refreshProvider:W,refreshAllProviders:L,startOAuthLogin:O,pollOAuthLogin:q,cancelOAuthLogin:X,setThinking:ie}}const GE="dimiWeb.compaction",Hge=/^read[_-]?media(?:file)?$/i,Wge=/^data:([^;]+);base64,(.*)$/s,zge=/^<(image|video|audio)\s+path="([^"]+)">$/,Uge=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,qge=/Mime type:\s*([^.\s]+)/i,jge=/Size:\s*(\d+)\s*bytes/i,Vge=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Kge="<system>Image compressed to fit model limits:",Gge=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Yge(e){return e.includes(Kge)?e.replace(Gge,""):e}function Zge(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Xge(e){const t=Uge.exec(e.trim());return t?{kind:t[1],path:Zge(t[2])}:null}const YE=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Qge=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Jge(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return YE.test(s)?s:void 0}const eve=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function tve(e){const t=eve.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",s=Qge.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:s!==void 0&&YE.test(s)?s:void 0}}function nve(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 sve(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 ove(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 ive(e,t){if(!Hge.test(e))return;const n=sve(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=zge.exec(h);p&&(o=p[1],s=p[2]);const m=qge.exec(h);m?.[1]&&(i=m[1]);const y=jge.exec(h);y?.[1]&&(r=Number(y[1]));const k=Vge.exec(h);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=ove(d);f&&(a=f)}if(a===null)return;const c=Wge.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=nve(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function rve(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
318
|
+
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
319
|
+
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
320
|
+
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
321
|
+
`)):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 lve(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 ave(e,t){const n=e.split(`
|
|
322
|
+
`),s=t.split(`
|
|
323
|
+
`),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 cve(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:ave(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 uve(e){const t=`<prompt>
|
|
324
|
+
`,n=`
|
|
325
|
+
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):dve(e)}function dve(e){const t=e.split(`
|
|
326
|
+
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
327
|
+
`):e}function fve(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function hve(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
328
|
+
`);return uve(t)}function pve(e,t){const n=e.metadata?.origin??{},s=hve(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 mve(e,t,n){const{text:s,cron:o}=pve(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function gve(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 vve(e){return e.metadata?.origin?.kind==="compaction_summary"}function yve(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function kve(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 bve(e){let t="",n="";const s=[],o=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?s.push(i.toolCallId):o.push(JSON.stringify(i));return s.sort(),o.sort(),{text:t,thinking:n,toolIds:s,rest:o}}function xve(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function ZE(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!s)for(let m=0;m<p.tools.length;m++){const y=p.tools[m];if(y.status!=="running")continue;const k={...y,status:"ok"};p.tools[m]=k;const g=p.blocks.find(v=>v.kind==="tool"&&v.tool.id===k.id);g&&g.kind==="tool"&&(g.tool=k)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
|
|
329
|
+
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
330
|
+
`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const y=h.blocks.at(-1);y&&y.kind==="text"?y.text+=`
|
|
331
|
+
`+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const y=h.blocks.at(-1);y&&y.kind==="thinking"?y.thinking+=`
|
|
332
|
+
`+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const y=l.get(m.toolCallId),k={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?o[m.toolCallId]?.path:void 0};h.tools.push(k),h.blocks.push({kind:"tool",tool:k}),y&&(h.approval=cve(y),h.approvalId=y.approvalId)}else if(m.type==="toolResult"){const y=h.tools.findIndex(k=>k.id===m.toolCallId);if(y!==-1){const k=h.tools[y],g={...k,status:m.isError?"error":"ok",output:rve(m.output),media:m.isError?void 0:ive(k.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=kve(g.output)),h.tools[y]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}}function d(h,p){for(const m of p){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const y=h.tools.findIndex(b=>b.id===m.toolCallId);if(y===-1)continue;const k=h.tools[y];if(k.output!==void 0)continue;const g={...k,output:m.outputLines};h.tools[y]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,m=h.source;if(m.kind==="url")return{url:m.url,kind:p};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:p};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:p,fileId:m.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(vve(h)){c();const g=h.metadata?.[GE];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(v=>v.type==="text").map(v=>v.text).join(`
|
|
333
|
+
`),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=fve(h);if(c(),g!==void 0){i.push(mve(h,r++,g));continue}if(!gve(h))continue;const v=h.metadata?.origin,b=v?.kind==="skill_activation"&&v?.trigger==="user-slash",C=v?.kind==="plugin_command"&&v?.trigger==="user-slash",I=[],T=[];for(const M of h.content){if(M.type==="text")if(b)I.push(v.skillArgs??"");else if(C)I.push(v.commandArgs??"");else{const N=Xge(M.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const R=Jge(N.path);if(R){T.push({url:n(R),kind:N.kind,fileId:R});continue}}const F=tve(M.text);if(F){T.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const _=Yge(M.text);if(_!==M.text&&_.trim().length===0)continue;I.push(_)}const $=f(M);if($){T.push({url:$.url,kind:$.kind,name:M.type==="file"?M.name:void 0,fileId:$.fileId});continue}M.type==="file"&&n&&T.push({kind:"file",url:n(M.fileId),fileId:M.fileId,name:M.name,mediaType:M.mediaType||void 0,size:M.size})}i.push({id:h.id,role:"user",no:r++,text:I.join(`
|
|
334
|
+
`),attachments:T.length>0?T:void 0,skillActivation:b?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:C?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;yve(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const y=a;if(y===null)continue;const k=bve(h.content);if(y.promptId!==void 0&&y.foldedSigs.some(g=>xve(g,k))){d(y,h.content);continue}y.foldedSigs.push(k),u(y,h.content)}return c(!0),i}function wve(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i,resolveThinkingForPrompt:r}=t,l=se({}),a=D(()=>{const N=e.activeSessionId;if(!N)return null;const F=l.value[N];return F?{parentId:N,agentId:F.agentId}:null}),c=D(()=>a.value?.parentId??null),u=D(()=>a.value!==null),d=D(()=>{const N=a.value;return N?!!e.sideChatSendingByAgent[N.agentId]:!1}),f=D(()=>{const N=a.value;return N?e.sideChatSendingByAgent[N.agentId]?!0:(e.tasksBySession[N.parentId]??[]).some(F=>F.id===N.agentId&&F.status==="running"):!1}),h=D(()=>{const N=a.value;if(!N)return[];const F=e.sideChatMessagesByAgent[N.agentId]??[];return ZE(F,[],_=>mt().getFileUrl(_),f.value)});function p(N,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:F(e.sideChatMessagesByAgent[N]??[])}}function m(N,F){p(N,_=>[..._,F])}function y(N){p(N,F=>{const _=[...F].reverse().findIndex(z=>z.role==="user");if(_===-1)return F;const R=F.length-1-_;return F.filter((z,W)=>W!==R)})}function k(N,F){p(N,_=>{const R=[..._];for(let z=R.length-1;z>=0;z-=1){const W=R[z];if(W.role==="user")return R[z]={...W,promptId:W.promptId??F},R}return _})}function g(N,F,_){_&&p(N,R=>{const z=R.at(-1);if(z?.role==="assistant"){const W=z.content[0],L=W?.type==="text"?W.text:"";return[...R.slice(0,-1),{...z,content:[{type:"text",text:`${L}${_}`}]}]}return[...R,{id:s(),sessionId:F,role:"assistant",content:[{type:"text",text:_}],createdAt:new Date().toISOString()}]})}function v(N,F,_){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[N]:!1},!_)return;const z=(e.sideChatMessagesByAgent[N]??[]).at(-1);(z?.role==="assistant"&&z.content[0]?.type==="text"?z.content[0].text:"").trim().length>0||g(N,F,_)}async function b(N){const F=e.activeSessionId;F&&await C(F,N)}async function C(N,F){if(!l.value[N]){let _;try{({agentId:_}=await mt().startBtw(N))}catch(R){n("openSideChat",R,{sessionId:N});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[_]:e.sideChatMessagesByAgent[_]??[]},l.value={...l.value,[N]:{agentId:_}},o(),i()?.markSideChannelAgent(_)}F&&F.trim()&&await I(N,F.trim())}async function I(N,F){const _=l.value[N],R=F.trim();if(!_||!R)return;const z=N,W=_.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[W]:!0};const L={id:s(),sessionId:z,role:"user",content:[{type:"text",text:R}],createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0}};m(W,L);try{const O=e.sessions.find(ie=>ie.id===z),q=(O?.model&&O.model.length>0?O.model:e.defaultModel)??void 0,X=await mt().submitPrompt(z,{content:[{type:"text",text:R}],agentId:W,model:q,thinking:await r(z,q)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[z]??!1,swarmMode:e.swarmModeBySession[z]??!1});k(W,X.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[z]:[...e.sideChatUserMessageIdsBySession[z]??[],X.userMessageId]}}catch(O){n("sendSideChatPrompt",O,{sessionId:z}),y(W),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[W]:!1}}}function T(){const N=e.activeSessionId;if(!N)return;const{[N]:F,..._}=l.value;l.value=_}async function M(N){const F=a.value;F&&await I(F.parentId,N)}function $(N){if(!l.value[N])return;const{[N]:F,..._}=l.value;l.value=_}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:g,finishSideChatAgent:v,openSideChat:b,openSideChatOn:C,closeSideChat:T,sendSideChatPrompt:M,clearSideChatForSession:$}}const _ve="dimiWeb.optimisticUserMessage",$3="Sub Agent";function Sve(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function Cve(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Ave(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 Ev(e){return e.role==="user"&&e.metadata?.[_ve]===!0}function Mve(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Eve(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Tve=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function F3(e){let t="",n=0;for(const s of e.content)s.type==="text"?Tve.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 Nve(e,t){const n=F3(e),s=F3(t);return n.text===s.text&&n.media===s.media}function Ive(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(Ev(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Ev(o)&&Eve(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Ev(o)&&Nve(o,t))return s}return-1}function Lve(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}const $ve={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function Fve(e){const t=On.global.t,n=[],s=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};s(t("warnings.details.code"),e.code);const o=e.details??{};s(t("warnings.details.status"),o.statusCode),s(t("warnings.details.requestId"),o.requestId),s(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||s(r,l);const i=(e.code!==void 0?$ve[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function Ove(e,t,n){const s=Cve(e);switch(Ave(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.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],delete s.turnActiveBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionWorkChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?o.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??o.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?s.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete s.turnActiveBySession[t.sessionId];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"},[GE]: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"&&!Mve(t.message)){const a=Ive(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]=Lve(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===$3&&a.description!==$3?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},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"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,mainTurnActive:t.active}:o),t.active?s.turnActiveBySession[t.sessionId]=!0:delete s.turnActiveBySession[t.sessionId];break}case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&o._agentError)s.warnings=[...s.warnings,Fve(o)];else if(o&&o._agentWarning){const i=o.message??o.code??"agent warning";s.warnings=[...s.warnings,`${On.global.t("warnings.noteLabel")}: ${i}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Rve(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Bve(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"||qa(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:Rve(a.status)}]:[]})}}return[]}const Dve=["queued","working","suspended","completed","failed"];function XE(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Pve(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Hve(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:XE(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=Pve();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 Wve(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Dve)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function zve(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:XE(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 xr=qE(),Vi=lge(),vf=mge(),QE=Pt.permission,JE=Pt.activeWorkspace,eT=Pt.planMode,tT=Pt.swarmMode,O3=40401,nT=Pt.onboarded;Oa(Pt.codeFont);Oa(Pt.theme);Oa(Pt.thinking);function Uve(){try{const e=ss(QE);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function qve(e){try{ps(QE,e)}catch{}}function R3(e){const t=ss(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 sT(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ps(e,JSON.stringify(n))}catch{}}function oT(){sT(eT,Me.planModeBySession)}function iT(){sT(tT,Me.swarmModeBySession)}function jve(){try{return ss(JE)}catch{return null}}const rT=Pt.hiddenWorkspaces;function Vve(){try{const e=ss(rT);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Kve(e){try{ps(rT,JSON.stringify(e))}catch{}}function Gve(e){try{ps(JE,e)}catch{}}function Yve(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Me=Ts({...Sve(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"dimi-web",connection:"disconnected",permission:Uve(),thinking:void 0,thinkingBySession:{},planModeBySession:R3(eT),swarmModeBySession:R3(tT),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Hk(),authReady:!1,defaultModel:null,authenticatedProviders:[],workspaces:[],activeWorkspaceId:jve(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Vve(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),db=Ts({planMode:!1,swarmMode:!1});function lT(e){Me.sessions=e}function X1(e,t){Me.sessions=Me.sessions.map(n=>n.id===e?t(n):n)}function Zve(e){Me.sessions=[e,...Me.sessions.filter(t=>t.id!==e.id)]}function Xve(e){Me.sessions=[...Me.sessions,e]}function Qve(e){Me.sessions=Me.sessions.filter(t=>t.id!==e)}function aT(){const e=Me.activeSessionId;e&&Me.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Me.unreadBySession={...Me.unreadBySession,[e]:!1},Wk({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Pt.unread&&(Me.unreadBySession=Hk(),aT())});function ik(){if(hi===null||!hi.health().stale)return;as("ws:stale-reconnect",{sessionId:Me.activeSessionId,status:"stale"}),Sr("ws: stale socket on focus, reconnecting",{activeSessionId:Me.activeSessionId}),hi.reconnect();const e=Me.activeSessionId;e&&qm.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(aT(),ik())});typeof window<"u"&&(window.addEventListener("focus",ik),window.addEventListener("online",ik));function fb(e){Me.activeSessionId=e}function Jve(e){Me.messagesBySession=e}function eye(e,t){Me.messagesBySession={...Me.messagesBySession,[e]:t}}function cT(e,t){Me.messagesBySession={...Me.messagesBySession,[e]:t(Me.messagesBySession[e]??[])}}function tye(e){const{[e]:t,...n}=Me.messagesBySession;Me.messagesBySession=n}function uT(e){hi?.unsubscribe(e),wye(e),zm.discard(({meta:t})=>t.sessionId===e),Qve(e),tye(e),delete Me.approvalsBySession[e],delete Me.questionsBySession[e],delete Me.tasksBySession[e],delete Me.gitStatusBySession[e],delete Me.lastSeqBySession[e],delete Me.compactionBySession[e],delete Me.messagesLoadingMoreBySession[e],delete Me.messagesHasMoreBySession[e],delete Me.messagesLoadMoreErrorBySession[e],delete rk[e],Um.delete(e),Ip.delete(e),wT.delete(e),$ge(e),delete Me.queuedBySession[e],delete Me.promptIdBySession[e],delete Me.inFlightBySession[e],delete Me.turnActiveBySession[e],delete Me.planModeBySession[e],delete Me.swarmModeBySession[e],delete Me.thinkingBySession[e],oT(),iT()}const dT=se(null),fT=se([]),hT=se(!1),pT=se(!1),mT=se(null);async function Rf(e){let t;try{t=await mt().getSessionStatus(e)}catch{return}X1(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Me.swarmModeBySession={...Me.swarmModeBySession,[e]:t.swarmMode},Me.planModeBySession={...Me.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(Me.thinkingBySession={...Me.thinkingBySession,[e]:t.thinkingEffort})}function gT(e,t){const n=t??Me.activeSessionId;return n?Promise.resolve(mt().updateSession(n,e)).then(()=>Rf(n)).then(()=>!0).catch(s=>(Bf("persistSessionProfile",s,{sessionId:n}),!1)):Promise.resolve(!1)}const vT=Pt.conversationToc;function nye(){try{const e=ss(vT);return e===null?!0:e==="true"}catch{return!0}}function sye(e){try{ps(vT,e?"true":"false")}catch{}}const yT=se(nye());function oye(e){yT.value=e,sye(e)}function iye(e){try{return ss(e)??""}catch{return""}}const kT=se(iye(nT)==="1");function rye(e){kT.value=e;try{ps(nT,e?"1":"0")}catch{}}let hi=null,B3=0;function bT(){return B3+=1,`msg_opt_${Date.now().toString(36)}_${B3}`}function lye(e,t,n){const s={sessions:Me.sessions,activeSessionId:Me.activeSessionId,messagesBySession:Me.messagesBySession,approvalsBySession:Me.approvalsBySession,planReviewByToolCallId:Me.planReviewByToolCallId,questionsBySession:Me.questionsBySession,tasksBySession:Me.tasksBySession,lastSeqBySession:Me.lastSeqBySession,turnActiveBySession:Me.turnActiveBySession,compactionBySession:Me.compactionBySession,config:Me.config,warnings:Me.warnings},o=Ove(s,e,{sessionId:t,seq:n});lT(o.sessions),fb(o.activeSessionId),Jve(o.messagesBySession),Me.approvalsBySession=o.approvalsBySession,Me.planReviewByToolCallId=o.planReviewByToolCallId,Me.questionsBySession=o.questionsBySession,Me.tasksBySession=o.tasksBySession,Me.lastSeqBySession=o.lastSeqBySession,Me.turnActiveBySession=o.turnActiveBySession,Me.compactionBySession=o.compactionBySession,Me.config=o.config??null,Me.warnings=o.warnings,e.type==="configChanged"&&(Me.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Ln.loadModels(),Ln.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Me.swarmModeBySession={...Me.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Me.planModeBySession={...Me.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(Me.thinkingBySession={...Me.thinkingBySession,[e.sessionId]:e.thinking}))}function aye(e,t){const n=Me.lastSeqBySession[t.sessionId]??0,s=Me.turnActiveBySession[t.sessionId]??!1;lye(e,t.sessionId,t.seq);const o=no.sideChatTargetBySession.value[t.sessionId];if(o){const{agentId:i}=o,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&no.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?no.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?no.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&no.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;Me.promptIdBySession[i]!==e.message.promptId&&(Me.promptIdBySession={...Me.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===Me.activeSessionId&&xr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;Ake(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",s)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&s||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&Cke(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&Me.promptIdBySession[e.sessionId]===e.promptId&>.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&Mke(e.sessionId,e.question),e.type==="approvalRequested"&&Eke(e.sessionId,e.approval)}const zm=T0e(({appEvent:e,meta:t})=>aye(e,t),({appEvent:e})=>C0e(e),{coalesce:I0e});function xT(){if(hi!==null||typeof WebSocket>"u")return;as("ws:connection",{status:"connecting"}),Me.connection="connecting",hi=mt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){gt.applyWorkspaceEvent(t);return}for(const s of N0e({appEvent:t,meta:n}))zm(s)},onResync(t,n,s){as("ws:resync",{sessionId:t,status:"required",seq:n}),zm.flush(),Um.add(t),qm.request(t)},onError(t,n,s){as("ws:error",{status:"failed",errorCode:t,fatal:s}),hb({severity:"error",title:On.global.t("warnings.wsTitle"),message:n,details:[Vn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){as("ws:connection",{status:t?"connected":"disconnected"}),Me.connected=t,Me.connection=t?"connected":"disconnected",t&&(gye(),gt.refreshServerMeta())}})}const rk={},Um=new Set,Ip=new Set,wT=new Set;function cye(e){return Si(e)&&e.code===O3?!0:typeof e=="object"&&e!==null&&e.code===O3}function Vn(e,t){if(!(t==null||t===""))return{label:On.global.t(`warnings.details.${e}`),value:_T(t)}}function _T(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 uye(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function dye(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function fye(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function hye(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function D3(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function pye(e,t,n){const s=H2(t),o=Si(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Vn("operation",e),Vn("sessionId",n??Me.activeSessionId),Vn("connection",Me.connection),Vn("timestamp",hye(i??Date.now()))];return s?l.push(Vn("duration",D3(r)),Vn("request",`${t.method} ${t.path}`),Vn("endpoint",t.url),Vn("requestId",t.requestId),Vn("phase",t.phase),Vn("timeout",`${t.timeoutMs}ms`),Vn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Vn("contentType",t.contentType),Vn("responsePreview",t.bodyPreview),Vn("cause",t.cause)):o?l.push(Vn("duration",D3(r)),Vn("code",t.code),Vn("requestId",t.requestId),Vn("message",t.message),Vn("details",t.details)):l.push(Vn("errorName",uye(t)),Vn("message",dye(t)??_T(t)),Vn("stack",fye(t))),l.filter(a=>a!==void 0)}function mye(e,t,n={}){const s=H2(t),o=Si(t),i=n.title??(s?On.global.t("warnings.daemonNetworkTitle"):o?On.global.t("warnings.daemonApiTitle"):On.global.t("warnings.operationFailedTitle")),r=n.message??(s?On.global.t("warnings.daemonNetworkMessage"):o?t.message:On.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:pye(e,t,n.sessionId)}}function hb(e){Me.warnings=[...Me.warnings,e]}function gye(){const e=On.global.t("warnings.wsTitle"),t=Me.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Me.warnings.length&&(Me.warnings=t)}function Bf(e,t,n){console.error(`[dimi-web] operation failed: ${e}`,t);const s=Si(t),o=H2(t);as("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:s?t.code:void 0,requestId:s||o?t.requestId:void 0,phase:o?t.phase:void 0,httpStatus:o?t.status:void 0}),hb(mye(e,t,n))}async function vye(e){if(uT(e),Me.activeSessionId!==e)return;const t=Me.sessions[0];t?await gt.selectSession(t.id,{urlMode:"replace"}):(fb(void 0),Me.sessionLoading=!1,gt.writeSessionUrl(void 0,"replace"))}const P3=new Set;async function yye(e){if(!P3.has(e)){P3.add(e);try{const t=await mt().getSessionWarnings(e),n=On.global.t("warnings.noteLabel");for(const s of t)hb(`${n}: ${s.message}`)}catch{}}}async function pb(e){const t=gt.localTurnStartState(e);try{const s=await mt().getSessionSnapshot(e);if(!Me.sessions.some(a=>a.id===e))return"ok";zm.flush();const o=Me.lastSeqBySession[e]??0,i=rk[e];if(!(Um.has(e)||jm.has(e))&&i!==void 0&&i===s.epoch&&o>s.asOfSeq)return Ip.delete(e)||(Ip.add(e),qm.request(e)),"ok";if(!gt.isLocalTurnSnapshotCurrent(e,t))return gt.afterLocalTurnStartsSettle(e,()=>{qm.request(e)}),"ok";const l=qy(s.session.usage);X1(e,a=>({...s.session,model:s.session.model&&s.session.model.length>0?s.session.model:a.model,usage:l?a.usage:s.session.usage})),eye(e,x0e(Me.messagesBySession[e]??[],s.messages)),Me.tasksBySession={...Me.tasksBySession,[e]:w0e(s.subagents,Me.tasksBySession[e]??[])},Me.messagesHasMoreBySession={...Me.messagesHasMoreBySession,[e]:s.hasMoreMessages},Me.approvalsBySession={...Me.approvalsBySession,[e]:s.pendingApprovals};for(const a of s.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(Me.planReviewByToolCallId={...Me.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}Me.questionsBySession={...Me.questionsBySession,[e]:s.pendingQuestions},Me.lastSeqBySession={...Me.lastSeqBySession,[e]:s.asOfSeq},rk[e]=s.epoch,Um.delete(e),Ip.delete(e),gt.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,busy:s.session.busy});{const a={...Me.turnActiveBySession};s.session.mainTurnActive??(s.inFlightTurn!==null&&s.session.busy)?a[e]=!0:delete a[e],Me.turnActiveBySession=a}return xT(),hi&&(hi.seedSnapshot(e,s),hi.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),xye(e)),jm.delete(e),l&&Rf(e),yye(e),"ok"}catch(n){return cye(n)?(await vye(e),"not-found"):(Bf("getSessionSnapshot",n,{title:On.global.t("warnings.sessionSnapshotTitle"),message:On.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const qm=_0e(pb);function kye(e){return Object.prototype.hasOwnProperty.call(Me.messagesBySession,e)}const bye=4,wr=[],jm=new Set;function xye(e){const t=wr.indexOf(e);for(t!==-1&&wr.splice(t,1),wr.unshift(e);wr.length>bye;){let n=-1;for(let o=wr.length-1;o>=0;o--)if(wr[o]!==Me.activeSessionId){n=o;break}if(n===-1)break;const[s]=wr.splice(n,1);if(s===void 0)break;hi?.unsubscribe(s),jm.add(s)}}function wye(e){const t=wr.indexOf(e);t!==-1&&wr.splice(t,1),jm.delete(e)}async function _ye(e){return pb(e)}function mb(e,t){return(Me.inFlightBySession[e]??!1)||(Me.turnActiveBySession[e]??!1)||(t??Me.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function gb(e){try{const t=new Date(e),s=Date.now()-t.getTime(),o=s/36e5;if(s<6e4)return On.global.t("sessions.justNow");if(o<1)return`${Math.round(s/6e4)}m`;if(o<24)return`${Math.round(o)}h`;const i=s/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const Sye=3e4,yf=se(0);let Tv=null;function Cye(){Tv===null&&(Tv=setInterval(()=>{yf.value=(yf.value+1)%Number.MAX_SAFE_INTEGER},Sye),Tv.unref?.())}function Aye(e,t){const n=e.split(`
|
|
335
|
+
`),s=t.split(`
|
|
336
|
+
`),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 Mye(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:Aye(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 Eye(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 Tye(e){const t=Me.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Nye(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=On.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=On.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??Tye(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 Iye=D(()=>{const e=Me.sessions.find(n=>n.id===Me.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Me.workspaceName,branch:t}}),Lye=D(()=>(yf.value,Me.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:gb(e.updatedAt),busy:mb(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),$ye=D(()=>Me.activeSessionId??""),Fye=D(()=>{const e=Me.activeSessionId;if(e)return Ln.skillsBySession.value[e]??[];const t=J1.value;return t?Ln.skillsByWorkspace.value[t]??[]:[]}),vb=D(()=>{const e=Me.activeSessionId;return e?Me.inFlightBySession[e]??!1:!1}),Oye=D(()=>gt.isStartingFirstPrompt()),no=wve(Me,{pushOperationFailure:Bf,nextOptimisticMsgId:bT,connectEventsIfNeeded:xT,getEventConn:()=>hi,resolveThinkingForPrompt:(e,t)=>Ln.resolveThinkingForPrompt(e,t)}),Df=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=no.sideChatTargetBySession.value[e]?.agentId;return(Me.tasksBySession[e]??[]).filter(n=>n.id!==t)}),ST=yge(Me,Df),Rye=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=new Set(Me.sideChatUserMessageIdsBySession[e]??[]),n=(Me.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Me.approvalsBySession[e]??[];return ZE(n,s,o=>mt().getFileUrl(o),Q1.value,Me.planReviewByToolCallId)}),Q1=D(()=>{const e=Me.activeSessionId;return e?(Me.turnActiveBySession[e]??!1)||(Me.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),Bye=D(()=>vb.value||Q1.value),Dye=D(()=>(ST.taskClock.value,Df.value.map(Nye))),CT=D(()=>Hve(Df.value)),Pye=D(()=>zve(Df.value)),Hye=D(()=>{const e=Me.activeSessionId;return e?Bve(Me.messagesBySession[e]??[]):[]}),Wye=D(()=>{const e=Me.activeSessionId;return e?Me.compactionBySession[e]??null:null}),zye=D(()=>Me.connection),Uye=D(()=>Me.loading),qye=D(()=>Me.sessionLoading),jye=D(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadingMoreBySession[e]??!1:!1}),Vye=D(()=>{const e=Me.activeSessionId;return e?Me.messagesHasMoreBySession[e]??!1:!1}),Kye=D(()=>{const e=Me.activeSessionId;return e?Me.messagesLoadMoreErrorBySession[e]??!1:!1}),Gye=D(()=>Me.serverVersion),Yye=D(()=>Me.dangerousBypassAuth);function Zye(){Me.dangerousBypassAuth=!1}const Xye=D(()=>Me.permission),Qye=D(()=>Me.thinking),AT=D(()=>{const e=Me.activeSessionId;return e?Me.planModeBySession[e]??!1:db.planMode}),Jye=D(()=>{const e=Me.activeSessionId;return e?Me.swarmModeBySession[e]??!1:db.swarmMode}),eke=D(()=>{const e=Wve(CT.value);return{plan:AT.value,swarm:e.total>0?e:null}}),tke=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=mt();return(Me.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId),name:s.name}))}))}),nke=D(()=>Me.warnings),ske=D(()=>{const e=Me.activeSessionId;return e?(Me.questionsBySession[e]??[]).map(Eye):[]}),oke=D(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Mye(t),agentName:t.agentName})):[]}),yb=D(()=>{const e=Me.activeSessionId;return e?(Me.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Me.questionsBySession[e]??[]).length>0?"awaiting-question":vb.value||Q1.value?"running":"idle":"idle"}),Ln=Pge(Me,{pushOperationFailure:Bf,refreshSessionStatus:Rf,persistSessionProfile:gT,activity:yb,updateSession:X1,updateSessionMessages:cT}),lk=D(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),ike=D(()=>{const e=Me.activeSessionId;return e?Me.gitStatusBySession[e]?.pullRequest??null:null}),rke=D(()=>{const e=Me.activeSessionId;if(!e)return[];const t=Me.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),lke=D(()=>{const e=Me.activeSessionId;if(!e)return null;const t=Me.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),MT=D(()=>{const e=Me.sessions.find(r=>r.id===Me.activeSessionId),t=lk.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Ln.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Me.defaultModel)??"—",o=Ln.models.value.find(r=>r.id===s)??Ln.models.value.find(r=>r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Me.permission,branch:t,cwd:e?.cwd??"",isGitRepo:lk.value!==null}}),ake=D(()=>fT.value),cke=D(()=>Me.sessions.find(t=>t.id===Me.activeSessionId)?.usage.totalCostUsd??0),uke=D(()=>Me.authReady),dke=D(()=>Me.defaultModel),fke=D(()=>Me.authenticatedProviders),hke=D(()=>Me.config),pke=D(()=>{const e=Me.activeSessionId;if(!e)return{};const t=Me.gitStatusBySession[e];return t?{...t.entries}:{}});function du(e){const t=Mi(e.cwd);return Me.workspaces.find(n=>Mi(n.root)===t)?.id??e.workspaceId??e.cwd}const kb=D(()=>b0e({workspaces:Me.workspaces,sessions:Me.sessions,hiddenWorkspaceRoots:Me.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Me.sessionsHasMoreByWorkspace})),Vm=se(U$()),fu=se(q$()==="manual"?"manual":"recent");Je(()=>[kb.value.map(e=>e.id).join("\0"),Me.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=j$(n,Vm.value);s!==null&&(Vm.value=s,JM(s))});const za=D(()=>{const e=kb.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Yve(t.root,Me.fsHome),sessionCount:t.sessionCount}));if(fu.value==="recent"){const t=new Map;for(const n of Me.sessions){if(n.parentSessionId)continue;const s=du(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return G$(e,t)}return V$(e,Vm.value)}),J1=D(()=>{const e=Me.activeWorkspaceId,t=za.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Je(J1,e=>{e&&(Object.prototype.hasOwnProperty.call(Ln.skillsByWorkspace.value,e)||Ln.loadSkillsForWorkspace(e))},{immediate:!0});const mke=D(()=>{const e=J1.value;return e?za.value.find(t=>t.id===e)??null:null}),gke=D(()=>{yf.value;const e=new Set(za.value.map(n=>n.id)),t=new Map(za.value.map(n=>[n.id,n.name]));return Me.sessions.filter(n=>!n.parentSessionId&&e.has(du(n))).map(n=>{const s=du(n);return{id:n.id,title:n.title,time:gb(n.updatedAt),busy:mb(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),vke=D(()=>{yf.value;const e=new Map;for(const t of Me.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=du(t),s={id:t.id,title:t.title,time:gb(t.updatedAt),busy:mb(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return za.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Me.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Me.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Me.sessionsInitialCountByWorkspace[t.id]??nk}))});function yke(e){Vm.value=e,JM(e),fu.value!=="manual"&&(fu.value="manual",e6("manual"))}function kke(e){fu.value!==e&&(fu.value=e,e6(e))}const ET=D(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),bke=D(()=>{const e={};for(const[t,n]of Object.entries(Me.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Me.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),xke=D(()=>{const e={};for(const[t,n]of Object.entries(Me.unreadBySession))n&&(e[t]=!0);return e}),wke=D(()=>{const e={},t=ET.value;for(const n of Me.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=du(n);e[o]=(e[o]??0)+s}return e}),_ke=D(()=>Me.recentRoots),Ske=D(()=>Me.availableOpenInApps),gt=Rge(Me,{taskPoller:ST,sideChat:no,modelProvider:Ln,pushOperationFailure:Bf,activity:yb,sessionsKnownEmpty:wT,setSessions:lT,updateSession:X1,upsertSessionFront:Zve,appendSession:Xve,forgetSession:uT,setActiveSessionId:fb,updateSessionMessages:cT,nextOptimisticMsgId:bT,getEventConn:()=>hi,syncSessionFromSnapshot:pb,reopenSession:_ye,hasLoadedMessages:kye,refreshSessionStatus:Rf,persistSessionProfile:gT,mergedWorkspaces:kb,workspacesView:za,status:MT,workspaceIdForSession:du,savePermissionToStorage:qve,savePlanModeToStorage:oT,saveSwarmModeToStorage:iT,draftModes:db,saveUnread:Wk,saveActiveWorkspaceToStorage:Gve,saveHiddenWorkspacesToStorage:Kve,resetFastMoon:xr.resetFastMoon,initialized:pT,connectIssue:mT,selectedDiffPath:dT,fileDiffLines:fT,fileDiffLoading:hT});function bb(e){return e===Me.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function Cke(e){if(Me.turnActiveBySession[e]){const t={...Me.turnActiveBySession};delete t[e],Me.turnActiveBySession=t}Me.inFlightBySession[e]&&(Me.inFlightBySession={...Me.inFlightBySession,[e]:!1})}function Ake(e,t,n){const s=Me.promptIdBySession[e];gt.finishPromptLocal(e,{turnWasActive:n}),e===Me.activeSessionId?(gt.loadGitStatus(e),Rf(e)):t==="idle"&&(Me.unreadBySession={...Me.unreadBySession,[e]:!0},Wk({[e]:!0}));const o=(Me.approvalsBySession[e]??[]).length>0,i=(Me.questionsBySession[e]??[]).length>0;Z0e(t,o,i)&&Vi.maybeNotifyCompletion(e,{isUserWatching:bb(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",promptId:s,onClick:()=>{gt.selectSession(e)}}),t==="idle"&&vf.maybePlayCompletionSound()}function Mke(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Vi.maybeNotifyQuestion({isUserWatching:bb(e),sessionTitle:Me.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{gt.selectSession(e)}}),vf.maybePlayQuestionSound()}function Eke(e,t){Vi.maybeNotifyApproval({isUserWatching:bb(e),sessionTitle:Me.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{gt.selectSession(e)}}),vf.maybePlayApprovalSound()}function xb(){return Cye(),{workspace:Iye,sessions:Lye,activeSessionId:$ye,workspacesView:za,workspaceSortMode:fu,visibleWorkspace:mke,activeWorkspaceId:J1,sessionsForView:gke,workspaceGroups:vke,attentionBySession:ET,pendingBySession:bke,attentionByWorkspace:wke,unreadBySession:xke,recentRoots:_ke,turns:Rye,tasks:Dye,activeAppTasks:Df,todos:Hye,swarms:CT,swarmMembersByToolCallId:Pye,activationBadges:eke,compaction:Wye,status:MT,sessionCost:cke,fileDiff:ake,selectedDiffPath:dT,fileDiffLoading:hT,changes:rke,gitInfo:lk,gitDiffStats:lke,activePullRequest:ike,changesByPath:pke,pendingApprovals:oke,availableOpenInApps:Ske,connection:zye,loading:Uye,sessionLoading:qye,loadingMoreMessages:jye,hasMoreMessages:Vye,loadMoreMessagesError:Kye,serverVersion:Gye,dangerousBypassAuth:Yye,clearDangerousBypassAuth:Zye,initialized:pT,connectIssue:mT,permission:Xye,thinking:Qye,planMode:AT,swarmMode:Jye,queued:tke,warnings:nke,questions:ske,activity:yb,turnActive:Q1,inFlight:vb,working:Bye,isStartingFirstPrompt:Oye,fastMoon:xr.fastMoon,models:Ln.models,starredModelIds:Ln.starredModelIds,providers:Ln.providers,uiFontSize:xr.uiFontSize,setUiFontSize:xr.setUiFontSize,conversationToc:yT,setConversationToc:oye,colorScheme:xr.colorScheme,setColorScheme:xr.setColorScheme,accent:xr.accent,setAccent:xr.setAccent,notifyOnComplete:Vi.notifyOnComplete,notifyOnQuestion:Vi.notifyOnQuestion,notifyOnApproval:Vi.notifyOnApproval,notifyPermission:Vi.notifyPermission,setNotifyOnComplete:Vi.setNotifyOnComplete,setNotifyOnQuestion:Vi.setNotifyOnQuestion,setNotifyOnApproval:Vi.setNotifyOnApproval,soundOnComplete:vf.soundOnComplete,setSoundOnComplete:vf.setSoundOnComplete,onboarded:kT,setOnboarded:rye,load:gt.load,selectSession:gt.selectSession,clearActiveSession:gt.clearActiveSession,loadOlderMessages:gt.loadOlderMessages,loadWorkspaces:gt.loadWorkspaces,loadMoreSessions:gt.loadMoreSessions,loadAllSessions:gt.loadAllSessions,selectWorkspace:gt.selectWorkspace,openWorkspace:gt.openWorkspace,openWorkspaceDraft:gt.openWorkspaceDraft,startSessionAndSendPrompt:gt.startSessionAndSendPrompt,startSessionAndActivateSkill:gt.startSessionAndActivateSkill,startSessionAndOpenSideChat:gt.startSessionAndOpenSideChat,addWorkspaceByPath:gt.addWorkspaceByPath,browseFs:gt.browseFs,getFsHome:gt.getFsHome,sendPrompt:gt.sendPrompt,steerPrompt:gt.steerPrompt,sideChatVisible:no.sideChatVisible,sideChatSessionId:no.sideChatSessionId,sideChatTurns:no.sideChatTurns,sideChatRunning:no.sideChatRunning,sideChatSending:no.sideChatSending,openSideChat:no.openSideChat,closeSideChat:no.closeSideChat,sendSideChatPrompt:no.sendSideChatPrompt,uploadImage:gt.uploadImage,abortCurrentPrompt:gt.abortCurrentPrompt,respondApproval:gt.respondApproval,respondQuestion:gt.respondQuestion,dismissQuestion:gt.dismissQuestion,pendingQuestionActions:gt.pendingQuestionActions,pendingApprovalActions:gt.pendingApprovalActions,cancelTask:gt.cancelTask,setPermission:gt.setPermission,setThinking:Ln.setThinking,setPlanMode:gt.setPlanMode,togglePlanMode:gt.togglePlanMode,setSwarmMode:gt.setSwarmMode,toggleSwarmMode:gt.toggleSwarmMode,enqueue:gt.enqueue,dismissWarning:gt.dismissWarning,renameSession:gt.renameSession,renameWorkspace:gt.renameWorkspace,deleteWorkspace:gt.deleteWorkspace,reorderWorkspaces:yke,setWorkspaceSortMode:kke,archiveSession:gt.archiveSession,exportSession:gt.exportSession,restoreSession:gt.restoreSession,loadArchivedSessions:gt.loadArchivedSessions,compact:gt.compact,forkSession:gt.forkSession,undo:gt.undo,unqueue:gt.unqueue,reorderQueue:gt.reorderQueue,searchFiles:gt.searchFiles,loadGitStatus:gt.loadGitStatus,loadFileDiff:gt.loadFileDiff,clearFileDiff:gt.clearFileDiff,listDir:gt.listDir,readFileContent:gt.readFileContent,getFileDownloadUrl:gt.getFileDownloadUrl,openWorkspaceFile:gt.openWorkspaceFile,openInApp:gt.openInApp,revealWorkspaceFile:gt.revealWorkspaceFile,resolveImageUrl:gt.resolveImageUrl,loadModels:Ln.loadModels,loadProviders:Ln.loadProviders,skills:Fye,activateSkill:Ln.activateSkill,setModel:Ln.setModel,toggleStarModel:Ln.toggleStarModel,loginProviderApiKey:Ln.loginProviderApiKey,logoutProvider:Ln.logoutProvider,refreshProvider:Ln.refreshProvider,refreshAllProviders:Ln.refreshAllProviders,authReady:uke,defaultModel:dke,authenticatedProviders:fke,config:hke,updateConfig:gt.updateConfig,checkAuth:gt.checkAuth,startOAuthLogin:Ln.startOAuthLogin,pollOAuthLogin:Ln.pollOAuthLogin,cancelOAuthLogin:Ln.cancelOAuthLogin,logout:gt.logout}}const TT=Xe({__name:"LanguageSwitcher",setup(e){const{locale:t}=Ot(),n=s6.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&o6(o)}return(o,i)=>(x(),Ae(ro,{"model-value":A(t),options:A(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),Tke=["aria-checked","aria-label","disabled"],Nke=Xe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(x(),E("button",{class:He(["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]=[S("span",{class:"ui-switch__thumb"},null,-1)])],10,Tke))}}),pr=dt(Nke,[["__scopeId","data-v-b35d3d03"]]),Ike=["value","disabled"],Lke=Xe({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(x(),E("select",{class:He(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Rn(o.$slots,"default",{},void 0,!0)],42,Ike))}}),H3=dt(Lke,[["__scopeId","data-v-b569f3aa"]]),$ke=["aria-label"],Fke=["aria-selected","onClick"],Oke={class:"body"},Rke={class:"panel"},Bke={class:"sec"},Dke={class:"sec-title"},Pke={class:"row"},Hke={class:"rlabel"},Wke={class:"row"},zke={class:"rlabel"},Uke={class:"row"},qke={class:"rlabel"},jke={class:"num-field"},Vke=["value","aria-label"],Kke={class:"row"},Gke={class:"rlabel"},Yke={class:"row"},Zke={class:"rlabel"},Xke={class:"hint"},Qke={class:"sec"},Jke={class:"sec-title"},e2e={class:"row"},t2e={class:"rlabel"},n2e={key:0,class:"hint"},s2e={class:"row"},o2e={class:"rlabel"},i2e={key:0,class:"hint"},r2e={class:"row"},l2e={class:"rlabel"},a2e={key:0,class:"hint"},c2e={class:"row"},u2e={class:"rlabel"},d2e={class:"panel"},f2e={class:"sec"},h2e={class:"sec-title"},p2e={class:"row"},m2e={class:"rlabel"},g2e={key:0,class:"rvalue"},v2e={class:"actions"},y2e={class:"panel"},k2e={class:"sec"},b2e={class:"sec-head"},x2e={class:"sec-title"},w2e={key:0,class:"saving"},_2e={class:"row"},S2e={class:"rlabel"},C2e={class:"hint"},A2e={key:0,class:"select-wrap"},M2e={key:0,value:"",disabled:""},E2e=["label"],T2e=["value"],N2e={key:1,class:"rvalue mono"},I2e={class:"row"},L2e={class:"rlabel"},$2e={class:"hint"},F2e={class:"row"},O2e={class:"rlabel"},R2e={class:"hint"},B2e={class:"row"},D2e={class:"rlabel"},P2e={class:"hint"},H2e={class:"row"},W2e={class:"rlabel"},z2e={class:"hint"},U2e={key:1,class:"empty-config"},q2e={class:"panel"},j2e={class:"sec"},V2e={class:"sec-title"},K2e={class:"row"},G2e={class:"rlabel"},Y2e={class:"rvalue mono"},Z2e={class:"row"},X2e={class:"rlabel"},Q2e={class:"rvalue mono"},J2e={key:0,class:"row"},ebe={class:"rlabel"},tbe={class:"hint"},nbe={class:"hint"},sbe={class:"row"},obe={class:"rlabel"},ibe={key:0,class:"hint"},rbe={class:"panel"},lbe={class:"panel-head"},abe={class:"panel-title"},cbe={class:"panel-desc"},ube={class:"archive-toolbar"},dbe={class:"archive-search"},fbe=["placeholder"],hbe={value:"all"},pbe=["value"],mbe={key:0,class:"archive-empty"},gbe={key:0,class:"archive-list"},vbe={class:"archive-workspace"},ybe={class:"path"},kbe={class:"count"},bbe={class:"setting-card"},xbe={class:"archive-meta"},wbe={class:"archive-name"},_be={class:"archive-time"},Sbe={key:1,class:"archive-empty"},Cbe=100,Abe=Xe({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=se("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=Joe(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=se(null);X2(u);function d(U){U.key==="Escape"&&o("close")}mn(()=>document.addEventListener("keydown",d)),Cn(()=>document.removeEventListener("keydown",d));function f(){mE()}const h=D(()=>(s.models??[]).map(U=>({id:U.id,label:U.displayName??U.model??U.id,provider:U.provider}))),p=D(()=>{const U=new Map;for(const j of h.value){const te=U.get(j.provider)??[];te.push(j),U.set(j.provider,te)}for(const j of U.values())j.sort((te,ae)=>te.label.localeCompare(ae.label));return Array.from(U.entries()).toSorted(([j],[te])=>j.localeCompare(te)).map(([j,te])=>({provider:j,options:te}))}),m=D(()=>{const U=s.config?.defaultPermissionMode;return U==="auto"||U==="yolo"||U==="manual"?U:"manual"});function y(U){return U===!0}function k(U){!U||U===s.config?.defaultModel||o("updateConfig",{defaultModel:U})}function g(U){U!==m.value&&o("updateConfig",{defaultPermissionMode:U})}function v(U){const j=s.config?.[U];o("updateConfig",{[U]:!y(j)})}function b(){const U=s.config?.thinking;return!U||typeof U!="object"?!0:U.enabled!==!1}function C(){o("updateConfig",{thinking:{enabled:!b()}})}function I(){const U=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!U})}function T(U){i.value=U}const M=xb(),$=se([]),N=se(!1),F=se(!1),_=se(""),R=se("all"),z=se("archived-desc");async function W(){if(!(N.value||F.value)){N.value=!0;try{const U=[];let j;for(;;){const te=await M.loadArchivedSessions({beforeId:j,pageSize:Cbe});if(U.push(...te.items),!te.hasMore||te.items.length===0)break;const ae=te.items.at(-1)?.id;if(ae===void 0)break;j=ae}$.value=U,F.value=!0}catch(U){console.warn("loadAllArchived failed",U)}finally{N.value=!1}}}Je(i,U=>{U==="archived"&&!F.value&&W()});const L=D(()=>{const U=new Set;for(const j of $.value)U.add(j.cwd);return Array.from(U).sort((j,te)=>j.localeCompare(te))}),O=D(()=>{const U=_.value.trim().toLowerCase();let j=$.value.filter(te=>te.archived===!0);return R.value!=="all"&&(j=j.filter(te=>te.cwd===R.value)),U&&(j=j.filter(te=>te.title.toLowerCase().includes(U))),j=j.slice(),z.value==="archived-desc"?j.sort((te,ae)=>ae.updatedAt.localeCompare(te.updatedAt)):z.value==="created-desc"?j.sort((te,ae)=>ae.createdAt.localeCompare(te.createdAt)):j.sort((te,ae)=>te.title.localeCompare(ae.title,"zh")),j}),q=D(()=>{const U=new Map;for(const j of O.value){const te=U.get(j.cwd)??[];te.push(j),U.set(j.cwd,te)}return Array.from(U.entries()).map(([j,te])=>({cwd:j,items:te}))});async function X(U){await M.restoreSession(U)&&($.value=$.value.filter(te=>te.id!==U))}function ie(U){const j=new Date(U);if(Number.isNaN(j.getTime()))return U;const te=ae=>String(ae).padStart(2,"0");return`${j.getFullYear()}-${te(j.getMonth()+1)}-${te(j.getDate())} ${te(j.getHours())}:${te(j.getMinutes())}`}return(U,j)=>(x(),Ae(Hr,{open:!0,"close-on-esc":!1,title:A(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:j[19]||(j[19]=te=>o("close"))},{default:Fe(()=>[S("div",{ref_key:"dialogRef",ref:u,class:"sd"},[S("nav",{class:"settings-tabs",role:"tablist","aria-label":A(n)("settings.title")},[(x(),E(De,null,rt(r,te=>S("button",{key:te.id,type:"button",class:He(["tab",{on:i.value===te.id}]),role:"tab","aria-selected":i.value===te.id,onClick:ae=>T(te.id)},B(A(n)(te.labelKey)),11,Fke)),64))],8,$ke),S("div",Oke,[Fn(S("section",Rke,[S("section",Bke,[S("h3",Dke,B(A(n)("settings.appearance")),1),S("div",Pke,[S("span",Hke,B(A(n)("theme.colorSchemeLabel")),1),ve(ro,{"model-value":e.colorScheme,options:[{value:"light",label:A(n)("theme.light")},{value:"dark",label:A(n)("theme.dark")},{value:"system",label:A(n)("theme.system")}],"onUpdate:modelValue":j[0]||(j[0]=te=>o("setColorScheme",te))},null,8,["model-value","options"])]),S("div",Wke,[S("span",zke,B(A(n)("theme.accentLabel")),1),ve(ro,{"model-value":e.accent,options:[{value:"blue",label:A(n)("theme.accentBlue")},{value:"mono",label:A(n)("theme.accentBlack")}],"onUpdate:modelValue":j[1]||(j[1]=te=>o("setAccent",te))},null,8,["model-value","options"])]),S("div",Uke,[S("span",qke,B(A(n)("settings.uiFontSize")),1),S("label",jke,[S("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:j[2]||(j[2]=te=>o("setUiFontSize",Number(te.target.value)))},null,40,Vke),j[20]||(j[20]=S("span",{class:"num-unit"},"px",-1))])]),S("div",Kke,[S("span",Gke,B(A(n)("sidebar.language")),1),ve(TT)]),S("div",Yke,[S("span",Zke,[tt(B(A(n)("settings.conversationToc"))+" ",1),S("span",Xke,B(A(n)("settings.conversationTocHint")),1)]),ve(pr,{"model-value":e.conversationToc??!0,label:A(n)("settings.conversationToc"),"onUpdate:modelValue":j[3]||(j[3]=te=>o("setConversationToc",te))},null,8,["model-value","label"])])]),S("section",Qke,[S("h3",Jke,B(A(n)("settings.notifications")),1),S("div",e2e,[S("span",t2e,[tt(B(A(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",n2e,B(A(n)("settings.notifyDenied")),1)):ge("",!0)]),ve(pr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnComplete"),"onUpdate:modelValue":j[4]||(j[4]=te=>o("setNotify",te))},null,8,["model-value","disabled","label"])]),S("div",s2e,[S("span",o2e,[tt(B(A(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",i2e,B(A(n)("settings.notifyDenied")),1)):ge("",!0)]),ve(pr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":j[5]||(j[5]=te=>o("setNotifyQuestion",te))},null,8,["model-value","disabled","label"])]),S("div",r2e,[S("span",l2e,[tt(B(A(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",a2e,B(A(n)("settings.notifyDenied")),1)):ge("",!0)]),ve(pr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnApproval"),"onUpdate:modelValue":j[6]||(j[6]=te=>o("setNotifyApproval",te))},null,8,["model-value","disabled","label"])]),S("div",c2e,[S("span",u2e,B(A(n)("settings.soundOnComplete")),1),ve(pr,{"model-value":e.sound,label:A(n)("settings.soundOnComplete"),"onUpdate:modelValue":j[7]||(j[7]=te=>o("setSound",te))},null,8,["model-value","label"])])])],512),[[ci,i.value==="general"]]),Fn(S("section",d2e,[S("section",f2e,[S("h3",h2e,B(A(n)("settings.account")),1),S("div",p2e,[S("span",m2e,B(e.authReady?e.accountModel?.split("/")[0]??A(n)("providers.status.connected"):A(n)("sidebar.notSignedIn")),1),ve(en,{text:e.accountModel},{default:Fe(()=>[e.authReady&&e.accountModel?(x(),E("span",g2e,B(e.accountModel),1)):ge("",!0)]),_:1},8,["text"])]),S("div",v2e,[ve(Kt,{variant:"secondary",size:"sm",onClick:j[8]||(j[8]=te=>{o("openOnboarding"),o("close")})},{default:Fe(()=>[tt(B(A(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),Ae(Kt,{key:0,variant:"danger-soft",size:"sm",onClick:j[9]||(j[9]=te=>o("logout"))},{default:Fe(()=>[tt(B(A(n)("sidebar.signOut")),1)]),_:1})):(x(),Ae(Kt,{key:1,variant:"primary",size:"sm",onClick:j[10]||(j[10]=te=>o("login"))},{default:Fe(()=>[tt(B(A(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[ci,i.value==="account"]]),Fn(S("section",y2e,[S("section",k2e,[S("div",b2e,[S("h3",x2e,B(A(n)("settings.agentDefaults")),1),e.configSaving?(x(),E("span",w2e,B(A(n)("settings.saving")),1)):ge("",!0)]),e.config?(x(),E(De,{key:0},[S("div",_2e,[S("span",S2e,[tt(B(A(n)("settings.defaultModel"))+" ",1),S("span",C2e,B(A(n)("settings.defaultModelHint")),1)]),p.value.length>0?(x(),E("div",A2e,[ve(H3,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":A(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Fe(()=>[e.config.defaultModel?ge("",!0):(x(),E("option",M2e,B(A(n)("settings.noDefaultModel")),1)),(x(!0),E(De,null,rt(p.value,te=>(x(),E("optgroup",{key:te.provider,label:te.provider},[(x(!0),E(De,null,rt(te.options,ae=>(x(),E("option",{key:ae.id,value:ae.id},B(ae.label),9,T2e))),128))],8,E2e))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),E("span",N2e,B(e.config.defaultModel??A(n)("settings.noDefaultModel")),1))]),S("div",I2e,[S("span",L2e,[tt(B(A(n)("settings.defaultPermission"))+" ",1),S("span",$2e,B(A(n)("settings.defaultPermissionHint")),1)]),ve(ro,{"model-value":m.value,options:a.map(te=>({value:te,label:A(n)(c[te])})),"onUpdate:modelValue":j[11]||(j[11]=te=>g(te))},null,8,["model-value","options"])]),S("div",F2e,[S("span",O2e,[tt(B(A(n)("settings.defaultThinking"))+" ",1),S("span",R2e,B(A(n)("settings.defaultThinkingHint")),1)]),ve(pr,{"model-value":b(),disabled:e.configSaving,label:A(n)("settings.defaultThinking"),"onUpdate:modelValue":j[12]||(j[12]=te=>C())},null,8,["model-value","disabled","label"])]),S("div",B2e,[S("span",D2e,[tt(B(A(n)("settings.defaultPlanMode"))+" ",1),S("span",P2e,B(A(n)("settings.defaultPlanModeHint")),1)]),ve(pr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:A(n)("settings.defaultPlanMode"),"onUpdate:modelValue":j[13]||(j[13]=te=>v("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),S("div",H2e,[S("span",W2e,[tt(B(A(n)("settings.mergeSkills"))+" ",1),S("span",z2e,B(A(n)("settings.mergeSkillsHint")),1)]),ve(pr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:A(n)("settings.mergeSkills"),"onUpdate:modelValue":j[14]||(j[14]=te=>v("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),E("div",U2e,B(A(n)("settings.configUnavailable")),1))])],512),[[ci,i.value==="agent"]]),Fn(S("section",q2e,[S("section",j2e,[S("h3",V2e,B(A(n)("settings.advanced")),1),S("div",K2e,[S("span",G2e,B(A(n)("sidebar.daemon")),1),S("span",Y2e,B(A(l)),1)]),S("div",Z2e,[S("span",X2e,B(A(n)("settings.serverVersion")),1),S("span",Q2e,B(e.serverVersion||"-"),1)]),e.config?(x(),E("div",J2e,[S("span",ebe,[tt(B(A(n)("settings.telemetry"))+" ",1),S("span",tbe,B(A(n)("settings.telemetryHint")),1),S("span",nbe,B(A(n)("settings.telemetryRestartHint")),1)]),ve(pr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:A(n)("settings.telemetry"),"onUpdate:modelValue":j[15]||(j[15]=te=>I())},null,8,["model-value","disabled","label"])])):ge("",!0),S("div",sbe,[S("span",obe,[tt(B(A(n)("settings.exportLog"))+" ",1),A($i)()?ge("",!0):(x(),E("span",ibe,B(A(n)("settings.logHint")),1))]),ve(Kt,{variant:"secondary",size:"sm",onClick:f},{default:Fe(()=>[tt(B(A(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[ci,i.value==="advanced"]]),Fn(S("section",rbe,[S("div",lbe,[j[21]||(j[21]=S("div",{class:"panel-kicker"},"Archived sessions",-1)),S("h4",abe,B(A(n)("settings.archivedTitle")),1),S("p",cbe,B(A(n)("settings.archivedDesc")),1)]),S("div",ube,[S("label",dbe,[j[22]||(j[22]=S("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[S("circle",{cx:"11",cy:"11",r:"7"}),S("path",{d:"m21 21-4.3-4.3"})],-1)),Fn(S("input",{"onUpdate:modelValue":j[16]||(j[16]=te=>_.value=te),placeholder:A(n)("settings.archivedSearch")},null,8,fbe),[[po,_.value]])]),ve(H3,{"model-value":R.value,size:"sm","aria-label":A(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":j[17]||(j[17]=te=>R.value=te)},{default:Fe(()=>[S("option",hbe,B(A(n)("settings.archivedAllWorkspaces")),1),(x(!0),E(De,null,rt(L.value,te=>(x(),E("option",{key:te,value:te},B(te),9,pbe))),128))]),_:1},8,["model-value","aria-label"]),ve(ro,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:A(n)("settings.archivedSortArchived")},{value:"created-desc",label:A(n)("settings.archivedSortCreated")},{value:"name-asc",label:A(n)("settings.archivedSortName")}],"onUpdate:modelValue":j[18]||(j[18]=te=>z.value=te)},null,8,["model-value","options"])]),N.value?(x(),E("div",mbe,B(A(n)("settings.archivedLoadingAll")),1)):(x(),E(De,{key:1},[q.value.length>0?(x(),E("div",gbe,[(x(!0),E(De,null,rt(q.value,te=>(x(),E("section",{key:te.cwd,class:"archive-card"},[S("div",vbe,[j[23]||(j[23]=S("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[S("path",{d:"M3 7h6l2 2h10v9H3z"}),S("path",{d:"M3 7V5h6l2 2"})],-1)),S("span",ybe,B(te.cwd),1),S("span",kbe,B(A(n)("settings.archivedSessionsCount",{count:te.items.length})),1)]),S("div",bbe,[(x(!0),E(De,null,rt(te.items,ae=>(x(),E("div",{key:ae.id,class:"archive-row"},[S("div",xbe,[S("div",wbe,B(ae.title),1),S("div",_be,B(A(n)("settings.archivedAt",{time:ie(ae.updatedAt)})),1)]),ve(Kt,{variant:"secondary",size:"sm",onClick:oe=>X(ae.id)},{default:Fe(()=>[tt(B(A(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),E("div",Sbe,B($.value.length===0?A(n)("settings.archivedEmpty"):A(n)("settings.archivedNoMatch")),1))],64))],512),[[ci,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Mbe=dt(Abe,[["__scopeId","data-v-c3c3a507"]]),Ebe=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,NT=/^[A-Za-z]:[\\/]/,Tbe=/^\/\/(?!\/)/;function Nv(e){return Ebe.test(e.trim())}function Nbe(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function Ibe(e){return Tbe.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function Lbe(e){return NT.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function $be(e){return NT.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function ak(e,t){let n=Ibe(Nbe(e.trim(),t));const s=Lbe(n),o=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=s?/[\\/]$/.test(n):n.endsWith("/");!o&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=s?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=$be(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Fbe(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Obe(e,t,n){if(n===null)return null;const{target:s}=ak(e,t);return s===n?n:null}const Rbe={class:"aw"},Bbe={key:0,class:"crumbbar"},Dbe={class:"crumbs"},Pbe={key:0,class:"crumb-sep"},Hbe=["onClick"],Wbe=["placeholder"],zbe={key:2,class:"folder-list"},Ube={key:0,class:"fl-loading"},qbe={key:0,class:"fl-loading"},jbe={key:0,class:"fl-note"},Vbe=["onClick"],Kbe={class:"folder-name"},Gbe={key:1,class:"fl-empty fl-error"},Ybe={key:2,class:"fl-empty fl-error"},Zbe=["onClick"],Xbe={class:"folder-name search-rel"},Qbe={key:0,class:"fl-empty"},Jbe={key:1,class:"fl-loading"},exe=["onClick"],txe={class:"folder-name"},nxe={key:0,class:"fl-empty"},sxe={key:3,class:"degraded-hint"},oxe={key:4,class:"add-error",role:"alert"},ixe={class:"actions"},rxe={class:"footer-hint"},lxe=600,axe=6,W3=150,cxe=Xe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=se(!0),r=se(!1),l=se(!1),a=se(""),c=se(null),u=se([]),d=se(""),f=se(!1),h=se([]),p=D(()=>d.value.trim().length>0);let m=0,y=null;const k=D(()=>Nv(d.value)),g=se("idle"),v=se(""),b=se("/"),C=se([]),I=se(""),T=se(null),M=se(null),$=D(()=>g.value!=="valid"?null:Obe(d.value,I.value,M.value));let N=0,F=null;function _(oe,re){const xe=oe.toLowerCase(),pe=re.toLowerCase();let Ee=0;for(let ue=0;ue<pe.length&&Ee<xe.length;ue++)pe[ue]===xe[Ee]&&Ee++;return Ee===xe.length}async function R(oe){const re=a.value,xe=oe.trim();if(!re||xe===""){h.value=[],f.value=!1;return}const pe=++m;f.value=!0;const Ee=[],ue=[{path:re,depth:0}];let Y=0;for(;ue.length>0&&Y<lxe&&Ee.length<W3;){if(pe!==m)return;const Q=ue.shift();Y++;let P;try{P=await s.browseFs(Q.path)}catch{continue}if(pe!==m)return;for(const G of P.entries){if(!G.isDir)continue;const ye=G.path.startsWith(re)?G.path.slice(re.length).replace(/^\/+/,""):G.path;if(_(xe,ye||G.name)&&(Ee.push({path:G.path,name:G.name,rel:ye||G.name}),Ee.length>=W3))break;Q.depth+1<axe&&ue.push({path:G.path,depth:Q.depth+1})}pe===m&&(h.value=[...Ee])}pe===m&&(f.value=!1)}Je(d,oe=>{y&&clearTimeout(y),F&&clearTimeout(F),N++,g.value="idle",C.value=[],M.value=null;const re=oe.trim();if(re===""){m++,h.value=[],f.value=!1;return}if(Nv(re)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void z(re),150);return}y=setTimeout(()=>void R(oe),220)});async function z(oe){const re=++N;g.value="checking",M.value=null;const xe=ak(oe,I.value),{target:pe}=xe;try{const ue=await s.browseFs(pe);if(re!==N)return;if(ue.path){g.value="valid",C.value=[],M.value=pe,a.value=ue.path,c.value=ue.parent,u.value=ue.entries,l.value=!1;return}}catch{}if(re!==N)return;const Ee=xe.base.toLowerCase();v.value=xe.parent,b.value=xe.separator;try{const ue=await s.browseFs(xe.parent);if(re!==N)return;if(ue.path){C.value=ue.entries.filter(Y=>Y.isDir&&Y.name.toLowerCase().startsWith(Ee)),g.value="not-found";return}}catch{}re===N&&(C.value=[],g.value="bad-parent")}function W(oe){d.value=Fbe(v.value,oe,b.value),T.value?.focus()}const L=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),O=D(()=>l.value?n("workspace.degradedHint"):k.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function q(oe){if(oe.key==="Escape"){d.value?d.value="":o("close");return}if(oe.key!=="Enter")return;const re=d.value.trim();if(Nv(re)){if(oe.preventDefault(),l.value){const{target:xe}=ak(re,I.value);xe&&o("add",xe);return}g.value==="valid"?ae():g.value==="not-found"&&C.value[0]&&W(C.value[0].name)}}const X=D(()=>{const oe=a.value;if(!oe)return[];const re=oe.split("/").filter(Boolean),xe=[{label:"/",path:"/"}];let pe="";for(const Ee of re)pe+=`/${Ee}`,xe.push({label:Ee,path:pe});return xe}),ie=D(()=>!(a.value.length===0||k.value&&$.value===null));async function U(oe){r.value=!0;try{const re=await s.browseFs(oe);if(!re.path){l.value=!0;return}a.value=re.path,c.value=re.parent,u.value=re.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function j(oe){oe.isDir&&U(oe.path)}function te(){c.value&&U(c.value)}function ae(){ie.value&&o("add",$.value??a.value)}return mn(async()=>{r.value=!0;try{const oe=await s.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(oe.home&&(I.value=oe.home),s.defaultPath&&(await U(s.defaultPath),!l.value))return;I.value?await U(I.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),Cn(()=>{y&&clearTimeout(y),F&&clearTimeout(F)}),(oe,re)=>(x(),Ae(Hr,{open:i.value,"onUpdate:open":re[2]||(re[2]=xe=>i.value=xe),title:A(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:re[3]||(re[3]=xe=>o("close"))},{default:Fe(()=>[S("div",Rbe,[l.value?ge("",!0):(x(),E("div",Bbe,[ve(Wn,{size:"sm",disabled:!c.value,label:A(n)("workspace.up"),onClick:te},{default:Fe(()=>[ve(et,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),S("div",Dbe,[(x(!0),E(De,null,rt(X.value,(xe,pe)=>(x(),E(De,{key:xe.path},[pe>1?(x(),E("span",Pbe,"/")):ge("",!0),S("button",{class:He(["crumb",{last:pe===X.value.length-1}]),onClick:Ee=>U(xe.path)},B(xe.label),11,Hbe)],64))),128))])])),!r.value||l.value?(x(),E("div",{key:1,class:He(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[ve(et,{class:"filter-icon",name:"search",size:"md"}),Fn(S("input",{ref_key:"filterEl",ref:T,"onUpdate:modelValue":re[0]||(re[0]=xe=>d.value=xe),class:"filter-input",type:"text",placeholder:L.value,autocomplete:"off",spellcheck:"false",onKeydown:Mt(q,["stop"])},null,40,Wbe),[[po,d.value]]),f.value||g.value==="checking"?(x(),Ae($o,{key:0,size:"sm"})):ge("",!0)],2)):ge("",!0),l.value?(x(),E("div",sxe,B(A(n)("workspace.degradedHint")),1)):(x(),E("div",zbe,[r.value?(x(),E("div",Ube,B(A(n)("workspace.browsing")),1)):k.value&&g.value!=="valid"?(x(),E(De,{key:1},[g.value==="checking"?(x(),E("div",qbe,B(A(n)("workspace.checkingPath")),1)):g.value==="not-found"?(x(),E(De,{key:1},[C.value.length>0?(x(),E("div",jbe,B(A(n)("workspace.pathPickHint")),1)):ge("",!0),(x(!0),E(De,null,rt(C.value,xe=>(x(),E("button",{key:xe.path,class:"folder-row",onClick:pe=>W(xe.name)},[ve(et,{class:"dir-icon",name:"folder-closed",size:"sm"}),S("span",Kbe,B(xe.name),1)],8,Vbe))),128)),C.value.length===0?(x(),E("div",Gbe,B(A(n)("workspace.noPathMatch",{parent:v.value})),1)):ge("",!0)],64)):g.value==="bad-parent"?(x(),E("div",Ybe,B(A(n)("workspace.badParent",{parent:v.value})),1)):ge("",!0)],64)):p.value&&!k.value?(x(),E(De,{key:2},[(x(!0),E(De,null,rt(h.value,xe=>(x(),E("button",{key:xe.path,class:"folder-row",onClick:pe=>U(xe.path)},[ve(et,{class:"dir-icon",name:"folder-closed",size:"sm"}),S("span",Xbe,B(xe.rel),1)],8,Zbe))),128)),!f.value&&h.value.length===0?(x(),E("div",Qbe,B(A(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),E("div",Jbe,B(A(n)("workspace.searching")),1)):ge("",!0)],64)):(x(),E(De,{key:3},[(x(!0),E(De,null,rt(u.value,xe=>(x(),E("button",{key:xe.path,class:"folder-row",onClick:pe=>j(xe)},[ve(et,{class:"dir-icon",name:"folder-closed",size:"sm"}),S("span",txe,B(xe.name),1)],8,exe))),128)),u.value.length===0?(x(),E("div",nxe,B(A(n)("workspace.noSubfolders")),1)):ge("",!0)],64))])),e.error?(x(),E("div",oxe,B(e.error),1)):ge("",!0),S("div",ixe,[ve(en,{text:a.value},{default:Fe(()=>[l.value?ge("",!0):(x(),Ae(Kt,{key:0,variant:"primary",disabled:!ie.value,onClick:ae},{default:Fe(()=>[tt(B(A(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ve(Kt,{variant:"secondary",onClick:re[1]||(re[1]=xe=>o("close"))},{default:Fe(()=>[tt(B(A(n)("workspace.cancel")),1)]),_:1})]),S("div",rxe,B(O.value),1)])]),_:1},8,["open","title"]))}}),uxe=dt(cxe,[["__scopeId","data-v-b0b096be"]]),dxe={key:0,class:"confirm-dialog__message"},fxe=Xe({__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=e,s=t,{t:o}=Ot();function i(){n.loading||(s("update:open",!1),s("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),s("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),Qn(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(x(),Ae(Hr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>s("update:open",c)),onClose:i},{foot:Fe(()=>[ve(Kt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Fe(()=>[tt(B(e.cancelLabel??A(o)("common.cancel")),1)]),_:1},8,["disabled"]),ve(Kt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>s("confirm"))},{default:Fe(()=>[tt(B(e.confirmLabel??A(o)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Fe(()=>[e.message?(x(),E("p",dxe,B(e.message),1)):ge("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),hxe=dt(fxe,[["__scopeId","data-v-ea995309"]]),pxe=Xe({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:s,runAction:o}=W1();function i(){o()}return(r,l)=>(x(),Ae(hxe,{open:A(t)!==null,title:A(t)?.title??"",message:A(t)?.message,"confirm-label":A(t)?.confirmLabel,"cancel-label":A(t)?.cancelLabel,variant:A(t)?.variant,loading:A(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>A(s)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),mxe={class:"rows"},gxe={class:"row"},vxe={class:"row"},yxe={class:"row"},kxe={class:"row"},bxe={class:"row"},xxe={class:"row"},wxe={class:"ctx-text"},_xe={key:0,class:"bar"},Sxe={class:"row"},Cxe=Xe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=se(!0),r=D(()=>s.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(s.status.ctxUsed/s.status.ctxMax*100)))),l=D(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:Br(s.status.ctxUsed),max:Br(s.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=D(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=D(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(x(),Ae(Hr,{open:i.value,"onUpdate:open":m[0]||(m[0]=y=>i.value=y),title:A(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=y=>o("close"))},{default:Fe(()=>[S("dl",mxe,[S("div",gxe,[S("dt",null,B(A(n)("status.statusModel")),1),S("dd",null,B(e.status.model),1)]),S("div",vxe,[S("dt",null,B(A(n)("status.statusThinking")),1),S("dd",null,B(e.thinking),1)]),S("div",yxe,[S("dt",null,B(A(n)("status.statusPermission")),1),S("dd",{style:Jt({color:c.value})},B(a(e.status.permission)),5)]),S("div",kxe,[S("dt",null,B(A(n)("status.statusPlanMode")),1),S("dd",{class:He({"plan-on":e.planMode})},B(u.value),3)]),S("div",bxe,[S("dt",null,B(A(n)("status.statusSwarmMode")),1),S("dd",{class:He({"swarm-on":e.swarmMode})},B(d.value),3)]),S("div",xxe,[S("dt",null,B(A(n)("status.statusContext")),1),S("dd",null,[S("span",wxe,B(l.value),1),e.status.ctxMax>0?(x(),E("span",_xe,[S("i",{style:Jt({width:r.value+"%"})},null,4)])):ge("",!0)])]),S("div",Sxe,[S("dt",null,B(A(n)("status.statusCost")),1),S("dd",null,B(h.value),1)])])]),_:1},8,["open","title"]))}}),Axe=dt(Cxe,[["__scopeId","data-v-c493cffd"]]),Mxe={class:"ui-toast__icon","aria-hidden":"true"},Exe={class:"ui-toast__body"},Txe={class:"ui-toast__title"},Nxe={key:0,class:"ui-toast__msg"},Ixe=Xe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),E("div",{class:He(["ui-toast",`ui-toast--${e.variant}`])},[S("span",Mxe,[Rn(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),Ae(et,{key:0,name:"check"})):e.variant==="danger"?(x(),Ae(et,{key:1,name:"close"})):e.variant==="warning"?(x(),Ae(et,{key:2,name:"alert-triangle"})):(x(),Ae(et,{key:3,name:"info"}))],!0)]),S("div",Exe,[S("div",Txe,B(e.title),1),e.message?(x(),E("div",Nxe,B(e.message),1)):ge("",!0),Rn(t.$slots,"default",{},void 0,!0)]),ve(Wn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Fe(()=>[ve(et,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Lxe=dt(Ixe,[["__scopeId","data-v-5edc3c48"]]),$xe={key:0,class:"actions"},Fxe=["onClick"],Oxe=["onClick"],Rxe={key:1,class:"details"},Bxe=Xe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Ot();function i(M){return typeof M=="object"&&M!==null}function r(M){return i(M)?M.title:M}function l(M){return i(M)?M.message??"":""}function a(M){return i(M)?M.details:void 0}function c(M){return i(M)?M.severity==="error":M.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(M)}function u(M){return i(M)?`notice:${M.severity}:${M.title}:${M.message??""}:${JSON.stringify(M.details??[])}`:`text:${M}`}function d(M){if(!i(M))return M;const $=[M.title];M.message&&$.push(M.message);const N=M.details??[];if(N.length>0){$.push("",`${o("warnings.diagnostics")}:`);for(const F of N)$.push(`${F.label}: ${F.value}`)}return $.join(`
|
|
337
|
+
`)}let f=1;const h=se([]),p=new Map,m=new Map;function y(M){const $=c(M)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?$+5e3:$}function k(M,$){const N=p.get(M)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>T(M),$),N.deadline=Date.now()+$,p.set(M,N)}function g(M){const $=p.get(M);$&&$.handle!==null&&clearTimeout($.handle),p.delete(M)}function v(M){const $=p.get(M);!$||$.handle===null||(clearTimeout($.handle),$.handle=null,$.remaining=Math.max(0,$.deadline-Date.now()))}function b(M){if(h.value.find(F=>F.id===M)?.detailsOpen)return;const N=p.get(M);!N||N.handle!==null||k(M,N.remaining)}function C(M){M.detailsOpen=!M.detailsOpen,M.detailsOpen?v(M.id):b(M.id)}async function I(M){if(!await Hs(d(M.warning)))return;M.copied=!0;const N=m.get(M.id);N&&clearTimeout(N),m.set(M.id,setTimeout(()=>{M.copied=!1,m.delete(M.id)},1400))}function T(M){g(M);const $=m.get(M);$&&clearTimeout($),m.delete(M);const N=h.value.findIndex(F=>F.id===M);N!==-1&&(h.value=h.value.filter(F=>F.id!==M),s("dismiss",N))}return Je(()=>n.warnings,M=>{const $=[...h.value];h.value=M.map(N=>{const F=u(N),_=$.findIndex(W=>W.key===F),R=_===-1?void 0:$.splice(_,1)[0];if(R)return R.warning=N,R;const z={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(z.id,y(N)),z});for(const N of $){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),Cn(()=>{p.forEach(M=>{M.handle!==null&&clearTimeout(M.handle)}),p.clear(),m.forEach(M=>clearTimeout(M)),m.clear()}),(M,$)=>(x(),Ae(w7,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Fe(()=>[(x(!0),E(De,null,rt(h.value,N=>(x(),Ae(Lxe,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":A(o)("warnings.dismiss"),onDismiss:F=>T(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>b(N.id)},{default:Fe(()=>[a(N.warning)?.length?(x(),E("div",$xe,[S("button",{class:"link",type:"button",onClick:F=>C(N)},B(N.detailsOpen?A(o)("warnings.hideDetails"):A(o)("warnings.showDetails")),9,Fxe),S("button",{class:"link",type:"button",onClick:F=>I(N)},B(N.copied?A(o)("warnings.copied"):A(o)("warnings.copyDetails")),9,Oxe)])):ge("",!0),N.detailsOpen&&a(N.warning)?.length?(x(),E("dl",Rxe,[(x(!0),E(De,null,rt(a(N.warning),F=>(x(),E("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[S("dt",null,B(F.label),1),S("dd",null,B(F.value),1)]))),128))])):ge("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Dxe=dt(Bxe,[["__scopeId","data-v-a0066058"]]),Pxe={class:"topbar"},Hxe={class:"wsq"},Wxe=["aria-label"],zxe={class:"tb-path"},Uxe={class:"ws"},qxe={class:"se"},jxe={class:"tb-sub"},Vxe=Xe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t,i=D(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=D(()=>s.workspace?.name??n("workspace.noWorkspace")),l=D(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),E("div",Pxe,[S("span",Hxe,B(i.value),1),S("button",{type:"button",class:"tb-mid","aria-label":A(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[S("span",zxe,[S("span",Uxe,B(r.value),1),e.sessionTitle?(x(),E(De,{key:0},[c[2]||(c[2]=S("span",{class:"sl"},"/",-1)),S("span",qxe,B(e.sessionTitle),1)],64)):ge("",!0),c[3]||(c[3]=S("span",{class:"cv"},"⌄",-1))]),S("span",jxe,[S("span",{class:He(["rd",{on:e.running}])},null,2),S("span",null,B(l.value),1),e.branch?(x(),E(De,{key:0},[tt(" · "+B(e.branch),1)],64)):ge("",!0),e.sessionCount>0?(x(),E(De,{key:1},[tt(" · "+B(A(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ge("",!0)])],8,Wxe),ve(Wn,{size:"lg",label:A(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Fe(()=>[ve(et,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Kxe=dt(Vxe,[["__scopeId","data-v-ac2feb1d"]]),Gxe={key:0,class:"sheet-root"},Yxe=["aria-label"],Zxe=["aria-label"],Xxe={key:0,class:"sheet-head"},Qxe={class:"sheet-title"},Jxe={class:"sheet-body"},ewe=Xe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Je(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Cn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),Ae(Fa,{name:"sheet"},{default:Fe(()=>[e.modelValue?(x(),E("div",Gxe,[S("div",{class:"sheet-scrim",onClick:i}),S("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||A(n)("mobile.sheetLabel")},[S("button",{type:"button",class:"sheet-grab","aria-label":A(n)("mobile.closeSheet"),onClick:i},null,8,Zxe),e.title?(x(),E("div",Xxe,[S("span",Qxe,B(e.title),1)])):ge("",!0),S("div",Jxe,[Rn(l.$slots,"default",{},void 0,!0)])],8,Yxe)])):ge("",!0)]),_:3}))}}),IT=dt(ewe,[["__scopeId","data-v-cc2a88fe"]]),twe={class:"mlist"},nwe={key:0,class:"mempty"},swe=["onClick"],owe={class:"mgh-main"},iwe={class:"mgh-name"},rwe={class:"mgh-path"},lwe={key:2,class:"att"},awe={key:0,class:"mempty small"},cwe=["onClick"],uwe={class:"m"},dwe={class:"s"},fwe={key:0,class:"att"},hwe=["disabled","onClick"],pwe=["onClick"],mwe=Xe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Ot(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(F){o("select",F),i()}function l(F){o("createInWorkspace",F),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=se(new Set);function d(F){return u.value.has(F)}function f(F){const _=new Set(u.value);_.has(F)?_.delete(F):_.add(F),u.value=_,v.value=null,T.value=null}const h=se(new Set);function p(F){return h.value.has(F)}function m(F){const _=new Set(h.value);_.has(F)?_.delete(F):_.add(F),h.value=_}function y(F){if(p(F.workspace.id))return F.sessions;const _=F.sessions.slice(0,F.initialCount);if(s.activeId&&!_.some(R=>R.id===s.activeId)){const R=F.sessions.find(z=>z.id===s.activeId);if(R)return[..._,R]}return _}function k(F){if(!h.value.has(F)){const _=new Set(h.value);_.add(F),h.value=_}o("loadMore",F)}function g(F){return s.attentionByWorkspace[F]??0}const v=se(null);function b(F){v.value=v.value===F?null:F,T.value=null}function C(F){v.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();R&&o("rename",F.id,R)}function I(F){v.value=null,o("archive",F)}const T=se(null);function M(F){T.value=T.value===F?null:F,v.value=null}function $(F){Hs(F.root),T.value=null}function N(F){T.value=null,o("deleteWorkspace",F.id)}return(F,_)=>(x(),Ae(IT,{"model-value":e.modelValue,"onUpdate:modelValue":_[2]||(_[2]=R=>o("update:modelValue",R))},{default:Fe(()=>[S("button",{type:"button",class:"newrow",onClick:a},[ve(et,{name:"message",size:"sm"}),tt(" "+B(A(n)("sidebar.newChat")),1)]),S("button",{type:"button",class:"newrow secondary",onClick:c},[ve(et,{name:"folder",size:"sm"}),tt(" "+B(A(n)("sidebar.newWorkspace")),1)]),S("div",twe,[e.groups.length===0?(x(),E("div",nwe,B(A(n)("workspace.noWorkspace")),1)):ge("",!0),(x(!0),E(De,null,rt(e.groups,R=>(x(),E("div",{key:R.workspace.id,class:"mgroup"},[S("div",{class:He(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:z=>f(R.workspace.id)},[d(R.workspace.id)?(x(),Ae(et,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),Ae(et,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),S("div",owe,[S("span",iwe,B(R.workspace.name),1),ve(en,{text:R.workspace.root},{default:Fe(()=>[S("span",rwe,B(R.workspace.shortPath),1)]),_:2},1032,["text"])]),d(R.workspace.id)&&g(R.workspace.id)>0?(x(),E("span",lwe,B(g(R.workspace.id)),1)):ge("",!0),ve(Wn,{size:"lg",class:"mgh-more",label:A(n)("sidebar.options"),onClick:Mt(z=>M(R.workspace.id),["stop"])},{default:Fe(()=>[ve(et,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ve(Wn,{size:"lg",class:"mgh-add",label:A(n)("workspace.newInGroup"),onClick:Mt(z=>l(R.workspace.id),["stop"])},{default:Fe(()=>[ve(et,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),T.value===R.workspace.id?(x(),Ae(Ma,{key:3,class:"kmenu wsmenu",onClick:_[0]||(_[0]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{size:"lg",onClick:z=>$(R.workspace)},{default:Fe(()=>[tt(B(A(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ve(_n,{size:"lg",danger:"",onClick:z=>N(R.workspace)},{default:Fe(()=>[tt(B(A(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ge("",!0)],10,swe),Fn(S("div",null,[R.sessions.length===0?(x(),E("div",awe,B(A(n)("sidebar.noSessions")),1)):ge("",!0),(x(!0),E(De,null,rt(y(R),z=>(x(),E("div",{key:z.id,class:He(["srow",{cur:z.id===e.activeId}]),onClick:W=>r(z.id)},[S("div",uwe,[S("div",{class:He(["t",{run:z.busy,aborted:!z.busy&&(e.attentionBySession[z.id]??0)===0&&(z.lastTurnReason==="cancelled"||z.lastTurnReason==="failed")}])},B(z.title),3),S("div",dwe,B(z.time),1)]),(e.attentionBySession[z.id]??0)>0?(x(),E("span",fwe,B(e.attentionBySession[z.id]),1)):ge("",!0),ve(Wn,{size:"lg",class:"kb",label:A(n)("sidebar.options"),onClick:Mt(W=>b(z.id),["stop"])},{default:Fe(()=>[ve(et,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),v.value===z.id?(x(),Ae(Ma,{key:1,class:"kmenu",onClick:_[1]||(_[1]=Mt(()=>{},["stop"]))},{default:Fe(()=>[ve(_n,{size:"lg",onClick:W=>C(z)},{default:Fe(()=>[tt(B(A(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ve(_n,{size:"lg",danger:"",onClick:W=>I(z.id)},{default:Fe(()=>[tt(B(A(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ge("",!0)],10,cwe))),128)),R.hasMore||R.loadingMore?(x(),E("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:Mt(z=>k(R.workspace.id),["stop"])},B(R.loadingMore?A(n)("sidebar.loadingMore"):A(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,hwe)):ge("",!0),R.sessions.length>R.initialCount?(x(),E("button",{key:2,type:"button",class:"mshow-more",onClick:Mt(z=>m(R.workspace.id),["stop"])},B(p(R.workspace.id)?A(n)("sidebar.showLess"):A(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,pwe)):ge("",!0)],512),[[ci,!d(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),gwe=dt(mwe,[["__scopeId","data-v-23ac86d1"]]),vwe={class:"group-title"},ywe={class:"srow-main"},kwe={class:"srow-label"},bwe={class:"srow-sub"},xwe={class:"srow read-only"},wwe={class:"srow-main"},_we={class:"srow-label"},Swe={key:0,class:"srow-sub"},Cwe={class:"cache-note"},Awe={class:"srow-main"},Mwe={class:"srow-label"},Ewe={class:"srow-sub"},Twe=["aria-checked"],Nwe={class:"srow-main"},Iwe={class:"srow-label"},Lwe={class:"srow-sub"},$we=["aria-checked"],Fwe={class:"srow-main"},Owe={class:"srow-label"},Rwe={class:"srow read-only"},Bwe={class:"srow-main"},Dwe={class:"srow-label"},Pwe={class:"srow-sub"},Hwe=["aria-label"],Wwe={class:"group-title"},zwe={class:"srow-main"},Uwe={class:"srow-label"},qwe={class:"srow-sub"},jwe={class:"srow read-only pref"},Vwe={class:"srow-main"},Kwe={class:"srow-label"},Gwe={class:"srow read-only pref"},Ywe={class:"srow-main"},Zwe={class:"srow-label"},Xwe={class:"srow read-only pref"},Qwe={class:"srow-main"},Jwe={class:"srow-label"},e_e={class:"num-field"},t_e=["value","aria-label"],n_e={class:"srow-main"},s_e={class:"srow-label"},o_e={class:"srow-sub"},i_e=["aria-checked"],r_e={class:"srow-main"},l_e={class:"srow-label"},a_e={class:"srow-main"},c_e={class:"srow-label"},u_e={key:2,class:"srow read-only"},d_e={class:"srow-main"},f_e={class:"srow-label"},h_e={class:"srow-val dim"},p_e={class:"arch-subhead"},m_e={class:"arch-count"},g_e={class:"arch-tools"},v_e={key:0,class:"arch-empty"},y_e={class:"arch-meta"},k_e={class:"arch-name"},b_e={class:"arch-time"},x_e={key:2,class:"arch-empty"},w_e=100,__e=Xe({__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}=Ot(),s=e,o=t;function i(U){o("setColorScheme",U)}const r=["manual","auto","yolo"],l=D(()=>s.models?.find(U=>U.id===s.status?.modelId)),a=D(()=>V1(l.value)),c=D(()=>K1(l.value)),u=D(()=>Bm(l.value,s.thinking)),d=D(()=>c.value.includes(u.value)?u.value:""),f=D(()=>c.value.map(U=>({value:U,label:Qy(U)}))),h=D(()=>s.planMode===!0),p=D(()=>s.swarmMode===!0),m=D(()=>{const U=s.status.permission;return U==="yolo"?"var(--color-danger)":U==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),y=D(()=>{const U=s.status.permission,j=n(U==="yolo"?"mobile.permYoloSub":U==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${U} · ${j}`}),k=D(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(s.status.ctxUsed/s.status.ctxMax*100))):0),g=D(()=>s.status.ctxMax>0?`${Br(s.status.ctxUsed)}/${Br(s.status.ctxMax)}`:n("status.statusNone"));function v(U){o("setThinking",Z2(l.value,U))}function b(){const U=r.indexOf(s.status.permission),j=r[(U+1)%r.length];o("setPermission",j)}function C(){o("pickModel"),o("update:modelValue",!1)}function I(){o("login"),o("update:modelValue",!1)}function T(){o("logout"),o("update:modelValue",!1)}const M=xb(),$=se("main"),N=se([]),F=se(!1),_=se(!1),R=se(""),z=se("archived-desc");async function W(){if(!F.value){F.value=!0,_.value=!1;try{const U=[];let j;for(;;){const te=await M.loadArchivedSessions({beforeId:j,pageSize:w_e});if(U.push(...te.items),!te.hasMore||te.items.length===0)break;const ae=te.items.at(-1)?.id;if(ae===void 0)break;j=ae}N.value=U,_.value=!0}catch(U){console.warn("loadAllArchived failed",U)}finally{F.value=!1}}}function L(){$.value="archived",R.value="",W()}function O(){$.value="main"}const q=D(()=>{const U=R.value.trim().toLowerCase();let j=N.value.filter(te=>te.archived===!0);return U&&(j=j.filter(te=>te.title.toLowerCase().includes(U))),j=j.slice(),z.value==="archived-desc"?j.sort((te,ae)=>ae.updatedAt.localeCompare(te.updatedAt)):z.value==="created-desc"?j.sort((te,ae)=>ae.createdAt.localeCompare(te.createdAt)):j.sort((te,ae)=>te.title.localeCompare(ae.title,"zh")),j});async function X(U){await M.restoreSession(U)&&(N.value=N.value.filter(te=>te.id!==U))}function ie(U){const j=new Date(U);if(Number.isNaN(j.getTime()))return U;const te=ae=>String(ae).padStart(2,"0");return`${j.getFullYear()}-${te(j.getMonth()+1)}-${te(j.getDate())} ${te(j.getHours())}:${te(j.getMinutes())}`}return Je(()=>s.modelValue,U=>{U||($.value="main")}),(U,j)=>(x(),Ae(IT,{"model-value":e.modelValue,title:A(n)("mobile.settingsTitle"),"onUpdate:modelValue":j[6]||(j[6]=te=>o("update:modelValue",te))},{default:Fe(()=>[$.value==="main"?(x(),E(De,{key:0},[S("div",vwe,B(A(n)("mobile.groupSession")),1),S("button",{type:"button",class:"srow",onClick:C},[S("span",ywe,[S("span",kwe,B(A(n)("status.statusModel")),1),S("span",bwe,B(e.status.model),1)]),j[7]||(j[7]=S("span",{class:"chev"},"›",-1))]),S("div",xwe,[S("span",wwe,[S("span",_we,B(A(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),E("span",Swe,B(A(n)("status.modeNotSupported")),1)):ge("",!0)]),c.value.length>1?(x(),Ae(ro,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":v},null,8,["model-value","options"])):(x(),E("span",{key:1,class:He(["srow-val",{dim:u.value==="off"}])},B(u.value==="off"?A(n)("status.planOff"):A(Qy)(u.value)),3))]),S("div",Cwe,B(A(n)("status.cacheNote")),1),S("button",{type:"button",class:"srow",onClick:j[0]||(j[0]=te=>o("togglePlan"))},[S("span",Awe,[S("span",Mwe,B(A(n)("status.statusPlanMode")),1),S("span",Ewe,B(A(n)("mobile.planModeSub")),1)]),S("span",{class:He(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Twe)]),S("button",{type:"button",class:"srow",onClick:j[1]||(j[1]=te=>o("toggleSwarm"))},[S("span",Nwe,[S("span",Iwe,B(A(n)("status.statusSwarmMode")),1),S("span",Lwe,B(A(n)("mobile.swarmModeSub")),1)]),S("span",{class:He(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,$we)]),S("button",{type:"button",class:"srow",onClick:b},[S("span",Fwe,[S("span",Owe,B(A(n)("status.statusPermission")),1),S("span",{class:"srow-sub",style:Jt({color:m.value})},B(y.value),5)]),j[8]||(j[8]=S("span",{class:"chev"},"›",-1))]),S("div",Rwe,[S("span",Bwe,[S("span",Dwe,B(A(n)("status.statusContext")),1),S("span",Pwe,B(g.value),1)]),S("span",{class:"ctx-meter","aria-label":g.value},[S("i",{style:Jt({width:k.value+"%"})},null,4)],8,Hwe)]),S("div",Wwe,B(A(n)("mobile.groupApp")),1),S("button",{type:"button",class:"srow",onClick:L},[S("span",zwe,[S("span",Uwe,B(A(n)("mobile.archivedSessions")),1),S("span",qwe,B(A(n)("mobile.archivedSessionsSub")),1)]),j[9]||(j[9]=S("span",{class:"chev"},"›",-1))]),S("div",jwe,[S("span",Vwe,[S("span",Kwe,B(A(n)("theme.colorSchemeLabel")),1)]),ve(ro,{"model-value":e.colorScheme??"system",options:[{value:"light",label:A(n)("theme.light")},{value:"dark",label:A(n)("theme.dark")},{value:"system",label:A(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),S("div",Gwe,[S("span",Ywe,[S("span",Zwe,B(A(n)("sidebar.language")),1)]),ve(TT)]),S("div",Xwe,[S("span",Qwe,[S("span",Jwe,B(A(n)("settings.uiFontSize")),1)]),S("label",e_e,[S("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:j[2]||(j[2]=te=>o("setUiFontSize",Number(te.target.value)))},null,40,t_e),j[10]||(j[10]=S("span",{class:"num-unit"},"px",-1))])]),S("button",{type:"button",class:"srow",onClick:j[3]||(j[3]=te=>o("setConversationToc",!e.conversationToc))},[S("span",n_e,[S("span",s_e,B(A(n)("settings.conversationToc")),1),S("span",o_e,B(A(n)("settings.conversationTocHint")),1)]),S("span",{class:He(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,i_e)]),e.authReady?(x(),E("button",{key:0,type:"button",class:"srow acct out",onClick:T},[S("span",r_e,[S("span",l_e,B(A(n)("sidebar.signOut")),1)])])):(x(),E("button",{key:1,type:"button",class:"srow acct in",onClick:I},[S("span",a_e,[S("span",c_e,B(A(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),E("div",u_e,[S("span",d_e,[S("span",f_e,B(A(n)("settings.serverVersion")),1)]),S("span",h_e,B(e.serverVersion),1)])):ge("",!0)],64)):(x(),E(De,{key:1},[S("div",p_e,[S("button",{type:"button",class:"arch-back",onClick:O},[j[11]||(j[11]=S("span",{class:"chev back"},"‹",-1)),tt(" "+B(A(n)("mobile.archivedBack")),1)]),S("span",m_e,B(A(n)("mobile.sessionCount",{n:q.value.length})),1)]),S("div",g_e,[ve(G1,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:A(n)("settings.archivedSearch"),"onUpdate:modelValue":j[4]||(j[4]=te=>R.value=te)},null,8,["model-value","placeholder"]),ve(ro,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:A(n)("settings.archivedSortArchived")},{value:"created-desc",label:A(n)("settings.archivedSortCreated")},{value:"name-asc",label:A(n)("settings.archivedSortName")}],"onUpdate:modelValue":j[5]||(j[5]=te=>z.value=te)},null,8,["model-value","options"])]),F.value?(x(),E("div",v_e,B(A(n)("settings.archivedLoadingAll")),1)):q.value.length>0?(x(!0),E(De,{key:1},rt(q.value,te=>(x(),E("div",{key:te.id,class:"arch-row"},[S("div",y_e,[S("div",k_e,B(te.title),1),S("div",b_e,B(A(n)("settings.archivedAt",{time:ie(te.updatedAt)})),1)]),ve(Kt,{variant:"secondary",size:"sm",onClick:ae=>X(te.id)},{default:Fe(()=>[tt(B(A(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),E("div",x_e,B(N.value.length===0?A(n)("settings.archivedEmpty"):A(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),S_e=dt(__e,[["__scopeId","data-v-32378dfd"]]),C_e={class:"ob-brand"},A_e={class:"ob-brand-text"},M_e={class:"ob-title"},E_e={class:"ob-sub"},T_e={class:"ob-sec"},N_e={class:"ob-label"},I_e={class:"ob-sec"},L_e={class:"ob-label"},$_e={class:"ob-sec"},F_e={class:"ob-label"},O_e=Xe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Ot(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=qE();function c(d){o.value!==d&&o6(d)}function u(){n("complete")}return(d,f)=>(x(),Ae(Hr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Fe(()=>[S("div",C_e,[f[4]||(f[4]=S("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Dimi"},[S("defs",null,[S("mask",{id:"obDimiEyes",maskUnits:"userSpaceOnUse"},[S("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),S("g",{class:"ob-eyes",fill:"#000"},[S("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),S("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),S("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obDimiEyes)"})],-1)),S("div",A_e,[S("div",M_e,B(A(s)("onboarding.title")),1),S("div",E_e,B(A(s)("onboarding.subtitle")),1)])])]),default:Fe(()=>[S("section",T_e,[S("div",N_e,B(A(s)("onboarding.languageLabel")),1),ve(ro,{"model-value":A(o),options:A(s6).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),S("section",I_e,[S("div",L_e,B(A(s)("theme.colorSchemeLabel")),1),ve(ro,{"model-value":A(i),options:[{value:"light",label:A(s)("theme.light")},{value:"dark",label:A(s)("theme.dark")},{value:"system",label:A(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>A(l)(h))},null,8,["model-value","options"])]),S("section",$_e,[S("div",F_e,B(A(s)("theme.accentLabel")),1),ve(ro,{"model-value":A(r),options:[{value:"blue",label:A(s)("theme.accentBlue")},{value:"mono",label:A(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>A(a)(h))},null,8,["model-value","options"])]),ve(Kt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Fe(()=>[tt(B(A(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),R_e=dt(O_e,[["__scopeId","data-v-b9bc9f52"]]),B_e=["aria-label"],D_e={class:"gload-box"},P_e={class:"gload-text"},H_e={key:0,class:"gload-issue"},W_e={class:"gload-issue-detail"},z_e=Xe({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Ot();return(n,s)=>(x(),E("div",{class:"gload",role:"status","aria-label":A(t)("app.connecting")},[S("div",D_e,[s[0]||(s[0]=Ek('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-b07a6ece><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-b07a6ece></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-b07a6ece></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-b07a6ece></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-b07a6ece></path></svg>',1)),ve($o,{size:"md",label:A(t)("app.connecting")},null,8,["label"]),S("div",P_e,B(A(t)("app.connecting")),1),e.issue?(x(),E("div",H_e,[S("div",null,B(A(t)("app.connectRetrying")),1),S("div",W_e,B(e.issue),1)])):ge("",!0)])],8,B_e))}}),U_e=dt(z_e,[["__scopeId","data-v-b07a6ece"]]),q_e={class:"kap-root"},j_e={class:"kap-head"},V_e={class:"kap-count"},K_e={class:"kap-head-actions"},G_e={class:"kap-filters"},Y_e=["value"],Z_e={class:"kap-check"},X_e={class:"kap-check"},Q_e={class:"kap-view-toggle",role:"group"},J_e={key:0,class:"kap-empty"},eSe=["onClick"],tSe={class:"kap-ts"},nSe={class:"kap-label"},sSe={key:0,class:"kap-detail"},oSe={class:"kap-detail-actions"},iSe=["onClick"],rSe={key:1,class:"kap-agg"},lSe={class:"mono"},aSe={class:"mono"},cSe={class:"num"},uSe={class:"num"},dSe={key:0},fSe={class:"mono"},hSe={class:"num"},pSe={class:"num"},mSe={key:0},gSe=Xe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=se("all"),o=se(""),i=se(""),r=se(!1),l=se("timeline"),a=D(()=>(D2.value,[...cie()])),c=D(()=>{const $=new Set;for(const N of a.value)N.sessionId&&$.add(N.sessionId);return[...$].sort()});function u($){return $.kind==="rest:error"||$.code!==void 0&&$.code!==0||$.eventType==="error"||$.eventType==="parse-error"}const d=D(()=>{const $=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||$&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes($)))}),f=D(()=>{const $=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",_=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,R=$.get(_)??{key:_,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};R.count++,N.seq!==void 0&&(R.lastSeq=N.seq),$.set(_,R)}return[...$.values()].sort((N,F)=>F.count-N.count)}),h=D(()=>{const $=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,_=$.get(F)??{count:0,errors:0,totalMs:0,timed:0};_.count++,u(N)&&_.errors++,N.durationMs!==void 0&&(_.totalMs+=N.durationMs,_.timed++),$.set(F,_)}return[...$.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),p=se(null),m=se(!0),y=se(null),k=se(null);Je(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await yt();const $=y.value;$&&($.scrollTop=$.scrollHeight)});function g($){p.value=p.value===$?null:$}function v($){const N=new Date($),F=(_,R=2)=>String(_).padStart(R,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function b($){return JSON.stringify($,null,2)}async function C($){await Hs(b($))&&(k.value=$.id,setTimeout(()=>{k.value===$.id&&(k.value=null)},1500))}function I(){mE(d.value)}function T($){return u($)||$.source==="client"?"b-err":$.source==="rest"?"b-rest":$.kind==="ws:lifecycle"?"b-life":$.kind==="ws:out"?"b-out":"b-in"}function M($){return $.source==="rest"?"REST":$.source==="client"?"APP":"WS"}return($,N)=>(x(),E("section",q_e,[S("header",j_e,[N[11]||(N[11]=S("strong",null,"KAP debug",-1)),S("span",V_e,B(d.value.length)+"/"+B(a.value.length),1),S("div",K_e,[S("button",{type:"button",class:He({on:A(bd)}),onClick:N[0]||(N[0]=F=>bd.value=!A(bd))},B(A(bd)?"resume":"pause"),3),S("button",{type:"button",onClick:N[1]||(N[1]=F=>A(uie)())},"clear"),S("button",{type:"button",onClick:N[2]||(N[2]=F=>I())},"export jsonl"),ve(en,{text:"Close window"},{default:Fe(()=>[S("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),S("div",G_e,[Fn(S("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[S("option",{value:"all"},"rest + ws + app",-1),S("option",{value:"rest"},"rest",-1),S("option",{value:"ws"},"ws",-1),S("option",{value:"client"},"app errors",-1)])],512),[[Zv,s.value]]),Fn(S("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=S("option",{value:""},"all sessions",-1)),(x(!0),E(De,null,rt(c.value,F=>(x(),E("option",{key:F,value:F},B(F),9,Y_e))),128))],512),[[Zv,i.value]]),Fn(S("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[po,o.value]]),S("label",Z_e,[Fn(S("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[Yp,r.value]]),N[14]||(N[14]=tt(" errors",-1))]),S("label",X_e,[Fn(S("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[Yp,m.value]]),N[15]||(N[15]=tt(" follow",-1))]),S("div",Q_e,[S("button",{type:"button",class:He({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),S("button",{type:"button",class:He({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),E("div",{key:0,ref_key:"listRef",ref:y,class:"kap-list"},[d.value.length===0?(x(),E("div",J_e," No trace entries yet. REST calls and WS frames will appear here. ")):ge("",!0),(x(!0),E(De,null,rt(d.value,F=>(x(),E("div",{key:F.id,class:"kap-row-wrap"},[S("button",{type:"button",class:He(["kap-row",{expanded:p.value===F.id}]),onClick:_=>g(F.id)},[S("span",tSe,B(v(F.ts)),1),S("span",{class:He(["kap-badge",T(F)])},B(M(F)),3),S("span",nSe,B(F.label),1)],10,eSe),p.value===F.id?(x(),E("div",sSe,[S("div",oSe,[S("button",{type:"button",onClick:_=>C(F)},B(k.value===F.id?"copied ✓":"copy json"),9,iSe)]),S("pre",null,B(b(F)),1)])):ge("",!0)]))),128))],512)):(x(),E("div",rSe,[N[20]||(N[20]=S("h4",null,"WS frames by session / type",-1)),S("table",null,[N[17]||(N[17]=S("thead",null,[S("tr",null,[S("th",null,"dir"),S("th",null,"type"),S("th",null,"session"),S("th",null,"count"),S("th",null,"last seq")])],-1)),S("tbody",null,[(x(!0),E(De,null,rt(f.value,F=>(x(),E("tr",{key:F.key},[S("td",null,B(F.dir),1),S("td",lSe,B(F.eventType),1),S("td",aSe,B(F.sessionId),1),S("td",cSe,B(F.count),1),S("td",uSe,B(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),E("tr",dSe,[...N[16]||(N[16]=[S("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ge("",!0)])]),N[21]||(N[21]=S("h4",null,"REST by endpoint",-1)),S("table",null,[N[19]||(N[19]=S("thead",null,[S("tr",null,[S("th",null,"endpoint"),S("th",null,"count"),S("th",null,"errors"),S("th",null,"avg ms")])],-1)),S("tbody",null,[(x(!0),E(De,null,rt(h.value,F=>(x(),E("tr",{key:F.key},[S("td",fSe,B(F.key),1),S("td",hSe,B(F.count),1),S("td",{class:He(["num",{err:F.errors>0}])},B(F.errors),3),S("td",pSe,B(F.avgMs),1)]))),128)),h.value.length===0?(x(),E("tr",mSe,[...N[18]||(N[18]=[S("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ge("",!0)])])]))]))}}),vSe=dt(gSe,[["__scopeId","data-v-a3d2c406"]]),ySe=Xe({__name:"DebugPanel",setup(e){const t=se(!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=Zp(vSe,{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 mn(()=>{c()}),Qn(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),Ae(en,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Fe(()=>[S("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),kSe=dt(ySe,[["__scopeId","data-v-b4944171"]]);function bSe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),s=D(()=>e.initialized.value&&!n.value),o="/login",i=se(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)}Je(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 Cn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function xSe({running:e,showAuthGate:t}){const{t:n}=Ot(),s=["◐","◓","◑","◒"],o=se(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}Je(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Dimi Web`:`${c}Dimi Web`});xA(()=>{typeof document<"u"&&(document.title=a.value)}),Cn(()=>{l()})}const LT=se(typeof window>"u"?0:window.innerWidth);let rp=0,Km=!1;function ck(){LT.value=window.innerWidth}function wSe(){Km||typeof window>"u"||(window.addEventListener("resize",ck),Km=!0,ck())}function _Se(){!Km||typeof window>"u"||(window.removeEventListener("resize",ck),Km=!1)}function $T(e,t,n){return Math.max(t,e-n)}function uk(e,t,n){return Math.min(n,Math.max(t,e))}function FT(){return mn(()=>{rp+=1,wSe()}),Qn(()=>{rp=Math.max(0,rp-1),rp===0&&_Se()}),{viewportWidth:LT}}const SSe="dimi-web.file-preview-width",Ic=320;function CSe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=FT(),i=D(()=>Math.max(0,o.value-t.value)),r=D(()=>$T(i.value,Ic,Ic));function l(Q){return uk(Math.round(Q),Ic,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=se(c.value),d=D(()=>uk(u.value,Ic,r.value)),f=se(null),h=D(()=>{const Q=f.value;if(!Q)return null;const G=e.turns.value.find(ye=>ye.id===Q.turnId)?.blocks?.[Q.blockIndex];return G?.kind==="thinking"?G.thinking:null}),p=D(()=>h.value!==null);function m(Q){const P=f.value;if(P&&P.turnId===Q.turnId&&P.blockIndex===Q.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=Q}function y(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=se(null),g=D(()=>{const Q=k.value;if(!Q)return null;const P=e.turns.value.find(G=>G.id===Q.turnId);return P?.role==="compaction"&&P.text?P.text:null}),v=D(()=>g.value!==null);function b(Q){if(k.value?.turnId===Q.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=Q}function C(){k.value=null,n.value==="compaction"&&(n.value=null)}const I=se(null);function T(Q){const P=e.activeAppTasks.value,G=P.find(he=>he.id===Q)??P.find(he=>he.parentToolCallId===Q);if(G)return G.id;const ye=P.filter(he=>he.kind==="subagent"&&!he.parentToolCallId);if(ye.length===1)return ye[0].id}const M=D(()=>{const Q=I.value;if(!Q)return null;const P=e.activeAppTasks.value.find(G=>G.id===Q.subagentId);return P?lve(P):null}),$=D(()=>M.value!==null);function N(Q){const P=T(Q);if(P){if(I.value?.subagentId===P){I.value=null,n.value==="agent"&&(n.value=null);return}I.value={subagentId:P},n.value="agent"}}function F(){I.value=null,n.value==="agent"&&(n.value=null)}const _=se(null),R=D(()=>{const Q=_.value;if(!Q)return null;const P=kz(e.turns.value,Q);return P?{id:Q,title:ja(P.name),path:yz(P.arg),lines:P.status==="error"?null:l6(P),output:P.output}:null}),z=D(()=>R.value!==null);function W(Q){if(n.value==="toolDiff"&&_.value===Q){L();return}n.value="toolDiff",_.value=Q}function L(){_.value=null,n.value==="toolDiff"&&(n.value=null)}const O=se("list"),q=se(null);function X(){if(n.value==="diff"){ie();return}n.value="diff",O.value="list",q.value=null,e.loadGitStatus(e.activeSessionId.value)}function ie(){n.value==="diff"&&(n.value=null),O.value="list",q.value=null,e.clearFileDiff()}async function U(Q){O.value="detail",q.value=Q,await e.loadFileDiff(Q)}async function j(Q){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Q):await e.openSideChat(Q),n.value="btw"}function te(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ae(){n.value==="btw"&&(n.value=null)}const oe=D(()=>e.sideChatVisible.value),re=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||$.value)&&(n.value!=="toolDiff"||z.value)&&(n.value!=="btw"||oe.value)),xe=se(!1),pe=se({});function Ee(){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 I.value?{kind:"agent",...I.value}:null;case"toolDiff":return _.value?{kind:"toolDiff",toolId:_.value}:null;case"btw":return{kind:"btw"};default:return null}}function ue(Q){if(Q)switch(Q.kind){case"thinking":f.value={turnId:Q.turnId,blockIndex:Q.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:Q.turnId},n.value="compaction";break;case"agent":I.value={subagentId:Q.subagentId},n.value="agent";break;case"toolDiff":_.value=Q.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Y(){return n.value==="thinking"&&p.value?(y(),!0):n.value==="compaction"&&v.value?(C(),!0):n.value==="agent"&&$.value?(F(),!0):n.value==="toolDiff"&&z.value?(L(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(ie(),!0):n.value==="btw"?(te(),!0):!1}return Je(e.activeSessionId,(Q,P)=>{if(P){const G=Ee();G?pe.value[P]=G:delete pe.value[P]}s(),y(),C(),F(),L(),ie(),ae(),Q&&ue(pe.value[Q])}),{PREVIEW_WIDTH_KEY:SSe,PREVIEW_MIN:Ic,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:y,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:b,closeCompactionPanel:C,agentPanelMember:M,agentPanelVisible:$,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:R,toolDiffVisible:z,openToolDiff:W,closeToolDiff:L,detailDiffMode:O,detailDiffPath:q,openDiffDetail:X,closeDiffDetail:ie,selectDiffFile:U,btwVisible:oe,openSideChatTab:j,closeSideChat:te,hideSideChatPanel:ae,sidePanelVisible:re,panelDragging:xe,closeOpenSidePanel:Y}}const ASe=Pt.sidebarWidth,z3=Pt.sidebarCollapsed,U3=270,Iv=170,MSe=480,ESe=320;function TSe(e={}){const{viewportWidth:t}=FT(),n=se(U3),s=se(!1),o=se(!1),i=D(()=>{const u=ESe+(hA(e.previewOpen)?Ic:0);return Math.min(MSe,$T(t.value,Iv,u))}),r=D(()=>uk(n.value,Iv,i.value));function l(){try{s.value=ss(z3)==="true"}catch{s.value=!1}}function a(){try{ps(z3,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:ASe,SIDEBAR_DEFAULT:U3,SIDEBAR_MIN:Iv,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function NSe(e){return/^(?:https?:|blob:|data:)/i.test(e)}function ISe({client:e,detailTarget:t}){const{t:n}=Ot(),s=se(null),o=se(null),i=se(!1),r=se(null),l=se(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const T=l.value;return T?e.getFileDownloadUrl(T):null}),f=D(()=>s.value!==null);function h(T){return T.length>1?T.replace(/\/+$/,""):T}function p(T){const M=[];for(const $ of T.split(/[\\/]+/))if(!(!$||$===".")){if($===".."){M.pop();continue}M.push($)}return M.join("/")}function m(T){const M=T.trim();if(!M)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(M))return{error:n("filePreview.errors.unsupportedPath")};if(M.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const $=h(e.status.value.cwd);if(M.startsWith("/")){if(!$||M!==$&&!M.startsWith(`${$}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=M===$?"":M.slice($.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const _=p(F);return _?{path:_}:{error:n("filePreview.errors.isDirectory")}}if(M.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=p(M);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function y(T){const M=s.value;if(t.value==="file"&&M&&M.path===T.path&&M.line===T.line){b();return}const $=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=T,l.value=null;const N=m(T.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if($!==a)return;F?o.value={...F,path:F.path||N.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if($!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{$===a&&(i.value=!1)}}function k(T){return/^data:([^;,]+)/i.exec(T)?.[1]}function g(T){if(T.kind!=="image"&&T.kind!=="video")return;const M=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const $=T.kind==="video",N={path:T.path??($?"Video":"ReadMediaFile image"),content:"",encoding:"utf-8",mime:T.mimeType??k(T.url)??($?"video/*":"image/*"),isBinary:!0,size:T.bytes??0};T.fileId?(i.value=!0,o.value=N,mt().getFileBlob(T.fileId).then(F=>{if(M===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(F),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{M===a&&(o.value&&(o.value={...o.value,sourceUrl:T.url}),i.value=!1)})):(i.value=!1,o.value=NSe(T.url)?{...N,sourceUrl:T.url}:N)}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function b(){v(),t.value==="file"&&(t.value=null)}Je(t,(T,M)=>{M==="file"&&T!=="file"&&v()});function C(){const T=o.value?.path??s.value?.path;T&&e.openWorkspaceFile(T,s.value?.line)}function I(){const T=o.value?.path??s.value?.path;T&&e.revealWorkspaceFile(T)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:y,openMediaPreview:g,closeFilePreview:b,openPreviewInEditor:C,revealPreviewFile:I}}const LSe=640,$Se=`(max-width: ${LSe}px)`;function FSe(){const e=se(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia($Se);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Cn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Cn(()=>t.removeListener(n))),e}const OSe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},RSe={class:"server-auth-card"},BSe={class:"server-auth-body"},DSe={class:"server-auth-foot"},PSe=Xe({__name:"ServerAuthDialog",setup(e){const t=se(""),n=se(null),s=se(!1);mn(()=>{yt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,bE(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(x(),E("div",OSe,[S("div",RSe,[l[1]||(l[1]=S("div",{class:"server-auth-head"},[S("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),S("p",{class:"server-auth-hint"},[tt(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),S("code",null,"DIMI_CODE_PASSWORD"),tt("). ")])],-1)),S("div",BSe,[ve(G1,{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"])]),S("div",DSe,[ve(Kt,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Fe(()=>[tt(B(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),HSe=dt(PSe,[["__scopeId","data-v-1b085c63"]]),WSe=["aria-label"],zSe=Xe({__name:"InternalBuildBanner",setup(e){const{t}=Ot(),n=jP;return(s,o)=>A(n)?(x(),E("span",{key:0,class:"internal-build-tag",role:"note","aria-label":A(t)("app.internalBuildBanner")},[o[0]||(o[0]=S("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"},[S("path",{d:"M8 2 14 13H2L8 2Z"}),S("path",{d:"M8 6v3.5"}),S("path",{d:"M8 11.5h.01"})],-1)),S("span",null,B(A(t)("app.internalBuildBanner")),1)],8,WSe)):ge("",!0)}}),USe=dt(zSe,[["__scopeId","data-v-06693836"]]),qSe={class:"app-shell"},jSe={key:1,class:"auth-page"},VSe={class:"auth-page-inner"},KSe={class:"auth-page-copy"},GSe=["aria-label","aria-hidden"],YSe=Xe({__name:"App",setup(e){tre();const t=se(!1);let n=null;const s=xb(),o=D(()=>!s.dangerousBypassAuth.value&&t.value);wn("resolveImage",s.resolveImageUrl),wn("resolveSwarmMembers",ce=>s.swarmMembersByToolCallId.value.get(ce)??[]);const{t:i}=Ot(),{confirm:r}=W1(),l=$i(),a=FSe(),c=se(!1),u=se(!1),d=D(()=>{const ce=s.activeSessionId.value;return s.sessions.value.find(V=>V.id===ce)?.title??""}),f=D(()=>s.visibleWorkspace.value?.sessionCount??0),h=D(()=>s.activity.value!=="idle"),p=se(null),{showAuthGate:m,blinkAuthLogo:y}=bSe({client:s,authLogoRef:p});xSe({running:h,showAuthGate:m});function k(ce){const V=s.models.value.find(Se=>Se.id===s.status.value.modelId),le=K1(V),J=le.indexOf(Bm(V,ce)),ke=le[(J+1)%le.length]??le[0]??"off";return Z2(V,ke)}const g=D(()=>{const ce=s.models.value.find(V=>V.id===s.status.value.modelId);return Bm(ce,s.thinking.value)}),v=se(!s.onboarded.value);function b(){s.setOnboarded(!0),v.value=!1}function C(){v.value=!0}let I=0;function T(){const ce=window.visualViewport,V=document.documentElement.style;V.setProperty("--app-height",`${ce?.height??window.innerHeight}px`),V.setProperty("--app-top",`${ce?.offsetTop??0}px`)}function M(){I||(I=requestAnimationFrame(()=>{I=0,T()}))}mn(()=>{n=ore(()=>{t.value=!0,s.clearDangerousBypassAuth()}),s.load(),Q(),T(),window.visualViewport?.addEventListener("resize",M),window.visualViewport?.addEventListener("scroll",M),window.addEventListener("resize",M),document.addEventListener("keydown",$,!0)}),Cn(()=>{document.removeEventListener("keydown",$,!0),window.visualViewport?.removeEventListener("resize",M),window.visualViewport?.removeEventListener("scroll",M),window.removeEventListener("resize",M),I&&(cancelAnimationFrame(I),I=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function $(ce){ce.key==="Escape"&&(sr.value||Ut()&&(ce.stopPropagation(),ce.preventDefault()))}const N=se(null),F=se(!1);Je(s.activeSessionId,()=>{F.value=!0,yt(()=>{F.value=!1})});const{previewTarget:_,previewFile:R,previewLoading:z,previewError:W,previewDownloadUrl:L,previewExternalActions:O,openFilePreview:q,openMediaPreview:X,closeFilePreview:ie,openPreviewInEditor:U,revealPreviewFile:j}=ISe({client:s,detailTarget:N}),te=D(()=>N.value!==null),{SIDEBAR_WIDTH_KEY:ae,SIDEBAR_DEFAULT:oe,SIDEBAR_MIN:re,sidebarMax:xe,sessionColWidth:pe,sidebarCollapsed:Ee,sidebarDragging:ue,sideWidth:Y,loadSidebarCollapsed:Q,toggleSidebarCollapse:P}=TSe({previewOpen:te}),{PREVIEW_WIDTH_KEY:G,PREVIEW_MIN:ye,previewDefaultWidth:he,previewMax:fe,previewWidth:K,previewPanelWidth:ne,thinkingPanelText:me,thinkingVisible:we,openThinkingPanel:Te,closeThinkingPanel:Pe,compactionPanelText:be,compactionPanelVisible:_e,openCompactionPanel:Ke,closeCompactionPanel:Qe,agentPanelMember:ot,openAgentPanel:at,closeAgentPanel:ht,toolDiffTarget:Et,openToolDiff:Tt,closeToolDiff:$t,detailDiffMode:rn,detailDiffPath:vn,openDiffDetail:Ht,closeDiffDetail:Zt,selectDiffFile:tn,btwVisible:Gt,openSideChatTab:An,closeSideChat:Ye,sidePanelVisible:qe,panelDragging:It,closeOpenSidePanel:Ut}=CSe({client:s,sideWidth:Y,detailTarget:N,closeFilePreview:ie}),Vt=se(null),kn=se(!1),ft=se(!1),cn=se(!1),un=se(null),Bn=se(!1),Mn=se(!1),Ns=se(!1),bs=se(null),ct=se(null),sr=D(()=>Mc.value>0||kn.value||ft.value||cn.value||Bn.value||Mn.value||Ns.value||v.value||c.value||u.value),xs=se(!1),bn=se(!1),gs=se(!1),ws=se(!1),Ws=se(!1);async function Zs(){xs.value=!0,bn.value=!1,kn.value=!0;try{await s.refreshAllProviders()}catch{bn.value=!0}finally{xs.value=!1}}async function Gn(){gs.value=!0,ws.value=!1,ft.value=!0;try{await s.loadProviders()}catch{ws.value=!0}finally{gs.value=!1}}function mo(ce){un.value=ce,cn.value=!0}async function Xs(ce){kn.value=!1,await _s(ce)}async function _s(ce){await s.setModel(ce)&&ce!==s.defaultModel.value&&s.updateConfig({defaultModel:ce})}async function Fo(ce){await s.loginProviderApiKey(ce.providerId,ce.value)&&(ft.value=!1,await s.checkAuth(),await s.load())}async function Jo(ce){await s.refreshProvider(ce)}async function Qs(ce){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>s.archiveSession(ce)})}async function os(ce){const V=s.workspacesView.value.find(le=>le.id===ce)?.name??ce;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:V}),variant:"danger",action:()=>s.deleteWorkspace(ce)})}async function Fi(ce){const V=s.providers.value.find(le=>le.id===ce)?.name??ce;await r({title:i("providers.logout"),message:i("providers.logoutTitle",{type:V}),variant:"danger",action:()=>s.logoutProvider(ce)})}async function ei(ce){Ws.value=!0;try{await s.updateConfig(ce)&&await s.checkAuth()}finally{Ws.value=!1}}async function Xt(){return un.value===null?null:s.startOAuthLogin(un.value)}async function Is(){return un.value===null?null:s.pollOAuthLogin(un.value)}async function Yn(){un.value!==null&&await s.cancelOAuthLogin(un.value)}async function Oo(){cn.value=!1,un.value=null,await s.checkAuth(),await s.load()}async function Ro(ce){await s.undo(1),await yt(),Vt.value?.loadComposerForEdit(ce.text,ce.attachments)}function Bo(ce){if(ce==="/compact"||ce.startsWith("/compact ")){s.compact(ce.slice(8).trim()||void 0);return}if(ce==="/swarm"||ce.startsWith("/swarm ")){const V=ce.slice(6).trim();V==="on"?s.setSwarmMode(!0):V==="off"?s.setSwarmMode(!1):V?(s.setSwarmMode(!0),s.sendPrompt(V)):s.toggleSwarmMode();return}if(ce==="/btw"||ce.startsWith("/btw ")){const V=ce.slice(4).trim();!V&&s.sideChatVisible.value?Ye():An(V||void 0);return}switch(ce){case"/new":case"/clear":zs();break;case"/fork":s.forkSession();break;case"/export":s.exportSession();break;case"/undo":s.undo();break;case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(k(s.thinking.value));break;case"/status":Mn.value=!0;break;case"/login":Gn();break;default:{const V=ce.indexOf(" "),le=Pce((V===-1?ce:ce.slice(0,V)).slice(1)),J=V===-1?void 0:ce.slice(V+1).trim()||void 0;if(!le)break;!s.activeSessionId.value&&s.activeWorkspaceId.value?s.startSessionAndActivateSkill(s.activeWorkspaceId.value,le,J):s.activateSkill(le,J);break}}}function ti(ce){s.unqueue(ce)}function Do(ce){s.unqueue(ce)}function go(ce){s.reorderQueue(ce.from,ce.to)}async function Ue(ce){const V=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&V){await s.startSessionAndSendPrompt(V,ce.text,ce.attachments);return}if(!s.activeSessionId.value&&!V){bs.value=ce,Bn.value=!0;return}s.sendPrompt(ce.text,ce.attachments)}async function Ze(ce){if(ct.value=null,!await s.addWorkspaceByPath(ce)){ct.value=i("workspace.addFailed");return}Bn.value=!1;const le=bs.value;bs.value=null;const J=s.activeWorkspaceId.value;le&&J&&await s.startSessionAndSendPrompt(J,le.text,le.attachments)}function ut(){bs.value=null,ct.value=null,Bn.value=!1}function Wt(){yt(()=>{Vt.value?.focusComposer()})}function zs(){const ce=s.activeWorkspaceId.value;ce?s.openWorkspaceDraft(ce):s.clearActiveSession(),Wt()}function vo(ce){s.openWorkspaceDraft(ce),Wt()}function zr(ce){ce&&window.open(ce,"_blank","noopener")}return(ce,V)=>(x(),E("div",qSe,[o.value?(x(),Ae(HSe,{key:0})):ge("",!0),A(m)?(x(),E("section",jSe,[S("div",VSe,[(x(),E("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":"Dimi",onMousedown:V[0]||(V[0]=Mt(()=>{},["prevent"])),onClick:V[1]||(V[1]=(...le)=>A(y)&&A(y)(...le))},[...V[95]||(V[95]=[Ek('<defs data-v-e02f8d12><mask id="authDimiEyes" maskUnits="userSpaceOnUse" data-v-e02f8d12><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-e02f8d12></rect><g class="ch-eyes" fill="#000" data-v-e02f8d12><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-e02f8d12></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-e02f8d12></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authDimiEyes)" data-v-e02f8d12></rect>',2)])],544)),S("div",KSe,[S("h1",null,B(A(i)("app.authPageTitle")),1),S("p",null,B(A(i)("app.authPageMessage")),1)]),ve(Kt,{class:"auth-page-btn",variant:"primary",onClick:Gn},{default:Fe(()=>[ve(et,{name:"log-in",size:"md"}),S("span",null,B(A(i)("app.authPageLogin")),1)]),_:1})])])):(x(),E("div",{key:2,class:He(["app",{mobile:A(a),"sidebar-collapsed":A(Ee)&&!A(a),"macos-desktop":A(Gc)}]),style:Jt({"--preview-w":A(ne)+"px"})},[A(a)?(x(),Ae(Kxe,{key:1,workspace:A(s).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:A(s).status.value.branch,"session-count":f.value,onOpenSwitcher:V[19]||(V[19]=le=>c.value=!0),onOpenSettings:V[20]||(V[20]=le=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),E(De,{key:0},[ve(aH,{collapsed:A(Ee),dragging:A(ue),"col-width":A(Y),"active-workspace":A(s).visibleWorkspace.value,"active-workspace-id":A(s).activeWorkspaceId.value,sessions:A(s).sessionsForView.value,groups:A(s).workspaceGroups.value,"active-id":A(s).activeSessionId.value,"attention-by-session":A(s).attentionBySession.value,"pending-by-session":A(s).pendingBySession.value,"unread-by-session":A(s).unreadBySession.value,"workspace-sort-mode":A(s).workspaceSortMode.value,onSelect:V[2]||(V[2]=le=>A(s).selectSession(le)),onCreate:zs,onCreateInWorkspace:V[3]||(V[3]=le=>vo(le)),onSelectWorkspace:V[4]||(V[4]=le=>A(s).openWorkspace(le)),onAddWorkspace:V[5]||(V[5]=le=>Bn.value=!0),onRename:V[6]||(V[6]=(le,J)=>A(s).renameSession(le,J)),onArchive:V[7]||(V[7]=le=>Qs(le)),onFork:V[8]||(V[8]=le=>A(s).forkSession(le)),onExport:V[9]||(V[9]=le=>A(s).exportSession(le)),onRenameWorkspace:V[10]||(V[10]=(le,J)=>A(s).renameWorkspace(le,J)),onDeleteWorkspace:V[11]||(V[11]=le=>os(le)),onReorderWorkspaces:V[12]||(V[12]=le=>A(s).reorderWorkspaces(le)),onSetWorkspaceSortMode:V[13]||(V[13]=le=>A(s).setWorkspaceSortMode(le)),onLoadMoreSessions:V[14]||(V[14]=le=>void A(s).loadMoreSessions(le)),onLoadAllSessions:V[15]||(V[15]=le=>void A(s).loadAllSessions()),onOpenSettings:V[16]||(V[16]=le=>Ns.value=!0),onCollapse:A(P)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),Fn(ve(w_,{class:"side-handle","storage-key":A(ae),"default-width":A(oe),min:A(re),max:A(xe),"onUpdate:width":V[17]||(V[17]=le=>pe.value=le),"onUpdate:dragging":V[18]||(V[18]=le=>ue.value=le)},null,8,["storage-key","default-width","min","max"]),[[ci,!A(Ee)]])],64)),ve(Ihe,{ref_key:"conversationPaneRef",ref:Vt,mobile:A(a),turns:A(s).turns.value,"session-id":A(s).activeSessionId.value,approvals:A(s).pendingApprovals.value,changes:A(s).changes.value,"git-info":A(s).gitInfo.value,tasks:A(s).tasks.value,todos:A(s).todos.value,"activation-badges":A(s).activationBadges.value,status:A(s).status.value,thinking:A(s).thinking.value,"plan-mode":A(s).planMode.value,"swarm-mode":A(s).swarmMode.value,models:A(s).models.value,"starred-ids":A(s).starredModelIds.value,skills:A(s).skills.value,questions:A(s).questions.value,"pending-question-actions":A(s).pendingQuestionActions,"pending-approval-actions":A(s).pendingApprovalActions,running:h.value,"turn-active":A(s).turnActive.value,queued:A(s).queued.value,"search-files":A(s).searchFiles,"upload-image":A(s).uploadImage,working:A(s).working.value,starting:A(s).isStartingFirstPrompt.value,"fast-moon":A(s).fastMoon.value,"file-reload-key":A(s).activeSessionId.value,"session-loading":A(s).sessionLoading.value,compaction:A(s).compaction.value,"has-more-messages":A(s).hasMoreMessages.value,"loading-more":A(s).loadingMoreMessages.value,"loading-more-error":A(s).loadMoreMessagesError.value,"load-older-messages":A(s).loadOlderMessages,"workspace-name":A(s).visibleWorkspace.value?.name,"workspace-root":A(s).visibleWorkspace.value?.root??A(s).status.value.cwd,"git-diff-stats":A(s).gitDiffStats.value,workspaces:A(s).workspacesView.value,"active-workspace-id":A(s).activeWorkspaceId.value,"session-title":d.value,pr:A(s).activePullRequest.value,"conversation-toc":A(s).conversationToc.value,onOpenChanges:V[21]||(V[21]=le=>A(Ht)()),onSelectWorkspace:V[22]||(V[22]=le=>vo(le)),onAddWorkspace:V[23]||(V[23]=le=>Bn.value=!0),onOpenPr:zr,onSubmit:V[24]||(V[24]=le=>Ue(le)),onSteer:V[25]||(V[25]=le=>A(s).steerPrompt(le.text,le.attachments)),onApproval:V[26]||(V[26]=(le,J)=>A(s).respondApproval(le,J)),onCancelTask:V[27]||(V[27]=le=>A(s).cancelTask(le)),onAnswer:V[28]||(V[28]=(le,J)=>A(s).respondQuestion(le,J)),onDismiss:V[29]||(V[29]=le=>A(s).dismissQuestion(le)),onCommand:Bo,onInterrupt:V[30]||(V[30]=le=>A(s).abortCurrentPrompt()),onUnqueue:ti,onEditQueued:Do,onReorderQueue:go,onSetPermission:V[31]||(V[31]=le=>A(s).setPermission(le)),onSetThinking:V[32]||(V[32]=le=>A(s).setThinking(le)),onTogglePlan:V[33]||(V[33]=le=>A(s).togglePlanMode()),onToggleSwarm:V[34]||(V[34]=le=>A(s).toggleSwarmMode()),onRefreshGitStatus:V[35]||(V[35]=le=>A(s).activeSessionId.value&&A(s).loadGitStatus(A(s).activeSessionId.value)),onRenameSession:V[36]||(V[36]=(le,J)=>A(s).renameSession(le,J)),onForkSession:V[37]||(V[37]=le=>A(s).forkSession(le)),onArchiveSession:V[38]||(V[38]=le=>Qs(le)),onExportSession:V[39]||(V[39]=le=>A(s).exportSession(le)),onCompact:V[40]||(V[40]=le=>A(s).compact()),onPickModel:V[41]||(V[41]=le=>Zs()),onSelectModel:V[42]||(V[42]=le=>_s(le)),onOpenFile:V[43]||(V[43]=le=>A(q)(le)),onOpenMedia:V[44]||(V[44]=le=>A(X)(le)),onOpenThinking:V[45]||(V[45]=le=>A(Te)(le)),onOpenCompaction:V[46]||(V[46]=le=>A(Ke)(le)),onOpenAgent:V[47]||(V[47]=le=>A(at)(le)),onOpenToolDiff:V[48]||(V[48]=le=>A(Tt)(le)),onEditMessage:Ro},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","activation-badges","status","thinking","plan-mode","swarm-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!A(a)&&(A(Gc)||A(Ee))?(x(),Ae(Wn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:A(Ee)?A(i)("sidebar.expandSidebar"):A(i)("sidebar.collapseSidebar"),onClick:A(P)},{default:Fe(()=>[ve(et,{name:A(Ee)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ge("",!0),A(qe)&&!A(a)?(x(),Ae(w_,{key:3,class:"preview-handle","storage-key":A(G),"default-width":A(he),min:A(ye),max:A(fe),reverse:"","aria-label":A(i)("layout.resizePreviewAria"),"onUpdate:width":V[49]||(V[49]=le=>K.value=le),"onUpdate:dragging":V[50]||(V[50]=le=>It.value=le)},null,8,["storage-key","default-width","min","max","aria-label"])):ge("",!0),!A(a)||A(qe)?(x(),E("aside",{key:4,class:He(["global-preview",{open:A(qe),mobile:A(a),"no-anim":A(It)||F.value}]),role:"complementary","aria-label":A(i)("layout.detailPanelAria"),"aria-hidden":!A(qe)},[N.value==="thinking"&&A(we)?(x(),Ae(w3,{key:0,text:A(me)??"",onClose:A(Pe)},null,8,["text","onClose"])):N.value==="compaction"&&A(_e)?(x(),Ae(w3,{key:1,text:A(be)??"",subtitle:A(i)("conversation.summaryTitle"),onClose:A(Qe)},null,8,["text","subtitle","onClose"])):N.value==="agent"&&A(ot)?(x(),Ae(sme,{key:2,member:A(ot),onClose:A(ht)},null,8,["member","onClose"])):N.value==="btw"&&A(Gt)?(x(),Ae(Sme,{key:3,turns:A(s).sideChatTurns.value,running:A(s).sideChatRunning.value,sending:A(s).sideChatSending.value,onSend:V[51]||(V[51]=le=>A(s).sendSideChatPrompt(le)),onClose:A(Ye)},null,8,["turns","running","sending","onClose"])):N.value==="diff"?(x(),Ae(Qme,{key:4,mode:A(rn),changes:A(s).changes.value,"git-info":A(s).gitInfo.value,"file-diff":A(s).fileDiff.value,"selected-diff-path":A(s).selectedDiffPath.value,"file-diff-loading":A(s).fileDiffLoading.value,closable:"",onOpen:A(tn),onBack:V[52]||(V[52]=le=>{rn.value="list",vn.value=null,A(s).clearFileDiff()}),onClose:A(Zt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):N.value==="toolDiff"&&A(Et)?(x(),Ae(gme,{key:5,target:A(Et),onClose:A($t)},null,8,["target","onClose"])):N.value==="file"?(x(),Ae(Dpe,{key:6,file:A(R),loading:A(z),error:A(W),line:A(_)?.line,"download-url":A(L),closable:"","external-actions":A(O),"open-file":A(q),onClose:A(ie),onOpenExternal:A(U),onReveal:A(j)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ge("",!0)],10,GSe)):ge("",!0),ve(USe,{class:"internal-build-fab"}),kn.value?(x(),Ae(v1e,{key:5,models:A(s).models.value,current:A(s).status.value.modelId,"starred-ids":A(s).starredModelIds.value,loading:xs.value,unavailable:bn.value,onSelect:V[53]||(V[53]=le=>Xs(le)),onToggleStar:V[54]||(V[54]=le=>A(s).toggleStarModel(le)),onClose:V[55]||(V[55]=le=>kn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ge("",!0),Ns.value?(x(),Ae(Mbe,{key:6,"color-scheme":A(s).colorScheme.value,accent:A(s).accent.value,"ui-font-size":A(s).uiFontSize.value,"auth-ready":A(s).authReady.value,"account-model":A(s).defaultModel.value,notify:A(s).notifyOnComplete.value,"notify-question":A(s).notifyOnQuestion.value,"notify-approval":A(s).notifyOnApproval.value,"notify-permission":A(s).notifyPermission.value,sound:A(s).soundOnComplete.value,"conversation-toc":A(s).conversationToc.value,config:A(s).config.value,models:A(s).models.value,"config-saving":Ws.value,"server-version":A(s).serverVersion.value,onSetColorScheme:V[56]||(V[56]=le=>A(s).setColorScheme(le)),onSetAccent:V[57]||(V[57]=le=>A(s).setAccent(le)),onSetUiFontSize:V[58]||(V[58]=le=>A(s).setUiFontSize(le)),onSetNotify:V[59]||(V[59]=le=>A(s).setNotifyOnComplete(le)),onSetNotifyQuestion:V[60]||(V[60]=le=>A(s).setNotifyOnQuestion(le)),onSetNotifyApproval:V[61]||(V[61]=le=>A(s).setNotifyOnApproval(le)),onSetSound:V[62]||(V[62]=le=>A(s).setSoundOnComplete(le)),onSetConversationToc:V[63]||(V[63]=le=>A(s).setConversationToc(le)),onUpdateConfig:V[64]||(V[64]=le=>ei(le)),onLogin:V[65]||(V[65]=()=>{Ns.value=!1,Gn()}),onLogout:A(s).logout,onOpenOnboarding:V[66]||(V[66]=()=>{Ns.value=!1,C()}),onOpenProviders:V[67]||(V[67]=()=>{Ns.value=!1,Gn()}),onClose:V[68]||(V[68]=le=>Ns.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):ge("",!0),Mn.value?(x(),Ae(Axe,{key:7,status:A(s).status.value,thinking:g.value,"plan-mode":A(s).planMode.value,"swarm-mode":A(s).swarmMode.value,"cost-usd":A(s).sessionCost.value,onClose:V[69]||(V[69]=le=>Mn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ge("",!0),Bn.value?(x(),Ae(uxe,{key:8,"browse-fs":A(s).browseFs,"get-fs-home":A(s).getFsHome,"default-path":A(s).visibleWorkspace.value?.root??A(s).status.value.cwd,error:ct.value,onAdd:V[70]||(V[70]=le=>Ze(le)),onClose:ut},null,8,["browse-fs","get-fs-home","default-path","error"])):ge("",!0),ve(Fa,{name:"gload-fade"},{default:Fe(()=>[A(s).initialized.value?ge("",!0):(x(),Ae(U_e,{key:0,issue:A(s).connectIssue.value},null,8,["issue"]))]),_:1}),A(s).initialized.value&&v.value&&!A(m)?(x(),Ae(R_e,{key:9,onComplete:b,onSkip:b})):ge("",!0),ve(Dxe,{warnings:A(s).warnings.value,onDismiss:A(s).dismissWarning},null,8,["warnings","onDismiss"]),A(l)?(x(),Ae(kSe,{key:10})):ge("",!0),ve(pxe),A(a)?(x(),Ae(gwe,{key:11,modelValue:c.value,"onUpdate:modelValue":V[71]||(V[71]=le=>c.value=le),groups:A(s).workspaceGroups.value,"active-workspace-id":A(s).activeWorkspaceId.value,"active-id":A(s).activeSessionId.value,"attention-by-session":A(s).attentionBySession.value,"attention-by-workspace":A(s).attentionByWorkspace.value,onSelect:V[72]||(V[72]=le=>A(s).selectSession(le)),onCreate:zs,onCreateInWorkspace:V[73]||(V[73]=le=>vo(le)),onAddWorkspace:V[74]||(V[74]=le=>Bn.value=!0),onRename:V[75]||(V[75]=(le,J)=>A(s).renameSession(le,J)),onArchive:V[76]||(V[76]=le=>Qs(le)),onDeleteWorkspace:V[77]||(V[77]=le=>os(le)),onLoadMore:V[78]||(V[78]=le=>void A(s).loadMoreSessions(le))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ge("",!0),A(a)?(x(),Ae(S_e,{key:12,modelValue:u.value,"onUpdate:modelValue":V[79]||(V[79]=le=>u.value=le),status:A(s).status.value,thinking:A(s).thinking.value,models:A(s).models.value,"plan-mode":A(s).planMode.value,"swarm-mode":A(s).swarmMode.value,"color-scheme":A(s).colorScheme.value,"ui-font-size":A(s).uiFontSize.value,"auth-ready":A(s).authReady.value,"conversation-toc":A(s).conversationToc.value,"server-version":A(s).serverVersion.value,onPickModel:V[80]||(V[80]=le=>Zs()),onSetThinking:V[81]||(V[81]=le=>A(s).setThinking(le)),onTogglePlan:V[82]||(V[82]=le=>A(s).togglePlanMode()),onToggleSwarm:V[83]||(V[83]=le=>A(s).toggleSwarmMode()),onSetPermission:V[84]||(V[84]=le=>A(s).setPermission(le)),onSetColorScheme:V[85]||(V[85]=le=>A(s).setColorScheme(le)),onSetUiFontSize:V[86]||(V[86]=le=>A(s).setUiFontSize(le)),onSetConversationToc:V[87]||(V[87]=le=>A(s).setConversationToc(le)),onLogin:V[88]||(V[88]=()=>{u.value=!1,Gn()}),onLogout:A(s).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ge("",!0)],6)),ft.value?(x(),Ae(P1e,{key:3,providers:A(s).providers.value,loading:gs.value,unavailable:ws.value,onLoginApiKey:V[89]||(V[89]=le=>Fo(le)),onRefresh:V[90]||(V[90]=le=>Jo(le)),onLogout:V[91]||(V[91]=le=>Fi(le)),onOpenLogin:V[92]||(V[92]=le=>{ft.value=!1,mo(le)}),onClose:V[93]||(V[93]=le=>ft.value=!1)},null,8,["providers","loading","unavailable"])):ge("",!0),cn.value&&un.value?(x(),Ae(g0e,{key:4,"provider-name":A(s).providers.value.find(le=>le.id===un.value)?.name??un.value,"on-start-o-auth-login":Xt,"on-poll-o-auth-login":Is,"on-cancel-o-auth-login":Yn,onSuccess:Oo,onClose:V[94]||(V[94]=()=>{cn.value=!1,un.value=null})},null,8,["provider-name"])):ge("",!0)]))}}),ZSe=dt(YSe,[["__scopeId","data-v-e02f8d12"]]);gie();Zp(ZSe).use(On).mount("#app");export{n9 as $,$A as A,V9 as B,cs as C,KCe as D,Z3 as E,De as F,Ek as G,tt as H,ve as I,A9 as J,yCe as K,Ci as L,Xe as M,v7 as N,wCe as O,_Ce as P,ACe as Q,$p as R,Vc as S,c1 as T,SCe as U,Nk as V,xCe as W,YCe as X,CCe as Y,zCe as Z,XSe as _,AA as a,Ms as a$,hs as a0,hk as a1,oCe as a2,yk as a3,sM as a4,Ft as a5,pu as a6,uCe as a7,QCe as a8,pCe as a9,IA as aA,sI as aB,cI as aC,mn as aD,aI as aE,lI as aF,bf as aG,rI as aH,Cn as aI,bk as aJ,I9 as aK,x as aL,p7 as aM,aCe as aN,wn as aO,pA as aP,lCe as aQ,Bp as aR,Ts as aS,Ov as aT,se as aU,RCe as aV,$7 as aW,rt as aX,Rn as aY,dI as aZ,kCe as a_,vCe as aa,gCe as ab,mCe as ac,DCe as ad,JCe as ae,jt as af,KI as ag,l1 as ah,kl as ai,Or as aj,ns as ak,BCe as al,Vo as am,Al as an,vt as ao,TCe as ap,NCe as aq,hn as ar,yt as as,QI as at,He as au,XN as av,Jt as aw,nI as ax,iI as ay,Qn as az,rCe as b,hte as b$,jCe as b0,Gd as b1,Up as b2,UCe as b3,Cl as b4,x9 as b5,JSe as b6,tr as b7,D9 as b8,qCe as b9,po as bA,ci as bB,GI as bC,HCe as bD,Je as bE,xA as bF,dCe as bG,H9 as bH,LCe as bI,Fe as bJ,MCe as bK,Fn as bL,Yi as bM,PCe as bN,Mt as bO,cCe as bP,gn as bQ,io as bR,i4e as bS,r4e as bT,O8 as bU,l4e as bV,Lee as bW,F8 as bX,Cy as bY,d4e as bZ,gte as b_,QSe as ba,B as bb,lp as bc,bCe as bd,sn as be,tCe as bf,eCe as bg,hA as bh,OCe as bi,_9 as bj,A as bk,Sf as bl,XCe as bm,GCe as bn,k7 as bo,fCe as bp,$Ce as bq,P9 as br,ZCe as bs,ECe as bt,hCe as bu,CA as bv,Yp as bw,E7 as bx,kM as by,Zv as bz,WCe as c,A2 as c0,S2 as c1,C2 as c2,h4e as c3,_m as c4,Rc as c5,xm as c6,cte as c7,ute as c8,p4e as c9,f4e as ca,n4e as cb,m4e as cc,O1 as cd,So as ce,Ate as cf,Cte as cg,Cee as ch,o4e as ci,xee as cj,wee as ck,s4e as cl,M2 as cm,Mte as cn,n4 as co,RC as cp,Fee as cq,wm as cr,bm as cs,a4e as ct,u4e as cu,t4e as cv,c4e as cw,et as cx,e4e as cy,dt as cz,FCe as d,bl as e,nCe as f,Fa as g,w7 as h,sCe as i,iCe as j,pi as k,xf as l,ks as m,Jm as n,Rr as o,VCe as p,D as q,Zp as r,Ae as s,ge as t,E as u,S as v,$I as w,ICe as x,LI as y,F7 as z};
|