@moonshot-ai/kimi-code 0.24.0 → 0.24.2
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 +3741 -2546
- package/dist-web/assets/{CodeBlockNode-CJ5S3jcL.js → CodeBlockNode-Df9vE1bZ.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DUnzbdWv.js → CodeBlockShell.vue_vue_type_style_index_0_lang-BiluoKas.js} +1 -1
- package/dist-web/assets/{DesignSystemView-CNbvXMLA.js → DesignSystemView-nRvuUAQ4.js} +1 -1
- package/dist-web/assets/{Tooltip-CYfSKW77.js → Tooltip-5xFjGt0g.js} +1 -1
- package/dist-web/assets/{arc-DM5w0UUk.js → arc-Dnx59qWR.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-BJGCvcyq.js → architectureDiagram-3BPJPVTR-DBpWrZ57.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-Ak3DV2hQ.js → blockDiagram-GPEHLZMM-DkT6M00_.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-CXmo8JCq.js → c4Diagram-AAUBKEIU-Cg7BlfZP.js} +1 -1
- package/dist-web/assets/channel-Dm0wArMZ.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-hsEGBMgQ.js → chunk-2J33WTMH-DG3GkhIs.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-BuRXIxwX.js → chunk-4BX2VUAB-mFuL4qyD.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-D36fUZmW.js → chunk-55IACEB6-C0MGLKjj.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-CSCtMBtG.js → chunk-727SXJPM-Baip9cBY.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-CVmv6q-C.js → chunk-AQP2D5EJ-B_MICX9C.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-CH1uVWZS.js → chunk-FMBD7UC4-P6Nt3H0u.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-BAsHVCmB.js → chunk-ND2GUHAM-vM3LTmKp.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-34z8roSX.js → chunk-QZHKN3VN-hUKMa2zX.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-CZ2lYDqs.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CZ2lYDqs.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-CZ3dL5vA.js → cose-bilkent-S5V4N54A-CoHANoHI.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-BFyCXAsK.js → dagre-BM42HDAG-DZ3-tpA0.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-CrGQtKum.js → diagram-2AECGRRQ-sVVmisSp.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DjrbO2YB.js → diagram-5GNKFQAL-WCU7ClNI.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-BidfbUQS.js → diagram-KO2AKTUF-p-iMIdgG.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-DSb43eJz.js → diagram-LMA3HP47-BvhDYPBc.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-DbIEjLYd.js → diagram-OG6HWLK6-C3UcJGVW.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-PqhrwUsN.js → erDiagram-TEJ5UH35-CcWR77tk.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-B6Y_JEK9.js → flowDiagram-I6XJVG4X-B84AEAo5.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-Bgzb2wCP.js → ganttDiagram-6RSMTGT7-HzyM30-H.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-BuPKv8u1.js → gitGraphDiagram-PVQCEYII-DJzaqTlt.js} +1 -1
- package/dist-web/assets/index-BKjLOXXE.js +325 -0
- package/dist-web/assets/{index-CXANJOpJ.js → index-BaDw7JC5.js} +2 -2
- package/dist-web/assets/{index-DKUtUfyZ.js → index-C71HJFAU.js} +1 -1
- package/dist-web/assets/index-DF8geVzs.css +1 -0
- package/dist-web/assets/{index10-geSt3mfj.js → index10-CZB6i7OT.js} +1 -1
- package/dist-web/assets/{index11-j-uBECZt.js → index11-D4J7mrqX.js} +1 -1
- package/dist-web/assets/{index5-C-Vgz62s.js → index5-lb-zFPOO.js} +1 -1
- package/dist-web/assets/{index6-CyOQc7vf.js → index6-XVcJQJvG.js} +1 -1
- package/dist-web/assets/{index7-BsqLagLn.js → index7-zYh5L7gm.js} +1 -1
- package/dist-web/assets/{index8-CmPghiWh.js → index8-BBnkw3W9.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-DIshBg7O.js → infoDiagram-5YYISTIA-Cb4CgzWD.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-COkhNYqM.js → ishikawaDiagram-YF4QCWOH-BiGyvml5.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-ChCikam8.js → journeyDiagram-JHISSGLW-D9e-zPlz.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-Tpr3y2G7.js → kanban-definition-UN3LZRKU-DRlzV1V8.js} +1 -1
- package/dist-web/assets/{linear-B4vx9XxZ.js → linear-BDV37mWq.js} +1 -1
- package/dist-web/assets/{mermaid.core-BuL5LAnc.js → mermaid.core-CuWz3x7I.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-DXOpYlyO.js → mindmap-definition-RKZ34NQL-BTtrckv5.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-BLbISlhP.js → pieDiagram-4H26LBE5-DbDWMeWy.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-C0112avZ.js → quadrantDiagram-W4KKPZXB-CrOQQAIE.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-BNFdetqm.js → requirementDiagram-4Y6WPE33-BcavKuxq.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-CcgvE5-p.js → sankeyDiagram-5OEKKPKP-ald5-wcg.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BvIw4dCy.js → sequenceDiagram-3UESZ5HK-BgRvBCDj.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-B3aH9w2s.js → stateDiagram-AJRCARHV-Di3BDQCW.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-3yJrfNOJ.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DoZdpZ4G.js → timeline-definition-PNZ67QCA-B4uD09jJ.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-9XQhhQFt.js → vennDiagram-CIIHVFJN-DnL5fgpC.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-DvsjYmbL.js → vue.runtime.esm-bundler-DzIUJ9SW.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-DlNxrTF5.js → wardley-L42UT6IY-Dqk9cHYZ.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-Cb8vH0kt.js → wardleyDiagram-YWT4CUSO-Hgwz5FgA.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-Bmi9SOWb.js → xychartDiagram-2RQKCTM6-TMOow26O.js} +1 -1
- package/dist-web/index.html +3 -3
- package/package.json +9 -9
- package/dist-web/assets/channel-bC8DwGBL.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Cgnn_8I-.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cgnn_8I-.js +0 -1
- package/dist-web/assets/index-BRLKiXrx.css +0 -1
- package/dist-web/assets/index-CkGmgp0_.js +0 -325
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Bx0mCnl0.js +0 -1
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-CNbvXMLA.js","assets/DesignSystemView-Dyj5tvMI.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-CJ5S3jcL.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DUnzbdWv.js","assets/index8-CmPghiWh.js","assets/index11-j-uBECZt.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 jp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Jt={},Ac=[],xi=()=>{},s4=()=>!1,Bd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Vp=e=>e.startsWith("onUpdate:"),xn=Object.assign,sy=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},rE=Object.prototype.hasOwnProperty,cn=(e,t)=>rE.call(e,t),_t=Array.isArray,Mc=e=>Jc(e)==="[object Map]",Ta=e=>Jc(e)==="[object Set]",Ab=e=>Jc(e)==="[object Date]",lE=e=>Jc(e)==="[object RegExp]",$t=e=>typeof e=="function",Nn=e=>typeof e=="string",ti=e=>typeof e=="symbol",un=e=>e!==null&&typeof e=="object",oy=e=>(un(e)||$t(e))&&$t(e.then)&&$t(e.catch),o4=Object.prototype.toString,Jc=e=>o4.call(e),aE=e=>Jc(e).slice(8,-1),Kp=e=>Jc(e)==="[object Object]",Gp=e=>Nn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ga=jp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},cE=/-\w/g,Ls=Yp(e=>e.replace(cE,t=>t.slice(1).toUpperCase())),uE=/\B([A-Z])/g,$o=Yp(e=>e.replace(uE,"-$1").toLowerCase()),Zp=Yp(e=>e.charAt(0).toUpperCase()+e.slice(1)),ch=Yp(e=>e?`on${Zp(e)}`:""),Vs=(e,t)=>!Object.is(e,t),Ec=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},i4=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Qp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$h=e=>{const t=Nn(e)?Number(e):NaN;return isNaN(t)?e:t};let Mb;const Xp=()=>Mb||(Mb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),dE="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",fE=jp(dE);function Yt(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Nn(s)?gE(s):Yt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Nn(e)||un(e))return e}const hE=/;(?![^(]*\))/g,pE=/:([^]+)/,mE=/\/\*[^]*?\*\//g;function gE(e){const t={};return e.replace(mE,"").split(hE).forEach(n=>{if(n){const s=n.split(pE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Pe(e){let t="";if(Nn(e))t=e;else if(_t(e))for(let n=0;n<e.length;n++){const s=Pe(e[n]);s&&(t+=s+" ")}else if(un(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function uxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Nn(t)&&(e.class=Pe(t)),n&&(e.style=Yt(n)),e}const vE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",yE=jp(vE);function r4(e){return!!e||e===""}function kE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Fr(e[s],t[s]);return n}function Fr(e,t){if(e===t)return!0;let n=Ab(e),s=Ab(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ti(e),s=ti(t),n||s)return e===t;if(n=_t(e),s=_t(t),n||s)return n&&s?kE(e,t):!1;if(n=un(e),s=un(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Fr(e[r],t[r]))return!1}}return String(e)===String(t)}function Jp(e,t){return e.findIndex(n=>Fr(n,t))}const l4=e=>!!(e&&e.__v_isRef===!0),O=e=>Nn(e)?e:e==null?"":_t(e)||un(e)&&(e.toString===o4||!$t(e.toString))?l4(e)?O(e.value):JSON.stringify(e,a4,2):String(e),a4=(e,t)=>l4(t)?a4(e,t.value):Mc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[q1(s,i)+" =>"]=o,n),{})}:Ta(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>q1(n))}:ti(t)?q1(t):un(t)&&!_t(t)&&!Kp(t)?String(t):t,q1=(e,t="")=>{var n;return ti(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function bE(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
7
|
-
* @vue/reactivity v3.5.35
|
|
8
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
-
* @license MIT
|
|
10
|
-
**/let Is;class c4{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Is&&(Is.active?(this.parent=Is,this.index=(Is.scopes||(Is.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Is;try{return Is=this,t()}finally{Is=n}}}on(){++this._on===1&&(this.prevScope=Is,Is=this)}off(){if(this._on>0&&--this._on===0){if(Is===this)Is=this.prevScope;else{let t=Is;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function xE(e){return new c4(e)}function iy(){return Is}function ry(e,t=!1){Is&&Is.cleanups.push(e)}let Hn;const j1=new WeakSet;class Lh{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Is&&(Is.active?Is.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,j1.has(this)&&(j1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||d4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Eb(this),f4(this);const t=Hn,n=Fi;Hn=this,Fi=!0;try{return this.fn()}finally{h4(this),Hn=t,Fi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)cy(t);this.deps=this.depsTail=void 0,Eb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?j1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Sg(this)&&this.run()}get dirty(){return Sg(this)}}let u4=0,ju,Vu;function d4(e,t=!1){if(e.flags|=8,t){e.next=Vu,Vu=e;return}e.next=ju,ju=e}function ly(){u4++}function ay(){if(--u4>0)return;if(Vu){let t=Vu;for(Vu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ju;){let t=ju;for(ju=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 f4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function h4(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),cy(s),_E(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Sg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(p4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function p4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ud)||(e.globalVersion=ud,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Sg(e))))return;e.flags|=2;const t=e.dep,n=Hn,s=Fi;Hn=e,Fi=!0;try{f4(e);const o=e.fn(e._value);(t.version===0||Vs(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Hn=n,Fi=s,h4(e),e.flags&=-3}}function cy(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)cy(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _E(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function dxe(e,t){e.effect instanceof Lh&&(e=e.effect.fn);const n=new Lh(e);t&&xn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function fxe(e){e.effect.stop()}let Fi=!0;const m4=[];function Or(){m4.push(Fi),Fi=!1}function Rr(){const e=m4.pop();Fi=e===void 0?!0:e}function Eb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Hn;Hn=void 0;try{t()}finally{Hn=n}}}let ud=0;class wE{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 em{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(!Hn||!Fi||Hn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Hn)n=this.activeLink=new wE(Hn,this),Hn.deps?(n.prevDep=Hn.depsTail,Hn.depsTail.nextDep=n,Hn.depsTail=n):Hn.deps=Hn.depsTail=n,g4(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=Hn.depsTail,n.nextDep=void 0,Hn.depsTail.nextDep=n,Hn.depsTail=n,Hn.deps===n&&(Hn.deps=s)}return n}trigger(t){this.version++,ud++,this.notify(t)}notify(t){ly();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ay()}}}function g4(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)g4(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Fh=new WeakMap,va=Symbol(""),Cg=Symbol(""),dd=Symbol("");function no(e,t,n){if(Fi&&Hn){let s=Fh.get(e);s||Fh.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new em),o.map=s,o.key=n),o.track()}}function Cr(e,t,n,s,o,i){const r=Fh.get(e);if(!r){ud++;return}const l=a=>{a&&a.trigger()};if(ly(),t==="clear")r.forEach(l);else{const a=_t(e),c=a&&Gp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===dd||!ti(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(dd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(va)),Mc(e)&&l(r.get(Cg)));break;case"delete":a||(l(r.get(va)),Mc(e)&&l(r.get(Cg)));break;case"set":Mc(e)&&l(r.get(va));break}}ay()}function SE(e,t){const n=Fh.get(e);return n&&n.get(t)}function Qa(e){const t=nn(e);return t===e?t:(no(t,"iterate",dd),Yo(e)?t:t.map(Ri))}function tm(e){return no(e=nn(e),"iterate",dd),e}function Xi(e,t){return Br(e)?Uc(xl(e)?Ri(t):t):Ri(t)}const CE={__proto__:null,[Symbol.iterator](){return V1(this,Symbol.iterator,e=>Xi(this,e))},concat(...e){return Qa(this).concat(...e.map(t=>_t(t)?Qa(t):t))},entries(){return V1(this,"entries",e=>(e[1]=Xi(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=>Xi(this,s)),arguments)},find(e,t){return fr(this,"find",e,t,n=>Xi(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=>Xi(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 K1(this,"includes",e)},indexOf(...e){return K1(this,"indexOf",e)},join(e){return Qa(this).join(e)},lastIndexOf(...e){return K1(this,"lastIndexOf",e)},map(e,t){return fr(this,"map",e,t,void 0,arguments)},pop(){return Cu(this,"pop")},push(...e){return Cu(this,"push",e)},reduce(e,...t){return Tb(this,"reduce",e,t)},reduceRight(e,...t){return Tb(this,"reduceRight",e,t)},shift(){return Cu(this,"shift")},some(e,t){return fr(this,"some",e,t,void 0,arguments)},splice(...e){return Cu(this,"splice",e)},toReversed(){return Qa(this).toReversed()},toSorted(e){return Qa(this).toSorted(e)},toSpliced(...e){return Qa(this).toSpliced(...e)},unshift(...e){return Cu(this,"unshift",e)},values(){return V1(this,"values",e=>Xi(this,e))}};function V1(e,t,n){const s=tm(e),o=s[t]();return s!==e&&!Yo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const AE=Array.prototype;function fr(e,t,n,s,o,i){const r=tm(e),l=r!==e&&!Yo(e),a=r[t];if(a!==AE[t]){const d=a.apply(e,i);return l?Ri(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Xi(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 Tb(e,t,n,s){const o=tm(e),i=o!==e&&!Yo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Xi(e,c)),n.call(this,c,Xi(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?Xi(e,a):a}function K1(e,t,n){const s=nn(e);no(s,"iterate",dd);const o=s[t](...n);return(o===-1||o===!1)&&om(n[0])?(n[0]=nn(n[0]),s[t](...n)):o}function Cu(e,t,n=[]){Or(),ly();const s=nn(e)[t].apply(e,n);return ay(),Rr(),s}const ME=jp("__proto__,__v_isRef,__isVue"),v4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ti));function EE(e){ti(e)||(e=String(e));const t=nn(this);return no(t,"has",e),t.hasOwnProperty(e)}class y4{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?S4:w4:i?_4:x4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=_t(t);if(!o){let a;if(r&&(a=CE[n]))return a;if(n==="hasOwnProperty")return EE}const l=Reflect.get(t,n,hs(t)?t:s);if((ti(n)?v4.has(n):ME(n))||(o||no(t,"get",n),i))return l;if(hs(l)){const a=r&&Gp(n)?l:l.value;return o&&un(a)?Oh(a):a}return un(l)?o?Oh(l):Hs(l):l}}class k4 extends y4{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=_t(t)&&Gp(n);if(!this._isShallow){const c=Br(i);if(!Yo(s)&&!Br(s)&&(i=nn(i),s=nn(s)),!r&&hs(i)&&!hs(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:cn(t,n),a=Reflect.set(t,n,s,hs(t)?t:o);return t===nn(o)&&(l?Vs(s,i)&&Cr(t,"set",n,s):Cr(t,"add",n,s)),a}deleteProperty(t,n){const s=cn(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(!ti(n)||!v4.has(n))&&no(t,"has",n),s}ownKeys(t){return no(t,"iterate",_t(t)?"length":va),Reflect.ownKeys(t)}}class b4 extends y4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const TE=new k4,NE=new b4,IE=new k4(!0),$E=new b4(!0),Ag=e=>e,wf=e=>Reflect.getPrototypeOf(e);function LE(e,t,n){return function(...s){const o=this.__v_raw,i=nn(o),r=Mc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Ag:t?Uc:Ri;return!t&&no(i,"iterate",a?Cg:va),xn(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 Sf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function FE(e,t){const n={get(o){const i=this.__v_raw,r=nn(i),l=nn(o);e||(Vs(o,l)&&no(r,"get",o),no(r,"get",l));const{has:a}=wf(r),c=t?Ag:e?Uc:Ri;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&no(nn(o),"iterate",va),o.size},has(o){const i=this.__v_raw,r=nn(i),l=nn(o);return e||(Vs(o,l)&&no(r,"has",o),no(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=nn(l),c=t?Ag:e?Uc:Ri;return!e&&no(a,"iterate",va),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return xn(n,e?{add:Sf("add"),set:Sf("set"),delete:Sf("delete"),clear:Sf("clear")}:{add(o){const i=nn(this),r=wf(i),l=nn(o),a=!t&&!Yo(o)&&!Br(o)?l:o;return r.has.call(i,a)||Vs(o,a)&&r.has.call(i,o)||Vs(l,a)&&r.has.call(i,l)||(i.add(a),Cr(i,"add",a,a)),this},set(o,i){!t&&!Yo(i)&&!Br(i)&&(i=nn(i));const r=nn(this),{has:l,get:a}=wf(r);let c=l.call(r,o);c||(o=nn(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Vs(i,u)&&Cr(r,"set",o,i):Cr(r,"add",o,i),this},delete(o){const i=nn(this),{has:r,get:l}=wf(i);let a=r.call(i,o);a||(o=nn(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Cr(i,"delete",o,void 0),c},clear(){const o=nn(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]=LE(o,e,t)}),n}function nm(e,t){const n=FE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(cn(n,o)&&o in s?n:s,o,i)}const OE={get:nm(!1,!1)},RE={get:nm(!1,!0)},BE={get:nm(!0,!1)},DE={get:nm(!0,!0)},x4=new WeakMap,_4=new WeakMap,w4=new WeakMap,S4=new WeakMap;function PE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Hs(e){return Br(e)?e:sm(e,!1,TE,OE,x4)}function HE(e){return sm(e,!1,IE,RE,_4)}function Oh(e){return sm(e,!0,NE,BE,w4)}function hxe(e){return sm(e,!0,$E,DE,S4)}function sm(e,t,n,s,o){if(!un(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=PE(aE(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function xl(e){return Br(e)?xl(e.__v_raw):!!(e&&e.__v_isReactive)}function Br(e){return!!(e&&e.__v_isReadonly)}function Yo(e){return!!(e&&e.__v_isShallow)}function om(e){return e?!!e.__v_raw:!1}function nn(e){const t=e&&e.__v_raw;return t?nn(t):e}function mt(e){return!cn(e,"__v_skip")&&Object.isExtensible(e)&&i4(e,"__v_skip",!0),e}const Ri=e=>un(e)?Hs(e):e,Uc=e=>un(e)?Oh(e):e;function hs(e){return e?e.__v_isRef===!0:!1}function Q(e){return C4(e,!1)}function Na(e){return C4(e,!0)}function C4(e,t){return hs(e)?e:new WE(e,t)}class WE{constructor(t,n){this.dep=new em,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nn(t),this._value=n?t:Ri(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Yo(t)||Br(t);t=s?t:nn(t),Vs(t,n)&&(this._rawValue=t,this._value=s?t:Ri(t),this.dep.trigger())}}function pxe(e){e.dep&&e.dep.trigger()}function C(e){return hs(e)?e.value:e}function A4(e){return $t(e)?e():C(e)}const zE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return hs(o)&&!hs(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function M4(e){return xl(e)?e:new Proxy(e,zE)}class UE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new em,{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 qE(e){return new UE(e)}function mxe(e){const t=_t(e)?new Array(e.length):{};for(const n in e)t[n]=E4(e,n);return t}class jE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=ti(n)?n:String(n),this._raw=nn(t);let o=!0,i=t;if(!_t(t)||ti(this._key)||!Gp(this._key))do o=!om(i)||Yo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&hs(this._raw[this._key])){const n=this._object[this._key];if(hs(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return SE(this._raw,this._key)}}class VE{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 gxe(e,t,n){return hs(e)?e:$t(e)?new VE(e):un(e)&&arguments.length>1?E4(e,t,n):Q(e)}function E4(e,t,n){return new jE(e,t,n)}class KE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new em(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ud-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Hn!==this)return d4(this,!0),!0}get value(){const t=this.dep.track();return p4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function GE(e,t,n=!1){let s,o;return $t(e)?s=e:(s=e.get,o=e.set),new KE(s,o,n)}const vxe={GET:"get",HAS:"has",ITERATE:"iterate"},yxe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Cf={},Rh=new WeakMap;let dl;function kxe(){return dl}function YE(e,t=!1,n=dl){if(n){let s=Rh.get(n);s||Rh.set(n,s=[]),s.push(e)}}function ZE(e,t,n=Jt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Yo(y)||o===!1||o===0?Ar(y,1):Ar(y);let u,d,f,h,p=!1,m=!1;if(hs(e)?(d=()=>e.value,p=Yo(e)):xl(e)?(d=()=>c(e),p=!0):_t(e)?(m=!0,p=e.some(y=>xl(y)||Yo(y)),d=()=>e.map(y=>{if(hs(y))return y.value;if(xl(y))return c(y);if($t(y))return a?a(y,2):y()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Or();try{f()}finally{Rr()}}const y=dl;dl=u;try{return a?a(e,3,[h]):e(h)}finally{dl=y}}:d=xi,t&&o){const y=d,A=o===!0?1/0:o;d=()=>Ar(y(),A)}const x=iy(),k=()=>{u.stop(),x&&x.active&&sy(x.effects,u)};if(i&&t){const y=t;t=(...A)=>{y(...A),k()}}let g=m?new Array(e.length).fill(Cf):Cf;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const A=u.run();if(o||p||(m?A.some((L,$)=>Vs(L,g[$])):Vs(A,g))){f&&f();const L=dl;dl=u;try{const $=[A,g===Cf?void 0:m&&g[0]===Cf?[]:g,h];g=A,a?a(t,3,$):t(...$)}finally{dl=L}}}else u.run()};return l&&l(v),u=new Lh(d),u.scheduler=r?()=>r(v,!1):v,h=y=>YE(y,!1,u),f=u.onStop=()=>{const y=Rh.get(u);if(y){if(a)a(y,4);else for(const A of y)A();Rh.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||!un(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,hs(e))Ar(e.value,t,n);else if(_t(e))for(let s=0;s<e.length;s++)Ar(e[s],t,n);else if(Ta(e)||Mc(e))e.forEach(s=>{Ar(s,t,n)});else if(Kp(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 T4=[];function QE(e){T4.push(e)}function XE(){T4.pop()}function bxe(e,t){}const xxe={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},JE={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Dd(e,t,n,s){try{return s?e(...s):e()}catch(o){eu(o,t,n)}}function Si(e,t,n,s){if($t(e)){const o=Dd(e,t,n,s);return o&&oy(o)&&o.catch(i=>{eu(i,t,n)}),o}if(_t(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Si(e[i],t,n,s));return o}}function eu(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Jt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Or(),Dd(i,null,10,[e,a,c]),Rr();return}}eT(e,n,o,s,r)}function eT(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const po=[];let Yi=-1;const Tc=[];let fl=null,cc=0;const N4=Promise.resolve();let Bh=null;function gt(e){const t=Bh||N4;return e?t.then(this?e.bind(this):e):t}function tT(e){let t=Yi+1,n=po.length;for(;t<n;){const s=t+n>>>1,o=po[s],i=fd(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function uy(e){if(!(e.flags&1)){const t=fd(e),n=po[po.length-1];!n||!(e.flags&2)&&t>=fd(n)?po.push(e):po.splice(tT(t),0,e),e.flags|=1,I4()}}function I4(){Bh||(Bh=N4.then($4))}function Dh(e){_t(e)?Tc.push(...e):fl&&e.id===-1?fl.splice(cc+1,0,e):e.flags&1||(Tc.push(e),e.flags|=1),I4()}function Nb(e,t,n=Yi+1){for(;n<po.length;n++){const s=po[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;po.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Ph(e){if(Tc.length){const t=[...new Set(Tc)].sort((n,s)=>fd(n)-fd(s));if(Tc.length=0,fl){fl.push(...t);return}for(fl=t,cc=0;cc<fl.length;cc++){const n=fl[cc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}fl=null,cc=0}}const fd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function $4(e){try{for(Yi=0;Yi<po.length;Yi++){const t=po[Yi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Dd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Yi<po.length;Yi++){const t=po[Yi];t&&(t.flags&=-2)}Yi=-1,po.length=0,Ph(),Bh=null,(po.length||Tc.length)&&$4()}}let uc,Af=[];function L4(e,t){var n,s;uc=e,uc?(uc.enabled=!0,Af.forEach(({event:o,args:i})=>uc.emit(o,...i)),Af=[]):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=>{L4(i,t)}),setTimeout(()=>{uc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Af=[])},3e3)):Af=[]}let Ys=null,im=null;function hd(e){const t=Ys;return Ys=e,im=e&&e.type.__scopeId||null,t}function _xe(e){im=e}function wxe(){im=null}const Sxe=e=>Me;function Me(e,t=Ys,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&qh(-1);const i=hd(t);let r;try{r=e(...o)}finally{hd(i),s._d&&qh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Rn(e,t){if(Ys===null)return e;const n=zd(Ys),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Jt]=t[o];i&&($t(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 Zi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Or(),Si(a,n,8,[e.el,l,e,t]),Rr())}}function Fn(e,t){if(Gs){let n=Gs.provides;const s=Gs.parent&&Gs.parent.provides;s===n&&(n=Gs.provides=Object.create(s)),n[e]=t}}function Kt(e,t,n=!1){const s=Zs();if(s||ya){let o=ya?ya._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&$t(t)?t.call(s&&s.proxy):t}}function Cxe(){return!!(Zs()||ya)}const nT=Symbol.for("v-scx"),sT=()=>Kt(nT);function oT(e,t){return Pd(e,null,t)}function Axe(e,t){return Pd(e,null,{flush:"post"})}function iT(e,t){return Pd(e,null,{flush:"sync"})}function Ze(e,t,n){return Pd(e,t,n)}function Pd(e,t,n=Jt){const{immediate:s,deep:o,flush:i,once:r}=n,l=xn({},n),a=t&&s||!t&&i!=="post";let c;if(wa){if(i==="sync"){const h=sT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=xi,h.resume=xi,h.pause=xi,h}}const u=Gs;l.call=(h,p,m)=>Si(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{ks(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():uy(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=ZE(e,t,l);return wa&&(c?c.push(f):a&&f()),f}function rT(e,t,n){const s=this.proxy,o=Nn(e)?e.includes(".")?F4(s,e):()=>s[e]:e.bind(s,s);let i;$t(t)?i=t:(i=t.handler,n=t);const r=tu(this),l=Pd(o,i.bind(s),n);return r(),l}function F4(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const al=new WeakMap,O4=Symbol("_vte"),R4=e=>e.__isTeleport,la=e=>e&&(e.disabled||e.disabled===""),lT=e=>e&&(e.defer||e.defer===""),Ib=e=>typeof SVGElement<"u"&&e instanceof SVGElement,$b=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Mg=(e,t)=>{const n=e&&e.to;return Nn(n)?t?t(n):null:n},aT={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:x,parentNode:k}}=c,g=la(t.props);let{dynamicChildren:v}=t;const y=($,_,E)=>{$.shapeFlag&16&&u($.children,_,E,o,i,r,l,a)},A=($=t)=>{const _=la($.props),E=$.target=Mg($.props,p),N=Eg(E,$,m,h);E&&(r!=="svg"&&Ib(E)?r="svg":r!=="mathml"&&$b(E)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(E),_||(y($,E,N),Ou($,!1)))},L=$=>{const _=()=>{if(al.get($)===_){if(al.delete($),la($.props)){const E=k($.el)||n;y($,E,$.anchor),Ou($,!0)}A($)}};al.set($,_),ks(_,i)};if(e==null){const $=t.el=m(""),_=t.anchor=m("");if(h($,n,s),h(_,n,s),lT(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,_),Ou(t,!0)),A()}else{t.el=e.el;const $=t.anchor=e.anchor,_=al.get(e);if(_){_.flags|=8,al.delete(e),L(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=la(e.props),S=F?n:E,I=F?$:N;if(r==="svg"||Ib(E)?r="svg":(r==="mathml"||$b(E))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),by(e,t,!0)):a||d(e,t,S,I,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Mf(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Mg(t.props,p);R&&Mf(t,R,null,c,0)}else F&&Mf(t,E,N,c,1);Ou(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||!la(f),p=al.get(e);if(p&&(p.flags|=8,al.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const x=l[m];s(x,t,n,h,!!x.dynamicChildren)}},move:Mf,hydrate:cT};function Mf(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!al.has(e)&&(!d||la(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function cT(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(x,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,x._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(x,k){k.anchor=d(r(x),k,l(x),n,s,o,i)}const p=t.target=Mg(t.props,a),m=la(t.props);if(p){const x=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,x),t.targetAnchor||Eg(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,x),t.targetAnchor||Eg(p,t,u,c),d(x&&r(x),t,p,n,s,o,i))),Ou(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const rm=aT;function Ou(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Eg(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[O4]=r,e&&(s(i,e,o),s(r,e,o)),r}const mi=Symbol("_leaveCb"),Au=Symbol("_enterCb");function B4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return gn(()=>{e.isMounted=!0}),ps(()=>{e.isUnmounting=!0}),e}const ci=[Function,Array],D4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ci,onEnter:ci,onAfterEnter:ci,onEnterCancelled:ci,onBeforeLeave:ci,onLeave:ci,onAfterLeave:ci,onLeaveCancelled:ci,onBeforeAppear:ci,onAppear:ci,onAfterAppear:ci,onAppearCancelled:ci},P4=e=>{const t=e.subTree;return t.component?P4(t.component):t},uT={name:"BaseTransition",props:D4,setup(e,{slots:t}){const n=Zs(),s=B4();return()=>{const o=t.default&&dy(t.default(),!0),i=o&&o.length?H4(o):n.subTree?re():void 0;if(!i)return;const r=nn(e),{mode:l}=r;if(s.isLeaving)return G1(i);const a=Lb(i);if(!a)return G1(i);let c=pd(a,r,s,n,d=>c=d);a.type!==xs&&Ml(a,c);let u=n.subTree&&Lb(n.subTree);if(u&&u.type!==xs&&!Ii(u,a)&&P4(n).type!==xs){let d=pd(u,r,s,n);if(Ml(u,d),l==="out-in"&&a.type!==xs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},G1(i);l==="in-out"&&a.type!==xs?d.delayLeave=(f,h,p)=>{const m=W4(s,u);m[String(u.key)]=u,f[mi]=()=>{h(),f[mi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function H4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==xs){t=n;break}}return t}const dT=uT;function W4(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 pd(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:x,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),A=W4(n,e),L=(E,N)=>{E&&Si(E,s,9,N)},$=(E,N)=>{const F=N[1];L(E,N),_t(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},_={mode:r,persisted:l,beforeEnter(E){let N=a;if(!n.isMounted)if(i)N=x||a;else return;E[mi]&&E[mi](!0);const F=A[y];F&&Ii(e,F)&&F.el[mi]&&F.el[mi](),L(N,[E])},enter(E){if(A[y]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=k||c,F=g||u,S=v||d;else return;let I=!1;E[Au]=B=>{I||(I=!0,B?L(S,[E]):L(F,[E]),_.delayedLeave&&_.delayedLeave(),E[Au]=void 0)};const R=E[Au].bind(null,!1);N?$(N,[E,R]):R()},leave(E,N){const F=String(e.key);if(E[Au]&&E[Au](!0),n.isUnmounting)return N();L(f,[E]);let S=!1;E[mi]=R=>{S||(S=!0,N(),R?L(m,[E]):L(p,[E]),E[mi]=void 0,A[F]===e&&delete A[F])};const I=E[mi].bind(null,!1);A[F]=e,h?$(h,[E,I]):I()},clone(E){const N=pd(E,t,n,s,o);return o&&o(N),N}};return _}function G1(e){if(Hd(e))return e=Dr(e),e.children=null,e}function Lb(e){if(!Hd(e))return R4(e.type)&&e.children?H4(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&$t(n.default))return n.default()}}function Ml(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ml(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function dy(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Be?(r.patchFlag&128&&o++,s=s.concat(dy(r.children,t,l))):(t||r.type!==xs)&&s.push(l!=null?Dr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ge(e,t){return $t(e)?xn({name:e.name},t,{setup:e}):e}function Mxe(){const e=Zs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function fy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Exe(e){const t=Zs(),n=Na(null);if(t){const o=t.refs===Jt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Fb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Hh=new WeakMap;function Nc(e,t,n,s,o=!1){if(_t(e)){e.forEach((m,x)=>Nc(m,t&&(_t(t)?t[x]:t),n,s,o));return}if(Ir(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Nc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?zd(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Jt?l.refs={}:l.refs,d=l.setupState,f=nn(d),h=d===Jt?s4:m=>Fb(u,m)?!1:cn(f,m),p=(m,x)=>!(x&&Fb(u,x));if(c!=null&&c!==a){if(Ob(t),Nn(c))u[c]=null,h(c)&&(d[c]=null);else if(hs(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if($t(a))Dd(a,l,12,[r,u]);else{const m=Nn(a),x=hs(a);if(m||x){const k=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)_t(g)&&sy(g,i);else if(_t(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):x&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),Hh.delete(e)};g.id=-1,Hh.set(e,g),ks(g,n)}else Ob(e),k()}}}function Ob(e){const t=Hh.get(e);t&&(t.flags|=8,Hh.delete(e))}let Rb=!1;const Xa=()=>{Rb||(console.error("Hydration completed but contains mismatches."),Rb=!0)},fT=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",hT=e=>e.namespaceURI.includes("MathML"),Ef=e=>{if(e.nodeType===1){if(fT(e))return"svg";if(hT(e))return"mathml"}},vc=e=>e.nodeType===8;function pT(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),Ph(),y._vnode=v;return}d(y.firstChild,v,null,null,null),Ph(),y._vnode=v},d=(v,y,A,L,$,_=!1)=>{_=_||!!y.dynamicChildren;const E=vc(v)&&v.data==="[",N=()=>m(v,y,A,L,$,E),{type:F,ref:S,shapeFlag:I,patchFlag:R}=y;let B=v.nodeType;y.el=v,R===-2&&(_=!1,y.dynamicChildren=null);let P=null;switch(F){case _l:B!==3?y.children===""?(a(y.el=o(""),r(v),v),P=v):P=N():(v.data!==y.children&&(Xa(),v.data=y.children),P=i(v));break;case xs:g(v)?(P=i(v),k(y.el=v.content.firstChild,v,A)):B!==8||E?P=N():P=i(v);break;case $c:if(E&&(v=i(v),B=v.nodeType),B===1||B===3){P=v;const z=!y.children.length;for(let W=0;W<y.staticCount;W++)z&&(y.children+=P.nodeType===1?P.outerHTML:P.data),W===y.staticCount-1&&(y.anchor=P),P=i(P);return E?i(P):P}else N();break;case Be:E?P=p(v,y,A,L,$,_):P=N();break;default:if(I&1)(B!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?P=N():P=f(v,y,A,L,$,_);else if(I&6){y.slotScopeIds=$;const z=r(v);if(E?P=x(v):vc(v)&&v.data==="teleport start"?P=x(v,v.data,"teleport end"):P=i(v),t(y,z,null,A,L,Ef(z),_),Ir(y)&&!y.type.__asyncResolved){let W;E?(W=ie(Be),W.anchor=P?P.previousSibling:z.lastChild):W=v.nodeType===3?Qe(""):ie("div"),W.el=v,y.component.subTree=W}}else I&64?B!==8?P=N():P=y.type.hydrate(v,y,A,L,$,_,e,h):I&128&&(P=y.type.hydrate(v,y,A,L,Ef(r(v)),$,_,e,d))}return S!=null&&Nc(S,null,L,y),P},f=(v,y,A,L,$,_)=>{_=_||!!y.dynamicChildren;const{type:E,props:N,patchFlag:F,shapeFlag:S,dirs:I,transition:R}=y,B=E==="input"||E==="option";if(B||F!==-1){I&&Zi(y,null,A,"created");let P=!1;if(g(v)){P=l3(null,R)&&A&&A.vnode.props&&A.vnode.props.appear;const W=v.content.firstChild;if(P){const X=W.getAttribute("class");X&&(W.$cls=X),R.beforeEnter(W)}k(W,v,A),y.el=v=W}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let W=h(v.firstChild,y,v,A,L,$,_);for(W&&!Tf(v,1)&&Xa();W;){const X=W;W=W.nextSibling,l(X)}}else if(S&8){let W=y.children;W[0]===`
|
|
15
|
-
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(W=W.slice(1));const{textContent:X}=v;X!==W&&X!==W.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Tf(v,0)||Xa(),v.textContent=y.children)}if(N){if(B||!_||F&48){const W=v.tagName.includes("-");for(const X in N)(B&&(X.endsWith("value")||X==="indeterminate")||Bd(X)&&!ga(X)||X[0]==="."||W&&!ga(X))&&s(v,X,null,N[X],void 0,A)}else if(N.onClick)s(v,"onClick",null,N.onClick,void 0,A);else if(F&4&&xl(N.style))for(const W in N.style)N.style[W]}let z;(z=N&&N.onVnodeBeforeMount)&&To(z,A,y),I&&Zi(y,null,A,"beforeMount"),((z=N&&N.onVnodeMounted)||I||P)&&d3(()=>{z&&To(z,A,y),P&&R.enter(v),I&&Zi(y,null,A,"mounted")},L)}return v.nextSibling},h=(v,y,A,L,$,_,E)=>{E=E||!!y.dynamicChildren;const N=y.children,F=N.length;let S=!1;for(let I=0;I<F;I++){const R=E?N[I]:N[I]=Io(N[I]),B=R.type===_l;v?(B&&!E&&I+1<F&&Io(N[I+1]).type===_l&&(a(o(v.data.slice(R.children.length)),A,i(v)),v.data=R.children),v=d(v,R,L,$,_,E)):B&&!R.children?a(R.el=o(""),A):(S||(S=!0,Tf(A,1)||Xa()),n(null,R,A,null,L,$,Ef(A),_))}return v},p=(v,y,A,L,$,_)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const N=r(v),F=h(i(v),y,N,A,L,$,_);return F&&vc(F)&&F.data==="]"?i(y.anchor=F):(Xa(),a(y.anchor=c("]"),N,F),F)},m=(v,y,A,L,$,_)=>{if(Tf(v.parentElement,1)||Xa(),y.el=null,_){const F=x(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const E=i(v),N=r(v);return l(v),n(null,y,N,E,A,L,Ef(N),$),A&&(A.vnode.el=y.el,cm(A,y.el)),E},x=(v,y="[",A="]")=>{let L=0;for(;v;)if(v=i(v),v&&vc(v)&&(v.data===y&&L++,v.data===A)){if(L===0)return i(v);L--}return v},k=(v,y,A)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=A;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const Bb="data-allow-mismatch",mT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Tf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Bb);)e=e.parentElement;const n=e&&e.getAttribute(Bb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(mT[t])}}const gT=Xp().requestIdleCallback||(e=>setTimeout(e,1)),vT=Xp().cancelIdleCallback||(e=>clearTimeout(e)),Txe=(e=1e4)=>t=>{const n=gT(t,{timeout:e});return()=>vT(n)};function yT(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 Nxe=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(yT(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Ixe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},$xe=(e=[])=>(t,n)=>{Nn(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 kT(e,t){if(vc(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(vc(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 $i(e){$t(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((x,k)=>{a(m,()=>x(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 Ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,x){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||x()},v=i?()=>{const y=i(g,A=>kT(p,A));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Gs;if(fy(p),u)return()=>Nf(u,p);const m=v=>{c=null,eu(v,p,13,!s)};if(l&&p.suspense||wa)return h().then(v=>()=>Nf(v,p)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const x=Q(!1),k=Q(),g=Q(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!x.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),h().then(()=>{x.value=!0,p.parent&&Hd(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(x.value&&u)return Nf(u,p);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return Nf(n,p)}}})}function Nf(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Hd=e=>e.type.__isKeepAlive,bT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Zs(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,v,y,A,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,A,g.slotScopeIds,L),ks(()=>{$.isDeactivated=!1,$.a&&Ec($.a);const _=g.props&&g.props.onVnodeMounted;_&&To(_,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;zh(v.m),zh(v.a),c(g,f,null,1,l),ks(()=>{v.da&&Ec(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&To(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Y1(g),u(g,n,l,!0)}function p(g){o.forEach((v,y)=>{const A=Bg(Ir(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!Ii(v,r))?h(v):r&&Y1(r),o.delete(g),i.delete(g)}Ze(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>Ru(g,y)),v&&p(y=>!Ru(v,y))},{flush:"post",deep:!0});let x=null;const k=()=>{x!=null&&(Uh(n.subTree.type)?ks(()=>{o.set(x,If(n.subTree))},n.subTree.suspense):o.set(x,If(n.subTree)))};return gn(k),hy(k),ps(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,A=If(v);if(g.type===A.type&&g.key===A.key){Y1(A);const L=A.component.da;L&&ks(L,y);return}h(g)})}),()=>{if(x=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!El(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=If(v);if(y.type===xs)return r=null,y;const A=y.type,L=Bg(Ir(y)?y.type.__asyncResolved||{}:A),{include:$,exclude:_,max:E}=e;if($&&(!L||!Ru($,L))||_&&L&&Ru(_,L))return y.shapeFlag&=-257,r=y,v;const N=y.key==null?A:y.key,F=o.get(N);return y.el&&(y=Dr(y),v.shapeFlag&128&&(v.ssContent=y)),x=N,F?(y.el=F.el,y.component=F.component,y.transition&&Ml(y,y.transition),y.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,Uh(v.type)?v:y}}},Lxe=bT;function Ru(e,t){return _t(e)?e.some(n=>Ru(n,t)):Nn(e)?e.split(",").includes(t):lE(e)?(e.lastIndex=0,e.test(t)):!1}function xT(e,t){z4(e,"a",t)}function _T(e,t){z4(e,"da",t)}function z4(e,t,n=Gs){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(lm(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Hd(o.parent.vnode)&&wT(s,t,n,o),o=o.parent}}function wT(e,t,n,s){const o=lm(t,e,s,!0);_n(()=>{sy(s[t],o)},n)}function Y1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function If(e){return e.shapeFlag&128?e.ssContent:e}function lm(e,t,n=Gs,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Or();const l=tu(n),a=Si(t,n,e,r);return l(),Rr(),a});return s?o.unshift(i):o.push(i),i}}const Hr=e=>(t,n=Gs)=>{(!wa||e==="sp")&&lm(e,(...s)=>t(...s),n)},ST=Hr("bm"),gn=Hr("m"),U4=Hr("bu"),hy=Hr("u"),ps=Hr("bum"),_n=Hr("um"),CT=Hr("sp"),AT=Hr("rtg"),MT=Hr("rtc");function ET(e,t=Gs){lm("ec",e,t)}const py="components",TT="directives";function NT(e,t){return my(py,e,!0,t)||e}const q4=Symbol.for("v-ndc");function Ks(e){return Nn(e)?my(py,e,!1)||e:e||q4}function Fxe(e){return my(TT,e)}function my(e,t,n=!0,s=!1){const o=Ys||Gs;if(o){const i=o.type;if(e===py){const l=Bg(i,!1);if(l&&(l===t||l===Ls(t)||l===Zp(Ls(t))))return i}const r=Db(o[e]||i[e],t)||Db(o.appContext[e],t);return!r&&s?i:r}}function Db(e,t){return e&&(e[t]||e[Ls(t)]||e[Zp(Ls(t))])}function st(e,t,n,s){let o;const i=n&&n[s],r=_t(e);if(r||Nn(e)){const l=r&&xl(e);let a=!1,c=!1;l&&(a=!Yo(e),c=Br(e),e=tm(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?Uc(Ri(e[u])):Ri(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(un(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function j4(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(_t(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Bn(e,t,n={},s,o){if(Ys.ce||Ys.parent&&Ir(Ys.parent)&&Ys.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),be(Be,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),b();const r=i&&gy(i(n)),l=n.key||r&&r.key,a=be(Be,{key:(l&&!ti(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 gy(e){return e.some(t=>El(t)?!(t.type===xs||t.type===Be&&!gy(t.children)):!0)?e:null}function Oxe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:ch(s)]=e[s];return n}const Tg=e=>e?g3(e)?zd(e):Tg(e.parent):null,Ku=xn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Tg(e.parent),$root:e=>Tg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>vy(e),$forceUpdate:e=>e.f||(e.f=()=>{uy(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>rT.bind(e)}),Z1=(e,t)=>e!==Jt&&!e.__isScriptSetup&&cn(e,t),Ng={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Z1(s,t))return r[t]=1,s[t];if(o!==Jt&&cn(o,t))return r[t]=2,o[t];if(cn(i,t))return r[t]=3,i[t];if(n!==Jt&&cn(n,t))return r[t]=4,n[t];Ig&&(r[t]=0)}}const c=Ku[t];let u,d;if(c)return t==="$attrs"&&no(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Jt&&cn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,cn(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Z1(o,t)?(o[t]=n,!0):s!==Jt&&cn(s,t)?(s[t]=n,!0):cn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Jt&&l[0]!=="$"&&cn(e,l)||Z1(t,l)||cn(i,l)||cn(s,l)||cn(Ku,l)||cn(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:cn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},IT=xn({},Ng,{get(e,t){if(t!==Symbol.unscopables)return Ng.get(e,t,e)},has(e,t){return t[0]!=="_"&&!fE(t)}});function Rxe(){return null}function Bxe(){return null}function Dxe(e){}function Pxe(e){}function Hxe(){return null}function Wxe(){}function zxe(e,t){return null}function Uxe(){return V4().slots}function Wd(){return V4().attrs}function V4(e){const t=Zs();return t.setupContext||(t.setupContext=k3(t))}function md(e){return _t(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function qxe(e,t){const n=md(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?_t(o)||$t(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function jxe(e,t){return!e||!t?e||t:_t(e)&&_t(t)?e.concat(t):xn({},md(e),md(t))}function Vxe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Kxe(e){const t=Zs(),n=wa;let s=e();vd(),n&&Lc(!1);const o=()=>{tu(t),n&&Lc(!0)},i=()=>{Zs()!==t&&t.scope.off(),vd(),n&&Lc(!1)};return oy(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let Ig=!0;function $T(e){const t=vy(e),n=e.proxy,s=e.ctx;Ig=!1,t.beforeCreate&&Pb(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:x,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:A,renderTracked:L,renderTriggered:$,errorCaptured:_,serverPrefetch:E,expose:N,inheritAttrs:F,components:S,directives:I,filters:R}=t;if(c&<(c,s,null),r)for(const z in r){const W=r[z];$t(W)&&(s[z]=W.bind(n))}if(o){const z=o.call(n,n);un(z)&&(e.data=Hs(z))}if(Ig=!0,i)for(const z in i){const W=i[z],X=$t(W)?W.bind(n,n):$t(W.get)?W.get.bind(n,n):xi,U=!$t(W)&&$t(W.set)?W.set.bind(n):xi,Z=D({get:X,set:U});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>Z.value,set:ce=>Z.value=ce})}if(l)for(const z in l)K4(l[z],s,n,z);if(a){const z=$t(a)?a.call(n):a;Reflect.ownKeys(z).forEach(W=>{Fn(W,z[W])})}u&&Pb(u,e,"c");function P(z,W){_t(W)?W.forEach(X=>z(X.bind(n))):W&&z(W.bind(n))}if(P(ST,d),P(gn,f),P(U4,h),P(hy,p),P(xT,m),P(_T,x),P(ET,_),P(MT,L),P(AT,$),P(ps,g),P(_n,y),P(CT,E),_t(N))if(N.length){const z=e.exposed||(e.exposed={});N.forEach(W=>{Object.defineProperty(z,W,{get:()=>n[W],set:X=>n[W]=X,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===xi&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),I&&(e.directives=I),E&&fy(e)}function LT(e,t,n=xi){_t(e)&&(e=$g(e));for(const s in e){const o=e[s];let i;un(o)?"default"in o?i=Kt(o.from||s,o.default,!0):i=Kt(o.from||s):i=Kt(o),hs(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Pb(e,t,n){Si(_t(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function K4(e,t,n,s){let o=s.includes(".")?F4(n,s):()=>n[s];if(Nn(e)){const i=t[e];$t(i)&&Ze(o,i)}else if($t(e))Ze(o,e.bind(n));else if(un(e))if(_t(e))e.forEach(i=>K4(i,t,n,s));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Ze(o,i,e)}}function vy(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=>Wh(a,c,r,!0)),Wh(a,t,r)),un(t)&&i.set(t,a),a}function Wh(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Wh(e,i,n,!0),o&&o.forEach(r=>Wh(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=FT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const FT={data:Hb,props:Wb,emits:Wb,methods:Bu,computed:Bu,beforeCreate:co,created:co,beforeMount:co,mounted:co,beforeUpdate:co,updated:co,beforeDestroy:co,beforeUnmount:co,destroyed:co,unmounted:co,activated:co,deactivated:co,errorCaptured:co,serverPrefetch:co,components:Bu,directives:Bu,watch:RT,provide:Hb,inject:OT};function Hb(e,t){return t?e?function(){return xn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function OT(e,t){return Bu($g(e),$g(t))}function $g(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function co(e,t){return e?[...new Set([].concat(e,t))]:t}function Bu(e,t){return e?xn(Object.create(null),e,t):t}function Wb(e,t){return e?_t(e)&&_t(t)?[...new Set([...e,...t])]:xn(Object.create(null),md(e),md(t??{})):t}function RT(e,t){if(!e)return t;if(!t)return e;const n=xn(Object.create(null),e);for(const s in t)n[s]=co(e[s],t[s]);return n}function G4(){return{app:null,config:{isNativeTag:s4,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 BT=0;function DT(e,t){return function(s,o=null){$t(s)||(s=xn({},s)),o!=null&&!un(o)&&(o=null);const i=G4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:BT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:p9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&$t(u.install)?(r.add(u),u.install(c,...d)):$t(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||ie(s,o);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,zd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Si(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=ya;ya=c;try{return u()}finally{ya=d}}};return c}}let ya=null;function Gxe(e,t,n=Jt){const s=Zs(),o=Ls(t),i=$o(t),r=Y4(e,o),l=qE((a,c)=>{let u,d=Jt,f;return iT(()=>{const h=e[o];Vs(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Vs(p,u)&&!(d!==Jt&&Vs(h,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=h,c()),s.emit(`update:${t}`,p),Vs(h,p)&&Vs(h,d)&&!Vs(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Jt:l,done:!1}:{done:!0}}}},l}const Y4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ls(t)}Modifiers`]||e[`${$o(t)}Modifiers`];function PT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Jt;let o=n;const i=t.startsWith("update:"),r=i&&Y4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Nn(u)?u.trim():u)),r.number&&(o=n.map(Qp)));let l,a=s[l=ch(t)]||s[l=ch(Ls(t))];!a&&i&&(a=s[l=ch($o(t))]),a&&Si(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Si(c,e,6,o)}}const HT=new WeakMap;function Z4(e,t,n=!1){const s=n?HT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=Z4(c,t,!0);u&&(l=!0,xn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(un(e)&&s.set(e,null),null):(_t(i)?i.forEach(a=>r[a]=null):xn(r,i),un(e)&&s.set(e,r),r)}function am(e,t){return!e||!Bd(t)?!1:(t=t.slice(2).replace(/Once$/,""),cn(e,t[0].toLowerCase()+t.slice(1))||cn(e,$o(t))||cn(e,t))}function uh(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,x=hd(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,A=y;k=Io(c.call(A,y,u,d,h,f,p)),g=l}else{const y=t;k=Io(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:zT(l)}}catch(y){Gu.length=0,eu(y,e,1),k=ie(xs)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:A}=v;y.length&&A&7&&(i&&y.some(Vp)&&(g=UT(g,i)),v=Dr(v,g,!1,!0))}return n.dirs&&(v=Dr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Ml(v,n.transition),k=v,hd(x),k}function WT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(El(o)){if(o.type!==xs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const zT=e=>{let t;for(const n in e)(n==="class"||n==="style"||Bd(n))&&((t||(t={}))[n]=e[n]);return t},UT=(e,t)=>{const n={};for(const s in e)(!Vp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function qT(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?zb(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(Q4(r,s,f)&&!am(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?zb(s,r,c):!0:!!r;return!1}function zb(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(Q4(t,e,i)&&!am(n,i))return!0}return!1}function Q4(e,t,n){const s=e[n],o=t[n];return n==="style"&&un(s)&&un(o)?!Fr(s,o):s!==o}function cm({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 X4={},J4=()=>Object.create(X4),e3=e=>Object.getPrototypeOf(e)===X4;function jT(e,t,n,s=!1){const o={},i=J4();e.propsDefaults=Object.create(null),t3(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:HE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function VT(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=nn(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(am(e.emitsOptions,f))continue;const h=t[f];if(a)if(cn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=Ls(f);o[p]=Lg(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{t3(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!cn(t,d)&&((u=$o(d))===d||!cn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Lg(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!cn(t,d))&&(delete i[d],c=!0)}c&&Cr(e.attrs,"set","")}function t3(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(ga(a))continue;const c=t[a];let u;o&&cn(o,u=Ls(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:am(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=nn(n),c=l||Jt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Lg(o,a,d,c[d],e,!cn(c,d))}}return r}function Lg(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=cn(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&$t(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=tu(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===$o(n))&&(s=!0))}return s}const KT=new WeakMap;function n3(e,t,n=!1){const s=n?KT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!$t(e)){const u=d=>{a=!0;const[f,h]=n3(d,t,!0);xn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return un(e)&&s.set(e,Ac),Ac;if(_t(i))for(let u=0;u<i.length;u++){const d=Ls(i[u]);Ub(d)&&(r[d]=Jt)}else if(i)for(const u in i){const d=Ls(u);if(Ub(d)){const f=i[u],h=r[d]=_t(f)||$t(f)?{type:f}:xn({},f),p=h.type;let m=!1,x=!0;if(_t(p))for(let k=0;k<p.length;++k){const g=p[k],v=$t(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(x=!1)}else m=$t(p)&&p.name==="Boolean";h[0]=m,h[1]=x,(m||cn(h,"default"))&&l.push(d)}}const c=[r,l];return un(e)&&s.set(e,c),c}function Ub(e){return e[0]!=="$"&&!ga(e)}const yy=e=>e==="_"||e==="_ctx"||e==="$stable",ky=e=>_t(e)?e.map(Io):[Io(e)],GT=(e,t,n)=>{if(t._n)return t;const s=Me((...o)=>ky(t(...o)),n);return s._c=!1,s},s3=(e,t,n)=>{const s=e._ctx;for(const o in e){if(yy(o))continue;const i=e[o];if($t(i))t[o]=GT(o,i,s);else if(i!=null){const r=ky(i);t[o]=()=>r}}},o3=(e,t)=>{const n=ky(t);e.slots.default=()=>n},i3=(e,t,n)=>{for(const s in t)(n||!yy(s))&&(e[s]=t[s])},YT=(e,t,n)=>{const s=e.slots=J4();if(e.vnode.shapeFlag&32){const o=t._;o?(i3(s,t,n),n&&i4(s,"_",o,!0)):s3(t,s)}else t&&o3(e,t)},ZT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Jt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:i3(o,t,n):(i=!t.$stable,s3(t,o)),r=t}else t&&(o3(e,t),r={default:1});if(i)for(const l in o)!yy(l)&&r[l]==null&&delete o[l]},ks=d3;function QT(e){return r3(e)}function XT(e){return r3(e,pT)}function r3(e,t){const n=Xp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=xi,insertStaticContent:p}=e,m=(q,ne,ge,ue=null,ye=null,j=null,te=void 0,pe=null,Ce=!!ne.dynamicChildren)=>{if(q===ne)return;q&&!Ii(q,ne)&&(ue=le(q),ce(q,ye,j,!0),q=null),ne.patchFlag===-2&&(Ce=!1,ne.dynamicChildren=null);const{type:Ie,ref:$e,shapeFlag:he}=ne;switch(Ie){case _l:x(q,ne,ge,ue);break;case xs:k(q,ne,ge,ue);break;case $c:q==null&&g(ne,ge,ue,te);break;case Be:S(q,ne,ge,ue,ye,j,te,pe,Ce);break;default:he&1?A(q,ne,ge,ue,ye,j,te,pe,Ce):he&6?I(q,ne,ge,ue,ye,j,te,pe,Ce):(he&64||he&128)&&Ie.process(q,ne,ge,ue,ye,j,te,pe,Ce,G)}$e!=null&&ye?Nc($e,q&&q.ref,j,ne||q,!ne):$e==null&&q&&q.ref!=null&&Nc(q.ref,null,j,q,!0)},x=(q,ne,ge,ue)=>{if(q==null)s(ne.el=l(ne.children),ge,ue);else{const ye=ne.el=q.el;ne.children!==q.children&&c(ye,ne.children)}},k=(q,ne,ge,ue)=>{q==null?s(ne.el=a(ne.children||""),ge,ue):ne.el=q.el},g=(q,ne,ge,ue)=>{[q.el,q.anchor]=p(q.children,ne,ge,ue,q.el,q.anchor)},v=({el:q,anchor:ne},ge,ue)=>{let ye;for(;q&&q!==ne;)ye=f(q),s(q,ge,ue),q=ye;s(ne,ge,ue)},y=({el:q,anchor:ne})=>{let ge;for(;q&&q!==ne;)ge=f(q),o(q),q=ge;o(ne)},A=(q,ne,ge,ue,ye,j,te,pe,Ce)=>{if(ne.type==="svg"?te="svg":ne.type==="math"&&(te="mathml"),q==null)L(ne,ge,ue,ye,j,te,pe,Ce);else{const Ie=q.el&&q.el._isVueCE?q.el:null;try{Ie&&Ie._beginPatch(),E(q,ne,ye,j,te,pe,Ce)}finally{Ie&&Ie._endPatch()}}},L=(q,ne,ge,ue,ye,j,te,pe)=>{let Ce,Ie;const{props:$e,shapeFlag:he,transition:Ne,dirs:Je}=q;if(Ce=q.el=r(q.type,j,$e&&$e.is,$e),he&8?u(Ce,q.children):he&16&&_(q.children,Ce,null,ue,ye,Q1(q,j),te,pe),Je&&Zi(q,null,ue,"created"),$(Ce,q,q.scopeId,te,ue),$e){for(const At in $e)At!=="value"&&!ga(At)&&i(Ce,At,null,$e[At],j,ue);"value"in $e&&i(Ce,"value",null,$e.value,j),(Ie=$e.onVnodeBeforeMount)&&To(Ie,ue,q)}Je&&Zi(q,null,ue,"beforeMount");const it=l3(ye,Ne);it&&Ne.beforeEnter(Ce),s(Ce,ne,ge),((Ie=$e&&$e.onVnodeMounted)||it||Je)&&ks(()=>{try{Ie&&To(Ie,ue,q),it&&Ne.enter(Ce),Je&&Zi(q,null,ue,"mounted")}finally{}},ye)},$=(q,ne,ge,ue,ye)=>{if(ge&&h(q,ge),ue)for(let j=0;j<ue.length;j++)h(q,ue[j]);if(ye){let j=ye.subTree;if(ne===j||Uh(j.type)&&(j.ssContent===ne||j.ssFallback===ne)){const te=ye.vnode;$(q,te,te.scopeId,te.slotScopeIds,ye.parent)}}},_=(q,ne,ge,ue,ye,j,te,pe,Ce=0)=>{for(let Ie=Ce;Ie<q.length;Ie++){const $e=q[Ie]=pe?wr(q[Ie]):Io(q[Ie]);m(null,$e,ne,ge,ue,ye,j,te,pe)}},E=(q,ne,ge,ue,ye,j,te)=>{const pe=ne.el=q.el;let{patchFlag:Ce,dynamicChildren:Ie,dirs:$e}=ne;Ce|=q.patchFlag&16;const he=q.props||Jt,Ne=ne.props||Jt;let Je;if(ge&&Jl(ge,!1),(Je=Ne.onVnodeBeforeUpdate)&&To(Je,ge,ne,q),$e&&Zi(ne,q,ge,"beforeUpdate"),ge&&Jl(ge,!0),(he.innerHTML&&Ne.innerHTML==null||he.textContent&&Ne.textContent==null)&&u(pe,""),Ie?N(q.dynamicChildren,Ie,pe,ge,ue,Q1(ne,ye),j):te||W(q,ne,pe,null,ge,ue,Q1(ne,ye),j,!1),Ce>0){if(Ce&16)F(pe,he,Ne,ge,ye);else if(Ce&2&&he.class!==Ne.class&&i(pe,"class",null,Ne.class,ye),Ce&4&&i(pe,"style",he.style,Ne.style,ye),Ce&8){const it=ne.dynamicProps;for(let At=0;At<it.length;At++){const bt=it[At],wt=he[bt],Gt=Ne[bt];(Gt!==wt||bt==="value")&&i(pe,bt,wt,Gt,ye,ge)}}Ce&1&&q.children!==ne.children&&u(pe,ne.children)}else!te&&Ie==null&&F(pe,he,Ne,ge,ye);((Je=Ne.onVnodeUpdated)||$e)&&ks(()=>{Je&&To(Je,ge,ne,q),$e&&Zi(ne,q,ge,"updated")},ue)},N=(q,ne,ge,ue,ye,j,te)=>{for(let pe=0;pe<ne.length;pe++){const Ce=q[pe],Ie=ne[pe],$e=Ce.el&&(Ce.type===Be||!Ii(Ce,Ie)||Ce.shapeFlag&198)?d(Ce.el):ge;m(Ce,Ie,$e,null,ue,ye,j,te,!0)}},F=(q,ne,ge,ue,ye)=>{if(ne!==ge){if(ne!==Jt)for(const j in ne)!ga(j)&&!(j in ge)&&i(q,j,ne[j],null,ye,ue);for(const j in ge){if(ga(j))continue;const te=ge[j],pe=ne[j];te!==pe&&j!=="value"&&i(q,j,pe,te,ye,ue)}"value"in ge&&i(q,"value",ne.value,ge.value,ye)}},S=(q,ne,ge,ue,ye,j,te,pe,Ce)=>{const Ie=ne.el=q?q.el:l(""),$e=ne.anchor=q?q.anchor:l("");let{patchFlag:he,dynamicChildren:Ne,slotScopeIds:Je}=ne;Je&&(pe=pe?pe.concat(Je):Je),q==null?(s(Ie,ge,ue),s($e,ge,ue),_(ne.children||[],ge,$e,ye,j,te,pe,Ce)):he>0&&he&64&&Ne&&q.dynamicChildren&&q.dynamicChildren.length===Ne.length?(N(q.dynamicChildren,Ne,ge,ye,j,te,pe),(ne.key!=null||ye&&ne===ye.subTree)&&by(q,ne,!0)):W(q,ne,ge,$e,ye,j,te,pe,Ce)},I=(q,ne,ge,ue,ye,j,te,pe,Ce)=>{ne.slotScopeIds=pe,q==null?ne.shapeFlag&512?ye.ctx.activate(ne,ge,ue,te,Ce):R(ne,ge,ue,ye,j,te,Ce):B(q,ne,Ce)},R=(q,ne,ge,ue,ye,j,te)=>{const pe=q.component=m3(q,ue,ye);if(Hd(q)&&(pe.ctx.renderer=G),v3(pe,!1,te),pe.asyncDep){if(ye&&ye.registerDep(pe,P,te),!q.el){const Ce=pe.subTree=ie(xs);k(null,Ce,ne,ge),q.placeholder=Ce.el}}else P(pe,q,ne,ge,ye,j,te)},B=(q,ne,ge)=>{const ue=ne.component=q.component;if(qT(q,ne,ge))if(ue.asyncDep&&!ue.asyncResolved){z(ue,ne,ge);return}else ue.next=ne,ue.update();else ne.el=q.el,ue.vnode=ne},P=(q,ne,ge,ue,ye,j,te)=>{const pe=()=>{if(q.isMounted){let{next:he,bu:Ne,u:Je,parent:it,vnode:At}=q;{const ln=a3(q);if(ln){he&&(he.el=At.el,z(q,he,te)),ln.asyncDep.then(()=>{ks(()=>{q.isUnmounted||Ie()},ye)});return}}let bt=he,wt;Jl(q,!1),he?(he.el=At.el,z(q,he,te)):he=At,Ne&&Ec(Ne),(wt=he.props&&he.props.onVnodeBeforeUpdate)&&To(wt,it,he,At),Jl(q,!0);const Gt=uh(q),vt=q.subTree;q.subTree=Gt,m(vt,Gt,d(vt.el),le(vt),q,ye,j),he.el=Gt.el,bt===null&&cm(q,Gt.el),Je&&ks(Je,ye),(wt=he.props&&he.props.onVnodeUpdated)&&ks(()=>To(wt,it,he,At),ye)}else{let he;const{el:Ne,props:Je}=ne,{bm:it,m:At,parent:bt,root:wt,type:Gt}=q,vt=Ir(ne);if(Jl(q,!1),it&&Ec(it),!vt&&(he=Je&&Je.onVnodeBeforeMount)&&To(he,bt,ne),Jl(q,!0),Ne&&me){const ln=()=>{q.subTree=uh(q),me(Ne,q.subTree,q,ye,null)};vt&&Gt.__asyncHydrate?Gt.__asyncHydrate(Ne,q,ln):ln()}else{wt.ce&&wt.ce._hasShadowRoot()&&wt.ce._injectChildStyle(Gt,q.parent?q.parent.type:void 0);const ln=q.subTree=uh(q);m(null,ln,ge,ue,q,ye,j),ne.el=ln.el}if(At&&ks(At,ye),!vt&&(he=Je&&Je.onVnodeMounted)){const ln=ne;ks(()=>To(he,bt,ln),ye)}(ne.shapeFlag&256||bt&&Ir(bt.vnode)&&bt.vnode.shapeFlag&256)&&q.a&&ks(q.a,ye),q.isMounted=!0,ne=ge=ue=null}};q.scope.on();const Ce=q.effect=new Lh(pe);q.scope.off();const Ie=q.update=Ce.run.bind(Ce),$e=q.job=Ce.runIfDirty.bind(Ce);$e.i=q,$e.id=q.uid,Ce.scheduler=()=>uy($e),Jl(q,!0),Ie()},z=(q,ne,ge)=>{ne.component=q;const ue=q.vnode.props;q.vnode=ne,q.next=null,VT(q,ne.props,ue,ge),ZT(q,ne.children,ge),Or(),Nb(q),Rr()},W=(q,ne,ge,ue,ye,j,te,pe,Ce=!1)=>{const Ie=q&&q.children,$e=q?q.shapeFlag:0,he=ne.children,{patchFlag:Ne,shapeFlag:Je}=ne;if(Ne>0){if(Ne&128){U(Ie,he,ge,ue,ye,j,te,pe,Ce);return}else if(Ne&256){X(Ie,he,ge,ue,ye,j,te,pe,Ce);return}}Je&8?($e&16&&J(Ie,ye,j),he!==Ie&&u(ge,he)):$e&16?Je&16?U(Ie,he,ge,ue,ye,j,te,pe,Ce):J(Ie,ye,j,!0):($e&8&&u(ge,""),Je&16&&_(he,ge,ue,ye,j,te,pe,Ce))},X=(q,ne,ge,ue,ye,j,te,pe,Ce)=>{q=q||Ac,ne=ne||Ac;const Ie=q.length,$e=ne.length,he=Math.min(Ie,$e);let Ne;for(Ne=0;Ne<he;Ne++){const Je=ne[Ne]=Ce?wr(ne[Ne]):Io(ne[Ne]);m(q[Ne],Je,ge,null,ye,j,te,pe,Ce)}Ie>$e?J(q,ye,j,!0,!1,he):_(ne,ge,ue,ye,j,te,pe,Ce,he)},U=(q,ne,ge,ue,ye,j,te,pe,Ce)=>{let Ie=0;const $e=ne.length;let he=q.length-1,Ne=$e-1;for(;Ie<=he&&Ie<=Ne;){const Je=q[Ie],it=ne[Ie]=Ce?wr(ne[Ie]):Io(ne[Ie]);if(Ii(Je,it))m(Je,it,ge,null,ye,j,te,pe,Ce);else break;Ie++}for(;Ie<=he&&Ie<=Ne;){const Je=q[he],it=ne[Ne]=Ce?wr(ne[Ne]):Io(ne[Ne]);if(Ii(Je,it))m(Je,it,ge,null,ye,j,te,pe,Ce);else break;he--,Ne--}if(Ie>he){if(Ie<=Ne){const Je=Ne+1,it=Je<$e?ne[Je].el:ue;for(;Ie<=Ne;)m(null,ne[Ie]=Ce?wr(ne[Ie]):Io(ne[Ie]),ge,it,ye,j,te,pe,Ce),Ie++}}else if(Ie>Ne)for(;Ie<=he;)ce(q[Ie],ye,j,!0),Ie++;else{const Je=Ie,it=Ie,At=new Map;for(Ie=it;Ie<=Ne;Ie++){const Vt=ne[Ie]=Ce?wr(ne[Ie]):Io(ne[Ie]);Vt.key!=null&&At.set(Vt.key,Ie)}let bt,wt=0;const Gt=Ne-it+1;let vt=!1,ln=0;const Gn=new Array(Gt);for(Ie=0;Ie<Gt;Ie++)Gn[Ie]=0;for(Ie=Je;Ie<=he;Ie++){const Vt=q[Ie];if(wt>=Gt){ce(Vt,ye,j,!0);continue}let an;if(Vt.key!=null)an=At.get(Vt.key);else for(bt=it;bt<=Ne;bt++)if(Gn[bt-it]===0&&Ii(Vt,ne[bt])){an=bt;break}an===void 0?ce(Vt,ye,j,!0):(Gn[an-it]=Ie+1,an>=ln?ln=an:vt=!0,m(Vt,ne[an],ge,null,ye,j,te,pe,Ce),wt++)}const Un=vt?JT(Gn):Ac;for(bt=Un.length-1,Ie=Gt-1;Ie>=0;Ie--){const Vt=it+Ie,an=ne[Vt],es=ne[Vt+1],rt=Vt+1<$e?es.el||c3(es):ue;Gn[Ie]===0?m(null,an,ge,rt,ye,j,te,pe,Ce):vt&&(bt<0||Ie!==Un[bt]?Z(an,ge,rt,2):bt--)}}},Z=(q,ne,ge,ue,ye=null)=>{const{el:j,type:te,transition:pe,children:Ce,shapeFlag:Ie}=q;if(Ie&6){Z(q.component.subTree,ne,ge,ue);return}if(Ie&128){q.suspense.move(ne,ge,ue);return}if(Ie&64){te.move(q,ne,ge,G);return}if(te===Be){s(j,ne,ge);for(let he=0;he<Ce.length;he++)Z(Ce[he],ne,ge,ue);s(q.anchor,ne,ge);return}if(te===$c){v(q,ne,ge);return}if(ue!==2&&Ie&1&&pe)if(ue===0)pe.persisted&&!j[mi]?s(j,ne,ge):(pe.beforeEnter(j),s(j,ne,ge),ks(()=>pe.enter(j),ye));else{const{leave:he,delayLeave:Ne,afterLeave:Je}=pe,it=()=>{q.ctx.isUnmounted?o(j):s(j,ne,ge)},At=()=>{const bt=j._isLeaving||!!j[mi];j._isLeaving&&j[mi](!0),pe.persisted&&!bt?it():he(j,()=>{it(),Je&&Je()})};Ne?Ne(j,it,At):At()}else s(j,ne,ge)},ce=(q,ne,ge,ue=!1,ye=!1)=>{const{type:j,props:te,ref:pe,children:Ce,dynamicChildren:Ie,shapeFlag:$e,patchFlag:he,dirs:Ne,cacheIndex:Je,memo:it}=q;if(he===-2&&(ye=!1),pe!=null&&(Or(),Nc(pe,null,ge,q,!0),Rr()),Je!=null&&(ne.renderCache[Je]=void 0),$e&256){ne.ctx.deactivate(q);return}const At=$e&1&&Ne,bt=!Ir(q);let wt;if(bt&&(wt=te&&te.onVnodeBeforeUnmount)&&To(wt,ne,q),$e&6)Y(q.component,ge,ue);else{if($e&128){q.suspense.unmount(ge,ue);return}At&&Zi(q,null,ne,"beforeUnmount"),$e&64?q.type.remove(q,ne,ge,G,ue):Ie&&!Ie.hasOnce&&(j!==Be||he>0&&he&64)?J(Ie,ne,ge,!1,!0):(j===Be&&he&384||!ye&&$e&16)&&J(Ce,ne,ge),ue&&fe(q)}const Gt=it!=null&&Je==null;(bt&&(wt=te&&te.onVnodeUnmounted)||At||Gt)&&ks(()=>{wt&&To(wt,ne,q),At&&Zi(q,null,ne,"unmounted"),Gt&&(q.el=null)},ge)},fe=q=>{const{type:ne,el:ge,anchor:ue,transition:ye}=q;if(ne===Be){se(ge,ue);return}if(ne===$c){y(q);return}const j=()=>{o(ge),ye&&!ye.persisted&&ye.afterLeave&&ye.afterLeave()};if(q.shapeFlag&1&&ye&&!ye.persisted){const{leave:te,delayLeave:pe}=ye,Ce=()=>te(ge,j);pe?pe(q.el,j,Ce):Ce()}else j()},se=(q,ne)=>{let ge;for(;q!==ne;)ge=f(q),o(q),q=ge;o(ne)},Y=(q,ne,ge)=>{const{bum:ue,scope:ye,job:j,subTree:te,um:pe,m:Ce,a:Ie}=q;zh(Ce),zh(Ie),ue&&Ec(ue),ye.stop(),j&&(j.flags|=8,ce(te,q,ne,ge)),pe&&ks(pe,ne),ks(()=>{q.isUnmounted=!0},ne)},J=(q,ne,ge,ue=!1,ye=!1,j=0)=>{for(let te=j;te<q.length;te++)ce(q[te],ne,ge,ue,ye)},le=q=>{if(q.shapeFlag&6)return le(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ne=f(q.anchor||q.el),ge=ne&&ne[O4];return ge?f(ge):ne};let He=!1;const de=(q,ne,ge)=>{let ue;q==null?ne._vnode&&(ce(ne._vnode,null,null,!0),ue=ne._vnode.component):m(ne._vnode||null,q,ne,null,null,null,ge),ne._vnode=q,He||(He=!0,Nb(ue),Ph(),He=!1)},G={p:m,um:ce,m:Z,r:fe,mt:R,mc:_,pc:W,pbc:N,n:le,o:e};let ae,me;return t&&([ae,me]=t(G)),{render:de,hydrate:ae,createApp:DT(de,ae)}}function Q1({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Jl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function l3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function by(e,t,n=!1){const s=e.children,o=t.children;if(_t(s)&&_t(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=wr(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&by(r,l)),l.type===_l&&(l.patchFlag===-1&&(l=o[i]=wr(l)),l.el=r.el),l.type===xs&&!l.el&&(l.el=r.el)}}function JT(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 a3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:a3(t)}function zh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function c3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?c3(t.subTree):null}const Uh=e=>e.__isSuspense;let Fg=0;const e9={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)t9(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}n9(e,t,n,s,o,r,l,a,c)}},hydrate:s9,normalize:o9},Yxe=e9;function gd(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function t9(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=u3(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?(gd(e,"onPending"),gd(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Ic(f,e.ssFallback)):f.resolve(!1,!0)}function n9(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:x,isHydrating:k}=d;if(m)d.pendingBranch=f,Ii(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():x&&(k||(a(p,h,n,s,o,null,i,r,l),Ic(d,h)))):(d.pendingId=Fg++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),x?(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),Ic(d,h))):p&&Ii(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&&Ii(p,f))a(p,f,n,s,o,d,i,r,l),Ic(d,f);else if(gd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Fg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function u3(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:x}}=c;let k;const g=i9(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?$h(e.props.timeout):void 0,y=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Fg++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:_,activeBranch:E,pendingBranch:N,pendingId:F,effects:S,parentComponent:I,container:R,isInFallback:B}=A;let P=!1;if(A.isHydrating)A.isHydrating=!1;else if(!L){P=E&&N.transition&&N.transition.mode==="out-in";let X=!1;P&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(N,R,i===y&&!X?p(E):i,0),Dh(S),B&&_.ssFallback&&(_.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(m(E.el)===R&&(i=p(E),X=!0),h(E,I,A,!0),!P&&B&&_.ssFallback&&ks(()=>_.ssFallback.el=null,A)),P||f(N,R,i,0)}A.isFallbackMountPending=!1,Ic(A,N),A.pendingBranch=null,A.isInFallback=!1;let z=A.parent,W=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),W=!0;break}z=z.parent}!W&&!P&&Dh(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),gd(_,"onResolve")},fallback(L){if(!A.pendingBranch)return;const{vnode:$,activeBranch:_,parentComponent:E,container:N,namespace:F}=A;gd($,"onFallback");const S=p(_),I=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,L,N,S,E,null,F,l,a),Ic(A,L))},R=L.transition&&L.transition.mode==="out-in";R&&(A.isFallbackMountPending=!0,_.transition.afterLeave=I),A.isInFallback=!0,h(_,E,null,!0),R||I()},move(L,$,_){A.activeBranch&&f(A.activeBranch,L,$,_),A.container=L},next(){return A.activeBranch&&p(A.activeBranch)},registerDep(L,$,_){const E=!!A.pendingBranch;E&&A.deps++;const N=L.vnode.el;L.asyncDep.catch(F=>{eu(F,L,0)}).then(F=>{if(L.isUnmounted||A.isUnmounted||A.pendingId!==L.suspenseId)return;vd(),L.asyncResolved=!0;const{vnode:S}=L;Og(L,F,!1),N&&(S.el=N);const I=!N&&L.subTree.el;$(L,S,m(N||L.subTree.el),N?null:p(L.subTree),A,r,_),I&&(S.placeholder=null,x(I)),cm(L,S.el),E&&--A.deps===0&&A.resolve()})},unmount(L,$){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,L,$),A.pendingBranch&&h(A.pendingBranch,n,L,$)}};return A}function s9(e,t,n,s,o,i,r,l,a){const c=t.suspense=u3(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 o9(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=qb(s?n.default:n),e.ssFallback=s?qb(n.fallback):ie(xs)}function qb(e){let t;if($t(e)){const n=_a&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=so,f3())}return _t(e)&&(e=WT(e)),e=Io(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function d3(e,t){t&&t.pendingBranch?_t(e)?t.effects.push(...e):t.effects.push(e):Dh(e)}function Ic(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,cm(s,o))}function i9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),_l=Symbol.for("v-txt"),xs=Symbol.for("v-cmt"),$c=Symbol.for("v-stc"),Gu=[];let so=null;function b(e=!1){Gu.push(so=e?null:[])}function f3(){Gu.pop(),so=Gu[Gu.length-1]||null}let _a=1;function qh(e,t=!1){_a+=e,e<0&&so&&t&&(so.hasOnce=!0)}function h3(e){return e.dynamicChildren=_a>0?so||Ac:null,f3(),_a>0&&so&&so.push(e),e}function T(e,t,n,s,o,i){return h3(w(e,t,n,s,o,i,!0))}function be(e,t,n,s,o){return h3(ie(e,t,n,s,o,!0))}function El(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Zxe(e){}const p3=({key:e})=>e??null,dh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Nn(e)||hs(e)||$t(e)?{i:Ys,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,s=0,o=null,i=e===Be?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&p3(t),ref:t&&dh(t),scopeId:im,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ys};return l?(_y(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Nn(n)?8:16),_a>0&&!r&&so&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&so.push(a),a}const ie=r9;function r9(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===q4)&&(e=xs),El(e)){const l=Dr(e,t,!0);return n&&_y(l,n),_a>0&&!i&&so&&(l.shapeFlag&6?so[so.indexOf(e)]=l:so.push(l)),l.patchFlag=-2,l}if(f9(e)&&(e=e.__vccOpts),t){t=l9(t);let{class:l,style:a}=t;l&&!Nn(l)&&(t.class=Pe(l)),un(a)&&(om(a)&&!_t(a)&&(a=xn({},a)),t.style=Yt(a))}const r=Nn(e)?1:Uh(e)?128:R4(e)?64:un(e)?4:$t(e)?2:0;return w(e,t,n,s,o,r,i,!0)}function l9(e){return e?om(e)||e3(e)?xn({},e):e:null}function Dr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?bn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&p3(c),ref:t&&t.ref?n&&i?_t(i)?i.concat(dh(t)):[i,dh(t)]:dh(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Dr(e.ssContent),ssFallback:e.ssFallback&&Dr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Ml(u,a.clone(u)),u}function Qe(e=" ",t=0){return ie(_l,null,e,t)}function xy(e,t){const n=ie($c,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(b(),be(xs,null,e)):ie(xs,null,e)}function Io(e){return e==null||typeof e=="boolean"?ie(xs):_t(e)?ie(Be,null,e.slice()):El(e)?wr(e):ie(_l,null,String(e))}function wr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Dr(e)}function _y(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_t(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),_y(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!e3(t)?t._ctx=Ys:o===3&&Ys&&(Ys.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Ys},n=32):(t=String(t),s&64?(n=16,t=[Qe(t)]):n=8);e.children=t,e.shapeFlag|=n}function bn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Pe([t.class,s.class]));else if(o==="style")t.style=Yt([t.style,s.style]);else if(Bd(o)){const i=t[o],r=s[o];r&&i!==r&&!(_t(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Vp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function To(e,t,n,s=null){Si(e,t,7,[n,s])}const a9=G4();let c9=0;function m3(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||a9,i={uid:c9++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new c4(!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:n3(s,o),emitsOptions:Z4(s,o),emit:null,emitted:null,propsDefaults:Jt,inheritAttrs:s.inheritAttrs,ctx:Jt,data:Jt,props:Jt,attrs:Jt,slots:Jt,refs:Jt,setupState:Jt,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=PT.bind(null,i),e.ce&&e.ce(i),i}let Gs=null;const Zs=()=>Gs||Ys;let jh,Lc;{const e=Xp(),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)}};jh=t("__VUE_INSTANCE_SETTERS__",n=>Gs=n),Lc=t("__VUE_SSR_SETTERS__",n=>wa=n)}const tu=e=>{const t=Gs;return jh(e),e.scope.on(),()=>{e.scope.off(),jh(t)}},vd=()=>{Gs&&Gs.scope.off(),jh(null)};function g3(e){return e.vnode.shapeFlag&4}let wa=!1;function v3(e,t=!1,n=!1){t&&Lc(t);const{props:s,children:o}=e.vnode,i=g3(e);jT(e,s,i,t),YT(e,o,n||t);const r=i?u9(e,t):void 0;return t&&Lc(!1),r}function u9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ng);const{setup:s}=n;if(s){Or();const o=e.setupContext=s.length>1?k3(e):null,i=tu(e),r=Dd(s,e,0,[e.props,o]),l=oy(r);if(Rr(),i(),(l||e.sp)&&!Ir(e)&&fy(e),l){if(r.then(vd,vd),t)return r.then(a=>{Og(e,a,t)}).catch(a=>{eu(a,e,0)});e.asyncDep=r}else Og(e,r,t)}else y3(e,t)}function Og(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:un(t)&&(e.setupState=M4(t)),y3(e,n)}let Vh,Rg;function Qxe(e){Vh=e,Rg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,IT))}}const Xxe=()=>!Vh;function y3(e,t,n){const s=e.type;if(!e.render){if(!t&&Vh&&!s.render){const o=s.template||vy(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=xn(xn({isCustomElement:i,delimiters:l},r),a);s.render=Vh(o,c)}}e.render=s.render||xi,Rg&&Rg(e)}{const o=tu(e);Or();try{$T(e)}finally{Rr(),o()}}}const d9={get(e,t){return no(e,"get",""),e[t]}};function k3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,d9),slots:e.slots,emit:e.emit,expose:t}}function zd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(M4(mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ku)return Ku[n](e)},has(t,n){return n in t||n in Ku}})):e.proxy}function Bg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function f9(e){return $t(e)&&"__vccOpts"in e}const D=(e,t)=>GE(e,t,wa);function mn(e,t,n){try{qh(-1);const s=arguments.length;return s===2?un(t)&&!_t(t)?El(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&El(n)&&(n=[n]),ie(e,t,n))}finally{qh(1)}}function Jxe(){}function e_e(e,t,n,s){const o=n[s];if(o&&h9(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function h9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Vs(n[s],t[s]))return!1;return _a>0&&so&&so.push(e),!0}const p9="3.5.35",t_e=xi,n_e=JE,s_e=uc,o_e=L4,m9={createComponentInstance:m3,setupComponent:v3,renderComponentRoot:uh,setCurrentRenderingInstance:hd,isVNode:El,normalizeVNode:Io,getComponentPublicInstance:zd,ensureValidVNode:gy,pushWarningContext:QE,popWarningContext:XE},i_e=m9,r_e=null,l_e=null,a_e=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Dg;const jb=typeof window<"u"&&window.trustedTypes;if(jb)try{Dg=jb.createPolicy("vue",{createHTML:e=>e})}catch{}const b3=Dg?e=>Dg.createHTML(e):e=>e,g9="http://www.w3.org/2000/svg",v9="http://www.w3.org/1998/Math/MathML",yr=typeof document<"u"?document:null,Vb=yr&&yr.createElement("template"),y9={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(g9,e):t==="mathml"?yr.createElementNS(v9,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{Vb.innerHTML=b3(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Vb.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Jr="transition",Mu="animation",qc=Symbol("_vtc"),x3={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},_3=xn({},D4,x3),k9=e=>(e.displayName="Transition",e.props=_3,e),Tl=k9((e,{slots:t})=>mn(dT,w3(e),t)),ea=(e,t=[])=>{_t(e)?e.forEach(n=>n(...t)):e&&e(...t)},Kb=e=>e?_t(e)?e.some(t=>t.length>1):e.length>1:!1;function w3(e){const t={};for(const S in e)S in x3||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=b9(o),m=p&&p[0],x=p&&p[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:A,onBeforeAppear:L=k,onAppear:$=g,onAppearCancelled:_=v}=t,E=(S,I,R,B)=>{S._enterCancelled=B,cl(S,I?u:l),cl(S,I?c:r),R&&R()},N=(S,I)=>{S._isLeaving=!1,cl(S,d),cl(S,h),cl(S,f),I&&I()},F=S=>(I,R)=>{const B=S?$:g,P=()=>E(I,S,R);ea(B,[I,P]),Gb(()=>{cl(I,S?a:i),Gi(I,S?u:l),Kb(B)||Yb(I,s,m,P)})};return xn(t,{onBeforeEnter(S){ea(k,[S]),Gi(S,i),Gi(S,r)},onBeforeAppear(S){ea(L,[S]),Gi(S,a),Gi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,I){S._isLeaving=!0;const R=()=>N(S,I);Gi(S,d),S._enterCancelled?(Gi(S,f),Pg(S)):(Pg(S),Gi(S,f)),Gb(()=>{S._isLeaving&&(cl(S,d),Gi(S,h),Kb(y)||Yb(S,s,x,R))}),ea(y,[S,R])},onEnterCancelled(S){E(S,!1,void 0,!0),ea(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),ea(_,[S])},onLeaveCancelled(S){N(S),ea(A,[S])}})}function b9(e){if(e==null)return null;if(un(e))return[X1(e.enter),X1(e.leave)];{const t=X1(e);return[t,t]}}function X1(e){return $h(e)}function Gi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[qc]||(e[qc]=new Set)).add(t)}function cl(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[qc];n&&(n.delete(t),n.size||(e[qc]=void 0))}function Gb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let x9=0;function Yb(e,t,n,s){const o=e._endId=++x9,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=S3(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 S3(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${Jr}Delay`),i=s(`${Jr}Duration`),r=Zb(o,i),l=s(`${Mu}Delay`),a=s(`${Mu}Duration`),c=Zb(l,a);let u=null,d=0,f=0;t===Jr?r>0&&(u=Jr,d=r,f=i.length):t===Mu?c>0&&(u=Mu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Jr:Mu:null,f=u?u===Jr?i.length:a.length:0);const h=u===Jr&&/\b(?:transform|all)(?:,|$)/.test(s(`${Jr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Zb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Qb(n)+Qb(e[s])))}function Qb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Pg(e){return(e?e.ownerDocument:document).body.offsetHeight}function _9(e,t,n){const s=e[qc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Kh=Symbol("_vod"),C3=Symbol("_vsh"),yi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Kh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Eu(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),Eu(e,!0),s.enter(e)):s.leave(e,()=>{Eu(e,!1)}):Eu(e,t))},beforeUnmount(e,{value:t}){Eu(e,t)}};function Eu(e,t){e.style.display=t?e[Kh]:"none",e[C3]=!t}function w9(){yi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const A3=Symbol("");function c_e(e){const t=Zs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Gh(i,o))},s=()=>{const o=e(t.proxy);t.ce?Gh(t.ce,o):Hg(t.subTree,o),n(o)};U4(()=>{Dh(s)}),gn(()=>{Ze(s,xi,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),_n(()=>o.disconnect())})}function Hg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Hg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Gh(e.el,t);else if(e.type===Be)e.children.forEach(n=>Hg(n,t));else if(e.type===$c){let{el:n,anchor:s}=e;for(;n&&(Gh(n,t),n!==s);)n=n.nextSibling}}function Gh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=bE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[A3]=s}}const S9=/(?:^|;)\s*display\s*:/;function C9(e,t,n){const s=e.style,o=Nn(n);let i=!1;if(n&&!o){if(t)if(Nn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Du(s,l,"")}else for(const r in t)n[r]==null&&Du(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?M9(e,r,!Nn(t)&&t?t[r]:void 0,l)||Du(s,r,l):Du(s,r,"")}}else if(o){if(t!==n){const r=s[A3];r&&(n+=";"+r),s.cssText=n,i=S9.test(n)}}else t&&e.removeAttribute("style");Kh in e&&(e[Kh]=i?s.display:"",e[C3]&&(s.display="none"))}const Xb=/\s*!important$/;function Du(e,t,n){if(_t(n))n.forEach(s=>Du(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=A9(e,t);Xb.test(n)?e.setProperty($o(s),n.replace(Xb,""),"important"):e[s]=n}}const Jb=["Webkit","Moz","ms"],J1={};function A9(e,t){const n=J1[t];if(n)return n;let s=Ls(t);if(s!=="filter"&&s in e)return J1[t]=s;s=Zp(s);for(let o=0;o<Jb.length;o++){const i=Jb[o]+s;if(i in e)return J1[t]=i}return t}function M9(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Nn(s)&&n===s}const ex="http://www.w3.org/1999/xlink";function tx(e,t,n,s,o,i=yE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ex,t.slice(6,t.length)):e.setAttributeNS(ex,t,n):n==null||i&&!r4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ti(n)?String(n):n)}function nx(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?b3(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=r4(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 E9(e,t,n,s){e.removeEventListener(t,n,s)}const sx=Symbol("_vei");function T9(e,t,n,s,o=null){const i=e[sx]||(e[sx]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=N9(t);if(s){const c=i[t]=L9(s,o);Mr(e,l,c,a)}else r&&(E9(e,l,r,a),i[t]=void 0)}}const ox=/(?:Once|Passive|Capture)$/;function N9(e){let t;if(ox.test(e)){t={};let s;for(;s=e.match(ox);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):$o(e.slice(2)),t]}let e0=0;const I9=Promise.resolve(),$9=()=>e0||(I9.then(()=>e0=0),e0=Date.now());function L9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(_t(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&Si(c,t,5,l)}}else Si(o,t,5,[s])};return n.value=e,n.attached=$9(),n}const ix=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,F9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?_9(e,s,r):t==="style"?C9(e,n,s):Bd(t)?Vp(t)||T9(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):O9(e,t,s,r))?(nx(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&tx(e,t,s,r,i,t!=="value")):e._isVueCE&&(R9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Nn(s)))?nx(e,Ls(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),tx(e,t,s,r))};function O9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&ix(t)&&$t(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return ix(t)&&Nn(n)?!1:t in e}function R9(e,t){const n=e._def.props;if(!n)return!1;const s=Ls(t);return Array.isArray(n)?n.some(o=>Ls(o)===s):Object.keys(n).some(o=>Ls(o)===s)}const rx={};function B9(e,t,n){let s=Ge(e,t);Kp(s)&&(s=xn({},s,t));class o extends wy{constructor(r){super(s,r,n)}}return o.def=s,o}const u_e=((e,t)=>B9(e,t,e7)),D9=typeof HTMLElement<"u"?HTMLElement:class{};class wy extends D9{constructor(t,n={},s=Qh){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!==Qh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(xn({},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 wy){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!_t(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=$h(this._props[a])),(l||(l=Object.create(null)))[Ls(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)cn(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=_t(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(Ls))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):rx;const o=Ls(t);n&&this._numberProps&&this._numberProps[o]&&(s=$h(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===rx?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($o(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute($o(t),n+""):n||this.removeAttribute($o(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),J9(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,xn(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,Kp(r[0])?xn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),$o(i)!==i&&o($o(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 P9(e){const t=Zs(),n=t&&t.ce;return n||null}function d_e(){const e=P9();return e&&e.shadowRoot}function f_e(e="$style"){{const t=Zs();if(!t)return Jt;const n=t.type.__cssModules;if(!n)return Jt;const s=n[e];return s||Jt}}const M3=new WeakMap,E3=new WeakMap,Yh=Symbol("_moveCb"),lx=Symbol("_enterCb"),H9=e=>(delete e.props.mode,e),W9=H9({name:"TransitionGroup",props:xn({},_3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Zs(),s=B4();let o,i;return hy(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!V9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(U9),o.forEach(q9);const l=o.filter(j9);Pg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Gi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Yh]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Yh]=null,cl(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=nn(e),l=w3(r);let a=r.tag||Be;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),Ml(u,pd(u,l,s,n)),M3.set(u,T3(u.el)))}i=t.default?dy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Ml(u,pd(u,l,s,n))}return ie(a,null,i)}}}),z9=W9;function U9(e){const t=e.el;t[Yh]&&t[Yh](),t[lx]&&t[lx]()}function q9(e){E3.set(e,T3(e.el))}function j9(e){const t=M3.get(e),n=E3.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 T3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function V9(e,t,n){const s=e.cloneNode(),o=e[qc];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}=S3(s);return i.removeChild(s),r}const Nl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _t(t)?n=>Ec(t,n):t};function K9(e){e.target.composing=!0}function ax(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const _i=Symbol("_assign");function cx(e,t,n){return t&&(e=e.trim()),n&&(e=Qp(e)),e}const wo={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[_i]=Nl(o);const i=s||o.props&&o.props.type==="number";Mr(e,t?"change":"input",r=>{r.target.composing||e[_i](cx(e.value,n,i))}),(n||i)&&Mr(e,"change",()=>{e.value=cx(e.value,n,i)}),t||(Mr(e,"compositionstart",K9),Mr(e,"compositionend",ax),Mr(e,"change",ax))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[_i]=Nl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Qp(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)}},Zh={deep:!0,created(e,t,n){e[_i]=Nl(n),Mr(e,"change",()=>{const s=e._modelValue,o=jc(e),i=e.checked,r=e[_i];if(_t(s)){const l=Jp(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(Ta(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(I3(e,i))})},mounted:ux,beforeUpdate(e,t,n){e[_i]=Nl(n),ux(e,t,n)}};function ux(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(_t(t))o=Jp(t,s.props.value)>-1;else if(Ta(t))o=t.has(s.props.value);else{if(t===n)return;o=Fr(t,I3(e,!0))}e.checked!==o&&(e.checked=o)}const N3={created(e,{value:t},n){e.checked=Fr(t,n.props.value),e[_i]=Nl(n),Mr(e,"change",()=>{e[_i](jc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[_i]=Nl(s),t!==n&&(e.checked=Fr(t,s.props.value))}},Wg={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Ta(t);Mr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Qp(jc(r)):jc(r));e[_i](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[_i]=Nl(s)},mounted(e,{value:t}){dx(e,t)},beforeUpdate(e,t,n){e[_i]=Nl(n)},updated(e,{value:t}){e._assigning||dx(e,t)}};function dx(e,t){const n=e.multiple,s=_t(t);if(!(n&&!s&&!Ta(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=jc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Jp(t,l)>-1}else r.selected=t.has(l);else if(Fr(jc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function jc(e){return"_value"in e?e._value:e.value}function I3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const G9={created(e,t,n){$f(e,t,n,null,"created")},mounted(e,t,n){$f(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){$f(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){$f(e,t,n,s,"updated")}};function $3(e,t){switch(e){case"SELECT":return Wg;case"TEXTAREA":return wo;default:switch(t){case"checkbox":return Zh;case"radio":return N3;default:return wo}}}function $f(e,t,n,s,o){const r=$3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function Y9(){wo.getSSRProps=({value:e})=>({value:e}),N3.getSSRProps=({value:e},t)=>{if(t.props&&Fr(t.props.value,e))return{checked:!0}},Zh.getSSRProps=({value:e},t)=>{if(_t(e)){if(t.props&&Jp(e,t.props.value)>-1)return{checked:!0}}else if(Ta(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},G9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=$3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const Z9=["ctrl","shift","alt","meta"],Q9={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)=>Z9.some(n=>e[`${n}Key`]&&!t.includes(n))},xt=(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=Q9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},X9={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ji=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=$o(o.key);if(t.some(r=>r===i||X9[r]===i))return e(o)}))},L3=xn({patchProp:F9},y9);let Yu,fx=!1;function F3(){return Yu||(Yu=QT(L3))}function O3(){return Yu=fx?Yu:XT(L3),fx=!0,Yu}const J9=((...e)=>{F3().render(...e)}),h_e=((...e)=>{O3().hydrate(...e)}),Qh=((...e)=>{const t=F3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=B3(s);if(!o)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,R3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),e7=((...e)=>{const t=O3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=B3(s);if(o)return n(o,!0,R3(o))},t});function R3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function B3(e){return Nn(e)?document.querySelector(e):e}let hx=!1;const p_e=()=>{hx||(hx=!0,Y9(),w9())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function t7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Xh=typeof window<"u",Ol=(e,t=!1)=>t?Symbol.for(e):Symbol(e),n7=(e,t,n)=>s7({l:e,k:t,s:n}),s7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ws=e=>typeof e=="number"&&isFinite(e),D3=e=>Cy(e)==="[object Date]",Vc=e=>Cy(e)==="[object RegExp]",um=e=>tn(e)&&Object.keys(e).length===0,Ss=Object.assign,o7=Object.create,Tn=(e=null)=>o7(e);let px;const fa=()=>px||(px=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Tn());function mx(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function i7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const r7=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,l7=/^(?:href|src|action|formaction)$/i;function Sy(e){return r7.test(e)}function a7(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+=Sy(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function gx(e,t){if(l7.test(e)&&Sy(t))return"about:blank";const n=e.toLowerCase()==="style"?a7(t):t;return i7(n)}function c7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${gx(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${gx(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)=>Sy(o)?`${s}about:blank`:n),e}const u7=Object.prototype.hasOwnProperty;function bi(e,t){return u7.call(e,t)}const ls=Array.isArray,Kn=e=>typeof e=="function",yt=e=>typeof e=="string",on=e=>typeof e=="boolean",rn=e=>e!==null&&typeof e=="object",d7=e=>rn(e)&&Kn(e.then)&&Kn(e.catch),P3=Object.prototype.toString,Cy=e=>P3.call(e),tn=e=>Cy(e)==="[object Object]",f7=e=>e==null?"":ls(e)||tn(e)&&e.toString===P3?JSON.stringify(e,null,2):String(e);function Ay(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Lf=e=>!rn(e)||ls(e);function fh(e,t){if(Lf(e)||Lf(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(rn(s[i])&&!rn(o[i])&&(o[i]=Array.isArray(s[i])?[]:Tn()),Lf(o[i])||Lf(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 h7(e,t,n){return{line:e,column:t,offset:n}}function zg(e,t,n){return{start:e,end:t}}const hn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},p7=17;function dm(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 m7(e){throw e}const ji=" ",g7="\r",Js=`
|
|
29
|
-
`,v7="\u2028",y7="\u2029";function k7(e){const t=e;let n=0,s=1,o=1,i=0;const r=$=>t[$]===g7&&t[$+1]===Js,l=$=>t[$]===Js,a=$=>t[$]===y7,c=$=>t[$]===v7,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=$=>r($)||a($)||c($)?Js:t[$],x=()=>m(n),k=()=>m(n+i);function g(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function A($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:x,currentPeek:k,next:g,peek:v,reset:y,resetPeek:A,skipToPeek:L}}const hr=void 0,b7=".",vx="'",x7="tokenizer";function _7(e,t={}){const n=t.location!==!1,s=k7(e),o=()=>s.index(),i=()=>h7(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(j,te,pe,...Ce){const Ie=c();if(te.column+=pe,te.offset+=pe,u){const $e=n?zg(Ie.startLoc,te):null,he=dm(j,$e,{domain:x7,args:Ce});u(he)}}function f(j,te,pe){j.endLoc=i(),j.currentType=te;const Ce={type:te};return n&&(Ce.loc=zg(j.startLoc,j.endLoc)),pe!=null&&(Ce.value=pe),Ce}const h=j=>f(j,13);function p(j,te){return j.currentChar()===te?(j.next(),te):(d(hn.EXPECTED_TOKEN,i(),0,te),"")}function m(j){let te="";for(;j.currentPeek()===ji||j.currentPeek()===Js;)te+=j.currentPeek(),j.peek();return te}function x(j){const te=m(j);return j.skipToPeek(),te}function k(j){if(j===hr)return!1;const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te===95}function g(j){if(j===hr)return!1;const te=j.charCodeAt(0);return te>=48&&te<=57}function v(j,te){const{currentType:pe}=te;if(pe!==2)return!1;m(j);const Ce=k(j.currentPeek());return j.resetPeek(),Ce}function y(j,te){const{currentType:pe}=te;if(pe!==2)return!1;m(j);const Ce=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ie=g(Ce);return j.resetPeek(),Ie}function A(j,te){const{currentType:pe}=te;if(pe!==2)return!1;m(j);const Ce=j.currentPeek()===vx;return j.resetPeek(),Ce}function L(j,te){const{currentType:pe}=te;if(pe!==7)return!1;m(j);const Ce=j.currentPeek()===".";return j.resetPeek(),Ce}function $(j,te){const{currentType:pe}=te;if(pe!==8)return!1;m(j);const Ce=k(j.currentPeek());return j.resetPeek(),Ce}function _(j,te){const{currentType:pe}=te;if(!(pe===7||pe===11))return!1;m(j);const Ce=j.currentPeek()===":";return j.resetPeek(),Ce}function E(j,te){const{currentType:pe}=te;if(pe!==9)return!1;const Ce=()=>{const $e=j.currentPeek();return $e==="{"?k(j.peek()):$e==="@"||$e==="|"||$e===":"||$e==="."||$e===ji||!$e?!1:$e===Js?(j.peek(),Ce()):F(j,!1)},Ie=Ce();return j.resetPeek(),Ie}function N(j){m(j);const te=j.currentPeek()==="|";return j.resetPeek(),te}function F(j,te=!0){const pe=(Ie=!1,$e="")=>{const he=j.currentPeek();return he==="{"||he==="@"||!he?Ie:he==="|"?!($e===ji||$e===Js):he===ji?(j.peek(),pe(!0,ji)):he===Js?(j.peek(),pe(!0,Js)):!0},Ce=pe();return te&&j.resetPeek(),Ce}function S(j,te){const pe=j.currentChar();return pe===hr?hr:te(pe)?(j.next(),pe):null}function I(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36}function R(j){return S(j,I)}function B(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36||te===45}function P(j){return S(j,B)}function z(j){const te=j.charCodeAt(0);return te>=48&&te<=57}function W(j){return S(j,z)}function X(j){const te=j.charCodeAt(0);return te>=48&&te<=57||te>=65&&te<=70||te>=97&&te<=102}function U(j){return S(j,X)}function Z(j){let te="",pe="";for(;te=W(j);)pe+=te;return pe}function ce(j){let te="";for(;;){const pe=j.currentChar();if(pe==="\\"){const Ce=j.peek();Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||Ce==="\\"?(te+=pe+Ce,j.next(),j.next()):(j.resetPeek(),te+=pe,j.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===ji||pe===Js)if(F(j))te+=pe,j.next();else{if(N(j))break;te+=pe,j.next()}else te+=pe,j.next()}}return te}function fe(j){x(j);let te="",pe="";for(;te=P(j);)pe+=te;const Ce=j.currentChar();if(Ce&&Ce!=="}"&&Ce!==hr&&Ce!==ji&&Ce!==Js&&Ce!==" "){const Ie=G(j);return d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+Ie),pe+Ie}return j.currentChar()===hr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function se(j){x(j);let te="";return j.currentChar()==="-"?(j.next(),te+=`-${Z(j)}`):te+=Z(j),j.currentChar()===hr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function Y(j){return j!==vx&&j!==Js}function J(j){x(j),p(j,"'");let te="",pe="";for(;te=S(j,Y);)te==="\\"?pe+=le(j):pe+=te;const Ce=j.currentChar();return Ce===Js||Ce===hr?(d(hn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ce===Js&&(j.next(),p(j,"'")),pe):(p(j,"'"),pe)}function le(j){const te=j.currentChar();switch(te){case"\\":case"'":return j.next(),`\\${te}`;case"u":return He(j,te,4);case"U":return He(j,te,6);default:return d(hn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,te),""}}function He(j,te,pe){p(j,te);let Ce="";for(let Ie=0;Ie<pe;Ie++){const $e=U(j);if(!$e){d(hn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${te}${Ce}${j.currentChar()}`);break}Ce+=$e}return`\\${te}${Ce}`}function de(j){return j!=="{"&&j!=="}"&&j!==ji&&j!==Js}function G(j){x(j);let te="",pe="";for(;te=S(j,de);)pe+=te;return pe}function ae(j){let te="",pe="";for(;te=R(j);)pe+=te;return pe}function me(j){const te=pe=>{const Ce=j.currentChar();return Ce==="{"||Ce==="@"||Ce==="|"||Ce==="("||Ce===")"||!Ce||Ce===ji?pe:(pe+=Ce,j.next(),te(pe))};return te("")}function q(j){x(j);const te=p(j,"|");return x(j),te}function ne(j,te){let pe=null;switch(j.currentChar()){case"{":return te.braceNest>=1&&d(hn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),pe=f(te,2,"{"),x(j),te.braceNest++,pe;case"}":return te.braceNest>0&&te.currentType===2&&d(hn.EMPTY_PLACEHOLDER,i(),0),j.next(),pe=f(te,3,"}"),te.braceNest--,te.braceNest>0&&x(j),te.inLinked&&te.braceNest===0&&(te.inLinked=!1),pe;case"@":return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=ge(j,te)||h(te),te.braceNest=0,pe;default:{let Ie=!0,$e=!0,he=!0;if(N(j))return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(te.braceNest>0&&(te.currentType===4||te.currentType===5||te.currentType===6))return d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te.braceNest=0,ue(j,te);if(Ie=v(j,te))return pe=f(te,4,fe(j)),x(j),pe;if($e=y(j,te))return pe=f(te,5,se(j)),x(j),pe;if(he=A(j,te))return pe=f(te,6,J(j)),x(j),pe;if(!Ie&&!$e&&!he)return pe=f(te,12,G(j)),d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),x(j),pe;break}}return pe}function ge(j,te){const{currentType:pe}=te;let Ce=null;const Ie=j.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&(Ie===Js||Ie===ji)&&d(hn.INVALID_LINKED_FORMAT,i(),0),Ie){case"@":return j.next(),Ce=f(te,7,"@"),te.inLinked=!0,Ce;case".":return x(j),j.next(),f(te,8,".");case":":return x(j),j.next(),f(te,9,":");default:return N(j)?(Ce=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,Ce):L(j,te)||_(j,te)?(x(j),ge(j,te)):$(j,te)?(x(j),f(te,11,ae(j))):E(j,te)?(x(j),Ie==="{"?ne(j,te)||Ce:f(te,10,me(j))):(pe===7&&d(hn.INVALID_LINKED_FORMAT,i(),0),te.braceNest=0,te.inLinked=!1,ue(j,te))}}function ue(j,te){let pe={type:13};if(te.braceNest>0)return ne(j,te)||h(te);if(te.inLinked)return ge(j,te)||h(te);switch(j.currentChar()){case"{":return ne(j,te)||h(te);case"}":return d(hn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(te,3,"}");case"@":return ge(j,te)||h(te);default:{if(N(j))return pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(F(j))return f(te,0,ce(j));break}}return pe}function ye(){const{currentType:j,offset:te,startLoc:pe,endLoc:Ce}=a;return a.lastType=j,a.lastOffset=te,a.lastStartLoc=pe,a.lastEndLoc=Ce,a.offset=o(),a.startLoc=i(),s.currentChar()===hr?f(a,13):ue(s,a)}return{nextToken:ye,currentOffset:o,currentPosition:i,context:c}}const w7="parser",S7=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,C7=/\\([\\@{}|])/g;function A7(e,t){return t}function M7(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 E7(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,g,v,y,...A){const L=k.currentPosition();if(L.offset+=y,L.column+=y,n){const $=t?zg(v,L):null,_=dm(g,$,{domain:w7,args:A});n(_)}}function o(k,g,v){const y={type:k};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(k,g,v,y){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(C7,A7),i(y,k.currentOffset(),k.currentPosition()),y}function l(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(5,y,A);return L.index=parseInt(g,10),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function a(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(4,y,A);return L.key=g,k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function c(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(9,y,A);return L.value=g.replace(S7,M7),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(8,y,A);return g.type!==11?(s(k,hn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,A),{nextConsumeToken:g,node:L}):(g.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Vi(g)),L.value=g.value||"",i(L,k.currentOffset(),k.currentPosition()),{node:L})}function d(k,g){const v=k.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,k.currentOffset(),k.currentPosition()),y}function f(k){const g=k.context(),v=o(6,g.offset,g.startLoc);let y=k.nextToken();if(y.type===8){const A=u(k);v.modifier=A.node,y=A.nextConsumeToken||k.nextToken()}switch(y.type!==9&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(y)),y=k.nextToken(),y.type===2&&(y=k.nextToken()),y.type){case 10:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(y)),v.key=d(k,y.value||"");break;case 4:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(y)),v.key=a(k,y.value||"");break;case 5:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(y)),v.key=l(k,y.value||"");break;case 6:y.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(y)),v.key=c(k,y.value||"");break;default:{s(k,hn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=k.context(),L=o(7,A.offset,A.startLoc);return L.value="",i(L,A.offset,A.startLoc),v.key=L,i(v,A.offset,A.startLoc),{nextConsumeToken:y,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function h(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,A=o(2,v,y);A.items=[];let L=null;do{const E=L||k.nextToken();switch(L=null,E.type){case 0:E.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(E)),A.items.push(r(k,E.value||""));break;case 5:E.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(E)),A.items.push(l(k,E.value||""));break;case 4:E.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(E)),A.items.push(a(k,E.value||""));break;case 6:E.value==null&&s(k,hn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Vi(E)),A.items.push(c(k,E.value||""));break;case 7:{const N=f(k);A.items.push(N.node),L=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:k.currentOffset(),_=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(A,$,_),A}function p(k,g,v,y){const A=k.context();let L=y.items.length===0;const $=o(1,g,v);$.cases=[],$.cases.push(y);do{const _=h(k);L||(L=_.items.length===0),$.cases.push(_)}while(A.currentType!==13);return L&&s(k,hn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,k.currentOffset(),k.currentPosition()),$}function m(k){const g=k.context(),{offset:v,startLoc:y}=g,A=h(k);return g.currentType===13?A:p(k,v,y,A)}function x(k){const g=_7(k,Ss({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=k),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(k)),v.currentType!==13&&s(g,hn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:x}}function Vi(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 T7(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function yx(e,t){for(let n=0;n<e.length;n++)My(e[n],t)}function My(e,t){switch(e.type){case 1:yx(e.cases,t),t.helper("plural");break;case 2:yx(e.items,t);break;case 6:{My(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 N7(e,t={}){const n=T7(e);n.helper("normalize"),e.body&&My(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function I7(e){const t=e.body;return t.type===2?kx(t):t.cases.forEach(n=>kx(n)),e}function kx(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=Ay(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 dc(e){switch(e.t=e.type,e.type){case 0:{const t=e;dc(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++)dc(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++)dc(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;dc(t.key),t.k=t.key,delete t.key,t.modifier&&(dc(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 $7(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,x){r.code+=m}function c(m,x=!0){const k=x?s:"";a(o?k+" ".repeat(m):k)}function u(m=!0){const x=++r.indentLevel;m&&c(x)}function d(m=!0){const x=--r.indentLevel;m&&c(x)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function L7(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Kc(e,t.key),t.modifier?(e.push(", "),Kc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function F7(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&&(Kc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function O7(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&&(Kc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function R7(e,t){t.body?Kc(e,t.body):e.push("null")}function Kc(e,t){const{helper:n}=e;switch(t.type){case 0:R7(e,t);break;case 1:O7(e,t);break;case 2:F7(e,t);break;case 6:L7(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 B7=(e,t={})=>{const n=yt(t.mode)?t.mode:"normal",s=yt(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=$7(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Ay(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Kc(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 D7(e,t={}){const n=Ss({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=E7(n).parse(e);return s?(i&&I7(l),o&&dc(l),{ast:l,code:""}):(N7(l,n),B7(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function P7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(fa().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(fa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function tr(e){return rn(e)&&Ey(e)===0&&(bi(e,"b")||bi(e,"body"))}const H3=["b","body"];function H7(e){return Rl(e,H3)}const W3=["c","cases"];function W7(e){return Rl(e,W3,[])}const z3=["s","static"];function z7(e){return Rl(e,z3)}const U3=["i","items"];function U7(e){return Rl(e,U3,[])}const q3=["t","type"];function Ey(e){return Rl(e,q3)}const j3=["v","value"];function Ff(e,t){const n=Rl(e,j3);if(n!=null)return n;throw yd(t)}const V3=["m","modifier"];function q7(e){return Rl(e,V3)}const K3=["k","key"];function j7(e){const t=Rl(e,K3);if(t)return t;throw yd(6)}function Rl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(bi(e,o)&&e[o]!=null)return e[o]}return n}const G3=[...H3,...W3,...z3,...U3,...K3,...V3,...j3,...q3];function yd(e){return new Error(`unhandled node type: ${e}`)}function t0(e){return n=>V7(n,e)}function V7(e,t){const n=H7(t);if(n==null)throw yd(0);if(Ey(n)===1){const i=W7(n);return e.plural(i.reduce((r,l)=>[...r,bx(e,l)],[]))}else return bx(e,n)}function bx(e,t){const n=z7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=U7(t).reduce((o,i)=>[...o,Ug(e,i)],[]);return e.normalize(s)}}function Ug(e,t){const n=Ey(t);switch(n){case 3:return Ff(t,n);case 9:return Ff(t,n);case 4:{const s=t;if(bi(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(bi(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw yd(n)}case 5:{const s=t;if(bi(s,"i")&&ws(s.i))return e.interpolate(e.list(s.i));if(bi(s,"index")&&ws(s.index))return e.interpolate(e.list(s.index));throw yd(n)}case 6:{const s=t,o=q7(s),i=j7(s);return e.linked(Ug(e,i),o?Ug(e,o):void 0,e.type)}case 7:return Ff(t,n);case 8:return Ff(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const K7=e=>e;let Of=Tn();function G7(e,t={}){let n=!1;const s=t.onError||m7;return t.onError=o=>{n=!0,s(o)},{...D7(e,t),detectError:n}}function Y7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){on(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||K7)(e),o=Of[s];if(o)return o;const{ast:i,detectError:r}=G7(e,{...t,location:!1,jit:!0}),l=t0(i);return r?l:Of[s]=l}else{const n=e.cacheKey;if(n){const s=Of[n];return s||(Of[n]=t0(e))}else return t0(e)}}let kd=null;function Z7(e){kd=e}function Q7(e,t,n){kd&&kd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const X7=J7("function:translate");function J7(e){return t=>kd&&kd.emit(e,t)}const Er={INVALID_ARGUMENT:p7,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},eN=24;function Tr(e){return dm(e,null,void 0)}function Ty(e,t){return t.locale!=null?xx(t.locale):xx(e.locale)}let n0;function xx(e){if(yt(e))return e;if(Kn(e)){if(e.resolvedOnce&&n0!=null)return n0;if(e.constructor.name==="Function"){const t=e();if(d7(t))throw Tr(Er.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return n0=t}else throw Tr(Er.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Tr(Er.NOT_SUPPORT_LOCALE_TYPE)}function tN(e,t,n){return[...new Set([n,...ls(t)?t:rn(t)?Object.keys(t):yt(t)?[t]:[n]])]}function qg(e,t,n){const s=yt(n)?n:bd,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;ls(r);)r=_x(i,r,t);const l=ls(t)||!tn(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,ls(r)&&_x(i,r,!1),o.__localeChainCache.set(s,i)}return i}function _x(e,t,n){let s=!0;for(let o=0;o<t.length&&on(s);o++){const i=t[o];yt(i)&&(s=nN(e,t[o],n))}return s}function nN(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=sN(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function sN(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),(ls(n)||tn(n))&&n[o]&&(s=n[o])}return s}const Bl=[];Bl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Bl[1]={w:[1],".":[2],"[":[4],o:[7]};Bl[2]={w:[2],i:[3,0],0:[3,0]};Bl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Bl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Bl[5]={"'":[4,0],o:8,l:[5,0]};Bl[6]={'"':[4,0],o:8,l:[6,0]};const oN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function iN(e){return oN.test(e)}function rN(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 lN(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 aN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:iN(t)?rN(t):"*"+t}function cN(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=aN(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=lN(i),d=Bl[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const wx=new Map;function uN(e,t){return rn(e)?e[t]:null}function dN(e,t){if(!rn(e))return null;let n=wx.get(t);if(n||(n=cN(t),n&&wx.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(G3.includes(r)&&tr(o)||!rn(o)||!bi(o,r))return null;const l=o[r];if(l===void 0||Kn(o))return null;o=l,i++}return o}const fN="11.4.5",fm=-1,bd="en-US",Jh="",Sx=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function hN(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&rn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&rn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?Sx(e):t==="vnode"&&rn(e)&&"__v_isVNode"in e?Sx(e.children):e}}let Y3;function pN(e){Y3=e}let Z3;function mN(e){Z3=e}let Q3;function gN(e){Q3=e}let X3=null;const vN=e=>{X3=e},yN=()=>X3;let J3=null;const Cx=e=>{J3=e},kN=()=>J3;let Ax=0;function bN(e={}){const t=Kn(e.onWarn)?e.onWarn:t7,n=yt(e.version)?e.version:fN,s=yt(e.locale)||Kn(e.locale)?e.locale:bd,o=Kn(s)?bd:s,i=ls(e.fallbackLocale)||tn(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=tn(e.messages)?e.messages:s0(o),l=tn(e.datetimeFormats)?e.datetimeFormats:s0(o),a=tn(e.numberFormats)?e.numberFormats:s0(o),c=Ss(Tn(),e.modifiers,hN()),u=e.pluralRules||Tn(),d=Kn(e.missing)?e.missing:null,f=on(e.missingWarn)||Vc(e.missingWarn)?e.missingWarn:!0,h=on(e.fallbackWarn)||Vc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,x=Kn(e.postTranslation)?e.postTranslation:null,k=tn(e.processor)?e.processor:null,g=on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Kn(e.messageCompiler)?e.messageCompiler:Y3,A=Kn(e.messageResolver)?e.messageResolver:Z3||uN,L=Kn(e.localeFallbacker)?e.localeFallbacker:Q3||tN,$=rn(e.fallbackContext)?e.fallbackContext:void 0,_=e,E=rn(_.__datetimeFormatters)?_.__datetimeFormatters:new Map,N=rn(_.__numberFormatters)?_.__numberFormatters:new Map,F=rn(_.__meta)?_.__meta:{};Ax++;const S={version:n,cid:Ax,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:x,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:A,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&Q7(S,n,F),S}const s0=e=>({[e]:Tn()});function Ny(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return yt(l)?l:t}else return t}function Tu(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function xN(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(xN(e,t[s]))return!0;return!1}function Mx(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!yt(t[0])&&!D3(t[0])&&!ws(t[0]))return Jh;const[a,c,u,d]=jg(...t),f=on(u.missingWarn)?u.missingWarn:e.missingWarn;on(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ty(e,u),m=r(e,o,p);if(!yt(a)||a===""){const L=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let x={},k,g=null;const v="datetime format";for(let L=0;L<m.length&&(k=m[L],x=n[k]||{},g=x[a],!tn(g));L++)Ny(e,a,k,f,v);if(!tn(g)||!yt(k))return s?fm:a;let y=`${k}__${a}`;um(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.DateTimeFormat(k,Ss({},g,d)),l.set(y,A)),h?A.formatToParts(c):A.format(c)}const eA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function jg(...e){const[t,n,s,o]=e,i=Tn();let r=Tn(),l;if(yt(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(D3(t)){if(isNaN(t.getTime()))throw Tr(Er.INVALID_DATE_ARGUMENT);l=t}else if(ws(t))l=t;else throw Tr(Er.INVALID_ARGUMENT);return yt(n)?i.key=n:tn(n)&&Object.keys(n).forEach(a=>{eA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(s)?i.locale=s:tn(s)&&(r=s),tn(o)&&(r=o),[i.key||"",l,i,r]}function Ex(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Tx(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ws(t[0]))return Jh;const[a,c,u,d]=Vg(...t),f=on(u.missingWarn)?u.missingWarn:e.missingWarn;on(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ty(e,u),m=r(e,o,p);if(!yt(a)||a===""){const L=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let x={},k,g=null;const v="number format";for(let L=0;L<m.length&&(k=m[L],x=n[k]||{},g=x[a],!tn(g));L++)Ny(e,a,k,f,v);if(!tn(g)||!yt(k))return s?fm:a;let y=`${k}__${a}`;um(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.NumberFormat(k,Ss({},g,d)),l.set(y,A)),h?A.formatToParts(c):A.format(c)}const tA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Vg(...e){const[t,n,s,o]=e,i=Tn();let r=Tn();if(!ws(t))throw Tr(Er.INVALID_ARGUMENT);const l=t;return yt(n)?i.key=n:tn(n)&&Object.keys(n).forEach(a=>{tA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(s)?i.locale=s:tn(s)&&(r=s),tn(o)&&(r=o),[i.key||"",l,i,r]}function Nx(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const wN=e=>e,SN=e=>"",CN="text",AN=e=>e.length===0?"":Ay(e),MN=f7;function o0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function EN(e){const t=ws(e.pluralIndex)?e.pluralIndex:-1;return ws(e.named?.count)?e.named.count:ws(e.named?.n)?e.named.n:t}function TN(e={}){const t=e.locale,n=EN(e),s=yt(t)&&Kn(e.pluralRules?.[t])?e.pluralRules[t]:o0,o=s===o0?void 0:o0,i=k=>k[s(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||Tn();ws(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=Kn(e.messages)?e.messages(k,!!g):rn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):SN)}const d=k=>e.modifiers?e.modifiers[k]:wN,f=Kn(e.processor?.normalize)?e.processor.normalize:AN,h=Kn(e.processor?.interpolate)?e.processor.interpolate:MN,p=yt(e.processor?.type)?e.processor.type:CN,x={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,y]=g;let A="text",L="";g.length===1?rn(v)?(L=v.modifier||L,A=v.type||A):yt(v)&&(L=v||L):g.length===2&&(yt(v)&&(L=v||L),yt(y)&&(A=y||A));const $=u(k,!0)(x),_=$===""||$===void 0?k:$,E=A==="vnode"&&ls(_)&&L?_[0]:_;return L?d(L)(E,A):E},message:u,type:p,interpolate:h,normalize:f,values:Ss(Tn(),r,a)};return x}const Ix=()=>"",gi=e=>Kn(e);function $x(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Kg(...t),u=on(c.missingWarn)?c.missingWarn:e.missingWarn,d=on(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=on(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||on(c.default)?on(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(yt(p)||Kn(p)),x=Ty(e,c);f&&NN(c);let[k,g,v]=h?[a,x,l[x]||Tn()]:nA(e,a,x,r,d,u),y=k,A=a;if(!h&&!(yt(y)||tr(y)||gi(y))&&m&&(y=p,A=y),!h&&(!(yt(y)||tr(y)||gi(y))||!yt(g)))return o?fm:a;let L=!1;const $=()=>{L=!0},_=gi(y)?y:sA(e,a,g,y,A,$);if(L)return y;const E=LN(e,g,v,c),N=TN(E),F=IN(e,_,N);let S=s?s(F,a):F;if(f&&yt(S)&&(S=c7(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:yt(a)?a:gi(y)?y.key:"",locale:g||(gi(y)?y.locale:""),format:yt(y)?y:gi(y)?y.source:"",message:S};I.meta=Ss({},e.__meta,yN()||{}),X7(I)}return S}function NN(e){ls(e.list)?e.list=e.list.map(t=>yt(t)?mx(t):t):rn(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=mx(e.named[t]))})}function nA(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=Tn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Tn(),(h=a(d,t))===null&&(h=d[t]),!(yt(h)||tr(h)||gi(h)));m++)if(!_N(f,u)){const x=Ny(e,t,f,i,p);x!==t&&(h=x)}return[h,f,d]}function sA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(gi(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,$N(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function IN(e,t,n){return t(n)}function Kg(...e){const[t,n,s]=e,o=Tn();if(!yt(t)&&!ws(t)&&!gi(t)&&!tr(t))throw Tr(Er.INVALID_ARGUMENT);const i=ws(t)?String(t):(gi(t),t);return ws(n)?o.plural=n:yt(n)?o.default=n:tn(n)&&!um(n)?o.named=n:ls(n)&&(o.list=n),ws(s)?o.plural=s:yt(s)?o.default=s:tn(s)&&Ss(o,s),[i,o]}function $N(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>n7(t,n,r)}}function LN(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[x,,k]=nA(u||e,h,t,l,a,c);m=x??r(k,h)}if(yt(m)||tr(m)){let x=!1;const g=sA(e,h,t,m,h,()=>{x=!0});return x?Ix:g}else return gi(m)?m:Ix}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),ws(s.plural)&&(f.pluralIndex=s.plural),f}P7();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const FN="11.4.5";function ON(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(fa().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(fa().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(fa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(fa().__INTLIFY_PROD_DEVTOOLS__=!1)}const vo={UNEXPECTED_RETURN_TYPE:eN,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 Lo(e,...t){return dm(e,null,void 0)}const Gg=Ol("__translateVNode"),Yg=Ol("__datetimeParts"),Zg=Ol("__numberParts"),oA=Ol("__setPluralRules"),iA=Ol("__injectWithOption"),yc=Ol("__dispose");function xd(e){if(!rn(e)||tr(e))return e;for(const t in e)if(bi(e,t))if(!t.includes("."))rn(e[t])&&xd(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]]=Tn()),!rn(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(tr(o)?G3.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!tr(o)){const r=o[n[s]];rn(r)&&xd(r)}}return e}function Iy(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=tn(n)?n:ls(s)?Tn():{[e]:Tn()};if(ls(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Tn(),fh(c,r[a])):fh(c,r)}else yt(l)&&fh(JSON.parse(l),r)}),o==null&&i)for(const l in r)bi(r,l)&&xd(r[l]);return r}function rA(e){return e.type}function lA(e,t,n){let s=rn(t.messages)?t.messages:Tn();"__i18nGlobal"in n&&(s=Iy(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(rn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(rn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Lx(e){return ie(_l,null,e,0)}function _d(){return Zs()}const Fx="__INTLIFY_META__",Ox=()=>[],RN=()=>!1;let Rx=0;function Bx(e){return((t,n,s,o)=>e(n,s,_d()||void 0,o))}const BN=()=>{const e=_d();let t=null;return e&&(t=rA(e)[Fx])?{[Fx]:t}:null};function ep(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Xh?Q:Na;let r=on(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:bd),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||ls(e.fallbackLocale)||tn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Iy(l.value,e)),u=i(tn(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(tn(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:on(e.missingWarn)||Vc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:on(e.fallbackWarn)||Vc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:on(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,x=Kn(e.missing)?e.missing:null,k=Kn(e.missing)?Bx(e.missing):null,g=Kn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const A=t?t.modifiers:tn(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&Cx(null);const he={version:FN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:L,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};he.datetimeFormats=u.value,he.numberFormats=d.value,he.__datetimeFormatters=tn($)?$.__datetimeFormatters:void 0,he.__numberFormatters=tn($)?$.__numberFormatters:void 0;const Ne=bN(he);return s&&Cx(Ne),Ne})(),Tu($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const N=D({get:()=>l.value,set:he=>{$.locale=he,l.value=he}}),F=D({get:()=>a.value,set:he=>{$.fallbackLocale=he,a.value=he,Tu($,l.value,he)}}),S=D(()=>c.value),I=D(()=>u.value),R=D(()=>d.value);function B(){return Kn(g)?g:null}function P(he){g=he,$.postTranslation=he}function z(){return x}function W(he){he!==null&&(k=Bx(he)),x=he,$.missing=k}const X=(he,Ne,Je,it,At,bt)=>{E();let wt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?kN():void 0),wt=he($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Je!=="translate exists"&&ws(wt)&&wt===fm||Je==="translate exists"&&!wt){const[Gt,vt]=Ne();return t&&p?it(t):At(Gt)}else{if(bt(wt))return wt;throw Lo(vo.UNEXPECTED_RETURN_TYPE)}};function U(...he){return X(Ne=>Reflect.apply($x,null,[Ne,...he]),()=>Kg(...he),"translate",Ne=>Reflect.apply(Ne.t,Ne,[...he]),Ne=>Ne,Ne=>yt(Ne))}function Z(...he){const[Ne,Je,it]=he;if(it&&!rn(it))throw Lo(vo.INVALID_ARGUMENT);return U(Ne,Je,Ss({resolvedMessage:!0},it||{}))}function ce(...he){return X(Ne=>Reflect.apply(Mx,null,[Ne,...he]),()=>jg(...he),"datetime format",Ne=>Reflect.apply(Ne.d,Ne,[...he]),()=>Jh,Ne=>yt(Ne)||ls(Ne))}function fe(...he){return X(Ne=>Reflect.apply(Tx,null,[Ne,...he]),()=>Vg(...he),"number format",Ne=>Reflect.apply(Ne.n,Ne,[...he]),()=>Jh,Ne=>yt(Ne)||ls(Ne))}function se(he){return he.map(Ne=>yt(Ne)||ws(Ne)||on(Ne)?Lx(String(Ne)):Ne)}const J={normalize:se,interpolate:he=>he,type:"vnode"};function le(...he){return X(Ne=>{let Je;const it=Ne;try{it.processor=J,Je=Reflect.apply($x,null,[it,...he])}finally{it.processor=null}return Je},()=>Kg(...he),"translate",Ne=>Ne[Gg](...he),Ne=>[Lx(Ne)],Ne=>ls(Ne))}function He(...he){return X(Ne=>Reflect.apply(Tx,null,[Ne,...he]),()=>Vg(...he),"number format",Ne=>Ne[Zg](...he),Ox,Ne=>yt(Ne)||ls(Ne))}function de(...he){return X(Ne=>Reflect.apply(Mx,null,[Ne,...he]),()=>jg(...he),"datetime format",Ne=>Ne[Yg](...he),Ox,Ne=>yt(Ne)||ls(Ne))}function G(he){L=he,$.pluralRules=L}function ae(he,Ne){return X(()=>{if(!he)return!1;const Je=yt(Ne)?Ne:l.value,it=yt(Ne)?[Je]:qg($,a.value,Je);for(let At=0;At<it.length;At++){const bt=ne(it[At]);let wt=$.messageResolver(bt,he);if(wt===null&&(wt=bt[he]),tr(wt)||gi(wt)||yt(wt))return!0}return!1},()=>[he],"translate exists",Je=>Reflect.apply(Je.te,Je,[he,Ne]),RN,Je=>on(Je))}function me(he){let Ne=null;const Je=qg($,a.value,l.value);for(let it=0;it<Je.length;it++){const At=c.value[Je[it]]||{},bt=$.messageResolver(At,he);if(bt!=null){Ne=bt;break}}return Ne}function q(he){const Ne=me(he);return Ne??(t?t.tm(he)||{}:{})}function ne(he){return c.value[he]||{}}function ge(he,Ne){if(o){const Je={[he]:Ne};for(const it in Je)bi(Je,it)&&xd(Je[it]);Ne=Je[he]}c.value[he]=Ne,$.messages=c.value}function ue(he,Ne){c.value[he]=c.value[he]||{};const Je={[he]:Ne};if(o)for(const it in Je)bi(Je,it)&&xd(Je[it]);Ne=Je[he],fh(Ne,c.value[he]),$.messages=c.value}function ye(he){return u.value[he]||{}}function j(he,Ne){u.value[he]=Ne,$.datetimeFormats=u.value,Ex($,he,Ne)}function te(he,Ne){u.value[he]=Ss(u.value[he]||{},Ne),$.datetimeFormats=u.value,Ex($,he,Ne)}function pe(he){return d.value[he]||{}}function Ce(he,Ne){d.value[he]=Ne,$.numberFormats=d.value,Nx($,he,Ne)}function Ie(he,Ne){d.value[he]=Ss(d.value[he]||{},Ne),$.numberFormats=d.value,Nx($,he,Ne)}Rx++,t&&Xh&&(Ze(t.locale,he=>{r&&(l.value=he,$.locale=he,Tu($,l.value,a.value))}),Ze(t.fallbackLocale,he=>{r&&(a.value=he,$.fallbackLocale=he,Tu($,l.value,a.value))}));const $e={id:Rx,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(he){r=he,he&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Tu($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(he){f=he,$.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(he){h=he,$.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(he){p=he},get fallbackFormat(){return m},set fallbackFormat(he){m=he,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(he){v=he,$.warnHtmlMessage=he},get escapeParameter(){return y},set escapeParameter(he){y=he,$.escapeParameter=he},t:U,getLocaleMessage:ne,setLocaleMessage:ge,mergeLocaleMessage:ue,getPostTranslationHandler:B,setPostTranslationHandler:P,getMissingHandler:z,setMissingHandler:W,[oA]:G};return $e.datetimeFormats=I,$e.numberFormats=R,$e.rt=Z,$e.te=ae,$e.tm=q,$e.d=ce,$e.n=fe,$e.getDateTimeFormat=ye,$e.setDateTimeFormat=j,$e.mergeDateTimeFormat=te,$e.getNumberFormat=pe,$e.setNumberFormat=Ce,$e.mergeNumberFormat=Ie,$e[iA]=n,$e[Gg]=le,$e[Yg]=de,$e[Zg]=He,$e}function DN(e){const t=yt(e.locale)?e.locale:bd,n=yt(e.fallbackLocale)||ls(e.fallbackLocale)||tn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Kn(e.missing)?e.missing:void 0,o=on(e.silentTranslationWarn)||Vc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=on(e.silentFallbackWarn)||Vc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=on(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=tn(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Kn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=on(e.sync)?e.sync:!0;let p=e.messages;if(tn(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce(($,_)=>{const E=$[_]||($[_]={});return Ss(E,A[_]),$},p||{})}const{__i18n:m,__root:x,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:g,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:x,__injectWithOption:k}}function Qg(e={}){const t=ep(DN(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return on(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=on(o)?!o:o},get silentFallbackWarn(){return on(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=on(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function PN(e,t,n){return{beforeCreate(){const s=_d();if(!s)throw Lo(vo.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=Dx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Qg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Dx(e,o);else{this.$i18n=Qg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&lA(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=_d();if(!s)throw Lo(vo.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 Dx(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[oA](t.pluralizationRules||e.pluralizationRules);const n=Iy(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 $y={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function HN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Be?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Tn())}function aA(){return Be}const WN=Ge({name:"i18n-t",props:Ss({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ws(e)||!isNaN(e)}},$y),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Tn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=HN(t,a);return o[Gg](e.keypath,u,c)},r=Ss(Tn(),s),l=yt(e.tag)||rn(e.tag)?e.tag:aA();return rn(l)?mn(l,r,{default:i}):mn(l,r,i())}}}),Px=WN;function zN(e){return ls(e)&&!yt(e[0])}function cA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Tn();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:rn(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?Ss(Tn(),h,{[p]:e.format[p]}):h,Tn()));const d=s(e.value,c,u);let f=[c.key];return ls(d)?f=d.map((h,p)=>{const m=o[h.type],x=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return zN(x)&&(x[0].key=`${h.type}-${p}`),x}):yt(d)&&(f=[d]),f},l=Ss(Tn(),i),a=yt(e.tag)||rn(e.tag)?e.tag:aA();return rn(a)?mn(a,l,{default:r}):mn(a,l,r())}}const UN=Ge({name:"i18n-n",props:Ss({value:{type:Number,required:!0},format:{type:[String,Object]}},$y),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return cA(e,t,tA,(...s)=>n[Zg](...s))}}),Hx=UN;function qN(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 jN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Lo(vo.UNEXPECTED_ERROR);const c=qN(e,l.$),u=Wx(a);return[Reflect.apply(c.t,c,[...zx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Xh&&(r.__i18nWatcher=Ze(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Xh&&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=Wx(l);r.textContent=Reflect.apply(a.t,a,[...zx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Wx(e){if(yt(e))return{path:e};if(tn(e)){if(!("path"in e))throw Lo(vo.REQUIRED_VALUE,"path");return e}else throw Lo(vo.INVALID_VALUE)}function zx(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return yt(n)&&(r.locale=n),ws(o)&&(r.plural=o),ws(i)&&(r.plural=i),[t,l,r]}function VN(e,t,...n){const s=tn(n[0])?n[0]:{};(on(s.globalInstall)?s.globalInstall:!0)&&([Px.name,"I18nT"].forEach(i=>e.component(i,Px)),[Hx.name,"I18nN"].forEach(i=>e.component(i,Hx)),[jx.name,"I18nD"].forEach(i=>e.component(i,jx))),e.directive("t",jN(t))}const KN=Ol("global-vue-i18n");function GN(e={}){const t=__VUE_I18N_LEGACY_API__&&on(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=on(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=YN(e,t),r=Ol("");function l(d){return s.get(d)||null}function a(d,f){s.set(d,f)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),tn(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=nI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&VN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(PN(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Tt(e={}){const t=_d();if(t==null)throw Lo(vo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Lo(vo.NOT_INSTALLED);const n=ZN(t),s=XN(n),o=rA(t),i=QN(e,o);if(i==="global")return lA(s,e,o),s;if(i==="parent"){let a=Ux(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Lo(vo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Ss({},e),u=Ux(n,t);c.__root=u||s;const d=ep(c);return a.__composerExtend&&(d[yc]=a.__composerExtend(d)),iy()&&ry(()=>{const h=d[yc];h&&(h(),delete d[yc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Ss({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=ep(a),r.__composerExtend&&(l[yc]=r.__composerExtend(l)),eI(r,t,l),r.__setInstance(t,l)}return l}function YN(e,t){const n=xE(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Qg(e)):n.run(()=>ep(e));if(s==null)throw Lo(vo.UNEXPECTED_ERROR);return[n,s]}function ZN(e){const t=Kt(e.isCE?KN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Lo(e.isCE?vo.NOT_INSTALLED_WITH_PROVIDE:vo.UNEXPECTED_ERROR);return t}function QN(e,t){return um(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function XN(e){return e.mode==="composition"?e.global:e.global.__composer}function Ux(e,t,n=!1){let s=null;const o=t.root;let i=JN(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[iA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function JN(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function eI(e,t,n){gn(()=>{},t),_n(()=>{const s=n;e.__deleteInstance(t);const o=s[yc];o&&(o(),delete s[yc])},t)}const tI=["locale","fallbackLocale","availableLocales"],qx=["t","rt","d","n","tm","te"];function nI(e,t){const n=Object.create(null);return tI.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Lo(vo.UNEXPECTED_ERROR);const r=hs(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,qx.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Lo(vo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,qx.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const sI=Ge({name:"i18n-d",props:Ss({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},$y),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return cA(e,t,eA,(...s)=>n[Yg](...s))}}),jx=sI;ON();pN(Y7);mN(dN);gN(qg);if(__INTLIFY_PROD_DEVTOOLS__){const e=fa();e.__INTLIFY__=!0,Z7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const oI="modulepreload",iI=function(e){return"/"+e},Vx={},mo=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=iI(c),c in Vx)return;Vx[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":oI,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)})},Lt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function Kx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function cs(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ms(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Gc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function hm(e){const t=cs(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ud(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Ly(){const e=cs(Lt.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 Fy(e){const n={...Ly()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ms(Lt.unread,JSON.stringify(n))}function rI(){const e=hm(Lt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function i0(e){Ud(Lt.collapsedWorkspaces,Array.from(e))}function lI(){const e=hm(Lt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function uA(e){Ud(Lt.workspaceOrder,Array.from(e))}function Rf(){const e=hm(Lt.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 Gx(e){Ud(Lt.workspaceNameOverrides,e)}function aI(){return cs(Lt.workspaceSort)}function dA(e){ms(Lt.workspaceSort,e)}const Yx=Lt.clientId,cI="kimi-code-web",uI="web";function dI(){return{serverHttpUrl:hI(),clientId:vI(),clientName:cI,clientVersion:yI(),clientUiMode:uI}}function fI(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function hI(e){const t=fI(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function pI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function mI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return pI(e)}function kc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function gI(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 vI(){const e=cs(Yx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ms(Yx,t),t}function yI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function kI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function bI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function oo(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 xI(e)}function xI(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function _I(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 wI(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 SI(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 CI(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const AI={"&":"&","<":"<",">":">",'"':""","'":"'"};function Zx(e){return e.replace(/[&<>"']/g,t=>AI[t]??t)}function MI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function EI(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 Qx(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return Qx(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 Qx(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function r0(e,t){const n=Zx(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(MI(Zx(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const fc=Q(0),TI=["type","disabled","aria-label"],NI=Ge({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),T("button",{ref_key:"el",ref:n,class:Pe(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Bn(s.$slots,"default",{},void 0,!0)],10,TI))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Wn=dt(NI,[["__scopeId","data-v-c9e67023"]]),II={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $I(e,t){return b(),T("svg",II,[...t[0]||(t[0]=[w("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),w("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 LI=mt({name:"kimi-add-conversation",render:$I}),FI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function OI(e,t){return b(),T("svg",FI,[...t[0]||(t[0]=[w("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 RI=mt({name:"kimi-folder",render:OI}),BI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DI=["clip-path"],PI=["id"];function HI(e,t){return b(),T("svg",BI,[w("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[w("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,DI),w("defs",null,[w("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[w("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,PI)])])}const WI=mt({name:"kimi-folder-open",render:HI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),zI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function UI(e,t){return b(),T("svg",zI,[...t[0]||(t[0]=[w("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),w("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),w("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 qI=mt({name:"kimi-more",render:UI}),jI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VI(e,t){return b(),T("svg",jI,[...t[0]||(t[0]=[w("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 KI=mt({name:"kimi-search",render:VI}),GI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YI(e,t){return b(),T("svg",GI,[...t[0]||(t[0]=[w("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),w("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 ZI=mt({name:"kimi-setting",render:YI}),QI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XI(e,t){return b(),T("svg",QI,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("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"}),w("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const JI=mt({name:"tabler-layout-sidebar-left-collapse",render:XI}),e$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t$(e,t){return b(),T("svg",e$,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("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"}),w("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const n$=mt({name:"tabler-layout-sidebar-left-expand",render:t$}),s$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o$(e,t){return b(),T("svg",s$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const i$=mt({name:"ri-add-line",render:o$}),r$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l$(e,t){return b(),T("svg",r$,[...t[0]||(t[0]=[w("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 a$=mt({name:"ri-alert-line",render:l$}),c$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u$(e,t){return b(),T("svg",c$,[...t[0]||(t[0]=[w("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 d$=mt({name:"ri-archive-line",render:u$}),f$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h$(e,t){return b(),T("svg",f$,[...t[0]||(t[0]=[w("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 p$=mt({name:"ri-arrow-down-line",render:h$}),m$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g$(e,t){return b(),T("svg",m$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const v$=mt({name:"ri-arrow-down-s-line",render:g$}),y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k$(e,t){return b(),T("svg",y$,[...t[0]||(t[0]=[w("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 b$=mt({name:"ri-arrow-go-back-line",render:k$}),x$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _$(e,t){return b(),T("svg",x$,[...t[0]||(t[0]=[w("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 w$=mt({name:"ri-arrow-right-line",render:_$}),S$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C$(e,t){return b(),T("svg",S$,[...t[0]||(t[0]=[w("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 A$=mt({name:"ri-arrow-right-s-line",render:C$}),M$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E$(e,t){return b(),T("svg",M$,[...t[0]||(t[0]=[w("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 Xx=mt({name:"ri-arrow-up-line",render:E$}),T$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N$(e,t){return b(),T("svg",T$,[...t[0]||(t[0]=[w("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 I$=mt({name:"ri-braces-line",render:N$}),$$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L$(e,t){return b(),T("svg",$$,[...t[0]||(t[0]=[w("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 F$=mt({name:"ri-calendar-close-line",render:L$}),O$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R$(e,t){return b(),T("svg",O$,[...t[0]||(t[0]=[w("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 B$=mt({name:"ri-calendar-schedule-line",render:R$}),D$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P$(e,t){return b(),T("svg",D$,[...t[0]||(t[0]=[w("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 H$=mt({name:"ri-calendar-todo-line",render:P$}),W$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z$(e,t){return b(),T("svg",W$,[...t[0]||(t[0]=[w("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 U$=mt({name:"ri-check-line",render:z$}),q$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function j$(e,t){return b(),T("svg",q$,[...t[0]||(t[0]=[w("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 V$=mt({name:"ri-close-line",render:j$}),K$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G$(e,t){return b(),T("svg",K$,[...t[0]||(t[0]=[w("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 Y$=mt({name:"ri-code-line",render:G$}),Z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q$(e,t){return b(),T("svg",Z$,[...t[0]||(t[0]=[w("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 X$=mt({name:"ri-collapse-diagonal-line",render:Q$}),J$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eL(e,t){return b(),T("svg",J$,[...t[0]||(t[0]=[w("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 tL=mt({name:"ri-download-line",render:eL}),nL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sL(e,t){return b(),T("svg",nL,[...t[0]||(t[0]=[w("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 oL=mt({name:"ri-draggable",render:sL}),iL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rL(e,t){return b(),T("svg",iL,[...t[0]||(t[0]=[w("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 lL=mt({name:"ri-equalizer-line",render:rL}),aL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cL(e,t){return b(),T("svg",aL,[...t[0]||(t[0]=[w("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 uL=mt({name:"ri-expand-diagonal-line",render:cL}),dL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fL(e,t){return b(),T("svg",dL,[...t[0]||(t[0]=[w("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 hL=mt({name:"ri-external-link-line",render:fL}),pL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mL(e,t){return b(),T("svg",pL,[...t[0]||(t[0]=[w("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 gL=mt({name:"ri-file-add-line",render:mL}),vL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yL(e,t){return b(),T("svg",vL,[...t[0]||(t[0]=[w("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 kL=mt({name:"ri-file-copy-line",render:yL}),bL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xL(e,t){return b(),T("svg",bL,[...t[0]||(t[0]=[w("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 _L=mt({name:"ri-file-edit-line",render:xL}),wL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SL(e,t){return b(),T("svg",wL,[...t[0]||(t[0]=[w("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 Jx=mt({name:"ri-file-line",render:SL}),CL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AL(e,t){return b(),T("svg",CL,[...t[0]||(t[0]=[w("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 ML=mt({name:"ri-file-text-line",render:AL}),EL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TL(e,t){return b(),T("svg",EL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const NL=mt({name:"ri-flashlight-line",render:TL}),IL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $L(e,t){return b(),T("svg",IL,[...t[0]||(t[0]=[w("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 LL=mt({name:"ri-folder-add-line",render:$L}),FL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OL(e,t){return b(),T("svg",FL,[...t[0]||(t[0]=[w("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 RL=mt({name:"ri-folder-fill",render:OL}),BL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DL(e,t){return b(),T("svg",BL,[...t[0]||(t[0]=[w("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 PL=mt({name:"ri-git-fork-line",render:DL}),HL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WL(e,t){return b(),T("svg",HL,[...t[0]||(t[0]=[w("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 zL=mt({name:"ri-git-pull-request-line",render:WL}),UL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qL(e,t){return b(),T("svg",UL,[...t[0]||(t[0]=[w("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 jL=mt({name:"ri-global-line",render:qL}),VL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KL(e,t){return b(),T("svg",VL,[...t[0]||(t[0]=[w("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 e_=mt({name:"ri-image-line",render:KL}),GL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YL(e,t){return b(),T("svg",GL,[...t[0]||(t[0]=[w("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 ZL=mt({name:"ri-information-line",render:YL}),QL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XL(e,t){return b(),T("svg",QL,[...t[0]||(t[0]=[w("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 JL=mt({name:"ri-links-line",render:XL}),eF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tF(e,t){return b(),T("svg",eF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const nF=mt({name:"ri-list-check",render:tF}),sF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oF(e,t){return b(),T("svg",sF,[...t[0]||(t[0]=[w("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 iF=mt({name:"ri-list-unordered",render:oF}),rF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lF(e,t){return b(),T("svg",rF,[...t[0]||(t[0]=[w("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 aF=mt({name:"ri-login-box-line",render:lF}),cF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uF(e,t){return b(),T("svg",cF,[...t[0]||(t[0]=[w("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 dF=mt({name:"ri-mail-line",render:uF}),fF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hF(e,t){return b(),T("svg",fF,[...t[0]||(t[0]=[w("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 pF=mt({name:"ri-message-line",render:hF}),mF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gF(e,t){return b(),T("svg",mF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const vF=mt({name:"ri-pause-fill",render:gF}),yF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kF(e,t){return b(),T("svg",yF,[...t[0]||(t[0]=[w("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 bF=mt({name:"ri-pencil-line",render:kF}),xF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _F(e,t){return b(),T("svg",xF,[...t[0]||(t[0]=[w("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 wF=mt({name:"ri-play-fill",render:_F}),SF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CF(e,t){return b(),T("svg",SF,[...t[0]||(t[0]=[w("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 AF=mt({name:"ri-question-line",render:CF}),MF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EF(e,t){return b(),T("svg",MF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const TF=mt({name:"ri-sort-desc",render:EF}),NF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IF(e,t){return b(),T("svg",NF,[...t[0]||(t[0]=[w("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 $F=mt({name:"ri-sparkling-line",render:IF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FF(e,t){return b(),T("svg",LF,[...t[0]||(t[0]=[w("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 OF=mt({name:"ri-star-fill",render:FF}),RF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BF(e,t){return b(),T("svg",RF,[...t[0]||(t[0]=[w("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 DF=mt({name:"ri-star-line",render:BF}),PF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HF(e,t){return b(),T("svg",PF,[...t[0]||(t[0]=[w("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 WF=mt({name:"ri-stop-fill",render:HF}),zF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UF(e,t){return b(),T("svg",zF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const qF=mt({name:"ri-subtract-line",render:UF}),jF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VF(e,t){return b(),T("svg",jF,[...t[0]||(t[0]=[w("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 KF=mt({name:"ri-target-line",render:VF}),GF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YF(e,t){return b(),T("svg",GF,[...t[0]||(t[0]=[w("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 ZF=mt({name:"ri-terminal-box-line",render:YF}),QF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return b(),T("svg",QF,[...t[0]||(t[0]=[w("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 JF=mt({name:"ri-time-line",render:XF}),eO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tO(e,t){return b(),T("svg",eO,[...t[0]||(t[0]=[w("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 nO=mt({name:"ri-tools-line",render:tO}),sO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oO(e,t){return b(),T("svg",sO,[...t[0]||(t[0]=[w("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 iO=mt({name:"ri-user-line",render:oO}),rO=`<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
|
-
`,lO=`<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
|
-
`,aO=`<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
|
-
`,cO=`<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
|
-
`,uO=`<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
|
-
`,dO=`<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
|
-
`,fO='<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>',hO='<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>',pO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',mO='<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>',gO='<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>',vO='<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>',yO='<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>',kO='<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>',bO='<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>',xO='<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>',t_='<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>',_O='<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>',wO='<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>',SO='<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>',CO='<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>',AO='<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>',MO='<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>',EO='<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>',TO='<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>',NO='<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>',IO='<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>',$O='<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>',LO='<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>',FO='<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>',OO='<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>',RO='<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>',BO='<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>',n_='<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>',DO='<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>',PO='<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>',HO='<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>',WO='<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>',zO='<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>',UO='<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>',qO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 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>',s_='<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>',jO='<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>',VO='<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>',KO='<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>',GO='<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>',YO='<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>',ZO='<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>',QO='<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>',XO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',JO='<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>',eR='<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>',tR='<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>',nR='<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>',sR='<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>',oR='<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>',iR='<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>',rR='<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>',lR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',aR='<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>',cR='<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>',uR='<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>',dR='<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>',fR='<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>',fA={sm:14,md:16,lg:20};function kt(e,t){return{component:e,svg:t}}const hA={plus:kt(i$,pO),"chat-new":kt(LI,rO),"calendar-close":kt(F$,wO),"calendar-schedule":kt(B$,SO),"calendar-todo":kt(H$,CO),close:kt(V$,MO),check:kt(U$,AO),archive:kt(d$,gO),search:kt(KI,uO),copy:kt(kL,RO),link:kt(JL,VO),"external-link":kt(hL,FO),download:kt(tL,NO),undo:kt(b$,kO),send:kt(Xx,t_),image:kt(e_,s_),settings:kt(ZI,dO),sliders:kt(lL,$O),"log-in":kt(aF,YO),"chevron-down":kt(v$,yO),"chevron-right":kt(A$,xO),"arrow-up":kt(Xx,t_),"arrow-down":kt(p$,vO),"arrow-right":kt(w$,bO),minus:kt(qF,lR),"panel-collapse":kt(JI,fO),"panel-expand":kt(n$,hO),expand:kt(uL,LO),collapse:kt(X$,TO),list:kt(iF,GO),sort:kt(TF,nR),grip:kt(oL,IO),folder:kt(WI,aO),"folder-closed":kt(RI,lO),"folder-plus":kt(LL,HO),"folder-solid":kt(RL,WO),file:kt(Jx,n_),"file-text":kt(ML,DO),"file-edit":kt(_L,BO),"file-plus":kt(gL,OO),"file-off":kt(Jx,n_),"image-off":kt(e_,s_),code:kt(Y$,EO),terminal:kt(ZF,cR),pencil:kt(bF,JO),tool:kt(nO,dR),glob:kt(I$,_O),globe:kt(jL,qO),"check-list":kt(nF,KO),bolt:kt(NL,PO),"git-fork":kt(PL,zO),"git-pull-request":kt(zL,UO),message:kt(pF,QO),mail:kt(dF,ZO),user:kt(iO,fR),info:kt(ZL,jO),"help-circle":kt(AF,tR),"alert-triangle":kt(a$,mO),clock:kt(JF,uR),sparkles:kt($F,sR),target:kt(KF,aR),pause:kt(vF,XO),play:kt(wF,eR),stop:kt(WF,rR),star:kt(OF,oR),"star-outline":kt(DF,iR),"dots-horizontal":kt(qI,cO)};function hR(e){return hA[e]}function pR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function hc(e,t="md"){const n=hA[e];return n?pR(n.svg,fA[t]):""}const m_e=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","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"]]],qe=Ge({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>hR(t.name)),s=D(()=>fA[t.size]);return(o,i)=>n.value?(b(),be(Ks(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):re("",!0)}}),mR={key:0,class:"ui-dialog__head"},gR={class:"ui-dialog__titles"},vR={key:0,class:"ui-dialog__title"},yR={key:1,class:"ui-dialog__desc"},kR={class:"ui-dialog__body"},bR={key:1,class:"ui-dialog__foot"},xR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',_R=Ge({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=Q(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(xR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ze(()=>n.open,async d=>{if(d){fc.value+=1,i=document.activeElement,await gt();const f=a(),h=l();(f??h[0]??o.value)?.focus()}else fc.value=Math.max(0,fc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ps(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(fc.value=Math.max(0,fc.value-1))}),(d,f)=>(b(),be(rm,{to:"body"},[e.open?(b(),T("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:o,class:Pe(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(b(),T("div",mR,[Bn(d.$slots,"head",{},()=>[w("div",gR,[e.title?(b(),T("div",vR,O(e.title),1)):re("",!0),e.description?(b(),T("div",yR,O(e.description),1)):re("",!0)])],!0),ie(Wn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Me(()=>[ie(qe,{name:"close",size:"md"})]),_:1})])):re("",!0),w("div",kR,[Bn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(b(),T("div",bR,[Bn(d.$slots,"foot",{},void 0,!0)])):re("",!0)],2)],32)):re("",!0)]))}}),Wr=dt(_R,[["__scopeId","data-v-3dce23a4"]]),wR={class:"sd-head"},SR=["placeholder","aria-label"],CR=["aria-selected","onClick","onMousemove"],AR={class:"sd-meta"},MR=["innerHTML"],ER={class:"sd-time"},TR=["innerHTML"],NR=["innerHTML"],IR={key:1,class:"sd-empty"},$R={class:"sd-hint"},LR=200,FR=Ge({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q(!0),r=Q(""),l=Q(null),a=Q(null),c=D(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",A=v.lastPrompt??"",L=v.workspaceName??"",$=k.length>0&&y.toLowerCase().includes(k),_=k.length>0&&A.toLowerCase().includes(k),E=k.length>0&&L.toLowerCase().includes(k);if(!(k.length>0&&!$&&!_&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?EI(A,r.value):""}),g.length>=LR))break}return g}),u=Q(0);Ze(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(k){u.value=d(u.value+k),f()}function p(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&p(k.session.id)}function x(k){k.key==="ArrowDown"?(k.preventDefault(),h(1)):k.key==="ArrowUp"?(k.preventDefault(),h(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return gn(()=>{l.value?.focus()}),(k,g)=>(b(),be(Wr,{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:Me(()=>[w("div",wR,[ie(qe,{class:"sd-search-icon",name:"search",size:"md"}),Rn(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:x},null,40,SR),[[wo,r.value]])])]),foot:Me(()=>[w("span",$R,O(C(n)("sidebar.searchHint")),1)]),default:Me(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(b(!0),T(Be,{key:0},st(c.value,(v,y)=>(b(),T("button",{key:v.session.id,class:Pe(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>p(v.session.id),onMousemove:A=>u.value=y},[w("span",AR,[ie(qe,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(r0)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,MR),w("span",ER,O(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(r0)(v.session.title,v.inTitle?r.value:"")},null,8,TR),v.snippetText?(b(),T("span",{key:0,class:"sd-snippet",innerHTML:C(r0)(v.snippetText,r.value)},null,8,NR)):re("",!0)],42,CR))),128)):(b(),T("div",IR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),OR=dt(FR,[["__scopeId","data-v-a678f802"]]),RR=["aria-label"],BR=Ge({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(b(),T("span",{class:Pe(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,RR))}}),Ho=dt(BR,[["__scopeId","data-v-e5c5b17d"]]),DR={key:0,class:"ui-badge__dot","aria-hidden":"true"},PR=Ge({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),T("span",{class:Pe(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),T("span",DR)):re("",!0),Bn(t.$slots,"default",{},void 0,!0)],2))}}),Fo=dt(PR,[["__scopeId","data-v-5bc5cd6d"]]),wd=Q(null);function pA(e){const t=wd.value;t&&(wd.value=null,t.resolve(e))}function HR(e){return wd.value&&pA(!1),new Promise(t=>{wd.value={...e,resolve:t}})}function zr(){return{current:wd,confirm:HR,settle:pA}}const WR=Ge({__name:"Menu",setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),T("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Bn(s.$slots,"default",{},void 0,!0)],512))}}),vl=dt(WR,[["__scopeId","data-v-60e6cd8d"]]),zR={key:0,class:"ui-menu-sep",role:"separator"},UR=["disabled"],qR=Ge({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(b(),T("div",zR)):(b(),T("button",{key:1,class:Pe(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Bn(t.$slots,"default",{},void 0,!0)],10,UR))}}),pn=dt(qR,[["__scopeId","data-v-f940771a"]]),el=6,tl=8,jR=150,VR=Ge({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Q(),s=Q(),o=Q(!1),i=Q(!1),r=Q({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const x=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&x.top-el-g<tl?A="bottom":A==="bottom"&&x.bottom+el+g>y-tl?A="top":A==="left"&&x.left-el-k<tl?A="right":A==="right"&&x.right+el+k>v-tl&&(A="left");let L=0,$=0;A==="top"?(L=x.top-el-g,$=x.left+x.width/2-k/2):A==="bottom"?(L=x.bottom+el,$=x.left+x.width/2-k/2):A==="left"?(L=x.top+x.height/2-g/2,$=x.left-el-k):(L=x.top+x.height/2-g/2,$=x.right+el),$=Math.min(Math.max($,tl),v-tl-k),L=Math.min(Math.max(L,tl),y-tl-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},jR))}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 gn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const x=m.firstElementChild??null;x!==a&&(f(),p(x??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ps(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,x)=>(b(),T(Be,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Bn(m.$slots,"default",{},void 0,!0)],512),(b(),be(rm,{to:"body"},[Rn(w("div",{ref_key:"bubble",ref:s,class:Pe(["ui-tip__bubble",{positioned:i.value}]),style:Yt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[yi,o.value]])]))],64))}}),Zt=dt(VR,[["__scopeId","data-v-4c261eb6"]]),KR={class:"row"},GR={class:"lead","aria-hidden":"true"},YR={key:1,class:"unread-dot"},ZR={class:"left"},QR=["onKeydown"],XR={class:"act"},JR={class:"ts"},eB={class:"menu-time"},tB=Ge({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:s}=Tt(),{confirm:o}=zr(),i=e,r=n;function l(I){const R=new Date(I);if(Number.isNaN(R.getTime()))return I;const B=P=>String(P).padStart(2,"0");return`${R.getFullYear()}-${B(R.getMonth()+1)}-${B(R.getDate())} ${B(R.getHours())}:${B(R.getMinutes())}`}const a=D(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Q(!1),u=Q(null),d=Q(null),f=Q({});function h(I){const R=I.target;d.value?.el?.contains(R)||u.value?.el?.contains(R)||x()}function p(){const I=u.value?.el;if(!I)return;const R=d.value?.el,B=I.getBoundingClientRect(),P=4,z=8,W=R?.offsetHeight??0,X=R?.offsetWidth??0;let U=B.bottom+P;U+W>window.innerHeight-z&&(U=Math.max(z,B.top-W-P));let Z=B.right-X;Z<z&&(Z=z),f.value={top:`${Math.round(U)}px`,left:`${Math.round(Z)}px`}}async function m(I){if(I.stopPropagation(),c.value){x();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",x),await gt(),p()}function x(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",x)}_n(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",x)});const k=Q(!1),g=Q(""),v=Q(null);async function y(){x(),k.value=!0,g.value=i.session.title,await gt();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const I=g.value.trim();I&&r("rename",i.session.id,I),k.value=!1}function L(){k.value=!1}const $=Q(!1),_=Q(!1);async function E(){const I=await oo(i.session.id);$.value=I,_.value=!I,setTimeout(()=>{$.value=!1,_.value=!1,x()},1500)}function N(){x(),r("fork",i.session.id)}function F(){x(),r("export",i.session.id)}async function S(){x(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:x}),(I,R)=>(b(),T("div",{class:Pe(["se",{on:e.active}]),onClick:R[4]||(R[4]=B=>r("select",e.session.id))},[w("div",KR,[w("span",GR,[e.session.busy?(b(),be(Ho,{key:0,size:"sm"})):e.unread?(b(),T("span",YR)):re("",!0)]),w("div",ZR,[k.value?Rn((b(),T("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":R[0]||(R[0]=B=>g.value=B),class:"rename-input",onClick:R[1]||(R[1]=xt(()=>{},["stop"])),onKeydown:[Ji(xt(A,["stop"]),["enter"]),Ji(xt(L,["stop"]),["esc"])],onBlur:A},null,40,QR)),[[wo,g.value]]):(b(),T("span",{key:1,class:"t",onDblclick:xt(y,["stop"])},O(e.session.title),33))]),ie(Zt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Me(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(b(),be(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Qe(O(C(s)("workspace.awaitingAnswer")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Zt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Me(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(b(),be(Fo,{key:0,variant:"warning",size:"sm"},{default:Me(()=>[Qe(O(C(s)("workspace.awaitingPermission")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Zt,{text:C(s)("workspace.abortedTitle")},{default:Me(()=>[!k.value&&e.session.status==="aborted"?(b(),be(Fo,{key:0,variant:"danger",size:"sm"},{default:Me(()=>[Qe(O(C(s)("workspace.aborted")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),w("span",XR,[w("span",JR,O(e.session.time),1),k.value?re("",!0):(b(),be(Wn,{key:0,ref_key:"kebabRef",ref:u,class:Pe(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:R[2]||(R[2]=xt(B=>m(B),["stop"]))},{default:Me(()=>[ie(qe,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(b(),be(rm,{to:"body"},[c.value?(b(),be(vl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Yt(f.value),onClick:R[3]||(R[3]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{danger:_.value,onClick:E},{default:Me(()=>[ie(qe,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Qe(" "+O(_.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(pn,{separator:""}),ie(pn,{onClick:y},{default:Me(()=>[ie(qe,{name:"pencil",size:"sm"}),Qe(" "+O(C(s)("sidebar.rename")),1)]),_:1}),ie(pn,{onClick:N},{default:Me(()=>[ie(qe,{name:"git-fork",size:"sm"}),Qe(" "+O(C(s)("sidebar.fork")),1)]),_:1}),ie(pn,{onClick:F},{default:Me(()=>[ie(qe,{name:"download",size:"sm"}),Qe(" "+O(C(s)("sidebar.export")),1)]),_:1}),ie(pn,{danger:"",onClick:S},{default:Me(()=>[ie(qe,{name:"archive",size:"sm"}),Qe(" "+O(C(s)("sidebar.archive")),1)]),_:1}),ie(pn,{separator:""}),w("div",eB,O(a.value),1)]),_:1},8,["style"])):re("",!0)]))],2))}}),nB=dt(tB,[["__scopeId","data-v-f34e9e88"]]),sB={class:"gh-top"},oB={class:"gh-name"},iB=["inert"],rB=["disabled"],lB={class:"show-more-label"},aB={class:"show-more-label"},cB={key:2,class:"group-empty"},uB=Ge({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Tt(),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)=>(b(),T("div",{class:Pe(["group",{dragging:e.dragging}])},[w("div",{class:Pe(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=xt(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"))},[w("div",sB,[e.isCollapsed(e.group.workspace.id)?(b(),be(qe,{key:0,class:"gh-folder",name:"folder-closed"})):(b(),be(qe,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(b(),be(Zt,{key:2,text:e.group.workspace.root},{default:Me(()=>[w("span",oB,O(e.group.workspace.name),1)]),_:1},8,["text"])):Rn((b(),T("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=Ji(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=Ji(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=xt(()=>{},["stop"]))},null,544)),[[wo,i.value]]),e.renamingId!==e.group.workspace.id?(b(),T("div",{key:4,class:Pe(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Wn,{class:Pe(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=xt(p=>o("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Me(()=>[ie(qe,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Wn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=xt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Me(()=>[ie(qe,{name:"chat-new"})]),_:1},8,["label"])],2)):re("",!0)])],34),w("div",{class:Pe(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(b(!0),T(Be,null,st(r.value,p=>(b(),be(nB,{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,x)=>o("renameSession",m,x)),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?(b(),T("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=xt(p=>o("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",lB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,rB)):re("",!0),l.value?(b(),T("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=xt(p=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",aB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):re("",!0),e.group.sessions.length===0?(b(),T("div",cB,O(C(n)("sidebar.noSessions")),1)):re("",!0)],10,iB)],2))}}),dB=dt(uB,[["__scopeId","data-v-cdac739a"]]),fB="kimi_desktop",hB="platform",o_="kimi-desktop",i_="kimi-desktop-platform";function pB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(fB)?(sessionStorage.setItem(o_,"1"),e=!0):e=e||sessionStorage.getItem(o_)==="1";const s=n.get(hB);s?(sessionStorage.setItem(i_,s),t=s):t=sessionStorage.getItem(i_)}catch{}return{isDesktop:e,platform:t}}const Xg=pB(),mB=Xg.isDesktop,Fc=Xg.isDesktop&&Xg.platform==="darwin",gB={class:"ui-kbd"},vB=Ge({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),T("span",gB,[(b(!0),T(Be,null,st(e.keys,s=>(b(),T("kbd",{key:s,class:"ui-kbd__key"},O(s),1))),128))]))}}),mr=dt(vB,[["__scopeId","data-v-32292ed8"]]),yB=["disabled","aria-pressed"],kB=Ge({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(b(),T("button",{key:0,class:Pe(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Bn(t.$slots,"default",{},void 0,!0)],10,yB)):(b(),T("span",{key:1,class:Pe(["ui-pill",{"is-active":e.active}])},[Bn(t.$slots,"default",{},void 0,!0)],2))}}),hh=dt(kB,[["__scopeId","data-v-317ace1a"]]),bB={class:"ch"},xB={class:"ch-brand"},_B={class:"ch-backend-ep"},wB={class:"btn-wrap"},SB={class:"search-input"},CB={key:0,class:"empty"},AB={class:"side-section-label"},MB={class:"side-section-title"},EB={class:"side-section-actions"},TB=["onDragover","onDrop"],NB={class:"side-footer"},IB={class:"section-menu-check"},$B={class:"section-menu-check"},LB={class:"section-menu-check"},FB={class:"backend-menu-name"},OB={class:"backend-menu-url"},RB=1e3,BB=Ge({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=zr(),o=!1,i=Q(null),r=D(()=>""),l=["default","multi"];function a(Ye){const je=i.value?.presets[Ye]??"";return je?bI(je):""}function c(Ye){const je=i.value;return je!==null&&je.current===je.presets[Ye]}const u=e,d=t,f=Q(!1),h=x()?["⌘","K"]:["Ctrl","K"];function p(){d("loadAllSessions"),f.value=!0}function m(Ye){(Ye.metaKey||Ye.ctrlKey)&&Ye.key.toLowerCase()==="k"&&(Ye.preventDefault(),p())}gn(()=>window.addEventListener("keydown",m)),ps(()=>window.removeEventListener("keydown",m));function x(){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 k=Q(!1);function g(Ye){k.value=Ye.target.scrollTop>0}const v=Q(new Set(rI()));function y(Ye){return v.value.has(Ye)}function A(Ye){const je=new Set(v.value);je.has(Ye)?je.delete(Ye):je.add(Ye),v.value=je,i0(je)}function L(){const Ye=new Set(u.groups.map(je=>je.workspace.id));v.value=Ye,i0(Ye)}function $(){const Ye=new Set;v.value=Ye,i0(Ye)}const _=D(()=>u.groups.length>0&&u.groups.every(Ye=>v.value.has(Ye.workspace.id))),E=Q(new Set);function N(Ye){return E.value.has(Ye)}function F(Ye){const je=new Set(E.value);je.has(Ye)?je.delete(Ye):je.add(Ye),E.value=je}function S(Ye){if(!E.value.has(Ye)){const je=new Set(E.value);je.add(Ye),E.value=je}d("loadMoreSessions",Ye)}const I=Q(null),R=Q(null);function B(Ye){I.value=Ye}function P(){I.value=null,R.value=null}function z(Ye){const je=Ye.currentTarget.getBoundingClientRect();return Ye.clientY<je.top+je.height/2?"before":"after"}function W(Ye,je){I.value===null||I.value===je||(Ye.preventDefault(),Ye.dataTransfer&&(Ye.dataTransfer.dropEffect="move"),R.value={id:je,position:z(Ye)})}function X(Ye){const je=I.value,Ot=R.value?.id===Ye?R.value.position:"before";if(R.value=null,I.value=null,!je||je===Ye)return;const Ht=SI(u.groups.map(dn=>dn.workspace.id),je,Ye,Ot);d("reorderWorkspaces",Ht)}function U(Ye,je){je.target.closest(".gh-more, .gh-add")||A(Ye)}function Z(Ye){d("select",Ye)}const ce=Q(null),fe=Q(""),se=Q(null);function Y(){return se}function J(Ye,je){ce.value=Ye,fe.value=je,gt().then(()=>se.value?.focus())}function le(){const Ye=ce.value,je=fe.value.trim();Ye&&je&&d("renameWorkspace",Ye,je),ce.value=null}function He(){ce.value=null}function de(Ye){fe.value=Ye}const G=Q(!1),ae=Q(null),me=Q({}),q=Q(null);function ne(Ye){q.value?.el&&!q.value.el.contains(Ye.target)&&ue()}function ge(Ye,je){je.preventDefault(),je.stopPropagation(),ae.value=Ye,me.value={top:`${je.clientY}px`,left:`${je.clientX}px`},G.value=!0,document.addEventListener("mousedown",ne,!0)}function ue(){G.value=!1,document.removeEventListener("mousedown",ne,!0),ae.value=null}function ye(){ae.value&&oo(ae.value.root),ue()}function j(){ae.value&&J(ae.value.id,ae.value.name),ue()}async function te(){const Ye=ae.value;Ye&&(ue(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ye.name}),variant:"danger"})&&d("deleteWorkspace",Ye.id))}const pe=Q(null),Ce=Q(null),Ie=Q({}),$e=Q(null);function he(Ye){const je=Ye.target;je.closest(".gh-more")||je.closest(".ws-menu")||Je()}async function Ne(Ye,je){if(pe.value===Ye.id){Je();return}const Ot=je.currentTarget;Ce.value=Ye,pe.value=Ye.id,document.addEventListener("mousedown",he),window.addEventListener("resize",Je),await gt();const Ht=$e.value?.el,dn=Ot.getBoundingClientRect(),Qt=4,Sn=8,Cn=Ht?.offsetHeight??0,Nt=Ht?.offsetWidth??0;let fs=dn.bottom+Qt;fs+Cn>window.innerHeight-Sn&&(fs=Math.max(Sn,dn.top-Cn-Qt));let ns=dn.right-Nt;ns<Sn&&(ns=Sn),Ie.value={top:`${Math.round(fs)}px`,left:`${Math.round(ns)}px`}}function Je(){pe.value=null,Ce.value=null,document.removeEventListener("mousedown",he),window.removeEventListener("resize",Je)}function it(Ye){oo(Ye.root),Je()}function At(Ye){J(Ye.id,Ye.name),Je()}async function bt(Ye){Je(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ye.name}),variant:"danger"})&&d("deleteWorkspace",Ye.id)}const wt=Q(!1),Gt=Q({}),vt=Q(null);function ln(Ye){const je=Ye.target;je.closest(".side-section-kebab")||je.closest(".section-menu")||Un()}async function Gn(Ye){if(wt.value){Un();return}const je=Ye.currentTarget;wt.value=!0,document.addEventListener("mousedown",ln),window.addEventListener("resize",Un),await gt();const Ot=vt.value?.el,Ht=je.getBoundingClientRect(),dn=4,Qt=8,Sn=Ot?.offsetHeight??0,Cn=Ot?.offsetWidth??0;let Nt=Ht.bottom+dn;Nt+Sn>window.innerHeight-Qt&&(Nt=Math.max(Qt,Ht.top-Sn-dn));let fs=Ht.right-Cn;fs<Qt&&(fs=Qt),Gt.value={top:`${Math.round(Nt)}px`,left:`${Math.round(fs)}px`}}function Un(){wt.value=!1,document.removeEventListener("mousedown",ln),window.removeEventListener("resize",Un)}function Vt(Ye){d("setWorkspaceSortMode",Ye),Un()}const an=Q(!1),es=Q({}),rt=Q(null);function In(Ye){const je=Ye.target;je.closest(".ch-backend")||je.closest(".backend-menu")||yn()}async function gs(Ye){if(i.value===null)return;if(an.value){yn();return}const je=Ye.currentTarget;an.value=!0,document.addEventListener("mousedown",In),window.addEventListener("resize",yn),await gt();const Ot=rt.value?.el,Ht=je.getBoundingClientRect(),dn=4,Qt=8,Sn=Ot?.offsetHeight??0;let Cn=Ht.bottom+dn;Cn+Sn>window.innerHeight-Qt&&(Cn=Math.max(Qt,Ht.top-Sn-dn)),es.value={top:`${Math.round(Cn)}px`,left:`${Math.round(Math.max(Qt,Ht.left))}px`}}function yn(){an.value=!1,document.removeEventListener("mousedown",In),window.removeEventListener("resize",yn)}async function us(Ye){if(c(Ye)){yn();return}if(await kI(Ye)===null){yn();return}window.location.reload()}ps(()=>{document.removeEventListener("mousedown",ne,!0),document.removeEventListener("mousedown",he),document.removeEventListener("mousedown",ln),document.removeEventListener("mousedown",In),window.removeEventListener("resize",Je),window.removeEventListener("resize",Un),window.removeEventListener("resize",yn)});const ts=Q(null);let kn;function qn(){const Ye=ts.value;Ye&&(Ye.classList.remove("blink-now"),Ye.getBoundingClientRect(),Ye.classList.add("blink-now"),clearTimeout(kn),kn=setTimeout(()=>Ye.classList.remove("blink-now"),300))}const $n=$i(()=>mo(()=>import("./DesignSystemView-CNbvXMLA.js"),__vite__mapDeps([0,1]))),ds=Q(!1);let Fs,wn=!1;function As(Ye){wn=!1,clearTimeout(Fs),Ye.currentTarget.setPointerCapture?.(Ye.pointerId),Fs=setTimeout(()=>{wn=!0,ds.value=!0},RB)}function zn(Ye){clearTimeout(Fs);const je=Ye.currentTarget;je.hasPointerCapture?.(Ye.pointerId)&&je.releasePointerCapture(Ye.pointerId)}function Pt(){if(wn){wn=!1;return}qn()}return ps(()=>{clearTimeout(Fs)}),(Ye,je)=>(b(),T("aside",{class:Pe(["side",{"macos-desktop":C(Fc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Yt({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:Yt({width:e.colWidth+"px"})},[w("div",bB,[w("div",xB,[C(Fc)?re("",!0):(b(),T(Be,{key:0},[(b(),T("svg",{ref_key:"logoRef",ref:ts,class:Pe(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Pt,onPointerdown:As,onPointerup:zn,onPointercancel:zn},[...je[22]||(je[22]=[xy('<defs data-v-00288d28><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-00288d28><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-00288d28></rect><g class="ch-eyes" fill="#000" data-v-00288d28><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-00288d28></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-00288d28></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-00288d28></rect>',2)])],34)),je[23]||(je[23]=w("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(b(),be(hh,{key:0,class:"ch-backend",clickable:i.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:r.value}),onClick:gs},{default:Me(()=>[w("span",{class:Pe(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),w("span",_B," · "+O(r.value),1),i.value!==null?(b(),be(qe,{key:0,name:"chevron-down",size:"sm"})):re("",!0)]),_:1},8,["clickable","title"])):re("",!0)],64))]),C(Fc)?re("",!0):(b(),be(Wn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:je[0]||(je[0]=xt(Ot=>d("collapse"),["stop"]))},{default:Me(()=>[ie(qe,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",wB,[w("button",{class:"btn-new-chat",type:"button",onClick:je[1]||(je[1]=xt(Ot=>d("create"),["stop"]))},[ie(qe,{name:"chat-new"}),w("span",null,O(C(n)("sidebar.newChat")),1)]),re("",!0)]),w("div",{class:Pe(["search-wrap",{"search-wrap--scrolled":k.value}])},[w("button",{class:"search",type:"button",onClick:p},[ie(qe,{class:"search-icon",name:"search"}),w("span",SB,O(C(n)("sidebar.search")),1),ie(mr,{keys:C(h)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:g},[e.groups.length===0?(b(),T("div",CB,O(C(n)("workspace.noWorkspace")),1)):(b(),T(Be,{key:1},[w("div",AB,[w("span",MB,O(C(n)("sidebar.workspaces")),1),w("div",EB,[ie(Wn,{class:"side-section-toggle",size:"sm",label:_.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:je[3]||(je[3]=xt(Ot=>_.value?$():L(),["stop"]))},{default:Me(()=>[_.value?(b(),be(qe,{key:0,name:"expand"})):(b(),be(qe,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Wn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":wt.value,onClick:je[4]||(je[4]=xt(Ot=>Gn(Ot),["stop"]))},{default:Me(()=>[ie(qe,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(b(!0),T(Be,null,st(e.groups,Ot=>(b(),T("div",{key:Ot.workspace.id,class:Pe(["ws-drop-target",{"drop-before":R.value?.id===Ot.workspace.id&&R.value.position==="before","drop-after":R.value?.id===Ot.workspace.id&&R.value.position==="after"}]),onDragover:Ht=>W(Ht,Ot.workspace.id),onDrop:Ht=>X(Ot.workspace.id)},[ie(dB,{group:Ot,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":ce.value,"rename-value":fe.value,"rename-input-ref":Y(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":pe.value,dragging:I.value===Ot.workspace.id,"is-collapsed":y,"is-expanded":N,onGroupClick:U,onGroupContextmenu:ge,onToggleWsMenu:Ne,onCreateInWorkspace:je[5]||(je[5]=Ht=>d("createInWorkspace",Ht)),onSelectSession:Z,onRenameSession:je[6]||(je[6]=(Ht,dn)=>d("rename",Ht,dn)),onArchiveSession:je[7]||(je[7]=Ht=>d("archive",Ht)),onForkSession:je[8]||(je[8]=Ht=>d("fork",Ht)),onExportSession:je[9]||(je[9]=Ht=>d("export",Ht)),onLoadMore:S,onToggleExpand:F,onConfirmRename:le,onCancelRename:He,onUpdateRenameValue:de,onWsDragstart:B,onWsDragend:P},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,TB))),128))],64))],32),w("div",NB,[w("button",{class:"btn-settings",type:"button",onClick:je[10]||(je[10]=xt(Ot=>d("openSettings"),["stop"]))},[ie(qe,{name:"settings"}),w("span",null,O(C(n)("settings.title")),1)])])],4),G.value?(b(),be(vl,{key:0,ref_key:"ghMenuRef",ref:q,class:"gh-menu",style:Yt(me.value),onClick:je[11]||(je[11]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{onClick:ye},{default:Me(()=>[Qe(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(pn,{onClick:j},{default:Me(()=>[Qe(O(C(n)("sidebar.rename")),1)]),_:1}),ie(pn,{danger:"",onClick:te},{default:Me(()=>[Qe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),pe.value!==null&&Ce.value?(b(),be(vl,{key:1,ref_key:"wsMenuRef",ref:$e,class:"ws-menu",style:Yt(Ie.value),onClick:je[15]||(je[15]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{onClick:je[12]||(je[12]=Ot=>it(Ce.value))},{default:Me(()=>[Qe(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(pn,{separator:""}),ie(pn,{onClick:je[13]||(je[13]=Ot=>At(Ce.value))},{default:Me(()=>[Qe(O(C(n)("sidebar.rename")),1)]),_:1}),ie(pn,{separator:""}),ie(pn,{danger:"",onClick:je[14]||(je[14]=Ot=>bt(Ce.value))},{default:Me(()=>[Qe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),wt.value?(b(),be(vl,{key:2,ref_key:"sectionMenuRef",ref:vt,class:"section-menu",style:Yt(Gt.value),onClick:je[18]||(je[18]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{onClick:je[16]||(je[16]=Ot=>Vt("manual"))},{default:Me(()=>[w("span",IB,[e.workspaceSortMode==="manual"?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),Qe(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),ie(pn,{onClick:je[17]||(je[17]=Ot=>Vt("recent"))},{default:Me(()=>[w("span",$B,[e.workspaceSortMode==="recent"?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),Qe(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):re("",!0),an.value?(b(),be(vl,{key:3,ref_key:"backendMenuRef",ref:rt,class:"backend-menu",style:Yt(es.value),onClick:je[19]||(je[19]=xt(()=>{},["stop"]))},{default:Me(()=>[(b(),T(Be,null,st(l,Ot=>ie(pn,{key:Ot,onClick:Ht=>us(Ot)},{default:Me(()=>[w("span",LB,[c(Ot)?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",FB,O(Ot),1),w("span",OB,O(a(Ot)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):re("",!0),f.value?(b(),be(OR,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:Z,onClose:je[20]||(je[20]=Ot=>f.value=!1)},null,8,["sessions","active-id"])):re("",!0),(b(),be(rm,{to:"body"},[ds.value?(b(),be(C($n),{key:0,onClose:je[21]||(je[21]=Ot=>ds.value=!1)})):re("",!0)]))],6))}}),DB=dt(BB,[["__scopeId","data-v-00288d28"]]);function PB(e){try{const t=cs(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function HB(e,t){try{ms(e,String(t))}catch{}}function WB(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(A4(o),Math.max(s,Math.round(k))):n}const l=Q(r(PB(t)??n)),a=Q(!1);function c(k){const g=r(k);l.value=g,HB(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 x(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 ps(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:x}}const zB=["aria-label"],UB=Ge({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),{width:i,dragging:r,onPointerDown:l}=WB({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ze(i,a=>s("update:width",a)),Ze(r,a=>s("update:dragging",a)),(a,c)=>(b(),T("div",{class:Pe(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,zB))}}),r_=dt(UB,[["__scopeId","data-v-ad762f1c"]]),qB={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},jB={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},VB={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},KB={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},GB={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"}},YB={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},ZB={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},QB={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},XB={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},JB={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},eD={justNow:"just now"},tD={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"},nD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},sD={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"},oD={panelTitle:"Thinking",close:"Close"},iD={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"},rD={},lD={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},aD={searching:"Searching…",noMatch:"No matches"},cD={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},uD={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},dD={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},fD={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},hD={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},pD={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},mD={preview:"预览",confirm:"确认",cancel:"取消"},gD={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},vD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},yD={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},kD={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:"收起"}},bD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},xD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · 思考: {level}"},_D={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},wD={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},SD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},CD={justNow:"刚刚"},AD={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:"拒绝并退出"},MD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},ED={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:"展开"},TD={panelTitle:"思考过程",close:"关闭"},ND={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},ID={},$D={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},LD={searching:"搜索中…",noMatch:"无匹配"},FD={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},OD={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},RD={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},BD={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},DD={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},PD={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},HD={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},WD={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},zD={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},UD={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},qD={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"},jD={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:"导出会话"},VD={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"},KD={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},GD={en:{common:qB,app:jB,sidebar:VB,workspace:KB,conversation:GB,status:YB,composer:ZB,login:QB,providers:XB,model:JB,sessions:eD,approval:tD,question:nD,tasks:sD,thinking:oD,diff:iD,fileTree:rD,filePreview:lD,mention:aD,warnings:cD,commands:uD,tools:dD,layout:fD,mobile:hD,theme:pD,onboarding:HD,settings:zD,header:qD,sideChat:VD},zh:{common:mD,app:gD,sidebar:vD,workspace:yD,conversation:kD,status:bD,composer:xD,login:_D,providers:wD,model:SD,sessions:CD,approval:AD,question:MD,tasks:ED,thinking:TD,diff:ND,fileTree:ID,filePreview:$D,mention:LD,warnings:FD,commands:OD,tools:RD,layout:BD,mobile:DD,theme:PD,onboarding:WD,settings:UD,header:jD,sideChat:KD}},mA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function YD(){const e=cs(Lt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const En=GN({legacy:!1,locale:YD(),fallbackLocale:"en",messages:GD});function gA(e){En.global.locale.value=e,ms(Lt.locale,e)}const to=En.global.t,ZD={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},QD={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function Ia(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return QD[t]??t}function $a(e){const t=ZD[Ia(e)];return t?to(t):e}const XD={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function pm(e){const t=Ia(e);let n=XD[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),hc(n,"sm")}const vA=80;function JD(e,t=vA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function eP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function tP(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 Xt(e){return typeof e=="string"&&e.length>0?e:void 0}function ul(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function nP(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function l0(e){return Xt(e.path)??Xt(e.file_path)??Xt(e.filePath)??Xt(e.filename)}const sP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function oP(e){const t=Xt(e);if(!t)return;const n=sP[t];return n?to(n):t}function iP(e){const t=ul(e.value),n=Xt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return to("tools.goal.turns",{value:t});case"tokens":return to("tools.goal.tokens",{value:t});case"milliseconds":return to("tools.goal.milliseconds",{value:t});case"seconds":return to("tools.goal.seconds",{value:t});case"minutes":return to("tools.goal.minutes",{value:t});case"hours":return to("tools.goal.hours",{value:t});default:return to("tools.goal.budget",{value:t,unit:n})}}const rP=64;function Sd(e,t,n=!1){const s=(o,i=vA)=>n?o.trim():JD(o,i);try{const o=tP(t);if(!n&&eP(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Ia(e)){case"read":{const r=l0(o);if(!r)return i();const l=ul(o.offset)??ul(o.line_start)??ul(o.start_line),a=ul(o.limit)??ul(o.length),c=ul(o.line_end)??ul(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=l0(o);return r?s(`${r} ${to("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=l0(o);return r?s(r):i()}case"bash":{const r=Xt(o.command)??Xt(o.cmd)??Xt(o.script);return r?s(r,rP):i()}case"grep":case"search":{const r=Xt(o.pattern)??Xt(o.query)??Xt(o.regex),l=Xt(o.path)??Xt(o.glob)??Xt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Xt(o.pattern)??Xt(o.glob)??Xt(o.query),l=Xt(o.path)??Xt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Xt(o.path)?s(Xt(o.path)):i()}case"ls":{const r=Xt(o.path)??Xt(o.dir)??Xt(o.directory)??Xt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Xt(o.url)??Xt(o.uri);return r?s(nP(r)):i()}case"todo":case"task":{const r=Xt(o.description)??Xt(o.title)??Xt(o.prompt)??Xt(o.name)??Xt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(to("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Xt(o.objective),l=Xt(o.completionCriterion);return r&&l?s(to("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?s(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=iP(o);return r?s(r):i()}case"updategoal":{if(n)return i();const r=oP(o.status);return r?s(to("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function lP(e){try{switch(Ia(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return to("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return to("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?to("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const aP=Ge({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=D(()=>n(t.status));return(o,i)=>(b(),T("span",{class:Pe(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),Cd=dt(aP,[["__scopeId","data-v-e36198e5"]]),cP=["innerHTML"],uP={class:"bh-text"},dP={class:"a"},fP={key:0,class:"p"},hP={class:"rt"},pP=["aria-label"],mP={key:0,class:"tm"},gP=["inert"],vP={class:"bb-pad"},yP=Ge({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,s=Kt("pinScroll",()=>{}),o=Q(null);function i(){n("toggle");const r=o.value;r&>(()=>s(r))}return(r,l)=>(b(),T("div",{class:Pe(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[w("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(b(),T("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,cP)):re("",!0),w("span",uP,[w("span",dP,O(e.name),1),ie(Zt,{text:e.arg},{default:Me(()=>[e.arg?(b(),T("span",fP,O(e.arg),1)):re("",!0)]),_:1},8,["text"])]),w("span",hP,[w("span",{class:Pe(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(b(),be(qe,{key:0,name:"check",size:"sm"})):e.status==="error"?(b(),be(qe,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(b(),be(Cd,{key:2,status:"suspended"})):(b(),be(Cd,{key:3,status:"running"}))],10,pP),Bn(r.$slots,"trailing"),e.time?(b(),T("span",mP,O(e.time),1)):re("",!0)]),e.expandable?(b(),be(qe,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):re("",!0)],512),w("div",{class:Pe(["bb",{open:e.open}]),inert:!e.open},[w("div",vP,[Bn(r.$slots,"default")])],10,gP)],2))}}),mm=dt(yP,[["__scopeId","data-v-fef8aad2"]]),kP={key:0,class:"at-type"},bP={key:1,class:"at-task"},xP={key:2,class:"bb-code"},_P=Ge({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=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=Q(s.tool.defaultExpanded===!0&&a.value),u=D(()=>s.tool.status),d=D(()=>$a(s.tool.name)),f=D(()=>pm(s.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=Kt("resolveAgentTaskId"),m=D(()=>p?p(s.tool.id)!==void 0:!0);function x(){a.value&&(c.value=!c.value)}return Ze(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(b(),be(mm,{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:x},{trailing:Me(()=>[m.value?(b(),T("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=xt(v=>o("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):re("",!0)]),default:Me(()=>[r.value.subagentType?(b(),T("div",kP,O(r.value.subagentType),1)):re("",!0),r.value.prompt?(b(),T("div",bP,O(r.value.prompt),1)):re("",!0),l.value?(b(),T("div",xP,[(b(!0),T(Be,null,st(e.tool.output??[],(v,y)=>(b(),T("div",{key:y},O(v),1))),128))])):re("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),wP=dt(_P,[["__scopeId","data-v-14ef8750"]]);function SP(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 Bf={recognized:!1,answers:{},note:""};function CP(e){const t=e?.[0];if(!t)return Bf;let n;try{n=JSON.parse(t)}catch{return Bf}if(!n||typeof n!="object"||Array.isArray(n))return Bf;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return Bf;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 AP(e,t,n){return e[t]??e[`q_${n}`]}const MP=/^opt_\d+_(\d+)$/;function EP(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=MP.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const TP={key:0,class:"chip"},NP={key:0,class:"au-dismissed"},IP={key:1,class:"au-list"},$P={class:"au-q"},LP={key:0,class:"au-hdr"},FP={class:"au-qtext"},OP={class:"au-opts"},RP={class:"au-glyph"},BP={class:"au-label"},DP={key:0,class:"au-desc"},PP={key:0,class:"au-opt sel"},HP={class:"au-glyph"},WP={class:"au-label"},zP={key:1,class:"au-opt sel"},UP={class:"au-label"},qP={key:2,class:"au-raw"},jP=80,VP=Ge({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Tt();function s($,_=jP){const E=$.trim();return E.length>_?E.slice(0,_-1)+"…":E}const o=D(()=>SP(t.tool.arg)),i=D(()=>CP(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(($,_)=>EP(AP(i.value.answers,$.question,_),$.options))),c=D(()=>Object.keys(i.value.answers).length);function u($,_){return a.value[$]?.selected.has(_)??!1}function d($){return a.value[$]?.otherText??""}function f($){return a.value[$]?.indeterminate??!1}function h($,_){return $?_?"■":"□":_?"●":"○"}const p=D(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const $=o.value[0]?.question??"",_=s($);return o.value.length<=1?_:`${_} ${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}):""),x=D(()=>!!t.tool.output&&t.tool.output.length>0),k=D(()=>r.value&&(o.value.length>0||l.value)||x.value),g=Q(t.tool.defaultExpanded===!0&&k.value),v=D(()=>t.tool.status),y=D(()=>$a(t.tool.name)),A=D(()=>pm(t.tool.name));function L(){k.value&&(g.value=!g.value)}return Ze(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),($,_)=>(b(),be(mm,{status:v.value,icon:A.value,name:y.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:L},{trailing:Me(()=>[m.value?(b(),T("span",TP,O(m.value),1)):re("",!0)]),default:Me(()=>[l.value?(b(),T("div",NP,O(i.value.note),1)):r.value?(b(),T("div",IP,[(b(!0),T(Be,null,st(o.value,(E,N)=>(b(),T("div",{key:N,class:"au-block"},[w("div",$P,[E.header?(b(),T("span",LP,O(E.header),1)):re("",!0),w("span",FP,O(E.question),1)]),w("div",OP,[(b(!0),T(Be,null,st(E.options,(F,S)=>(b(),T("div",{key:S,class:Pe(["au-opt",{sel:u(N,S)}])},[w("span",RP,O(h(E.multiSelect,u(N,S))),1),w("span",BP,O(F.label),1),F.description?(b(),T("span",DP,O(F.description),1)):re("",!0)],2))),128)),d(N)?(b(),T("div",PP,[w("span",HP,O(h(E.multiSelect,!0)),1),w("span",WP,O(d(N)),1)])):re("",!0),f(N)?(b(),T("div",zP,[_[0]||(_[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",UP,O(C(n)("tools.ask.answered")),1)])):re("",!0)])]))),128))])):(b(),T("div",qP,[(b(!0),T(Be,null,st(e.tool.output??[],(E,N)=>(b(),T("div",{key:N},O(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),KP=dt(VP,[["__scopeId","data-v-a9a0f259"]]),GP=1e6,l_=5e3;function a_(e){if(e==="")return[];const t=e.split(`
|
|
68
|
-
`);return t.at(-1)===""&&t.pop(),t}function YP(e,t){const n=a_(e),s=a_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>l_||i>l_||(o+1)*(i+1)>GP)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=o;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===s[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=o,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===s[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:s[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function ZP(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}function yA(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 kA(e){const t=Ia(e.name);if(t!=="edit"&&t!=="write")return null;const n=yA(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:YP(s,o)}return null}function QP(e){const t=yA(e);return t&&typeof t.path=="string"?t.path:void 0}function XP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const JP={key:0,class:"bb-empty"},c_=50,eH=Ge({__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)=>(b(),T("div",{class:Pe(["bb-code tool-output-block",{scroll:s.value}]),style:o},[n.value.length===0&&e.emptyText?(b(),T("div",JP,O(e.emptyText),1)):re("",!0),(b(!0),T(Be,null,st(n.value,(l,a)=>(b(),T("div",{key:a},O(l),1))),128))],2))}}),bA=dt(eH,[["__scopeId","data-v-262bbea0"]]),tH={key:0,class:"chip"},nH={key:0,class:"bb-summary"},sH=Ge({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status),i=D(()=>$a(n.tool.name)),r=D(()=>pm(n.tool.name)),l=D(()=>Sd(n.tool.name,n.tool.arg)),a=D(()=>Sd(n.tool.name,n.tool.arg,!0)),c=D(()=>kA(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:x,removed:k}=ZP(m);if(x||k)return`+${x} −${k}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=Q(!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,x)=>(b(),be(mm,{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:Me(()=>[u.value?(b(),T("span",tH,O(u.value),1)):re("",!0)]),default:Me(()=>[a.value?(b(),T("div",nH,O(a.value),1)):re("",!0),ie(bA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),oH=dt(sH,[["__scopeId","data-v-74e1da99"]]),iH={key:0,class:"chip"},rH={key:0,class:"bb-summary"},lH=Ge({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=D(()=>!!t.tool.output&&t.tool.output.length>0),o=D(()=>s.value||n.value),i=Q(t.tool.defaultExpanded===!0&&o.value),r=D(()=>t.tool.status),l=D(()=>$a(t.tool.name)),a=D(()=>pm(t.tool.name)),c=D(()=>Sd(t.tool.name,t.tool.arg)),u=D(()=>Sd(t.tool.name,t.tool.arg,!0)),d=D(()=>lP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){o.value&&(i.value=!i.value)}return Ze(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(b(),be(mm,{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:Me(()=>[d.value?(b(),T("span",iH,O(d.value),1)):re("",!0)]),default:Me(()=>[u.value?(b(),T("div",rH,O(u.value),1)):re("",!0),ie(bA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),aH=dt(lH,[["__scopeId","data-v-aa4edcb0"]]),cH={class:"media-title"},uH=["src","alt"],dH=["src"],fH=["src"],hH=Ge({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=o.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=o.value;c?.kind==="image"&&s("openMedia",c)}return(c,u)=>o.value?(b(),T("div",{key:0,class:Pe(["media-tool",{mob:e.mobile}])},[ie(Zt,{text:o.value.path||l.value},{default:Me(()=>[w("div",cH,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(b(),be(Zt,{key:0,text:o.value.path||l.value},{default:Me(()=>[w("button",{type:"button",class:"media-image-button",onClick:a},[w("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,uH)])]),_:1},8,["text"])):o.value.kind==="video"?(b(),T("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,dH)):(b(),T("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,fH))],2)):re("",!0)}}),pH=dt(hH,[["__scopeId","data-v-bec13b73"]]),mH=/<summary>([\s\S]*?)<\/summary>/,gH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,a0=/<subagent\b([^>]*)>|<\/subagent>/g,vH="</subagent>",u_=/(completed|failed|aborted):\s*(\d+)/g,d_=/([a-z_]+)="([^"]*)"/g;function yH(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function kH(e){const t={};d_.lastIndex=0;let n;for(;(n=d_.exec(e))!==null;)t[n[1]]=yH(n[2]);return t}function bH(e){const t={completed:0,failed:0,aborted:0};u_.lastIndex=0;let n;for(;(n=u_.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function xH(e,t){const n=kH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function _H(e){const t=[],n=[];a0.lastIndex=0;let s;for(;(s=a0.exec(e))!==null;)if(s[0]===vH){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(xH(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:a0.lastIndex}):n.push(null);return t}function wH(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=mH.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=bH(n),r=gH.exec(t)?.[1]?.trim(),l=_H(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 f_(e){return e?e.split(`
|
|
70
|
-
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function SH(e){return e.suspendedReason||f_(e.text)||f_(e.outputLines?.join(`
|
|
71
|
-
`))||e.summary||""}function CH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
72
|
-
`):e.summary??""}function AH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function h_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
73
|
-
`)[0]??"",phase:AH(e.outcome),body:e.body}}function MH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function EH(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:SH(o),phase:o.phase,body:CH(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>MH(i,o))).map((o,i)=>h_(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>h_(o,i))}const TH=["aria-expanded"],NH={class:"title"},IH={key:0,class:"meta"},$H={key:1,class:"sum-txt"},LH={class:"rt"},FH={class:"status"},OH={key:0,class:"chip"},RH={key:1,class:"tm"},BH={class:"body"},DH={class:"overview"},PH={class:"overview-line"},HH={class:"big"},WH={key:0,class:"lbl"},zH={key:1,class:"lbl"},UH={key:2,class:"lbl"},qH={key:0,class:"seg","aria-hidden":"true"},jH={key:1,class:"legend"},VH=["aria-expanded","onClick"],KH={class:"mname"},GH={class:"mact"},YH={class:"mphase"},ZH={key:1,class:"fallback-output"},QH={key:2,class:"waiting"},XH=Ge({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Tt(),n=e;function s(N){if(!N)return{};try{const F=JSON.parse(N),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const o=Kt("resolveSwarmMembers"),i=D(()=>s(n.tool.arg)),r=D(()=>$a(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>o?.(n.tool.id)??[]),c=D(()=>wH(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(()=>EH(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),x=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=Q(!1);function y(){v.value=!v.value}const A=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
74
|
-
`).trim()),L=Q(new Set);function $(N){const F=new Set(L.value);F.has(N)?F.delete(N):F.add(N),L.value=F}function _(N){return L.value.has(N)}function E(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(b(),T("div",{class:Pe(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[w("button",{class:"head",type:"button","aria-expanded":v.value,onClick:y},[ie(qe,{class:"ic",name:"git-pull-request",size:"sm"}),w("span",NH,O(r.value),1),l.value?(b(),T("span",IH,"·")):re("",!0),l.value?(b(),T("span",$H,O(l.value),1)):re("",!0),w("span",LH,[w("span",FH,[d.value==="ok"?(b(),be(qe,{key:0,name:"check",size:"sm"})):d.value==="error"?(b(),be(qe,{key:1,name:"close",size:"sm"})):(b(),be(Cd,{key:2,status:"running"}))]),m.value>0||p.value>0?(b(),T("span",OH,O(m.value)+" / "+O(p.value),1)):re("",!0),e.tool.timing?(b(),T("span",RH,O(e.tool.timing),1)):re("",!0)]),ie(qe,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,TH),Rn(w("div",BH,[w("div",DH,[w("div",PH,[w("span",HH,O(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(b(),T("span",WH,O(C(t)("tools.swarm.runningSub",{count:x.value})),1)):c.value?(b(),T("span",zH,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(b(),T("span",UH,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(b(),T("div",qH,[(b(!0),T(Be,null,st(g.value,S=>(b(),T("span",{key:S.phase,class:Pe(S.cls),style:Yt({flex:S.count})},null,6))),128))])):re("",!0),g.value.length>1?(b(),T("div",jH,[(b(!0),T(Be,null,st(g.value,S=>(b(),T("span",{key:S.phase},[w("i",{class:Pe(["lg-dot",S.cls])},null,2),Qe(O(E(S.phase))+" "+O(S.count),1)]))),128))])):re("",!0)]),f.value.length>0?(b(!0),T(Be,{key:0},st(f.value,S=>(b(),T("div",{key:S.id,class:Pe(["member",[`phase-${S.phase}`,{open:_(S.id)}]])},[w("button",{class:"member-head",type:"button","aria-expanded":_(S.id),onClick:I=>$(S.id)},[ie(Cd,{class:"row-dot",status:S.phase},null,8,["status"]),ie(Zt,{text:S.name},{default:Me(()=>[w("span",KH,O(S.name),1)]),_:2},1032,["text"]),S.activity?(b(),be(Zt,{key:0,text:S.activity},{default:Me(()=>[w("span",GH,O(S.activity),1)]),_:2},1032,["text"])):re("",!0),w("span",YH,O(E(S.phase)),1),ie(qe,{class:"mcar",name:_(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,VH),Rn(w("div",{class:"member-body"},O(S.body),513),[[yi,_(S.id)]])],2))),128)):A.value?(b(),T("div",ZH,O(A.value),1)):(b(),T("div",QH,O(C(t)("tools.swarm.waiting")),1))],512),[[yi,v.value]])],2))}}),JH=dt(XH,[["__scopeId","data-v-3b95ba79"]]);function eW(e){if(e.media&&e.status==="ok")return pH;const t=Ia(e.name);return t==="edit"||t==="write"||t==="multi_edit"?oH:t==="task"?wP:t==="agentswarm"?JH:t==="askuserquestion"?KP:aH}const xA=Ge({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>eW(n.tool));return(i,r)=>(b(),be(Ks(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>s("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>s("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>s("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>s("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function p_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function tW(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 gm(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 nW(e){return!(e.tool.status==="ok"&&e.tool.media)}function sW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function oW(e){const t=gm(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(nW(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 iW(e){return gm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
75
|
-
|
|
76
|
-
`)}function rW(e){const t=[];for(const n of gm(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 _A(e){return e.tool.id||`tool-${e.sourceIndex}`}function lW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?_A({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const aW=["aria-expanded"],cW={class:"tg-title"},uW={class:"tg-meta"},dW=["inert"],fW={class:"tool-group-body-inner"},hW=Ge({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=Q(!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}=Tt(),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=Kt("pinScroll",()=>{}),d=Q(null);function f(){c();const h=d.value;h&>(()=>u(h))}return(h,p)=>(b(),T("div",{class:Pe(["tool-group",{open:o.value}])},[w("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[ie(Cd,{status:r.value},null,8,["status"]),ie(qe,{class:"tg-ic",name:"list",size:"sm"}),w("span",cW,O(C(l)("tools.group.title",i.value)),1),w("span",uW,"· "+O(a.value),1),ie(qe,{class:"tg-car",name:"chevron-right",size:"sm"})],8,aW),w("div",{class:Pe(["tool-group-body",{open:o.value}]),inert:!o.value},[w("div",fW,[(b(!0),T(Be,null,st(e.tools,(m,x)=>(b(),be(xA,{key:C(_A)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(sW)(x,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,dW)],2))}}),pW=dt(hW,[["__scopeId","data-v-37eb334f"]]);var mW=Object.create,Oy=Object.defineProperty,gW=Object.getOwnPropertyDescriptor,wA=Object.getOwnPropertyNames,vW=Object.getPrototypeOf,yW=Object.prototype.hasOwnProperty,SA=(e,t)=>function(){return t||(0,e[wA(e)[0]])((t={exports:{}}).exports,t),t.exports},CA=e=>{let t={};for(var n in e)Oy(t,n,{get:e[n],enumerable:!0});return t},kW=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=wA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!yW.call(e,l)&&l!==n&&Oy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=gW(t,l))||s.enumerable});return e},AA=(e,t,n)=>(n=e!=null?mW(vW(e)):{},kW(Oy(n,"default",{value:e,enumerable:!0}),e));function bW(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 xW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function _W(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 wW(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 SW(){return`</ol>
|
|
90
|
-
</section>
|
|
91
|
-
`}function CW(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 AW(){return`</li>
|
|
92
|
-
`}function MW(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 EW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=_W,e.renderer.rules.footnote_block_open=wW,e.renderer.rules.footnote_block_close=SW,e.renderer.rules.footnote_open=CW,e.renderer.rules.footnote_close=AW,e.renderer.rules.footnote_anchor=MW,e.renderer.rules.footnote_caption=xW,e.renderer.rules.footnote_anchor_name=bW;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 x=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=A;for(;h<f;){const _=l.src.charCodeAt(h);if(n(_))_===9?L+=4-L%4:L++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=L-A,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=v,l.blkIndent-=4,l.tShift[a]=k,l.sCount[a]=g,l.bMarks[a]=x;const $=new l.Token("footnote_reference_close","",-1);return $.level=--l.level,l.tokens.push($),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const x=new l.Token("footnote_open","",1);if(x.meta={id:p,label:h[p].label},l.tokens.push(x),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const y=new l.Token("inline","",0);y.children=h[p].tokens,y.content=h[p].content,a.push(y);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:p,subId:v,label:h[p].label},l.tokens.push(y)}k&&l.tokens.push(k),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function TW(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 NW(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 IW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function $W(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(IW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function LW(e){e.inline.ruler.after("emphasis","sub",$W)}const FW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function OW(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(FW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function RW(e){e.inline.ruler.after("emphasis","sup",OW)}var BW=SA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,x){x=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},x),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,x,k.Token),v+=1,n(g[y-2],"class",x.liClass),n(g[s(g,y-2)],"class",x.ulClass))})};function n(m,x,k){var g=m.attrIndex(x),v=[x,k];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,x){for(var k=m[x].level-1,g=x-1;g>=0;g--)if(m[g].level===k)return g;return-1}function o(m,x){return d(m[x])&&f(m[x-1])&&h(m[x-2])&&p(m[x])}function i(m,x,k,g){var v=k.idPrefix+x;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,x,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",x]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,x){var k=new x("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,x){var k=new x("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)}})}),DW=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))),PW=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),c0;const HW=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]]),WW=(c0=String.fromCodePoint)!==null&&c0!==void 0?c0:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function zW(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=HW.get(e))!==null&&t!==void 0?t:e}var Ps;(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"})(Ps||(Ps={}));const UW=32;var yl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yl||(yl={}));function Jg(e){return e>=Ps.ZERO&&e<=Ps.NINE}function qW(e){return e>=Ps.UPPER_A&&e<=Ps.UPPER_F||e>=Ps.LOWER_A&&e<=Ps.LOWER_F}function jW(e){return e>=Ps.UPPER_A&&e<=Ps.UPPER_Z||e>=Ps.LOWER_A&&e<=Ps.LOWER_Z||Jg(e)}function VW(e){return e===Ps.EQUALS||jW(e)}var Ds;(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"})(Ds||(Ds={}));var ml;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ml||(ml={}));var KW=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Ds.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ml.Strict}startEntity(e){this.decodeMode=e,this.state=Ds.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ds.EntityStart:return e.charCodeAt(t)===Ps.NUM?(this.state=Ds.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ds.NamedEntity,this.stateNamedEntity(e,t));case Ds.NumericStart:return this.stateNumericStart(e,t);case Ds.NumericDecimal:return this.stateNumericDecimal(e,t);case Ds.NumericHex:return this.stateNumericHex(e,t);case Ds.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|UW)===Ps.LOWER_X?(this.state=Ds.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ds.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Jg(s)||qW(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Jg(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ps.SEMI)this.consumed+=1;else if(this.decodeMode===ml.Strict)return 0;return this.emitCodePoint(zW(this.result),this.consumed),this.errors&&(e!==Ps.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&yl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=GW(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===ml.Attribute&&(o===0||VW(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&yl.VALUE_LENGTH)>>14,o!==0){if(i===Ps.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ml.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&yl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~yl.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Ds.NamedEntity:return this.result!==0&&(this.decodeMode!==ml.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ds.NumericDecimal:return this.emitNumericEntity(0,2);case Ds.NumericHex:return this.emitNumericEntity(0,3);case Ds.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ds.EntityStart:return 0}}};function MA(e){let t="";const n=new KW(e,s=>t+=WW(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 GW(e,t,n,s){const o=(t&yl.BRANCH_LENGTH)>>7,i=t&yl.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const YW=MA(DW);MA(PW);function Ry(e,t=ml.Legacy){return YW(e,t)}var ZW=AA(BW());const m_={};function QW(e){let t=m_[e];if(t)return t;t=m_[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 vm(e,t){typeof t!="string"&&(t=vm.defaultChars);const n=QW(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})}vm.defaultChars=";/?:@&=+$,#";vm.componentChars="";var ev=vm;const g_={};function XW(e){let t=g_[e];if(t)return t;t=g_[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function ym(e,t,n){typeof t!="string"&&(n=t,t=ym.defaultChars),typeof n>"u"&&(n=!0);const s=XW(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}ym.defaultChars=";/?:@&=+$,-_.!~*'()#";ym.componentChars="-_.!~*'()";var EA=ym;function By(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 tp(){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 JW=/^([a-z0-9.+-]+:)/i,ez=/:[0-9]*$/,tz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,nz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
93
|
-
`," "]),sz=["'"].concat(nz),v_=["%","/","?",";","#"].concat(sz),y_=["/","?","#"],oz=255,k_=/^[+a-z0-9A-Z_-]{0,63}$/,iz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b_={javascript:!0,"javascript:":!0},x_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function rz(e,t){if(e&&e instanceof tp)return e;const n=new tp;return n.parse(e,t),n}tp.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=tz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=JW.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&&b_[r])&&(i=i.substr(2),this.slashes=!0)),!b_[r]&&(o||r&&!x_[r])){let c=-1;for(let p=0;p<y_.length;p++)s=i.indexOf(y_[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<v_.length;p++)s=i.indexOf(v_[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,x=p.length;m<x;m++){const k=p[m];if(k&&!k.match(k_)){let g="";for(let v=0,y=k.length;v<y;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(k_)){const v=p.slice(0,m),y=p.slice(m+1),A=k.match(iz);A&&(v.push(A[1]),y.unshift(A[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>oz&&(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),x_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};tp.prototype.parseHost=function(e){let t=ez.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 Dy=rz,TA=CA({decode:()=>ev,encode:()=>EA,format:()=>By,parse:()=>Dy}),NA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,IA=/[\0-\x1F\x7F-\x9F]/,lz=/[\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]/,$A=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,az=/[\$\+<->\^`\|~\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]/,LA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,cz=CA({Any:()=>NA,Cc:()=>IA,Cf:()=>lz,P:()=>$A,S:()=>az,Z:()=>LA}),uz=Object.defineProperty,FA=e=>{let t={};for(var n in e)uz(t,n,{get:e[n],enumerable:!0});return t},_s=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}`}},dz=FA({arrayReplaceAt:()=>yz,assign:()=>gz,countLines:()=>rs,escapeHtml:()=>Mz,escapeRE:()=>Tz,fromCodePoint:()=>Md,has:()=>mz,isMdAsciiPunct:()=>op,isPunctChar:()=>sp,isPunctCode:()=>tv,isSpace:()=>vz,isString:()=>hz,isValidEntityCode:()=>bm,isWhiteSpace:()=>Ad,lib:()=>Nz,mdurl:()=>TA,normalizeReference:()=>km,ucmicro:()=>np,unescapeAll:()=>Ed,unescapeMd:()=>_z});const np=cz;function fz(e){return Object.prototype.toString.call(e)}function hz(e){return fz(e)==="[object String]"}const pz=Object.prototype.hasOwnProperty;function mz(e,t){return pz.call(e,t)}function gz(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 vz(e){return e===9||e===32}function Ad(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 sp(e){return np.P.test(e)||np.S.test(e)}const __=new Map;function tv(e){if(op(e))return!0;const t=__.get(e);if(t!==void 0)return t;const n=sp(String.fromCharCode(e));return __.set(e,n),n}function op(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 km(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function yz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function bm(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 Md(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 OA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,kz=new RegExp(`${OA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),bz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function xz(e,t){if(t.charCodeAt(0)===35&&bz.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return bm(s)?Md(s):e}const n=Ry(e);return n!==e?n:e}function _z(e){return e.includes("\\")?e.replace(OA,"$1"):e}function Ed(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(kz,(t,n,s)=>n||xz(t,s))}const wz=/[&<>"]/,Sz=/[&<>"]/g,Cz={"&":"&","<":"<",">":">",'"':"""};function Az(e){return Cz[e]}function Mz(e){return wz.test(e)?e.replace(Sz,Az):e}const Ez=/[.?*+^$[\]\\(){}|-]/g;function Tz(e){return e.replace(Ez,"\\$&")}const Nz={mdurl:TA,ucmicro:np};function rs(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
94
|
-
`,n+1))!==-1;)t++;return t}const Iz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,$z=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Lz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Py=["references","footnotes","abbreviations","abbr","abbrs"],Hy=Symbol.for("markdown-it-ts.global-state"),Wy=Object.prototype.hasOwnProperty;function w_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Li(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function wl(e){if(Array.isArray(e))return e.map(t=>wl(t));if(Li(e)){const t={};for(const n of Object.keys(e))t[n]=wl(e[n]);return t}return e}function ip(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Li(e)?Object.keys(e):[]}function nv(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!nv(e[n],t[n]))return!1;return!0}if(Li(e)||Li(t)){if(!Li(e)||!Li(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(!Wy.call(t,o)||!nv(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function RA(e,t){if(Array.isArray(e))return e[Number(t)];if(Li(e))return e[t]}function Fz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=wl(t[n]);return e}if(Li(e)&&Li(t)){for(const n of Object.keys(e))Wy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=wl(t[n]);return e}return wl(t)}function Oz(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Li(o)||Array.isArray(o)){const i=new Set(ip(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=wl(RA(n.value,r)):delete o[r];!n.existed&&ip(o).length===0&&delete e[t];return}n.existed?e[t]=wl(n.value):delete e[t]}function zy(e){const t=e[Hy];return w_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&w_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function Rz(e,t){Object.defineProperty(e,Hy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function No(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Iz.test(e)?"footnote-definition":$z.test(e)?"abbreviation-definition":Lz.test(e)?"reference-definition":null}function qd(e){return zy(e)?.reason??null}function Oc(e,t,n){if(qd(e)&&Pr(e),!t)return n();Uy(e,t);try{const s=n();return qy(e),s}catch(s){throw Pr(e),s}}function Uy(e,t){try{Pr(e);const n={};for(const s of Py)n[s]=Wy.call(e,s)?{existed:!0,value:wl(e[s])}:{existed:!1};Rz(e,{reason:t,snapshot:n})}catch{}}function qy(e){const t=zy(e);if(t)for(const n of Py){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Li(o)&&!Array.isArray(o))continue;const i=new Set(ip(s.existed?s.value:void 0));s.ownedKeys=ip(o).filter(r=>i.has(r)?!nv(o[r],RA(s.value,r)):!0)}}function Pr(e){const t=zy(e);if(t){for(const n of Py){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){Oz(e,n,s);continue}s.existed?e[n]=Fz(e[n],s.value):delete e[n]}delete e[Hy]}}const sv=Symbol.for("markdown-it-ts.diagnostics");function xm(e,t){if(e)try{const n=e[sv];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[sv]=s,s}catch{return}}function kr(e){return xm(e,!1)}function Bz(e){if(e)try{const t=e[sv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function uo(e){Bz(e)}function bs(e,t){const n=xm(e,!0);n&&(n.strategy=t)}function u0(e,t){const n=xm(e,!0);n&&(n.chunk=t)}function BA(e,t){const n=xm(e,!0);n&&(n.unbounded=t)}function Dz(e){const t={};e=e||{},t.src_Any=NA.source,t.src_Cc=IA.source,t.src_Z=LA.source,t.src_P=$A.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function ov(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function _m(e){return Object.prototype.toString.call(e)}function Pz(e){return _m(e)==="[object String]"}function Hz(e){return _m(e)==="[object Object]"}function Wz(e){return _m(e)==="[object RegExp]"}function S_(e){return _m(e)==="[object Function]"}function zz(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const DA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Uz(e){return Object.keys(e||{}).reduce(function(t,n){return t||DA.hasOwnProperty(n)},!1)}const qz={"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}}},jz="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]",Vz="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Kz(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function C_(){return function(e,t){t.normalize(e)}}function rp(e){const t=e.re=Dz(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(jz),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,Hz(a)){Wz(a.validate)?c.validate=Kz(a.validate):S_(a.validate)?c.validate=a.validate:i(l,a),S_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=C_();return}if(Pz(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:C_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(zz).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 PA(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 ni(e,t){if(!(this instanceof ni))return new ni(e,t);t||Uz(e)&&(t=e,e={}),this.__opts__=ov({},DA,t),this.__schemas__=ov({},qz,e),this.__compiled__={},this.__tlds__=Vz,this.__tlds_replaced__=!1,this.re={},rp(this)}ni.prototype.add=function(t,n){return this.__schemas__[t]=n,rp(this),this};ni.prototype.set=function(t){return this.__opts__=ov(this.__opts__,t),this};ni.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)};ni.prototype.pretest=function(t){return this.re.pretest.test(t)};ni.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};ni.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 PA(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};ni.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 PA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};ni.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(),rp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,rp(this),this)};ni.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ni.prototype.onCompile=function(){};var HA=ni,Gz=SA({"../../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,x=Math.floor,k=String.fromCharCode;function g(B){throw new RangeError(p[B])}function v(B,P){const z=[];let W=B.length;for(;W--;)z[W]=P(B[W]);return z}function y(B,P){const z=B.split("@");let W="";z.length>1&&(W=z[0]+"@",B=z[1]),B=B.replace(h,".");const X=v(B.split("."),P).join(".");return W+X}function A(B){const P=[];let z=0;const W=B.length;for(;z<W;){const X=B.charCodeAt(z++);if(X>=55296&&X<=56319&&z<W){const U=B.charCodeAt(z++);(U&64512)==56320?P.push(((X&1023)<<10)+(U&1023)+65536):(P.push(X),z--)}else P.push(X)}return P}const L=B=>String.fromCodePoint(...B),$=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},_=function(B,P){return B+22+75*(B<26)-((P!=0)<<5)},E=function(B,P,z){let W=0;for(B=z?x(B/700):B>>1,B+=x(B/P);B>m*26>>1;W+=36)B=x(B/m);return x(W+(m+1)*B/(B+38))},N=function(B){const P=[],z=B.length;let W=0,X=128,U=72,Z=B.lastIndexOf("-");Z<0&&(Z=0);for(let ce=0;ce<Z;++ce)B.charCodeAt(ce)>=128&&g("not-basic"),P.push(B.charCodeAt(ce));for(let ce=Z>0?Z+1:0;ce<z;){const fe=W;for(let Y=1,J=36;;J+=36){ce>=z&&g("invalid-input");const le=$(B.charCodeAt(ce++));le>=36&&g("invalid-input"),le>x((2147483647-W)/Y)&&g("overflow"),W+=le*Y;const He=J<=U?1:J>=U+26?26:J-U;if(le<He)break;const de=36-He;Y>x(2147483647/de)&&g("overflow"),Y*=de}const se=P.length+1;U=E(W-fe,se,fe==0),x(W/se)>2147483647-X&&g("overflow"),X+=x(W/se),W%=se,P.splice(W++,0,X)}return String.fromCodePoint(...P)},F=function(B){const P=[];B=A(B);const z=B.length;let W=128,X=0,U=72;for(const fe of B)fe<128&&P.push(k(fe));const Z=P.length;let ce=Z;for(Z&&P.push("-");ce<z;){let fe=2147483647;for(const Y of B)Y>=W&&Y<fe&&(fe=Y);const se=ce+1;fe-W>x((2147483647-X)/se)&&g("overflow"),X+=(fe-W)*se,W=fe;for(const Y of B)if(Y<W&&++X>2147483647&&g("overflow"),Y===W){let J=X;for(let le=36;;le+=36){const He=le<=U?1:le>=U+26?26:le-U;if(J<He)break;const de=J-He,G=36-He;P.push(k(_(He+de%G,0))),J=x(de/G)}P.push(k(_(J,0))),U=E(X,se,ce===Z),X=0,++ce}++X,++W}return P.join("")},R={version:"2.3.1",ucs2:{decode:A,encode:L},decode:N,encode:F,toASCII:function(B){return y(B,function(P){return f.test(P)?"xn--"+F(P):P})},toUnicode:function(B){return y(B,function(P){return d.test(P)?N(P.slice(4).toLowerCase()):P})}};t.exports=R})}),WA=AA(Gz());function jy(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=Ed(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=Ed(e.slice(t,o)),i.pos=o,i.ok=!0),i}var zA=jy;const ph=-2;function Yz(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 ph}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return ph;if(r===91){o++,i++;continue}i++}return-1}function Vy(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=Yz(l,t,a,n);if(f!==ph)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 lp=Vy;function Ky(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+=Ed(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+=Ed(e.slice(t,i)),r}var UA=Ky;function wm(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function Gy(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function Zz(e,t,n){const s=wm(e,t),o=[t,n];s<0?Gy(e,o):e.attrs[s]=o}function Qz(e,t){const n=wm(e,t);return n>=0?e.attrs[n][1]:null}function Xz(e,t,n){const s=wm(e,t);s<0?Gy(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var Jz=FA({attrGet:()=>Qz,attrIndex:()=>wm,attrJoin:()=>Xz,attrPush:()=>Gy,attrSet:()=>Zz,parseLinkDestination:()=>jy,parseLinkLabel:()=>Vy,parseLinkTitle:()=>Ky});function eU(e){return e.includes("\r")||e.includes("\0")}function qA(e){return typeof e=="string"?e:e.toString()}function tU(e){if(e.inlineMode){const t=new _s("inline","",0);t.content=qA(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 nU=/^([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])?)*)$/,sU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function oU(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(sU.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(nU.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 iU=oU;function rU(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 lU=rU;function A_(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 aU(e){const t=e.tokens_meta,n=e.tokens_meta.length;A_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&A_(t[s].delimiters)}var cU=aU;function uU(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function M_(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function dU(e){const t=e.tokens_meta,n=e.tokens_meta.length;M_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&M_(e,t[s].delimiters)}const E_={tokenize:uU,postProcess:dU};function jA(e){return Ry(e)}function Yy(e){return e>=48&&e<=57}function fU(e){const t=e|32;return Yy(e)||t>=97&&t<=102}function VA(e){const t=e|32;return t>=97&&t<=122}function hU(e){return VA(e)||Yy(e)}function pU(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?fU(l):Yy(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function mU(e,t,n){let s=t+1;if(s>=n||!VA(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&hU(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 jA(o)!==o?o:null}function gU(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=pU(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=bm(i)?Md(i):Md(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=mU(e.src,n,s);if(o){const i=jA(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 vU=gU;const KA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),iv=new Array(128),GA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);iv[e]=`\\${t}`,GA[e]=KA[e]?t:iv[e]}function T_(e,t,n){e.pending&&e.pushPending();const s=new _s("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 yU(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):(T_(e,GA[i],iv[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return T_(e,i<256&&KA[i]?r:l,l),e.pos=n+1,!0}var kU=yU;function bU(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 xU=bU;const YA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,ZA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",_U=new RegExp(`^(?:${YA}|${ZA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),wU=new RegExp(`^(?:${YA}|${ZA})`);function QA(e){return e===32||e===9||e===10||e===12||e===13}function SU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||QA(t)}function CU(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(!QA(n))return!1}return!1}function AU(e){const t=e|32;return t>=97&&t<=122}function MU(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&&!AU(i))return!1;const r=o.slice(s).match(_U);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,SU(l)&&e.linkLevel++,CU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var EU=MU;function TU(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=lp(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=zA(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=UA(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=lp(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[km(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 x=e.push("image","img",0);x.attrs=[["src",u],["alt",""]],x.children=m,x.content=s,a&&x.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var NU=TU;function IU(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=lp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(o=zA(e.src,p,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?p=o.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(o=UA(e.src,p,e.posMax),p<d&&a!==p&&o.ok)for(l=o.str,p=o.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=lp(e,p),p>=0?s=e.src.slice(a,p++):p=h+1):p=h+1,s||(s=e.src.slice(f,h)),i=e.env.references[km(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),x=[["href",r]];m.attrs=x,l&&x.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var $U=IU;function XA(e){const t=e|32;return t>=97&&t<=122}function LU(e){return e>=48&&e<=57}function FU(e){return XA(e)||LU(e)||e===43||e===45||e===46}function OU(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&FU(e.charCodeAt(t));)t--;return t++,t>=e.length||!XA(e.charCodeAt(t))?null:e.slice(t)}function RU(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 BU(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=OU(e.pending);if(!o)return!1;const i=RU(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 DU(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 PU=DU;function HU(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 N_(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 WU(e){const t=e.delimiters;N_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&N_(e,n[s].delimiters)}const I_={tokenize:HU,postProcess:WU};function $_(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 zU(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||$_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!$_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var UU=zU;function Zy(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function qU(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 jU(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 JA(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:Zy(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function Rc(e,t,n,s,o,i){const r=JA(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=jU(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=Zy()}function VU(e){const t=JA(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=qU(o.samples)}return t.completedAt=Zy(),t}var L_=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}},e6=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 _s("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 _s(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 _s(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=Ad(l),u=Ad(a),d=tv(l),f=tv(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};e6.prototype.Token=_s;const KU=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function t6(e){return!KU.test(e)}var GU=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new L_,this.ruler2=new L_,this.ruler.push("text",UU),this.ruler.push("linkify",BU),this.ruler.push("newline",PU),this.ruler.push("escape",kU),this.ruler.push("backticks",lU),this.ruler.push("strikethrough",I_.tokenize),this.ruler.push("emphasis",E_.tokenize),this.ruler.push("link",$U),this.ruler.push("image",NU),this.ruler.push("autolink",iU),this.ruler.push("html_inline",EU),this.ruler.push("entity",vU),this.ruler2.push("balance_pairs",cU),this.ruler2.push("strikethrough",I_.postProcess),this.ruler2.push("emphasis",E_.postProcess),this.ruler2.push("fragments_join",xU),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(Rc(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(Rc(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()&&t6(e)){const a=new _s("text","",0);a.content=e,s.push(a);return}const o=new e6(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();Rc(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 YU(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&&t6(i.content)){const r=new _s("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const ZU=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,QU=/[0-9a-z]/i;function XU(e){return/^<a[>\s]/i.test(e)}function JU(e){return/^<\/a\s*>/i.test(e)}function eq(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(!ZU.test(s)||!QU.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 tq(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"&&(XU(l.content)&&i>0&&i--,JU(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=>eq(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 x=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText(`mailto:${x}`).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText(`http://${x}`).replace(/^http:\/\//,"");const k=p.index;if(k>f){const A=new _s("text","",0);A.content=a.slice(f,k),A.level=d,u.push(A)}const g=new _s("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new _s("text","",0);v.content=x,v.level=d,u.push(v);const y=new _s("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new _s("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const nq=/\r\n?|\n/g,sq=/\0/g;function oq(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(nq,`
|
|
96
|
-
`)),s&&(o=o.replace(sq,"�")),e.src=o}const n6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,iq=/\((?:c|tm|r)\)/i,rq=/\((c|tm|r)\)/gi,lq={c:"©",r:"®",tm:"™"};function aq(e,t){return lq[t.toLowerCase()]}function cq(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(rq,aq)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function uq(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&n6.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 dq(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(""):"");iq.test(s)&&cq(n.children||[]),n6.test(s)&&uq(n.children||[])}}var fq=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 hq=/['"]/,F_=/['"]/g,O_="’";function Df(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function pq(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;){F_.lastIndex=c;const d=F_.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 x=32;if(c<u)x=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const k=op(m)||sp(String.fromCharCode(m)),g=op(x)||sp(String.fromCharCode(x)),v=Ad(m),y=Ad(x);if(y?f=!1:g&&(v||k||(f=!1)),v?h=!1:k&&(y||g||(h=!1)),x===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=k,h=g),!f&&!h){p&&(r.content=Df(r.content,d.index,O_));continue}if(h)for(n=s.length-1;n>=0;n--){let A=s[n];if(s[n].level<l)break;if(A.single===p&&s[n].level===l){A=s[n];let L,$;p?(L=o[2]||"‘",$=o[3]||"’"):(L=o[0]||"“",$=o[1]||"”"),r.content=Df(r.content,d.index,$),e[A.token].content=Df(e[A.token].content,A.pos,L),c+=$.length-1,A.token===i&&(c+=L.length-1),a=r.content,u=a.length,s.length=n;continue e}}f?s.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Df(r.content,d.index,O_))}}}function mq(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("");!hq.test(s)||!n.children||pq(n.children,e)}}function gq(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 vq=/^(?:vbscript|javascript|file|data):/,yq=/^data:image\/(?:gif|png|jpeg|webp);/,s6=["http:","https:","mailto:"];function o6(e){const t=e.trim().toLowerCase();return vq.test(t)?yq.test(t):!0}function i6(e){const t=Dy(e,!0);if(t.hostname&&(!t.protocol||s6.includes(t.protocol)))try{t.hostname=WA.default.toASCII(t.hostname)}catch{}return EA(By(t))}function r6(e){const t=Dy(e,!0);if(t.hostname&&(!t.protocol||s6.includes(t.protocol)))try{t.hostname=WA.default.toUnicode(t.hostname)}catch{}return ev(By(t),`${ev.defaultChars}%`)}function kq(e){switch(e){case 9:case 32:return!0}return!1}function bq(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=[],x=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const E=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!E){let F=a[y]+1,S,I;o.charCodeAt(u)===32?(u++,F++,I=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[y]+F)%4===3?(u++,F++,I=!1):I=!0):S=!1;let R=F;for(h.push(i[y]),i[y]=u;u<d;){const B=o.charCodeAt(u);if(kq(B))B===9?R+=4-(R+c[y]+(I?1:0))%4:R++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=R-F,x.push(l[y]),l[y]=u-i[y];continue}if(v)break;let N=!1;for(let F=0,S=k.length;F<S;F++)if(k[F](e,y,n,!0)){N=!0;break}if(N){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),x.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),x.push(l[y]),m.push(a[y]),a[y]=-1}const A=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const $=[t,0];L.map=$,e.md.block.tokenize(e,t,y);const _=e.push("blockquote_close","blockquote",-1);_.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let E=0;E<x.length;E++)i[E+t]=h[E],l[E+t]=x[E],a[E+t]=m[E],c[E+t]=p[E];return e.blkIndent=A,!0}function xq(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 _q(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 R_=["","h1","h2","h3","h4","h5","h6"],B_=["","#","##","###","####","#####","######"];function D_(e){switch(e){case 9:case 32:return!0}return!1}function wq(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&&!D_(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&D_(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",R_[d],1);h.markup=B_[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",R_[d],-1);return m.markup=B_[d],!0}function Sq(e){switch(e){case 9:case 32:return!0}return!1}function Cq(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&&!Sq(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Ja=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${wU.source}\\s*$`),/^$/,!1]];function Aq(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<Ja.length&&!Ja[l][0].test(r);l++);if(l===Ja.length)return!1;if(s)return Ja[l][2];let a=t+1;if(!Ja[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),Ja[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function P_(e){switch(e){case 9:case 32:return!0}return!1}const Zu={Pipe:1,ParagraphTerminator:2};function Mq(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 l6=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|=Zu.Pipe|Zu.ParagraphTerminator),!a)if(P_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Mq(f)&&(c|=Zu.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 _s(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new _s(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,x=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+x[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 x=i.charCodeAt(p);if(P_(x))x===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("")}};l6.prototype.Token=_s;function Eq(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function a6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function c6(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&Zu.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:Eq(n,s,o)}const H_=["","h1","h2"];function Tq(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=a6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const y=i[p]+r[p],A=l[p];if(y>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(y),h===45||h===61)){let $=y+1,_=$;for(;$<A&&o.charCodeAt($)===h;)$++;for(_=$;$<A;){const E=o.charCodeAt($);if(E!==9&&E!==32)break;$++}if($>=A){f=h===61?1:2;break}if(_-y>1)continue}if(a[p]<0||u&&!c6(e,p,o,y,A))continue;let L=!1;for(let $=0,_=s.length;$<_;$++)if(s[$](e,p,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(p===t+1){const y=i[t]+r[t];let A=l[t];for(;A>y;){const L=o.charCodeAt(A-1);if(L!==9&&L!==32)break;A--}m=o.slice(y,A)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const x=h===61?"=":"-",k=e.push("heading_open",H_[f],1);k.markup=x,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",H_[f],-1);return v.markup=x,e.parentType=d,!0}function u6(e){switch(e){case 9:case 32:return!0}return!1}function W_(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&&!u6(i.charCodeAt(l))?-1:l}function z_(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),!u6(c))?-1:a}function Nq(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 Iq=["0","1","2","3","4","5","6","7","8","9"];function $q(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 Lq(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,x=e.eMarks,k=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=x[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=z_(e,l),f<0||(u=!0,r=v,d=Nq(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=W_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=x[l])return!1;if(s)return!0;const A=h.charCodeAt(f-1),L=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let _=!1;const E=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,o=x[l];const S=k[l]+f-(p[l]+m[l]);let I=S;for(;i<o;){const se=h.charCodeAt(i);if(se===9)I+=4-(I+g[l])%4;else if(se===32)I++;else break;i++}const R=i;let B;R>=o?B=1:B=I-S,B>4&&(B=1);const P=S+B,z=e.push("list_item_open","li",1);z.markup=L;const W=[l,0];z.map=W,u&&(z.info=f-r-1===1?Iq[h.charCodeAt(r)-48]:h.slice(r,f-1));const X=e.tight,U=e.tShift[l],Z=e.sCount[l],ce=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=P,e.tight=!0,e.tShift[l]=R-p[l],e.sCount[l]=I,R>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||_)&&(a=!1),_=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ce,e.tShift[l]=U,e.sCount[l]=Z,e.tight=X,e.push("list_item_close","li",-1).markup=L,l=e.line,W[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let fe=!1;for(let se=0,Y=N.length;se<Y;se++)if(N[se](e,l,n,!0)){fe=!0;break}if(fe)break;if(u){if(f=z_(e,l),f<0)break;r=p[l]+m[l]}else if(f=W_(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,$[1]=l,e.line=l,e.parentType=F,a&&$q(e,E),!0}function U_(e){return e===9||e===32}function Fq(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=a6(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(o==="list"&&c[f]>=u){const v=r[f]+l[f],y=a[f];if(v<y){const A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=y||U_(i.charCodeAt(v+1)))break}else if(A>=48&&A<=57&&v+1<y){let L=v+1;for(;;){if(L>=y){L=-1;break}const $=i.charCodeAt(L++);if($>=48&&$<=57){if(L-v>=10){L=-1;break}continue}if(($===41||$===46)&&(L>=y||U_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const x=r[f]+l[f],k=a[f];if(d&&!c6(e,f,i,x,k))continue;let g=!1;for(let v=0,y=s.length;v<y;v++)if(s[v](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function Pf(e){switch(e){case 9:case 32:return!0}return!1}function Oq(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const _=e.parentType;e.parentType="reference";let E=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,v,y,!0)){E=!0;break}if(e.parentType=_,E)return null}const L=e.bMarks[v]+e.tShift[v],$=e.eMarks[v];return e.src.slice(L,$+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const v=c.charCodeAt(o);if(v===91)return!1;if(v===93){u=o;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!Pf(v))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;o=d.pos;const h=o,p=r,m=o;for(;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!Pf(v))break}let x=e.md.helpers.parseLinkTitle(c,o,i);for(;x.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,x=e.md.helpers.parseLinkTitle(c,o,i,x)}let k;for(o<i&&m!==o&&x.ok?(k=x.str,o=x.pos):(k="",o=h,r=p);o<i&&Pf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&k)for(k="",o=h,r=p;o<i&&Pf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=km(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 d0(e){switch(e){case 9:case 32:return!0}return!1}const Rq=65536;function f0(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function Bq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Zu.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 q_(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 Dq(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!d0(l)||r===45&&d0(l)||!Bq(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!d0(y))return!1;i++}let a=f0(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const A=c[y].trim();if(!A){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=f0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=q_(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 x=e.push("thead_open","thead",1);x.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let y=0;y<c.length;y++){const A=e.push("th_open","th",1);u[y]&&(A.attrs=[["style",`text-align:${u[y]}`]]);const L=e.push("inline","",0);L.content=c[y].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let L=0,$=h.length;L<$;L++)if(h[L](e,o,n,!0)){y=!0;break}if(y||(a=f0(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=q_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>Rq))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[o,o+1];for(let L=0;L<d;L++){const $=e.push("td_open","td",1);u[L]&&($.attrs=[["style",`text-align:${u[L]}`]]);const _=e.push("inline","",0);_.content=c[L]?c[L].trim():"",_.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 Pq=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 Rc(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 Hf=[["table",Dq,["paragraph","reference"]],["code",xq],["fence",_q,["paragraph","reference","blockquote","list"]],["blockquote",bq,["paragraph","reference","blockquote","list"]],["hr",Cq,["paragraph","reference","blockquote","list"]],["list",Lq,["paragraph","reference","blockquote"]],["reference",Oq],["html_block",Aq,["paragraph","reference","blockquote"]],["heading",wq,["paragraph","reference","blockquote"]],["lheading",Tq],["paragraph",Fq]];var Hq=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Pq;for(let e=0;e<Hf.length;e++)this.ruler.push(Hf[e][0],Hf[e][1],{alt:(Hf[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 x=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(Rc(e.env,"block",f[m].name,k-x,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 l6(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}},d6=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}};d6.prototype.Token=_s;const j_=[["normalize",oq],["block",tU],["inline",YU],["linkify",tq],["replacements",dq],["smartquotes",mq],["text_join",gq]],Wq={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},zq={parseLinkLabel:Vy,parseLinkDestination:jy,parseLinkTitle:Ky};function Uq(){return{...Wq}}function qq(){return{...zq}}var jq=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Hq,this.inline=new GU,this.ruler=new fq;for(let e=0;e<j_.length;e++){const[t,n]=j_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:Uq(),helpers:qq(),normalizeLink:i6,normalizeLinkText:r6,validateLink:o6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new HA),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 d6(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();Rc(e.env,"core",t[n].name,o-s,!0,!1)}VU(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&eU(e))return this.parse(qA(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 Vq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function ap(e){return!Vq.test(e)}function Pu(e,t){const n=e.indexOf(`
|
|
98
|
-
`,t);return n===-1?e.length:n}function mh(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 V_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function h0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Kq(e){if(e.length>3)return ap(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 Gq=["","h1","h2","h3","h4","h5","h6"],Yq=["","#","##","###","####","#####","######"],K_=0,p0=1,m0=2;function Go(e,t,n,s){const o=new _s(e,t,n);return o.level=s,o.block=!0,o}function f6(e,t,n){const s=Go("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new _s("text","",0);return o.content=e,s.children=[o],s}function Zq(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(!ap(u))return!1;const d=Gq[i],f=Yq[i],h=Go("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(f6(u,o,1));const p=Go("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function Qq(e,t,n){const s=Go("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(f6(t,n,1)),e.push(Go("paragraph_close","p",-1,0))}function Xq(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function g0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Jq(e,t){const n=Go("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function ej(e,t,n){const s=Go("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Go("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Go("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new _s("text","",0);r.content=t,i.children=[r],e.push(i);const l=Go("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Go("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function tj(e){const t=Go("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function nj(e,t,n,s){if(!V_(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=Pu(e,l);if(V_(e,l,c)&&mh(e,l+3,c)){const u=Go("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 sj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?K_:m0,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Pu(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(!mh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!Zq(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=g0(e,h),l+=1+r-h;continue}if(c===45){if(!h0(e,r,a))return null;const h=l;let p=r,m=l,x=null,k=null;for(;p<e.length;){const y=Pu(e,p);if(!h0(e,p,y))break;const A=p+2,L=y===A+1?e[A]:e.slice(A,y);if(!Kq(L))return null;x===null&&(x=Jq(t,h)),k=ej(t,L,m),p=y<e.length?y+1:y,m++}if(x===null||k===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=Pu(e,g);if(!mh(e,g,y)){if(h0(e,g,y))return null;break}g=y<e.length?y+1:y,v++}x.map[1]=v,k.map[1]=v,tj(t),r=g,l=v;continue}if(c===96){const h=nj(e,r,a,l);if(!h)return null;t.push(h.token),r=g0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=Xq(e,r,a);let d;if(n===m0?d=ap(u):n===p0&&u===s?d=o:(d=ap(u),n===K_?(i&&(n=u===s?p0:m0),s=u,o=d,i=!0):n===p0&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!mh(e,f,Pu(e,f)))return null;Qq(t,u,l),r=g0(e,f),l+=1+r-f}return t}const oj=/[&<>"]/,G_=/[&<>"]/g,ij=/&/g,rj=/[<>"]/g,lj={"&":"&","<":"<",">":">",'"':"""};function v0(e){return lj[e]||e}function On(e){if(e.length===0)return"";if(e.length<32)return oj.test(e)?e.replace(G_,v0):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(ij,"&"):t?e.replace(G_,v0):e.replace(rj,v0)}const aj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),cj=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function h6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(aj,(t,n,s)=>{if(n)return n;if(cj.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return bm(i)?Md(i):"�"}const o=Ry(t);return o!==t?o:t})}const uj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,dj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,fj=/"/g;function bc(e,t){const n=e.indexOf(`
|
|
99
|
-
`,t);return n===-1?e.length:n}function cp(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 Wf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function hj(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!cp(e,t,bc(e,t))}function Y_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function pj(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function Qy(e){return dj.test(e)?uj.test(e)?null:e.replace(fj,"""):e}function mj(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=Qy(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
|
|
100
|
-
`}function Z_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function gj(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 vj(e,t,n){const s=t+2;if(n===s+1)return gj(e,s);const o=Qy(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
|
|
103
|
-
`}function yj(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 kj(e,t,n,s){if(!Y_(e,t,n))return null;const o=yj(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=bc(e,l);if(Y_(e,l,a)&&cp(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-${On(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${On(c)}</code></pre>
|
|
104
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function Q_(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=bc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!cp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=mj(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=Wf(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=bc(e,m);if(!Z_(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const x=e.slice(t,m);let k;if(x===r)k=l;else{let v=t;for(k=`<ul>
|
|
105
|
-
`;v<m;){const y=bc(e,v),A=vj(e,v,y);if(A===null)return null;k+=A,v=y<e.length?y+1:y}k+=`</ul>
|
|
106
|
-
`,r=x,l=k}let g=Wf(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=bc(e,g);if(!cp(e,g,v)){if(Z_(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=kj(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=Wf(e,m.nextPos);continue}const f=pj(e,t,u);let h;if(f===a)h=c;else{const m=Qy(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&&hj(e,p))return null;s?o.push(h):n+=h,t=Wf(e,p)}return s?o.join(""):n}const bj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function up(e,t,n={},s){uo(n);const o={...bj,...s||{}},i=No(t);if(o.fallbackOnGlobalState!==!1&&i)return u0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Oc(n,i,()=>e.core.parse(t,n,e).tokens);let r=gh(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Sj(r,o.maxChunks)),vh(t,r))return u0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Oc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return u0(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Oc(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&&_j(f,l),wj(a,f),l+=u.lineCount}return a})}function gh(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=Cj(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const y=e.charCodeAt(g);if(y===32||y===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let y=g;for(;y<h&&e[y]===v;)y++;const A=y-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const x=p-f;o+=x,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=x);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 vh(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!xj(e,t[o].end))return!0;return!1}function xj(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 _j(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 wj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Sj(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 Cj(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 p6=4e6,m6=8e4,Aj=1e4,Mj=200,Ej=1e4,Tj=200;function g6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Nj(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function nl(e){return e.length===0?0:rs(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Ij(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function $j(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 Lj(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 Ij(e,n+1,e.length-1)?!$j(e,t):!1}function Fj(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??Ej:e.options.fullChunkSizeChars??Aj),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Tj:e.options.fullChunkSizeLines??Mj);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 jd=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=nl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=gh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(vh(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,nl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Lj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,nl(this.pending)),null;const n=gh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,nl(this.pending)),null;const s=vh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:nl(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=gh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=vh(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:nl(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:nl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+nl(this.pending);return Fj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(qd(e)&&Pr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=No(t);n&&(Uy(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&&Nj(r,a),this.options.retainTokens!==!1&&g6(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&&qy(t),n}catch(s){throw this.markedGlobalStateReason&&(Pr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){BA(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 Oj(e,t,n={},s={}){uo(n);const o=new jd(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function Rj(e,t,n={},s={}){uo(n);const o=new jd(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function Bj(e,t,n,s={},o={}){uo(s);const i=new jd(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 Dj(e,t,n,s={},o={}){uo(s);const i=new jd(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 v6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??p6,o=e.options.autoUnboundedThresholdLines??m6;return t>=s||n>=o}function y6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??p6))return"yes";const s=e.options.autoUnboundedThresholdLines??m6;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Qu(e,t,n={},s={}){uo(n);const o=No(t);if(qd(n)&&Pr(n),s.fallbackOnGlobalState!==!1&&o)return BA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:rs(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Oc(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new jd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){g6(i,l)}});if(o&&Uy(n,o),r.feed(t),r.flushForce(n),o&&(qy(n),s.fallbackOnGlobalState===!1)){const l=kr(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Bc=(e,t,n)=>e<t?t:e>n?n:e;function k6(e){return e.experimental?{...e,...e.experimental}:e}const X_=[{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"}],J_=[{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 b6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Pj(e,t=Math.max(0,e/40|0),n={}){const s=k6(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<X_.length;l++){const a=X_[l];if(e<=a.max){if(a.strategy!=="adaptive")return b6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Bc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Bc(Math.ceil(t/i),150,700),maxChunks:Bc(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 ew(e,t=Math.max(0,e/40|0),n={}){const s=k6(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<J_.length;l++){const a=J_[l];if(e<=a.max){if(a.strategy!=="adaptive")return b6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Bc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Bc(Math.ceil(t/i),150,700),maxChunks:Bc(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 Hj={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"]}}},Wj={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zj={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 Sm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function yh(e,t){if(Sm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const tw=e=>Sm(e)?e:Promise.resolve(e);function Xu(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return On(e)}}function Il(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Xu(t[0])}="${On(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Xu(o[0])}="${On(o[1])}"`}return n}function x6(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 Ju(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="${On(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
111
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Il(r)}>${t}</code></pre>
|
|
112
|
-
`}return`<pre><code${Il(e.attrs)}>${t}</code></pre>
|
|
113
|
-
`}function dp(e){return!e.attrs||e.attrs.length===0?`<code>${On(e.content)}</code>`:`<code${Il(e.attrs)}>${On(e.content)}</code>`}function rv(e){const t=On(e.content);return e.attrs?`<pre${Il(e.attrs)}><code>${t}</code></pre>
|
|
114
|
-
`:`<pre><code>${t}</code></pre>
|
|
115
|
-
`}function Uj(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${On(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${On(n[0][1])}">`}return null}function nw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Xu(t[0][0])}="${On(t[0][1])}">`:t.length===2?`<a ${Xu(t[0][0])}="${On(t[0][1])}" ${Xu(t[1][0])}="${On(t[1][1])}">`:`<a${Il(t)}>`}function qj(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 sw(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 fp(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+Il(n);return s===0&&t&&(i+=" /"),`${i}>`}const jj={langPrefix:"language-",xhtmlOut:!1,breaks:!1},zf=Object.prototype.hasOwnProperty,Ln={code_inline(e,t){return dp(e[t])},code_block(e,t){return rv(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?h6(i.info).trim():"",{langName:l,langAttrs:a}=x6(r),c=n.highlight,u=On(i.content);if(!c)return Ju(i,u,r,l,n);const d=c(i.content,l,a);return Sm(d)?d.then(f=>Ju(i,f||u,r,l,n)):Ju(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]],fp(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 On(e[t].content)},text_special(e,t){return On(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function ow(e,t,n){const s=e.info?h6(e.info).trim():"",{langName:o,langAttrs:i}=x6(s),r=t.highlight,l=On(e.content);if(!r)return Ju(e,l,s,o,t);const a=r(e.content,o,i);if(Sm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Ju(e,a||l,s,o,t)}function Uf(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Ln.text)return l.content.length===0?"":On(l.content);break;case"text_special":if(o.text_special===Ln.text_special)return l.content.length===0?"":On(l.content);break;case"softbreak":if(o.softbreak===Ln.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Ln.hardbreak)return i;break;case"html_inline":if(o.html_inline===Ln.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Ln.code_inline)return dp(l);break}const a=o[l.type];if(!a)return fp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:yh(c,l.type)}var Vj=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Ln}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,x="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,y=k>0&&e[k-1].hidden?`
|
|
121
|
-
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const $=e[k+1],_=e[k+2],E=e[k+3];if($.type==="paragraph_open"&&$.hidden&&_.type==="inline"&&E.type==="paragraph_close"&&E.hidden){x+=`${y}<li>${this.renderInlineTokens(_.children||[],s,o)}`,k+=3;continue}}if(k+2<e.length){const $=e[k+1],_=e[k+2];if($.type==="inline"&&_.nesting===-1&&_.tag===g.tag&&!_.hidden){const E=Uj(g,y);if(E!==null){x+=`${E+this.renderInlineTokens($.children||[],s,o)}</${g.tag}>
|
|
122
|
-
`,k+=2;continue}}}if(v==="inline"){const $=g.children||[];if($.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
123
|
-
`:`<br>
|
|
124
|
-
`,p=s.breaks?h:`
|
|
125
|
-
`,m=!0);const _=$[0];switch(_.type){case"text":if(l===Ln.text){x+=On(_.content);continue}break;case"text_special":if(a===Ln.text_special){x+=On(_.content);continue}break;case"softbreak":if(c===Ln.softbreak){x+=p;continue}break;case"hardbreak":if(u===Ln.hardbreak){x+=h;continue}break;case"html_inline":if(d===Ln.html_inline){x+=_.content;continue}break;case"code_inline":if(f===Ln.code_inline){x+=dp(_);continue}break}}x+=this.renderInlineTokens($,s,o);continue}const A=i[v];if(!A){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":x+=r?`<hr />
|
|
126
|
-
`:`<hr>
|
|
127
|
-
`;continue;case"heading_open":x+=`<${g.tag}>`;continue;case"heading_close":x+=`</${g.tag}>
|
|
128
|
-
`;continue;case"paragraph_open":x+=`${y}<p>`;continue;case"paragraph_close":x+=`</p>
|
|
129
|
-
`;continue;case"list_item_open":{const _=e[k+1];x+=y+(_&&(_.type==="inline"||_.hidden||_.nesting===-1&&_.tag==="li")?"<li>":`<li>
|
|
130
|
-
`);continue}case"list_item_close":x+=`</li>
|
|
131
|
-
`;continue;case"bullet_list_open":x+=`${y}<ul>
|
|
132
|
-
`;continue;case"bullet_list_close":x+=`</ul>
|
|
133
|
-
`;continue;case"blockquote_open":x+=y+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
134
|
-
`);continue;case"blockquote_close":x+=`</blockquote>
|
|
135
|
-
`;continue;case"ordered_list_open":x+=`${y}<ol>
|
|
136
|
-
`;continue;case"ordered_list_close":x+=`</ol>
|
|
137
|
-
`;continue;case"table_open":x+=`${y}<table>
|
|
138
|
-
`;continue;case"table_close":x+=`</table>
|
|
139
|
-
`;continue;case"thead_open":x+=`${y}<thead>
|
|
140
|
-
`;continue;case"thead_close":x+=`</thead>
|
|
141
|
-
`;continue;case"tbody_open":x+=`${y}<tbody>
|
|
142
|
-
`;continue;case"tbody_close":x+=`</tbody>
|
|
143
|
-
`;continue;case"tr_open":x+=`${y}<tr>
|
|
144
|
-
`;continue;case"tr_close":x+=`</tr>
|
|
145
|
-
`;continue;case"td_open":x+=`${y}<td>`;continue;case"td_close":x+=`</td>
|
|
146
|
-
`;continue;case"th_open":x+=`${y}<th>`;continue;case"th_close":x+=`</th>
|
|
147
|
-
`;continue}else if($.length===1){const _=$[0];if(v==="ordered_list_open"&&_[0]==="start"){x+=`${y}<ol start="${On(_[1])}">
|
|
148
|
-
`;continue}if(v==="td_open"&&_[0]==="style"){x+=`${y}<td style="${On(_[1])}">`;continue}if(v==="th_open"&&_[0]==="style"){x+=`${y}<th style="${On(_[1])}">`;continue}}}x+=this.renderToken(e,k,s);continue}if(v==="code_block"&&A===Ln.code_block){x+=rv(g);continue}if(v==="fence"&&A===Ln.fence){x+=ow(g,s);continue}if(v==="html_block"&&A===Ln.html_block){x+=g.content;continue}const L=A(e,k,s,o,this);typeof L=="string"?x+=L:x+=yh(L,g.type)}return x}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 tw(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return Il(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
149
|
-
`:"",u=a?`>
|
|
150
|
-
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+Il(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(zf.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),zf.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(zf.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(zf.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...jj,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Ln.code_block)return rv(t);if(i==="html_block"&&o.html_block===Ln.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):fp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Ln.fence)return ow(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:yh(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,x=t.xhtmlOut===!0,k=x?`<br />
|
|
151
|
-
`:`<br>
|
|
152
|
-
`,g=t.breaks?k:`
|
|
153
|
-
`;if(e.length===1)return Uf(e,t,n,this,s,k,g);let v="";for(let y=0;y<e.length;y++){const A=e[y];if(A.type==="link_open"&&!u&&!d&&y+2<e.length){const _=e[y+1];if(e[y+2].type==="link_close"&&qj(_)){const E=`${nw(A)+Uf([_],t,n,this,s,k,g)}</a>`;if(r===Ln.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=E+g,y+=3;continue}v+=E,y+=2;continue}}if(A.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${nw(A)}</a>`,y+=1;continue}if(A.type==="em_open"&&!f&&!h&&y+2<e.length){const _=e[y+1];if(e[y+2].type==="em_close"&&sw(_)){v+=`<em>${Uf([_],t,n,this,s,k,g)}</em>`,y+=2;continue}}if(A.type==="strong_open"&&!p&&!m&&y+2<e.length){const _=e[y+1];if(e[y+2].type==="strong_close"&&sw(_)){v+=`<strong>${Uf([_],t,n,this,s,k,g)}</strong>`,y+=2;continue}}switch(A.type){case"text":if(o===Ln.text){const _=A.content.length===0?"":On(A.content);if(a===Ln.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=_+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=_;continue}break;case"text_special":if(i===Ln.text_special){A.content.length!==0&&(v+=On(A.content));continue}break;case"softbreak":if(r===Ln.softbreak){v+=g;continue}break;case"hardbreak":if(l===Ln.hardbreak){v+=k;continue}break;case"html_inline":if(a===Ln.html_inline){for(v+=A.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===Ln.code_inline){v+=dp(A);continue}break}const L=s[A.type];if(!L){v+=A.block?this.renderToken(e,y,t):fp(A,x);continue}const $=L(e,y,t,n,this);typeof $=="string"?v+=$:v+=yh($,A.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 tw(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}},Kj=Vj;const Gj=[],y0=4096;function Yj(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 Zj(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 Qj(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(!_6(e[n],t[n]))return!1;return!0}function _6(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||!Zj(e.attrs,t.attrs)||!Qj(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function iw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var Xj=class{core;cache=null;stats=iw();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=iw(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(uo(s??o?.env),!o||s&&s!==o.env){const I=s??{},R=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,P=!!n.options?.streamChunkedFallback,z=!R&&B,W=P||z,X=n.options?.streamChunkAdaptive!==!1,U=n.options?.streamChunkTargetChunks??8,Z=n.options?.streamChunkSizeChars,ce=n.options?.streamChunkSizeLines,fe=n.options?.streamChunkMaxChunks,se=!!n.__explicitStreamChunkConfig,Y=n.options?.autoTuneChunks!==!1,J=n.options?.streamChunkFenceAware??!0,le=n.options?.streamLargeCachePolicy??"retain",He=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,de=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let G,ae=!1;if(le==="skip"&&(ae=e.length>=He,!ae&&de!==void 0&&(G=rs(e),ae=G>=de)),ae){const q=this.parseFullDocument(e,I,n,G,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!kr(I)?.unbounded}),q.tokens}else if(W){const q=(pe,Ce,Ie)=>pe<Ce?Ce:pe>Ie?Ie:pe;G===void 0&&(G=rs(e));const ne=Y&&!se?ew(e.length,G,n.options):null,ge=ne?.maxChunkChars??(X?q(Math.ceil(e.length/U),8e3,64e3):Z??1e4),ue=ne?.maxChunkLines??(X?q(Math.ceil(G/U),150,700):ce??200),ye=ne?.maxChunks??(X?q(Math.ceil(e.length/64e3),U,32):fe),j=e.length>0&&e.charCodeAt(e.length-1)===10,te=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ne?.strategy!=="plain";if((P||te)&&(e.length>=ge*2||G>=ue*2)&&j){const pe=up(n,e,I,{maxChunkChars:ge,maxChunkLines:ue,fenceAware:ne?.fenceAware??J,maxChunks:ye});return this.cache={src:e,tokens:pe,env:I,lineCount:G,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,G),this.recordChunkedParseResult(I,P?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const me=this.parseFullDocument(e,I,n,G);return G=me.lineCount,this.cache={src:e,tokens:me.tokens,env:I,lineCount:G,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,G),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!kr(I)?.unbounded}),me.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",bs(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=No(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):No(e),a=r||l;if(a){const I=s??o.env;Pr(I);const R=No(e),B=this.parseFullDocument(e,I,n),P=B.tokens,z=B.lineCount;return this.cache={src:e,tokens:P,env:I,lineCount:z,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!kr(I)?.unbounded}),P}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<c&&e.length<c*1.5&&!e.startsWith(o.src)){const I=s??o.env,R=this.parseFullDocument(e,I,n),B=R.tokens,P=R.lineCount;return this.cache={src:e,tokens:B,env:I,lineCount:P,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!kr(I)?.unbounded}),B}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const I=o.lineCount??rs(o.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,I);let B=null;const P=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,W=n.options?.streamContextParseMinLines??2;let X;const U=()=>(X===void 0&&(X=rs(u)),X),Z=this.canDirectlyParseAppend(o),ce=Z&&this.shouldUseUnboundedAppend(e,o,u);let fe=!1;if(!Z)switch(P){case"lines":fe=U()>=W;break;case"constructs":if(u.length>=z){fe=!0;break}if(Yj(u)){fe=!0;break}fe=U()>=W;break;case"chars":default:fe=u.length>=z}if(R>0&&fe){const J=this.getTailLines(o.src,R)+u;try{const le=this.core.parse(J,o.env,n).tokens,He=le.findIndex(de=>de.map&&typeof de.map[1]=="number"&&de.map[1]>R);if(He!==-1){const de=le.slice(He),G=I-R;G!==0&&this.shiftTokenLines(de,G),B={tokens:de}}}catch{B=null}}else B=null;if(!B){const J=I;if(ce)B={tokens:Qu(n,u,o.env,{mode:"stream"})},J>0&&this.shiftTokenLines(B.tokens,J);else{const le=this.core.parse(u,o.env,n);J>0&&this.shiftTokenLines(le.tokens,J),B=le}}let se=0;if(o.tokens.length>0&&B.tokens.length>0){const J=o.tokens[o.tokens.length-1],le=B.tokens[0];try{J.type==="inline"&&le.type==="inline"&&(le.children&&le.children.length>0&&(J.children||(J.children=[]),this.appendTokens(J.children,le.children)),J.content=(J.content||"")+(le.content||""),se=1)}catch{se=0}}const Y=o.tokens.length;if(B.tokens.length>se){const J=o.tokens,le=B.tokens,He=Math.min(J.length,le.length-se);let de=0;for(let G=He;G>0;G--){let ae=!0;for(let me=0;me<G;me++){const q=J[J.length-G+me],ne=le[se+me];if(!_6(q,ne)){ae=!1;break}}if(ae){de=G;break}}de>0&&(se+=de),le.length>se&&this.appendTokens(o.tokens,le,se)}if(o.src=e,o.globalStateReason=null,o.lineCount=I+(X??U()),o.tokens.length>Y){const J=this.getLastSegment(o.tokens,e,Y,o.tokens.length,e.length-u.length,I);J?o.lastSegment=J:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ce&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",bs(o.env,{area:"stream",path:ce?"stream-unbounded-append":"stream-append",reason:ce?"large-delta":"safe-append",unbounded:ce}),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",bs(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,x=!h&&!u&&p,k=m||x,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,_=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let N=u&&o.lineCount!==void 0?o.lineCount+rs(u):void 0;if(k){N===void 0&&(N=rs(e));const I=(U,Z,ce)=>U<Z?Z:U>ce?ce:U,R=_&&!$?ew(e.length,N,n.options):null,B=R?.maxChunkChars??(g?I(Math.ceil(e.length/v),8e3,64e3):y??1e4),P=R?.maxChunkLines??(g?I(Math.ceil(N/v),150,700):A??200),z=R?.maxChunks??(g?I(Math.ceil(e.length/64e3),v,32):L),W=e.length>0&&e.charCodeAt(e.length-1)===10,X=x&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((m||X)&&(e.length>=B*2||N>=P*2)&&W){const U=up(n,e,d,{maxChunkChars:B,maxChunkLines:P,fenceAware:R?.fenceAware??E,maxChunks:z});return this.cache={src:e,tokens:U,env:d,lineCount:N,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),U}}const F=this.parseFullDocument(e,d,n,N),S=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:N,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!kr(d)?.unbounded}),S}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",bs(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",bs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=No(e);qd(t)&&Pr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?y6(n,e.length,s):"no";if(r==="yes"){const a=Qu(n,e,t);return bs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?rs(e):0)}}let l=s;if(r==="need-lines"&&(l=rs(e),v6(n,e.length,l))){const a=Qu(n,e,t);return bs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?rs(e):0),{tokens:Oc(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:rs(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+rs(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??Gj}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??rs(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-y0))+t,s=No(n);return e.globalStateCarry=n.length>y0?n.slice(n.length-y0):n,s&&(e.globalStateReason=s),s}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,s=e.length,o,i){if(s<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=s-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}}return null}getLineStartOffset(e,t,n,s){if(n!==void 0&&s!==void 0&&t>=s)return this.getLineStartOffsetFrom(e,n,t-s);if(t<=0)return 0;let o=t,i=-1;for(;o>0;){if(i=e.indexOf(`
|
|
159
|
-
`,i+1),i===-1)return e.length;o--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let s=n,o=t-1;for(;s>0;){if(o=e.indexOf(`
|
|
160
|
-
`,o+1),o===-1)return e.length;s--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??rs(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+rs(i);t.lineCount=m;const x=this.getDocLineCount(e,m);return r.map&&(r.map[1]=x),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:x,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 x=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??rs(t.src);t.tokens.splice(x,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=k+rs(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const y=t.tokens[h.tbodyOpenIndex];y?.map&&(y.map[1]=v)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
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=rs(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 rw={default:Wj,zero:zj,commonmark:Hj};function Jj(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function eV(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 lw(e){return e.experimental?{...e,...e.experimental}:e}function hi(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function aw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(hi(t,o)||hi(e,o))return!0}return!1}function cw(e,t,n){return hi(t,n)||hi(e,n)}function uw(e,t){const n=kr(e)?.chunk;if(n?.fallback){bs(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}bs(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function tV(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=rw[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=lw(n),typeof n.quotes=="string"){const _=n.quotes;_.length>=4?n.quotes=[_[0],_[1],_[2],_[3]]:n.quotes=["“","”","‘","’"]}let r=aw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=aw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=cw(i?.options,o,"fullChunkedFallback"),c=cw(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new jq;let p=null;const m=()=>(p||(p=new Kj(n)),p);let x=null;const k=()=>(x||(x=new Xj(h)),x);let g=null;const v=()=>(g||(g=new HA),g),y=_=>!u&&!!d&&!eV(_,d),A=(_,E)=>s==="default"&&!u&&p===null&&f!==null&&_.parse===f&&y(_)&&!_.stream.enabled&&E<(_.options.autoUnboundedThresholdChars??4e6)&&_.options.html===!1&&_.options.xhtmlOut===!1&&_.options.breaks===!1&&_.options.langPrefix==="language-"&&_.options.linkify===!1&&_.options.typographer===!1&&_.options.highlight===null,L=(_,E)=>s==="default"&&!u&&y(_)&&!_.stream.enabled&&!_.options.fullChunkedFallback&&E<(_.options.autoUnboundedThresholdChars??4e6)&&_.options.html===!1&&_.options.linkify===!1&&_.options.typographer===!1,$={core:h,block:h.block,inline:h.inline,get linkify(){const _=v();return Object.defineProperty(this,"linkify",{value:_,writable:!0,configurable:!0}),_},get renderer(){const _=m();return Object.defineProperty(this,"renderer",{value:_,writable:!0,configurable:!0}),_},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(_){const E=lw(_);return this.options={...this.options,...E},(hi(_,"fullChunkSizeChars")||hi(_,"fullChunkSizeLines")||hi(_,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(hi(_,"streamChunkSizeChars")||hi(_,"streamChunkSizeLines")||hi(_,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),hi(_,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),hi(_,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,x&&(x.reset(),x.resetStats())),this},configure(_){const E=typeof _=="string"?rw[_]:_;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const N=E.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(_,E){const N=Array.isArray(_)?_:[_],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const R=I.enable(N,!0);for(let B=0;B<R.length;B++)S.add(R[B])}if(!E){const I=N.filter(R=>!S.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(_,E){const N=Array.isArray(_)?_:[_],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const R=I.disable(N,!0);for(let B=0;B<R.length;B++)S.add(R[B])}if(!E){const I=N.filter(R=>!S.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(_,...E){const N=typeof _=="function"?_:_&&typeof _.default=="function"?_.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...E],S=_;return u=!0,N.apply(S,F),this},render(_,E){if(A(this,_.length)){E!==void 0&&uo(E);const S=Q_(_);if(S!==null)return E!==void 0&&bs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=E??{},F=this.parse(_,N);return m().render(F,this.options,N)},async renderAsync(_,E){if(A(this,_.length)){E!==void 0&&uo(E);const S=Q_(_);if(S!==null)return E!==void 0&&bs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=E??{},F=this.parse(_,N);return m().renderAsync(F,this.options,N)},renderIterable(_,E={}){const N=this.parseIterable(_,E);return m().render(N,this.options,E)},async renderAsyncIterable(_,E={}){const N=await this.parseAsyncIterable(_,E);return m().renderAsync(N,this.options,E)},renderInline(_,E={}){const N=this.parseInline(_,E);return m().render(N,this.options,E)},validateLink:o6,normalizeLink:i6,normalizeLinkText:r6,utils:dz,helpers:{...Jz},parse(_,E){if(typeof _!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&uo(E),L(this,_.length)){const I=sj(_);if(I!==null)return E!==void 0&&bs(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const N=E??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=y6(this,_.length);if(I==="yes"){const R=Qu(this,_,N);return bs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}I==="need-lines"&&(F=rs(_))}if(!this.stream.enabled){const I=_.length,R=this.options.autoTuneChunks!==!1,B=r,P=!a&&y(this),z=!!this.options.fullChunkedFallback,W=P&&I>=2e5;let X;(z||W||F!==void 0)&&(X=F??rs(_));const U=(z||W)&&R&&!B?Pj(I,X,this.options):null;if(z||W){const Z=X??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||Z>=(this.options.fullChunkThresholdLines??400):W){if(U&&U.strategy!=="plain"){const ce=up(this,_,N,{maxChunkChars:U.maxChunkChars,maxChunkLines:U.maxChunkLines,fenceAware:U.fenceAware,maxChunks:U.maxChunks});return E&&uw(E,z?"explicit-full-chunk":"default-large-string"),ce}if(z){const ce=(ae,me,q)=>ae<me?me:ae>q?q:ae,fe=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,Y=ce(Math.ceil(I/se),8e3,64e3),J=ce(Math.ceil(Z/se),150,700),le=fe?Y:this.options.fullChunkSizeChars??1e4,He=fe?J:this.options.fullChunkSizeLines??200,de=fe?ce(Math.ceil(I/64e3),se,32):this.options.fullChunkMaxChunks,G=up(this,_,N,{maxChunkChars:le,maxChunkLines:He,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:de});return E&&uw(E,"explicit-full-chunk"),G}}}if(F!==void 0&&y(this)&&v6(this,I,X??F)){const Z=Qu(this,_,N);return bs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Z}}const S=No(_);return bs(E,{area:"parse",path:"plain",reason:"default-plain"}),Oc(N,S,()=>h.parse(_,N,this).tokens)},parseIterable(_,E={}){return uo(E),Oj(this,_,E)},parseAsyncIterable(_,E={}){return uo(E),Rj(this,_,E)},parseIterableToSink(_,E,N={}){return uo(N),Bj(this,_,E,N)},parseAsyncIterableToSink(_,E,N={}){return uo(N),Dj(this,_,E,N)},parseInline(_,E={}){if(typeof _!="string")throw new TypeError("Input data should be a String");uo(E),qd(E)&&Pr(E);const N=h.createState(_,E,this);return N.inlineMode=!0,h.process(N),N.tokens}};if($.stream={enabled:!!n.stream,parse(_,E){return $.stream.enabled?k().parse(_,E,$):$.parse(_,E??{})},reset(){k().reset()},peek(){return x?x.peek():[]},stats(){return x?x.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){x&&x.resetStats()}},i?.components){const _=i.components;_.core?.rules&&$.core.ruler.enableOnly(_.core.rules),_.block?.rules&&$.block.ruler.enableOnly(_.block.rules),_.inline?.rules&&$.inline.ruler.enableOnly(_.inline.rules),_.inline2?.rules&&$.inline.ruler2.enableOnly(_.inline2.rules)}return d=Jj($),f=$.parse,$}var nV=tV;const w6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],sV=["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"],S6=["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"],oV=["svg","g","path"],iV=["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"],rV=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],lV=["action","data","href","src","srcset","poster","xlink:href","formaction"],aV=["script"],cV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],La=new Set(w6),uV=new Set(S6),Td=new Set([...w6,...sV,...S6,...oV]),C6=new Set([...Td,...iV]),dV=new Set(rV),fV=new Set(lV),Vd=new Set(aV),A6=new Set(cV);function M6(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 hV={amp:"&",bsol:"\\",colon:":",newline:`
|
|
163
|
-
`,sol:"/",tab:" "};function E6(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 hV[String(o??"").toLowerCase()]??t})}const qf=new Set(["http","https","mailto","tel"]),pV=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 T6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function mV(e,t,n){if(!ed(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function ed(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function gV(e,t){return t==="href"||t==="xlink:href"?ed(e,t)?qf:ta:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ta:(ed(e,t),qf)}function ka(e,t={}){const n=M6(E6(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=T6(n);return i?i==="file"?!mV(n,s,o):ed(s,o)?pV.has(i):!gV(s,o).has(i):!1}function vV(e){const t=E6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=T6(M6(t).toLowerCase());return n==="http"||n==="https"}function yV(e,t={}){const n=String(e??"").trim();return n?ka(n,t)?"":n:""}function dw(e){return yV(e,{tagName:"img",attrName:"src"})}function kV(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,x){return f[h].nesting===1&&f[h].attrJoin("class",t),x.renderToken(f,h,p,m,x)}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 x,k=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(x=g+1;x<=v&&r[(x-g)%a]===f.src[x];x++);const y=Math.floor((x-g)/a);if(y<i)return!1;x-=(x-g)%a;const A=f.src.slice(g,x),L=f.src.slice(x,v);if(!c(L,A))return!1;if(m)return!0;let $=h;for(;$++,!($>=p||(g=f.bMarks[$]+f.tShift[$],v=f.eMarks[$],g<v&&f.sCount[$]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[$]-f.blkIndent>=4)){for(x=g+1;x<=v&&r[(x-g)%a]===f.src[x];x++);if(!(Math.floor((x-g)/a)<y)&&(x-=(x-g)%a,x=f.skipSpaces(x),!(x<v))){k=!0;break}}const _=f.parentType,E=f.lineMax;f.parentType="container",f.lineMax=$;const N=f.push("container_"+t+"_open","div",1);N.markup=A,N.block=!0,N.info=L,N.map=[h,$],f.md.block.tokenize(f,h+1,$);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,x),F.block=!0,f.parentType=_,f.lineMax=E,f.line=$+(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 bV(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 x=0;x<a.length;x++){const k=a[x];if(k==="\\"){x++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=x;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 xV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(kV,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 A=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?A++:m[$]==="}"&&A--,A===0){L=$+1;break}L>0&&(h=m.slice(0,L))}h||(f=d||void 0)}if(o)return!0;const x=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=s;){const A=i.bMarks[k]+i.tShift[k],L=i.eMarks[k];if(i.src.slice(A,L).trim()===":::"){g=!0;break}k++}g||(k=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!x},f&&v.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[L,$]of Object.entries(A)){const _=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,_?JSON.stringify($):String($))}}catch{const A=bV(h);if(A)for(const[L,$]of Object.entries(A)){const _=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,_?JSON.stringify($):String($))}else v.attrSet("data-attrs",h)}const y=[];for(let A=n+1;A<k;A++){const L=i.bMarks[A]+i.tShift[A],$=i.eMarks[A];y.push(i.src.slice(L,$))}if(y.some(A=>A.trim().length>0)){let A=y.join(`
|
|
165
|
-
`);A.endsWith(`
|
|
166
|
-
`)||(A+=`
|
|
167
|
-
`),A.endsWith(`
|
|
168
|
-
|
|
169
|
-
`)||(A+=`
|
|
170
|
-
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=A);const $=[];i.md.block.parse(A,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Zo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xn(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 Cm(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 _V=/^[a-z][a-z0-9_-]*$/;function fw(e){return _V.test(String(e??"").trim().toLowerCase())}function Ci(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return fw(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)?"":fw(o)?o:""}function nu(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Ci(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function wV(...e){const t=new Set,n=[];for(const s of e)for(const o of nu(s))t.has(o)||(t.add(o),n.push(o));return n}function SV(e){const t=nu(e);return{key:t.join(","),tags:t}}function N6(e){return Ci(e)}function CV(e,t){const n=String(e??""),s=Ci(t);if(!s)return!1;const o=Zo(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 I6(e,t){const n=Ci(t);return!!n&&!Td.has(n)&&!CV(e,n)}function AV(e,t){const n=String(e??""),s=Ci(t);if(!s)return n;const o=Zo(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 $6=La,MV=Td,L6=new Set(uV);L6.delete("details");const EV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,TV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,lv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,NV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function hp(e){return(e.match(lv)?.[1]??"").toLowerCase()}function Xy(e){return/^\s*<\s*\//.test(e)}function Jy(e,t){return $6.has(t)||/\/\s*>\s*$/.test(e)}function IV(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=hp(i);if(r===t){if(Xy(i)){if(n===0)return s;n--;continue}Jy(i,r)||n++}}return-1}function $V(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=hp(o);if(i===t){if(Xy(o)){n>0&&n--;continue}Jy(o,i)||n++}}return n}function hw(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Zo(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 LV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Zo(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 pp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function FV(e){const t=e;return t.meta||(t.meta={}),t.meta}function k0(e,t,n){const s=FV(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function OV(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Zo(h)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!s.length))for(const p of s)p.raw+=h,p.inner+=h},l=()=>{!s.length||!o||(r(`
|
|
171
|
-
`),o=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<s.length;m++)s[m].raw+=h,m<s.length-1&&(s[m].inner+=h);const p=s.pop();k0(p.token,p.raw,p.inner)},u=h=>{const p=s[s.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Zo(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const x=m??(h.type==="html_inline"?hp(p):"");if(!(x&&t.has(x))){r(p);return}const k=Xy(p),g=!k&&Jy(p,x);if(k){if(!s.length||s[s.length-1].tag!==x){r(p);return}c(p);return}if(r(p),g){k0(h,p,"");return}s.push({tag:x,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,x=!0;for(const k of h.children){const g=pp(k),v=k.type==="html_inline"?hp(g):"",y=v&&t.has(v);let A=g;if(x&&p&&g&&(s.length||y)){const L=p.indexOf(g,m);if(L!==-1)a(p.slice(m,L)),A=p.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!y)continue;x=!1}}f(k,A,v)}x&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=pp(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
|
|
172
|
-
`:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)k0(h.token,h.raw,h.inner)}function RV(e){return/^\s*<\s*[!?]/.test(e)}function BV(e){const t=new Set(MV);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 pw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function DV(e,t){let n=null;for(const i of e.matchAll(EV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();pw(l,t)&&Xn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(TV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();pw(l,t)&&Xn(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 PV(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function HV(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(PV(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(lv);if(!h){i("<",c),u=d+1;continue}const p=Xn(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),x=(h[1]??"").toLowerCase();t.has(x)?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=DV(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+=pp(a),o=s.buffer;const c=Xn(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=pp(a),u=(c.match(lv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Xn(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 WV=["a","span","strong","em","b","i","u"];function zV(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Ci(f);h&&n.add(h)}const s=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=Ci(String(v??""));y&&p.add(y)}const x=BV(Array.from(p)),k=new Set(WV);for(const v of p)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:x,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!x.has(v)||L6.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 x={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},x,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[x]},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 x of h){const k=x;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=HV(v,p);if(k.children=y.children,y.pendingBuffer){const A=g.lastIndexOf(y.pendingBuffer);if(A!==-1){const L=g.slice(0,A);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}OV(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:x}=s(f),k=[];for(let g=0;g<h.length;g++){const v=h[g];if(k.length>0){const[A,L]=k[k.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const _=h[L],E=`${String(_.content||"")}
|
|
173
|
-
${$}`,N=Xn(E),F=N===-1?null:hw(E,A,N+1);if(F){const S=E.slice(0,F.end),I=E.slice(F.end);_.content=S,_.loading=!1,h.splice(g,1),k.pop();const R=d(_,I)?[]:c(I,u(h,g,"paragraph"));R.length&&h.splice(g,0,...R),g--;continue}_.content=E,_.loading!==!1&&(_.loading=!0)}h.splice(g,1),g--;continue}}const y=o(v);if(y){if(RV(y))continue;const A=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!A||!x(A))continue;if(i(v,y),!L)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(y)&&LV(y,A)>0&&k.push([A,g]);else if(k.length>0&&A&&k[k.length-1][0]===A){const[,$]=k[k.length-1],_=h[$];_.content=`${String(_.content||"")}
|
|
174
|
-
${y}`,_.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 A=v.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(A);if(A){const[,$]=k[k.length-1],_=h[$];_.content=`${_.content||""}
|
|
175
|
-
${A}`,_.loading!==!1&&(_.loading=!L)}L&&k.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let _=g.get($);return _||(_=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,_)),_},A=$=>{let _=v.get($);return _||(_=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,_)),_},L=[];for(let $=0;$<h.length;$++){const _=h[$],E=String(_.content??"");if(L.length>0){const F=L[L.length-1],S=h[F.index],I=_.type==="html_block"?A(F.tag).exec(E):null;if(I){const P=I.index+I[0].length,z=E.slice(0,P),W=E.slice(P);S.content=`${String(S.content??"")}
|
|
176
|
-
${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),L.pop();const X=d(S,W)?[]:c(W,u(h,$,"paragraph"));X.length?h.splice($,1,...X):(h.splice($,1),$--);continue}if(_.type!=="inline")continue;const R=Array.isArray(_.children)?_.children:[],B=IV(R,F.tag);if(B!==-1){const P=R.slice(0,B+1),z=R.slice(B+1),W=P.map(X=>String(X?.content??X?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
177
|
-
${W}`,Array.isArray(S.children)&&S.children.push(...P),z.length){const X=z.map(U=>String(U.content??U.raw??"")).join("");if(X.trim()){const U=X.replace(/^\s+/,"");if(d(S,X))h.splice($,1),$--;else if(U.startsWith("<"))h.splice($,1,{type:"html_block",content:U});else{const Z=c(X,u(h,$,"paragraph"));h.splice($,1,...Z)}}else h.splice($,1),$--}else h.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
|
|
178
|
-
${E}`,Array.isArray(S.children)&&S.children.push(...R),h.splice($,1),$--;continue}if(_.type!=="inline")continue;const N=Array.isArray(_.children)?_.children:[];for(const F of m)if((N.length?$V(N,F):y(F).test(E)&&!A(F).test(E)?1:0)>0){L.push({tag:F,index:$});break}}}{let g=0;for(let v=0;v<h.length;v++){const y=h[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const _=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(_.startsWith("!")||_.startsWith("?")){v.loading=!1;continue}if(m.has(_)){const B=String(v.content??""),P=Xn(B),z=P===-1?null:hw(B,_,P+1);v.loading=z?!1:v.loading!==void 0?v.loading:!0;const W=z?.start??-1,X=z?z.end-z.start:0;if(W!==-1){const U=B.slice(0,W+X);let Z="";P!==-1&&P<W&&(Z=B.slice(P+1,W)),v.children=[{type:_,content:Z,raw:U,attrs:[],tag:_,loading:!1}],v.content=U,v.raw=U;const ce=c(B.slice(W+X)||"","text");ce.length&&h.splice(g+1,0,...ce)}else v.children=[{type:_,content:"",raw:B,attrs:[],tag:_,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(_))continue;v.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=E.exec(v.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${_}\\s*>`,"i").exec(F),I=S?S.index:-1,R=S?S[0].length:0;if(I!==-1){const B=F.slice(0,I+R),P=(F.slice(I+R)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:B,tag:_,loading:!1}],v.content=B,v.raw=B,P&&h.splice(g+1,0,P.startsWith("<")?{type:"html_block",content:P}:{type:"text",content:P,raw:P})}else v.children=[{type:"html_block",content:v.content,tag:_,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const _=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=v.children[1],N=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&N===_)continue;p.has(_)?(v.children[0].loading=!0,v.children[0].tag=_,v.children.push({type:"html_inline",tag:_,loading:!0,content:`</${_}>`})):v.children=[{type:"html_block",loading:!0,tag:_,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 _=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(_))continue;v.children=[{type:"html_block",loading:!1,tag:_,content:v.children.map(E=>E.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),A=v,L=A.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(A.children.length=0);continue}const $=String(L.content??y).match(NV)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||$6.has($)){A.children=[{type:"html_inline",content:y}];continue}A.children.length=0}}})}function UV(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 qV(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&&!UV(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 F6=/\.([a-z0-9]{1,15})$/i,jV=/[_()[\]{}<>]/u,VV=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,KV=/[?#@]/u,GV=/[\\/]/u,YV=/^[\p{L}\p{N}./\\-]+$/u,ZV=/^[A-Za-z0-9-]{1,63}$/u,QV=/^xn--[a-z0-9-]{2,59}$/i,XV=/^(?:[A-Z]{1,6}|\d{1,8})$/u,JV=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,eK=/文件名\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,tK=/文件名\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,nK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,sK=new Set(["ai","md","py","rs","sh","zip"]),O6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),oK=new Set([...O6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),iK=new Set(["com","dev","io","page","site"]),rK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),lK=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Nd(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function b0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Nd(n)?n:void 0}function mw(e,t){if(!Nd(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function gw(e){const t=Kd(e);return Nd(t)?t:void 0}function aK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function vw(e,t){if(!Nd(t))return;const n=String(e??"").trim().split(/\s+/u).map(aK).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>mp(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>mp(o,{marketTicker:!0}))&&(s.marketTicker=!0),Nd(s)?s:void 0}function Dl(e,t=!1){let n;return{options(s){return t||s==null?mw(e,n):mw(e,b0(gw(s),vw(s,n)))},remember(s){const o=gw(s);n=t?b0(n,o):b0(o,vw(s,n))},reset(){n=void 0}}}function yw(e){return ZV.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function cK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return yw(n)||QV.test(n)?t.every(yw):!1}function R6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function uK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function dK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function B6(e,t,n){const s=uK(t);return R6(e)&&dK(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function Kd(e){const t=String(e??"");return{explicitFilename:eK.test(t),filename:tK.test(t),marketTicker:nK.test(t)}}function fK(e){return cK(e.split(/[\\/]/)[0]??"")}function hK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function pK(e){if(jV.test(e)||!YV.test(e))return!0;if(GV.test(e))return!fK(e);const t=e.replace(F6,"");return R6(t)?!0:t.split(".").filter(Boolean).some(hK)}function mK(e,t,n){if(!(n?oK:O6).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?JV:XV).test(s)}function mp(e,t={}){if(!e||VV.test(e)||KV.test(e))return!1;const n=e.match(F6);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return mK(e,s,t.marketTicker===!0)?!0:lK.has(s)?!sK.has(s)||t.filename?!0:pK(e):!!(t.explicitFilename&&iK.has(s)||t.filename&&rK.has(s))}const kw=["!"];function Eo(e){return{type:"text",content:e,raw:e}}function na(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function sa(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function sl(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function gK(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(Eo(t))}}function bw(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 vK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function yK(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 kK(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 bK(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=xK(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function xK(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=Kd(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=kK(e,s,i),l=vK(o);if(o.markup==="linkify"&&r&&!B6(r,l,t)&&mp(r,n)){e.splice(s,i-s+1,Eo(r));continue}const a=bw(l,kw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=bw(u.content,kw);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 x=l;if(a!==-1)x=l.slice(0,a);else if(p){const k=encodeURI(p);if(k&&l.endsWith(k))x=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(x=l.slice(0,v))}}x!==l&&yK(o,x),p&&e.splice(i+1,0,Eo(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(Eo(r));const c=i[1],u=l[1].length;na(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(sl(c,d,!e[s+4]?.content?.startsWith(")"))),sa(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(Eo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Eo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(h+=e[s+4]?.content||"",e[s+4].content=""),na(a,f),a.push(sl(c,h,!e[s+4]?.content?.startsWith(")"))),sa(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(Eo(p)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(sl(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Eo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(sl(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Eo(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,x=e[p];if(m===1&&x.type==="em_close")break;if(m===2&&x.type==="strong_close")break;if(m===3&&(x.type==="em_close"||x.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(Eo(l)),na(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(sl(a,c,u)),sa(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Eo(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(Eo(r)),na(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(sl(l,a,c)),sa(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Eo(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(Eo(r)),na(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const f=e[s+2].attrs?.find(h=>h[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(f||c)+e[s+5].content,e[s+5].content=""):c=f||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const f=(e[s+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[s+2]?.content?.slice(0,f)||"",e[s+2].content="")}i.push(sl(a,c,d)),sa(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];na(a,2),a.push(sl(r,l,!1)),sa(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;gK(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function _K(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=wK(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function wK(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 SK(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=CK(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function CK(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 x=u+1;for(;x<e.length&&e[x].type==="text"&&e[x].content==="";)x++;const k=e[x];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 x=u+1;for(;x<e.length&&e[x].type==="text"&&e[x].content==="";)x++;const k=e[x];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=AK(l),l}function AK(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=MK(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 MK(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 EK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=FK(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 xw(){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 _w(){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 ww(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 D6(e,t){if(!e.startsWith("|")||e.includes(`
|
|
179
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function x0(e){return D6(e)!==null}function P6(e){return/^:?-+:?$/.test(e.trim())}function TK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(P6)}function NK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function IK(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(P6)&&NK(n)}function $K(e){return e==="|"||e==="|:"}function LK(e){const t=D6(e);return t!==null&&t.every(n=>!n.includes(":"))}function FK(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
180
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
181
|
-
`),d=!t&&!r.includes(`
|
|
182
|
-
`)&&/\r?\n$/.test(n)&&x0(r);if(!t&&(r.includes(`
|
|
183
|
-
`)&&u.length===0&&x0(a)&&IK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>ww(p)),h=[...xw(),...f,..._w()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
184
|
-
`)&&u.length===0&&x0(a)&&TK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>ww(p)),h=[...xw(),...f,..._w()];s.splice(o-1,3,...h)}else r.includes(`
|
|
185
|
-
`)&&u.length===0&&LK(a)&&$K(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function OK(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 RK=OK;const BK=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],gp=BK.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),DK=/\\[a-z]+/i,H6="(?:\\\\|\\u0008)",PK=new RegExp(String.raw`${H6}(?:${gp})\s*\{[^}]+\}`,"i"),HK=new RegExp(String.raw`(?:${H6})?(?:${gp})\s*\{`,"i"),WK=/\\(?:text|frac|left|right|times)/,zK=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,UK=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,qK=/[A-Z]+\s*\([^)]+\)/i,jK=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,VK=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,KK=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,GK={"\b":"\\b","\v":"\\v","\f":"\\f"};function YK(e){let t="";for(const n of e)t+=GK[n]??n;return t}function xc(e){if(!e)return!1;const t=YK(e),n=t.trim();if(KK.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=DK.test(t),o=PK.test(t),i=HK.test(t),r=WK.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=zK.test(t)&&!UK.test(t),c=qK.test(t),u=jK.test(n),d=VK.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 W6="__markstreamMathPluginApplied",av=80,z6=2e4,Sw=z6+4096;function U6(e){return!!e[W6]}function ZK(e){e[W6]=!0}const q6=["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"],QK=["cdot","mathbf{","partial","mu_{"],j6=q6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),V6="[ \r\b\f\v]",XK=new RegExp(`([^\\\\])(${QK.map(e=>e).join("|")})+`,"g"),JK=/span\{([^}]+)\}/,eG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,tG=/(^|[^\\])\\\r?\n/g,nG=/(^|[^\\])\\$/g,sG=new RegExp(`(${V6})|(${j6})\\b`,"g"),Cw=new Map,Aw=new Map;function oG(e){if(!e)return sG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Cw.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${V6})|(${o})\\b`,"g");return Cw.set(n,i),i}function iG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Aw.get(s);if(o)return o;const i=e?[gp,j6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),gp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Aw.set(s,r),r}const Mw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Ew(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Tw(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function ol(e,t){const n=t?.commands??q6,s=t?.escapeExclamation??!0,o=t?.commands==null,i=oG(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&Mw[u]!==void 0)return`\\${Mw[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=iG(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(JK,"span\\{$1\\}").replace(eG,"\\operatorname{span}\\{$1\\}"),l=l.replace(tG,`$1\\\\
|
|
186
|
-
`),l=l.replace(nG,"$1\\\\"),l=l.replace(XK,"$1\\$2"),l}function Nw(e){const t=e.trim();return!(!xc(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 K6(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 vp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function rG(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 Gd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function cv(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Gd(e,s)){n=s+1;continue}return s}return-1}function _0(e,t){let n=t;for(;n<e.length;){const s=cv(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function Hu(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(!Gd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function Iw(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=vp(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Gd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function ek(e,t,n){const s=$d(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!$d(s.slice(0,o)).trim()||Gd(s,o))return-1;const i=K6(s);if(vp(i,o))return-1;const r=Iw(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Iw(s,n,0,o,i))return-1;return o}function Id(e){return e===" "||e===" "}function $d(e){let t=e.length;for(;t>0&&Id(e[t-1]);)t--;return e.slice(0,t)}function $w(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
187
|
-
`&&t++;return t}function Lw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function lG(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(!Id(o))return!1}return n>=3}function aG(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 cG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(aG)}function uG(e){let t=0;if(!Lw(e[t]))return!1;for(;Lw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Id(e[t+1])}function G6(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&&Id(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Id(t[1])||uG(t)||lG(t)||cG(t))}function Fw(e,t){return e?t?`${e}
|
|
188
|
-
${t}`:e:t}function uv(e){const t=String(e??"").trim();return t?xc(t):!1}function Ow(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function Y6(e){if(e.length<=Sw)return{source:e,lineOffset:0};let t=e.length-Sw;const n=e.indexOf(`
|
|
189
|
-
`,t);return n===-1?{source:"",lineOffset:$w(e)}:(t=n+1,{source:e.slice(t),lineOffset:$w(e.slice(0,t))})}function Z6(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=Y6(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-av-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=$d(s[r]);if(l&&!G6(l)){for(const[a,c]of i)if(ek(l,a,c)!==-1)return!0}}return!1}function dG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=Y6(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-av-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=$d(o[l]);for(const[c,u]of r){const d=ek(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>av){h=!0;break}const m=o[p],x=Hu(m,u);if(x!==-1){const k=Fw(f,m.slice(0,x));if(!uv(k)){h=!0;break}const g=m.slice(x+u.length),v=g.trim()?`suffix:${Ow(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,x,Ow(k),v].join(":")}if(G6(m)){h=!0;break}if(f=Fw(f,m),f.length>z6){h=!0;break}}if(!h&&uv(f))return["pending",c,s+l,d].join(":")}}return null}function w0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function fG(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function S0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function hG(e,t){ZK(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},s=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let y=v;for(;y<g.length&&(g[y]===" "||g[y]===" ");)y++;if(y===v||!(g[y]===`
|
|
190
|
-
`||g[y]==="\r"&&g[y+1]===`
|
|
191
|
-
`))return v;const A=g.slice(v,y),L=a.push("text","",0);return L.content=A,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const A=a.push("text","",0);return A.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,x=p;const k=p;for(const[g,v]of f){const y=a.src,A=K6(y),L=rG(y,u);let $=!1;g==="$$"&&m!==k&&(m=k);let _=-1,E=-1,N=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const B=a.push("text_special","",0);B.content=S==="\\)"?")":"(",B.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let B=0;for(;B<S.length;){const P=cv(S,B);if(P===-1){const J=S.slice(B);if(J){const le=a.push("text","",0);le.content=J,a.pos=a.pos+J.length,m=a.pos}break}if(P>0&&S[P-1]==="$"||P+1<S.length&&S[P+1]==="$"){const J=S.slice(B,P+1);if(J){const le=a.push("text","",0);le.content=J,a.pos=a.pos+J.length,m=a.pos}B=P+1;continue}const z=S.slice(B,P);if(z){const J=a.push("text","",0);J.content=z,a.pos=a.pos+z.length,m=a.pos}const W=_0(S,P+1);if(W===-1){const J=S.slice(P),le=a.push("text","",0);le.content=J,a.pos=a.pos+J.length,m=a.pos;break}const X=S.slice(P+1,W),U=X.includes("`"),Z=!X||!X.trim(),ce=S[W+1],fe=w0(X,ce),se=S0(X);if(!U&&!Z&&!fe&&!se){const J=a.push("math_inline","math",0);J.content=ol(X,t),J.markup="$",J.raw=`$${X}$`,J.loading=!1,a.pos=a.pos+(W-P+1),m=a.pos,B=W+1;continue}const Y=a.push("text","",0);Y.content="$",a.pos=a.pos+1,m=a.pos,B=P+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),W=a.push("text","",0);W.content=z,a.pos=a.pos+z.length,m=a.pos}const B=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,z,W]=B,X=W.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),U=X?X[1]:W,Z=X&&X[2]?X[2]:null,ce=a.push("image","img",0);ce.attrs=[["src",U],["alt",z]],Z&&ce.attrs.push(["title",Z]),ce.content=z,ce.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+B[0].length,m=a.pos;const fe=S.slice(I+B[0].length);fe&&F(fe);return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos;return}const R=a.push("text","",0);R.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(Gd(y,S)){m=S+Math.max(1,g.length);continue}const I=vp(A,S);if(I){m=I[1];continue}const R=vp(L,S);if(R){m=R[1];continue}if(S===_&&m===E){if(N++,N>2){m=S+Math.max(1,g.length);continue}}else N=0,_=S,E=m;if(g==="("&&S>0){let fe=S-1;for(;fe>=0&&y[fe]===" ";)fe--;if(fe>=0&&y[fe]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const B=g==="$"?_0(y,S+g.length):RK(y,S+g.length,g,v);if(B===-1){const fe=y.slice(S+g.length);if(fe.includes(g)){m=y.indexOf(g,S+g.length);continue}if(B===-1){const se=g==="$"&&fG(fe);if(u&&!c&&!se&&xc(fe)&&!fe.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const Y=x?y.slice(x,m):y.slice(0,m),J=Ew(Y)%2===1;if(x)F(y.slice(x,m));else{let le=y.slice(0,m);le.endsWith(g)&&(le=le.slice(0,le.length-g.length)),F(le)}if(J){const le=Tw(Y)?.marker??"**",He=a.push("strong_open","",0);He.markup=le;const de=a.push("math_inline","math",0);de.content=ol(fe,t),de.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",de.raw=`${g}${fe}${v}`,de.loading=!0,He.content=fe,a.push("strong_close","",0)}else{const le=a.push("math_inline","math",0);le.content=ol(fe,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${fe}${v}`,le.loading=!0}a.pos=y.length}m=y.length,x=m}break}}const P=y.slice(S+g.length,B),z=P.includes("`"),W=!P||!P.trim(),X=g==="$",U=y[B+v.length],Z=X&&w0(P,U),ce=X&&S0(P);if(c?z||W||Z||ce:z||W||Z||ce||!X&&!xc(P)){m=B+v.length;const fe=y.slice(a.pos,m);a.pending||(F(fe),x=m);continue}if($=!0,!l){const fe=y.slice(a.pos-(a.pending??"").length,S);let se=y.slice(0,m)?y.slice(x,S):fe;const Y=Ew(se)%2===1;S!==a.pos&&Y&&(se=a.pending+y.slice(a.pos,S));const J=Y?Tw(se):null,le=J?.marker??"**";if(a.pending!==se)if(a.pending="",Y)if(J){const He=se.slice(J.index+le.length);F(se.slice(0,J.index));const de=a.push("strong_open","",0);de.markup=le;const G=a.push("text","",0);G.content=He,a.push("strong_close","",0)}else F(se);else F(se);if(Y){const He=a.push("strong_open","",0);He.markup=le;const de=a.push("math_inline","math",0);de.content=ol(P,t),de.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",de.raw=`${g}${P}${v}`,de.loading=!1;const G=y.slice(B+v.length).startsWith(le);return G&&a.push("strong_close","",0),a.pos=d(y,B+v.length),m=a.pos,x=m,G||a.push("strong_close","",0),!0}else{const He=a.push("math_inline","math",0);He.content=ol(P,t),He.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",He.raw=`${g}${P}${v}`,He.loading=!1}}return m=d(y,B+v.length),x=m,a.pos=m,!0}if($){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const I=cv(y,S);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){S=I+2;continue}if(I>0&&y[I-1]==="$"){S=I+1;continue}const R=_0(y,I+1);if(R===-1)break;const B=y.slice(I+1,R),P=B.includes("`"),z=!B||!B.trim(),W=y[R+1],X=w0(B,W),U=S0(B);if(!P&&!z&&!X&&!U){const Z=y.slice(m,I);Z&&F(Z);const ce=a.push("math_inline","math",0);ce.content=ol(B,t),ce.markup="$",ce.raw=`$${B}$`,ce.loading=!1,m=R+1,S=R+1}else F("$"),S=I+1}S<y.length&&F(y.slice(S))}else m<y.length&&F(y.slice(m));a.pos=y.length}return!0}}return!1},o=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),x=!1,k="",g="",v=!1,y="",A=!1;for(const[Z,ce]of h)if(m.startsWith(Z))if(Z.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){x=!0,k=Z,g=ce;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){x=!0,k=Z,g=ce;break}continue}else{const fe=u.tokens[u.tokens.length-1];if(fe&&fe.type==="list_item_open"&&fe.mark==="-"&&m.slice(Z.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const se=m.indexOf("]");if(m.slice(se).trim()!=="]")continue;const Y=m.slice(Z.length,se);if(Z==="["?Nw(Y):xc(Y)){x=!0,k=Z,g=ce;break}continue}}else{x=!0,k=Z,g=ce;break}else if((Z==="$$"||Z==="\\[")&&m.endsWith(Z)&&l+1<a){const fe=ek(m,Z,ce);if(fe===-1)continue;y=$d(m.slice(0,fe)),A=!0;const se=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(se,u.eMarks[l+1]).trim(),v=!0,x=!0,k=Z,g=ce;break}if(!x)return!1;if(c&&!A)return!0;const L=m.indexOf(k),$=L+k.length,_=!f&&k==="["?m.indexOf("\\]",$):-1,E=_>=0?"\\]":g,N=_>=0?_:Hu(m,g,$);if(!v&&N>k.length){const Z=m.slice(L+k.length,N),ce=u.push("math_block","math",0);ce.content=ol(Z),ce.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ce.map=[l,l+1],ce.raw=`${k}${Z}${E}`,ce.block=!0,ce.loading=!1,u.line=l+1;const fe=m.slice(N+E.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",I=!1,R="",B=l;const P=v?m:m===k?"":m.slice(k.length),z=!f&&k==="\\["?"]":"",W=Hu(P,g);if(W!==-1){const Z=W;S=P.slice(0,Z),R=P.slice(Z+g.length),B=v?l+1:l,I=!0,F=B}else for(P&&!v&&(S=P),F=l+1;F<a;F++){const Z=u.bMarks[F]+u.tShift[F],ce=u.eMarks[F],fe=u.src.slice(Z,ce),se=fe.trim();if(!f&&k==="["&&se==="\\]"){g="\\]",I=!0;break}if(z&&fe.trim()===z){g=z,I=!0;break}if(se===g){I=!0;break}else if(!f&&k==="["&&fe.includes("\\]")){I=!0;const Y=fe.indexOf("\\]");g="\\]";const J=fe.slice(0,Y);J&&(S+=(S?`
|
|
192
|
-
`:"")+J),R=fe.slice(Y+g.length),B=F;break}else if(Hu(fe,g)!==-1){I=!0;const Y=Hu(fe,g),J=fe.slice(0,Y);J&&(S+=(S?`
|
|
193
|
-
`:"")+J),R=fe.slice(Y+g.length),B=F;break}S+=(S?`
|
|
194
|
-
`:"")+fe}if((!d||f)&&!I)return!1;const X=/^\s*!\[/.test(S);if(!(A?!X&&uv(S):k==="$$"?!X:k==="["?Nw(S):xc(S)))return!1;if(c)return!0;y&&n(u,y,l);const U=u.push("math_block","math",0);return U.content=ol(S),U.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",U.raw=`${k}${S}${S.startsWith(`
|
|
195
|
-
`)?`
|
|
196
|
-
`:""}${g}`,U.map=[l,F+1],U.block=!0,U.loading=!I,u.line=F+1,R.trim()&&n(u,R,B),!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 pG(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function mG(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 nV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!ka(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&hG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&xV(i),e.enableFixIndentedCodeBlock!==!1&&qV(i),bK(i),SK(i),_K(i),EK(i),pG(i),zV(i,{customHtmlTags:e.customHtmlTags}),i}function ba(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=>ba(n))),t}function gG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function vG(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 yG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function jf(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(...Jn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const Rw=/\r?\n[ \t]*`+\s*$/,Q6=["diff ","index ","--- ","+++ ","@@ "],kG=/\r?\n/;function bG(e){const t=String(e??"");return t?Q6.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Bw(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function xG(e,t){const n=[],s=[],o=[],i=[],r=e.split(kG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!Q6.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);o.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(p.startsWith("+")){const m=p.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{Bw(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&&bG(p)||c(p)}(t||o.length>0||i.length>0)&&Bw(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 tk(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(Rw.test(a)&&(a=a.replace(Rw,"")),r){const{original:c,updated:u}=xG(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 _G(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function wG(){return{type:"hardbreak",raw:`\\
|
|
201
|
-
`}}function SG(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(...Jn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let C0=null;const A0=new WeakMap;function Dw(){return C0||(C0={customTagSet:null,allowedTagSet:Em()}),C0}function X6(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function J6(e){return/^<\s*\//.test(e)}function eM(e,t){return/\/\s*>\s*$/.test(t)||La.has(e)}function CG(e){if(!e||e.length===0)return Dw();const t=A0.get(e);if(t)return t;const n=e.map(Ci).filter(Boolean);if(!n.length){const o=Dw();return A0.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Em({customHtmlTags:e})};return A0.set(e,s),s}function tM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function AG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function yp(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function MG(e,t,n){const s=e.slice();return yp(s,"href")||s.push(["href",t]),n!=null&&!yp(s,"title")&&s.push(["title",n]),s}function dv(e){return e.map(tM).join("")}function kh(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:kh(s.children)});continue}t.push(s)}return t}function EG(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=X6(r),a=J6(r),c=eM(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function M0(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?EG(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:dv(s),innerTokens:o,nextIndex:i}}function TG(e,t,n,s,o,i,r){const l=String(e.content??""),a=X6(l),{customTagSet:c,allowedTagSet:u}=CG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!M0(t,n,a).closed){const A=tM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=J6(l),f=eM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=M0(t,n,a),L=Cm(l),$=A.innerTokens,_=String(yp(L,"href")??""),E=yp(L,"title"),N=E==null?null:String(E),F=MG(L,_,N),S=kh($.length?s($,o,i,r):[]),I=$.length?dv($):_||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:_,title:N,text:I,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=M0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:kh(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=kh(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,x=!h.closed,k=!1;if(!h.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),k=!0,x=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const A=y[1],L=y[2]||y[3]||y[4]||"";g.push([A,L])}if(c?.has(a)){const A=AG(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:h.innerTokens.length?dv(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:A?.raw??m,loading:e.loading||x,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:x,autoClosed:k},h.nextIndex]}function nM(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=>nM(t)).join(""):String(e.content??"")}function NG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>nM(t)).join("")}function Pw(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=NG(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 IG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function $G(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(...Jn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function LG(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 kp(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 FG(e,t,n){const s=e.slice();return kp(s,"href")||s.push(["href",t]),n!=null&&!kp(s,"title")&&s.push(["title",n]),s}function Vf(e,t,n){const s=e[t],o=LG(s.attrs),i=String(kp(o,"href")??""),r=kp(o,"title"),l=r==null?null:String(r),a=FG(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(x=>x.type==="strong_open")){const x=String(h.content??""),k=String(h.raw??x),g=ba(h);g.content=x.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=Jn(f,void 0,void 0,n),m=p.map(x=>{const k=x;return"content"in x?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 Hw(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 OG(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Ww(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(...Jn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const RG=/\\([\\()[\]`$|*_\-!])/g;function BG(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(RG,"$1")===t))return n}function Nu(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(...Jn(l,BG(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function DG(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(...Jn(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 PG(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(...Jn(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 HG(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const WG=/[^~]*~{2,}[^~]+/,zG=/\*\*/,UG=/[[_*^~]/,qG=/\\([\\()[\]`$|*_\-!])/g,nk=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),jG=/\s/u,VG=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,KG=/\p{P}/u,GG=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,YG=/:\/\//;function ZG(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 sM(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&&nk.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function $l(e){return!!e&&jG.test(e)}function Ll(e){return!!e&&(VG.test(e)||KG.test(e))}function QG(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||$l(s)?!1:!(Ll(s)&&n&&!$l(n)&&!Ll(n))}function XG(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||$l(n)?!1:!(Ll(n)&&s&&!$l(s)&&!Ll(s))}function JG(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?sM(e,s):t.indexOf("*",s);if(i===-1)break;if(XG(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function eY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||$l(s)?!1:!(Ll(s)&&n&&!$l(n)&&!Ll(n))}function tY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||$l(n)?!1:!(Ll(n)&&s&&!$l(s)&&!Ll(s))}function nY(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(tY(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function sY(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&&nk.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function oY(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&nk.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function iY(e,t,n){const s=oY(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 rY=/[\p{L}\p{N}]/u,lY=/^[\p{L}\p{N}]+$/u;function fv(e){return e?rY.test(e):!1}function oM(e){return e?lY.test(e):!1}function td(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:fv(s)&&fv(o)}}function aY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=td(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(!oM(e.slice(s.end,o.start)))return o.end}return-1}function cY(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function uY(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=td(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function dY(e){return e?GG.test(e)||YG.test(e):!1}function fY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Jn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=Kd(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(G,ae){const me=e.length===1?t:String(ae.content??""),q=[],ne=aY(G);if(ne!==-1){A(G.slice(0,ne),G.slice(0,ne));const ue=G.slice(ne);return ue&&(N({type:"text",content:ue,raw:ue}),u--),u++,!0}if(WG.test(G)){const ue=G.indexOf("~~");ue!==-1&&q.push({type:"strikethrough",index:ue})}if(zG.test(G)){const ue=G.indexOf("**");ue!==-1&&q.push({type:"strong",index:ue})}if(/[^*]*\*[^*]+/.test(G)){const ue=me?sM(me,0):G.indexOf("*");if(me&&ue===-1)return!1;ue!==-1&&q.push({type:"emphasis",index:ue})}q.sort((ue,ye)=>ue.index!==ye.index?ue.index-ye.index:ue.type===ye.type?0:ue.type==="strong"?-1:ye.type==="strong"?1:0);const ge=q[0];if(!ge)return!1;if(ge.type==="strikethrough"){const ue=ge.index,ye=ue>-1?G.slice(0,ue):"";if(ye&&A(ye,ye),ue===-1)return u++,!0;const j=G.indexOf("~~",ue+2),te=j===-1?G.slice(ue+2):G.slice(ue+2,j),pe=j===-1?"":G.slice(j+2),{node:Ce}=Ww([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:te,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),y(Ce),pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}if(ge.type==="strong"){const ue=ge.index,ye=ue>-1?G.slice(0,ue):"";if(ye&&A(ye,ye),ue===-1)return u++,!0;if(t&&ue===0){let $e=!1,he=0;for(;he<G.length&&G[he]==="*";)he++;if(t.startsWith("\\*")&&($e=!0),$e){let Ne=0,Je=0;for(;Je<t.length&&Ne<he;)if(t[Je]==="\\"&&Je+1<t.length&&t[Je+1]==="*")Ne+=1,Je+=2;else{if(t[Je]==="*")break;Je++}if(Ne>=2)return A(G,G),u++,!0}}if(t&&(G.match(/\*/g)||[]).length>ZG(t))return A(G.slice(ye.length),G.slice(ye.length)),u++,!0;const j=td(G,ue);if(j.len>=3){const $e=uY(G,ue+j.len);if($e!==-1){const he=G.slice(ue+j.len,$e);if(cY(he)){const{node:Ne}=Nu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:he,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);p(),y(Ne);const Je=G.slice($e+3);return Je&&(N({type:"text",content:Je,raw:Je}),u--),u++,!0}}}if(!eY(G,ue)){const $e=G.slice(ue,ue+j.len);A($e,$e);const he=G.slice(ue+j.len);return he&&(N({type:"text",content:he,raw:he}),u--),u++,!0}const te=nY(G,ue+2);let pe="",Ce="";if(te.index!==-1){pe=G.slice(ue+2,te.index),Ce=G.slice(te.index+2);const $e=te.index,he=td(G,$e);if(j.intraword&&he.intraword&&!oM(pe)||!pe&&j.len>=4&&j.intraword)return A(G.slice(ye.length),G.slice(ye.length)),u++,!0}else{if(d||te.sawInvalidClose||j.intraword)return A(G.slice(ye.length),G.slice(ye.length)),u++,!0;pe=G.slice(ue+2),Ce=""}if(!pe&&/^\*+$/.test(Ce))return A(G,G),u++,!0;const{node:Ie}=Nu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),y(Ie),Ce&&(N({type:"text",content:Ce,raw:Ce}),u--),u++,!0}if(ge.type==="emphasis"){let ue=ge.index;ue===-1&&(ue=0);const ye=G.slice(0,ue);if(ye&&A(ye,ye),!QG(G,ue)){A(G[ue],G[ue]);const $e=G.slice(ue+1);return $e&&(N({type:"text",content:$e,raw:$e}),u--),u++,!0}const j=td(G,ue),te=JG(me,G,ue+1),pe=te.index,Ce=e[u+1];if(s?.final&&Ce?.type==="em_open"&&pe!==-1&&G.slice(ue+1,pe).trim()!==G.slice(ue+1,pe)||pe===-1&&(te.sawInvalidClose||s?.final||j.intraword||!fv(G[ue+1])))return A(G.slice(ue),G.slice(ue)),u++,!0;const{node:Ie}=jf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe>-1?G.slice(ue+1,pe):G.slice(ue+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),y(Ie),pe!==-1&&pe<G.length-1){const $e=G.slice(pe+1);$e&&(N({type:"text",content:$e,raw:$e}),u--)}return u++,!0}return!1}function x(G,ae){if(!G.includes("`"))return!1;const q=(Ce=>{for(let Ie=0;Ie<Ce.length;Ie++){if(Ce[Ie]!=="`")continue;let $e=0;for(let he=Ie-1;he>=0&&Ce[he]==="\\";he--)$e++;if($e%2===0)return Ie}return-1})(G);if(q===-1)return!1;let ne=1;for(let Ce=q+1;Ce<G.length&&G[Ce]==="`";Ce++)ne++;const ge="`".repeat(ne),ue=q+ne,ye=G.indexOf(ge,ue);if(ye===-1){if(ne===1){const Ie=G.slice(0,q),$e=G.slice(q+1);return Ie&&(m(Ie,ae)?u--:A(Ie,Ie)),g({type:"inline_code",code:$e,raw:String($e)}),u++,!0}let Ce=G;for(let Ie=u+1;Ie<e.length;Ie++)Ce+=String((e[Ie].content??"")+(e[Ie].markup??""));return u=e.length-1,A(Ce,Ce),u++,!0}p();const j=G.slice(0,q),te=G.slice(q+ne,ye),pe=G.slice(ye+ne);return j&&(m(j,ae)?u--:A(j,j)),g({type:"inline_code",code:te,raw:String(te??"")}),pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}function k(G){const ae=l?.__markdownIt;if(!ae||e.length<=1||!e.some(ge=>ge?.type==="math_inline")||!UG.test(G))return null;const me=ae.parseInline(G,{__markstreamFinal:!!s?.final});if(!Array.isArray(me)||me.length===0)return null;const q=(me.find(ge=>ge?.type==="inline")?.children??[]).filter(ge=>!(ge?.type==="text"&&String(ge.content??"")===""));if(!q.length||!q.some(ge=>ge?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===G)return null;const ne=Jn(q,G,n,s);return ne.length?ne:null}function g(G){p(),a.push(G)}function v(G){p();const ae=ba(G);a.push(ae)}function y(G){g(G)}function A(G,ae){c?(c.content+=G,c.raw+=ae??G):(c={type:"text",content:String(G??""),raw:String(ae??G??"")},a.push(c))}function L(G,ae){if(!G)return;const me=Jn([{...ae,type:"text",content:G,raw:G}],G,n,s);if(me.length===1&&me[0]?.type==="text"){const q=me[0];A(String(q.content??""),String(q.raw??q.content??""));return}for(const q of me)y(q)}function $(G,ae){return String(G.markup??"").startsWith(ae)}function _(G){return G.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function E(G,ae){let me=G;const q=String(ae.content??"");return me.endsWith("\\")&&!$(ae,"\\\\")&&!q.endsWith("\\\\")&&(me=me.slice(0,-1)),me.endsWith("(")&&!$(ae,"\\(")&&!q.endsWith("\\(")&&(me=me.slice(0,-1)),/\*+$/.test(me)&&!$(ae,"\\*")&&!q.endsWith("\\*")&&(me=me.replace(/\*+$/,"")),me}for(;u<e.length;){const G=e[u];N(G)}function N(G){switch(G.type){case"text":S(G);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":y(IG(G)),u++;break;case"html_inline":{const[ae,me]=TG(G,e,u,Jn,t,n,s);y(ae),u=me;break}case"link_open":I(G);break;case"image":fe(G)||(p(),y(Pw(G)),u++);break;case"strong_open":{p();const{node:ae,nextIndex:me}=Nu(e,u,G.content,s);y(ae),u=me;break}case"em_open":{p();const{node:ae,nextIndex:me}=jf(e,u,s);y(ae),u=me;break}case"s_open":{p();const{node:ae,nextIndex:me}=Ww(e,u,s);y(ae),u=me;break}case"mark_open":{p();const{node:ae,nextIndex:me}=SG(e,u,s);y(ae),u=me;break}case"ins_open":{p();const{node:ae,nextIndex:me}=$G(e,u,s);y(ae),u=me;break}case"sub_open":{p();const{node:ae,nextIndex:me}=DG(e,u,s);y(ae),u=me;break}case"sup_open":{p();const{node:ae,nextIndex:me}=PG(e,u,s);y(ae),u=me;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`~${String(G.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`^${String(G.content??"")}^`}),u++;break;case"emoji":{p();const ae=e[u-1];ae?.type==="text"&&/\|:-+/.test(String(ae.content??""))?A("",""):y(yG(G)),u++;break}case"checkbox":p(),y(gG(G)),u++;break;case"checkbox_input":p(),y(vG(G)),u++;break;case"footnote_ref":p(),y(_G(G)),u++;break;case"footnote_anchor":{p();const ae=G.meta??{};g({type:"footnote_anchor",id:String(ae.label??G.content??""),raw:String(G.content??"")}),u++;break}case"hardbreak":p(),y(wG()),u++;break;case"fence":p(),y(tk(e[u])),u++;break;case"math_inline":p(),!G.content&&G.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Hw({...G,content:e[u+1].content})),u+=2):y(Hw(G)),u++;break;case"reference":B(G);break;case"text_special":A(String(G.content??""),String(G.content??"")),u++;break;default:{const ae=G;if(G.type==="link"&&ae.href!=null&&s?.validateLink&&!s.validateLink(String(ae.href))){p();const me=String(ae.text??"");A(me,me),u++}else se(G)||z(G)||X(G)||P(G)||v(G),u++;break}}}function F(G,ae,me,q){const ne=HG({...ae,content:G});if(c){c.content+=E(ne.content,ae),c.raw+=ne.raw;return}const ge=me?.tag==="br"&&e[u-2]?.content==="[";q||(ne.content=E(ne.content,ae)),c=ne,c.center=ge,a.push(c)}function S(G){const ae=String(G.content??""),me=e.length===1&&ae.includes("\\")&&typeof t=="string"?String(t):"";let q=me?sY(me):ae.replace(qG,"$1");if(G.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const ne=q.indexOf("$");ne!==-1&&ne===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let ge=a.length,ue="";for(let pe=a.length-1;pe>=0;pe--){const Ce=a[pe];if(Ce.type!=="text")break;ge=pe,ue=String(Ce.content??"")+ue}ge<a.length&&(q.startsWith(ue)?(c=null,a.length=ge):c=a[a.length-1]);const ye=e[u+1];if((q==="`"||q==="|"||q==="$")&&!$(G,`\\${q}`)||/^\*+$/.test(q)&&!$(G,"\\*")){u++;return}if(!ye&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(ce(q)||Y(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){F(q,G,e[u-1],ye),u++;return}if(de(q))return;const j=e[u-1];if(q==="["&&!ye?.markup?.includes("*")&&!$(G,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!$(G,"\\]")){u++;return}if(x(ae,G)||He(q)||(e[u+1]?.type!=="link_open"||_(q))&&le(q,G))return;const te=k(ae);if(te){p();for(const pe of te)y(pe);u++;return}m(q,G)||(F(q,G,j,ye),u++)}function I(G){if(R(G))return;if(J()){const{node:ye,nextIndex:j}=Vf(e,u,s),te=String(ye.text||ye.href||"");A(te,te),u=j;return}p();const{node:ae,nextIndex:me}=Vf(e,u,s);u=me;const q=ae.text||ae.href||"";if(G.markup==="linkify"&&!B6(q,ae.href,t)&&mp(q,l?.__linkifyDemotionContext)){A(q,q);return}const ne=ae.children.length===1&&ae.children[0]?.type==="text";if(ae.loading&&t&&ae.text===ae.href&&ne){const ye=fY(t,ae.href);ye&&(ae.text=ye,ae.children=[{type:"text",content:ye,raw:ye}],ae.raw=`[${ye}](${ae.href}${ae.title?` "${ae.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ae.href)){A(ae.text,ae.text);return}const ge=G.attrs?.find(([ye])=>ye==="href")?.[1],ue=String(ge??"");if(t&&ue){const ye=t.indexOf("](");if(ye!==-1){const j=t.indexOf(")",ye+2);j===-1?ae.loading=!0:ae.loading&&t.slice(ye+2,j).includes(ue)&&(ae.loading=!1)}}P(ae)||g(ae)}function R(G){if(G.markup!=="linkify")return!1;const{node:ae,nextIndex:me}=Vf(e,u,s);return W(ae,me)?(u=me,!0):!1}function B(G){p(),y(OG(G)),u++}function P(G){if(G.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const me=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!me)return!1;const q=G,ne=String(q.href??""),ge=String(q.text??""),ue=String(me[2]??""),ye=ne.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ne||!(ge===ne||ge===ye||dY(ge)))return!1;const j=String(me[1]??"");return j?(ae.content=j,ae.raw=j):a.pop(),g({...G,text:ue,children:[{type:"text",content:ue,raw:ue}],raw:`[${ue}](${ne}${q.title?` "${q.title}"`:""})`}),!0}function z(G){if(G.type!=="link")return!1;const ae=G,me=String(ae.href??"");return me?W({href:me,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},u+1):!1}function W(G,ae){const me=a[a.length-1];if(me?.type!=="image"||me.src||!me.loading||!String(me.raw??"").endsWith("]("))return!1;const q=e[ae],ne=String(q?.content??"");if(q?.type!=="text"||!ne.startsWith(")"))return!1;a.pop(),c=null;const ge=String(me.alt??"");g({type:"image",src:G.href,alt:ge,title:G.title,raw:``,loading:!!G.loading});const ue=ne.slice(1),ye=ba(q);return ye.content=ue,ye.raw=ue,h()[ae]=ye,!0}function X(G){if(G.type!=="link")return!1;const ae=a[a.length-1],me=e[u-1];if(!ae||ae.type!=="text"||me?.type!=="text")return!1;const q=String(ae.content??""),ne=String(me.content??"");if(!q.endsWith("!")||!ne.endsWith("!")||$(me,"\\!"))return!1;const ge=q.slice(0,-1);ge?(ae.content=ge,ae.raw=ge,c=ae):(a.pop(),c=null);const ue=G,ye=String(ue.text??ue.children?.map(pe=>String(pe?.content??pe?.raw??"")).join("")??""),j=String(ue.href??""),te=ue.title==null||ue.title===""?null:String(ue.title);return g({type:"image",src:j,alt:ye,title:te,raw:``,loading:!!ue.loading}),!0}function U(G,ae="",me=null){const q=String(G.alt??G.raw??"");return{type:"link",href:ae,title:me,text:q,children:[G],raw:`[${q}](${ae}${me?` "${me}"`:""})`,loading:!0}}function Z(G){const ae=G.startsWith(";return{type:"image",src:"",alt:q===-1?me.replace(/\]$/,""):me.slice(0,q),title:null,raw:ae,loading:!0}}function ce(G){const ae=G.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&iY(t,ae,"["))return!1;const me=G.slice(0,ae);return me&&A(me,me),g(U(Z(G.slice(ae+1)))),u++,!0}function fe(G){if(s?.final)return!1;const ae=e[u-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||$(ae,"\\["))return!1;const me=a[a.length-1];if(me?.type==="text"&&me.content.endsWith("[")){const q=me.content.slice(0,-1);q?(me.content=q,me.raw=q,c=me):(a.pop(),c=null)}return g(U(Pw(G))),u++,!0}function se(G){if(G.type!=="link")return!1;const ae=G,me=String(ae.raw??""),q=String(ae.text??"");if(!me.startsWith("[![")&&!q.startsWith("!["))return!1;const ne=ae.title==null||ae.title===""?null:String(ae.title);return g(U({type:"image",src:String(ae.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ne,raw:me.startsWith("[)return!1;const ae=e[u-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&$(ae,"\\["))return!1;const me=a[a.length-1];if(me?.type!=="image"&&me?.type!=="link")return!1;const q=me,ne=me?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ge=ne?ne.children[0]:a.pop();if(!ge||ge.type!=="image")return!1;const ue=e[u+1];let ye=String(ne?.href??""),j=ne?.title==null?null:String(ne.title),te=!0;if(ue?.type==="link_open"){const{node:Ce,nextIndex:Ie}=Vf(e,u+1,s);ye=Ce.href,j=Ce.title,te=!0,u=Ie}else{if(ye=G.slice(2),ye.includes('"')){const Ce=ye.split('"');ye=String(Ce[0]??"").trim(),j=Ce[1]==null?null:String(Ce[1]).trim()}u++}const pe=U(ge,ye,j);return pe.loading=te,g(pe),!0}function J(){const G=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&G?.type==="text"&&String(G.content??"").endsWith("[")&&$(G,"\\[")}function le(G,ae){const me=G.indexOf("[");if(me===-1)return!1;let q=G.slice(0,me);const ne=G.indexOf("](",me);if(ne!==-1){const ge=e[u+2];let ue=G.slice(me+1,ne);if(ue.includes("[")){const $e=ue.indexOf("[");q+=G.slice(0,me+$e+1);const he=me+$e+1;ue=G.slice(he+1,ne)}const ye=e[u+1];if(G.endsWith("](")&&ye?.type==="link_open"&&ge){const $e=e[u+4];let he=4,Ne=!0;if($e?.type==="text"){const it=String($e.content??"");if(it.startsWith(")")){Ne=!1;const At=it.slice(1);if(At){const bt=ba($e);bt.content=At,bt.raw=At,h()[u+4]=bt}else he++}else it==="."&&he++}L(q,ae);const Je=String(ge.content??"");return s?.validateLink&&!s.validateLink(Je)?A(ue,ue):g({type:"link",href:Je,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:Ne}),u+=he,!0}const j=G.indexOf(")",ne),te=j!==-1?G.slice(ne+2,j):"",pe=j===-1;let Ce=q.match(/\*+$/);if(Ce&&(q=q.replace(/\*+$/,"")),L(q,ae),Ce||(Ce=ue.match(/^\*+/)),!d&&Ce){const $e=Ce[0].length;ue=ue.replace(/^\*+/,"").replace(/\*+$/,"");const he=[];if($e===1?he.push({type:"em_open",tag:"em",nesting:1}):$e===2?he.push({type:"strong_open",tag:"strong",nesting:1}):$e===3&&(he.push({type:"strong_open",tag:"strong",nesting:1}),he.push({type:"em_open",tag:"em",nesting:1})),he.push({type:"link",href:te,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:pe}),$e===1){he.push({type:"em_close",tag:"em",nesting:-1});const{node:Ne}=jf(he,0,s);y(Ne)}else if($e===2){he.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Nu(he,0,void 0,s);y(Ne)}else if($e===3){he.push({type:"em_close",tag:"em",nesting:-1}),he.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Nu(he,0,void 0,s);y(Ne)}else{const{node:Ne}=jf(he,0,s);y(Ne)}}else s?.validateLink&&!s.validateLink(te)?A(ue,ue):g({type:"link",href:te,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:pe});const Ie=j!==-1?G.slice(j+1):"";return Ie&&(N({type:"text",content:Ie,raw:Ie}),u--),u++,!0}return!1}function He(G){const ae=G.indexOf("![");if(ae===-1)return!1;const me=G.slice(0,ae);return me&&!c?c={type:"text",content:me,raw:me}:me&&c&&(c.content+=me),c&&(a.push(c),c=null),g(Z(G.slice(ae))),u++,!0}function de(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=G.slice(1).match(/[^\s\]]/);if(ae===null)return u++,!0;if(ae&&/x/i.test(ae[0])){const me=ae[0]==="x"||ae[0]==="X";return g({type:"checkbox_input",checked:me,raw:me?"[x]":"[ ]"}),u++,!0}return!1}return a}function hY(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 pY(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 mY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function su(e,t,n){const s=e[t],o=[],i=Dl(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=mY(c)?ba(c):c,d=e[a-1];u!==c&&(pY(u),hY(u));const f=String(u.content??"");l.push({type:"paragraph",children:Jn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=ou(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=su(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=ok(e,a,i.options(),sk);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
206
|
-
`)},r+1]}function gY(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Dl(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:Jn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=su(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=ou(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Am(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
207
|
-
${r.map(c=>c.raw).join(`
|
|
208
|
-
`)}
|
|
209
|
-
:::`},a+1]}const vY=new Set(["warning","info","note","tip","danger","caution"]);function yY(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 vY.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function kY(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=yY(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Dl(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const x=f[m];if(x.type==="text"&&/:+/.test(x.content)){h=m;break}}const p={type:"paragraph",children:Jn((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=su(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=ou(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Am(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
210
|
-
${l.map(d=>d.raw).join(`
|
|
211
|
-
`)}
|
|
212
|
-
:::`},c+1]}const bY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function xY(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=bY.exec(String(s.info??""));return o?gY(e,t,o,n):null}const sk={parseContainer:(e,t,n)=>kY(e,t,n),matchAdmonition:xY};function ou(e,t,n){const s=[],o=Dl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:Jn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=su(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=ou(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=ok(e,i,o.options(),sk);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
213
|
-
`)},i+1]}function _Y(e){if(e.info?.startsWith("diff"))return tk(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 wY(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Dl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Jn(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:Jn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
214
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
215
|
-
`)},o+1]}function SY(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Dl(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:Jn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
216
|
-
`)}`},l+1]}function CY(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:Jn(a.children||[],c,void 0,n),raw:c}}function AY(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=Xn(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=Xn(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 iM(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=Xn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=La.has(n),l=Cm(o),a=(s===-1?-1:AY(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
217
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function MY(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 EY(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 rM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function lM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return rM(n)?n:void 0}function TY(e,t,n){const s=lM(Kd(t),n);if(!rM(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 NY(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=EY(e[c].attrs),x=a.length,k=!f&&!r,g=k?o?.cells[x]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Jn(h.children||[],p,void 0,TY(n,g,k?u:void 0)),raw:p,align:m}),k&&(u=lM(u,Kd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
218
|
-
`)},s+1]}function IY(){return{type:"thematic_break",raw:"---"}}let E0=null;const T0=new WeakMap;function zw(){return E0||(E0={allowedTagSet:Em(),customTagSet:null}),E0}function $Y(e){if(!e||e.length===0)return zw();const t=T0.get(e);if(t)return t;const n=e.map(Ci).filter(Boolean);if(!n.length){const o=zw();return T0.set(e,o),o}const s={allowedTagSet:Em({customHtmlTags:e}),customTagSet:new Set(n)};return T0.set(e,s),s}function LY(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[h,p]of o)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=Dl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:Jn(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=su(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=ou(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Am(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
219
|
-
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
220
|
-
`),f+=`
|
|
221
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function FY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function OY(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function RY(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Zo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Zo(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=Xn(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=Xn(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 BY(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=Xn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const x=m+1;return{raw:e.slice(r,x),end:x}}d=m+1;continue}if(f(p)){const m=Xn(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function hv(e){return Number.isFinite(e)&&e>0?e:0}function DY(e,t){const n=hv(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
222
|
-
`&&(s++,s===n))return o+1;return e.length}function Am(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[CY(e,t,n),t+3];case"code_block":return[_Y(s),t+1];case"fence":return[tk(s),t+1];case"math_block":return[MY(s),t+1];case"html_block":{const o=iM(s),i=o.tag?$Y(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?DY(l,Number(s.map?.[0]??0)):0,u=BY(l,r,Math.max(hv(a),hv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Xn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:RY(d,r,f+1),x=m?.start??-1;let k="";f!==-1&&(x!==-1&&f<x?k=d.slice(f+1,x):k=d.slice(f+1)),x===-1&&(k=OY(k,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const $=y[2]||y[3]||y[4]||"";g.push([L,$])}const A=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:FY(k),raw:String(u?.raw??o.raw??d),loading:A,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=NY(e,t,n);return[o,i]}case"dl_open":{const[o,i]=wY(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=SY(e,t,n);return[o,i]}case"hr":return[IY(),t+1]}return null}function ok(e,t,n,s){const o=Am(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return LY(e,t,n)}return null}function PY(){return{type:"hardbreak",raw:`\\
|
|
223
|
-
`}}function HY(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Jn(s.children||[],o,void 0,n),raw:o}}const Uw=new WeakMap,Mm=new WeakMap,WY=["$$","\\["];function Yc(){return typeof performance<"u"?performance.now():Date.now()}function ik(e,t,n){e&&(e[t]=(e[t]??0)+n)}function aM(e){return e.__timing}function N0(e,t,n){return t&&ik(t,"parseMarkdownToStructureTotalMs",Yc()-n),e}function qw(e,t,n){if(!n)return Xw(e,t);const s=Yc(),o=Xw(e,t);return ik(n,"processTokensMs",Yc()-s),o}function zY(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=nu(t);return n.length?new Set(n):null}function UY(e,t){const n=e;let s=Uw.get(n);s||(s=new Map,Uw.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 qY(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Kf(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]=aa(o.value,n))}}function aa(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(aa(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(aa(l,t),aa(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(aa(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),Kf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Kf(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),Kf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!qY(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Kf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=aa(i[r],t);return o}function cM(e,t=!0){if(!t)return ba(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=>cM(a,t)):t&&r&&typeof r=="object"&&(l=aa(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function jw(e,t=!0){return e.map(n=>cM(n,t))}function uM(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function jY(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function VY(e){Mm.delete(e)}function KY(e,t,n){Mm.set(e,{source:t,key:n,pendingCandidate:n===null&&Z6(t)})}function GY(e){return e.endsWith("$")||e.endsWith("\\")}function YY(e){const t=Math.max(e.lastIndexOf(`
|
|
224
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return WY.some(s=>n.endsWith(s))}function ZY(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||YY(e)&&/[\r\n]/.test(t)):!1}function QY(e,t){if(!U6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=Mm.get(s);if(o?.source===t)return;if(o&&t.startsWith(o.source)){const l=t.slice(o.source.length);if(o.key===null&&o.pendingCandidate===!1&&!ZY(o.source,l)&&!GY(t)){o.source=t;return}}const i=dG(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),KY(e,t,i)}function XY(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function JY(e,t){const n=e?.map,s=t?.map;return n===s?!0:!Array.isArray(n)||!Array.isArray(s)?!1:n.length===s.length&&n.every((o,i)=>o===s[i])}function I0(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&JY(e,t)}function Vw(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function eZ(e){for(let t=0;t+5<e.length;t++)if(Vw(e,t)&&Vw(e,t+3)&&I0(e[t],e[t+3])&&I0(e[t+1],e[t+4])&&I0(e[t+2],e[t+5]))return!0;return!1}function tZ(e,t,n){return U6(e)&&Z6(t)&&eZ(n)}function nZ(e){const t=Mm.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Kw(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!uM(e,s)||(QY(e,t),nZ(e)))return e.parse(t,n);const o=e.stream.parse(t,UY(e,n));if(tZ(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!XY(s))return o;const i=aM(s);if(!i)return jw(o,!0);const r=Yc(),l=jw(o,!0);return ik(i,"tokenCloneMs",Yc()-r),l}function Em(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Td;const n=new Set(Td);for(const s of nu(t))s&&n.add(s);return n}function sZ(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 Gw(e){return{type:"paragraph",children:e,raw:e.map(sZ).join("")}}function Yw(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=zY(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(Gw(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(Gw(c)),a}function oZ(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 nd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function iZ(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*${Zo(t)}\s*>\s*$`,"i").test(n)}function rk(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Zo(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Xn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(La.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${Zo(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Zo(s)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const m=Xn(e.slice(p));if(m===-1)return null;u--;const x=p+m+1;if(u===0)return{raw:e.slice(r,x),start:r,end:x,closed:!0};d=x;continue}if(f(p)){const m=Xn(e.slice(p));if(m===-1)return null;const x=e.slice(p,p+m+1);/\/\s*>$/.test(x)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function rZ(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
225
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function lZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
226
|
-
</${t}>`}function Zw(e){return e.replace(/\r\n/g,`
|
|
227
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function aZ(e,t,n){return n?e.includes(n,t)?!0:Zw(e.slice(Math.max(0,t))).includes(Zw(n)):!1}function cZ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
228
|
-
`&&n++,n):e[n]===`
|
|
229
|
-
`?n+1:t}function Qw(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 uZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function lk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Zo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function dM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const dZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),fZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function hZ(e){return/\n\s*\n/.test(e)||fZ.test(e)}function pZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>dZ.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(!hZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function mZ(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"||A6.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Xn(l);if(a===-1)return o;const c=lk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=sd(u,t,dM(n,s));return pZ(u,d)?{...o,children:d}:o})}function sd(e,t,n){return e.trim()?hM(e,t,{...n,__disableStreamParse:!0}):[]}function gZ(e,t,n){const s=sd(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function vZ(e,t,n){const s=iM({content:e}),o=Xn(e),i=lk(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=gZ(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function yZ(e,t,n){const s=Xn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=rk(o,"summary",0);if(!i)return sd(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...sd(r,t,n),vZ(i.raw,t,n),...sd(l,t,n)]}function fM(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=nd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!Qw(c)){r.push(c);continue}const f=String(c.raw??nd(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 X=a+1;X<e.length;X++){const U=e[X];if(Qw(U)){p++;continue}if(uZ(U)&&(p--,p===0)){m=X;break}}const x=rk(t,"details",h),k=m===-1&&x?.closed===!0,g=k?(()=>{const X=lk(f,"details");return X!==-1?f.slice(0,X):f})():f,[v]=fM(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),y=yZ(g,n,dM(s,o)),A=m===-1?"</details>":String(e[m].raw??nd(e[m])??"</details>"),L=k||m!==-1&&x?.closed===!0,$=A.replace(/[\t\r\n ]+$/,""),_=L?(()=>{const X=(x?.raw??"").lastIndexOf($);return X===-1?t.length:h+X})():t.length,E=Xn(f),N=k&&E!==-1?h+E+1:h+f.length,F=t.slice(N,_===-1?t.length:_),S=n.parse(F,{__markstreamFinal:o}),I=n.renderer.render(S,n.options,{__markstreamFinal:o}),R=_+$.length,B=L?Math.max(_+A.length,cZ(t,R)):t.length,P=L?t.slice(_,B):A,z=L?t.slice(h,B):t.slice(h),W=k&&E!==-1?f.slice(0,E+1):f;if(r.push({...c,tag:"details",attrs:Cm(f.slice(0,E+1)),raw:z,content:`${W}${I}${P}`,children:[...y,...v],loading:!o&&!L}),l=L?B:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function kZ(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=nd(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=rk(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=lZ(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,x=Xn(u.raw),k=x===-1?"":u.raw.slice(0,x+1),g=k?Cm(k):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=rZ(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&iZ(s[y],c)){s.splice(y,1);continue}const A=nd(s[y]);if(!A)break;const L=u.raw.indexOf(A,v);if(L===-1){if(aZ(n,u.end,A))break;s.splice(y,1);continue}v=L+A.length,s.splice(y,1)}}return s}function bZ(e){const t=l=>l===" "||l===" "||l===`
|
|
230
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const x=m.charCodeAt(0);return x>=65&&x<=90||x>=97&&x<=122},u=m=>{const x=m.charCodeAt(0);return x>=48&&x<=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 x=l[a];if(t(x)||x==="<"||x===">"||x==='"'||x==="'"||x==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let A=v;for(;A<g.length&&g[A]===y;)A++;const L=A-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(A)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&f(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const y=p(g);return y==null?null:h(y)};let x=0;const k=l.split(/\r?\n/);for(const g of k){const v=x,y=x+g.length;if(a<v)break;const A=m(g);if(A){const L=A.markerChar,$=A.markerLen;c?L===u&&$>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=y)break;x=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
231
|
-
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
232
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function xZ(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 x=0;x<p.length;x++){const k=p[x];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=p=>{let m=!1,x=!1;for(let k=0;k<p.length;k++){const g=p[k];if(g==="\\"){k++;continue}if(!x&&g==="'"){m=!m;continue}if(!m&&g==='"'){x=!x;continue}if(!m&&!x&&g===">")return k}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const x=p[m];if(x!=="`"&&x!=="~")return null;let k=m;for(;k<p.length&&p[k]===x;)k++;const g=k-m;return g<3?null:{markerChar:x,markerLen:g,rest:p.slice(k)}},a=(p,m)=>{if(i(p))return-1;const x=p.replace(/^[ \t]+/,"");if(!x||x.startsWith(">")||x.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(x))return-1;let k=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(k=!0),g++;continue}const y=r(p.slice(g));if(y===-1){k=!0,g++;continue}const A=p.slice(g,g+y+1);let L=1;for(;L<A.length&&s(A[L]);)L++;if(L>=A.length){k=!0,g++;continue}const $=A[L];if($==="!"||$==="?"){k=!0,g+=y+1;continue}if($==="/"){k=!0,g+=y+1;continue}const _=L;for(;L<A.length&&o(A[L]);)L++;if(L===_){k=!0,g++;continue}const E=A.slice(_,L).toLowerCase(),N=A[L];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(A),I=F.test(p.slice(g+y+1)),R=F.test(e.slice(m+g+y+1)),B=/[\r\n]/.test(e.slice(m+g+y+1));if(k&&n.has(E)&&!S&&!I&&(R||B))return g;k=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
233
|
-
`,h),m=p!==-1,x=m&&p>h&&e[p-1]==="\r",k=m?x?p-1:p:e.length,g=e.slice(h,k),v=m?x?`\r
|
|
234
|
-
`:`
|
|
235
|
-
`:"",y=l(g);let A=g;if(!c&&!y){const L=a(g,h);if(L!==-1){const $=v||`
|
|
236
|
-
`;A=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=A,f+=v,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),h=m?p+1:e.length}return f}function _Z(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 x=m+1;for(;x<d.length&&s(d[x]);)x++;if(x>=d.length||d[x]!=="/"){m=d.indexOf("<",m+1);continue}for(x++;x<d.length&&s(d[x]);)x++;if(x+p.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<p.length;v++){const y=d[x+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=x+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 x=f+m;if(l(d,x+1,p))return d;const k=i(d.slice(x+1));return k?`${d.slice(0,x+1)}
|
|
237
|
-
${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
238
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
239
|
-
`:`
|
|
240
|
-
`,u=d+1}return c}function wZ(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 x=m-h;return x<3?null:{markerChar:p,markerLen:x,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
241
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,x=e.slice(d,m),k=h?p?`\r
|
|
242
|
-
`:`
|
|
243
|
-
`:"",g=o(x),v=g?.prefix??"",y=g?.content??x,A=i(y);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let L=y;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(_,E,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return _;const S=F.slice(0,N).replace(/^[\t ]+/,"");if(S.length>0){const I=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!R||I!==R)return _}return`${E}
|
|
244
|
-
|
|
245
|
-
`});if(v){const $=v+L.split(`
|
|
246
|
-
`).join(`
|
|
247
|
-
${v}`);u+=$}else u+=L;u+=k,d=h?f+1:e.length}return u}function SZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const s=S=>S===" "||S===" ",o=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let R=0;R<S.length;R++){const B=S[R];if(B===" "){if(I++,I>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,R=!1,B=0;for(;I<S.length;){for(;I<S.length&&s(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(R=!0,I++;I<S.length&&s(S[I]);)I++;B=I}if(!R)return null;const P=S.slice(0,B);return{prefix:P,key:P.replace(/[ \t]+$/,""),content:S.slice(B)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const R=S[I];if(R!==" "&&R!==" ")return!1}return!0},u=S=>{if(o(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let R=1;for(;R<I.length&&s(I[R]);)R++;if(R>=I.length||I[R]==="/"||I[R]==="!"||I[R]==="?")return"";const B=R;for(;R<I.length&&i(I[R]);)R++;if(R===B)return"";const P=I.slice(B,R).toLowerCase();if(!n.has(P))return"";const z=I[R];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":P},d=S=>{if(o(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let R=1;for(;R<I.length&&s(I[R]);)R++;if(R>=I.length)return null;const B=I[R]==="/";if(B)for(R++;R<I.length&&s(I[R]);)R++;const P=I[R];if(!P||P==="!"||P==="?")return null;const z=R;for(;R<I.length&&i(I[R]);)R++;if(R===z)return null;const W=I.slice(z,R).toLowerCase();if(!n.has(W))return null;const X=I[R];if(X&&X!==" "&&X!==" "&&X!==">"&&X!=="/")return null;if(B)return{type:"close",name:W};if(/\/\s*>\s*$/.test(I))return{type:"open",name:W,complete:!0};const U=I.indexOf(">",R);if(U!==-1){const Z=I.slice(U+1);if(new RegExp(`<\\s*\\/\\s*${W}\\s*>`,"i").test(Z))return{type:"open",name:W,complete:!0}}return{type:"open",name:W,complete:!1}},f=S=>{if(o(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const R=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const B=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!B?.[1]||!B[2])return null;const P=B[1].toLowerCase();return P===B[2].toLowerCase()?P:null};let h=!1,p="",m=0;const x=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;const R=S[I];if(R!=="`"&&R!=="~")return null;let B=I;for(;B<S.length&&S[B]===R;)B++;const P=B-I;return P<3?null:{markerChar:R,markerLen:P,rest:S.slice(B)}},k=S=>x(S),g=S=>{const I=r(S);return I?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},v=(S,I,R)=>{let B=S,P=0;for(;B<e.length;){const z=e.indexOf(`
|
|
248
|
-
`,B),W=z!==-1,X=W&&z>B&&e[z-1]==="\r",U=W?X?z-1:z:e.length,Z=e.slice(B,U),ce=l(Z),fe=ce?.key??"";if(P>0&&I&&fe!==I)break;const se=ce?.content??Z,Y=d(se);if(Y?.name===R){if(Y.type==="open")Y.complete||P++;else if(P>0&&(P--,P===0))return!1}else if(P>0&&(c(se)||g(se)))return!0;if(W)B=z+1;else break}return!1};let y="",A=0,L=!0,$=!1,_=!1,E=`
|
|
249
|
-
`;const N=[];let F="";for(;A<e.length;){const S=e.indexOf(`
|
|
250
|
-
`,A),I=S!==-1,R=I&&S>A&&e[S-1]==="\r",B=I?R?S-1:S:e.length,P=e.slice(A,B),z=I?R?`\r
|
|
251
|
-
`:`
|
|
252
|
-
`:"",W=l(P),X=W?.key??"",U=W?.content??P,Z=k(U);Z&&(h?Z.markerChar===p&&Z.markerLen>=m&&/^\s*$/.test(Z.rest)&&(h=!1,p="",m=0):(h=!0,p=Z.markerChar,m=Z.markerLen));const ce=N.length>0;if(!h&&!ce){const se=u(U),Y=!!se&&!L&&$&&_&&v(A,X,se);se&&!L&&(!$||Y)&&(X&&F&&X===F?y+=`${X}${E}`:X||(y+=E))}if(y+=P,y+=z,z&&(E=z),!h){const se=d(U);if(se){if(se.type==="open")se.complete||N.push(se.name);else for(let Y=N.length-1;Y>=0;Y--)if(N[Y]===se.name){N.length=Y;break}}}const fe=c(U);L=fe,$=!fe&&a(U),_=!fe&&!!f(U),F=X,A=I?S+1:e.length}return y}function hM(e,t,n={}){const s=aM(n),o=s?Yc():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(jY(t,n)&&(t.stream.reset(),VY(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,x=>x.startsWith(`
|
|
253
|
-
`)?`
|
|
254
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,x=>x.startsWith(`
|
|
255
|
-
`)?`
|
|
256
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,x=>x.startsWith(`
|
|
257
|
-
`)?`
|
|
258
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
259
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,x=>x.startsWith(`
|
|
260
|
-
`)?`
|
|
261
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(x,k,g)=>`${k}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,x=>x.startsWith(`
|
|
262
|
-
`)?`
|
|
263
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
264
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const x=nu(n.customHtmlTags);if(x.length&&(r=xZ(r,x),r=_Z(r,x),r=SZ(r,x),r=wZ(r,x),r.includes("</")))for(const k of x){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${k}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=bZ(r));const l=oZ(r);if(l){const x=n.preTransformTokens,k=n.postTransformTokens;if(uM(t,n)||typeof x=="function"||typeof k=="function"){const g=Kw(t,r,{__markstreamFinal:i},n),v=typeof x=="function"&&x(g)||g;typeof k=="function"&&k(v)}return N0(l,s,o)}const a=Kw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return N0([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=qw(d,p,s);if(u&&typeof u=="function"){const x=u(d);if(Array.isArray(x)){const k=x[0],g=k?.type;k&&typeof g=="string"?m=qw(x,void 0,s):m=x}}if(m=kZ(m,i,r),m=fM(m,r,t,n,i)[0],m=mZ(m,t,n,i),i){const x=new WeakSet,k=g=>{if(!g||typeof g!="object"||x.has(g))return;if(x.add(g),Array.isArray(g)){for(const y of g)k(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))k(y)};k(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),N0(m,s,o)}function Xw(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Dl(t);let o=0;for(;o<e.length;){const i=ok(e,o,s.options(),sk);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=HY(e,o,s.options(l)),c=Yw(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=su(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=ou(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(PY()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=Jn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Yw(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const CZ=new Set([...Vd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),AZ=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),Jw=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function eS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function MZ(e){return typeof e=="string"?e:e==null?"":String(e)}function pM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function gl(e){return MZ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function mM(e){return gl(e).replace(/`/g,"`")}function Tm(e){return String(e??"").trim().toLowerCase()}function ak(e,t="safe"){const n=Tm(e);return n?t==="escape"?!0:t==="trusted"?Vd.has(n):!AZ.has(n):!1}function gM(e,t="safe"){const n=Tm(e);return n?t==="escape"?!0:t==="trusted"?Vd.has(n):CZ.has(n):!1}function tS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${mM(s)}"`).join("")}function EZ(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||ka(o,{tagName:t,attrName:"srcset"})})}function vM(e,t,n,s){return dV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?EZ(t,s):!!(fV.has(e)&&t&&ka(t,{tagName:s,attrName:e}))}function ca(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function yM(e,t,n,s=!1){if(t!=="safe"||Tm(n)!=="a")return e;const o=ca(e,"href");if(s&&(!o||!e[o])){const a=ca(e,"target"),c=ca(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=ca(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=ca(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 nS(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!pM(r)||vM(l,i,t,n)||(s[r]=i)}return yM(s,t,n,!!ca(e,"href"))}function kM(e,t){const n=e.toLowerCase();return C6.has(n)?!1:eS(t,n)||eS(t,e)}function ck(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!pM(r)||vM(l,i,t,n)||(s[r]=i)}return yM(s,t,n,!!ca(e,"href"))}function bp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function pv(e,t="safe",n){const s=ck(bp(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function TZ(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 NZ(e){const t={};for(const[n,s]of Object.entries(e))t[n]=TZ(s,n);return t}function sS(e){return e.trim().length>0}function IZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);sS(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);sS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||La.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function $Z(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||La.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function LZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${gl(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${gl(s)}`:` ${gl(s)}="${mM(o)}"`).join("");return e.type==="self_closing"?`<${gl(t)}${n} />`:`<${gl(t)}${n}>`}function FZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Jw.lastIndex=0;let n;for(;(n=Jw.exec(e))!==null;)if(kM(n[1],t))return!0;return!1}function Dc(e,t="safe"){if(!e)return"";if(t==="escape")return gl(e);const n=$Z(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(gl(r.content??""));continue}const l=Tm(r.tagName);if(!l)continue;if(gM(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"&&ak(l,t)){o.push(LZ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${tS(nS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${tS(nS(r.attrs??{},t,l))}>`),La.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 OZ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],oS="http://www.w3.org/2000/svg",RZ=new Set(["script","style","iframe","object","embed","link","meta"]),BZ=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"]),DZ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),PZ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),HZ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function WZ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function zZ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function UZ(e){const t=e.nodeName.toLowerCase();return t==="use"?WZ(e):t==="image"?zZ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():HZ.has(t)}function qZ(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 jZ(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")?ka(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ka(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ka(i,{tagName:s,attrName:o})?"":i:""}function VZ(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 bM(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 xM(e){const t=bM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=VZ(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function iS(e){const t=bM(e);return OZ.some(n=>n.test(t))||xM(t)}function KZ(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 Gf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function _M(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(!RZ.has(s)){if(s==="br"){t.push(`
|
|
265
|
-
`);return}for(const o of Array.from(n.childNodes))_M(o,t)}}function GZ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];_M(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Gf(t.getAttribute("width")),i=Gf(t.getAttribute("height")),r=Gf(t.getAttribute("x")),l=Gf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(oS,"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(oS,"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 YZ(e){GZ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!BZ.has(s)){n.remove();continue}if(s==="style"&&iS(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&&iS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(DZ.has(r)&&i.value){const l=jZ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(PZ.has(r)&&i.value&&xM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=qZ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}KZ(n)}}function g_e(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 YZ(n),ZZ(n)?null:n}catch{return null}}function ZZ(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){UZ(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 rS=[];function $0(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function QZ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function XZ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function lS(e=`editor-${Date.now()}`,t={}){const n=mG(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=h=>f[h]??s[h]??h}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...m]=h;typeof p=="function"&&n.use(p,...m)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(rS.length)for(const f of rS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(LW),n.use(RW),n.use(NW);const i=ZW,r=i.default??i;n.use(r),n.use(TW),n.use(EW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,x=p.split(/\r?\n/);for(const k of h.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,A=y[0],L=y.length,$=x[Math.max(0,v-1)]??"";let _=0;for(;_<$.length&&($[_]===" "||$[_]===" ");)_++;let E=0;for(;_+E<$.length&&$[_+E]===A;)E++;let N=_+E;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;const F=m?!0:v>g+1&&E>=L&&N===$.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const x=p.src[m-1],k=p.src[m+1];if(/\d/.test(x)&&/\d/.test(k)){if(!h){const g=p.push("text","",0);g.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],m=String(p.info??"").trim(),x=String(p.content??""),k=btoa(unescape(encodeURIComponent(x))),g=QZ(m),v=$0(g),y=XZ(`editor-${e}-${h}-${g}`),A=$0(o("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
|
|
266
|
-
<div class="code-header">
|
|
267
|
-
<span class="code-lang">${$0(g.toUpperCase())}</span>
|
|
268
|
-
<button class="copy-button" data-code="${k}">${A}</button>
|
|
269
|
-
</div>
|
|
270
|
-
<div class="code-editor"></div>
|
|
271
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const m=a.exec(p.src.slice(p.pos));if(!m)return!1;const x=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(x))return!1;const k=p.src.slice(p.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!h){const g=m[1],v=p.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return p.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const m=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function JZ({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 wM({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}:JZ({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const aS=new WeakMap;function eQ(e){let t=aS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},aS.set(e,t)),t}function cS(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function uk(e){return!!(e.themes?.length||e.langs?.length)}function SM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function tQ(e,t){return!t?.length||e.registeredAllLangs?!0:SM(e.registeredLangs,t)}function L0(e,t){return uk(t)&&SM(e.registeredThemes,t.themes)&&tQ(e,t.langs)}function nQ(e,t){if(!uk(t))return t;const n=cS(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:cS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const sQ={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 oQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function CM(e){const t=oQ(e);return sQ[t]??t}function AM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>CM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function MM(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 iQ(e){return MM(e)?.join("\0")??""}function EM(e,t){const n=MM(e),s=AM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function xp(e,t){return`${iQ(e)}\0\0${AM(t)?.join("\0")??""}`}function v_e(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=EM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:xp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function y_e(e,t={},n){if(!e)return"ready";const s=EM(t.themes,t.langs),o=xp(s.themes,s.langs),i=n&&n===o?n:o,r=eQ(e);if(r.completed.has(i))return"ready";if(L0(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||L0(r,s))return r.completed.add(i),"ready";const c=nQ(r,s),u=xp(c.themes,c.langs);return r.completed.has(u)||L0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(uk(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function ec(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function uS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var rQ=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=dS();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=dS();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,x=uQ(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(x-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=cQ(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=ec(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ec(s,1e3,1)),this.normalizedTargetLatencyMs=ec(o,900,1),this.normalizedCatchUpLatencyMs=ec(i,350,1),this.normalizedCatchUpThreshold=uS(r,600),this.normalizedStartDelayMs=uS(a,80),this.maxCommitFps=Math.trunc(ec(l,30,1)),this.maxCharsPerCommit=Math.trunc(ec(c,80,1)),this.flushOnFinish=u,this.segmenter=aQ(),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 lQ(e={},t){const n=new rQ(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 aQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function cQ(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 dS(){return typeof performance<"u"?performance.now():Date.now()}function uQ(e,t,n){return Math.min(n,Math.max(t,e))}var dQ=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const mv=Symbol.for("markstream-vue:node-lifecycle"),fS='<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>',hS='<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>',fQ={id:"material",core:{"":hS,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:hS,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:fS,csharp:fS,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:()=>mo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},gv=new Map;let pS="material";const _c=new Map,mS=new Map;let vv=null;function hQ(e){gv.set(e.id,e)}function pQ(e){return dQ(this,null,function*(){var t,n,s;if(_c.has(e.id))return(t=_c.get(e.id))!=null?t:null;let o=mS.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(_c.set(e.id,i),vv?.(),i)).catch(()=>(_c.set(e.id,null),null)),mS.set(e.id,o)),o})}const mQ=Na(0);vv=()=>{mQ.value++},hQ(fQ);const gQ={"":"",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 dk(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=gQ[n])!=null?t:n}function k_e(e){const t=dk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function b_e(e){return(function(s){const o=gv.get(pS);if(!o)return;const i=o.core[s];if(i)return i;const r=_c.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!_c.has(o.id)&&pQ(o)})(dk(e))||((n=(t=gv.get(pS))==null?void 0:t.fallback)!=null?n:"");var t,n}const x_e={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let TM=!1;function __e(){return TM}function w_e(){TM=!0}var Nm=(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 Ko=null,bh=!1,Im=hk;function $m(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function fk(){try{const e=globalThis;return $m(e?.katex)}catch{return null}}function hk(){return Nm(null,null,function*(){const e=fk();if(e)return e;const t=yield mo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield mo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return $m(t)})}function vQ(e){Im=e,Ko=null,bh=!1}function yQ(e){vQ(hk)}function NM(){return typeof Im=="function"}function S_e(){var e;const t=Im;if(!t||t===hk)return null;if(Ko)return Ko;const n=fk();if(n)return Ko=n,Ko;try{const s=t();return s&&typeof s?.then!="function"?(Ko=(e=$m(s))!=null?e:s,Ko):null}catch{return null}}function pk(){return Nm(this,null,function*(){var e;const t=fk();if(t)return Ko=t,Ko;if(Ko)return Ko;if(bh)return null;const n=Im;if(!n)return bh=!0,null;try{const s=yield n();if(s)return Ko=(e=$m(s))!=null?e:s,Ko}catch{}return bh=!0,null})}function IM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let kl=null,hl=null;const vi=new Map,Nr=new Map;let _p=5;const ha=new Set;function Ld(){if(vi.size<_p&&ha.size){const e=Array.from(ha);ha.clear();for(const t of e)try{t()}catch{}}}function kQ(e){kl=e,hl=null,kl.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=vi.get(n);if(i)if(vi.delete(n),clearTimeout(i.timeoutId),Ld(),o)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.resolve(s)}},kl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of vi.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));vi.clear(),Ld()}}function bQ(){var e;kl&&((e=kl.terminate)==null||e.call(kl)),kl=null,hl=null}function xQ(e,t=!0,n=2e3,s){return Nm(this,null,function*(){performance.now();const o=IM(e);if(!NM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(hl)return Promise.reject(hl);const i=`${t?"d":"i"}:${o}`,r=Nr.get(i);if(r)return Promise.resolve(r);const l=kl||(hl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),hl.name="WorkerInitError",hl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(hl);if(vi.size>=_p){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=vi.size,a.max=_p,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{vi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Ld()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),vi.has(u)&&vi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Ld()},{once:!0});const f=a,h=c;vi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function C_e(e,t=!0,n){const s=`${t?"d":"i"}:${IM(e)}`;if(Nr.set(s,n),Nr.size>200){const o=Nr.keys().next().value;Nr.delete(o)}}const _Q="WORKER_BUSY";function wQ(e=2e3,t){return vi.size<_p?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),ha.delete(r),n())};if(ha.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,ha.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Ld()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),ha.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Iu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function A_e(e){return Nm(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!NM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Iu.timeout,c=(i=s.waitTimeout)!=null?i:Iu.waitTimeout,u=(r=s.backoffMs)!=null?r:Iu.backoffMs,d=(l=s.maxRetries)!=null?l:Iu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Iu.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield xQ(t,n,a,h)}catch(m){if(m?.code!==_Q||p>=f)throw m;if(p++,yield wQ(c,h).catch(()=>{}),h?.aborted){const x=new Error("Aborted");throw x.name="AbortError",x}u>0&&(yield new Promise(x=>globalThis.setTimeout(x,u*p)))}}})}function wc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function SQ(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function yv(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=SQ(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function kv(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function $M(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function bv(e,t=360,n=500){return $M(e,t,n)}function xv(e,t=360,n=500){return $M(e,t,n)}var CQ=Object.defineProperty,AQ=Object.defineProperties,MQ=Object.getOwnPropertyDescriptors,gS=Object.getOwnPropertySymbols,EQ=Object.prototype.hasOwnProperty,TQ=Object.prototype.propertyIsEnumerable,vS=(e,t,n)=>t in e?CQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LM=(e,t)=>{for(var n in t||(t={}))EQ.call(t,n)&&vS(e,n,t[n]);if(gS)for(var n of gS(t))TQ.call(t,n)&&vS(e,n,t[n]);return e},mk=(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 gk=()=>mo(()=>import("./mermaid.core-BuL5LAnc.js").then(e=>e.bn),[]);let gr=null,vk=gk;function NQ(e){vk=e,gr=null}function IQ(e){NQ(gk)}function $Q(){return typeof vk=="function"}function yS(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=LM({},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},AQ(n,MQ(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function kS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=LM({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 M_e(){return mk(this,null,function*(){if(gr)return gr;const e=(function(){try{const s=globalThis;return yS(s?.mermaid)}catch{return null}})();if(e)return gr=e,kS(gr),gr;const t=vk;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===gk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(gr=yS(n),kS(gr),gr):null})}let ho=null,pl=null;const js=new Map;let bS=5,xS=!1;const LQ="WORKER_BUSY",FQ="MERMAID_DISABLED";function OQ(e){ho=e,pl=null;const t=e;ho.onmessage=n=>{if(ho!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=js.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},ho.onerror=n=>{var s,o;if(ho===t)if(js.size!==0){try{xS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of js.entries())r.reject(new Error(`Worker error: ${n.message}`));js.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},ho.onmessageerror=n=>{var s,o;if(ho===t)if(js.size!==0){try{xS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of js.entries())r.reject(new Error("Worker messageerror"));js.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function RQ(){var e;if(ho)try{for(const[t,n]of js.entries())n.reject(new Error("Worker cleared"));js.clear(),(e=ho.terminate)==null||e.call(ho)}catch{}ho=null,pl=null}function FM(e,t,n=1400){if(!$Q()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=FQ,Promise.reject(o)}if(pl)return Promise.reject(pl);const s=ho||(pl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),pl.name="WorkerInitError",pl.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(pl);if(js.size>=bS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=LQ,o.inFlight=js.size,o.max=bS,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),js.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};js.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return js.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=js.get(r);f&&f.reject(d)},n)})}function E_e(e,t,n=1400){return mk(this,null,function*(){try{return yield FM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function T_e(e,t,n=1400){return mk(this,null,function*(){try{return yield FM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function N_e(){if(ho)try{for(const[e,t]of js.entries())t.reject(new Error("Worker terminated"));js.clear(),ho.terminate()}finally{ho=null}}var BQ=Object.defineProperty,DQ=Object.defineProperties,PQ=Object.getOwnPropertyDescriptors,_S=Object.getOwnPropertySymbols,HQ=Object.prototype.hasOwnProperty,WQ=Object.prototype.propertyIsEnumerable,wS=(e,t,n)=>t in e?BQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))HQ.call(t,n)&&wS(e,n,t[n]);if(_S)for(var n of _S(t))WQ.call(t,n)&&wS(e,n,t[n]);return e},zt=(e,t)=>DQ(e,PQ(t)),Qn=(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 zQ="__global__",F0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",_v=(()=>{const e=globalThis;if(e[F0])return e[F0];const t={scopedCustomComponents:{},revision:Na(0)};return e[F0]=t,t})(),SS=_v.revision,UQ=Symbol("markstreamCustomComponents"),qQ=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 Yd(e){return qQ.has(String(e).trim().toLowerCase())}function jQ(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function O0(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Ci(n),Ci(jQ(n))]))!o||Yd(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Cs(e){const t=Kt(UQ,null);return D(()=>{var n;return SS.value,(function(s,o={}){return SS.value,lt(lt(lt({},O0(_v.scopedCustomComponents[zQ]||{})),O0(o)),O0((function(i){return i&&_v.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const VQ=["aria-label"],KQ={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"},GQ={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},vn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Qo=vn(Ge({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),T("svg",GQ,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),T("svg",KQ,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,VQ))}),[["__scopeId","data-v-be21ab83"]]);Qo.install=e=>{e.component(Qo.__name,Qo)};const YQ={class:"emoji-node"},Oo=vn(Ge({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),T("span",YQ,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Oo.install=e=>{e.component(Oo.__name,Oo)};const ZQ=["id"],QQ=["title"],Xo=vn(Ge({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(b(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,QQ)],8,ZQ))}}),[["__scopeId","data-v-c1463a29"]]);Xo.install=e=>{e.component(Xo.__name,Xo)};const OM=(()=>{try{return!1}catch{}return!1})();function R0(e){OM&&console.warn(e)}function CS(e,t="safe",n){return ck(e,t,n)}function RM(e){return NZ(e)}function B0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function yk(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=pv((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),B0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),B0(r.value)]):Object.entries(o).map(([r,l])=>[r,B0(l)]):null,t,n);var o;if(!s)return;const i=RM(bp(s));return Object.keys(i).length>0?i:void 0}function AS(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 $u(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function D0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return kM(d,f)})(e,s);if(Vd.has(e.toLowerCase())||!l&&gM(e,i))return null;if(!l&&ak(e,i))return r?[AS(e,t,!0)]:[AS(e,t),...n,`</${e}>`];const a=ck(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=RM(a);return mn(d,zt(lt({},f),{key:u}),n.length>0?n:void 0)}return mn(e,zt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function BM(e,t){return FZ(e,t)}function wp(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=D0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);$u(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=D0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?$u(c[c.length-1].children,m):$u(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&R0(`Auto-closing unclosed tag: <${p.tagName}>`)}else R0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=D0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?$u(c[c.length-1].children,f):$u(u,f),R0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(IZ(e),t,n)}catch(o){return s=o,OM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const XQ=["innerHTML"],Jo=vn(Ge({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),s=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Cs(()=>t.customId),i=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Dc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=wp(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!BM(l,o.value))return{mode:"html",content:Dc(l,s.value)};const a=wp(l,o.value,s.value);return a===null?{mode:"html",content:Dc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),T("span",{key:0,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ie(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(b(),T("span",{key:1,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(b(),T("span",{key:2,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,XQ))}}),[["__scopeId","data-v-d17f12b0"]]);Jo.install=e=>{e.component(Jo.__name,Jo)};const JQ={class:"inline-code"},eX={key:0},io=vn(Ge({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Wd(),s=Kt("markstreamFade",void 0),o=Kt("markstreamTextStreamState",void 0),i=Kt("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=Q(t.node.code),f=Q("");let h=i?.value;const p=Q(0);function m(){return d.value+f.value}function x(){f.value&&(d.value=m(),f.value="")}Ze([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const L=String(g??""),$=u.value,_=A!==h;h=A;const E=wM({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:_});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(p.value+=1),$&&o?.set($,L)},{immediate:!0}),Ze(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=D(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(b(),T("code",JQ,[c.value?(b(),T(Be,{key:0},[Qe(O(a.value),1)],64)):(b(),T(Be,{key:1},[d.value?(b(),T("span",eX,O(d.value),1)):re("",!0),f.value?(b(),T("span",{key:1,class:Pe(["inline-code-stream-delta",[k.value]]),onAnimationend:x},O(f.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);io.install=e=>{e.component(io.__name,io)};const wv=Q(!1),MS=Q(""),ES=Q("top"),od=Q(null),id=Q(null),Sv=Q(null),Cv=Q(null),TS=Q(null);let xh=null,_h=null,Av=0;function DM(){xh&&(clearTimeout(xh),xh=null),_h&&(clearTimeout(_h),_h=null)}let Yf=!1,Zf=null,NS=!1;function tX(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Av;DM();const l=()=>Qn(null,null,function*(){var a,c;if(yield(function(){return Qn(this,null,function*(){if(!Yf&&!NS&&typeof document<"u"){Zf!=null||(Zf=Qn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([mo(()=>import("./vue.runtime.esm-bundler-DvsjYmbL.js"),[]),mo(()=>import("./Tooltip-CYfSKW77.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:wv.value,"anchor-el":od.value,content:MS.value,placement:ES.value,id:id.value,originX:Sv.value,originY:Cv.value,isDark:(p=TS.value)!=null?p:void 0})}}).mount(h),Yf=!0}));try{yield Zf}catch(u){Yf=!1,Zf=null,NS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Yf&&r===Av){id.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,od.value=e,MS.value=t,ES.value=n,Sv.value=(a=o?.x)!=null?a:null,Cv.value=(c=o?.y)!=null?c:null,TS.value=typeof i=="boolean"?i:null,wv.value=!0;try{e.setAttribute("aria-describedby",id.value)}catch{}}});s?l():xh=setTimeout(l,80)}function nX(e=!1){Av+=1,DM();const t=()=>{if(od.value&&id.value)try{od.value.removeAttribute("aria-describedby")}catch{}wv.value=!1,od.value=null,id.value=null,Sv.value=null,Cv.value=null};e?t():_h=setTimeout(t,120)}const Mv={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Ev=e=>{var t;return(t=Mv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function IS(e){return{t(t){if(e.te&&Mv[t]&&!e.te(t))return Ev(t);const n=e.t(t);return n===t&&Mv[t]?Ev(t):n}}}function sX(){const e=(function(){var t,n;try{const s=Zs(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return IS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return IS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Ev}}function oX(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 iX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],rX={key:1,class:"image-placeholder"},lX={key:1,class:"image-node__raw-text"},aX={key:0,class:"image-shimmer-overlay"},cX={key:1,class:"image-node__raw-text"},uX={key:2,class:"image-error"},Sl=vn(Ge({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Q(!1),i=Q(!1),r=Q(""),l=Q("primary"),a=Q(null),c=Wd(),u=Kt(mv,null);let d="",f=null;const h=D(()=>dw(n.node.src)),p=D(()=>dw(n.fallbackSrc)),m=D(()=>r.value),x=D(()=>!n.lazy),k=D(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=D(()=>l.value==="failed"),v=D(()=>!x.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=D(()=>oX(n,c));function A(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&>(()=>{A(R)})}function $(){f&&(clearTimeout(f),f=null)}function _(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),$(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),E())},8e3)))}function E(){return Qn(this,null,function*(){const R=d;R&&($(),d="",yield gt(),A(R),u?.markSettled(R))})}function N(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,o.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,s("error",r.value),L()}function F(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,m.value])}const{t:I}=sX();return Ze([h,p,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ze([k,o,i,m,()=>n.lazy],([R,B,P,z,W])=>R&&z&&!P?B?(E(),void L()):W?(_(),void L()):void(B||P||_()):(E(),void L()),{flush:"post",immediate:!0}),ps(()=>{(function(){const R=d;R&&($(),d="",u?.markSettled(R))})()}),(R,B)=>{var P,z,W,X,U;return b(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(b(),T("img",{key:0,src:m.value,alt:String((z=(P=n.node.alt)!=null?P:n.node.title)!=null?z:""),title:String((X=(W=n.node.title)!=null?W:n.node.alt)!=null?X:""),class:Pe(["image-node__img",{"is-loading":!x.value&&!o.value,"is-loaded":x.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(U=n.node.alt)!=null?U:C(I)("image.preview"),onError:N,onLoad:F,onClick:S},null,42,iX)):re("",!0),e.node.loading&&!i.value?(b(),T("span",rX,[n.usePlaceholder?Bn(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),T("span",lX,O(e.node.raw),1))])):re("",!0),ie(Tl,{name:"shimmer-fade"},{default:Me(()=>[v.value&&!e.node.loading?(b(),T("span",aX,[n.usePlaceholder?Bn(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),T("span",cX,O(e.node.raw),1))])):re("",!0)]),_:3}),g.value?(b(),T("span",uX,[Bn(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("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)),w("span",null,O(C(I)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Sl.install=e=>{e.component(Sl.__name,Sl)};const dX={key:2},sr=Ge({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Cs(()=>t.customId),s=Kt("markstreamHtmlPolicy",void 0),o=Kt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const x=(p=o?.value)!=null?p:{};return zt(lt({},x),{customId:(m=t.customId)!=null?m:x.customId,htmlPolicy:i.value})}),l=$i({loader:()=>Promise.resolve().then(()=>Ck),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Yd(String(t.node.type)))),u=D(()=>c.value?yk(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?(b(),be(Ks(a.value),bn({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:Me(()=>[d.value?(b(),be(C(l),bn({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?(b(),be(C(l),bn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),be(Ks(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),T("span",dX,O(h.value),1)):re("",!0)}}),fX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],hX={key:0,translate:"no",class:"markstream-pre__diff-code"},pX={class:"markstream-pre__diff-number","aria-hidden":"true"},mX={class:"markstream-pre__diff-content"},gX={class:"markstream-pre__diff-content-inner"},vX={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},yX=["textContent"],Vo=Ge({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=D(()=>{var S,I,R;const B=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((R=String(B).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${n.value}`),o=D(()=>{var S,I,R,B,P;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(I=t.node)==null?void 0:I.code)!=null?R:""):(function(z,W){const X=String(z??"");return W?X:X.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((P=t.node)==null?void 0:P.loading)===!0)}),i=D(()=>o.value.split(/\r\n|\n|\r/)),r=D(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=D(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=D(()=>l.value&&t.diffInline===!0),c=D(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",R={}){const B=u(S);return{code:S,kind:B&&I!=="hunk"&&!R.preserveBlankKind?"context":I,empty:B}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function x(S,I){const R=f(S),B=f(I),P=(function(ce,fe){const se=ce.length,Y=fe.length;if((se+1)*(Y+1)>15e5)return null;const J=Y+1,le=new Uint32Array((se+1)*(Y+1));for(let ae=1;ae<=se;ae++)for(let me=1;me<=Y;me++){const q=ae*J+me;if(ce[ae-1]===fe[me-1])le[q]=le[(ae-1)*J+(me-1)]+1;else{const ne=le[(ae-1)*J+me],ge=le[ae*J+(me-1)];le[q]=ne>=ge?ne:ge}}const He=[];let de=se,G=Y;for(;de>0&&G>0;)ce[de-1]===fe[G-1]?(He.push({originalIndex:de-1,modifiedIndex:G-1}),de--,G--):le[(de-1)*J+G]>=le[de*J+(G-1)]?de--:G--;return He.reverse(),He})(R,B);if(P){const ce=[];let fe=0,se=0;for(const Y of P){for(;fe<Y.originalIndex;)ce.push(zt(lt({},d(R[fe],"removed",{preserveBlankKind:h(R,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;se<Y.modifiedIndex;)ce.push(zt(lt({},d(B[se],"added",{preserveBlankKind:h(B,se)})),{key:`inline-added-source-${se}`,number:se+1})),se++;ce.push(zt(lt({},d(B[Y.modifiedIndex])),{key:`inline-context-source-${Y.originalIndex}-${Y.modifiedIndex}`,number:Y.modifiedIndex+1})),fe=Y.originalIndex+1,se=Y.modifiedIndex+1}for(;fe<R.length;)ce.push(zt(lt({},d(R[fe],"removed",{preserveBlankKind:h(R,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;se<B.length;)ce.push(zt(lt({},d(B[se],"added",{preserveBlankKind:h(B,se)})),{key:`inline-added-source-${se}`,number:se+1})),se++;return ce}const z=[];let W=0,X=R.length-1,U=B.length-1;for(;W<=X&&W<=U&&R[W]===B[W];)z.push(zt(lt({},d(B[W])),{key:`inline-prefix-${W}`,number:W+1})),W++;const Z=[];for(;X>=W&&U>=W&&R[X]===B[U];)Z.unshift(zt(lt({},d(B[U])),{key:`inline-suffix-${U}`,number:U+1})),X--,U--;for(let ce=W;ce<=X;ce++)z.push(zt(lt({},d(R[ce],"removed",{preserveBlankKind:h(R,ce)})),{key:`inline-removed-source-${ce}`,number:""}));for(let ce=W;ce<=U;ce++)z.push(zt(lt({},d(B[ce],"added",{preserveBlankKind:h(B,ce)})),{key:`inline-added-source-${ce}`,number:ce+1}));return z.concat(Z)}const k=D(()=>{var S,I,R,B;const P=(function(U){const Z=U.some(fe=>p(fe)),ce=U.some(fe=>m(fe));return Z&&ce||(function(){var fe,se,Y,J;if(n.value==="diff")return!0;const le=(J=(Y=String((se=(fe=t.node)==null?void 0:fe.raw)!=null?se:"").split(/\r?\n/,1)[0])==null?void 0:Y.trim())!=null?J:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(le)})()&&(Z||ce)})(i.value),z=(function(){var U,Z;return((U=t.node)==null?void 0:U.originalCode)!=null||((Z=t.node)==null?void 0:Z.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:P?(function(U){const Z=[];let ce=1;for(const[fe,se]of U.entries())if(se.startsWith("@@"))Z.push(zt(lt({},d(se,"hunk")),{key:`inline-hunk-${fe}`,number:""}));else if(p(se))Z.push(zt(lt({},d(se.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${fe}`,number:""}));else if(m(se))Z.push(zt(lt({},d(se.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${fe}`,number:ce++}));else{const Y=se.startsWith(" ")?se.slice(1):se;Z.push(zt(lt({},d(Y)),{key:`inline-context-${fe}`,number:ce})),ce++}return Z})(i.value):x((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!P&&z){const U=f((R=t.node)==null?void 0:R.originalCode),Z=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((ce,fe)=>{const se=Z[fe]===ce?"context":"removed";return zt(lt({},d(ce,se,{preserveBlankKind:h(U,fe)})),{key:`original-${fe}`,number:fe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((ce,fe)=>{const se=U[fe]===ce?"context":"added";return zt(lt({},d(ce,se,{preserveBlankKind:h(Z,fe)})),{key:`modified-${fe}`,number:fe+1})})}]}const W=[],X=[];for(const U of i.value)if(U.startsWith("@@"))W.push(d(U,"hunk")),X.push(d(U,"hunk"));else if(U.startsWith("-")&&!U.startsWith("---"))W.push(d(U.slice(1),"removed",{preserveBlankKind:!0}));else if(U.startsWith("+")&&!U.startsWith("+++"))X.push(d(U.slice(1),"added",{preserveBlankKind:!0}));else{const Z=U.startsWith(" ")?U.slice(1):U;W.push(d(Z)),X.push(d(Z))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:W.map((U,Z)=>zt(lt({},U),{key:`original-${Z}`,number:Z+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:X.map((U,Z)=>zt(lt({},U),{key:`modified-${Z}`,number:Z+1}))}]}),g=D(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Q(null),y=Q([]);let A=null,L=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function _(S,I){var R;if(!S)return I;const B=S.querySelector(".markstream-pre__diff-content"),P=B?.getBoundingClientRect(),z=(R=P?.height)!=null?R:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const R=v.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const B=(function(ce){const fe=window.getComputedStyle(ce),se=$(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(se>0)return se;const Y=$(fe.lineHeight);return Y>0?Y:18})(R),P=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),W=Math.max(P.length,z.length),X=[];for(let ce=0;ce<W;ce++){const fe=_((S=P[ce])!=null?S:null,B),se=_((I=z[ce])!=null?I:null,B),Y=Math.max(B,fe,se);X.push({rowHeight:Y,originalHeight:fe,modifiedHeight:se})}var U,Z;U=y.value,Z=X,U.length===Z.length&&U.every((ce,fe)=>{const se=Z[fe];return se&&Math.abs(ce.rowHeight-se.rowHeight)<=.5&&Math.abs(ce.originalHeight-se.originalHeight)<=.5&&Math.abs(ce.modifiedHeight-se.modifiedHeight)<=.5})||(y.value=X)})()}))}function N(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{E()}),L.observe(S))}function F(S,I){const R=y.value[S];if(!R)return;const B=I==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Ze(v,S=>{N(S),gt(()=>E())},{flush:"post"}),Ze([l,k],()=>{N(v.value),gt(()=>E())},{flush:"post",immediate:!0}),ps(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),L?.disconnect(),L=null}),(S,I)=>(b(),T("pre",{ref_key:"preRef",ref:v,style:Yt(c.value),class:Pe([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(b(),T("code",hX,[(b(!0),T(Be,null,st(k.value,R=>(b(),T("span",{key:R.key,class:Pe(["markstream-pre__diff-pane",R.className])},[(b(!0),T(Be,null,st(R.lines,(B,P)=>(b(),T("span",{key:B.key,class:Pe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:Yt(F(P,R.key))},[I[0]||(I[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",pX,O(B.number),1),w("span",mX,[w("span",gX,O(B.code),1)])],6))),128))],2))),128))])):(b(),T(Be,{key:1},[t.showLineNumbers?(b(),T("span",vX,[(b(!0),T(Be,null,st(r.value,R=>(b(),T("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):re("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,yX)],64))],14,fX))}});Vo.install=e=>{e.component(Vo.__name,Vo)};const P0=Na(!1);let $S=null;const kX={key:0},as=vn(Ge({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=($S||($S=pk().then(k=>{P0.value=!!k}).catch(()=>{P0.value=!1})),Oh(P0)),s=Wd(),o=Kt("markstreamFade",void 0),i=Kt("markstreamTextStreamState",void 0),r=Kt("markstreamStreamVersion",void 0),l=D(()=>{const k=s.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=D(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=D(()=>{var k;const g=(k=s["index-key"])!=null?k:s.indexKey;return g==null||g===""?"":String(g)}),u=Q(t.node.content),d=Q("");let f=r?.value;const h=Q(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ze([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const A=String(k??""),L=c.value,$=y!==f;f=y;const _=wM({nextContent:A,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=_.settledContent,d.value=_.streamedDelta,_.appended&&(h.value+=1),L&&i?.set(L,A)},{immediate:!0}),Ze(a,k=>{var g;k||(g=p(),u.value=g,d.value="")});const x=D(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(b(),T("span",{class:Pe([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(b(),T("span",kX,O(u.value),1)):re("",!0),d.value?(b(),T("span",{key:1,class:Pe(["text-node-stream-delta",[x.value]]),onAnimationend:m},O(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);as.install=e=>{e.component(as.__name,as)};const PM=Ge({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return mn(Vo,zt(lt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),H0=$i({loader:()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./CodeBlockNode-CJ5S3jcL.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),Vo}}),loadingComponent:PM,delay:0,suspensible:!1}),Bi=$i(()=>Qn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return mn(as,zt(lt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield pk())return(yield mo(()=>import("./index6-CyOQc7vf.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return mn(as,zt(lt({},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:""}$`}}))}})),HM=$i(()=>Qn(null,null,function*(){try{if(yield pk())return(yield mo(()=>import("./index5-C-Vgz62s.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return mn(as,zt(lt({},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:""}$$`}}))}})),yo=vn(Ge({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),T("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);yo.install=e=>{e.component(yo.__name,yo)};const bX={class:"superscript-node"},Ro=vn(Ge({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,strong:ko,emphasis:_o,footnote_reference:Xo,strikethrough:bo,highlight:ei,insert:Do,subscript:Bo,emoji:Oo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("sup",bX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Ro.install=e=>{e.component(Ro.__name,Ro)};const xX={class:"subscript-node"},Bo=vn(Ge({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,strong:ko,emphasis:_o,footnote_reference:Xo,strikethrough:bo,highlight:ei,insert:Do,superscript:Ro,emoji:Oo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("sub",xX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Bo.install=e=>{e.component(Bo.__name,Bo)};const _X={class:"strong-node"},ko=vn(Ge({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,emphasis:_o,strikethrough:bo,highlight:ei,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Xo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("strong",_X,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);ko.install=e=>{e.component(ko.__name,ko)};const wX={class:"strikethrough-node"},bo=vn(Ge({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,strong:ko,emphasis:_o,highlight:ei,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Xo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("del",wX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);bo.install=e=>{e.component(bo.__name,bo)};const SX=["href","title","aria-label","aria-hidden","target","rel"],CX=["aria-hidden"],AX={class:"link-text-wrapper relative inline-flex"},MX={class:"leading-[normal] link-text"},xo=vn(Ge({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Kt("markstreamShowTooltips",void 0),s=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,g,v,y,A;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(k=t.animationOpacity)!=null?k:.35,_=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(_),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=Cs(()=>t.customId),r=D(()=>lt({text:as,strong:ko,strikethrough:bo,emphasis:_o,image:Sl,html_inline:Jo,inline_code:io},i.value)),l=Wd(),a=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,L]of Object.entries(v))A&&L!=null&&L!==!1&&(y[A]=L===!0?"":String(L));return CS(y,"safe","a")}),c=D(()=>lt(lt({},l),a.value)),u=D(()=>{var k,g;return CS({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())||(vV(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(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=D(()=>{const k=lt({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&nX()}const x=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,y;return e.node.loading?(b(),T("span",bn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[w("span",AX,[w("span",MX,[ie(C(as),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,CX)):(b(),T("a",bn({key:0,class:"link-node",href:u.value,title:s.value?"":x.value,"aria-label":`Link: ${x.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(L){var $,_,E,N;if(!s.value)return;const F=L,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((_=u.value)!=null&&_.includes("xn--")&&((N=(E=t.node)==null?void 0:E.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";tX(L.currentTarget,I,"top",!1,S)})(A)),onMouseleave:m}),[(b(!0),T(Be,null,st(e.node.children,(A,L)=>(b(),be(C(sr),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,SX))}}}),[["__scopeId","data-v-367e6ca4"]]);xo.install=e=>{e.component(xo.__name,xo)};const EX={class:"insert-node"},Do=vn(Ge({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,strong:ko,emphasis:_o,strikethrough:bo,highlight:ei,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Xo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("ins",EX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Do.install=e=>{e.component(Do.__name,Do)};const TX={class:"highlight-node"},ei=vn(Ge({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,strong:ko,emphasis:_o,strikethrough:bo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Xo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("mark",TX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ei.install=e=>{e.component(ei.__name,ei)};const NX={class:"emphasis-node"},_o=vn(Ge({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:as,inline_code:io,link:xo,html_inline:Jo,strong:ko,strikethrough:bo,highlight:ei,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Xo,math_inline:Bi,reference:yo},n.value));return(o,i)=>(b(),T("em",NX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),be(C(sr),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);_o.install=e=>{e.component(_o.__name,_o)};const IX={class:"hard-break"},Cl=vn(Ge({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),T("br",IX))}),[["__scopeId","data-v-50c58f70"]]);Cl.install=e=>{e.component(Cl.__name,Cl)};const Fd=Ge({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=mt({checkbox:Qo,checkbox_input:Qo,emoji:Oo,emphasis:_o,hardbreak:Cl,highlight:ei,inline_code:io,insert:Do,link:xo,reference:yo,strikethrough:bo,strong:ko,subscript:Bo,superscript:Ro,text:as}),s=Cs(()=>t.customId),o=D(()=>{const i=s.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(b(!0),T(Be,null,st(e.nodes,(l,a)=>(b(),be(C(sr),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Tv(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(Tv)}function Sp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Tv))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(Tv)?o:null}function Zc(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 $X=["cite"],LX={key:0,dir:"auto",class:"paragraph-node"},FX=["custom-id"],wh=vn(Ge({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),i=D(()=>Sp(t.node.children,!s.value)),r=D(()=>t.fade!==!1||o.value?null:Zc(i.value));return Fn("markstreamShowTooltips",D(()=>t.showTooltips)),Fn("markstreamFade",D(()=>t.fade)),(l,a)=>(b(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(b(),T("p",LX,[r.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,FX)):(b(),be(C(Fd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),be(C(Po),{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,$X))}}),[["__scopeId","data-v-abfecebc"]]);wh.install=e=>{e.component(wh.__name,wh)};const OX={class:"definition-list"},RX={class:"definition-term"},BX={class:"definition-desc"},Sh=vn(Ge({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),T("dl",OX,[(b(!0),T(Be,null,st(t.node.items,(o,i)=>(b(),T(Be,{key:i},[w("dt",RX,[ie(C(Po),{"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"])]),w("dd",BX,[ie(C(Po),{"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"]]);Sh.install=e=>{e.component(Sh.__name,Sh)};const DX=["href","title"],rd=vn(Ge({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(b(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,DX))}}),[["__scopeId","data-v-e1eb37b6"]]);rd.install=e=>{e.component(rd.__name,rd)};const PX=["id"],HX={class:"flex-1"},Ch=Ge({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",HX,[ie(C(Po),{"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,PX))}});Ch.install=e=>{e.component(Ch.__name,Ch)};const WX=["custom-id"],Nv=vn(Ge({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=Kt("markstreamFade",void 0),o=D(()=>s?.value!==!1||n.value.text?null:Zc(t.node.children)),i=D(()=>lt({text:as,inline_code:io,link:xo,image:Sl,strong:ko,emphasis:_o,strikethrough:bo,highlight:ei,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,checkbox:Qo,checkbox_input:Qo,footnote_reference:Xo,hardbreak:Cl,math_inline:Bi,reference:yo},n.value));return(r,l)=>(b(),be(Ks(`h${e.node.level}`),bn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Me(()=>[o.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,WX)):(b(!0),T(Be,{key:1},st(e.node.children,(a,c)=>(b(),be(C(sr),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Cp=Nv;Cp.install=e=>{e.component(Nv.__name,Nv)};const zX={key:0,dir:"auto",class:"paragraph-node"},UX=["custom-id"],qX={dir:"auto",class:"paragraph-node"},jX=["custom-id"],Pc=vn(Ge({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),s=Cs(()=>t.customId),o=D(()=>!!s.value.paragraph),i=D(()=>!!s.value.text),r=D(()=>{var h;return Sp((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 x=p.slice(1);if(!x.every(g=>g?.type==="list"))return null;const k=Sp([m]);return k?{paragraphChildren:k,nestedLists:x}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Zc(r.value):null),u=D(()=>{var h;return a()?Zc((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 Fn("markstreamShowTooltips",D(()=>t.showTooltips)),Fn("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,x;return b(),T("li",bn({class:"list-item",dir:"auto"},f.value),[r.value?(b(),T("p",zX,[c.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,UX)):(b(),be(C(Fd),{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?(b(),T(Be,{key:1},[w("p",qX,[u.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,jX)):(b(),be(C(Fd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(b(!0),T(Be,null,st(l.value.nestedLists,(k,g)=>(b(),be(C(Po),{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)):(b(),be(C(Po),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(x=(m=n.value)==null?void 0:m.children)!=null?x:[],"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"]]);Pc.install=e=>{e.component(Pc.__name,Pc)};const Hc=vn(Ge({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Cs(()=>e.customId),n=D(()=>t.value.list_item||Pc);return(s,o)=>(b(),be(Ks(e.node.ordered?"ol":"ul"),{class:Pe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Me(()=>[(b(!0),T(Be,null,st(e.node.items,(i,r)=>{var l;return b(),be(Ks(n.value),bn({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"]]);Hc.install=e=>{e.component(Hc.__name,Hc)};const WM=Symbol("ViewportPriority");function VX(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()}}function x(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&x())},{timeout:1200}))}Ze(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const k=(g,v)=>{const y=Q(!1);let A,L=!1;const $=new Promise(N=>{A=()=>{L||(L=!0,N())}}),_=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:_};const E=(function(N,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(B,P){var z,W,X;return{root:(z=e?.(B??null))!=null?z:null,rootMargin:(W=P?.rootMargin)!=null?W:"300px",threshold:(X=P?.threshold)!=null?X:0}})(N,F);if(a&&(R=S,(I=c)&&I.root===R.root&&I.rootMargin===R.rootMargin&&I.threshold===R.threshold))return a;var I,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const P of B)(P.isIntersecting||P.intersectionRatio>0)&&m(P.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const B of u.keys())a.observe(B);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),x(),{isVisible:y,whenVisible:$,destroy:_}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:_})};return Fn(WM,k),k}function KX(){var e,t;const n=Kt(WM,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=s.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=Q(!1);let p,m=!1;const x=new Promise(v=>{p=()=>{m||(m=!0,v())}}),k=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:p,visible:h}),g.observe(f),i.add(f),d(),{isVisible:h,whenVisible:x,destroy:k}):(h.value=!0,p(),{isVisible:h,whenVisible:x,destroy:k})}}const GX={key:2,class:"html-block-node__raw"},YX=["innerHTML"],ZX={key:1,class:"html-block-node__placeholder"},ld=vn(Ge({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamNestedRendererProps",void 0),o=D(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=D(()=>{var L,$;const _=(L=s?.value)!=null?L:{};return zt(lt({},_),{customId:($=t.customId)!=null?$:_.customId,htmlPolicy:o.value})}),r=$i({loader:()=>Promise.resolve().then(()=>Ck),suspensible:!1}),l=D(()=>{const L=pv(t.node.attrs,o.value);if(!L)return;const $=bp(L);return Object.keys($).length>0?$:void 0}),a=D(()=>{const L=String(t.node.tag||"").trim(),$=pv(t.node.attrs,o.value,L);if(!$)return;const _=bp($);return Object.keys(_).length>0?_:void 0}),c=Cs(()=>t.customId),u=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Q(null),f=Q(typeof window>"u"),h=Q(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),x=D(()=>{const L=m.value.trim().toLowerCase();return A6.has(L)||ak(L,o.value)}),k=D(()=>p.value.length>0&&!!t.node.tag&&!x.value),g=D(()=>{var L,$,_;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=h.value)!=null?L:""};const E=($=h.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Dc(E,o.value)};if(t.node.loading){const F=wp(E,c.value,o.value);return F===null?{mode:"text",content:(_=t.node.raw)!=null?_:E}:{mode:"dynamic",nodes:F}}if(!BM(E,c.value))return{mode:"html",content:Dc(E,o.value)};const N=wp(E,c.value,o.value);return N===null?{mode:"html",content:Dc(E,o.value)}:{mode:"dynamic",nodes:N}}),v=KX(),y=Q(null),A=!!t.node.loading;return typeof window<"u"?(Ze(d,L=>{var $,_;if((_=($=y.value)==null?void 0:$.destroy)==null||_.call($),y.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!L)return void(f.value=!1);const E=v(L,{rootMargin:"400px"});y.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ze(()=>t.node.content,L=>{A&&!f.value||(h.value=L)})):f.value=!0,ps(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(b(),be(Ks(k.value?m.value:"div"),bn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:Me(()=>[f.value?(b(),T(Be,{key:0},[g.value.mode==="structured"?(b(),be(C(r),bn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(b(),be(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(b(),T("pre",GX,O(g.value.content),1)):(b(),T("div",bn({key:3},l.value,{innerHTML:g.value.content}),null,16,YX))],64)):(b(),T("div",ZX,[Bn(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);ld.install=e=>{e.component(ld.__name,ld)};const QX={dir:"auto",class:"paragraph-node"},XX=["custom-id"],xa=vn(Ge({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Cs(()=>t.customId),s=Kt("markstreamHtmlPolicy",void 0),o=Kt("markstreamFade",void 0),i=Kt("markstreamParseOptions",void 0),r=Kt("markstreamCustomMarkdownIt",void 0),l=Kt("markstreamNestedRendererProps",void 0),a=D(()=>{var _;return(_=s?.value)!=null?_:"safe"}),c=D(()=>{var _;return(_=t.parseOptions)!=null?_:i?.value}),u=D(()=>{var _;return(_=t.customMarkdownIt)!=null?_:r?.value}),d=D(()=>{var _,E;return(E=t.customHtmlTags)!=null?E:(_=l?.value)==null?void 0:_.customHtmlTags}),f=D(()=>{var _,E;const N=(_=l?.value)!=null?_:{};return zt(lt({},N),{customId:(E=t.customId)!=null?E:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=$i({loader:()=>Promise.resolve().then(()=>Ck),suspensible:!1});function p(_){var E;return _.type==="text"&&String((E=_.content)!=null?E:"").trim()===""}const m=D(()=>t.node.children.filter(_=>!p(_))),x=D(()=>m.value.length>0&&m.value.every(_=>_.type==="image"||(function(E){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(E);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(_))),k=D(()=>new Set(nu(d.value))),g=D(()=>{if(!x.value||m.value.length<=1)return t.node.children;const _=[];for(let E=0;E<t.node.children.length;E++){const N=t.node.children[E];if(!p(N)){_.push(N);continue}const F=_.length>0,S=t.node.children.slice(E+1).some(I=>!p(I));F&&S&&_.push(zt(lt({},N),{content:" ",raw:" "}))}return _}),v=D(()=>o?.value===!1&&!n.value.text),y=D(()=>v.value?Zc(g.value):null);function A(_,E){return{node:_,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>lt({inline_code:io,image:Sl,link:xo,hardbreak:Cl,emphasis:_o,strong:ko,strikethrough:bo,highlight:ei,insert:Do,subscript:Bo,superscript:Ro,html_inline:Jo,html_block:ld,emoji:Oo,checkbox:Qo,math_inline:Bi,checkbox_input:Qo,reference:yo,footnote_anchor:rd,footnote_reference:Xo,text:as},n.value)),$=D(()=>g.value.map((_,E)=>{var N;const F=(function(S){var I,R,B,P;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||N6(S.content);if(z&&!k.value.has(z)&&I6((R=S.content)!=null?R:S.raw,z)){const W=String((P=(B=S.content)!=null?B:S.raw)!=null?P:"");return{child:{type:"text",content:W,raw:W},component:as,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Yd(String(S.type)))}})(_);return zt(lt({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?yk(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:_})}));return(_,E)=>(b(),T("p",QX,[y.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,XX)):(b(!0),T(Be,{key:1},st($.value,N=>{return b(),T(Be,{key:N.key},[x.value&&p(N.originalChild)?(b(),T(Be,{key:0},[Qe(O((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(b(),be(Ks(N.component),bn({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:Me(()=>[N.hasSlotChildren?(b(),be(C(h),bn({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?(b(),be(C(h),bn({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"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),be(Ks(N.component),bn({key:2,ref_for:!0},A(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);xa.install=e=>{e.component(xa.__name,xa)};const JX={class:"table-node-wrapper"},eJ=["aria-busy"],tJ={key:0},nJ=["custom-id"],sJ=["aria-label","onPointerdown"],oJ=["custom-id"],iJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ad=vn(Ge({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var k;return(k=t.node.loading)!=null&&k}),s=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=Q(null),i=Q([]);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):[]);Fn("markstreamShowTooltips",D(()=>t.showTooltips)),Fn("markstreamFade",D(()=>t.fade));const u=Cs(()=>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,y=h.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Sp(k.children,v,!0),L={simpleChildren:A,plainText:A&&g?Zc(A):null};return h.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function x(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),r=null)}return Ze(l,()=>{x(),i.value=[]}),ps(x),(k,g)=>(b(),T("div",JX,[w("table",{ref_key:"tableRef",ref:o,class:Pe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),T("colgroup",tJ,[(b(!0),T(Be,null,st(e.node.header.cells,(v,y)=>(b(),T("col",{key:y,style:Yt(c.value[y])},null,4))),128))])):re("",!0),w("thead",null,[w("tr",null,[(b(!0),T(Be,null,st(e.node.header.cells,(v,y)=>(b(),T("th",{key:y,dir:"auto",class:Pe([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(v).plainText),9,nJ)):p(v).simpleChildren?(b(),be(C(Fd),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(b(),be(C(Po),{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]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(b(),T("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(L,$){if($.button!==0)return;const _=(function(){var F;const S=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=_[L],N=_[L+1];E&&N&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:E,nextStartWidth:N,widths:_},i.value=_,window.addEventListener("pointermove",m),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x))})(y,A)},null,40,sJ)):re("",!0)],2))),128))])]),w("tbody",null,[(b(!0),T(Be,null,st(s.value,(v,y)=>(b(),T("tr",{key:y},[(b(!0),T(Be,null,st(v.cells,(A,L)=>(b(),T("td",{key:L,class:Pe([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,oJ)):p(A).simpleChildren?(b(),be(C(Fd),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),be(C(Po),{key:2,nodes:A.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]=$=>k.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,eJ),ie(Tl,{name:"table-node-fade"},{default:Me(()=>[n.value?(b(),T("div",iJ,[Bn(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ad.install=e=>{e.component(ad.__name,ad)};const rJ={class:"hr-node"},Ah=vn({},[["render",function(e,t){return b(),T("hr",rJ)}],["__scopeId","data-v-39b2349c"]]);Ah.install=e=>{e.component(Ah.__name,Ah)};const lJ={class:"unknown-node"},Iv=Ge({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),T("div",lJ,O(e.node.raw),1))}),Mh=vn(Ge({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),s=Cs(()=>t.customId),o=D(()=>lt({text:as,paragraph:xa,heading:Cp,inline_code:io,link:xo,image:Sl,strong:ko,emphasis:_o,strikethrough:bo,insert:Do,subscript:Bo,superscript:Ro,checkbox:Qo,checkbox_input:Qo,hardbreak:Cl,math_inline:Bi,reference:yo,list:Hc,math_block:HM,table:ad},s.value));return(i,r)=>(b(),T("div",bn({class:n.value},e.node.attrs),[(b(!0),T(Be,null,st(e.node.children,(l,a)=>{return b(),be(Ks((c=l.type,o.value[c]||Iv)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Mh.install=e=>{e.component(Mh.__name,Mh)};const aJ=["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"],LS=[[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 cJ(e){if(e<=255)return aJ[e];let t=0,n=LS.length-1;for(;t<=n;){const s=t+n>>1,o=LS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const uJ=/[ \t\n\r\f]+/g,dJ=/[\t\n\r\f]| {2,}|^ | $/;let W0=null;const fJ=new RegExp("\\p{Script=Arabic}","u"),Lm=new RegExp("\\p{M}","u"),zM=new RegExp("\\p{Nd}","u");function FS(e){return fJ.test(e)}function OS(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function $r(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(OS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(OS(n))return!0}}return!1}const hJ=new Set([" "," ","","\uFEFF"]);function pJ(e){return $r(e)}function $v(e){return!(function(t){const n=Ap(t);return n!==null&&(kk.has(n)||Sa.has(n))})(e)&&!(function(t){const n=Ap(t);return n!==null&&hJ.has(n)})(e)}const kk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Fm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),bk=new Set(["'","’"]),Sa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),mJ=new Set([":",".","،","؛"]),gJ=new Set(["၏"]),vJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function yJ(e){if(xk(e))return!0;let t=!1;for(const n of e)if(Sa.has(n))t=!0;else if(!t||!Lm.test(n))return!1;return t}function kJ(e){for(const t of e)if(!kk.has(t)&&!Sa.has(t))return!1;return e.length>0}function bJ(e){if(xk(e))return!0;for(const t of e)if(!Fm.has(t)&&!bk.has(t)&&!Lm.test(t))return!1;return e.length>0}function xk(e){let t=!1;for(const n of e)if(n!=="\\"&&!Lm.test(n)){if(!(Fm.has(n)||Sa.has(n)||bk.has(n)))return!1;t=!0}return t}function UM(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 Ap(e){if(e.length===0)return null;const t=UM(e,e.length);return e.slice(t)}function xJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Lm.test(s))n--;else{if(!Fm.has(s)&&!bk.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function _J(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function RS(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 BS(e,t){return e&&t!==null&&mJ.has(t)}function wJ(e){const t=Ap(e);return t!==null&&gJ.has(t)}function SJ(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function Lv(e){let t=e.length;for(;t>0;){const n=UM(e,t),s=e.slice(n,t);if(vJ.has(s))return!0;if(!Sa.has(s))return!1;t=n}return!1}function CJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
272
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const AJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function pi(e){return e.length===1?e[0]:e.join("")}function MJ(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),pi(n)}function EJ(e,t,n,s){if(!AJ.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=CJ(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:pi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:pi(r),isWordLike:a,kind:i,start:l}),o}function z0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const TJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function NJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||TJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function IJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const $J=new Set([":","-","/","×",",",".","+","–","—"]),DS=/^[A-Za-z0-9_]+[,:;]*$/,PS=/[,:;]+$/;function HS(e){for(const t of e)if(zM.test(t))return!0;return!1}function Eh(e){if(e.length===0)return!1;for(const t of e)if(!zM.test(t)&&!$J.has(t))return!1;return!0}function WS(e,t,n){var s,o,i;const r=(W0===null&&(W0=new Intl.Segmenter(void 0,{granularity:"word"})),W0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],x=[],k=[],g=[],v=[];for(const _ of r.segment(e))for(const E of EJ(_.segment,(s=_.isWordLike)!=null&&s,_.index,n)){let N=function(){h[W]!==null&&(c[W]=[RS(a,h,p,W)],h[W]=null),c[W].push(E.text),u[W]=u[W]||E.isWordLike,m[W]=m[W]||I,x[W]=x[W]||R,k[W]=P,g[W]=z,v[W]=BS(x[W],B)};const F=E.kind==="text",S=_J(E.text,E.isWordLike,E.kind),I=$r(E.text),R=FS(E.text),B=Ap(E.text),P=Lv(E.text),z=wJ(E.text),W=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[W]==="text"&&I&&m[W]&&k[W]||F&&l>0&&d[W]==="text"&&kJ(E.text)&&m[W]||F&&l>0&&d[W]==="text"&&g[W]?N():F&&l>0&&d[W]==="text"&&E.isWordLike&&R&&v[W]?(N(),u[W]=!0):S!==null&&l>0&&d[W]==="text"&&h[W]===S?p[W]=((o=p[W])!=null?o:1)+1:F&&!E.isWordLike&&l>0&&d[W]==="text"&&(yJ(E.text)||E.text==="-"&&u[W])?N():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,h[l]=S,p[l]=S===null?0:1,m[l]=I,x[l]=R,k[l]=P,g[l]=z,v[l]=BS(R,B),l++)}for(let _=0;_<l;_++)h[_]===null?a[_]=pi(c[_]):a[_]=RS(a,h,p,_);for(let _=1;_<l;_++)d[_]==="text"&&!u[_]&&xk(a[_])&&d[_-1]==="text"&&(a[_-1]+=a[_],u[_-1]=u[_-1]||u[_],a[_]="");const y=Array.from({length:l},()=>null);let A=-1;for(let _=l-1;_>=0;_--){const E=a[_];if(E.length!==0){if(d[_]==="text"&&!u[_]&&bJ(E)&&A>=0&&d[A]==="text"){const N=(i=y[A])!=null?i:[];N.push(E),y[A]=N,f[A]=f[_],a[_]="";continue}A=_}}for(let _=0;_<l;_++){const E=y[_];E!=null&&(a[_]=MJ(E,a[_]))}let L=0;for(let _=0;_<l;_++){const E=a[_];E.length!==0&&(L!==_&&(a[L]=E,u[L]=u[_],d[L]=d[_],f[L]=f[_]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(_){const E=_.texts.slice(),N=_.isWordLike.slice(),F=_.kinds.slice(),S=_.starts.slice();for(let I=0;I<E.length-1;I++){if(F[I]!=="text"||F[I+1]!=="text"||!$r(E[I])||!$r(E[I+1]))continue;const R=xJ(E[I]);R!==null&&(E[I]=R.head,E[I+1]=R.tail+E[I+1],S[I+1]=S[I]+R.head.length)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I],B=_.kinds[I],P=_.isWordLike[I];if(B==="text"&&P&&DS.test(R)){const z=[R];let W=PS.test(R),X=I+1;for(;W&&X<_.len&&_.kinds[X]==="text"&&_.isWordLike[X]&&DS.test(_.texts[X]);){const U=_.texts[X];z.push(U),W=PS.test(U),X++}E.push(pi(z)),N.push(!0),F.push("text"),S.push(_.starts[I]),I=X-1;continue}E.push(R),N.push(P),F.push(B),S.push(_.starts[I])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I];if(_.kinds[I]==="text"&&R.includes("-")){const B=R.split("-");let P=B.length>1;for(let z=0;z<B.length;z++){const W=B[z];if(!P)break;W.length!==0&&HS(W)&&Eh(W)||(P=!1)}if(P){let z=0;for(let W=0;W<B.length;W++){const X=B[W],U=W<B.length-1?`${X}-`:X;E.push(U),N.push(!0),F.push("text"),S.push(_.starts[I]+z),z+=U.length}continue}}E.push(R),N.push(_.isWordLike[I]),F.push(_.kinds[I]),S.push(_.starts[I])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I],B=_.kinds[I];if(B==="text"&&Eh(R)&&HS(R)){const P=[R];let z=I+1;for(;z<_.len&&_.kinds[z]==="text"&&Eh(_.texts[z]);)P.push(_.texts[z]),z++;E.push(pi(P)),N.push(!0),F.push("text"),S.push(_.starts[I]),I=z-1;continue}E.push(R),N.push(_.isWordLike[I]),F.push(B),S.push(_.starts[I])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I];if(E.push(R),N.push(_.isWordLike[I]),F.push(_.kinds[I]),S.push(_.starts[I]),!IJ(R))continue;const B=I+1;if(B>=_.len||z0(_.kinds[B]))continue;const P=[],z=_.starts[B];let W=B;for(;W<_.len&&!z0(_.kinds[W]);)P.push(_.texts[W]),W++;P.length>0&&(E.push(pi(P)),N.push(!0),F.push("text"),S.push(z),I=W-1)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=_.texts.slice(),N=_.isWordLike.slice(),F=_.kinds.slice(),S=_.starts.slice();for(let R=0;R<_.len;R++){if(F[R]!=="text"||!NJ(_,R))continue;const B=[E[R]];let P=R+1;for(;P<_.len&&!z0(F[P]);){B.push(E[P]),N[R]=!0;const z=E[P].includes("?");if(F[P]="text",E[P]="",P++,z)break}E[R]=pi(B)}let I=0;for(let R=0;R<E.length;R++){const B=E[R];B.length!==0&&(I!==R&&(E[I]=B,N[I]=N[R],F[I]=F[R],S[I]=S[R]),I++)}return E.length=I,N.length=I,F.length=I,S.length=I,{len:I,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];let I=0;for(;I<_.len;){const R=[_.texts[I]];let B=_.isWordLike[I],P=_.kinds[I],z=_.starts[I];if(P==="glue"){const W=[R[0]],X=z;for(I++;I<_.len&&_.kinds[I]==="glue";)W.push(_.texts[I]),I++;const U=pi(W);if(!(I<_.len&&_.kinds[I]==="text")){E.push(U),N.push(!1),F.push("glue"),S.push(X);continue}R[0]=U,R.push(_.texts[I]),B=_.isWordLike[I],P="text",z=X,I++}else I++;if(P==="text")for(;I<_.len&&_.kinds[I]==="glue";){const W=[];for(;I<_.len&&_.kinds[I]==="glue";)W.push(_.texts[I]),I++;const X=pi(W);I<_.len&&_.kinds[I]==="text"?(R.push(X,_.texts[I]),B=B||_.isWordLike[I],I++):R.push(X)}E.push(pi(R)),N.push(B),F.push(P),S.push(z)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let _=0;_<$.len-1;_++){const E=SJ($.texts[_]);E!==null&&($.kinds[_]!=="space"&&$.kinds[_]!=="preserved-space"||$.kinds[_+1]!=="text"||!FS($.texts[_+1])||($.texts[_]=E.space,$.isWordLike[_]=!1,$.kinds[_]=$.kinds[_]==="preserved-space"?"preserved-space":"space",$.texts[_+1]=E.marks+$.texts[_+1],$.starts[_+1]=$.starts[_]+E.space.length))}return $}function LJ(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let tc=null;const zS=new Map;let nc=null;const FJ=new RegExp("\\p{Emoji_Presentation}","u"),OJ=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let U0=null;const US=new Map;function Fv(){if(tc!==null)return tc;if(typeof OffscreenCanvas<"u")return tc=new OffscreenCanvas(1,1).getContext("2d"),tc;if(typeof document<"u")return tc=document.createElement("canvas").getContext("2d"),tc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function il(e,t){let n=t.get(e);return n===void 0&&(n={width:Fv().measureText(e).width,containsCJK:$r(e)},t.set(e,n)),n}function Om(){if(nc!==null)return nc;if(typeof navigator>"u")return nc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},nc;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return nc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},nc}function qM(){return U0===null&&(U0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),U0}function RJ(e){return FJ.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=qM();for(const a of l.segment(i))RJ(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function BJ(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function DJ(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function qS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Om().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,A=d,L=a){l++,a=0,c=!1,f=-1,h=0}function m(y,A){c=!0,u=y+1,d=0,a=A}function x(y,A,L){c=!0,u=y,d=A+1,a=L}function k(y,A){c?(a+=A,u=y+1,d=0):m(y,A)}function g(y,A){const L=i[y];for(let $=A;$<L.length;$++){const _=L[$];c?a+_>r?(p(),x(y,$,_)):(a+=_,u=y,d=$+1):x(y,$,_)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=BJ(e,v),!(v>=s.length)));){const y=s[v],A=o[v],L=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+y>r){if(L){k(v,y),p(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(y>t&&i[v]!==null){p(),g(v,0),v++;continue}p()}else k(v,y),L&&(f=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,h=a-y),v++}return c&&p(),l}let q0=null;function PJ(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=Lv(d),l=Fm.has(d)}function u(d,f){s.push(d),i=i||f;const h=Lv(d);r=d.length===1&&Sa.has(d)&&r||h,l=!1}for(const d of(q0===null&&(q0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),q0).segment(e)){const f=d.segment,h=$r(f);s.length!==0?l||kk.has(f)||Sa.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 HJ(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=$r(e[0].text),i=$v(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=$r(a.text),u=$v(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function WJ(e,t,n,s){const o=Om(),{cache:i,emojiCorrection:r}=(function($,_){Fv().font=$;const E=(function(S){let I=zS.get(S);return I||(I=new Map,zS.set(S,I)),I})($),N=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),F=_?(function(S,I){let R=US.get(S);if(R!==void 0)return R;const B=Fv();B.font=S;const P=B.measureText("😀").width;if(R=0,P>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const W=z.getBoundingClientRect().width;document.body.removeChild(z),P-W>.5&&(R=P-W)}return US.set(S,R),R})($,N):0;return{cache:E,fontSize:N,emojiCorrection:F}})(t,(l=e.normalized,OJ.test(l)));var l;const a=oa("-",il("-",i),r),c=8*oa(" ",il(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const m=null,x=[],k=n?[]:null,g=Array.from({length:e.len});function v($,_,E,N,F,S,I){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(_),d.push(E),f.push(N),h.push(F),x.push(I),k!==null&&k.push($)}function y($,_,E,N,F){const S=il($,i),I=oa($,S,r),R=_==="space"||_==="preserved-space"||_==="zero-width-break"?0:I,B=_==="space"||_==="zero-width-break"?0:I;if(F&&N&&$.length>1){let P="sum-graphemes";Eh($)?P="pair-context":o.preferPrefixWidthsForBreakableRuns&&(P="segment-prefixes");const z=(function(W,X,U,Z,ce){if(X.breakableFitAdvances!==void 0)return X.breakableFitAdvances;const fe=qM(),se=[];for(const He of fe.segment(W))se.push(He.segment);if(se.length<=1)return X.breakableFitAdvances=null,X.breakableFitAdvances;if(ce==="sum-graphemes"){const He=[];for(const de of se){const G=il(de,U);He.push(oa(de,G,Z))}return X.breakableFitAdvances=He,X.breakableFitAdvances}if(ce==="pair-context"||se.length>96){const He=[];let de=null,G=0;for(const ae of se){const me=oa(ae,il(ae,U),Z);if(de===null)He.push(me);else{const q=de+ae,ne=il(q,U);He.push(oa(q,ne,Z)-G)}de=ae,G=me}return X.breakableFitAdvances=He,X.breakableFitAdvances}const Y=[];let J="",le=0;for(const He of se){J+=He;const de=oa(J,il(J,U),Z);Y.push(de-le),le=de}return X.breakableFitAdvances=Y,X.breakableFitAdvances})($,S,i,r,P);return void v($,I,R,B,_,E,z)}v($,I,R,B,_,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const _=e.texts[$],E=e.isWordLike[$],N=e.kinds[$],F=e.starts[$];if(N==="soft-hyphen"){v(_,0,a,a,N,F,null);continue}if(N==="hard-break"){v(_,0,0,0,N,F,null);continue}if(N==="tab"){v(_,0,0,0,N,F,null);continue}const S=il(_,i);if(N==="text"&&S.containsCJK){const I=PJ(_,o),R=s==="keep-all"?HJ(I):I;for(let B=0;B<R.length;B++){const P=R[B];y(P.text,"text",F+P.start,E,s==="keep-all"||!$r(P.text))}continue}y(_,N,F,E,!0)}const A=(function($,_,E){const N=[];for(let F=0;F<$.length;F++){const S=$[F],I=S.startSegmentIndex<_.length?_[S.startSegmentIndex]:E,R=S.endSegmentIndex<_.length?_[S.endSegmentIndex]:E,B=S.consumedEndSegmentIndex<_.length?_[S.consumedEndSegmentIndex]:E;N.push({startSegmentIndex:I,endSegmentIndex:R,consumedEndSegmentIndex:B})}return N})(e.chunks,g,u.length),L=m===null?null:(function($,_){const E=(function(F){const S=F.length;if(S===0)return null;const I=new Array(S);let R=!1;for(let U=0;U<S;){const Z=F.charCodeAt(U);let ce=Z,fe=1;if(Z>=55296&&Z<=56319&&U+1<S){const Y=F.charCodeAt(U+1);Y>=56320&&Y<=57343&&(ce=Y-56320+(Z-55296<<10)+65536,fe=2)}const se=cJ(ce);se!=="R"&&se!=="AL"&&se!=="AN"||(R=!0);for(let Y=0;Y<fe;Y++)I[U+Y]=se;U+=fe}if(!R)return null;let B=0;for(let U=0;U<S;U++){const Z=I[U];if(Z==="L"){B=0;break}if(Z==="R"||Z==="AL"){B=1;break}}const P=new Int8Array(S);for(let U=0;U<S;U++)P[U]=B;const z=1&B?"R":"L",W=z;let X=W;for(let U=0;U<S;U++)I[U]==="NSM"?I[U]=X:X=I[U];X=W;for(let U=0;U<S;U++){const Z=I[U];Z==="EN"?I[U]=X==="AL"?"AN":"EN":Z!=="R"&&Z!=="L"&&Z!=="AL"||(X=Z)}for(let U=0;U<S;U++)I[U]==="AL"&&(I[U]="R");for(let U=1;U<S-1;U++)I[U]==="ES"&&I[U-1]==="EN"&&I[U+1]==="EN"&&(I[U]="EN"),I[U]!=="CS"||I[U-1]!=="EN"&&I[U-1]!=="AN"||I[U+1]!==I[U-1]||(I[U]=I[U-1]);for(let U=0;U<S;U++){if(I[U]!=="EN")continue;let Z;for(Z=U-1;Z>=0&&I[Z]==="ET";Z--)I[Z]="EN";for(Z=U+1;Z<S&&I[Z]==="ET";Z++)I[Z]="EN"}for(let U=0;U<S;U++){const Z=I[U];Z!=="WS"&&Z!=="ES"&&Z!=="ET"&&Z!=="CS"||(I[U]="ON")}X=W;for(let U=0;U<S;U++){const Z=I[U];Z==="EN"?I[U]=X==="L"?"L":"EN":Z!=="R"&&Z!=="L"||(X=Z)}for(let U=0;U<S;U++){if(I[U]!=="ON")continue;let Z=U+1;for(;Z<S&&I[Z]==="ON";)Z++;const ce=(U>0?I[U-1]:W)!=="L"?"R":"L";if(ce===((Z<S?I[Z]:W)!=="L"?"R":"L"))for(let fe=U;fe<Z;fe++)I[fe]=ce;U=Z-1}for(let U=0;U<S;U++)I[U]==="ON"&&(I[U]=z);for(let U=0;U<S;U++){const Z=I[U];1&P[U]?Z!=="L"&&Z!=="AN"&&Z!=="EN"||P[U]++:Z==="R"?P[U]++:Z!=="AN"&&Z!=="EN"||(P[U]+=2)}return P})($);if(E===null)return null;const N=new Int8Array(_.length);for(let F=0;F<_.length;F++)N[F]=E[_[F]];return N})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:x,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:x,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function zJ(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return WJ((function(c,u,d="normal",f="normal"){const h=(function(x){const k=x??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(x){return/[\r\f]/.test(x)?x.replace(/\r\n/g,`
|
|
273
|
-
`).replace(/[\r\f]/g,`
|
|
274
|
-
`):x.replace(/\r\n/g,`
|
|
275
|
-
`)})(c):(function(x){if(!dJ.test(x))return x;let k=x.replace(uJ," ");return k.charCodeAt(0)===32&&(k=k.slice(1)),k.length>0&&k.charCodeAt(k.length-1)===32&&(k=k.slice(0,-1)),k})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(x){if(x.len<=1)return x;const k=[],g=[],v=[],y=[];let A=null,L=!1,$=0,_=!1,E=!1;function N(){A!==null&&(k.push(pi(A)),g.push(L),v.push("text"),y.push($),A=null)}for(let F=0;F<x.len;F++){const S=x.texts[F],I=x.kinds[F],R=x.isWordLike[F],B=x.starts[F];if(I==="text"){const P=pJ(S),z=$v(S);if(A!==null&&_&&E){A.push(S),L=L||R,_=_||P,E=z;continue}N(),A=[S],L=R,$=B,_=P,E=z;continue}N(),k.push(S),g.push(R),v.push(I),y.push(B)}return N(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(WS(p,u,h)):WS(p,u,h);return lt({normalized:p,chunks:LJ(m,h)},m)})(s,Om(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const j0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Ns=(()=>{const e=globalThis;if(e[j0])return e[j0];const t={configs:{},controllers:{},revision:Na(0),preparedCache:new Map,blockEstimateCache:new Map};return e[j0]=t,t})();let Lu=null;const jS=Ns.revision;function VS(e){var t;return e&&(t=Ns.configs[e])!=null?t:null}function KS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function UJ(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function V0(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!UJ(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
276
|
-
`)}return o.length>0?o:null}function K0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Lu!=null)return Lu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Lu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Lu}catch{return Lu=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Ns.blockEstimateCache.get(r);if(l)return Ns.blockEstimateCache.delete(r),Ns.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(h,p,m){const x=`${m}\0${p}\0${h}`,k=Ns.preparedCache.get(x);if(k)return Ns.preparedCache.delete(x),Ns.preparedCache.set(x,k),k.prepared;const g=zJ(h,p,{whiteSpace:m});for(Ns.preparedCache.set(x,{prepared:g});Ns.preparedCache.size>240;){const v=Ns.preparedCache.keys().next().value;if(!v)break;Ns.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const x=(function(k,g){return k.simpleLineWalkFastPath?qS(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return qS(v,y);const{widths:A,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:_,breakableFitAdvances:E,discretionaryHyphenWidth:N,tabStopAdvance:F,chunks:S}=v;if(A.length===0||S.length===0)return 0;const I=Om(),R=I.lineFitEpsilon,B=y+R;let P=0,z=0,W=!1,X=0,U=0,Z=-1,ce=0,fe=0,se=null;function Y(){Z=-1,ce=0,fe=0,se=null}function J(ne=X,ge=U,ue=z){P++,z=0,W=!1,Y()}function le(ne,ge){W=!0,X=ne+1,U=0,z=ge}function He(ne,ge,ue){W=!0,X=ne,U=ge+1,z=ue}function de(ne,ge){W?(z+=ge,X=ne+1,U=0):le(ne,ge)}function G(ne,ge,ue,ye){if(!ge)return;const j=ne==="tab"?0:L[ue],te=ne==="tab"?ye:$[ue];Z=ue+1,ce=z-ye+j,fe=z-ye+te,se=ne}function ae(ne,ge){const ue=E[ne];for(let ye=ge;ye<ue.length;ye++){const j=ue[ye];W?z+j>B?(J(),He(ne,ye,j)):(z+=j,X=ne,U=ye+1):He(ne,ye,j)}W&&X===ne&&U===ue.length&&(X=ne+1,U=0)}function me(ne){if(se!=="soft-hyphen")return!1;const ge=E[ne];if(ge==null)return!1;const{fitCount:ue,fittedWidth:ye}=(function(j,te,pe,Ce,Ie){let $e=0,he=te;for(;$e<j.length;){const Ne=he+j[$e];if(($e+1<j.length?Ne+Ie:Ne)>pe+Ce)break;he=Ne,$e++}return{fitCount:$e,fittedWidth:he}})(ge,z,y,R,N);return ue!==0&&(z=ye,X=ne,U=ue,Y(),ue===ge.length?(X=ne+1,U=0,!0):(J(ne,ue,ye+N),ae(ne,ue),!0))}function q(ne){P++,Y()}for(let ne=0;ne<S.length;ne++){const ge=S[ne];if(ge.startSegmentIndex===ge.endSegmentIndex){q();continue}W=!1,z=0,ge.startSegmentIndex,X=ge.startSegmentIndex,U=0,Y();let ue=ge.startSegmentIndex;for(;ue<ge.endSegmentIndex;){const ye=_[ue],j=ye==="space"||ye==="preserved-space"||ye==="tab"||ye==="zero-width-break"||ye==="soft-hyphen",te=ye==="tab"?DJ(z,F):A[ue];if(ye!=="soft-hyphen")if(W){if(z+te>B){const pe=z+(ye==="tab"?0:L[ue]),Ce=z+(ye==="tab"?te:$[ue]);if(se==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&ce<=B){J(Z,0,fe);continue}if(se==="soft-hyphen"&&me(ue)){ue++;continue}if(j&&pe<=B){de(ue,te),J(ue+1,0,Ce),ue++;continue}if(Z>=0&&ce<=B){if(X>Z||X===Z&&U>0){J();continue}const Ie=Z;J(Ie,0,fe),ue=Ie;continue}if(te>y&&E[ue]!==null){J(),ae(ue,0),ue++;continue}J();continue}de(ue,te),G(ye,j,ue,te),ue++}else te>y&&E[ue]!==null?ae(ue,0):le(ue,te),G(ye,j,ue,te),ue++;else W&&(X=ue+1,U=0,Z=ue+1,ce=z+N,fe=z+N,se=ye),ue++}if(W){const ye=Z===ge.consumedEndSegmentIndex?fe:z;J(ge.consumedEndSegmentIndex,0,ye)}}return P})(k,g)})(h,p);return{lineCount:x,height:x*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Ns.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Ns.blockEstimateCache.size>4e3;){const h=Ns.blockEstimateCache.keys().next().value;if(!h)break;Ns.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function jM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=V0(e.children);return i&&n.paragraph?K0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=V0(e.children),l=n.headings[i];return r&&l?K0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=V0((o=i[0])==null?void 0:o.children);return r?K0(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=jM(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 Qf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function qJ(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(Qf(String((d=u.originalCode)!=null?d:"")),Qf(String((f=u.updatedCode)!=null?f:"")),Qf(String((h=u.code)!=null?h:""))):Qf((function(p,m){const x=String(p??"");return m?x:x.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const m=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*m)})(u,r),f=(function(h,p){var m,x;if(!p)return 0;const k=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((x=h?.padding)==null?void 0:x.bottom)=="number"?h.padding.bottom:22;return Math.max(0,k)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function jJ(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function G0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=KS(s.lineHeight,1.5*KS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:jJ(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const VJ=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function GS(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))VJ.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const KJ=!1;function I_e(){return KJ}function YS(e,t,n,s){var o;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=s.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const VM=Symbol("MarkstreamMathBlockMinHeightCache");function $_e(){return Kt(VM,null)}const GJ=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],YJ=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],ZJ=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),KM=["raw","content","code","originalCode","updatedCode"],ZS=new WeakMap,QS=new WeakMap;let QJ=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function XS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ki(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=ZS.get(t);return n||(n=QJ++,ZS.set(t,n)),String(n)}function JS(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:ki(t),customMarkdownIt:ki(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:ki(e.validateLink),preTransformTokens:ki(e.preTransformTokens),postTransformTokens:ki(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function eC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
277
|
-
`,t-1)+1;return e.slice(n,t).trim()}function tC(e){const t=GM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function GM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function YM(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 _k(e){const t=String(e??"");return`${t.length}:${YM(t)}`}function Ov(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?_k(r):`${r.length}:${YM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ki(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${ki(s)}`;const i=ki(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Ov(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${Ov(r[c],t,n+1)}`).join(";")}`}return typeof e}function Mp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function ZM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Mp(s)?Fl(s,t,n+1):ZM(s,t,n+1)).join(",")}`:Mp(e)?Fl(e,t,n):Ov(e,t,n)}function XJ(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!KM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${_k(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${ki(o)}`:ZJ.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${ZM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${ki(o)}`:""}).filter(Boolean).join(";")}function JJ(e){return KM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${_k(n)}`:""}).filter(Boolean).join(";")}function Fl(e,t=new WeakMap,n=0){const s=QS.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${ki(o)}`;const r=ki(o);t.set(o,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Fl(p,c,u+1)).join("|"):"";return[a.type,JJ(d),XJ(d,c,u),f.length,h].join(":")})(e,t,n);return QS.set(o,l),l}function QM(e,t){return Fl(e)===Fl(t)}function wk(e,t,n){const s=Ti(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function nC(e,t,n){return wk(t,n,()=>Fl(e))}function XM(e,t,n){return nC(e,n,"stabilizeSignatureMs")===nC(t,n,"stabilizeSignatureMs")}function Y0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function sC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function eee(e,t){return e.length===t.length&&e===t}function Sk(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"||!eee(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(!Mp(d)||!Mp(f))return null;const h=Sk(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function tee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Sk(e,t);return n??QM(e,t)}function nee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return wk(n,"stabilizeSignatureMs",()=>{s=Sk(e,t)}),s??XM(e,t,n)}function see(e,t){const n={};for(const s of GJ){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function oee(e,t){var n;const s=lS(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=Q(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function m(){l&&(clearTimeout(l),l=void 0)}function x(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),p=Ti()}Ze([t.renderContent,t.effectiveFinal,i],([E,N,F])=>{r.value!==E&&(!F||N||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const R=I.slice(S.length);return!!R&&(!!tC(eC(I))||!(!R.includes(`
|
|
278
|
-
|
|
279
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
280
|
-
`)&&!(function(B){const P=eC(B);if(tC(P))return!1;const z=GM(P);return z.length>=2&&z.some(W=>W.trim())})(I))})(r.value,E)?x():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const R=I.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Ti()-p));S<=0?x():l=setTimeout(x,S)})())},{flush:"sync",immediate:!0}),ry(m);const k=D(()=>{var E,N,F,S;return wV(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(N=t.customComponentsMap)==null?void 0:N.value)!=null?F:{},Object.entries(S).map(([I,R])=>{const B=Ci(I);return R==null||!B||Yd(B)||C6.has(B)||Vd.has(B)?"":B}).filter(Boolean)))}),g=D(()=>{const{key:E,tags:N}=SV(k.value);if(!E)return s;const F=o.get(E);if(F)return F;const S=lS(t.instanceMsgId,{customHtmlTags:N});return o.set(E,S),S}),v=D(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=D(()=>{var E,N;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=k.value,R=S!=null,B=I.length>0;return R||B||F.streamParse==null?lt(lt(zt(lt({},F),{streamParse:(N=F.streamParse)==null||N}),R?{final:S}:{}),B?{customHtmlTags:I}:{}):F}),A=D(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),L=D(()=>JS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=D(()=>JS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ze([L,$],([E,N],[F,S])=>{F&&(E===F&&N===S||(x(),N!==S&&(a=[],d="")))},{flush:"sync"});const _=D(()=>{var E,N,F,S,I,R,B,P;if((E=e.nodes)!=null&&E.length)return a=[],d="",mt(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const W=t.debugPerformanceEnabled.value,X=W?Ti():0,U=v.value,Z=L.value,ce=$.value;c&&Z!==c&&(function(ge){var ue,ye;(ye=(ue=ge.stream)==null?void 0:ue.reset)==null||ye.call(ue)})(U),u&&ce!==u&&(a=[],d="");const fe=a.length>0&&z.startsWith(d)&&ce===u,se=W?XS(U):null,Y=W?{}:void 0,J=Y?zt(lt({},y.value),{__timing:Y}):y.value,le=hM(z,U,J),He=W?Ti():0,de=W?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let G,ae=W?Y0(le.length):void 0,me=0,q=0;if(fe){const ge=W?Ti():0;if(de){const ue=(function(ye,j,te){if(!j.length)return{nodes:ye,metrics:Y0(ye.length)};const pe=(function($e,he,Ne){const Je=Math.min($e.length,he.length);for(let it=0;it<Je;it++)if(!nee(he[it],$e[it],Ne))return it;return $e.length===he.length?-1:Je})(ye,j,te);if(pe<0)return{nodes:j,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:pe,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const Ce=ye.slice();let Ie=pe;for(let $e=0;$e<pe;$e++)Ce[$e]=j[$e];for(let $e=pe;$e<ye.length;$e++){const he=j[$e],Ne=ye[$e];he&&XM(he,Ne,te)&&(Ce[$e]=he,Ie+=1)}return{nodes:Ce,metrics:{reusedNodeCount:Ie,dirtyStartIndex:pe,stablePrefixNodeCount:pe,dirtyTailNodeCount:sC(pe,ye,j)}}})(le,a,de);G=ue.nodes,ae=ue.metrics}else{const ue=(function(ye,j){if(!j.length)return{nodes:ye,metrics:Y0(ye.length)};const te=(function(Ie,$e){const he=Math.min(Ie.length,$e.length);for(let Ne=0;Ne<he;Ne++)if(!tee($e[Ne],Ie[Ne]))return Ne;return Ie.length===$e.length?-1:he})(ye,j);if(te<0)return{nodes:j,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:te,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const pe=ye.slice();let Ce=te;for(let Ie=0;Ie<te;Ie++)pe[Ie]=j[Ie];for(let Ie=te;Ie<ye.length;Ie++){const $e=j[Ie],he=ye[Ie];$e&&QM($e,he)&&(pe[Ie]=$e,Ce+=1)}return{nodes:pe,metrics:{reusedNodeCount:Ce,dirtyStartIndex:te,stablePrefixNodeCount:te,dirtyTailNodeCount:sC(te,ye,j)}}})(le,a);G=ue.nodes,ae=ue.metrics}me=W?Ti()-ge:0,q=ae?.dirtyStartIndex==null||ae.dirtyStartIndex<0?G.length:ae.dirtyStartIndex}else G=le;de?(function(ge,ue,ye=0){for(let j=Math.max(0,ye);j<ge.length;j++)wk(ue,"primeSignatureMs",()=>Fl(ge[j]))})(G,de,q):(function(ge,ue=0){for(let ye=Math.max(0,ue);ye<ge.length;ye++)Fl(ge[ye])})(G,q);const ne=W?Ti()-He:0;if(f+=1,d=z,c=Z,u=ce,a=G,W){const ge=XS(U),ue=typeof ge?.total=="number"&&ge.total>((N=se?.total)!=null?N:0);t.logPerf(ue?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-X),nodes:G.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:ne,signatureMs:(F=de?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=de?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=de?.primeSignatureMs)!=null?I:0,signatureCallCount:(R=de?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(B=de?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(P=de?.primeSignatureCallCount)!=null?P:0,stabilizeMs:me},ae??{}),Y?Object.fromEntries(YJ.map(ye=>{var j;return[ye,(j=Y[ye])!=null?j:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:see(ge,se),streamStats:ge}:{}))}return mt(G)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:_}}function iee(e){const{isClient:t}=e,n=Q(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 x=n.value,k=x.has(f);if(h){if(k)return;const v=new Set(x);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(x);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 ree(e={}){const t=Q(""),n=Q(""),s=Q(!1),o=lQ(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 iy()&&ry(()=>{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 oC=/auto|scroll|overlay/i;function lee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return oC.test(t)||oC.test(n)}function aee(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 cee=Ge({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return xv((s=wc(e.estimatedPreviewHeightPx))!=null?s:kv(String((n=e.node.code)!=null?n:"")))});return()=>mn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?mn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),mn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),mn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>mn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,mn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"absolute inset-0"},[mn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),uee=Ge({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return bv((s=wc(e.estimatedPreviewHeightPx))!=null?s:yv(String((n=e.node.code)!=null?n:"")))});return()=>mn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?mn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),mn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>mn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[mn("span",{class:"action-icon block"})])))]):null,mn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}),dee=["data-custom-id"],fee={class:"m-0 p-0"},hee=["data-probe"],pee=["data-node-index","data-node-type"],JM=vn(Ge(zt(lt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Zs(),r=Kt("markstreamNestedRendererProps",void 0);function l(M){var H,V;const K=s[M];return(function(oe){const _e=i?.vnode.props;return!!_e&&(Object.prototype.hasOwnProperty.call(_e,oe)||Object.prototype.hasOwnProperty.call(_e,String(oe).replace(/[A-Z]/g,Ee=>`-${Ee.toLowerCase()}`)))})(M)?K:(V=(H=r?.value)==null?void 0:H[M])!=null?V:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=D(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=D(()=>{const M=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return M===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:M===!1||c.value==="docs"?"monaco":"pre"}),d=D(()=>a[c.value]),f=D(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=D(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=D(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),m=D(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),x=D(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),k=D(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),g=D(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),v=D(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),y=D(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=D(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),L=D(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),$=D(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),_={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return x.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(M){o("height-change",M)}function N(M){o("virtual-state-change",M)}function F(M){o("anchor-change",M)}const S=Q(),I=Q(null),R=Q(null),B=Q(null),P=Hs({1:null,2:null,3:null,4:null,5:null,6:null}),z=Q(!1),W=new Map,X=Q(0),U=Q(0),Z=Q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ce(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const V=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return fe(typeof V=="function"?V():V)}function fe(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?fe(M.value):typeof M=="object"&&"$el"in M?fe(M.$el):null:null}const{isClient:se,renderAsFragment:Y,debugPerformanceEnabled:J,resolvedShowTooltips:le,resolvedHtmlPolicy:He,inheritedSmoothStreaming:de,ownsTypewriterCursor:G}=(function(M){const H=typeof window<"u",V=Wd(),K=Kt("markstreamHtmlPolicy",void 0),oe=Kt("markstreamTypewriterCursor",void 0),_e=Kt("markstreamSmoothStreaming",void 0),Ee=D(()=>M.renderAsFragment===!0),Te=D(()=>!!(M.debugPerformance&&H&&typeof console<"u")),We=D(()=>{var ze;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Oe=(ze=V.showTooltips)!=null?ze:V["show-tooltips"];return Oe===""||Oe===!0||Oe==="true"||Oe!==!1&&Oe!=="false"&&void 0}),Le=D(()=>{var ze,Oe;return(Oe=(ze=M.htmlPolicy)!=null?ze:K?.value)!=null?Oe:"safe"}),Ve=D(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Ee,debugPerformanceEnabled:Te,resolvedShowTooltips:We,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:_e,inheritedTypewriterCursor:oe,ownsTypewriterCursor:Ve}})(_),{resolveViewportRoot:ae,resolveScrollContainer:me,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ne,getOffsetTopWithinRoot:ge}=(function(M,H){function V(){var Te,We;return(We=(Te=H.scrollRoot)==null?void 0:Te.call(H))!=null?We:null}function K(Te){if(typeof window>"u")return null;const We=V();if(We)return We;const Le=Te??M.value;if(!Le)return null;const Ve=Le.ownerDocument||document,ze=Ve.scrollingElement||Ve.documentElement;let Oe=Le;for(;Oe&&Oe!==Ve.body&&Oe!==ze;){if(lee(window.getComputedStyle(Oe))&&aee(Oe))return Oe;Oe=Oe.parentElement}return null}function oe(Te){if(!H.isClient)return!1;try{const We=window.getComputedStyle(Te);return!!(We.display||"").toLowerCase().includes("flex")&&(We.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function _e(Te,We,Le){var Ve,ze;if(Le)return Ee(We);const Oe=Te.scrollTop;if(!oe(Te))return Oe;const Ue=Oe<0?-Oe:Oe;return Math.max(0,((Ve=Te.scrollHeight)!=null?Ve:0)-((ze=Te.clientHeight)!=null?ze:0))-Ue}function Ee(Te){var We,Le,Ve,ze,Oe;const Ue=Number((We=Te.scrollingElement)==null?void 0:We.scrollTop),et=Number((Ve=(Le=Te.documentElement)==null?void 0:Le.scrollTop)!=null?Ve:0),tt=Number((Oe=(ze=Te.body)==null?void 0:ze.scrollTop)!=null?Oe:0);return Math.max(0,Number.isFinite(Ue)?Ue:0,Number.isFinite(et)?et:0,Number.isFinite(tt)?tt:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Te){var We,Le,Ve,ze;const Oe=V();if(Oe)return Oe;const Ue=K((We=Te??M.value)!=null?We:null);if(Ue)return Ue;const et=(ze=(Ve=Te?.ownerDocument)!=null?Ve:(Le=M.value)==null?void 0:Le.ownerDocument)!=null?ze:typeof document<"u"?document:null;return et?.scrollingElement||et?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:function(Te,We){const Le=We.ownerDocument||Te.ownerDocument||document;if((function(Ue,et){return Ue===et.documentElement||Ue===et.body||Ue===et.scrollingElement})(We,Le))return Te.getBoundingClientRect().top+Ee(Le);const Ve=We.getBoundingClientRect(),ze=Te.getBoundingClientRect(),Oe=_e(We,Le,!1);return ze.top-Ve.top+Oe}}})(S,{isClient:se,scrollRoot:ce});Fn("markstreamShowTooltips",le),Fn("markstreamHtmlPolicy",He),Fn("markstreamTypewriter",D(()=>_.typewriter!==!1)),Fn("markstreamFade",D(()=>_.fade!==!1)),Fn("markstreamTypewriterCursor",D(()=>!0)),Fn("markstreamTextStreamState",W),Fn("markstreamStreamVersion",X),Fn("markstreamParseOptions",D(()=>_.parseOptions)),Fn("markstreamCustomMarkdownIt",D(()=>_.customMarkdownIt));const{smoothStreamingEnabled:ue,renderContent:ye,effectiveFinal:j}=(function(M,H){const V=ree(M.smoothStreamingOptions),K=D(()=>{var Le,Ve,ze;return M.smoothStreaming!==!1&&!((Le=M.nodes)!=null&&Le.length)&&(M.smoothStreaming===!0||!((Ve=H.inheritedSmoothStreaming)!=null&&Ve.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((ze=M.maxLiveNodes)!=null?ze:0)<=0)}),oe=Q(!H.isClient||M.smoothStreaming===!0);gn(()=>{oe.value=!0});const _e=D(()=>oe.value&&K.value),Ee=D(()=>{var Le;return _e.value?V.visible.value:(Le=M.content)!=null?Le:""}),Te=D(()=>{var Le,Ve;const ze=(Le=M.parseOptions)!=null?Le:{};return(Ve=M.final)!=null?Ve:ze.final}),We=D(()=>{const Le=Te.value;return _e.value&&Le!=null?!!Le&&V.caughtUp.value:Le});return Ze([()=>M.content,()=>M.nodes,_e,Te],([Le,Ve,ze,Oe])=>{if(Ve?.length)return void V.reset("");const Ue=Le??"";if(!ze)return V.reset(Ue),void(Oe&&V.finish({flush:!0}));const et=V.source.value;Ue?Ue===et||(Ue.startsWith(et)?V.enqueue(Ue.slice(et.length)):V.reset(Ue)):V.reset(""),Oe&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:_e,renderContent:Ee,requestedFinal:Te,effectiveFinal:We}})(_,{isClient:se,inheritedSmoothStreaming:de});Fn("markstreamSmoothStreaming",ue);const te=Q(!1);let pe="",Ce=!1,Ie=null;function $e(){se&&Ie!=null&&(window.clearTimeout(Ie),Ie=null)}function he(){te.value=!1,$e()}function Ne(M,H){if(!J.value)return;const V=(function(){if(!J.value)return null;const K=wt(Je),oe=wt(it),_e=Math.max(bt,oe);if(K<=0&&_e<=0)return null;const Ee={total:K,maxPerFrame:_e,byLabel:(Te=Je,Object.fromEntries(Array.from(Te.entries()).sort((We,Le)=>Le[1]-We[1]||We[0].localeCompare(Le[0]))))};var Te;return Je.clear(),it.clear(),bt=0,Ee})();console.info(`[markstream-vue][perf] ${M}`,V?zt(lt({},H),{layoutReads:V}):H)}Ze([ye,()=>s.nodes,j],([M,H,V])=>{const K=M??"";return H?.length||V===!0?(he(),pe=K,void(Ce=!0)):Ce?(pe&&K.length>pe.length&&K.startsWith(pe)?(te.value=!0,se&&($e(),Ie=window.setTimeout(()=>{var oe;Ie=null,j.value===!0||(oe=s.nodes)!=null&&oe.length||(ja(),te.value=!1,lr())},1200))):(K.length<pe.length||!K.startsWith(pe))&&he(),void(pe=K)):(pe=K,void(Ce=!0))},{flush:"sync",immediate:!0});const Je=new Map,it=new Map;let At=!1,bt=0;function wt(M){let H=0;for(const V of M.values())H+=V;return H}function Gt(){bt=Math.max(bt,wt(it)),it.clear(),At=!1}function vt(M,H){return(function(V){var K,oe;J.value&&(Je.set(V,((K=Je.get(V))!=null?K:0)+1),it.set(V,((oe=it.get(V))!=null?oe:0)+1),At||(At=!0,se&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Gt):typeof queueMicrotask!="function"?setTimeout(Gt,0):queueMicrotask(Gt)))})(M),H()}const ln=_.customId?`renderer-${_.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Gn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(ln),Un=D(()=>`${ln}:${X.value}`);Fn(VM,Gn);const Vt=Cs(()=>_.customId),{effectiveCustomHtmlTagsSet:an,mergedParseOptions:es,parsedNodes:rt}=oee(_,{instanceMsgId:ln,renderContent:ye,effectiveFinal:j,smoothStreamingEnabled:ue,debugPerformanceEnabled:J,customComponentsMap:Vt,logPerf:Ne});Ze(rt,()=>{Gn.clear(),X.value+=1},{immediate:!0});const In=D(()=>({customId:_.customId,customHtmlTags:es.value.customHtmlTags,parseOptions:_.parseOptions,customMarkdownIt:_.customMarkdownIt,htmlPolicy:He.value,viewportPriority:_.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:_.codeBlockStream,codeBlockDarkTheme:_.codeBlockDarkTheme,codeBlockLightTheme:_.codeBlockLightTheme,codeBlockMonacoOptions:_.codeBlockMonacoOptions,renderCodeBlocksAsPre:_.renderCodeBlocksAsPre,codeBlockMinWidth:_.codeBlockMinWidth,codeBlockMaxWidth:_.codeBlockMaxWidth,codeBlockProps:_.codeBlockProps,mermaidProps:_.mermaidProps,d2Props:_.d2Props,infographicProps:_.infographicProps,showTooltips:le.value,themes:_.themes,langs:_.langs,isDark:_.isDark,typewriter:_.typewriter,smoothStreamingOptions:_.smoothStreamingOptions,parseCoalesceMs:_.parseCoalesceMs,fade:_.fade}));Fn("markstreamNestedRendererProps",In);const gs=D(()=>rt.value),yn=D(()=>rt.value.length),us=Q(null),ts=Q(null),kn=Q(null),qn=Q(null),$n=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),ds=!$n&&_.customId?VS(_.customId):null,Fs=D(()=>ds?(jS.value,VS(_.customId)):null),wn=D(()=>{var M;return!!(se&&!Y.value&&_.customId&&!$n&&((M=Fs.value)!=null&&M.enabled))}),As=D(()=>{var M;return!!(!Y.value&&((M=s.virtualScroll)!=null&&M.enabled))}),zn=Q(!1);gn(()=>{zn.value=!0});const Pt=D(()=>!!(se&&As.value));Fn("markstreamHostScrollManaged",Pt);const Ye=D(()=>!!(zn.value&&Pt.value)),je=D(()=>wn.value||Pt.value),Ot=D(()=>wn.value||Ye.value),Ht=D(()=>{var M;return je.value&&((M=Fs.value)==null?void 0:M.textEstimation)!==!1}),dn=D(()=>{var M;return je.value&&((M=Fs.value)==null?void 0:M.codeBlockEstimation)!==!1});function Qt(){const M=U.value||vt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const Sn=D(()=>{const M=Qt();return M>0?Math.max(1,Math.round(M)):640}),Cn=D(()=>{var M;return Math.max(1,(M=_.maxLiveNodes)!=null?M:320)}),Nt=D(()=>{var M;return!Y.value&&_.nodeVirtual!==!1&&!(((M=_.maxLiveNodes)!=null?M:0)<=0)&&(_.nodeVirtual===!0?rt.value.length>0:rt.value.length>Cn.value)}),fs=D(()=>Nt.value||wn.value||Pt.value),ns=D(()=>_.viewportPriority!==!1&&!z.value),ro=VX(M=>{var H;return ae((H=M??S.value)!=null?H:null)},ns),{requestFrame:Dn,cancelFrame:ss,hasIdleCallback:Ai,isTestEnv:Os}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var _e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ee=(_e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:_e.value;return Ee?.env})();return{requestFrame:H,cancelFrame:V,hasIdleCallback:K,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:se}),{resolvedBatchSize:si,resolvedInitialBatch:So,batchingEnabled:Pi,incrementalRenderingActive:oi,renderedCount:vs,previousRenderContext:Co,adaptiveBatchSize:Hi,previousBatchConfig:ii}=(function(M,H){var V;const K=D(()=>{var ze;const Oe=Math.trunc((ze=M.renderBatchSize)!=null?ze:80);return Number.isFinite(Oe)?Math.max(0,Oe):0}),oe=D(()=>{var ze;const Oe=Math.trunc((ze=M.initialRenderBatchSize)!=null?ze:K.value);return Number.isFinite(Oe)?Math.max(0,Oe):K.value}),_e=D(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&K.value>0&&H.isClient&&!H.isTestEnv),Ee=Q(0),Te=Q({key:M.indexKey,total:0}),We=Q(Math.max(1,K.value||1)),Le=D(()=>{var ze;return _e.value&&((ze=M.maxLiveNodes)!=null?ze:0)<=0}),Ve=Q({batchSize:K.value,initial:oe.value,delay:(V=M.renderBatchDelay)!=null?V:16,enabled:Le.value});return{resolvedBatchSize:K,resolvedInitialBatch:oe,batchingEnabled:_e,incrementalRenderingActive:Le,renderedCount:Ee,previousRenderContext:Te,adaptiveBatchSize:We,previousBatchConfig:Ve}})(_,{isClient:se,isTestEnv:Os,renderAsFragment:Y}),Yn=new Map,Rs=new Map,ut=new WeakMap;let ke=null;const Fe=new WeakMap,Ut=new Map,lo=Q(0),Ke=D(()=>(lo.value,Array.from(Yn.entries()).sort((M,H)=>M[0]-H[0]))),nt=Q(null),ot=Q(null);let Rt=null,ve=0,xe=null;const{activeRestoreAnchor:De,getRelativeScrollTopWithinContainer:Bt,setRelativeScrollTopWithinContainer:Wt,resolveAnchorOffset:An,clearRestoreReconcile:jn,scheduleRestoreReconcile:Ws,captureRestoreAnchor:Wo,restoreAnchor:ee,getAnchorDrift:Se}=(function(M){const{isClient:H,containerRef:V,parsedNodeCount:K,requestFrame:oe,cancelFrame:_e,resolveScrollContainer:Ee,getNormalizedScrollTop:Te,getOffsetTopWithinRoot:We,isReverseFlexScrollRoot:Le,estimateIndexForOffset:Ve,estimateHeightRange:ze,getFallbackNodeHeight:Oe,clamp:Ue}=M,et=Q(null);let tt=null,St=[];function ct(){const It=Ee(),jt=V.value;if(!It||!jt)return null;const qt=It.ownerDocument||jt.ownerDocument||document;if(It===qt.documentElement||It===qt.body||It===qt.scrollingElement){const fn=jt.getBoundingClientRect();return Math.max(0,-fn.top)}return Math.max(0,Te(It,qt,!1)-We(jt,It))}function ft(It){var jt;const qt=Ee(),fn=V.value;if(!qt||!fn)return;const jo=Math.max(0,It),ao=qt.ownerDocument||fn.ownerDocument||document,Mi=ao.defaultView||(typeof window<"u"?window:null);if(qt===ao.documentElement||qt===ao.body||qt===ao.scrollingElement){const Yr=Te(qt,ao,!0)+fn.getBoundingClientRect().top;return void((jt=Mi?.scrollTo)==null||jt.call(Mi,0,Math.max(0,Yr+jo)))}YS(qt,ao,We(fn,qt)+jo,{isReverseFlexScrollRoot:Yr=>{var Zr;return(Zr=Le?.(Yr))!=null&&Zr},getNormalizedScrollTop:Te})}function Et(It){const jt=K.value,qt=Ue(It.nodeIndex,0,Math.max(0,jt-1));return ze(0,qt)+Math.max(0,It.offsetWithinNodePx)}function Ct(){if(tt!=null&&(_e?.(tt),tt=null),H)for(const It of St)window.clearTimeout(It);St=[]}function sn(It){const jt=Et(It),qt=ct();qt!=null&&Math.abs(qt-jt)<=.5||ft(jt)}return{activeRestoreAnchor:et,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:ft,resolveAnchorOffset:Et,clearRestoreReconcile:Ct,applyRestoreAnchor:sn,scheduleRestoreReconcile:function(){et.value&&H&&tt==null&&(tt=oe?oe(()=>{tt=null,et.value&&sn(et.value)}):null,tt==null&&et.value&&sn(et.value))},captureRestoreAnchor:function(){const It=ct(),jt=K.value;if(It==null||jt<=0)return null;const qt=Ue(Ve(It+1),0,jt-1),fn=ze(0,qt),jo=Oe(qt);return{nodeIndex:qt,offsetWithinNodePx:Ue(It-fn,0,Math.max(0,jo-1))}},restoreAnchor:function(It){const jt=K.value;if(et.value={nodeIndex:Ue(It.nodeIndex,0,Math.max(0,jt-1)),offsetWithinNodePx:Math.max(0,It.offsetWithinNodePx)},Ct(),sn(et.value),H)for(const qt of[0,120,280,480])St.push(window.setTimeout(()=>{et.value&&sn(et.value)},qt))},getAnchorDrift:function(It){const jt=ct();return jt==null?null:jt-Et(It)}}})({isClient:se,containerRef:S,parsedNodeCount:yn,requestFrame:Dn,cancelFrame:ss,resolveScrollContainer:()=>nt.value||me(),getNormalizedScrollTop:ne,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:q,estimateIndexForOffset:I1,estimateHeightRange:Gr,getFallbackNodeHeight:af,clamp:Us}),{nodeHeights:we,heightStats:Re,heightTreeSize:Xe,heightSumTree:at,heightKnownTree:Mt,averageNodeHeight:Ft,resetHeightMeasurements:en,pruneHeightMeasurements:os,rebuildHeightTrees:Ao,recordNodeHeight:ri,removeNodeHeights:is,exportHeightCache:Qs,importHeightCache:ys,fenwickRangeSum:Ms}=(function(M={}){const H=Hs({}),V=Hs({total:0,count:0}),K=Q(0),oe=Q([]),_e=Q([]);function Ee(){for(const Oe of Object.keys(H))delete H[Number(Oe)];V.total=0,V.count=0,K.value=0,oe.value=[],_e.value=[]}function Te(Oe,Ue,et){for(let tt=Ue+1;tt<Oe.length;tt+=tt&-tt)Oe[tt]+=et}function We(Oe,Ue){let et=0;for(let tt=Ue+1;tt>0;tt-=tt&-tt)et+=Oe[tt];return et}function Le(Oe){K.value=Oe;const Ue=new Array(Oe+1).fill(0),et=new Array(Oe+1).fill(0);for(const[tt,St]of Object.entries(H)){const ct=Number(tt),ft=Number(St);!Number.isFinite(ct)||ct<0||ct>=Oe||!Number.isFinite(ft)||ft<=0||(Te(Ue,ct,ft),Te(et,ct,1))}oe.value=Ue,_e.value=et}function Ve(Oe){if(!Number.isInteger(Oe)||Oe<0)return!1;const Ue=H[Oe];if(!Number.isFinite(Ue)||Ue<=0)return!1;if(delete H[Oe],V.total=Math.max(0,V.total-Ue),V.count=Math.max(0,V.count-1),K.value>Oe){const et=oe.value,tt=_e.value;et.length&&tt.length&&(Te(et,Oe,-Ue),Te(tt,Oe,-1))}return!0}const ze=D(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:H,heightStats:V,heightTreeSize:K,heightSumTree:oe,heightKnownTree:_e,averageNodeHeight:ze,resetHeightMeasurements:Ee,pruneHeightMeasurements:function(Oe){if(Oe<=0)return void Ee();let Ue=0,et=0;for(const[tt,St]of Object.entries(H)){const ct=Number(tt),ft=Number(St);!Number.isFinite(ct)||ct<0||ct>=Oe||!Number.isFinite(ft)||ft<=0?delete H[ct]:(Ue+=ft,et++)}V.total=Ue,V.count=et},rebuildHeightTrees:Le,recordNodeHeight:function(Oe,Ue,et={}){(function(tt,St,ct={}){var ft;if(!Number.isFinite(St)||St<=0)return!1;const Et=H[tt];if(Et&&(ct.allowShrink===!1&&St<Et||Math.abs(St-Et)<=1))return!1;if(H[tt]=St,Et?V.total+=St-Et:(V.total+=St,V.count++),K.value>tt){const Ct=oe.value,sn=_e.value;if(Ct.length&&sn.length)if(Et){const It=St-Et;It!==0&&Te(Ct,tt,It)}else Te(Ct,tt,St),Te(sn,tt,1)}ct.notify!==!1&&((ft=M.onHeightRecorded)==null||ft.call(M))})(Oe,Ue,zt(lt({},et),{notify:!0}))},removeNodeHeight:function(Oe,Ue={}){var et;const tt=Ve(Oe);return tt&&Ue.notify!==!1&&((et=M.onHeightRecorded)==null||et.call(M)),tt},removeNodeHeights:function(Oe,Ue={}){var et;let tt=0;for(const St of Oe)Ve(Number(St))&&tt++;return tt>0&&Ue.notify!==!1&&((et=M.onHeightRecorded)==null||et.call(M)),tt},exportHeightCache:function(){return Object.entries(H).map(([Oe,Ue])=>({index:Number(Oe),height:Number(Ue)})).filter(Oe=>Number.isFinite(Oe.index)&&Oe.index>=0&&Number.isFinite(Oe.height)&&Oe.height>0).sort((Oe,Ue)=>Oe.index-Ue.index)},importHeightCache:function(Oe,Ue={}){var et;if(!Array.isArray(Oe))return;const tt=K.value;let St=!1;if(Ue.mode!=="merge"){const ct=Object.keys(H);if(ct.length>0){for(const ft of ct)delete H[Number(ft)];St=!0}}for(const ct of Oe){const ft=Number(ct.index),Et=Number(ct.height);if(!Number.isInteger(ft)||ft<0||tt>0&&ft>=tt||!Number.isFinite(Et)||Et<=0)continue;const Ct=H[ft];Ct&&Math.abs(Ct-Et)<=1||(H[ft]=Et,St=!0)}St&&((function(){let ct=0,ft=0;const Et=K.value;for(const[Ct,sn]of Object.entries(H)){const It=Number(Ct),jt=Number(sn);!Number.isFinite(It)||It<0||Et>0&&It>=Et||!Number.isFinite(jt)||jt<=0?delete H[It]:(ct+=jt,ft++)}V.total=ct,V.count=ft})(),tt>0&&Le(tt),(et=M.onHeightRecorded)==null||et.call(M))},fenwickRangeSum:function(Oe,Ue,et){if(et<=Ue)return 0;const tt=We(Oe,et-1);return Ue<=0?tt:tt-We(Oe,Ue-1)}}})({onHeightRecorded:()=>{ai(),Pt.value&&xu(),De.value&&Ws(),ot.value&&za(),Pn("node-resize")}});function Es(){en(),Ut.clear()}function or(M){!Number.isInteger(M)||M<0||M>=rt.value.length||Ut.set(M,uu(M))}function Wl(M,H,V={}){const K=we[M];ri(M,H,V);const oe=we[M];oe&&oe>0?or(M):K&&Ut.delete(M)}function ef(M,H){const V=vt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,oe;return(oe=(K=Yn.get(M))==null?void 0:K.offsetHeight)!=null?oe:0});return V>0?V:vt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function c2(M,H={}){ys(M,H),_1()}const qr=D(()=>{var M;return!Y.value&&_.deferNodesUntilVisible!==!1&&!(((M=_.maxLiveNodes)!=null?M:0)<=0)&&!Nt.value&&!(rt.value.length>900)&&ns.value}),u2=D(()=>!!ro&&(qr.value||Nt.value)),d2=D(()=>Nt.value||Pt.value),{liveNodeBufferResolved:ru,focusIndex:li,liveRange:zs,updateLiveRange:zl}=(function(M,H){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:oe,clamp:_e}=H,Ee=D(()=>{var Le;return Math.max(0,(Le=M.liveNodeBuffer)!=null?Le:60)}),Te=Q(0),We=Hs({start:0,end:0});return{liveNodeBufferResolved:Ee,focusIndex:Te,liveRange:We,updateLiveRange:function(){const Le=V.value;if(!K.value||Le===0)return We.start=0,void(We.end=Le);const Ve=Math.min(oe.value,Le),ze=Ee.value,Oe=_e(Te.value-ze,0,Math.max(0,Le-Ve));We.start=Oe,We.end=Math.min(Le,Oe+Ve)}}})(_,{parsedNodeCount:yn,virtualizationEnabled:Nt,maxLiveNodesResolved:Cn,clamp:Us}),Wi=new Map,Ul=new Map,jr=new Map,tf=[],ir=new Map,Vr=new Set,f2=Q(0);let Ym=!1;const h2=D(()=>(f2.value,Vr.size)),zo=new Map,zi=new Map,p2=Q(0),Zm=D(()=>{p2.value;let M=0;for(const H of zo.values())M+=Math.max(0,H);return M});let Uo=null,Qm=!0,m2=[0],g2="";function ai(){Qm=!0}const nf=D(()=>{if(!Nt.value)return rt.value.length;const M=ru.value,H=Math.max(zs.end+M,So.value),V=Math.min(rt.value.length,H);return Math.max(vs.value,V)});function sf(){Ym||(Ym=!0,queueMicrotask(()=>{Ym=!1,f2.value+=1}))}function v2(M,H,V="node-resize"){if(!se||typeof window>"u")return null;const K=window.setTimeout(()=>{Vr.delete(K)&&sf();try{H()}finally{Pn(V)}},Math.max(0,M));return Vr.add(K),sf(),K}function of(M){se&&M!=null&&(Vr.delete(M)&&sf(),window.clearTimeout(M))}function y2(){if(se&&typeof window<"u")for(const M of Vr)window.clearTimeout(M);Vr.size&&(Vr.clear(),sf()),tf.length=0,jr.clear()}function w8(M){var H,V;return(V=(H=qn.value)==null?void 0:H[M])!=null?V:null}const{cancelScheduledFocusSync:Xm,scheduleFocusSync:Ui}=(function(M){const{isClient:H,containerRef:V,virtualizationEnabled:K,requestFrame:oe,cancelFrame:_e,syncFocusToScroll:Ee}=M;let Te=null;function We(){var Ve,ze,Oe;return(Oe=(ze=(Ve=V.value)==null?void 0:Ve.ownerDocument)==null?void 0:ze.defaultView)!=null?Oe:typeof window<"u"?window:null}function Le(){if(!Te)return;const Ve=We();Te.viaTimeout?Ve?Ve.clearTimeout(Te.id):clearTimeout(Te.id):_e?.(Te.id),Te=null}return{cancelScheduledFocusSync:Le,scheduleFocusSync:function(Ve={}){if(!K.value)return;if(!H)return void Ee(!0);if(Ve.immediate)return Le(),void Ee(!0);if(Te)return;const ze=()=>{Te=null,Ee()};if(oe)return void(Te={id:oe(ze),viaTimeout:!1});const Oe=We();Te={id:Oe?Oe.setTimeout(ze,16):setTimeout(ze,16),viaTimeout:!0}}}})({isClient:se,containerRef:S,virtualizationEnabled:Nt,requestFrame:Dn,cancelFrame:ss,syncFocusToScroll:function(M=!1){var H;if(!Nt.value)return;const V=nt.value||me();if(!V)return;const K=V.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=K?.defaultView||(typeof window<"u"?window:null),_e=V===K?.documentElement||V===K?.body,Ee=rt.value.length;if(!_e&&Ee>0&&q(V)){const et=vt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),tt=vt("syncFocusToScroll.scrollTop",()=>V.scrollTop),St=tt<0?-tt:tt,ct=(function(Et){var Ct,sn;const It=rt.value;if(!It.length)return 0;if(Et<=0)return Math.max(0,It.length-1);if(je.value){const qt=(Ct=s1()[It.length])!=null?Ct:0;return A2(Math.max(0,qt-Et))}if(Xe.value===It.length){const qt=Gr(0,It.length);return I1(Math.max(0,qt-Et))}let jt=Et;for(let qt=It.length-1;qt>=0;qt--){const fn=(sn=we[qt])!=null?sn:Ft.value;if(jt<=fn)return qt;jt-=fn}return 0})(Math.max(0,St)+.5*Math.max(0,et)),ft=Us(ct,0,Math.max(0,Ee-1));return void((M||Math.abs(ft-li.value)>1)&&(li.value=ft,zl()))}const Te=_e?null:vt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),We=_e?0:Te.top,Le=_e?vt("syncFocusToScroll.viewport.clientHeight",()=>{var et,tt;return(tt=(et=oe?.innerHeight)!=null?et:V.clientHeight)!=null?tt:0}):Te.bottom,Ve=Ke.value;let ze=null,Oe=null;for(const[et,tt]of Ve){if(!tt)continue;const St=vt("syncFocusToScroll.slot.getBoundingClientRect",()=>tt.getBoundingClientRect());St.bottom<=We||St.top>=Le||(ze==null&&(ze=et),Oe=et)}if(ze==null||Oe==null){const et=S.value;if(!et)return;const tt=_e?{top:0}:vt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),St=vt("syncFocusToScroll.fallback.scrollTop",()=>ne(V,K,_e)),ct=_e?(()=>{const Ct=vt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>et.getBoundingClientRect()),sn=(_e?0:tt.top)-Ct.top;return Math.max(0,sn)})():(()=>{const Ct=ge(et,V);return Math.max(0,St-Ct)})(),ft=_e?vt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,sn,It,jt;return(jt=(It=(sn=oe?.innerHeight)!=null?sn:(Ct=K?.documentElement)==null?void 0:Ct.clientHeight)!=null?It:V.clientHeight)!=null?jt:0}):vt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),Et=I1(ct+.5*Math.max(0,ft));return li.value=Us(Et,0,Math.max(0,rt.value.length-1)),void zl()}const Ue=Math.round((ze+Oe)/2);!M&&Math.abs(Ue-li.value)<=1||(li.value=Us(Ue,0,Math.max(0,rt.value.length-1)),zl())}}),{visibleNodeIndices:Jm,nodeVisibilityHandles:Oa,nodeVisibilityWatchStops:rf,nodeVisibilityFallbackTimers:k2,clearVisibilityFallback:lf,markNodeVisible:Kr,cleanupNodeVisibility:S8,destroyNodeVisibilityState:e1}=iee({isClient:se,shouldTrackVisibleNodeIndices:()=>qr.value,shouldCleanupNodeVisibility:()=>Nt.value,onNodeMarkedVisible:M=>{Nt.value?Ui():li.value=Us(M,0,Math.max(0,rt.value.length-1))},onNodeVisibilityCleaned:M=>{Yn.delete(M)&&G2()}}),{cleanupScrollListener:b2,setupScrollListener:C8}=(function(M){const{isClient:H,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:oe,resolveScrollContainer:_e,scheduleFocusSync:Ee,onScroll:Te}=M;let We=null,Le=null;function Ve(){We&&(We(),We=null),Le=null,oe.value=null}function ze(Oe){const Ue=M.getScrollTop?M.getScrollTop(Oe):Oe.scrollTop;return Math.max(0,Number.isFinite(Ue)?Math.abs(Ue):0)}return{cleanupScrollListener:Ve,setupScrollListener:function(){if(!H)return;if(!((Oe=K?.value)!=null?Oe:V.value))return void Ve();var Oe;const Ue=_e();if(!Ue)return void Ve();if(oe.value===Ue&&We)return;Ve(),Le=ze(Ue);const et=()=>{if(Te?.(),V.value){const tt=(function(St){const ct=ze(St),ft=Le;Le=ct;const Et=Math.max(480,.75*(St.clientHeight||0));return ft==null?ct>Et?{immediate:!0}:void 0:Math.abs(ct-ft)>Et?{immediate:!0}:void 0})(Ue);tt?Ee(tt):Ee()}};Ue.addEventListener("scroll",et,{passive:!0}),oe.value=Ue,We=()=>{Ue.removeEventListener("scroll",et)}}}})({isClient:se,virtualizationEnabled:Nt,listenerEnabled:d2,scrollRootElement:nt,resolveScrollContainer:me,scheduleFocusSync:Ui,onScroll:function(){const M=ot.value;if(!M)return;const H=cu();if(!H||(function(K){if(mu()>=ve)return xe=null,!1;const oe=xe;if(oe==null)return!0;const _e=Math.abs(K.scrollTop-oe)<=2;return _e||(xe=null),_e})(H))return;const V=O2(H);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,M.distanceFromBottomPx))>32)&&Wa("restore"):Wa("restore")},getScrollTop:M=>{var H;const V=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,K=M===V.documentElement||M===V.body||M===V.scrollingElement;return vt("scrollListener.getScrollTop",()=>ne(M,V,K))}});function Us(M,H,V){return Math.min(Math.max(M,H),V)}function t1(M){return M?.firstElementChild}function x2(M,H){var V;return M?(V=M.matches)!=null&&V.call(M,H)?M:M.querySelector(H):null}function _2(){if(!je.value)return void(U.value=0);const M=vt("updateExperimentContainerWidth.clientWidth",()=>{var H,V;return(V=(H=S.value)==null?void 0:H.clientWidth)!=null?V:0});U.value=M>0?M:0}let lu=null;function n1(){lu?.disconnect(),lu=null}const w2=$i({loader:()=>Qn(null,null,function*(){return(yield mo(()=>import("./index8-CmPghiWh.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:PM,delay:0,suspensible:!1});function S2(M){return M===w2}const C2=D(()=>u.value==="pre"?Vo:u.value==="shiki"?w2:H0),ql=D(()=>{const M=rt.value;if(!M.length||!je.value)return M.map(()=>null);const H=U.value||vt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((V,K)=>{const oe=we[K],_e=typeof oe=="number"&&oe>0;if(Ht.value&&!_e){const Te=jM(V,H,Z.value);if(Te)return Te}if(dn.value&&V.type==="code_block"){const Te=(function(We){if(We.type!=="code_block")return null;const Le=lb(We,mf(We));return S2(Le)?"markdown":Le===Vo?"pre":Le===C2.value||Le===H0?"monaco":null})(V);if(Te==="monaco"||Te==="markdown"||Te==="pre")return qJ(V,{rendererKind:Te,monacoOptions:_.codeBlockMonacoOptions,showHeader:((Ee=_.codeBlockProps)==null?void 0:Ee.showHeader)!==!1})}var Ee;return null})});function af(M){var H;const V=we[M];if(Number.isFinite(V)&&V>0)return V;const K=(H=ql.value[M])==null?void 0:H.height;return Number.isFinite(K)&&K>0?K:Math.max(Ft.value,(function(oe){var _e,Ee,Te,We,Le,Ve,ze,Oe,Ue,et,tt,St,ct;const ft=rt.value[oe];if(!ft||typeof ft!="object")return 32;const Et=String((_e=ft.type)!=null?_e:""),Ct=Qt()||640;switch(Et){case"heading":return 44;case"paragraph":return Ra(String((Te=(Ee=ft.raw)!=null?Ee:ft.content)!=null?Te:""),Ct,34);case"list":{const sn=Array.isArray(ft.items)?ft.items.length:1;return Math.max(48,30*sn+12)}case"list_item":return Ra(String((Le=(We=ft.raw)!=null?We:ft.content)!=null?Le:""),Ct,34);case"blockquote":return Ra(String((ze=(Ve=ft.raw)!=null?Ve:ft.content)!=null?ze:""),Ct,56);case"table":{const sn=Array.isArray(ft.rows)?ft.rows.length:Array.isArray(ft.children)?ft.children.length:3;return Math.max(120,38*sn+48)}case"code_block":return Ra(String((Ue=(Oe=ft.code)!=null?Oe:ft.raw)!=null?Ue:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Ra(String((tt=(et=ft.raw)!=null?et:ft.content)!=null?tt:""),Ct,96);case"thematic_break":return 24;default:return Ra(String((ct=(St=ft.raw)!=null?St:ft.content)!=null?ct:""),Ct,40)}})(M))}function Ra(M,H,V,K=22){const oe=String(M??"");if(!oe)return V;const _e=Math.max(18,Math.floor(Math.max(320,H)/8)),Ee=oe.split(/\r?\n/).length,Te=Math.ceil(oe.length/_e),We=Math.max(1,Ee,Te);return Math.max(V,Math.ceil(We*K+12))}function au(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function s1(){var M,H;const V=rt.value.length,K=au(U.value||vt("getFallbackHeightPrefix.clientWidth",()=>{var Te;return((Te=S.value)==null?void 0:Te.clientWidth)||0})),oe=((M=s.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(s.virtualScroll.measurementKey),_e=[V,Re.count,Math.round(Re.total),Math.round(100*Ft.value),oe,K,je.value?1:0,jS.value,X.value].join(":");if(!Qm&&g2===_e)return m2;const Ee=new Array(V+1);Ee[0]=0;for(let Te=0;Te<V;Te++)Ee[Te+1]=Ee[Te]+(je.value?af(Te):(H=we[Te])!=null?H:Ft.value);return m2=Ee,g2=_e,Qm=!1,Ee}function A2(M){var H,V;const K=rt.value.length;if(K<=0||M<=0)return 0;const oe=s1();if(M>=((H=oe[K])!=null?H:0))return K-1;let _e=0,Ee=K-1,Te=K-1;for(;_e<=Ee;){const We=_e+Ee>>1;((V=oe[We+1])!=null?V:0)>=M?(Te=We,Ee=We-1):_e=We+1}return Te}function Gr(M,H){var V,K;if(M>=H)return 0;if(je.value)return(function(Ee,Te){var We,Le;const Ve=rt.value.length,ze=Us(Math.trunc(Ee),0,Ve),Oe=Us(Math.trunc(Te),ze,Ve);if(ze>=Oe)return 0;const Ue=s1();return((We=Ue[Oe])!=null?We:0)-((Le=Ue[ze])!=null?Le:0)})(M,H);if(Xe.value!==rt.value.length){let Ee=0;for(let Te=M;Te<H;Te++)Ee+=(V=we[Te])!=null?V:Ft.value;return Ee}const oe=at.value,_e=Mt.value;if(!oe.length||!_e.length){let Ee=0;for(let Te=M;Te<H;Te++)Ee+=(K=we[Te])!=null?K:Ft.value;return Ee}return Ms(oe,M,H)+(H-M-Ms(_e,M,H))*Ft.value}Ze(()=>rt.value.length,M=>{ai(),M<=0?Es():(M<Xe.value&&os(M),M!==Xe.value&&Ao(M))},{immediate:!0});const A8=D(()=>{if(!Nt.value)return rt.value.map((K,oe)=>({node:K,index:oe}));const M=rt.value.length,H=Us(zs.start,0,M),V=Us(zs.end,H,M);return rt.value.slice(H,V).map((K,oe)=>({node:K,index:H+oe}))}),o1=D(()=>Nt.value?Gr(0,Math.min(zs.start,rt.value.length)):0),i1=D(()=>{if(!Nt.value)return 0;const M=rt.value.length;return Gr(Math.min(zs.end,M),M)});function M2(){if(!je.value)return 0;let M=0;const H=ql.value;for(let V=0;V<H.length;V++){if(!H[V])continue;const K=we[V];Number.isFinite(K)&&K>0||M++}return M}function E2(){const M=rt.value.length;return{totalNodes:M,measuredCount:Re.count,estimatedCount:M2(),averageNodeHeight:Ft.value,topSpacerHeight:o1.value,bottomSpacerHeight:i1.value,estimatedTotalHeight:Gr(0,M),width:jl()}}function M8(){const M=rt.value,H=E2();return zt(lt({},H),{probe:{paragraphReady:!!Z.value.paragraph,listItemReady:!!Z.value.listItem,listWrapperOverhead:Z.value.listWrapperOverhead,headingReadyLevels:Object.entries(Z.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:M.map((V,K)=>{var oe,_e,Ee,Te,We,Le,Ve,ze,Oe;return{index:K,type:V.type,estimateKind:(_e=(oe=ql.value[K])==null?void 0:oe.kind)!=null?_e:null,rendererKind:(Te=(Ee=ql.value[K])==null?void 0:Ee.rendererKind)!=null?Te:null,estimatedHeight:(Le=(We=ql.value[K])==null?void 0:We.height)!=null?Le:null,estimatedContentHeight:(ze=(Ve=ql.value[K])==null?void 0:Ve.contentHeight)!=null?ze:null,measuredHeight:(Oe=we[K])!=null?Oe:null}})})}function r1(){return s.indexKey!=null?String(s.indexKey):As.value?`virtual-${Vn()}`:"markdown-renderer"}function T2(M){const H=String(M),V=`${r1()}-`;if(!H.startsWith(V))return null;const K=H.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const oe=Number(K[1]);return!Number.isInteger(oe)||oe<0||oe>=rt.value.length?null:oe}function Vn(){var M,H,V;const K=(M=s.virtualScroll)==null?void 0:M.sessionKey;return String(K!=null&&K!==""?K:(V=(H=s.indexKey)!=null?H:_.customId)!=null?V:ln)}function Ts(){var M;const H=(M=s.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function l1(M){var H;return(M??"")===((H=Ts())!=null?H:"")}function E8(){var M;const H=(M=s.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function T8(){var M,H;const V=u.value,K=V==="monaco"?_.codeBlockMonacoOptions:void 0,oe=_.codeBlockProps,_e=V==="shiki";return[_.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",_.codeBlockStream===!1?"code-static":"code-stream",Bs(_.codeBlockMinWidth),Bs(_.codeBlockMaxWidth),..._e?[xp((M=oe?.themes)!=null?M:_.themes,(H=oe?.langs)!=null?H:_.langs)]:[],Bs(K?.fontSize),Bs(K?.lineHeight),Bs(K?.fontFamily),Bs(K?.tabSize),Bs(K?.MAX_HEIGHT),Bs(K?.wordWrap),Bs(K?.wrappingIndent),Bs(K?.padding),Bs(oe?.showHeader),Bs(oe?.showCopyButton),Bs(oe?.showExpandButton),Bs(oe?.showPreviewButton),Bs(oe?.showCollapseButton),Bs(oe?.showFontSizeButtons)].join("\0")}function rr(){return[E8(),T8()].join("\0")}function jl(){return Qt()}const cf=D(()=>au(jl())),qo=D(()=>[rr(),cf.value].join("\0")),N8=D(()=>{var M;return As.value?["virtual",(M=Ts())!=null?M:"",Vn(),qo.value].join("\0"):s.indexKey});function Ba(){p2.value+=1}function a1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=rt.value.length||M.sessionKey!==Vn()||M.threadKey!==Ts()||M.layoutEpochKey!==qo.value)}function N2(M){const H=String(M),V=zi.get(H);return V?a1(V)?V.index:null:T2(H)}function I2(M="async-node"){(zo.size||zi.size)&&(zo.clear(),zi.clear(),Ba(),Pn(M))}const Da=Kt(mv,null),c1={reportHeight(M,H){if(!Pt.value)return;const V=N2(M);if(V==null)return;const K=Wi.get(V);if(!K)return;const oe=Number(H),_e=ef(V,K);Wl(V,Number.isFinite(oe)&&oe>0?Math.max(oe,_e||0):_e)},markPending(M){if(!Pt.value)return;const H=T2(M);H!=null&&(function(V,K){var oe;const _e=zi.get(V);if(_e&&a1(_e))return zo.set(V,Math.max(0,(oe=zo.get(V))!=null?oe:0)+1),Ba(),void Pn("async-node");zo.set(V,1),zi.set(V,(function(Ee){return{index:Ee,sessionKey:Vn(),threadKey:Ts(),layoutEpochKey:qo.value}})(K)),Ba(),Pn("async-node")})(String(M),H)},markSettled(M){if(!Pt.value)return;const H=String(M),V=N2(M);(V!=null||(function(K){return zo.has(String(K))})(H))&&(function(K){var oe;const _e=(oe=zo.get(K))!=null?oe:0;return!(_e<=0||(_e<=1?(zo.delete(K),zi.delete(K)):zo.set(K,_e-1),Ba(),_e===1&&Pn("async-node"),0))})(H)&&V!=null&&lr()}};function I8(){let M=0;for(const H of Wi.values())M+=vt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=H?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,M))}Fn(mv,{reportHeight(M,H){c1.reportHeight(M,H),Da?.reportHeight(M,H)},markPending(M){c1.markPending(M),Da?.markPending(M)},markSettled(M){c1.markSettled(M),Da?.markSettled(M)}});let u1,d1=null,Pa=null;function uf(M){return M!==!1&&M!=null&&M!==""}function $2(){return Nt.value?(function(){if(!Nt.value)return!0;const M=rt.value.length,H=Us(zs.start,0,M),V=Us(zs.end,H,M);if(H>=V)return!0;for(let K=H;K<V;K++)if(!Yn.has(K)||$1(K)&&!Wi.has(K))return!1;return!0})():vs.value>=nf.value}function f1(){return j.value===!0&&!te.value&&Zm.value===0&&Vr.size===0&&ir.size===0&&Uo==null&&$2()}function L2(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.settleMode)!=="manual"||d1===Vn()&&u1===Ts())return!0;const V=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!uf(V)&&Pa===_u(V)}function h1(){return f1()&&L2()}function $8(M,H){return H.totalNodes<=0?M==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?M==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function Vl(M="manual",H){const V=E2(),K=(function(oe){return oe||(j.value!==!0?rt.value.length>0?"streaming":"estimating":!$2()||ir.size>0||Uo!=null?"measuring":h1()?"settled":"settling")})(H);return{sessionKey:Vn(),threadKey:Ts(),phase:K,nodeCount:V.totalNodes,liveRange:{start:zs.start,end:zs.end},renderedCount:vs.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:I8(),totalHeight:F2(),width:V.width,final:j.value===!0,stable:h1(),confidence:$8(K,V),reason:M}}function cu(){const M=nt.value||me(),H=S.value;if(!M||!H)return null;const V=M.ownerDocument||H.ownerDocument||document,K=M===V.documentElement||M===V.body||M===V.scrollingElement,oe=vt("getScrollBox.scrollTop",()=>ne(M,V,K)),_e=vt("getScrollBox.scrollHeight",()=>{var Te,We,Le,Ve,ze;return K?Math.max((We=(Te=V.documentElement)==null?void 0:Te.scrollHeight)!=null?We:0,(Ve=(Le=V.body)==null?void 0:Le.scrollHeight)!=null?Ve:0,(ze=M.scrollHeight)!=null?ze:0):M.scrollHeight}),Ee=vt("getScrollBox.clientHeight",()=>{var Te;return K?((Te=V.documentElement)==null?void 0:Te.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:V,isViewportRoot:K,scrollTop:oe,scrollHeight:_e,clientHeight:Ee}}function F2(){const M=rt.value.length,H=Math.max(0,Gr(0,M)),V=vt("getRendererLogicalHeight.offsetHeight",()=>{var oe,_e;return(_e=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?_e:0}),K=Math.max(0,V>0?V:vt("getRendererLogicalHeight.scrollHeight",()=>{var oe,_e;return(_e=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?_e:0}));return M<=0?Math.ceil(V):Nt.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=o1.value+i1.value;for(const _e of Yn.values())_e&&(oe+=Math.max(0,vt("getVirtualizedDomLogicalHeight.offsetHeight",()=>_e.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,_e){return oe<=0||_e<=0?0:_e<=oe+Math.max(512,.05*oe)?Math.ceil(_e):0})(H,K)):Math.max(1,Math.ceil(K)):Pt.value?H>0||Re.count>0||M2()>0?(oi.value&&vs.value,Math.max(1,Math.ceil(K),Math.ceil(H))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(H))}function O2(M){const H=S.value;if(!H)return null;const V=vt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:vt("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-V.bottom}function L8(M={}){const H=M.requireViewport!==!1,V=(function(_e=64){const Ee=cu(),Te=S.value;if(!Ee||!Te)return!1;const We=(function(Ve){if(Ve.isViewportRoot)return{top:0,bottom:Ve.clientHeight};const ze=vt("getVirtualViewportRect.getBoundingClientRect",()=>Ve.root.getBoundingClientRect());return{top:ze.top,bottom:ze.bottom}})(Ee),Le=vt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Te.getBoundingClientRect());return Le.bottom>=We.top-_e&&Le.top<=We.bottom+_e})();if(H&&!V)return null;const K=(function(){const _e=cu(),Ee=S.value;if(!_e||!Ee||Math.max(0,_e.scrollHeight-_e.scrollTop-_e.clientHeight)>64)return null;const Te=O2(_e);return Te==null?null:Te>=-8&&Te<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Te)}:null})();if(K)return{anchor:K,captured:!0};const oe=Wo();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:V};if(M.allowFallback===!0){const _e=(function(){const Ee=rt.value.length;return Ee<=0?null:{type:"node",nodeIndex:Us(li.value,0,Math.max(0,Ee-1)),offsetWithinNodePx:0}})();return _e?{anchor:_e,captured:!1}:null}return null}function p1(M){let H=2166136261;for(let V=0;V<M.length;V++)H^=M.charCodeAt(V),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function F8(M,H){let V=M;for(let K=0;K<H.length;K++)V^=H.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const O8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function df(M,H=new WeakSet,V=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(K){const oe=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${p1(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(V>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Le=[];for(let Ve=0;Ve<M.length;Ve++)Le.push(df(M[Ve],H,V+1));return`a:${M.length}:${Le.join(",")}`}const _e=[],Ee=[],Te=Math.max(0,M.length-32);let We=2166136261;for(let Le=0;Le<M.length;Le++){const Ve=df(M[Le],H,V+1);We=F8(We,Ve),Le<32&&_e.push(Ve),Le>=Te&&Ee.push(Ve)}return[`a:${M.length}`,`h=${_e.join(",")}`,`t=${Ee.join(",")}`,`all=${(We>>>0).toString(36)}`].join(":")}const K=M,oe=Object.keys(K).filter(_e=>{const Ee=K[_e];return _e!=="parent"&&_e!=="el"&&_e!=="component"&&(Ee==null||typeof Ee=="string"||typeof Ee=="number"||typeof Ee=="boolean"||O8.has(_e))}).sort();return`o:${oe.length}:${oe.map(_e=>`${_e}=${df(K[_e],H,V+1)}`).join(";")}`}finally{H.delete(M)}}let R2=-1,m1="";function uu(M){const H=rt.value[M];return H?p1(df(H)):""}function g1(){const M=X.value;if(R2===M)return m1;let H=2166136261;for(let V=0;V<rt.value.length;V++){const K=uu(V);for(let oe=0;oe<K.length;oe++)H^=K.charCodeAt(oe),H=Math.imul(H,16777619)}return m1=(H>>>0).toString(36),R2=M,m1}function Ha(M,H={}){var V;const K=H.includeHeightCache===!0,oe=(V=H.includeContentHash)!=null?V:K,_e=K?(function(Te){const We=(function(){var tt,St;const ct=Number((St=(tt=s.virtualScroll)==null?void 0:tt.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(We)||Te.length<=We)return Te;const Le=new Map,Ve=tt=>{!tt||Le.size>=We||Le.set(tt.index,tt)},ze=rt.value.length,Oe=Us(zs.start-2*ru.value,0,ze),Ue=Us(zs.end+2*ru.value,Oe,ze);for(const tt of Te)tt.index>=Oe&&tt.index<Ue&&Ve(tt);const et=Math.max(1,Math.ceil(Te.length/We));for(let tt=0;tt<Te.length&&Le.size<We;tt+=et)Ve(Te[tt]);for(let tt=Te.length-1;tt>=0&&Le.size<We;tt-=et)Ve(Te[tt]);return Array.from(Le.values()).sort((tt,St)=>tt.index-St.index).slice(0,We)})(Qs().map(Te=>{var We;const Le=rt.value[Te.index];return Le?zt(lt({},Te),{nodeType:String((We=Le.type)!=null?We:""),signature:uu(Te.index)}):null}).filter(Te=>!!Te)):[],Ee=L8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Ee||_e.length||H.includeEmptyState===!0?zt(lt({sessionKey:M.sessionKey,threadKey:M.threadKey},Ee?{anchor:Ee.anchor,anchorCaptured:Ee.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?g1():void 0,measurementKey:rr()||void 0,heightCache:_e.length?_e:void 0}):null}function v1(M){var H,V;const K=cu();if(!K)return;const oe=(function(Te){const We=S.value;if(!We)return null;const Le=ge(We,Te.root),Ve=rt.value.length,ze=vt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>We.offsetHeight||0),Oe=Math.max(0,ze>0?ze:Ve>0?vt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>We.scrollHeight||0):0),Ue=F2();return Le+Math.max(Oe,Ue)})(K);if(oe==null)return;const _e=Math.max(0,M.distanceFromBottomPx),Ee=Math.max(0,oe-K.clientHeight-_e);(function(Te){ve=mu()+120,xe=Te})(Ee),K.isViewportRoot?(V=(H=K.doc.defaultView)==null?void 0:H.scrollTo)==null||V.call(H,0,Ee):YS(K.root,K.doc,Ee,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ne})}const y1=[];function B2(){if(se)for(Rt!=null&&(ss?.(Rt),Rt=null);y1.length;){const M=y1.pop();M!=null&&window.clearTimeout(M)}}function Wa(M){const H=!!ot.value;ot.value=null,ve=0,xe=null,B2(),H&&M&&Pn(M)}function za(){if(!ot.value||!se||Rt!=null)return;const M=()=>{Rt=null;const H=ot.value;H&&v1(H)};Rt=Dn?Dn(M):null,Rt==null&&M()}function D2(M,H={}){const V=rt.value.length;return V<=0?[]:M.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(H.requireSignature&&!K.signature)&&!(H.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(oe){var _e;const Ee=rt.value[oe.index];return!(!Ee||oe.nodeType&&oe.nodeType!==String((_e=Ee.type)!=null?_e:"")||oe.signature&&oe.signature!==uu(oe.index))})(K))}function P2(M){const H=au(jl()),V=au(M);return H!==-1&&V!==-1&&H===V}function k1(M){var H;const V=Number(M?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(K)&&K>0?K:null}function H2(M){var H;return M.sessionKey===Vn()&&!!l1(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===rr()&&!!P2(k1(M))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(W2(V)?K.some(oe=>!!(oe.nodeType||oe.signature)):K.some(oe=>!!oe.signature))})(M)}function W2(M){return!!(M.contentHash&&M.contentHash===g1())}function R8(M){return!W2(M)}let Kl=null,Gl=null,ff=null,du=null,fu=null;function b1(M){var H;const V=M.map(oe=>{var _e,Ee;return[oe.index,Math.round(10*oe.height),(_e=oe.nodeType)!=null?_e:"",(Ee=oe.signature)!=null?Ee:""].join("")}).join(""),K=au(jl());return[(H=Ts())!=null?H:"",Vn(),rr(),rt.value.length,K,M.length,p1(V)].join(":")}function z2(M=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Pt.value||!M?.length||rt.value.length<=0||!P2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const V=D2(M,{requireSignature:!0});if(!V.length)return!1;const K=b1(V);return K===Kl?(Gl="standalone",!0):(c2(V,{mode:"merge"}),ai(),Kl=K,Gl="standalone",vu(),Pn("restore"),!0)}function x1(M,H={}){var V,K,oe;if(!Pt.value||!M||M.sessionKey!==Vn()||!l1(M.threadKey)||rt.value.length<=0)return!1;const _e=!!((V=M.heightCache)!=null&&V.length)&&!hf(),Ee=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Te=H.restoreAnchor===!0&&!!Ee&&!hf()&&Number(k1(M))>0;let We=!1;if((K=M.heightCache)!=null&&K.length&&H2(M)){const Ve=D2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:R8(M)});Ve.length&&(c2(Ve,{mode:"merge"}),ai(),Kl=b1(Ve),Gl="restore",vu(),We=!0)}if(_e||Te)return!1;if(!H.restoreAnchor||!Ee)return We&&Pn("restore"),!0;const Le=(function(Ve,ze){var Oe;const Ue=Ve.anchor,et=Ue?Ue.type==="bottom"?`bottom:${Math.round(Ue.distanceFromBottomPx)}`:`node:${Ue.nodeIndex}:${Math.round(Ue.offsetWithinNodePx)}`:"none";return[(Oe=Ts())!=null?Oe:"",Vn(),rr(),cf.value,ze,et].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return ff===Le?(We&&Pn("restore"),!0):(ff=Le,(function(Ve){const ze=()=>{if(Ve.type==="node")return Wa(),void ee({nodeIndex:Ve.nodeIndex,offsetWithinNodePx:Ve.offsetWithinNodePx});if(jn(),De.value=null,ot.value=Ve,B2(),v1(Ve),se)for(const Oe of[0,120,280,480])y1.push(window.setTimeout(()=>{const Ue=ot.value;Ue&&v1(Ue)},Oe))};(function(Oe){if(!Nt.value)return!1;const Ue=rt.value.length;return!(Ue<=0||(li.value=Oe.type==="node"?Us(Oe.nodeIndex,0,Ue-1):Ue-1,zl(),0))})(Ve)?gt(ze):ze()})(Ee),Pn("restore"),!0)}function hf(){const M=jl();return Number.isFinite(M)&&M>0}function U2(M){var H;return M.sessionKey===Vn()&&!!l1(M.threadKey)&&(rt.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||hf())||!(!(M.anchor&&Number(k1(M))>0)||hf()))}function _1(){Ut.clear();for(const M of Object.keys(we)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<rt.value.length&&or(H)}}function hu(){Uo!=null&&(ss?.(Uo),Uo=null),L1()}function q2(){return!se||Os?Promise.resolve():new Promise(M=>{let H=!1,V=null;const K=()=>{H||(H=!0,V!=null&&window.clearTimeout(V),M())};if(Dn)return Dn(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function w1(M,H=Ts(),V=qo.value){return Vn()===M&&Ts()===H&&qo.value===V}function S1(){return Qn(this,arguments,function*(M={}){var H,V,K,oe,_e;const Ee=Vn(),Te=Ts(),We=qo.value,Le=(H=M.frames)!=null?H:2,Ve=(V=M.timeoutMs)!=null?V:120,ze=(K=M.reason)!=null?K:"manual",Oe=M.expectedSettledTokenKey,Ue=M.flushPendingTimers===!0,et=Vl(ze),tt=()=>zt(lt({},et),{phase:et.final?"settling":et.phase,stable:!1,confidence:et.confidence==="final"?"mixed":et.confidence,reason:ze}),St=()=>w1(Ee,Te,We)&&(Oe==null||gu()===Oe);for(let Ct=0;Ct<Le;Ct++){if(yield gt(),!St()||(yield q2(),!St()))return tt();lr(),hu()}if(yield(function(Ct){return!se||Ct<=0?Promise.resolve():new Promise(sn=>window.setTimeout(sn,Ct))})(Ve),!St()||(Ue&&y2(),lr(),hu(),!St()))return tt();const ct=f1();ct&&(d1=Ee,u1=Te,((oe=s.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Oe!=null&&uf((_e=s.virtualScroll)==null?void 0:_e.settledToken)&&gu()===Oe&&(Pa=_u(s.virtualScroll.settledToken)));const ft=St()&&ct&&L2(),Et=Vl(ze,ft?"final":void 0);return T1(Et,!0),Et})}let C1="content",Yl=null,Zl=null,A1=0,pu=null,Ua=null,M1=null,E1=null;function mu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function j2(M){var H,V;const K=pu;if(!K)return!0;const oe=(V=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?V:1;return Math.abs(M.totalHeight-K.totalHeight)>oe||M.sessionKey!==K.sessionKey||M.phase!==K.phase||M.stable!==K.stable||M.final!==K.final||M.threadKey!==K.threadKey||M.nodeCount!==K.nodeCount||M.measuredCount!==K.measuredCount||M.width!==K.width}function Bs(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function gu(M=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return Bs(M)}function V2(M,H){var V,K;return[M,H.sessionKey,(V=H.threadKey)!=null?V:"",rr(),g1(),Bs((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function vu(){M1=null,E1=null,Ua=null}function B8(M){const H=M.heightCache;return H?.length?b1(H):""}function yu(M){var H,V,K;const oe=M.metrics,_e=M.anchor?(Ee=M.anchor).type==="bottom"?`bottom:${Math.round(Ee.distanceFromBottomPx)}`:`node:${Ee.nodeIndex}:${Math.round(Ee.offsetWithinNodePx)}`:"none";var Ee;return[M.sessionKey,(H=M.threadKey)!=null?H:"",(V=M.measurementKey)!=null?V:rr(),(K=M.contentHash)!=null?K:"",B8(M),_e,M.anchorCaptured?1:0,oe.liveRange.start,oe.liveRange.end,oe.renderedCount,oe.nodeCount,Math.round(oe.totalHeight),Math.round(oe.width),oe.phase,oe.stable?1:0].join("\0")}function T1(M,H=!1){if(!Pt.value||(function(Ee=!1){return!Ee&&As.value&&!Ye.value})(H))return;const V=H||j2(M),K=(function(Ee,Te=!1){return Te||Ee.stable||Ee.phase==="final"?{state:Ha(Ee,{includeHeightCache:!0})}:{state:Ha(Ee)}})(M,H),oe=K.state,_e=!!(oe&&(V||(function(Ee,Te=!1){return!!Te||yu(Ee)!==Ua})(oe,H)));if(V&&(E(M),pu=M,A1=mu()),oe&&_e&&(N(oe),oe.anchor&&F(oe.anchor),Ua=yu(oe)),M.stable){const Ee=V2("settled",M);if(Ee!==M1){M1=Ee;const Te=Ha(M,{includeHeightCache:!0});Te&&(N(Te),Ua=yu(Te)),(function(We){o("render-settled",We)})(M)}}if(M.phase==="final"){const Ee=V2("final",M);if(Ee!==E1){E1=Ee;const Te=Ha(M,{includeHeightCache:!0});Te&&(N(Te),Ua=yu(Te)),(function(We){o("render-final",We)})(M)}}}function N1(){Yl!=null&&(ss?.(Yl),Yl=null),Zl!=null&&se&&(window.clearTimeout(Zl),Zl=null)}function K2(){Yl=null,Zl=null,(function(M){if(ir.size>0||Uo!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(C1)&&(lr(),hu()),T1(Vl(C1))}function Pn(M){var H,V;if(!Pt.value||(C1=M,Yl!=null||Zl!=null))return;const K=Math.max(0,(V=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?V:32),oe=Math.max(0,K-(mu()-A1)),_e=()=>{Zl=null,Yl=Dn?Dn(K2):null,Yl==null&&K2()};se&&oe>0?Zl=window.setTimeout(_e,oe):_e()}function I1(M){var H;if(M<=0)return 0;const V=rt.value;if(je.value)return A2(M);if(Xe.value===V.length&&at.value.length&&Mt.value.length){const oe=Ft.value,_e=at.value,Ee=Mt.value,Te=ze=>ze<=0?0:Ms(_e,0,ze)+(ze-Ms(Ee,0,ze))*oe;let We=0,Le=V.length-1,Ve=V.length-1;for(;We<=Le;){const ze=We+Le>>1;Te(ze+1)>=M?(Ve=ze,Le=ze-1):We=ze+1}return Ve}let K=M;for(let oe=0;oe<V.length;oe++){const _e=(H=we[oe])!=null?H:Ft.value;if(K<=_e)return oe;K-=_e}return Math.max(0,V.length-1)}function G2(){lo.value+=1}function $1(M){return!(oi.value&&M>=vs.value)&&(!qr.value||M<So.value||Jm.value.has(M))}function qa(M){const H=rf.get(M);H&&(H(),rf.delete(M));const V=Oa.get(M);V&&(V.destroy(),Oa.delete(M)),lf(M)}function Y2(M,H){let V=!1;if(H){const _e=Yn.get(M);Yn.set(M,H),_e!==H&&(V=!0)}else Yn.delete(M)&&(V=!0);if(V&&G2(),H||lf(M),!u2.value||!ro||!Nt.value&&qr.value&&!z.value&&Oa.size>=640&&(z.value||(z.value=!0,e1()),!u2.value||!ro))return qa(M),void(H&&Kr(M,!0));if(M<So.value&&!Nt.value||Jm.value.has(M))return qa(M),void Kr(M,!0);if(!H)return void qa(M);qa(M);const K=ro(H,{rootMargin:"400px"});if(!K)return;Oa.set(M,K),Kr(M,K.isVisible.value),qr.value&&(function(_e){if(!se||!qr.value)return;lf(_e);const Ee=_e%17*23,Te=window.setTimeout(()=>{if(k2.delete(_e),!qr.value||Jm.value.has(_e))return;const We=Yn.get(_e);if(!We)return;const Le=me(We),Ve=We.ownerDocument||document,ze=Ve.defaultView||window,Oe=!Le||Le===Ve.documentElement||Le===Ve.body,Ue=!Oe&&Le?vt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Le.getBoundingClientRect()):null,et=Oe?0:Ue.top,tt=Oe?vt("nodeVisibilityFallback.clientHeight",()=>{var ct,ft;return(ft=(ct=ze.innerHeight)!=null?ct:Le?.clientHeight)!=null?ft:0}):Ue.bottom,St=vt("nodeVisibilityFallback.node.getBoundingClientRect",()=>We.getBoundingClientRect());St.bottom>=et-500&&St.top<=tt+500&&Kr(_e,!0)},1800+Ee);k2.set(_e,Te)})(M);let oe=null;oe=Ze(()=>K.isVisible.value,_e=>{if(_e){lf(M),Kr(M,!0),oe?.(),rf.delete(M),Oa.get(M)===K&&Oa.delete(M);try{K.destroy()}catch{}}},{immediate:!0}),rf.set(M,oe),Nt.value&&Ui()}function L1(){Uo=null;for(const[M,H]of ir)ir.delete(M),Wi.get(M)===H.el&&Ul.get(M)===H.version&&Wl(M,H.height,{allowShrink:H.allowShrink})}function ja(){Uo!=null&&(ss?.(Uo),Uo=null),ir.clear()}function pf(M,H){(function(V,K,oe){var _e;if(!Number.isFinite(oe)||oe<=0||Wi.get(V)!==K)return;const Ee=Ul.get(V);if(Ee==null)return;const Te=rt.value[V],We=te.value&&j.value!==!0&&!((_e=s.nodes)!=null&&_e.length)&&V>=rt.value.length-2,Le=!(Te?.loading===!0||We),Ve=ir.get(V),ze=Ve?Ve.allowShrink&&Le:Le,Oe=Ve&&!ze?Math.max(Ve.height,oe):oe;ir.set(V,{height:Oe,allowShrink:ze,version:Ee,el:K}),Uo==null&&(Uo=Dn?Dn(L1):null,Uo==null&&L1())})(M,H,ef(M,H))}function lr(){for(const[M,H]of Wi)H&&pf(M,H)}function Z2(){ke?.disconnect(),ke=null,Rs.clear()}function F1(){for(;tf.length;)of(tf.pop())}Ze(Ye,M=>{M&&Pn("content")},{flush:"post"}),t({getVirtualMetrics:Vl,captureVirtualState:function(M={}){var H;return Ha(Vl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const V=H.restoreAnchor===!0,K=H.restoreToken==null?"imperative":String(H.restoreToken);du=M,fu={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!x1(M,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&U2(M)||(du=null,fu=null)},forceMeasure:function(M="manual"){return Qn(this,null,function*(){yield gt(),yield q2(),lr(),hu(),yield gt();const H=Vl(M);return T1(H,!0),H})},settle:S1,scrollToNode:function(M,H="start"){Wa(),jn();const V=rt.value.length;if(V<=0)return;const K=Us(M,0,V-1),oe=()=>{var _e;const Ee=An({nodeIndex:K,offsetWithinNodePx:0}),Te=af(K),We=cu(),Le=(_e=We?.clientHeight)!=null?_e:0,Ve=Bt();let ze=Ee;if(H==="center")ze=Ee-Le/2+Te/2;else if(H==="end")ze=Ee-Le+Te;else if(H==="nearest"&&Ve!=null){if(Ee>=Ve&&Ee+Te<=Ve+Le)return;ze=Ee<Ve?Ee:Ee-Le+Te}Wt(Math.max(0,ze)),Ui({immediate:!0}),Nt.value&&(li.value=K,zl())};if(Nt.value)return li.value=K,zl(),void gt(oe);oe()}}),Ze(()=>fs.value,M=>{if(!M){Z2();for(const H of jr.values())for(const V of H)of(V);jr.clear(),Ul.clear(),F1(),ja()}},{immediate:!0}),Ze(j,M=>{M&&(function(){if(se&&j.value&&Wi.size){F1();for(const H of[80,240,640]){const V=v2(H,()=>{for(const[K,oe]of Wi)oe&&pf(K,oe)},"final");V!=null&&tf.push(V)}}})(),Pn(M?"final":"content")}),Ze([()=>rt.value.length,()=>vs.value],()=>{ot.value&&za(),Pn("content")},{flush:"post",immediate:!0}),Ze([()=>zs.start,()=>zs.end],()=>{Pn("batch")},{flush:"post"});const{cleanupBatchScheduler:D8}=(function(M){const{props:H,isClient:V,isTestEnv:K,parsedNodesIdentity:oe,parsedNodeCount:_e,desiredRenderedCount:Ee,datasetKey:Te,batchingEnabled:We,incrementalRenderingActive:Le,resolvedBatchSize:Ve,resolvedInitialBatch:ze,renderedCount:Oe,adaptiveBatchSize:Ue,previousRenderContext:et,previousBatchConfig:tt,requestFrame:St,cancelFrame:ct,hasIdleCallback:ft,cleanupNodeVisibility:Et,onDatasetKeyChanged:Ct,onDatasetChanged:sn}=M;let It=null,jt=null,qt=!1,fn=null,jo=null,ao=0,Mi=!1,Yr=!1;const Zr=new Set,Xl=new Set;function pb(){if(V){It!=null&&(ct?.(It),It=null),jt!=null&&(window.clearTimeout(jt),jt=null),jo!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(jo),jo=null),ao+=1;for(const Xs of Zr)ct?.(Xs);Zr.clear();for(const Xs of Xl)window.clearTimeout(Xs);Xl.clear(),qt=!1,fn=null,Mi=!1,Yr=!1}}function xf(){return typeof performance<"u"?performance.now():Date.now()}function mb(Xs){(function(ar){var Qr;if(!Le.value)return;const cr=Math.max(2,(Qr=H.renderBatchBudgetMs)!=null?Qr:6),ur=Math.max(1,Ve.value||1),Ei=Math.max(1,Math.floor(ur/4));ar>1.2*cr?Ue.value=Math.max(Ei,Math.floor(.7*Ue.value)):ar<.5*cr&&Ue.value<ur&&(Ue.value=Math.min(ur,Math.ceil(1.2*Ue.value)))})(Xs),Mi=!1;const Mo=Yr||Oe.value<Ee.value;Yr=!1,Mo&&yb()}function gb(Xs,Mo={}){var ar,Qr;if(!Le.value)return;const cr=Ee.value;if(Oe.value>=cr)return;const ur=Math.max(1,Xs),Ei=()=>{const Ga=xf();let Ya=0;It=null,jt=null,jo=null,qt=!1;const Za=fn??ur;fn=null;const z1=xf();Oe.value=Math.min(cr,Oe.value+Za),Et(Oe.value),Ya=xf()-z1,(function(U1,kb){if(!V)return void mb(kb);Mi=!0;const bb=++ao;gt().then(()=>{var xb;if(bb!==ao)return;const oE=xf(),iE=Math.max(kb,oE-U1),_b=()=>{bb===ao&&mb(iE)};if(St){let Sb=!1,dr=null;const Cb=()=>{Sb||(Sb=!0,_b())},_f=St(()=>{Zr.delete(_f),dr!=null&&(window.clearTimeout(dr),Xl.delete(dr),dr=null),Cb()});return Zr.add(_f),dr=window.setTimeout(()=>{dr!=null&&Xl.delete(dr),dr=null,ct?.(_f),Zr.delete(_f),Cb()},Math.max(32,(xb=H.renderBatchIdleTimeoutMs)!=null?xb:120)),void Xl.add(dr)}const wb=window.setTimeout(()=>{Xl.delete(wb),_b()},0);Xl.add(wb)})})(Ga,Ya)};if(!V||Mo.immediate)return void Ei();const Xr=Math.max(0,(ar=H.renderBatchDelay)!=null?ar:16);if(fn=fn!=null?Math.max(fn,ur):ur,!qt){if(qt=!0,!K&&ft&&window.requestIdleCallback){const Ga=Math.max(0,(Qr=H.renderBatchIdleTimeoutMs)!=null?Qr:120);return void(jo=window.requestIdleCallback(()=>Ei(),{timeout:Ga}))}St&&!K?It=St(()=>{Xr!==0?jt=window.setTimeout(()=>Ei(),Xr):Ei()}):jt=window.setTimeout(()=>Ei(),Xr)}}function vb(Xs,Mo={}){Mi?Yr=!0:Xs==null?yb():gb(Xs,Mo)}function yb(){Le.value&&gb(We.value?Math.max(1,Math.round(Ue.value)):Math.max(1,Ve.value))}return Ze([oe,_e,Te,Le,Ve,ze,()=>H.renderBatchDelay],()=>{var Xs;const Mo=_e.value,ar=et.value,Qr=Te.value,cr=!Object.is(Qr,ar.key),ur=Mo!==ar.total,Ei=cr||ur;et.value={key:Qr,total:Mo};const Xr=tt.value,Ga=(Xs=H.renderBatchDelay)!=null?Xs:16,Ya=Xr.batchSize!==Ve.value||Xr.initial!==ze.value||Xr.delay!==Ga||Xr.enabled!==Le.value;tt.value={batchSize:Ve.value,initial:ze.value,delay:Ga,enabled:Le.value},cr&&Ct(Mo),(Ei||Ya||!Le.value)&&pb(),(Ei||Ya)&&(Ue.value=Math.max(1,Ve.value||1)),Ei&&sn();const Za=Ee.value;if(!Mo)return Oe.value=0,void Et(0);if(!Le.value)return Oe.value=Za,void Et(Oe.value);const z1=cr||ar.total===0;Oe.value=z1||Ya?Math.min(Za,ze.value):Math.min(Oe.value,Za);const U1=Math.max(1,ze.value||Ve.value||Mo);Oe.value<Za?vb(U1,{immediate:!V}):Et(Oe.value)},{immediate:!0}),Ze(Ee,(Xs,Mo)=>{Le.value&&(typeof Mo=="number"&&Xs<=Mo||Xs>Oe.value&&vb())}),{cleanupBatchScheduler:pb}})({props:_,isClient:se,isTestEnv:Os,parsedNodesIdentity:gs,parsedNodeCount:yn,desiredRenderedCount:nf,datasetKey:N8,batchingEnabled:Pi,incrementalRenderingActive:oi,resolvedBatchSize:si,resolvedInitialBatch:So,renderedCount:vs,adaptiveBatchSize:Hi,previousRenderContext:Co,previousBatchConfig:ii,requestFrame:Dn,cancelFrame:ss,hasIdleCallback:Ai,cleanupNodeVisibility:S8,onDatasetKeyChanged:M=>{ja(),Es(),ai(),vu(),M>0&&Ao(M)},onDatasetChanged:()=>{Nt.value&&Ui({immediate:!0})}});Ze([d2,Nt,()=>S.value,()=>ce()],([M,H])=>{if(!M)return b2(),void Xm();C8(),H?Ui({immediate:!0}):Xm()},{flush:"post",immediate:!0}),Ze([()=>rt.value.length,()=>Nt.value],M=>Qn(null,[M],function*([H,V]){V&&H&&se&&(yield gt(),Ui({immediate:!0}))}),{flush:"post"}),Ze(je,M=>{M&&(function(){var H;if(us.value&&ts.value&&kn.value&&((H=qn.value)!=null&&H[1]))return;const V=mt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=mt({type:"list_item",children:[V],raw:"- Probe paragraph text"}),oe=mt({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});us.value=V,ts.value=K,kn.value=oe;const _e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ee=1;Ee<=6;Ee++)_e[Ee]=mt({type:"heading",level:Ee,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ee)} Probe heading`});qn.value=_e})()},{immediate:!0}),Ze([()=>S.value,je],()=>{if(!je.value)return n1(),void(U.value=0);_2(),n1(),je.value&&S.value&&typeof ResizeObserver<"u"&&(lu=new ResizeObserver(()=>{_2(),De.value&&Ws(),ot.value&&za(),Pn("resize")}),lu.observe(S.value))},{immediate:!0}),Ze([je,Sn,qo],()=>Qn(null,null,function*(){if(!je.value)return Z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ai();yield gt(),(function(){if(!je.value||typeof window>"u")return Z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ai();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=x2(t1(I.value),".paragraph-node");M.paragraph=G0(I.value,H,"pre-wrap");const V=t1(R.value),K=V?.querySelector(".paragraph-node");M.listItem=G0(R.value,K,"pre-wrap");const oe=vt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ee,Te;return(Te=(Ee=B.value)==null?void 0:Ee.offsetHeight)!=null?Te:0}),_e=vt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ee,Te;return(Te=(Ee=R.value)==null?void 0:Ee.offsetHeight)!=null?Te:0});M.listWrapperOverhead=Math.max(0,oe-_e);for(let Ee=1;Ee<=6;Ee++){const Te=x2(t1(P[Ee]),`h${Ee}`);M.headings[Ee]=G0(P[Ee],Te,"pre-wrap")}Z.value=M,ai()})()}),{flush:"post",immediate:!0}),Ze(()=>rt.value.length,()=>{Nt.value&&Ui({immediate:!0})}),Ze([je,U],()=>{ai(),Nt.value&&Ui({immediate:!0}),De.value&&Ws(),ot.value&&za(),Pn("resize")},{immediate:!1}),Ze(()=>qr.value,M=>{if(M)for(const[H,V]of Yn)Y2(H,V);else{e1();for(const[H,V]of Yn)V&&Kr(H,!0)}},{immediate:!1}),Ze([()=>_.viewportPriority,()=>rt.value.length],([M,H])=>{M!==!1?z.value&&H<=200&&(z.value=!1):z.value=!1}),Ze(()=>vs.value,()=>{Nt.value&&Ui({immediate:!0})}),Ze([li,Cn,ru,()=>rt.value.length,Nt],()=>{zl()},{immediate:!0});let ku=null,bu=!1,Va=null;function xu(){ku=null,d1=null,u1=void 0,Pa=null,vu()}function O1(){ja(),Es(),ai(),Ut.clear();const M=rt.value.length;M>0&&Ao(M),_1()}function R1(){N1(),y2(),pu=null,Kl=null,Gl=null,ff=null,du=null,fu=null,bu=!1,xu(),I2("restore"),jn(),Wa()}function _u(M){var H;return[(H=Ts())!=null?H:"",Vn(),rr(),cf.value,gu(M),rt.value.length,Math.round(Gr(0,rt.value.length)),Math.round(jl()),Re.count,Math.round(Re.total)].join(":")}function Q2(){return Qn(this,null,function*(){var M,H,V,K;const oe=(M=s.virtualScroll)==null?void 0:M.settledToken,_e=gu(oe),Ee=Vn(),Te=Ts(),We=qo.value;if(Pt.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&uf(oe))if(f1()){if(_u(oe)!==Pa&&!bu){bu=!0;try{const Le=yield S1({reason:"manual",expectedSettledTokenKey:_e}),Ve=gu()===_e;w1(Ee,Te,We)&&Le.sessionKey===Ee&&Le.threadKey===Te&&Ve&&Le.stable&&Le.phase==="final"&&(Pa=_u((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{bu=!1,yield gt();const Le=(K=s.virtualScroll)==null?void 0:K.settledToken,Ve=uf(Le)?_u(Le):"";w1(Ee,Te,We)&&Ve&&Pa!==Ve&&Q2()}}}else Pn("manual")})}Ze(Pt,(M,H)=>{if(M!==H){if(!M)return R1(),void N1();R1(),O1(),Va=qo.value,Pn("content")}},{flush:"post"}),Ze([Pt,qo],([M,H])=>{M?Va!=null?Va!==H&&(Va=H,(function(V="resize"){ja(),Es(),ai(),Ut.clear();const K=rt.value.length;K>0&&Ao(K),_1(),Kl=null,Gl=null,ff=null,pu=null,bu=!1,xu(),z2(),gt(()=>{lr(),De.value&&Ws(),ot.value&&za(),Pn(V)})})("resize")):Va=H:Va=null},{flush:"post",immediate:!0}),Ze([Pt,()=>Vn(),()=>Ts()],([M])=>{M&&(R1(),O1(),I2("content"),Pn("content"))}),Ze([Pt,()=>Vn(),()=>Ts(),qo,()=>rt.value.length],([M])=>{M&&(function(H="async-node"){let V=!1;for(const[K,oe]of Array.from(zi.entries()))a1(oe)||(zi.delete(K),zo.delete(K),V=!0);V&&(Ba(),Pn(H))})("async-node")},{flush:"post"}),Ze([Pt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>s.indexKey,()=>X.value],([M])=>{M&&(vu(),(function(H="content"){if(!Pt.value)return;const V=[],K=rt.value.length;for(const oe of Array.from(Ut.keys())){if(oe>=K){V.push(oe);continue}const _e=uu(oe),Ee=Ut.get(oe);Ee!=null&&Ee!==_e&&V.push(oe),Ut.set(oe,_e)}for(const oe of Array.from(Ut.keys()))oe>=K&&Ut.delete(oe);V.length&&((function(oe,_e={}){const Ee=Array.from(oe,Number);is(Ee,_e)>0&&(function(We){for(const Le of We)Ut.delete(Le)})(Ee)})(V,{notify:!1}),ai(),xu(),De.value&&Ws(),ot.value&&za(),Pn(H))})("content"))},{flush:"post",immediate:!0}),Ze([Pt,()=>rt.value.length,()=>Vn(),()=>Ts()],([M,H,V,K],[oe,_e,Ee,Te])=>{M&&oe&&V===Ee&&K===Te&&H!==_e&&xu()},{flush:"post"}),Ze([Pt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>rt.value.length,()=>Vn(),U],()=>{z2()},{flush:"post",immediate:!0}),Ze([Pt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>rt.value.length,()=>Vn(),U],M=>Qn(null,[M],function*([H,V]){if(!H||!V)return;yield gt();const K=(function(){var oe;const _e=(oe=s.virtualScroll)==null?void 0:oe.restoreAnchor;return _e==null||_e===!1?null:_e===!0?"true":String(_e)})();x1(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ze([Pt,U,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const V=(H=s.virtualScroll)==null?void 0:H.restoreState;V&&Kl&&Gl==="restore"&&(H2(V)||(O1(),Kl=null,Gl=null,Pn("resize")))},{flush:"post"}),Ze([Pt,()=>rt.value.length,()=>Vn(),U],M=>Qn(null,[M],function*([H]){var V;const K=du,oe=fu;H&&K&&(yield gt(),!x1(K,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(V=oe?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&U2(K)||(du=null,fu=null))}),{flush:"post",immediate:!0}),Ze([Pt,j,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>Vn(),()=>Ts(),qo,Zm,h2,()=>vs.value,nf,()=>Re.count,()=>Re.total],([M,H,V])=>{if(!M||H!==!0||V==="manual"||!h1())return;const K=(function(){var oe;const _e=rt.value.length;return[(oe=Ts())!=null?oe:"",Vn(),rr(),cf.value,_e,Math.round(Gr(0,_e)),Math.round(jl()),Re.count,Math.round(Re.total)].join(":")})();ku!==K&&(ku=K,S1({reason:"final"}).then(oe=>{oe.stable||ku!==K||(ku=null)}))},{flush:"post",immediate:!0}),Ze([Pt,j,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settledToken},()=>Vn(),()=>Ts(),qo,Zm,h2,()=>vs.value,nf,()=>rt.value.length,()=>Re.count,()=>Re.total],()=>{Q2()},{flush:"post",immediate:!0}),Ze([()=>rt.value.length,Nt,Cn,ru,()=>zs.start,()=>zs.end],([M,H,V,K,oe,_e])=>{J.value&&Ne("virtualization",{nodes:M,virtualization:H,maxLiveNodes:V,buffer:K,focusIndex:li.value,scroll:H?(()=>{const Ee=nt.value||me();return Ee?{reverse:q(Ee),scrollTop:Math.round(Ee.scrollTop),scrollTopAbs:Math.round(Math.abs(Ee.scrollTop)),scrollHeight:Math.round(Ee.scrollHeight),clientHeight:Math.round(Ee.clientHeight)}:null})():null,liveRange:{start:oe,end:_e},rendered:vs.value})}),Ze([()=>_.customId],([M],H,V)=>{if(!M||$n)return;const K=(function(oe,_e){return oe?(Ns.controllers[oe]=_e,()=>{Ns.controllers[oe]===_e&&delete Ns.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:Wo,restoreAnchor:ee,getAnchorDrift:Se,getReport:M8});V(()=>{K()})},{immediate:!0}),ps(()=>{(function(){if(Pt.value)try{lr(),hu();const M=Vl("manual");j2(M)&&(E(M),pu=M,A1=mu());const H=Ha(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(N(H),H.anchor&&F(H.anchor),Ua=yu(H))}catch{}})(),D8(),e1(),$e(),Z2();for(const M of jr.values())for(const H of M)of(H);jr.clear(),Ul.clear(),Ut.clear(),F1(),ja(),n1(),jn(),Wa(),N1(),b2(),Xm()});const P8=$i({loader:()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./index11-j-uBECZt.js"),__vite__mapDeps([8,5]))).default}catch(M){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".',M),Vo}}),loadingComponent:uee,delay:0}),H8=$i({loader:()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./index10-geSt3mfj.js"),[])).default}catch(M){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.',M),Vo}}),loadingComponent:cee,delay:0}),W8=$i(()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./index7-BsqLagLn.js"),[])).default}catch(M){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".',M),Vo}})),X2={text:as,paragraph:xa,heading:Cp,code_block:H0,list:Hc,list_item:Pc,blockquote:wh,table:ad,definition_list:Sh,footnote:Ch,footnote_reference:Xo,footnote_anchor:rd,admonition:Th,vmr_container:Mh,hardbreak:Cl,link:xo,image:Sl,thematic_break:Ah,math_inline:Bi,math_block:HM,strong:ko,emphasis:_o,strikethrough:bo,highlight:ei,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,checkbox:Qo,checkbox_input:Qo,inline_code:io,html_inline:Jo,reference:yo,html_block:ld},z8=D(()=>r1()),J2=D(()=>GS(_.codeBlockProps)),U8=D(()=>GS(_.codeBlockProps,{omit:["langs"]})),eb=D(()=>lt(lt({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,monacoOptions:_.codeBlockMonacoOptions,themes:_.themes,langs:u.value==="shiki"?_.langs:void 0,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof le.value=="boolean"?{showTooltips:le.value}:{}),U8.value)),tb=D(()=>lt(zt(lt({},eb.value),{langs:_.langs}),J2.value));function nb(M){return typeof M=="boolean"?M:void 0}const q8=D(()=>{const M=_.codeBlockProps||{},H={},V=nb(M.showLineNumbers);V!==void 0&&(H.showLineNumbers=V);const K=nb(M.diffInline);K!==void 0&&(H.diffInline=K);const oe=(function(_e){const Ee=Number(_e);return Number.isFinite(Ee)&&Ee>0?Ee:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),j8=D(()=>lt(lt({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,themes:_.themes,langs:_.langs,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof le.value=="boolean"?{showTooltips:le.value}:{}),J2.value)),V8=D(()=>lt({},_.mermaidProps||{})),sb=D(()=>lt({},_.d2Props||{})),K8=D(()=>lt({},_.infographicProps||{})),wu=D(()=>({typewriter:_.typewriter,fade:_.fade,customHtmlTags:es.value.customHtmlTags})),G8=D(()=>lt(lt({},wu.value),typeof le.value=="boolean"?{showTooltip:le.value}:{})),Y8=D(()=>lt(lt({},wu.value),typeof le.value=="boolean"?{showTooltips:le.value}:{})),Z8=D(()=>lt(lt({},wu.value),typeof le.value=="boolean"?{showTooltips:le.value}:{})),Q8=D(()=>lt(lt({},wu.value),typeof le.value=="boolean"?{showTooltips:le.value}:{}));function X8(M){return Array.isArray(M.children)&&M.children.length>0}const B1=D(()=>A8.value.map(M=>{var H,V,K,oe,_e,Ee,Te,We;let Le=(function(ct){var ft,Et,Ct,sn,It,jt,qt;if(ct.type!=="code_block")return ct;const fn=ct,jo=[String((ft=fn.language)!=null?ft:""),String((Et=fn.loading)!=null?Et:""),String((Ct=fn.diff)!=null?Ct:""),String((sn=fn.code)!=null?sn:""),String((It=fn.originalCode)!=null?It:""),String((jt=fn.updatedCode)!=null?jt:""),String((qt=fn.raw)!=null?qt:"")].join("\0"),ao=Fe.get(fn);if(ao&&ao.signature===jo)return ao.node;const Mi=lt({},fn);return Fe.set(fn,{signature:jo,node:Mi}),Mi})(M.node);const Ve=mf(Le);let ze=lb(Le,Ve);if((Le.type==="html_block"||Le.type==="html_inline")&&ze===X2[Le.type]){const ct=Le,ft=String((H=ct.tag)!=null?H:"").trim().toLowerCase()||N6(ct.content);if(ft){const Et=Vt.value[ft];if(an.value.has(ft)&&Et)ze=Et,Le=zt(lt({},ct),{type:ft,tag:ft,content:AV(ct.content,ft)});else if(I6((V=ct.content)!=null?V:ct.raw,ft)){const Ct=String((oe=(K=ct.content)!=null?K:ct.raw)!=null?oe:"");Le.type==="html_inline"?(ze=as,Le={type:"text",content:Ct,raw:Ct}):(ze=xa,Le={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Oe=Le.type==="code_block"&&u.value==="pre"&&ze===Vo&&!D1(Vt.value,Ve);let Ue=lt({},(function(ct,ft,Et){const Ct=ft??mf(ct);if(ct.type==="code_block"){const sn=Ct?D1(Vt.value,Ct):void 0;if(Et&&u.value==="pre"&&!sn&&Et===Vo)return q8.value;if(Et&&Ct&&Et===sn)return Ct==="mermaid"?ib(ct):Ct==="infographic"?rb(ct):Ct==="d2"||Ct==="d2lang"?sb.value:tb.value;if(Et&&Et===Vt.value.code_block)return tb.value;if(S2(Et))return j8.value}return Ct==="mermaid"?ib(ct):Ct==="infographic"?rb(ct):Ct==="d2"||Ct==="d2lang"?sb.value:ct.type==="link"?G8.value:ct.type==="list"?Y8.value:ct.type==="blockquote"?Z8.value:ct.type==="table"?Q8.value:ct.type==="code_block"?eb.value:wu.value})(Le,Ve,ze));const et=ql.value[M.index];Le.type==="code_block"&&et?.kind==="code-block"&&(Ue=zt(lt({},Ue),Oe?{reservedHeightPx:(_e=et.height)!=null?_e:et.contentHeight}:{estimatedHeightPx:et.height,estimatedContentHeightPx:et.contentHeight})),Oe||Le.type!=="code_block"||Ve!=="mermaid"||wc(Ue.estimatedPreviewHeightPx)!=null||(Ue=zt(lt({},Ue),{estimatedPreviewHeightPx:bv(yv(String((Ee=Le.code)!=null?Ee:"")))})),Oe||Le.type!=="code_block"||Ve!=="infographic"||wc(Ue.estimatedPreviewHeightPx)!=null||(Ue=zt(lt({},Ue),{estimatedPreviewHeightPx:xv(kv(String((Te=Le.code)!=null?Te:"")))})),Le.type==="math_block"&&(Ue=zt(lt({},Ue),{cacheScope:Un.value}));const tt=(function(ct,ft){const Et=String(ct.type);return!Yd(Et)&&Vt.value[Et]===ft})(Le,ze),St=tt?yk(Le,He.value):void 0;return zt(lt({},M),{node:Le,component:ze,bindings:Ue,customBindings:lt(lt({},St??{}),Ue),rendersCustomNode:tt,hasSlotChildren:X8(Le),slotContent:String((We=Le.content)!=null?We:""),isCodeBlock:Le.type==="code_block",indexKey:`${z8.value}-${M.index}`})}));function mf(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function D1(M,H){const V=H.trim().toLowerCase();if(V)for(const K of[V,dk(V),CM(V)]){const oe=K&&M[K];if(oe)return oe}}function ob(M,H,V,K){var oe,_e;const Ee=lt({},M.value);return wc(Ee.estimatedPreviewHeightPx)==null&&(Ee.estimatedPreviewHeightPx=K(V(String((oe=H?.code)!=null?oe:"")),void 0,Ee.maxHeight==="none"?null:(_e=wc(Ee.maxHeight))!=null?_e:void 0)),Ee}function ib(M){return ob(V8,M,yv,bv)}function rb(M){return ob(K8,M,kv,xv)}function lb(M,H){if(!M)return Iv;const V=Vt.value,K=V[String(M.type)];if(M.type==="code_block"){const oe=H??mf(M),_e=oe?D1(V,oe):void 0;return _e||(u.value==="pre"?V.code_block||Vo:oe==="mermaid"?V.mermaid||P8:oe==="infographic"?V.infographic||H8:oe==="d2"||oe==="d2lang"?V.d2||W8:K||V.code_block||C2.value)}return K||X2[String(M.type)]||Iv}function P1(M){o("click",M)}function J8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",M)}function eE(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",M)}function ab(M){o("mouseover",M)}function cb(M){o("mouseout",M)}const Ql=Q(null),qi=Q(!1);let Su,Ka=null,H1=0,gf=0,vf=0;const ub=["code_block","admonition","table","math_block","html_block","image","thematic_break"],tE=new Set(ub),db=[".typewriter-cursor",".height-estimation-probes",...ub.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function fb(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&tE.has(H)}function yf(M){var H,V;if(!M||typeof M!="object")return 0;const K=M,oe=(V=(H=K.raw)!=null?H:K.content)!=null?V:K.code;if(typeof oe=="string")return oe.length;const _e=K.children;if(Array.isArray(_e))return _e.reduce((Te,We)=>Te+yf(We),0);const Ee=K.items;return Array.isArray(Ee)?Ee.reduce((Te,We)=>Te+yf(We),0):0}function kf(){Su&&(clearTimeout(Su),Su=void 0)}function hb(){H1+=1,Ka!=null&&(ss?.(Ka),Ka=null)}function bf(){hb(),Ql.value&&(Ql.value.style.visibility="hidden")}function nE(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const V=M.parentElement;return!!V&&!V.closest(db)}function sE(M){let H=M.lastChild;for(;H;){if(nE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const V=H;if(!V.matches(db)&&V.lastChild){H=V.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function W1(){if(!se||!qi.value||Ka!=null)return;const M=H1,H=()=>{Ka=null,M===H1&&(function(){var V,K;if(!(se&&qi.value&&S.value&&Ql.value))return;const oe=S.value,_e=Ql.value;_e.style.visibility="hidden";const Ee=(function(){const ze=B1.value;for(let Oe=ze.length-1;Oe>=0;Oe--){const Ue=ze[Oe];if(!Ue||fb(Ue.node)||!$1(Ue.index))continue;const et=Yn.get(Ue.index);if(!et)continue;const tt=sE(et);if(tt)return tt}return null})();if(!Ee)return;let Te=0,We=0,Le=20,Ve=!1;if(Ee?.textContent){const ze=Ee.textContent.length,Oe=document.createRange();Oe.setStart(Ee,Math.max(0,ze-1)),Oe.setEnd(Ee,ze);const Ue=typeof Oe.getClientRects=="function"?Oe.getClientRects():void 0,et=(K=Ue?.[Ue.length-1])!=null?K:(V=Ee.parentElement)==null?void 0:V.getBoundingClientRect();if(et){const tt=vt("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Te=et.right-tt.left+oe.scrollLeft,We=et.top-tt.top+oe.scrollTop,Le=et.height||Le,Ve=!0}Oe.detach()}Ve&&(_e.style.transform=`translate(${Math.max(0,Te)}px, ${Math.max(0,We)}px)`,_e.style.height=`${Le}px`,_e.style.visibility="visible")})()};Dn?Ka=Dn(H):H()}return Ze([ye,()=>s.content,()=>s.nodes,()=>_.typewriter,j],()=>Qn(null,null,function*(){var M,H;if(!se||Y.value||!G.value)return;if(j.value)return qi.value=!1,kf(),void bf();if((M=s.nodes)!=null&&M.length)return qi.value=!1,kf(),bf(),gf=((H=s.content)!=null?H:"").length,void(vf=ye.value.length);const V=(function(){var Te,We;return(Te=s.nodes)!=null&&Te.length?s.nodes.reduce((Le,Ve)=>Le+yf(Ve),0):((We=s.content)!=null?We:"").length})(),K=(function(){var Te;return(Te=s.nodes)!=null&&Te.length?s.nodes.reduce((We,Le)=>We+yf(Le),0):ye.value.length})(),oe=!fb(rt.value[rt.value.length-1]),_e=V>gf,Ee=K>vf;if(_.typewriter===!1||!oe||!_e&&!Ee)return _.typewriter!==!1&&oe||(qi.value=!1,bf()),gf=V,void(vf=K);gf=V,vf=K,qi.value=!0,Ql.value&&(Ql.value.style.visibility="hidden"),kf(),yield gt(),W1(),Su=setTimeout(()=>{Su=void 0,qi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ze(qi,M=>Qn(null,null,function*(){M?(yield gt(),W1()):bf()}),{flush:"post"}),Ze([()=>vs.value,()=>zs.start,()=>zs.end],()=>Qn(null,null,function*(){se&&!Y.value&&G.value&&qi.value&&(yield gt(),W1())}),{flush:"post"}),ps(()=>{kf(),hb(),Gn.clear()}),(M,H)=>{const V=NT("NodeRenderer",!0);return C(Y)?(b(!0),T(Be,{key:0},st(B1.value,K=>(b(),T(Be,{key:K.index},[K.rendersCustomNode?(b(),be(Ks(K.component),bn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onClick:P1,onMouseover:ab,onMouseout:cb,onCopy:H[0]||(H[0]=oe=>o("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>o("handleArtifactClick",oe))}),{default:Me(()=>[K.hasSlotChildren?(b(),be(V,bn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(b(),be(V,bn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),be(Ks(K.component),bn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onClick:P1,onMouseover:ab,onMouseout:cb,onCopy:H[2]||(H[2]=oe=>o("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),T("div",{key:1,ref_key:"containerRef",ref:S,class:Pe(["markstream-vue markdown-renderer",[{dark:_.isDark},{virtualized:Nt.value},{"virtual-scroll-coordinated":Ye.value}]]),"data-custom-id":_.customId,onClick:P1,onMouseover:J8,onMouseout:eE},[Ot.value||Nt.value?(b(),T(Be,{key:0},[Ot.value?(b(),T("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${Sn.value}px`}),"aria-hidden":"true"},[w("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[ie(C(xa),{node:us.value,"index-key":"probe-paragraph"},null,8,["node"])],512),w("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[w("ul",fee,[ie(C(Pc),{node:ts.value,"index-key":"probe-list-item"},null,8,["node"])])],512),w("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[ie(C(Hc),{node:kn.value,"index-key":"probe-list"},null,8,["node"])],512),(b(),T(Be,null,st(6,K=>w("div",{key:`probe-heading-${K}`,ref_for:!0,ref:oe=>(function(_e,Ee){_e<1||_e>6||(P[_e]=Ee)})(K,oe),class:"node-content","data-probe":`heading-${K}`},[ie(C(Cp),{node:w8(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,hee)),64))],4)):re("",!0),Nt.value?(b(),T("div",{key:1,class:"node-spacer",style:Yt({height:`${o1.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(b(!0),T(Be,null,st(B1.value,K=>(b(),T("div",{key:K.index,ref_for:!0,ref:oe=>Y2(K.index,oe),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[$1(K.index)?(b(),T("div",{key:0,ref_for:!0,ref:oe=>(function(_e,Ee){var Te;Ee||(function(ze){const Oe=`${r1()}-${ze}`;let Ue=!1;for(const et of Array.from(zo.keys())){const tt=zi.get(et);(tt?.index===ze||et===Oe||et.startsWith(`${Oe}-`))&&(zo.delete(et),zi.delete(et),Ue=!0)}Ue&&(Ba(),Pn("async-node"))})(_e),ir.delete(_e),(function(ze){var Oe;const Ue=((Oe=Ul.get(ze))!=null?Oe:0)+1;Ul.set(ze,Ue)})(_e);const We=jr.get(_e);if(We){for(const ze of We)of(ze);jr.delete(_e)}if((function(ze){const Oe=Rs.get(ze);Oe&&(ke?.unobserve(Oe),ut.delete(Oe),Rs.delete(ze))})(_e),!Ee||!fs.value)return Wi.delete(_e),void Ul.delete(_e);Wi.set(_e,Ee);const Le=()=>{pf(_e,Ee)};queueMicrotask(Le);const Ve=(ke||typeof ResizeObserver>"u"||(ke=new ResizeObserver(ze=>{if(ze.length)for(const Oe of ze){const Ue=ut.get(Oe.target),et=Rs.get(Ue??-1);Ue!=null&&et&&pf(Ue,et)}else lr()})),ke);if(Ve&&(Rs.set(_e,Ee),ut.set(Ee,_e),Ve.observe(Ee)),typeof window<"u"){const ze=((Te=rt.value[_e])==null?void 0:Te.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(ze.length){const Oe=ze.map(Ue=>v2(Ue,Le,"node-resize")).filter(Ue=>Ue!=null);Oe.length&&jr.set(_e,Oe)}}})(K.index,oe),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(b(),be(Ks(K.component),bn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[8]||(H[8]=oe=>o("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>o("handleArtifactClick",oe))}),{default:Me(()=>[K.hasSlotChildren?(b(),be(V,bn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(b(),be(V,bn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),be(Ks(K.component),bn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[10]||(H[10]=oe=>o("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),be(Tl,{key:0,name:"fade",css:_.fade!==!1,appear:_.fade!==!1},{default:Me(()=>[K.rendersCustomNode?(b(),be(Ks(K.component),bn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[4]||(H[4]=oe=>o("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>o("handleArtifactClick",oe))}),{default:Me(()=>[K.hasSlotChildren?(b(),be(V,bn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(b(),be(V,bn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),be(Ks(K.component),bn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[6]||(H[6]=oe=>o("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),T("div",{key:1,class:"node-placeholder",style:Yt({height:`${af(K.index)}px`})},null,4))],8,pee))),128)),qi.value?(b(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:Ql,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),Nt.value?(b(),T("div",{key:2,class:"node-spacer",style:Yt({height:`${i1.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,dee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Po=JM;Po.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Po.__name,Po.name].filter(n=>!!n));for(const n of t)e.component(n,JM)};const Ck=Object.freeze(Object.defineProperty({__proto__:null,default:Po},Symbol.toStringTag,{value:"Module"})),mee={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"},gee={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"},vee={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"},yee={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"},kee={class:"admonition-title"},bee=["aria-expanded","aria-controls"],xee=["id"],Th=vn(Ge({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=D(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Q(!!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)=>(b(),T("div",{class:Pe(["admonition",[`admonition-${s.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(b(),T("svg",mee,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(b(),T("svg",gee,[...u[2]||(u[2]=[w("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),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(b(),T("svg",vee,[...u[3]||(u[3]=[w("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),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(b(),T("svg",yee,[...u[4]||(u[4]=[w("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),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),w("span",kee,O(i.value),1),s.node.collapsible?(b(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),T("svg",{style:Yt({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]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,bee)):re("",!0)]),Rn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(Po),{"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,xee),[[yi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Th.install=e=>{e.component(Th.__name,Th)};const e5=()=>mo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Xf=null,_ee=e5;function L_e(){return Qn(this,null,function*(){if(Xf)return Xf;const e=_ee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===e5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Xf=(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),Xf):null})}function F_e(){return!1}function O_e(){return Qn(this,null,function*(){return null})}const Jf=Q(!1);let iC=!1;function Z0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function wee(){return!iC&&typeof window<"u"&&typeof document<"u"&&(iC=!0,Jf.value=Z0(),new MutationObserver(()=>{Jf.value=Z0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Jf.value=Z0()})),Jf}const t5=["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"],See=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Rv=[...t5].sort((e,t)=>t.length-e.length).join("|"),Q0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Rv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Rv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),n5=/[),.;!?,。;!?)]+$/;function Cee(e){const t=e.toLowerCase();return t5.some(n=>t.endsWith(`.${n}`))}function Aee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Rv}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function Mee(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(n5,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=See.has(i),a=Cee(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 Eee(e,t={}){const n=[];Q0.lastIndex=0;let s;for(;(s=Q0.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(n5,""),u=a.length-c.length;a=c;const d=Mee(a,t);if(!d)continue;const f=s.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(Q0.lastIndex-=u)}return n}const Tee=12e4,Nee=6e4,Iee=32,$ee=3e4,rC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Lee(e){let t=0,n=0,s=0;rC.lastIndex=0;let o;for(;(o=rC.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=Tee||n>=Nee||t>=Iee||s>=$ee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Fee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Oee(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Ree={key:1,class:"diff-wrap"},Bee={class:"diff-bar"},Dee=["aria-label","onClick"],Pee={class:"diff-pre"},Hee={key:0,class:"diff-sign"},Wee={class:"diff-text"},zee="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",lC="github-light",aC="github-dark",Uee=Ge({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){yQ(),IQ(),bQ(),RQ(),kQ(new Fee),OQ(new Oee);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Tt(),s=Kt("resolveImage"),o=Q(null),i=e,r=D(()=>!i.streaming),l=D(()=>Aee(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Lee(i.text??"")),c=wee(),u=D(()=>!i.streaming),d=Hs(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function x(R){if(!s)return;const B=[];for(const P of[h,p]){P.lastIndex=0;let z;for(;(z=P.exec(R))!==null;)B.push(z[2]??"")}for(const P of B)!P||!m(P)||d.has(P)||f.has(P)||(f.add(P),s(P).then(z=>{d.set(P,z!==P?z:"")}).catch(()=>{d.set(P,"")}).finally(()=>{f.delete(P)}))}function k(R){if(!s)return R;const B=P=>{if(!m(P))return null;const z=d.get(P);return z===void 0?zee:z===""?null:z};return R.replace(h,(P,z,W,X)=>{const U=B(W);return U===null?P:`${z}${U}${X}`}).replace(p,(P,z,W,X)=>{const U=B(W);return U===null?P:`${z}${U}${X}`})}Ze(()=>i.text,R=>x(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),B=[];let P=R.nextNode();for(;P;){const z=P,W=z.parentElement;W&&!W.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&B.push(z),P=R.nextNode()}for(const z of B){const W=Eee(z.data,{aliases:l.value});if(W.length===0||!z.parentNode)continue;const X=document.createDocumentFragment();let U=0;for(const Z of W){Z.start>U&&X.append(document.createTextNode(z.data.slice(U,Z.start)));const ce=document.createElement("button");ce.type="button",ce.className="md-file-link",ce.textContent=Z.text,ce.title=Z.line?`${Z.path}:${Z.line}`:Z.path,ce.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation(),i.openFile?.({path:Z.path,line:Z.line})}),X.append(ce),U=Z.end}U<z.data.length&&X.append(document.createTextNode(z.data.slice(U))),z.parentNode.replaceChild(X,z)}}function v(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let B=R.length;for(const P of["#","?"]){const z=R.indexOf(P);z!==-1&&z<B&&(B=z)}return R.slice(0,B)}function A(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const B of R){if(B.dataset.mdLinkHandled==="true"||B.closest("svg"))continue;const P=B.getAttribute("href")??"";v(P)&&(B.dataset.mdLinkHandled="true",B.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(P)})}))}}function L(){gt().then(()=>{g(),A()})}Ze(()=>i.text,L),Ze(()=>i.streaming,L);let $=null;gn(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),_n(()=>{$?.disconnect()});const _={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=D(()=>{const R=k(i.text??""),B=[];let P=0;E.lastIndex=0;let z;for(;(z=E.exec(R))!==null;){const X=z[1]??"",U=R.slice(P,z.index)+(X||"");U.trim()&&B.push({kind:"md",text:U}),B.push({kind:"diff",code:z[2]??""}),P=E.lastIndex}const W=R.slice(P);return(W.trim()||B.length===0)&&B.push({kind:"md",text:W}),B});function F(R){return R.split(`
|
|
281
|
-
`).map(B=>B.startsWith("@@")?{type:"hunk",sign:"",text:B}:/^\+(?!\+\+)/.test(B)?{type:"add",sign:"+",text:B.slice(1)}:/^-(?!--)/.test(B)?{type:"del",sign:"-",text:B.slice(1)}:B.startsWith(" ")?{type:"ctx",sign:"",text:B.slice(1)}:{type:"ctx",sign:"",text:B})}const S=Q(null);function I(R,B){oo(R).then(P=>{P&&(S.value=B,setTimeout(()=>{S.value=null},1400))})}return(R,B)=>(b(),T("div",{ref_key:"mdRef",ref:o,class:"md"},[(b(!0),T(Be,null,st(N.value,(P,z)=>(b(),T(Be,{key:z},[P.kind==="md"?(b(),be(C(Po),{key:0,content:P.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":lC,"code-block-dark-theme":aC,themes:[lC,aC],"code-block-props":_,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(b(),T("div",Ree,[w("div",Bee,[B[0]||(B[0]=w("span",{class:"diff-lang"},"diff",-1)),ie(Zt,{text:C(n)("filePreview.copyCode")},{default:Me(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:W=>I(P.code,z)},[ie(qe,{name:S.value===z?"check":"copy",size:"sm"},null,8,["name"])],8,Dee)]),_:2},1032,["text"])]),w("pre",Pee,[w("code",null,[(b(!0),T(Be,null,st(F(P.code),(W,X)=>(b(),T("span",{key:X,class:Pe(["diff-line",`diff-${W.type}`])},[W.type!=="hunk"?(b(),T("span",Hee,O(W.sign),1)):re("",!0),w("span",Wee,O(W.text),1)],2))),128))])])]))],64))),128))],512))}}),Rm=dt(Uee,[["__scopeId","data-v-135142ed"]]),qee={class:"tc-anim"},jee={class:"prev-anim"},Vee={class:"prev"},Kee=Ge({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&o.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>o.value.at(-1)??""),a=Q(null);return gn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ze(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(b(),T("div",{class:Pe(["think",{mob:e.mobile}])},[i.value?(b(),T("div",{key:0,class:Pe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[w("div",qee,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),w("div",jee,[w("span",Vee,O(l.value),1)])],2)):(b(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),Gee=dt(Kee,[["__scopeId","data-v-fdc551ea"]]),Yee={class:"activity-notice",role:"status"},Zee={"aria-hidden":"true"},Qee={class:"an-label"},Xee=Ge({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(b(),T("div",Yee,[w("span",Zee,[ie(Ho,{size:"sm"})]),w("span",Qee,O(e.label),1)]))}}),Jee=dt(Xee,[["__scopeId","data-v-0d497074"]]);function ete(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 tte=Ge({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),s=Q(!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:ete(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(b(),T("button",{type:"button",class:"msg-time",onClick:xt(r,["stop"])},O(i.value),1))}}),s5=dt(tte,[["__scopeId","data-v-9672fbd5"]]);function nte(e){return e.length===1?`0${e}`:e}function ste(e,t){return`${String(Number(e))}:${nte(t)}`}const cC=e=>/^\d+$/.test(e);function ote(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(cC(s)&&cC(o)&&c){const f=ste(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 ite=["data-turn-id"],rte={class:"cn-bubble"},lte={class:"cn-title"},ate={key:0,class:"cn-prompt"},cte={class:"cn-meta"},ute={key:0,class:"cn-meta-item"},dte={key:1,class:"cn-meta-item"},fte=["aria-label"],hte=["title"],pte=Ge({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),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?ote(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)=>(b(),T("div",{class:Pe(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",rte,[w("span",lte,O(i.value),1),c.value?(b(),T("span",ate,O(c.value),1)):re("",!0)]),w("div",cte,[ie(qe,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(b(),T("span",ute,O(r.value),1)):re("",!0),a.value?(b(),T("span",dte,O(a.value),1)):re("",!0),w("span",{class:Pe(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(b(),be(qe,{key:0,name:"check",size:"sm"})):(b(),be(qe,{key:1,name:"close",size:"sm"}))],10,fte),s.value?.jobId?(b(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},O(s.value.jobId),9,hte)):re("",!0),e.createdAt?(b(),be(s5,{key:3,time:e.createdAt},null,8,["time"])):re("",!0)])],10,ite))}}),mte=dt(pte,[["__scopeId","data-v-a62a6587"]]),gte=["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","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],o5=500,Ep=256*1024,uC=200,X0=16384,J0=500,eg=50,tg=50,vte=6,yte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,kte=/^[A-Za-z0-9+/=_-]{200,}$/;let ng=null;function Di(){if(ng!==null)return ng;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=cs(Lt.debug)==="1"),ng=e,e}const Al=[],Sc=[];let Wu=0;const ua=[];let zu=0,bte=1;const Tp=new TextEncoder,xte=new Set(gte),Ak=Q(0),Uu=Na(!1);function _te(){return Al}function wte(){Al.length=0,Sc.length=0,Wu=0,ua.length=0,zu=0,Ak.value++}function Ur(e){if(!Uu.value){try{const t={id:bte++,ts:Date.now(),source:e.source,kind:String(Wc(e.kind)),label:String(Wc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Wc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Pl(e.detail)},n=JSON.stringify(t),s=Tp.encode(n).byteLength;if(s>Ep)return;for(Al.push(t),Sc.push(n),Wu+=s+(Sc.length>1?1:0);Al.length>o5||Wu>Ep;){const o=Sc.shift();Al.shift(),o!==void 0&&(Wu-=Tp.encode(o).byteLength,Sc.length>0&&(Wu-=1))}}catch{return}Ak.value++}}function sc(e){if(typeof e=="string")return e.length<=uC?e:e.slice(0,uC)}function ui(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ste(e,t){if(xte.has(e))try{const n={ts:Date.now(),event:e,sessionId:sc(t?.sessionId),status:sc(t?.status),seq:ui(t?.seq),durationMs:ui(t?.durationMs),messageCount:ui(t?.messageCount),contentCount:ui(t?.contentCount),mediaCount:ui(t?.mediaCount),sessionCount:ui(t?.sessionCount),workspaceCount:ui(t?.workspaceCount),promptId:sc(t?.promptId),zipBytes:ui(t?.zipBytes),errorName:sc(t?.errorName),errorCode:ui(t?.errorCode),requestId:sc(t?.requestId),phase:sc(t?.phase),httpStatus:ui(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:ui(t?.line),col:ui(t?.col)},s=JSON.stringify(n),o=Tp.encode(s).byteLength;if(o>Ep)return;for(ua.push(s),zu+=o+(ua.length>1?1:0);ua.length>o5||zu>Ep;){const i=ua.shift();i!==void 0&&(zu-=Tp.encode(i).byteLength,ua.length>0&&(zu-=1))}}catch{return}}function Wc(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 kte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>J0?`${i.slice(0,J0)}… [+${i.length-J0} chars]`:i}if(n!=="object")return String(e);if(t>=vte)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,eg).map(r=>Wc(r,t+1));return e.length>eg&&i.push(`[+${e.length-eg} more items]`),i}const s={},o=Object.entries(e);for(const[i,r]of o.slice(0,tg))s[i]=yte.test(i)?"[redacted]":Wc(r,t+1);return o.length>tg&&(s._truncatedKeys=o.length-tg),s}function Pl(e){if(e===void 0)return;const t=Wc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>X0)return{_truncated:`detail JSON was ${n.length} chars; first ${X0} kept`,preview:n.slice(0,X0)}}catch{return"[unserializable detail]"}return t}function eh(e){Di()&&Ur({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Pl(e.body)}})}function oc(e){if(!Di())return;const t=e.code!==0;Ur({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:Pl(e.data)}})}function rl(e){Di()&&Ur({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function ic(e,t){Di()&&Ur({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Pl(t)})}function Cte(e){if(!Di())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;Ur({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Pl(e)})}function Ate(e){if(!Di())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Ur({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Pl(t.payload)})}const Mte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Ete(e,t,n){Di()&&Ur({source:"client",kind:`client:${e}`,label:`${Mte[e]} ${t}`,detail:Pl(n)})}function Sr(e,t){Di()&&Ur({source:"client",kind:"client:event",label:`· ${e}`,detail:Pl(t)})}function $s(e,t){Ste(e,t),Ur({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let sg=!1,th=null;function Tte(){if(sg)return()=>th?.();sg=!0;const e=[];try{if(typeof window<"u"){const n=o=>{$s("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;$s("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(Di())for(const n of["error","warn","log","info","debug"]){const s=console[n];if(typeof s!="function")continue;const o=(...i)=>{try{Ete(n,i.map(Nte).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(th===t){for(const n of e.toReversed())n();th=null,sg=!1}};return th=t,t}function Nte(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 i5(e=Al){if(typeof document>"u")return;const t=new Blob([Ite(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let s;try{s=document.createElement("a"),s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(s),s.click()}finally{s?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Ite(e=Al){return e===Al?Sc.join(`
|
|
282
|
-
`):e.map(t=>JSON.stringify(t)).join(`
|
|
283
|
-
`)}function $te(){return ua.join(`
|
|
284
|
-
`)}function r5(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function Bv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Dv(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function Lte(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function Ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:Dv(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:r5(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 cd(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function dC(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function Mk(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:dC(e.source)};case"video":return{type:"video",source:dC(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function Pv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Mk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Fte(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function Ote(e){return{content:e.content.map(Fte),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function Rte(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function l5(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 Bte(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Dte(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Bte),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function a5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Dte),createdAt:e.created_at}}function Pte(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 Hte(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=Pte(s);return{answers:t,method:e.method,note:e.note}}function Nh(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 fC(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function ll(e,t){const n=e[t];return typeof n=="string"?n:void 0}function rc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function di(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function c5(e){if(!e||typeof e!="object")return null;const t=e,n=ll(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:ll(t,"goalId")??ll(t,"goal_id")??"goal",objective:ll(t,"objective")??"",completionCriterion:ll(t,"completionCriterion")??ll(t,"completion_criterion"),status:n,turnsUsed:rc(t,"turnsUsed")??rc(t,"turns_used")??0,tokensUsed:rc(t,"tokensUsed")??rc(t,"tokens_used")??0,wallClockMs:rc(t,"wallClockMs")??rc(t,"wall_clock_ms")??0,terminalReason:ll(t,"terminalReason")??ll(t,"terminal_reason"),budget:{tokenBudget:di(o,"tokenBudget")??di(o,"token_budget"),remainingTokens:di(o,"remainingTokens")??di(o,"remaining_tokens"),turnBudget:di(o,"turnBudget")??di(o,"turn_budget"),remainingTurns:di(o,"remainingTurns")??di(o,"remaining_turns"),wallClockBudgetMs:di(o,"wallClockBudgetMs")??di(o,"wall_clock_budget_ms"),remainingWallClockMs:di(o,"remainingWallClockMs")??di(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Wte(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(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:cd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:cd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:Dv(t.payload.status),previousStatus:Dv(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:r5(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=c5(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:Pv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Mk),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:l5(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:a5(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:Nh(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:Hv(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function zte(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 hC(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function Hv(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Ute(e){return e.session_id}function qte(e){return e.seq}const jte="main",Vte=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","error"]);function 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 Kte(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 pC(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function fo(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ra(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function fi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Gte(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=fo(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=fo(t,"goalId")??fo(t,"goal_id")??"goal",r=fo(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:fo(t,"completionCriterion")??fo(t,"completion_criterion"),status:o,turnsUsed:ra(t,"turnsUsed")??ra(t,"turns_used")??0,tokensUsed:ra(t,"tokensUsed")??ra(t,"tokens_used")??0,wallClockMs:ra(t,"wallClockMs")??ra(t,"wall_clock_ms")??0,terminalReason:fo(t,"terminalReason")??fo(t,"terminal_reason"),budget:{tokenBudget:fi(s,"tokenBudget")??fi(s,"token_budget"),remainingTokens:fi(s,"remainingTokens")??fi(s,"remaining_tokens"),turnBudget:fi(s,"turnBudget")??fi(s,"turn_budget"),remainingTurns:fi(s,"remainingTurns")??fi(s,"remaining_turns"),wallClockBudgetMs:fi(s,"wallClockBudgetMs")??fi(s,"wall_clock_budget_ms"),remainingWallClockMs:fi(s,"remainingWallClockMs")??fi(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Cc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Yte(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=fo(t,"name")??fo(t,"toolName")??"tool",s=$a(Zte(n)),o=Qte(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=fo(n,"text");if(o)return og(o);const i=fo(n,"message");if(i)return og(i)}const s=fo(t,"message");if(s)return og(s)}return null}function Zte(e){return e.replace(/_\d+$/,"")}const mC=2e3;function og(e){return e.length>mC?`${e.slice(0,mC)}…`:e}function Qte(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Sd(e,n)}function Xte(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=fo(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Cc(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=Yte(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Cc(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function Fu(e){return{...e,content:e.content.map(t=>({...t}))}}function gC(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 Jte(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 ene(e){return Array.isArray(e)?e.map(t=>Mk(t)):[]}function vC(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 tne(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 nne(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 yC(e,t){e.messages.find(n=>n.id===t)}function sne(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 ig(e,t){return e.messages.find(n=>n.id===t)}function kC(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 one(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=pC(),e.set(u,d)),d}function s(u){e.set(u,pC())}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=gC(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 x=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:x}),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:Fu(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,x=[],k=m?.agentId;if(typeof k=="string"&&k!==jte){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(Vte.has(u))return Xte(p,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&x.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=ene(m?.content);if(y.length===0)break;p.currentPromptId=g;const A=Jte(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());x.push({type:"messageCreated",message:Fu(A)});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;break}case"turn.step.started":{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)),p.turnTextLen=0,p.turnThinkLen=0;const y=gC(p,f,v);p.currentAssistantMsgId=y.id,x.push({type:"messageCreated",message:Fu(y)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const y=a(p.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){x.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=vC(p,g,"thinking",v);if(A<0)break;p.turnThinkLen+=v.length,x.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const y=a(p.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){x.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=vC(p,g,"text",v);if(A<0)break;p.turnTextLen+=v.length,x.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,y=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};tne(p,g,A,L,$);const _=ig(p,g);_&&_.content.length-1,p.toolStartTimes.set(A,Date.now()),_&&x.push({type:"messageUpdated",sessionId:f,messageId:g,content:_.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=nne(m??{});g&&v&&x.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 y=m?.toolCallId,A=m?.output,L=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const $=sne(p,f,y,A,L,v);x.push({type:"messageCreated",message:Fu($)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=Kte(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){yC(p,g);const y=ig(p,g);y&&x.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(A=>({...A})),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),x.push({type:"sessionUsageUpdated",sessionId:f,usage:kC(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",y=ra(m??{},"durationMs");if(g){yC(p,g);const L=ig(p,g);L&&x.push({type:"messageUpdated",sessionId:f,messageId:g,content:L.content.map($=>({...$})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:y})}p.turnCount++;const A=kC(p);x.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{p.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId: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),x.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Cc(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&x.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Cc(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&x.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Cc(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&x.push({type:"taskCreated",sessionId:f,task:v}),x.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=Cc(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&x.push({type:"taskCreated",sessionId:f,task:v}),x.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{x.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{x.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,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):br("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:En.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;x.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:A,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;x.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??{};x.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}),x.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{x.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{x.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Gte(m?.snapshot??null);x.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=fo(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:br("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(y),x.push({type:"messageCreated",message:Fu(y)})}break}}return x}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const ine=new Set(["server_hello","ack","ping","resync_required","error","pong"]),bC=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),rne=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"]),lne=new Set(["assistant.delta","thinking.delta"]);function ane(e,t){if(ine.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return lne.has(s)?cne(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?rne.has(s)?{route:"protocol"}:bC.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:bC.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function cne(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 qu 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 Lr(e){return e instanceof qu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function u5(e){return e instanceof vr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const qs="kimi-web.server-credential",une="token",dne=10080*60*1e3;let er;const Wv=new Set;function fne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(une);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function zv(e){return{version:1,credential:e,expiresAt:Date.now()+dne}}function hne(e){return JSON.stringify(e)}function Ek(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Uv(e){globalThis.localStorage?.setItem(qs,hne(e))}function pne(){try{const e=globalThis.localStorage?.getItem(qs);if(e){const n=Ek(e);if(n===void 0){const s=zv(e);let o=!1;try{Uv(s),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(qs)===e&&globalThis.localStorage?.removeItem(qs),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(qs)}catch{}return o?s:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(qs),globalThis.localStorage?.getItem(qs)===e&&globalThis.localStorage?.removeItem(qs);return}const t=globalThis.sessionStorage?.getItem(qs);if(t){const n=zv(t);let s=!1;try{Uv(n),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(qs),s=!0}catch{}return s?n:void 0}return}catch{return}}function mne(){const e=fne();return e?(f5(e),!0):(er=pne(),er!==void 0)}function d5(){if(er!==void 0){if(er.expiresAt<=Date.now()){gne(er);return}return er.credential}}function gne(e){er=void 0;try{globalThis.sessionStorage?.removeItem(qs);const t=globalThis.localStorage?.getItem(qs),n=t==null?void 0:Ek(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(qs)}catch{}}function f5(e){const t=zv(e);er=t;try{Uv(t)}catch{}try{globalThis.sessionStorage?.removeItem(qs)}catch{}}function vne(){const e=er;er=void 0;try{const t=globalThis.localStorage?.getItem(qs),s=(t==null?void 0:Ek(t))?.credential??t;e!==void 0&&s===e.credential&&globalThis.localStorage?.removeItem(qs),globalThis.sessionStorage?.removeItem(qs)}catch{}}function yne(e){return Wv.add(e),()=>{Wv.delete(e)}}function kne(){vne();for(const e of Wv)try{e()}catch{}}const pc=3e4,nh=5*6e4,h5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",xC=500,p5=40101;function sh(e=pc){try{return AbortSignal.timeout(e)}catch{return}}function bne(e,t){let n="",s=e;for(let o=0;o<t;o++)n=h5[s%32]+n,s=Math.floor(s/32);return n}function xne(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=>h5[n%32]).join("")}function oh(){return`${bne(Date.now(),10)}${xne(16)}`}function _ne(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function rg(e){try{const t=await e.text();return t?t.length>xC?`${t.slice(0,xC)}...`:t:void 0}catch{return}}class wne{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=kc(this.origin,t),s=oh(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();eh({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:sh()})}catch(a){throw rl({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:pc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return oc({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),oc({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 qu({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=kc(this.origin,t),r=oh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();eh({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:sh(nh)})}catch(h){throw rl({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:nh,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 x=h?.code??c.status,k=h?.msg??c.statusText;throw oc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:x,msg:k,envelopeRequestId:h?.request_id}),new qu({code:x,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 rl({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:nh,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await rg(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw rl({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new vr({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:nh,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return oc({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=kc(this.origin,t),o=oh(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();eh({method:"POST",path:t,url:s,requestId:o,body:_ne(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:sh()})}catch(u){throw rl({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:pc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw rl({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new vr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:pc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await rg(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(oc({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 qu({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=kc(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,x]of Object.entries(o))x!==void 0&&h.set(m,String(x));const p=h.toString();p&&(r=`${r}?${p}`)}const l=oh(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();eh({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:sh()})}catch(h){throw rl({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:pc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw rl({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new vr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:pc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await rg(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(oc({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 qu({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=d5();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===p5)&&kne()}}const Sne="kimi-code.bearer.",Cne=3e4;class Ane{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(),ic("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=d5(),n=t!==void 0?[`${Sne}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{ic("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));Ate(i),this.handleFrame(i)}catch(i){ic("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{ic("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{ic("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,ic("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=ih(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(ih(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(ih(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,Cne),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=ih(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=ane(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)),Cte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function ih(e,t){return`${e}\0${t}`}function Mne(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 _C(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function lg(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function wC(e){return e==="auto_compact"||e==="manual_compact"}class Ene{http;config;constructor(t){this.config=t,this.http=new wne(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Lte(t.status):void 0,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ni),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 Ni(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return c5(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ni(n)}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(Pv),hasMore:o.has_more}}async getSessionSnapshot(t){const n=Date.now();$s("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:Ni(s.session),messages:s.messages.items.map(Pv),hasMoreMessages:s.messages.has_more,inFlightTurn:s.in_flight_turn===null?null:{turnId:s.in_flight_turn.turn_id,assistantText:s.in_flight_turn.assistant_text,thinkingText:s.in_flight_turn.thinking_text,runningTools:s.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:s.in_flight_turn.current_prompt_id},pendingApprovals:s.pending_approvals.map(l5),pendingQuestions:s.pending_questions.map(a5),subagents:(s.subagents??[]).map(Nh)};return $s("session:snapshot:accepted",{sessionId:t,status:o.session.status,seq:o.asOfSeq,messageCount:o.messages.length,durationMs:Date.now()-n}),o}catch(s){throw $s("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,..._C(s)}),s}}async exportSession(t,n){const s=n===void 0?0:new TextEncoder().encode(n).byteLength,o=n===void 0||n.length===0?0:n.split(`
|
|
285
|
-
`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:s,web_log_entries:o}),r=`${t}.zip`;return{blob:i.blob,fileName:Mne(i.contentDisposition,r)}}async submitPrompt(t,n){const s=Date.now();$s("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`,Ote(n));return $s("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 $s("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-s,..._C(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 Ni(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 Ni(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}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)}`,Rte(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)}`,Hte(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(Nh)}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 Nh(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(lg)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return lg(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return lg(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(fC)])):void 0;return{items:o.items.map(fC),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 kc(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(cd)}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 cd(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 cd(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(zte)}async listProviders(){return(await this.http.get("/providers")).items.map(hC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return hC(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return ag(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return ag(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return ag(t)}async getConfig(){const t=await this.http.get("/config");return Hv(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return Hv(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return kc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=gI(this.config.serverHttpUrl,this.config.clientId),s=one(),o=new Ane(n,this.config.clientId,{onWireEvent:i=>{const r=Ute(i),l=qte(i),a=Wte(i);a.type==="historyCompacted"&&!wC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!wC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function ag(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let SC;function pt(){return SC??=new Ene(dI()),SC}const Tne=["src","controls","muted"],Nne=["src","alt"],cg=Ge({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=Q(t.fileId?"":t.url),s=Q(null),o=Q(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=await pt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ze(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),gn(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),ps(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(b(),T("video",{key:0,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Tne)):(b(),T("img",{key:1,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Nne))}}),Ine=["aria-label"],$ne=120,Lne=60,Fne=Ge({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*$ne}ms`,"--moon-frame-fast-delay":`${s*Lne}ms`}}return(s,o)=>(b(),T("span",{class:Pe(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(b(),T(Be,null,st(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Ine))}}),m5=dt(Fne,[["__scopeId","data-v-a6b7ec07"]]),One={class:"chat"},Rne={key:0,class:"chat-loading"},Bne={class:"chat-loading-text"},Dne={key:1,class:"chat-empty"},Pne={key:1,class:"top-sentinel-text"},Hne={key:0,class:"u-turn"},Wne=["data-turn-id"],zne={key:0,class:"u-imgs"},Une=["aria-label","onClick"],qne={key:1,class:"skill-act"},jne={class:"skill-act-head"},Vne={key:0,class:"skill-act-args"},Kne={key:2,class:"skill-act"},Gne={class:"skill-act-head"},Yne={key:0,class:"skill-act-args"},Zne={key:3,class:"u-text"},Qne={key:0,class:"u-meta"},Xne=["aria-label","onClick"],Jne=["aria-label","onClick"],ese=["data-turn-id"],tse=["onClick"],nse={class:"cd-view"},sse={key:1,class:"cd-label"},ose=["data-turn-id"],ise={key:1,class:"msg"},rse={key:0,class:"a-msg-ft"},lse={key:0,class:"a-duration"},ase=["aria-label","onClick"],cse={key:4,class:"sending-placeholder"},use={key:5,class:"q-stack"},dse={class:"q-head"},fse={class:"q-title"},hse={class:"q-hint"},pse=["onDragover","onDrop"],mse={class:"u-bub q-bub"},gse=["title","onDragstart"],vse=["title","onClick"],yse={key:0,class:"u-text q-text"},kse={key:1,class:"q-text q-text-placeholder"},bse={key:0,class:"q-imgs"},xse={key:1,class:"q-tag q-tag-next"},_se={key:2,class:"q-tag q-tag-idx"},wse=["aria-label","onClick"],Sse=2500,Cse=Ge({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=Tt(),{confirm:o}=zr();_n(()=>{U!==null&&(clearTimeout(U),U=null),I!==null&&(clearTimeout(I),I=null),E!==null&&(clearTimeout(E),E=null)});const i=e,r=Q(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Y=>{Y[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))}gn(a),_n(()=>{l?.disconnect(),l=null}),Ze(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=D(()=>{if(!i.running||i.turns.length===0)return null;const Y=i.turns.at(-1);return Y.role==="assistant"?Y.id:null}),u=D(()=>i.sending||i.running),d=n,f=Q(null),h=Q(null);function p(Y){return(Y.attachments?.length??0)>0}function m(Y){d("editQueued",Y)}function x(Y,J){if(f.value=Y,!J.dataTransfer)return;J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("text/plain",String(Y));const le=J.currentTarget?.closest(".q-turn");le&&J.dataTransfer.setDragImage(le,24,24)}function k(Y,J){if(f.value===null)return;J.preventDefault(),J.dataTransfer&&(J.dataTransfer.dropEffect="move");const le=J.currentTarget.getBoundingClientRect(),He=J.clientY<le.top+le.height/2?"before":"after";h.value={index:Y,position:He}}function g(Y,J){J.preventDefault();const le=f.value,He=h.value?.position??"before";if(f.value=null,h.value=null,le===null)return;let de=He==="before"?Y:Y+1;le<de&&(de-=1),le!==de&&d("reorderQueue",{from:le,to:de})}function v(){f.value=null,h.value=null}const y=D(()=>{for(let Y=i.turns.length-1;Y>=0;Y--)if(i.turns[Y].role==="user")return i.turns[Y].id;return null});function A(Y){return Y.role==="user"&&Y.id===y.value&&!i.running&&!i.sending&&!Y.skillActivation&&!Y.pluginCommand}function L(Y){const J=Y.compaction,le=J?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof J?.tokensBefore=="number"&&typeof J?.tokensAfter=="number"?le+s("conversation.compactedTokens",{before:p_(J.tokensBefore),after:p_(J.tokensAfter)}):le}const $=Q(null),_=Q(null);let E=null;async function N(Y){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(Y)}function F(Y){_.value===null&&(_.value=Y.id,d("editMessage",{text:Y.text,images:Y.images}),E=setTimeout(()=>{E=null,_.value=null},Sse))}Ze(()=>i.turns,Y=>{_.value!==null&&(Y.some(J=>J.id===_.value)||(_.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Q(!1);let I=null;function R(){if(i.turns.length===0)return;const Y=[];for(const le of i.turns){if(le.role==="compaction"||le.role==="cron")continue;const He=le.role==="user"?"User":"Assistant",de=rW(le);de.trim()&&Y.push(`**${He}**
|
|
286
|
-
|
|
287
|
-
${de}`)}const J=Y.join(`
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
`);oo(J).then(le=>{le&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}function B(Y){const J=[];for(let le=Y;le>=0;le--){const He=i.turns[le];if(!He||He.role!=="assistant")break;J.unshift(He)}return J}function P(Y){return B(Y).map(J=>iW(J)).filter(Boolean).join(`
|
|
292
|
-
|
|
293
|
-
`)}function z(){for(let Y=i.turns.length-1;Y>=0;Y-=1)if(i.turns[Y]?.role==="assistant")return P(Y);return""}function W(){const Y=z();Y.trim()&&oo(Y).then(J=>{J&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:R,copyFinalSummary:W});function X(Y){const J=i.turns[Y];if(!J||J.role!=="assistant")return!1;const le=i.turns[Y+1];return!le||le.role!=="assistant"}let U=null;function Z(Y){const J=i.turns[Y];if(!J)return;const le=P(Y);le.trim()&&oo(le).then(He=>{He&&($.value=J.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function ce(Y){const J=Y.text;J.trim()&&oo(J).then(le=>{le&&($.value=Y.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function fe(Y){return{kind:"image",url:Y.url,path:Y.alt,fileId:Y.fileId}}function se(Y,J){return Y.id!==c.value?!1:J.sourceIndex===gm(Y).length-1}return(Y,J)=>(b(),T("div",One,[e.sessionLoading?(b(),T("div",Rne,[ie(Ho,{size:"sm"}),w("span",Bne,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(b(),T("div",Dne)):re("",!0),e.hasMoreMessages||e.loadingMore?(b(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Pe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(b(),T("span",Pne,[ie(Ho,{size:"sm"}),Qe(" "+O(C(s)("conversation.loadingOlder")),1)])):(b(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:J[0]||(J[0]=le=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):re("",!0),(b(!0),T(Be,null,st(e.turns,(le,He)=>(b(),T(Be,{key:le.id},[le.role==="user"?(b(),T("div",Hne,[w("div",{class:Pe(["u-bub turn-anchor",{undoing:_.value===le.id}]),"data-turn-id":le.id},[le.images&&le.images.length>0?(b(),T("div",zne,[(b(!0),T(Be,null,st(le.images,(de,G)=>(b(),T(Be,{key:G},[de.kind==="video"?(b(),be(cg,{key:0,url:de.url,kind:"video","file-id":de.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(b(),T("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:ae=>d("openMedia",fe(de))},[ie(cg,{url:de.url,kind:"image",alt:de.alt,"file-id":de.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,Une))],64))),128))])):re("",!0),le.skillActivation?(b(),T("div",qne,[w("div",jne,[J[9]||(J[9]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,O(C(s)("conversation.activatedSkill",{name:le.skillActivation.name})),1)]),le.skillActivation.args?(b(),T("div",Vne,O(le.skillActivation.args),1)):re("",!0)])):le.pluginCommand?(b(),T("div",Kne,[w("div",Gne,[J[10]||(J[10]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,"/"+O(le.pluginCommand.pluginId)+":"+O(le.pluginCommand.commandName),1)]),le.pluginCommand.args?(b(),T("div",Yne,O(le.pluginCommand.args),1)):re("",!0)])):(b(),T("div",Zne,O(le.text),1))],10,Wne),le.createdAt||A(le)?(b(),T("div",Qne,[A(le)?(b(),T("div",{key:0,class:Pe(["u-edit-wrap",{undoing:_.value===le.id}])},[w("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:de=>N(le)},[ie(qe,{name:"undo",size:"sm"})],8,Xne)],2)):re("",!0),le.text.trim().length>0?(b(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:xt(de=>ce(le),["stop"])},[$.value!==le.id?(b(),be(qe,{key:0,name:"copy",size:"sm"})):(b(),be(qe,{key:1,name:"check",size:"sm"}))],8,Jne)):re("",!0),le.createdAt?(b(),be(s5,{key:2,time:le.createdAt},null,8,["time"])):re("",!0)])):re("",!0)])):le.role==="compaction"?(b(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":le.id,role:"separator"},[J[11]||(J[11]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1)),le.text?(b(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:de=>d("openCompaction",{turnId:le.id})},[w("span",null,O(L(le)),1),w("span",nse,O(C(s)("conversation.viewSummary")),1)],8,tse)):(b(),T("span",sse,O(L(le)),1)),J[12]||(J[12]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,ese)):le.role==="cron"?(b(),be(mte,{key:2,text:le.text,cron:le.cron,"turn-id":le.id,"created-at":le.createdAt},null,8,["text","cron","turn-id","created-at"])):(b(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":le.id},[(b(!0),T(Be,null,st(C(oW)(le),(de,G)=>(b(),T(Be,{key:C(lW)(de,G)},[de.kind==="thinking"?(b(),be(Gee,{key:0,text:de.thinking,mobile:"",streaming:se(le,de),onOpen:ae=>d("openThinking",{turnId:le.id,blockIndex:de.sourceIndex})},null,8,["text","streaming","onOpen"])):de.kind==="text"&&de.text?(b(),T("div",ise,[ie(Rm,{text:de.text,streaming:se(le,de),"open-file":ae=>d("openFile",ae)},null,8,["text","streaming","open-file"])])):de.kind==="tool-stack"?(b(),be(pW,{key:2,tools:de.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:J[1]||(J[1]=ae=>d("openMedia",ae)),onOpenFile:J[2]||(J[2]=ae=>d("openFile",ae)),onOpenToolDiff:J[3]||(J[3]=ae=>d("openToolDiff",ae)),onOpenAgent:J[4]||(J[4]=ae=>d("openAgent",ae))},null,8,["tools","tool-diff-panel"])):de.kind==="tool"?(b(),be(xA,{key:3,tool:de.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:J[5]||(J[5]=ae=>d("openMedia",ae)),onOpenFile:J[6]||(J[6]=ae=>d("openFile",ae)),onOpenToolDiff:J[7]||(J[7]=ae=>d("openToolDiff",ae)),onOpenAgent:J[8]||(J[8]=ae=>d("openAgent",ae))},null,8,["tool","tool-diff-panel"])):re("",!0)],64))),128)),le.id!==c.value&&X(He)&&(P(He).trim().length>0||le.durationMs!==void 0)?(b(),T("div",rse,[ie(Zt,{text:`${le.durationMs} ms`},{default:Me(()=>[le.durationMs!==void 0?(b(),T("span",lse,O(C(tW)(le.durationMs)),1)):re("",!0)]),_:2},1032,["text"]),P(He).trim().length>0?(b(),T("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:de=>Z(He)},[$.value!==le.id?(b(),be(qe,{key:0,name:"copy",size:"sm"})):(b(),be(qe,{key:1,name:"check",size:"sm"}))],8,ase)):re("",!0)])):re("",!0)],8,ose))],64))),128)),e.compaction?(b(),be(Jee,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(b(),T("div",cse,[ie(m5,{fast:e.fastMoon},null,8,["fast"])])):re("",!0),e.queued.length>0?(b(),T("div",use,[w("div",dse,[w("span",fse,[ie(qe,{name:"mail",size:"sm"}),Qe(" "+O(C(s)("composer.queueLabel"))+" · ",1),w("b",null,O(e.queued.length),1)]),w("span",hse,O(C(s)("composer.queueAutoDrain")),1)]),(b(!0),T(Be,null,st(e.queued,(le,He)=>(b(),T("div",{key:He,class:Pe(["u-turn q-turn",{"q-dragging":f.value===He,"drop-before":h.value?.index===He&&h.value.position==="before","drop-after":h.value?.index===He&&h.value.position==="after"}]),onDragover:de=>k(He,de),onDrop:de=>g(He,de)},[w("div",mse,[w("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:de=>x(He,de),onDragend:v},[ie(qe,{name:"grip",size:"sm"})],40,gse),w("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:de=>m(He)},[le.text?(b(),T("span",yse,O(le.text),1)):(b(),T("span",kse,[ie(qe,{name:"image",size:"sm"}),Qe(" "+O(C(s)("composer.queuedImageOnly",{n:le.attachments?.length??0})),1)]))],8,vse),p(le)?(b(),T("div",bse,[(b(!0),T(Be,null,st(le.attachments,(de,G)=>(b(),be(cg,{key:G,url:de.url,kind:de.kind,"file-id":de.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):re("",!0),He===0?(b(),T("span",xse,O(C(s)("composer.queueNext")),1)):(b(),T("span",_se,"#"+O(He+1),1)),w("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:xt(de=>d("unqueue",He),["stop"])},[ie(qe,{name:"close",size:"sm"})],8,wse)])],42,pse))),128))])):re("",!0)]))}}),g5=dt(Cse,[["__scopeId","data-v-a8f7c9a5"]]),Ase={class:"ch-id"},Mse={key:0,class:"ch-ws"},Ese={key:1,class:"ch-sep"},Tse=["onKeydown"],Nse={class:"ch-ses"},Ise={key:0,class:"ch-pill ch-sync-pill"},$se={key:0,class:"ch-ahead"},Lse={key:1,class:"ch-behind"},Fse={key:1,class:"ch-pill ch-diff-pill"},Ose={key:0,class:"ch-add"},Rse={key:1,class:"ch-del"},Bse=Ge({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=zr(),o=e,i=t,r=D(()=>o.ahead??0),l=D(()=>o.behind??0),a=D(()=>o.gitDiffStats?.totalAdditions??0),c=D(()=>o.gitDiffStats?.totalDeletions??0),u=D(()=>a.value>0||c.value>0),d={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function f(U){return U.trim().toLowerCase().replaceAll("_","-")}function h(U){const Z=f(U);return d[Z]?`pr-${Z}`:"pr-unknown"}function p(U){return n(d[f(U)]??"header.prStatusUnknown")}const m=Q(!1),x=Q(null),k=Q(null),g=Q({});function v(U){const Z=U.target;k.value?.el?.contains(Z)||x.value?.el?.contains(Z)||L()}function y(){L()}async function A(U){if(U.stopPropagation(),m.value){L();return}m.value=!0,document.addEventListener("mousedown",v),window.addEventListener("resize",y),await gt();const Z=x.value?.el,ce=k.value?.el;if(!Z||!ce)return;const fe=Z.getBoundingClientRect(),se=4,Y=8,J=ce.offsetWidth,le=ce.offsetHeight;let He=fe.bottom+se;He+le>window.innerHeight-Y&&(He=Math.max(Y,fe.top-le-se));let de=fe.left;de+J>window.innerWidth-Y&&(de=Math.max(Y,fe.right-J)),g.value={top:`${Math.round(He)}px`,left:`${Math.round(de)}px`}}function L(){m.value=!1,document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)}_n(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)});function $(){i("copyAll"),L()}function _(){i("copyFinalSummary"),L()}const E=Q(!1);function N(){o.sessionId&&oo(o.sessionId).then(U=>{U&&(E.value=!0,setTimeout(()=>{E.value=!1},1200))})}const F=Q(!1),S=Q(""),I=Q(null);async function R(){if(L(),!!o.sessionId){F.value=!0,S.value=o.sessionTitle??"",await gt();try{I.value?.focus(),I.value?.select()}catch{}}}function B(){const U=S.value.trim();U&&o.sessionId&&U!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,U),F.value=!1}function P(){F.value=!1}function z(){o.sessionId&&(L(),i("forkSession",o.sessionId))}function W(){o.sessionId&&(L(),i("exportSession",o.sessionId))}async function X(){o.sessionId&&(L(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(U,Z)=>(b(),T("header",{class:Pe(["chat-header",{"macos-desktop":C(Fc)}])},[w("div",Ase,[e.workspaceName?(b(),T("span",Mse,O(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(b(),T("span",Ese,"/")):re("",!0),F.value?Rn((b(),T("input",{key:2,ref_key:"renameInputRef",ref:I,"onUpdate:modelValue":Z[0]||(Z[0]=ce=>S.value=ce),class:"ch-rename",type:"text",onKeydown:[Ji(xt(B,["stop"]),["enter"]),Ji(xt(P,["stop"]),["esc"])],onBlur:B,onClick:Z[1]||(Z[1]=xt(()=>{},["stop"]))},null,40,Tse)),[[wo,S.value]]):e.sessionTitle?(b(),be(Zt,{key:3,text:e.sessionTitle},{default:Me(()=>[w("span",Nse,O(e.sessionTitle),1)]),_:1},8,["text"])):re("",!0)]),ie(Wn,{ref_key:"kebabRef",ref:x,class:Pe(["ch-act-more",{open:m.value}]),label:C(n)("header.options"),"aria-expanded":m.value,"aria-haspopup":"menu",onClick:Z[2]||(Z[2]=xt(ce=>A(ce),["stop"]))},{default:Me(()=>[ie(qe,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),m.value?(b(),be(vl,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:Yt(g.value),onClick:Z[3]||(Z[3]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{onClick:$},{default:Me(()=>[ie(qe,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Qe(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie(pn,{onClick:_},{default:Me(()=>[ie(qe,{name:"file-text",size:"sm"}),Qe(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(b(),T(Be,{key:0},[ie(pn,{separator:""}),ie(pn,{onClick:N},{default:Me(()=>[ie(qe,{name:E.value?"check":"copy",size:"sm"},null,8,["name"]),Qe(" "+O(E.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie(pn,{onClick:R},{default:Me(()=>[ie(qe,{name:"pencil",size:"sm"}),Qe(" "+O(C(n)("header.renameSession")),1)]),_:1}),ie(pn,{onClick:z},{default:Me(()=>[ie(qe,{name:"git-fork",size:"sm"}),Qe(" "+O(C(n)("header.forkSession")),1)]),_:1}),ie(pn,{onClick:W},{default:Me(()=>[ie(qe,{name:"download",size:"sm"}),Qe(" "+O(C(n)("header.exportSession")),1)]),_:1}),ie(pn,{danger:"",onClick:X},{default:Me(()=>[ie(qe,{name:"archive",size:"sm"}),Qe(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):re("",!0)]),_:1},8,["style"])):re("",!0),Z[6]||(Z[6]=w("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(b(),T("button",{key:1,type:"button",class:"ch-git",onClick:Z[4]||(Z[4]=ce=>i("openChanges"))},[w("span",{class:Pe(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),r.value>0||l.value>0?(b(),T("span",Ise,[r.value>0?(b(),T("span",$se,"↑"+O(r.value),1)):re("",!0),l.value>0?(b(),T("span",Lse,"↓"+O(l.value),1)):re("",!0)])):re("",!0),u.value?(b(),T("span",Fse,[a.value>0?(b(),T("span",Ose,"+"+O(a.value),1)):re("",!0),c.value>0?(b(),T("span",Rse,"-"+O(c.value),1)):re("",!0)])):re("",!0)])):re("",!0),e.pr?(b(),T("button",{key:2,type:"button",class:Pe(["ch-pill ch-pr",h(e.pr.state)]),onClick:Z[5]||(Z[5]=ce=>e.pr&&i("openPr",e.pr.url))},[ie(qe,{name:"git-pull-request",size:"sm"}),w("span",null,"PR #"+O(e.pr.number)+" · "+O(p(e.pr.state)),1)],2)):re("",!0)],2))}}),Dse=dt(Bse,[["__scopeId","data-v-59cdb23e"]]),Pse=["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"],CC=[[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 Hse(e){if(e<=255)return Pse[e];let t=0,n=CC.length-1;for(;t<=n;){const s=t+n>>1,o=CC[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function Wse(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=Hse(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 zse(e,t){const n=Wse(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 Use=/[ \t\n\r\f]+/g,qse=/[\t\n\r\f]| {2,}|^ | $/;function jse(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Vse(e){if(!qse.test(e))return e;let t=e.replace(Use," ");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 Kse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
294
|
-
`).replace(/[\r\f]/g,`
|
|
295
|
-
`):e}let ug=null,Gse;function Yse(){return ug===null&&(ug=new Intl.Segmenter(Gse,{granularity:"word"})),ug}const Zse=/\p{Script=Arabic}/u,Hl=/\p{M}/u,Tk=/\p{Nd}/u;function AC(e){return Zse.test(e)}function MC(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function nr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){const o=(n-55296<<10)+(s-56320)+65536;if(MC(o))return!0;t++;continue}}if(MC(n))return!0}}return!1}function Qse(e){const t=Zd(e);return t!==null&&(Nk.has(t)||Ca.has(t))}const Xse=new Set([" "," ","","\uFEFF"]),Jse=new Set(["-","‐","–","—"]);function eoe(e){const t=Zd(e);return t!==null&&Xse.has(t)}function toe(e){const t=Zd(e);return t!==null&&Jse.has(t)}function v5(e,t){return eoe(e)?!1:t?!(Qse(e)||toe(e)):!0}const Nk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Bm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ik=new Set(["'","’"]),Ca=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),noe=new Set([":",".","،","؛"]),soe=new Set(["၏"]),ooe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function ioe(e){if($k(e))return!0;let t=!1;for(const n of e){if(Ca.has(n)||Pm(n)){t=!0;continue}if(!(t&&Hl.test(n)))return!1}return t}function roe(e){for(const t of e)if(!Nk.has(t)&&!Ca.has(t))return!1;return e.length>0}function loe(e){if($k(e))return!0;for(const t of e)if(!Bm.has(t)&&!Ik.has(t)&&!Hl.test(t)&&!Pm(t))return!1;return e.length>0}function $k(e){let t=!1;for(const n of e)if(!(n==="\\"||Hl.test(n))){if(Bm.has(n)||Ca.has(n)||Ik.has(n)){t=!0;continue}return!1}return t}function Dm(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=Dm(e,e.length);return e.slice(t)}function aoe(e){for(const t of e)if(!Hl.test(t))return t;return null}function coe(e){for(let t=e.length;t>0;){const n=Dm(e,t),s=e.slice(n,t);if(!Hl.test(s))return s;t=n}return null}const uoe=[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 doe(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Pm(e){const t=e.codePointAt(0);return t!==void 0&&doe(t,uoe)}function foe(e){const t=coe(e);return t!==null&&Pm(t)}function hoe(e){const t=aoe(e);return t!==null&&Tk.test(t)}function poe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Hl.test(s)){n--;continue}if(Bm.has(s)||Ik.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function moe(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function EC(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 TC(e,t){return e&&t!==null&&noe.has(t)}function goe(e){const t=Zd(e);return t!==null&&soe.has(t)}function voe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function qv(e){let t=e.length;for(;t>0;){const n=Dm(e,t),s=e.slice(n,t);if(ooe.has(s))return!0;if(!Ca.has(s))return!1;t=n}return!1}function yoe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
296
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const koe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Oi(e){return e.length===1?e[0]:e.join("")}function boe(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Oi(n)}function xoe(e,t,n,s){if(!koe.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=yoe(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:Oi(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:Oi(r),isWordLike:a,kind:i,start:l}),o}function jv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const _oe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function woe(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:_oe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Soe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Coe(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"||!woe(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!jv(s[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(s[a]="text",t[a]="",a++,c)break}t[r]=Oi(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 Aoe(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]),!Soe(r))continue;const l=i+1;if(l>=e.len||jv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!jv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Oi(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 Moe=new Set([":","-","/","×",",",".","+","–","—"]),Eoe=/[\p{P}\p{S}\p{Co}]/u,Toe=/\p{Emoji_Presentation}/u,Noe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function Ioe(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function y5(e){const t=e.charCodeAt(0);return t<128?Ioe(t):!Noe.has(e)&&!Toe.test(e)&&Eoe.test(e)}function NC(e){let t=!1;for(const n of e)if(!Hl.test(n)){if(!y5(n))return!1;t=!0}return t}function $oe(e){for(let t=e.length;t>0;){const n=Dm(e,t),s=e.slice(n,t);if(Hl.test(s)){t=n;continue}return y5(s)||Pm(s)}return!1}function Loe(e,t,n,s){const o=!t&&NC(e),i=!s&&NC(n),r=foe(e),l=(t||r)&&$oe(e);return!o&&!i&&!l||nr(e)||nr(n)?!1:(t||o||r)&&(s||i)}function k5(e){for(const t of e)if(Tk.test(t))return!0;return!1}function Np(e){if(e.length===0)return!1;for(const t of e)if(!(Tk.test(t)||Moe.has(t)))return!1;return!0}function Foe(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"&&Np(r)&&k5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Np(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Oi(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 Ooe(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"&&Loe(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(Oi(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 Roe(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||!k5(u)||!Np(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 Boe(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=Oi(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=Oi(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(Oi(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Doe(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!nr(t[i])||!nr(t[i+1]))continue;const r=poe(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 Poe(e,t,n){const s=Yse();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],x=[];for(const L of s.segment(e))for(const $ of xoe(L.segment,L.isWordLike??!1,L.index,n)){let P=function(){u[B]!==null&&(r[B]=[EC(i,u,d,B)],u[B]=null),r[B].push($.text),l[B]=l[B]||$.isWordLike,f[B]=f[B]||N,h[B]=h[B]||F,p[B]=I,m[B]=R,x[B]=TC(h[B],S)};const _=$.kind==="text",E=moe($.text,$.isWordLike,$.kind),N=nr($.text),F=AC($.text),S=Zd($.text),I=qv($.text),R=goe($.text),B=o-1;t.carryCJKAfterClosingQuote&&_&&o>0&&a[B]==="text"&&N&&f[B]&&p[B]||_&&o>0&&a[B]==="text"&&roe($.text)&&f[B]||_&&o>0&&a[B]==="text"&&m[B]?P():_&&o>0&&a[B]==="text"&&$.isWordLike&&F&&x[B]?(P(),l[B]=!0):E!==null&&o>0&&a[B]==="text"&&u[B]===E?d[B]=(d[B]??1)+1:_&&!$.isWordLike&&o>0&&a[B]==="text"&&!f[B]&&(ioe($.text)||$.text==="-"&&l[B])?P():(i[o]=$.text,r[o]=[$.text],l[o]=$.isWordLike,a[o]=$.kind,c[o]=$.start,u[o]=E,d[o]=E===null?0:1,f[o]=N,h[o]=F,p[o]=I,m[o]=R,x[o]=TC(F,S),o++)}for(let L=0;L<o;L++){if(u[L]!==null){i[L]=EC(i,u,d,L);continue}i[L]=Oi(r[L])}for(let L=1;L<o;L++)a[L]==="text"&&!l[L]&&$k(i[L])&&a[L-1]==="text"&&!f[L-1]&&(i[L-1]+=i[L],l[L-1]=l[L-1]||l[L],i[L]="");const k=Array.from({length:o},()=>null);let g=-1;for(let L=o-1;L>=0;L--){const $=i[L];if($.length!==0){if(a[L]==="text"&&!l[L]&&g>=0&&a[g]==="text"&&(loe($)||$==="-"&&hoe(i[g]))){const _=k[g]??[];_.push($),k[g]=_,c[g]=c[L],i[L]="";continue}g=L}}for(let L=0;L<o;L++){const $=k[L];$!=null&&(i[L]=boe($,i[L]))}let v=0;for(let L=0;L<o;L++){const $=i[L];$.length!==0&&(v!==L&&(i[v]=$,l[v]=l[L],a[v]=a[L],c[v]=c[L]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const y=Boe({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=Doe(Ooe(Roe(Foe(Aoe(Coe(y))))));for(let L=0;L<A.len-1;L++){const $=voe(A.texts[L]);$!==null&&(A.kinds[L]!=="space"&&A.kinds[L]!=="preserved-space"||A.kinds[L+1]!=="text"||!AC(A.texts[L+1])||(A.texts[L]=$.space,A.isWordLike[L]=!1,A.kinds[L]=A.kinds[L]==="preserved-space"?"preserved-space":"space",A.texts[L+1]=$.marks+A.texts[L+1],A.starts[L+1]=A.starts[L]+$.space.length))}return A}function Hoe(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 Woe(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],x=h<t.len?t.starts[h]:e.length;s.push(e.slice(m,x)),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&&!v5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||nr(h);continue}d(f),s.push(h),o.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function zoe(e,t,n="normal",s="normal"){const o=jse(n),i=o.mode==="pre-wrap"?Kse(e):Vse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=Poe(i,t,o),l=s==="keep-all"?Woe(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:Hoe(l,o),...l}}let lc=null;const IC=new Map;let ac=null;const Uoe=96,qoe=/\p{Emoji_Presentation}/u,joe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let dg=null;const $C=new Map;function Lk(){if(lc!==null)return lc;if(typeof OffscreenCanvas<"u")return lc=new OffscreenCanvas(1,1).getContext("2d"),lc;if(typeof document<"u")return lc=document.createElement("canvas").getContext("2d"),lc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Voe(e){let t=IC.get(e);return t||(t=new Map,IC.set(e,t)),t}function bl(e,t){let n=t.get(e);return n===void 0&&(n={width:Lk().measureText(e).width,containsCJK:nr(e)},t.set(e,n)),n}function Hm(){if(ac!==null)return ac;if(typeof navigator>"u")return ac={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ac;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 ac={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},ac}function Koe(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function b5(){return dg===null&&(dg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),dg}function Goe(e){return qoe.test(e)||e.includes("️")}function Yoe(e){return joe.test(e)}function Zoe(e,t){let n=$C.get(e);if(n!==void 0)return n;const s=Lk();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 $C.set(e,n),n}function Qoe(e){let t=0;const n=b5();for(const s of n.segment(e))Goe(s.segment)&&t++;return t}function Xoe(e,t){return t.emojiCount===void 0&&(t.emojiCount=Qoe(e)),t.emojiCount}function pa(e,t,n){return n===0?t.width:t.width-Xoe(e,t)*n}function Joe(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=b5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const u=[];for(const d of r){const f=bl(d,n);u.push(pa(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>Uoe){const u=[];let d=null,f=0;for(const h of r){const p=bl(h,n),m=pa(h,p,s);if(d===null)u.push(m);else{const x=d+h,k=bl(x,n);u.push(pa(x,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=bl(a,n),f=pa(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function eie(e,t){const n=Lk();n.font=e;const s=Voe(e),o=Koe(e),i=t?Zoe(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function tie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function x5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function _5(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!tie(s))break;t++}return t}function nie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function sie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Fk(e,t){return t===0?0:e+t}function oie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function iie(e,t,n,s,o){const i=t==="tab"?o+oie(e,n):e.lineEndFitAdvances[n];return Fk(s,i)}function LC(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return Fk(s,o)}function FC(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return Fk(s,i)}function rie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function lie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ip(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function aie(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 cie(e,t,n,s,o,i){return t+aie(e,n,s,o,i)}function uie(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=Hm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,x=0,k=-1,g=0;function v(){k=-1,g=0}function y(N=m,F=x,S=d){u++,n?.(S,h,p,N,F),d=0,f=!1,v()}function A(N,F){f=!0,h=N,p=0,m=N+1,x=0,d=F}function L(N,F,S){f=!0,h=N,p=F,m=N,x=F+1,d=S}function $(N,F){if(!f){A(N,F);return}d+=F,m=N+1,x=0}function _(N,F){const S=i[N],I=r[N]??null;let R=I===null?-1:Ip(I,0,F+1),B=-1,P=0,z=F;for(;z<S.length;){const W=S[z];if(!f)L(N,z,W);else if(d+W>c){if(I!==null&&B>F){y(N,B,P),z=B,R=Ip(I,R,z+1),B=-1,P=0;continue}y(),L(N,z,W)}else d+=W,m=N,x=z+1;const X=z+1;I!==null&&I[R]===X&&(B=X,P=d,R++),z++}f&&m===N&&x===S.length&&(m=N+1,x=0)}let E=0;for(;E<s.length&&!(!f&&(E=_5(e,E),E>=s.length));){const N=s[E],F=o[E],S=x5(F);if(!f){N>c&&i[E]!==null?_(E,0):A(E,N),S&&(k=E+1,g=d-N),E++;continue}if(d+N>c){if(S){$(E,N),y(E+1,0,d-N),E++;continue}if(k>=0){if(m>k||m===k&&x>0){y();continue}y(k,0,g);continue}if(N>c&&i[E]!==null){y(),_(E,0),E++;continue}y();continue}$(E,N),S&&(k=E+1,g=d-N),E++}return f&&y(),u}function die(e,t,n){if(e.simpleLineWalkFastPath)return uie(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=Hm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,x=0,k=0,g=0,v=-1,y=0,A=0,L=null;function $(){v=-1,y=0,A=0,L=null}function _(){return L==="soft-hyphen"&&v===k&&g===0?A:h}function E(P=k,z=g,W){f++,n!==void 0&&n(cie(e,W??_(),m,x,P,z),m,x,P,z),h=0,p=!1,$()}function N(P,z){p=!0,m=P,x=0,k=P+1,g=0,h=z}function F(P,z,W){p=!0,m=P,x=z,k=P,g=z+1,h=W}function S(P,z){if(!p){N(P,z);return}h+=z,k=P+1,g=0}function I(P,z,W,X,U,Z){if(!z)return;const ce=LC(e,P,W,U),fe=FC(e,P,W,U,X);v=W+1,y=h-Z+ce,A=h-Z+fe,L=P}function R(P,z){const W=i[P],X=r[P]??null;let U=X===null?-1:Ip(X,0,z+1),Z=-1,ce=0,fe=z;for(;fe<W.length;){const se=W[fe];if(!p)F(P,fe,se);else{const J=rie(e,!0,se),le=h+J;if(lie(e,le)>d){if(X!==null&&Z>z){E(P,Z,ce),fe=Z,U=Ip(X,U,fe+1),Z=-1,ce=0;continue}E(),F(P,fe,se)}else h=le,k=P,g=fe+1}const Y=fe+1;X!==null&&X[U]===Y&&(Z=Y,ce=h,U++),fe++}p&&k===P&&g===W.length&&(k=P+1,g=0)}function B(P){f++,n?.(0,P.startSegmentIndex,0,P.consumedEndSegmentIndex,0),$()}for(let P=0;P<a.length;P++){const z=a[P];if(z.startSegmentIndex===z.endSegmentIndex){B(z);continue}p=!1,h=0,m=z.startSegmentIndex,x=0,k=z.startSegmentIndex,g=0,$();let W=z.startSegmentIndex;for(;W<z.endSegmentIndex&&!(!p&&(W=_5(e,W,z.endSegmentIndex),W>=z.endSegmentIndex));){const X=o[W],U=x5(X),Z=sie(e,p,W),ce=X==="tab"?nie(h+Z,e.tabStopAdvance):s[W],fe=Z+ce,se=iie(e,X,W,Z,ce);if(X==="soft-hyphen"){p&&(k=W+1,g=0,v=W+1,y=h+l,A=h+l,L=X),W++;continue}if(!p){se>d&&i[W]!==null?R(W,0):N(W,ce),I(X,U,W,ce,Z,fe),W++;continue}if(h+se>d){const J=h+LC(e,X,W,Z),le=h+FC(e,X,W,Z,ce);if(L==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&y<=d){E(v,0,A);continue}if(U&&J<=d){S(W,fe),E(W+1,0,le),W++;continue}if(v>=0&&y<=d){if(k>v||k===v&&g>0){E();continue}const He=v;E(He,0,A),W=He;continue}if(se>d&&i[W]!==null){E(),R(W,0),W++;continue}E();continue}S(W,fe),I(X,U,W,ce,Z,fe),W++}if(p){const X=v===z.consumedEndSegmentIndex?A:h;E(z.consumedEndSegmentIndex,0,X)}}return f}let fg=null;function Ok(){return fg===null&&(fg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fg}function fie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function hie(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=qv(d),l=Bm.has(d)}function u(d,f){s.push(d),i=i||f;const h=qv(d);d.length===1&&Ca.has(d)?r=r||h:r=h,l=!1}for(const d of Ok().segment(e)){const f=d.segment,h=nr(f);if(s.length===0){c(f,d.index,h);continue}if(l||Nk.has(f)||Ca.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 pie(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&&!v5(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||nr(c.text)}return l(t.length),s}function OC(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=Ok();for(const o of s.segment(e))n++;return n}function mie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function gie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of Ok().segment(e))n++,mie(s.segment)&&t.push(n);return t.length===0?null:t}function vie(e,t,n){return t>1?e+(t-1)*n:e}function yie(e,t,n,s,o){const i=Hm(),{cache:r,emojiCorrection:l}=eie(t,Yoe(e.normalized)),a=pa("-",bl("-",r),l)+(o===0?0:o*2),u=pa(" ",bl(" ",r),l)*8,d=o!==0;if(e.len===0)return fie();const f=[],h=[],p=[],m=[];let x=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],y=[],A=n?[]:null,L=Array.from({length:e.len});function $(F,S,I,R,B,P,z,W,X){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(x=!1),f.push(S),h.push(I),p.push(R),m.push(B),k?.push(P),g.push(z),v.push(W),d&&y.push(X),A!==null&&A.push(F)}function _(F,S,I,R,B){const P=bl(F,r),z=d?OC(F,S):0,W=vie(pa(F,P,l),z,o),X=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:W,U=X===0?0:X+(z>0?o:0),Z=S==="space"||S==="zero-width-break"?0:W;if(B&&R&&F.length>1){let ce="sum-graphemes";o!==0?ce="segment-prefixes":Np(F)?ce="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ce="segment-prefixes");const fe=Joe(F,P,r,l,ce),se=fe===null||s==="keep-all"?null:gie(F);$(F,W,U,Z,S,I,fe,se,z);return}$(F,W,U,Z,S,I,null,null,z)}for(let F=0;F<e.len;F++){L[F]=f.length;const S=e.texts[F],I=e.isWordLike[F],R=e.kinds[F],B=e.starts[F];if(R==="soft-hyphen"){$(S,0,a,a,R,B,null,null,0);continue}if(R==="hard-break"){$(S,0,0,0,R,B,null,null,0);continue}if(R==="tab"){$(S,0,0,0,R,B,null,null,d?OC(S,R):0);continue}const P=bl(S,r);if(R==="text"&&P.containsCJK){const z=hie(S,i),W=s==="keep-all"?pie(S,z,i.breakKeepAllAfterPunctuation):z;for(let X=0;X<W.length;X++){const U=W[X];_(U.text,"text",B+U.start,I,s==="keep-all"||!nr(U.text))}continue}_(S,R,B,I,!0)}const E=kie(e.chunks,L,f.length),N=k===null?null:zse(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:x,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:x,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function kie(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 bie(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=zoe(e,Hm(),s?.whiteSpace,o);return yie(r,t,n,o,i)}function xie(e,t,n){return bie(e,t,!0,n)}function _ie(e){let t=0;return die(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const wie={key:0,class:"slash-menu",role:"listbox"},Sie=["aria-selected","onMouseenter","onMousedown"],Cie={class:"slash-name"},Aie={class:"slash-desc"},Mie=Ge({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q([]);return Ze(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(b(),T("div",wie,[(b(!0),T(Be,null,st(e.items,(a,c)=>(b(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Pe(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:xt(u=>o("select",a),["prevent"])},[w("span",Cie,O(a.name),1),w("span",Aie,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Sie))),128))])):re("",!0)}}),Eie=dt(Mie,[["__scopeId","data-v-f60b70d9"]]),Tie={class:"mention-menu",role:"listbox"},Nie={key:0,class:"mention-state dim"},Iie={key:1,class:"mention-state dim"},$ie=["aria-selected","onMouseenter","onMousedown"],Lie=["innerHTML"],Fie={class:"mention-name"},Oie={class:"mention-path"},Rie=Ge({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=hc("folder","sm"),r=hc("code","sm"),l=hc("file-text","sm"),a=hc("image","sm"),c=hc("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 x=p.name||m.split("/").pop()||m,k=x.lastIndexOf("."),g=k>0?x.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(b(),T("div",Tie,[n.loading?(b(),T("div",Nie,O(C(o)("mention.searching")),1)):n.items.length===0?(b(),T("div",Iie,O(C(o)("mention.noMatch")),1)):(b(!0),T(Be,{key:2},st(n.items,(x,k)=>(b(),T("div",{key:x.path,class:Pe(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>s("hover",k),onMousedown:xt(g=>s("select",x),["prevent"])},[w("span",{class:"mention-icon",innerHTML:h(x),"aria-hidden":"true"},null,8,Lie),w("span",Fie,O(x.name),1),w("span",Oie,O(x.path),1)],42,$ie))),128))]))}}),Bie=dt(Rie,[["__scopeId","data-v-f4d6b958"]]),w5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function Die(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 $p="skill:";function Pie(e){return e.startsWith($p)?e.slice($p.length):e}function S5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${$p}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...w5,...t]}function Hie(e,t=w5){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 Qd(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 Rk(e){return e?.supportEfforts??[]}function Wie(e){return e[Math.floor(e.length/2)]}function Lp(e){if(Qd(e)==="unsupported")return"off";const t=Rk(e);return t.length>0?e?.defaultEffort??Wie(t):"on"}function Bk(e){const t=Rk(e),n=Qd(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Vv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function zie(e){return e!=="off"}function Fa(e,t){if(e===void 0)return t;const n=Qd(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?Lp(e):"off";const s=Rk(e);return s.length>0?s.includes(t)?t:Lp(e):"on"}function Dk(e,t){return t==="off"?"off":t==="on"?Lp(e):t}function Uie(e,t,n){return n&&t==="off"&&(e?.supportEfforts?.length??0)>0?Lp(e):Fa(e,t)}const Fp=100;function qie(e){const t=hm(Lt.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>Fp?n.slice(-Fp):n,o={[e]:s};return Ud(Lt.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function jie(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=Q(qie(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 y=i.value[g]??[];if(y.at(-1)===v)return;const A=[...y,v],L=A.length>Fp?A.slice(-Fp):A;i.value={...i.value,[g]:L},Ud(Lt.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,gt(()=>{const g=n.value;if(!g)return;s();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function h(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function x(){return r.value.length>0}return Ze(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:x}}function Vie(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Q(!1),c=Q([]),u=Q(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=Hie(h,S5(o())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,gt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),s()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function Kie(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=Q(!1),r=Q([]),l=Q(0),a=Q(!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 x=h.slice(m,p);return x.startsWith("@")?{token:x.slice(1),start:m,end:p}:null}function d(){const h=u(),p=o();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,gt(()=>{const x=n.value;if(!x)return;const k=p.start+h.path.length;x.setSelectionRange(k,k),x.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Gie(e){const{sessionId:t}=e;function n(c){return cs(Kx(c))??""}function s(c,u){const d=Kx(c);u?ms(d,u):Gc(d)}const o=Q(n(t())),i=Q(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ze(o,c=>{gt(r),s(t(),c)}),Ze(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),gt(r))});function l(c){o.value=c,gt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){s(t(),"")}return{text:o,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Yie(e){const{uploadImage:t,sessionId:n}=e,s=Q({}),o=D(()=>s.value[n()??""]??[]),i=Q(null),r=Q(null),l=Q(!1);let a=0;function c(){return`att_${++a}`}function u(F,S){s.value={...s.value,[F]:S}}function d(F){try{URL.revokeObjectURL(F.previewUrl)}catch{}}function f(F){return F.startsWith("image/")?"image":F.startsWith("video/")?"video":null}async function h(F){const S=t();if(!S)return;const I=n()??"",R=F.map(B=>({file:B,kind:f(B.type)})).filter(B=>B.kind!==null);if(R.length!==0)for(const{file:B,kind:P}of R){const z=c(),W=URL.createObjectURL(B),X={localId:z,name:B.name,kind:P,previewUrl:W,uploading:!0};u(I,[...s.value[I]??[],X]),S(B,B.name).then(U=>{const Z=s.value[I]??[];u(I,Z.map(ce=>ce.localId===z?{...ce,uploading:!1,fileId:U?.fileId,error:U===null}:ce))}).catch(()=>{const U=s.value[I]??[];u(I,U.map(Z=>Z.localId===z?{...Z,uploading:!1,error:!0}:Z))})}}function p(F){const S=n()??"",I=s.value[S]??[],R=I.find(B=>B.localId===F);i.value?.localId===F&&(i.value=null),R&&d(R),u(S,I.filter(B=>B.localId!==F))}function m(F){i.value=F}function x(){i.value=null}function k(){r.value?.click()}function g(F){const S=F.target,I=Array.from(S.files??[]);h(I),S.value=""}function v(F){if(!t())return;const S=F.clipboardData;if(!S)return;const I=[],R=new Set,B=(P,z)=>{const W=`${P.size}:${P.type}:${z}`;if(R.has(W))return;R.add(W);const X=P.type.split("/")[1]??"png",U=z.includes(".")?z:`paste-${Date.now()}.${X}`;I.push(P instanceof File?P:new File([P],U,{type:P.type}))};for(const P of Array.from(S.items))if(P.kind==="file"&&f(P.type)){const z=P.getAsFile();z&&B(z,z.name||`paste-${Date.now()}.${P.type.split("/")[1]??"png"}`)}for(const P of Array.from(S.files))f(P.type)&&B(P,P.name);I.length!==0&&(F.preventDefault(),h(I))}function y(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(I=>I.kind==="file")||(F.preventDefault(),l.value=!0)}function A(){l.value=!1}function L(F){if(l.value=!1,!t())return;F.preventDefault();const S=Array.from(F.dataTransfer?.files??[]);h(S)}function $(){const F=n()??"";for(const S of s.value[F]??[])d(S);u(F,[])}function _(F,S,I){const R=s.value[F]??[];R.some(B=>B.localId===S)&&u(F,R.map(B=>B.localId===S?{...B,...I}:B))}function E(F){return fetch(F).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function N(F){const S=n()??"";for(const I of s.value[S]??[])d(I);u(S,[]);for(const I of F){const R=c(),B=/^data:/i.test(I.url),P=/^blob:/i.test(I.url),z=I.name??I.kind;if(I.fileId){const W={localId:R,name:z,kind:I.kind,previewUrl:I.url,uploading:!1,fileId:I.fileId};u(S,[...s.value[S]??[],W]),!B&&!P&&pt().getFileBlob(I.fileId).then(X=>{const U=URL.createObjectURL(X);if(!(s.value[S]??[]).some(ce=>ce.localId===R)){URL.revokeObjectURL(U);return}_(S,R,{previewUrl:U})}).catch(()=>{})}else{const W=t();if(!W)continue;const X={localId:R,name:z,kind:I.kind,previewUrl:I.url,uploading:!0};u(S,[...s.value[S]??[],X]),E(I.url).then(U=>{const Z=z.includes(".")?z:`${z}.${U.type.split("/")[1]??"bin"}`;return W(U,Z)}).then(U=>{if(U===null){const Z=s.value[S]??[];u(S,Z.filter(ce=>ce.localId!==R));return}_(S,R,{uploading:!1,fileId:U.fileId})}).catch(()=>{const U=s.value[S]??[];u(S,U.filter(Z=>Z.localId!==R))})}}}return Ze(n,()=>{i.value=null}),gn(()=>{document.addEventListener("paste",v)}),_n(()=>{document.removeEventListener("paste",v);for(const F of Object.values(s.value))for(const S of F)d(S);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:x,openFilePicker:k,handleFileInputChange:g,handleDragOver:y,handleDragLeave:A,handleDrop:L,clearAfterSubmit:$,loadAttachments:N}}const Zie=["type","disabled"],Qie={class:"ui-button__content"},Xie=Ge({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(b(),T("button",{class:Pe(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(b(),be(Ho,{key:0,size:"sm",class:"ui-button__spinner"})):re("",!0),w("span",Qie,[Bn(t.$slots,"default",{},void 0,!0)])],10,Zie))}}),Dt=dt(Xie,[["__scopeId","data-v-e58393a8"]]),Jie={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},ere=["stroke-dasharray","stroke-dashoffset"],hg=7,tre=Ge({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*hg;return(s,o)=>(b(),T("svg",Jie,[w("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:hg,fill:"none","stroke-width":"2.5"}),w("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:hg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,ere)]))}}),nre=dt(tre,[["__scopeId","data-v-a364f1f1"]]),sre={key:0,class:"att-strip"},ore=["onClick"],ire=["src"],rre=["src","alt"],lre={key:2,class:"att-video-badge","aria-hidden":"true"},are={class:"att-name"},cre={class:"att-err-icon"},ure=["onClick"],dre={class:"att-lightbox-card"},fre=["src"],hre=["src","alt"],pre={class:"att-lightbox-name"},mre={class:"composer-card"},gre={class:"cin-wrap"},vre={class:"input-row"},yre=["placeholder","disabled"],kre=["aria-label"],bre={class:"toolbar-left"},xre=["onKeydown"],_re=["onClick"],wre={class:"pd-check"},Sre={class:"pd-info"},Cre={class:"pd-desc"},Are={class:"mode-label"},Mre={key:0,class:"mode-tag"},Ere={key:1,class:"mode-tag"},Tre={key:2,class:"mode-tag"},Nre={class:"mode-row-icon"},Ire={class:"mode-row-info"},$re={class:"mode-row-name"},Lre={class:"mode-row-desc"},Fre={class:"mode-row-icon"},Ore={class:"mode-row-info"},Rre={class:"mode-row-name"},Bre={class:"mode-row-desc"},Dre={class:"mode-row-icon"},Pre={class:"mode-row-info"},Hre={class:"mode-row-name"},Wre={class:"mode-row-desc"},zre={key:0,class:"mode-row-actions"},Ure={class:"toolbar-right"},qre=["aria-label"],jre={class:"ctx-num"},Vre=["onKeydown"],Kre={key:0,class:"think-suffix"},Gre=["aria-label"],Yre=["aria-label","disabled"],Zre={key:0,class:"md-section"},Qre=["onClick"],Xre={class:"md-check"},Jre={class:"md-name"},ele={class:"md-provider"},tle={key:1,class:"md-divider"},nle={key:2,class:"md-section"},sle=["onClick"],ole={class:"md-check"},ile={class:"md-name"},rle={key:3,class:"md-divider"},lle={class:"md-name"},ale={key:0,class:"md-note"},cle=["aria-label"],ule=["disabled","onClick"],dle={class:"md-name"},RC=36,fle=Ge({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=D(()=>s.starting?r("composer.starting"):s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Tt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Gie({sessionId:()=>s.sessionId}),h=Q(!1);function p(){h.value=!h.value,gt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,gt(u))}function x(Ke){if(typeof getComputedStyle>"u")return RC;const nt=Number.parseFloat(getComputedStyle(Ke).minHeight);return Number.isFinite(nt)&&nt>0?nt:RC}const k=Q(!1);function g(){const Ke=c.value;k.value=!!Ke&&Ke.scrollHeight>x(Ke)}Ze(a,()=>{gt(g)}),Ze(()=>s.sessionId,()=>{h.value=!1});const v=jie({text:a,textareaRef:c,autosize:u,sessionId:()=>s.sessionId}),{open:y,items:A,active:L,update:$,select:_}=Vie({text:a,textareaRef:c,autosize:u,skills:()=>s.skills,emitCommand:Ke=>i("command",Ke),historyPush:Ke=>v.push(Ke),clearDraft:f}),{open:E,items:N,active:F,loading:S,update:I,select:R}=Kie({text:a,textareaRef:c,autosize:u,searchFiles:()=>s.searchFiles});function B(){v.resetBrowsing(),$(),I()}const{attachments:P,previewAttachment:z,fileInputRef:W,isDragOver:X,removeAttachment:U,openAttachmentPreview:Z,closeAttachmentPreview:ce,openFilePicker:fe,handleFileInputChange:se,handleDragOver:Y,handleDragLeave:J,handleDrop:le,clearAfterSubmit:He,loadAttachments:de}=Yie({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});gn(()=>{a.value&>(()=>{u(),g()})}),_n(()=>{document.removeEventListener("mousedown",dn),ue()});function G(){c.value?.focus({preventScroll:!0})}function ae(Ke){de(Ke)}t({loadForEdit:d,loadAttachmentsForEdit:ae,focus:G});function me(){const Ke=a.value.trim();if(P.value.some(Rt=>Rt.uploading))return;const nt=P.value.filter(Rt=>!Rt.uploading&&!Rt.error&&Rt.fileId);if(!Ke&&nt.length===0)return;if(v.push(Ke),Ke){const Rt=Die(Ke),ve=Rt?S5(s.skills).some(xe=>xe.name===Rt.cmd||xe.name===`/${$p}${Rt.cmd.slice(1)}`):!1;if(Rt&&ve){a.value="",f(),y.value=!1,m(),i("command",Rt.arg?`${Rt.cmd} ${Rt.arg}`:Rt.cmd);return}}const ot={text:Ke,attachments:nt.map(Rt=>({fileId:Rt.fileId,kind:Rt.kind}))};z.value=null,He(),a.value="",f(),y.value=!1,E.value=!1,m(),i("submit",ot)}function q(){if(!s.running||P.value.some(Rt=>Rt.uploading))return;const Ke=a.value.trim(),nt=P.value.filter(Rt=>!Rt.uploading&&!Rt.error&&Rt.fileId);if(!Ke&&nt.length===0&&s.queued.length===0)return;const ot={text:Ke,attachments:nt.map(Rt=>({fileId:Rt.fileId,kind:Rt.kind}))};He(),v.push(Ke),a.value="",f(),y.value=!1,E.value=!1,m(),i("steer",ot)}let ne=!1,ge=null;function ue(){ge!==null&&(clearTimeout(ge),ge=null)}function ye(){ue(),ne=!0}function j(){ue(),ge=setTimeout(()=>{ge=null,ne=!1},0)}function te(Ke){return ne||Ke.isComposing||Ke.keyCode===229}function pe(Ke){if(!te(Ke)){if(Ke.key==="Escape"){if($e.value){Ke.preventDefault(),it();return}if(he.value){Ke.preventDefault(),bt();return}}if(y.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),L.value=(L.value+1)%A.value.length;return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),L.value=(L.value-1+A.value.length)%A.value.length;return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const nt=A.value[L.value];nt&&_(nt);return}if(Ke.key==="Escape"){Ke.preventDefault(),y.value=!1;return}}if(E.value&&!S.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const nt=N.value[F.value];nt&&R(nt);return}if(Ke.key==="Escape"){Ke.preventDefault(),E.value=!1;return}}if(Ke.key==="s"&&(Ke.ctrlKey||Ke.metaKey)&&!Ke.shiftKey&&!Ke.altKey){s.running&&(Ke.preventDefault(),q());return}if(!h.value&&!y.value&&!E.value&&!Ke.shiftKey&&!Ke.altKey&&!Ke.metaKey&&!Ke.ctrlKey){const nt=v.isBrowsing();if(Ke.key==="ArrowUp"&&v.hasHistory()&&(nt||v.caretAtTextStart())){Ke.preventDefault(),v.recallOlder();return}if(Ke.key==="ArrowDown"&&nt){Ke.preventDefault(),v.recallNewer();return}}if(Ke.key==="Enter"&&!Ke.shiftKey){if(h.value&&!(Ke.metaKey||Ke.ctrlKey))return;Ke.preventDefault(),me()}}}const Ce=D(()=>r("composer.send")),Ie=D(()=>!!s.uploadImage),$e=Q(!1),he=Q(!1),Ne=Q(null);function Je(){$e.value=!$e.value,$e.value?(he.value=!1,Ht(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function it(){$e.value=!1,he.value||document.removeEventListener("click",wt,!0)}function At(){he.value=!he.value,he.value?($e.value=!1,Ht(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function bt(){he.value=!1,$e.value||document.removeEventListener("click",wt,!0)}function wt(Ke){Ne.value&&!Ne.value.contains(Ke.target)&&(it(),bt())}_n(()=>{document.removeEventListener("click",wt,!0)});const Gt=Ke=>`${Math.round(Ke/1e3)}k`,vt=D(()=>{const Ke=s.status?.ctxMax??0;return Ke<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ke*100)))}),ln=D(()=>{const Ke=(s.status?.ctxUsed??0).toLocaleString(),nt=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ke,max:nt,pct:vt.value})}),Gn=D(()=>vt.value>=80),Un=D(()=>s.models?.find(Ke=>Ke.id===s.status?.modelId)),Vt=D(()=>Qd(Un.value)),an=D(()=>Bk(Un.value)),es=D(()=>Fa(Un.value,s.thinking??"off")),rt=D(()=>{const Ke=an.value,nt=es.value;return Ke.includes(nt)?nt:Ke.includes("on")?"on":Ke[0]??"off"}),In=D(()=>Vt.value==="always-on"?!0:Vt.value==="unsupported"?!1:zie(es.value)),gs=D(()=>Vt.value==="unsupported"||an.value.length<=1),yn=D(()=>{if(!In.value)return"";const Ke=(Un.value?.supportEfforts?.length??0)>0,nt=es.value;return Ke&&nt!=="on"?r("composer.thinkingSuffixEffort",{level:nt}):r("composer.thinkingSuffix")});function us(Ke){gs.value||i("setThinking",Dk(Un.value,Ke))}function ts(Ke){return Ke==="on"?r("status.thinkingOn"):Ke==="off"?r("status.thinkingOff"):Vv(Ke)}const kn=D(()=>s.planMode===!0),qn=D(()=>s.swarmMode===!0),$n=D(()=>s.goal?.status??s.activationBadges?.goal?.status??null),ds=D(()=>$n.value!==null&&$n.value!=="complete"),Fs=D(()=>ds.value||s.goalMode===!0),wn=D(()=>$n.value==="active"),As=D(()=>$n.value==="paused"||$n.value==="blocked"),zn=Q(!1),Pt=Q(null),Ye=Q(null),je=Q({}),Ot=D(()=>kn.value||qn.value||Fs.value);function Ht(){zn.value=!1,document.removeEventListener("mousedown",dn)}function dn(Ke){const nt=Ke.target;Pt.value?.contains(nt)||Ye.value?.contains(nt)||Ht()}function Qt(){if(zn.value){Ht();return}it(),bt();const Ke=Pt.value?.getBoundingClientRect();Ke&&(je.value={left:`${Math.round(Ke.left)}px`,bottom:`${Math.round(window.innerHeight-Ke.top+8)}px`}),zn.value=!0,setTimeout(()=>document.addEventListener("mousedown",dn),0)}const Sn=[{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"}],Cn=["status.planDesc","status.swarmDesc","status.goalDesc"],Nt=Q(null),fs=Q(""),ns=Q("");function ro(Ke){const nt={};return Ke&&(nt["--composer-menu-desc-width"]=Ke),nt}const Dn=D(()=>ro(fs.value)),ss=D(()=>ro(ns.value)),Ai=D(()=>({...je.value,...ss.value}));let Os=null;function si(Ke){const nt=Number.parseFloat(Ke);return Number.isFinite(nt)?nt:0}function So(Ke){return`${Ke.fontStyle||"normal"} ${Ke.fontWeight||"400"} ${Ke.fontSize} ${Ke.fontFamily}`}function Pi(Ke){return Ke.letterSpacing==="normal"?0:si(Ke.letterSpacing)}function oi(Ke,nt){if(!Ke)return 0;const ot=xie(Ke,So(nt),{letterSpacing:Pi(nt)});return _ie(ot)}function vs(){const Ke=Nt.value?.querySelector(".pd-desc");if(!Ke)return;const nt=getComputedStyle(Ke),ot=Math.max(0,...Sn.map(ve=>oi(r(ve.descKey),nt))),Rt=Math.max(0,...Cn.map(ve=>oi(r(ve),nt)));fs.value=ot>0?`${Math.ceil(ot)}px`:"",ns.value=Rt>0?`${Math.ceil(Rt)}px`:""}function Co(){typeof window>"u"||(Os!==null&&window.cancelAnimationFrame(Os),gt(()=>{Os=window.requestAnimationFrame(()=>{Os=null,vs()})}))}Ze(l,Co,{immediate:!0}),gn(()=>{Co(),document.fonts?.ready.then(Co)}),_n(()=>{Os!==null&&(window.cancelAnimationFrame(Os),Os=null)});function Hi(Ke){i("setPermission",Ke),bt()}const ii=D(()=>Sn.find(Ke=>Ke.mode===s.status?.permission)),Yn=D(()=>ii.value?r(ii.value.labelKey):""),Rs=D(()=>Un.value?.provider??""),ut=D(()=>!Rs.value||!s.models?.length?[]:s.models.filter(Ke=>Ke.provider===Rs.value)),ke=D(()=>new Set(s.starredIds??[]));function Fe(Ke){return ke.value.has(Ke)}const Ut=D(()=>s.models?.length?s.models.filter(Ke=>Fe(Ke.id)&&Ke.provider!==Rs.value):[]);function lo(Ke){i("selectModel",Ke),it()}return(Ke,nt)=>(b(),T("div",{class:Pe(["composer",{"drag-over":C(X),expanded:h.value}]),onDragover:nt[18]||(nt[18]=(...ot)=>C(Y)&&C(Y)(...ot)),onDragleave:nt[19]||(nt[19]=(...ot)=>C(J)&&C(J)(...ot)),onDrop:nt[20]||(nt[20]=(...ot)=>C(le)&&C(le)(...ot))},[C(P).length>0?(b(),T("div",sre,[(b(!0),T(Be,null,st(C(P),ot=>(b(),T("div",{key:ot.localId,class:Pe(["att-chip",{"att-error":ot.error}])},[ie(Zt,{text:C(r)("composer.previewAttachment",{name:ot.name})},{default:Me(()=>[w("button",{type:"button",class:"att-preview",onClick:Rt=>C(Z)(ot)},[ot.kind==="video"?(b(),T("video",{key:0,class:"att-thumb",src:ot.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,ire)):(b(),T("img",{key:1,class:"att-thumb",src:ot.previewUrl,alt:ot.name},null,8,rre)),ot.kind==="video"?(b(),T("span",lre,[ie(qe,{name:"play",size:"sm"})])):re("",!0)],8,ore)]),_:2},1032,["text"]),w("span",are,O(ot.name),1),ot.uploading?(b(),be(Ho,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):ot.error?(b(),be(Zt,{key:1,text:C(r)("composer.uploadFailed")},{default:Me(()=>[w("span",cre,[ie(qe,{name:"info",size:"sm"})])]),_:1},8,["text"])):re("",!0),ie(Zt,{text:C(r)("composer.removeNamed",{name:ot.name})},{default:Me(()=>[w("button",{class:"att-rm",onClick:Rt=>C(U)(ot.localId)},[ie(qe,{name:"close",size:"sm"})],8,ure)]),_:2},1032,["text"])],2))),128))])):re("",!0),C(z)?(b(),T("div",{key:1,class:"att-lightbox",onClick:nt[1]||(nt[1]=xt((...ot)=>C(ce)&&C(ce)(...ot),["self"]))},[w("div",dre,[ie(Zt,{text:C(r)("model.close")},{default:Me(()=>[w("button",{type:"button",class:"att-lightbox-close",onClick:nt[0]||(nt[0]=(...ot)=>C(ce)&&C(ce)(...ot))},"✕")]),_:1},8,["text"]),C(z).kind==="video"?(b(),T("video",{key:0,class:"att-lightbox-media",src:C(z).previewUrl,controls:"",playsinline:""},null,8,fre)):(b(),T("img",{key:1,class:"att-lightbox-media",src:C(z).previewUrl,alt:C(z).name},null,8,hre)),w("div",pre,O(C(z).name),1)])])):re("",!0),w("div",mre,[w("div",gre,[C(y)?(b(),be(Eie,{key:0,items:C(A),"active-index":C(L),onSelect:C(_),onHover:nt[2]||(nt[2]=ot=>L.value=ot)},null,8,["items","active-index","onSelect"])):re("",!0),C(E)?(b(),be(Bie,{key:1,items:C(N),"active-index":C(F),loading:C(S),onSelect:C(R),onHover:nt[3]||(nt[3]=ot=>F.value=ot)},null,8,["items","active-index","loading","onSelect"])):re("",!0),w("div",vre,[Rn(w("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":nt[4]||(nt[4]=ot=>hs(a)?a.value=ot:null),class:"ph",placeholder:o.value,disabled:e.starting,rows:"1",onKeydown:pe,onCompositionstart:ye,onCompositionend:j,onInput:B},null,40,yre),[[wo,C(a)]]),h.value||k.value?(b(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(b(),be(qe,{key:0,name:"collapse",size:"sm"})):(b(),be(qe,{key:1,name:"expand",size:"sm"}))],8,kre)):re("",!0)])]),Ie.value?(b(),T("input",{key:0,ref_key:"fileInputRef",ref:W,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:nt[5]||(nt[5]=(...ot)=>C(se)&&C(se)(...ot))},null,544)):re("",!0),w("div",{ref_key:"toolbarRef",ref:Ne,class:"toolbar"},[w("div",{ref_key:"menuMeasureRef",ref:Nt,class:"menu-measure","aria-hidden":"true"},[...nt[21]||(nt[21]=[w("span",{class:"pd-desc"},null,-1)])],512),w("div",bre,[Ie.value?(b(),be(Wn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(fe)},{default:Me(()=>[ie(qe,{name:"image"})]),_:1},8,["label","onClick"])):re("",!0),e.status?(b(),T("span",{key:1,class:Pe(["perm-pill",["perm-"+e.status.permission,{open:he.value}]]),role:"button",tabindex:"0",onClick:xt(At,["stop"]),onKeydown:[Ji(At,["enter"]),Ji(xt(At,["prevent"]),["space"])]},O(Yn.value),43,xre)):re("",!0),he.value&&e.status?(b(),T("div",{key:2,class:"perm-dropdown",style:Yt(Dn.value),role:"menu",onClick:nt[6]||(nt[6]=xt(()=>{},["stop"]))},[(b(),T(Be,null,st(Sn,ot=>w("button",{key:ot.mode,class:Pe(["pd-row",{"is-current":ot.mode===e.status.permission}]),role:"menuitem",onClick:Rt=>Hi(ot.mode)},[w("span",wre,[ot.mode===e.status.permission?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",Sre,[w("span",{class:"pd-name",style:Yt({color:ot.color})},O(C(r)(ot.labelKey)),5),w("span",Cre,O(C(r)(ot.descKey)),1)])],10,_re)),64))],4)):re("",!0),e.status?(b(),T("div",{key:3,ref_key:"modesRef",ref:Pt,class:"modes"},[w("button",{type:"button",class:Pe(["mode-pill",{on:Ot.value,open:zn.value}]),onClick:xt(Qt,["stop"])},[w("span",Are,O(C(r)("status.modesLabel")),1),kn.value?(b(),T("span",Mre,O(C(r)("status.planLabel")),1)):re("",!0),qn.value?(b(),T("span",Ere,O(C(r)("status.swarmLabel")),1)):re("",!0),Fs.value?(b(),T("span",Tre,O(C(r)("status.goalLabel")),1)):re("",!0)],2),zn.value?(b(),T("div",{key:0,ref_key:"modesMenuRef",ref:Ye,class:"modes-menu",style:Yt(Ai.value),role:"menu"},[w("button",{type:"button",class:Pe(["mode-row",{on:kn.value}]),role:"menuitem",onClick:nt[7]||(nt[7]=ot=>i("togglePlan"))},[w("span",Nre,[ie(qe,{name:"file-edit",size:"sm"})]),w("span",Ire,[w("span",$re,O(C(r)("status.planLabel")),1),w("span",Lre,O(C(r)("status.planDesc")),1)]),w("span",{class:Pe(["mode-switch",{on:kn.value}])},[...nt[22]||(nt[22]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("button",{type:"button",class:Pe(["mode-row",{on:qn.value}]),role:"menuitem",onClick:nt[8]||(nt[8]=ot=>i("toggleSwarm"))},[w("span",Fre,[ie(qe,{name:"sparkles",size:"sm"})]),w("span",Ore,[w("span",Rre,O(C(r)("status.swarmLabel")),1),w("span",Bre,O(C(r)("status.swarmDesc")),1)]),w("span",{class:Pe(["mode-switch",{on:qn.value}])},[...nt[23]||(nt[23]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("div",{class:Pe(["mode-row mode-row-goal",{on:ds.value||s.goalMode}])},[w("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:nt[9]||(nt[9]=ot=>ds.value?i("focusGoal"):i("toggleGoal"))},[w("span",Dre,[ie(qe,{name:"target",size:"sm"})]),w("span",Pre,[w("span",Hre,O(C(r)("status.goalLabel")),1),w("span",Wre,O(C(r)("status.goalDesc")),1)]),ds.value?re("",!0):(b(),T("span",{key:0,class:Pe(["mode-switch",{on:s.goalMode}])},[...nt[24]||(nt[24]=[w("span",{class:"mode-knob"},null,-1)])],2))]),ds.value?(b(),T("div",zre,[wn.value?(b(),be(Dt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:nt[10]||(nt[10]=ot=>i("controlGoal","pause"))},{default:Me(()=>[ie(qe,{name:"pause",size:"sm"}),w("span",null,O(C(r)("status.goalPause")),1)]),_:1})):re("",!0),As.value?(b(),be(Dt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:nt[11]||(nt[11]=ot=>i("controlGoal","resume"))},{default:Me(()=>[ie(qe,{name:"play",size:"sm"}),w("span",null,O(C(r)("status.goalResume")),1)]),_:1})):re("",!0),ie(Dt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:nt[12]||(nt[12]=ot=>i("controlGoal","cancel"))},{default:Me(()=>[ie(qe,{name:"close",size:"sm"}),w("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),w("div",Ure,[Gn.value?(b(),T("button",{key:0,class:"compact-chip",onClick:nt[13]||(nt[13]=xt(ot=>i("compact"),["stop"]))},"/compact")):re("",!0),ie(Zt,{text:ln.value},{default:Me(()=>[e.status&&!e.hideContext?(b(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":ln.value},[ie(nre,{pct:vt.value},null,8,["pct"]),w("span",jre,O(Gt(e.status.ctxUsed))+"/"+O(Gt(e.status.ctxMax)),1)],8,qre)):re("",!0)]),_:1},8,["text"]),e.status?(b(),T("span",{key:1,class:Pe(["model-pill",{open:$e.value}]),role:"button",tabindex:"0",onClick:xt(Je,["stop"]),onKeydown:[Ji(Je,["enter"]),Ji(xt(Je,["prevent"]),["space"])]},[w("b",null,O(e.status.model),1),yn.value?(b(),T("span",Kre,O(yn.value),1)):re("",!0),ie(qe,{class:"cv",name:"chevron-down",size:"sm"})],42,Vre)):re("",!0),e.running?(b(),be(Zt,{key:2,text:C(r)("composer.interruptTitle")},{default:Me(()=>[w("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:nt[14]||(nt[14]=ot=>i("interrupt"))},[ie(qe,{name:"stop",size:"sm"})],8,Gre)]),_:1},8,["text"])):re("",!0),w("button",{class:Pe(["send",{"is-starting":e.starting}]),"aria-label":Ce.value,disabled:e.starting,onClick:nt[15]||(nt[15]=ot=>me())},[e.starting?(b(),be(Ho,{key:0,size:"sm"})):(b(),be(qe,{key:1,name:"send",size:"sm"}))],10,Yre)]),$e.value&&e.status?(b(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:nt[17]||(nt[17]=xt(()=>{},["stop"]))},[Ut.value.length>0?(b(),T("div",Zre,O(C(r)("status.starredModels")),1)):re("",!0),(b(!0),T(Be,null,st(Ut.value,ot=>(b(),T("button",{key:ot.id,class:Pe(["md-row",{"is-current":ot.id===e.status.modelId}]),role:"menuitem",onClick:Rt=>lo(ot.id)},[w("span",Xre,[ot.id===e.status.modelId?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",Jre,O(ot.displayName??ot.model),1),w("span",ele,O(ot.provider),1),ie(qe,{class:"md-star",name:"star",size:"sm"})],10,Qre))),128)),Ut.value.length>0?(b(),T("div",tle)):re("",!0),ut.value.length>0?(b(),T("div",nle,O(Rs.value),1)):re("",!0),(b(!0),T(Be,null,st(ut.value,ot=>(b(),T("button",{key:ot.id,class:Pe(["md-row",{"is-current":ot.id===e.status.modelId}]),role:"menuitem",onClick:Rt=>lo(ot.id)},[w("span",ole,[ot.id===e.status.modelId?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",ile,O(ot.displayName??ot.model),1),Fe(ot.id)?(b(),be(qe,{key:0,class:"md-star",name:"star",size:"sm"})):re("",!0)],10,sle))),128)),ut.value.length>0?(b(),T("div",rle)):re("",!0),w("div",{class:Pe(["md-thinking",{"is-readonly":gs.value}])},[w("span",lle,O(C(r)("status.thinkingLabel")),1),Vt.value==="unsupported"?(b(),T("span",ale,O(C(r)("status.modeNotSupported")),1)):(b(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(b(!0),T(Be,null,st(an.value,ot=>(b(),T("button",{key:ot,type:"button",class:Pe(["effort-seg",{"is-active":ot===rt.value}]),disabled:gs.value,onClick:Rt=>us(ot)},O(ts(ot)),11,ule))),128))],8,cle))],2),nt[25]||(nt[25]=w("div",{class:"md-divider"},null,-1)),w("button",{class:"md-row md-row-more",role:"menuitem",onClick:nt[16]||(nt[16]=ot=>{it(),i("pickModel")})},[w("span",dle,O(C(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),C5=dt(fle,[["__scopeId","data-v-bd454ec5"]]),hle={key:0,class:"ui-card__head"},ple={class:"ui-card__body"},mle={key:1,class:"ui-card__foot"},gle=Ge({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(b(),T("div",hle,[Bn(t.$slots,"head",{},void 0,!0)])):re("",!0),w("div",ple,[Bn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(b(),T("div",mle,[Bn(t.$slots,"foot",{},void 0,!0)])):re("",!0)],2))}}),Pk=dt(gle,[["__scopeId","data-v-9c9f9a9a"]]),vle={class:"goal-kicker"},yle={key:0,class:"goal-progress","aria-hidden":"true"},kle={class:"goal-full"},ble={key:0,class:"goal-criterion"},xle=["inert","aria-hidden"],_le={class:"goal-meta"},wle={key:0},Sle={class:"goal-actions"},Cle=Ge({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),{confirm:i}=zr(),r=Q(!1);Ze(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=D(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return o("status.goalStatusActive");case"paused":return o("status.goalStatusPaused");case"blocked":return o("status.goalStatusBlocked");case"complete":return o("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:o("status.goalCancel"),message:o("status.goalCancelConfirm"),confirmLabel:o("status.goalCancelConfirmYes"),cancelLabel:o("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}return(d,f)=>(b(),be(Pk,{class:Pe(["goal-strip",{expanded:r.value}])},{head:Me(()=>[w("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[ie(qe,{class:"goal-icon",name:"target",size:"md"}),w("span",vle,O(C(o)("status.goalLabel")),1),w("span",{class:Pe(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),ie(Fo,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Me(()=>[Qe(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(b(),T("span",yle,[w("span",{class:"goal-progress-fill",style:Yt({width:`${l.value}%`})},null,4)])):re("",!0),ie(qe,{class:Pe(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Me(()=>[w("div",kle,O(e.goal.objective),1),e.goal.completionCriterion?(b(),T("div",ble,[f[3]||(f[3]=w("span",null,"Done when",-1)),w("p",null,O(e.goal.completionCriterion),1)])):re("",!0)]),foot:Me(()=>[w("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[w("div",_le,[w("span",null,O(e.goal.turnsUsed)+" turns",1),w("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),w("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(b(),T("span",wle,O(l.value)+"% token budget",1)):re("",!0)]),w("div",Sle,[e.goal.status==="active"?(b(),be(Dt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=xt(h=>s("controlGoal","pause"),["stop"]))},{default:Me(()=>[ie(qe,{name:"pause",size:"md"}),w("span",null,O(C(o)("status.goalPause")),1)]),_:1})):re("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(b(),be(Dt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=xt(h=>s("controlGoal","resume"),["stop"]))},{default:Me(()=>[ie(qe,{name:"play",size:"md"}),w("span",null,O(C(o)("status.goalResume")),1)]),_:1})):re("",!0),ie(Dt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:xt(u,["stop"])},{default:Me(()=>[ie(qe,{name:"close",size:"md"}),w("span",null,O(C(o)("status.goalCancel")),1)]),_:1})])],8,xle)]),_:1},8,["class"]))}}),Ale=dt(Cle,[["__scopeId","data-v-353c73e2"]]),Mle={class:"qh"},Ele={class:"qtitle"},Tle={key:0,class:"qstep"},Nle={key:1,class:"qmin-peek"},Ile={class:"qbody"},$le=["aria-label"],Lle=["aria-selected","aria-label","onClick"],Fle={class:"qstep-num"},Ole={key:1,class:"qheader-chip"},Rle={class:"qtext"},Ble={class:"qopts"},Dle=["onClick"],Ple={class:"qopt-key"},Hle={class:"qopt-glyph"},Wle={key:0,class:"chk"},zle={key:1,class:"rad"},Ule={class:"qopt-text"},qle={class:"qopt-label"},jle={key:0,class:"qopt-desc"},Vle={class:"qopt-glyph"},Kle={key:0,class:"chk"},Gle={key:1,class:"rad"},Yle={class:"qopt-label"},Zle=["placeholder"],Qle={class:"qfoot"},Xle=Ge({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Tt(),o=t,i=Q(0),r=Q(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(P){P>=0&&P<a.value&&(i.value=P)}function f(P){const z=p.value[P];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=Q({});function m(P){return P.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${P.label} ${P.description??""}`.toLowerCase())}function x(){const P={...p.value};let z=!1;for(const W of n.question.questions){if(P[W.id])continue;const X=W.options.filter(m);X.length!==0&&(P[W.id]=W.multiSelect?{kind:"multi",optionIds:X.map(U=>U.id)}:{kind:"single",optionId:X[0].id},z=!0)}z&&(p.value=P)}Ze(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Ze(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),x()},{immediate:!0,deep:!0});function k(P,z){const W=p.value[P];if(W&&W.kind==="single"&&W.optionId===z){const X={...p.value};delete X[P],p.value=X}else p.value={...p.value,[P]:{kind:"single",optionId:z}}}function g(P,z){const W=p.value[P],X=W&&(W.kind==="multi"||W.kind==="multiWithOther")?W.kind==="multi"?[...W.optionIds]:[...W.optionIds]:[],U=X.indexOf(z);U>=0?X.splice(U,1):X.push(z);const Z=p.value[P],ce=Z&&Z.kind==="multiWithOther"?Z.otherText:"";ce?p.value={...p.value,[P]:{kind:"multiWithOther",optionIds:X,otherText:ce}}:p.value={...p.value,[P]:{kind:"multi",optionIds:X}}}const v=Q({}),y=Q(null);function A(P){const z=n.question.questions.find(X=>X.id===P),W=v.value[P]??"";if(z.multiSelect){const X=p.value[P],U=X&&(X.kind==="multi"||X.kind==="multiWithOther")?X.kind==="multi"?[...X.optionIds]:[...X.optionIds]:[];p.value={...p.value,[P]:{kind:"multiWithOther",optionIds:U,otherText:W}}}else p.value={...p.value,[P]:{kind:"other",text:W}}}function L(P){A(P),gt(()=>y.value?.focus())}function $(P,z){const W=p.value[P];return W?W.kind==="single"?W.optionId===z:W.kind==="multi"||W.kind==="multiWithOther"?W.optionIds.includes(z):!1:!1}function _(P){const z=p.value[P];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function E(){return n.question.questions.every(P=>f(P.id))}const N=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function I(){if(S.value||!E())return;const P={answers:p.value,method:"click"};o("answer",n.question.questionId,P)}function R(){S.value||o("dismiss",n.question.questionId)}function B(P){const z=(document.activeElement?.tagName??"").toLowerCase(),W=z==="input"||z==="textarea";if(S.value)return;if(P.key==="Enter"){if(P.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():E()&&I();return}if(W)return;if(P.key==="Escape"){P.preventDefault(),R();return}if(r.value)return;const X=parseInt(P.key,10);if(!isNaN(X)&&X>=1&&X<=9){P.preventDefault();const U=l.value,Z=X-1,ce=U.options[Z];ce&&(U.multiSelect?g(U.id,ce.id):k(U.id,ce.id))}}return gn(()=>document.addEventListener("keydown",B)),_n(()=>document.removeEventListener("keydown",B)),(P,z)=>(b(),be(Pk,{class:Pe(["qcard",{minimized:r.value}])},j4({head:Me(()=>[w("div",Mle,[z[5]||(z[5]=w("span",{class:"qh-ic"},"?",-1)),w("span",Ele,O(C(s)("question.title")),1),a.value>1&&!r.value?(b(),T("span",Tle,O(C(s)("question.step",{current:i.value+1,total:a.value})),1)):re("",!0),r.value?(b(),T("span",Nle,O(l.value.question),1)):re("",!0),ie(Wn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:z[0]||(z[0]=W=>r.value=!r.value)},{default:Me(()=>[r.value?(b(),be(qe,{key:0,name:"chevron-down",size:"md"})):(b(),be(qe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Me(()=>[w("div",Ile,[a.value>1?(b(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(b(!0),T(Be,null,st(n.question.questions,(W,X)=>(b(),T("button",{key:W.id,type:"button",class:Pe(["qstep-dot",{active:X===i.value,answered:f(W.id)}]),"aria-selected":X===i.value,"aria-label":C(s)("question.step",{current:X+1,total:a.value}),onClick:U=>d(X)},[w("span",Fle,O(X+1),1)],10,Lle))),128))],8,$le)):re("",!0),l.value.header?(b(),T("div",Ole,[ie(Fo,{variant:"neutral",size:"sm"},{default:Me(()=>[Qe(O(l.value.header),1)]),_:1})])):re("",!0),w("div",Rle,O(l.value.question),1),l.value.body?(b(),be(Rm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),w("div",Ble,[(b(!0),T(Be,null,st(l.value.options,(W,X)=>(b(),T("label",{key:W.id,class:Pe(["qopt",{selected:$(l.value.id,W.id)}]),onClick:xt(U=>l.value.multiSelect?g(l.value.id,W.id):k(l.value.id,W.id),["prevent"])},[w("span",Ple,O(X+1),1),w("span",Hle,[l.value.multiSelect?(b(),T("span",Wle,O($(l.value.id,W.id)?"■":"□"),1)):(b(),T("span",zle,O($(l.value.id,W.id)?"●":"○"),1))]),w("span",Ule,[w("span",qle,O(W.label),1),W.description?(b(),T("span",jle,O(W.description),1)):re("",!0)])],10,Dle))),128)),l.value.allowOther?(b(),T("label",{key:0,class:Pe(["qopt",{selected:_(l.value.id)}]),onClick:z[4]||(z[4]=xt(W=>L(l.value.id),["prevent"]))},[z[6]||(z[6]=w("span",{class:"qopt-key"},null,-1)),w("span",Vle,[l.value.multiSelect?(b(),T("span",Kle,O(_(l.value.id)?"■":"□"),1)):(b(),T("span",Gle,O(_(l.value.id)?"●":"○"),1))]),w("span",Yle,O(l.value.otherLabel??C(s)("question.otherDefault")),1),Rn(w("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":z[1]||(z[1]=W=>v.value[l.value.id]=W),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:z[2]||(z[2]=W=>A(l.value.id)),onFocus:z[3]||(z[3]=W=>A(l.value.id))},null,40,Zle),[[wo,v.value[l.value.id]]])],2)):re("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Me(()=>[w("div",Qle,[i.value<a.value-1?(b(),be(Dt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Me(()=>[Qe(O(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(b(),be(Dt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:N.value,onClick:I},{default:Me(()=>[Qe(O(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(b(),be(Dt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Me(()=>[Qe(O(C(s)("question.back")),1)]),_:1},8,["disabled"])):re("",!0),ie(Dt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:R},{default:Me(()=>[Qe(O(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Jle=dt(Xle,[["__scopeId","data-v-9525707a"]]),eae={class:"ah"},tae={class:"akind"},nae={class:"apath"},sae={class:"ah-path"},oae={key:1,class:"diff"},iae={class:"dg"},rae={class:"dc"},lae={key:2,class:"body-shell"},aae={class:"shell-cmd"},cae={key:0,class:"shell-cwd"},uae={key:1,class:"shell-danger"},dae={key:3,class:"body-file"},fae={class:"file-bar"},hae={class:"file-lang"},pae={class:"file-content"},mae={class:"file-ln"},gae={class:"file-text"},vae={key:4,class:"body-chip"},yae={class:"chip-label"},kae={class:"chip-value"},bae={key:0,class:"chip-detail"},xae={key:5,class:"body-chip"},_ae={key:0,class:"chip-label"},wae={class:"chip-value"},Sae={key:6,class:"body-chip"},Cae={class:"chip-label"},Aae={class:"chip-value"},Mae={key:0,class:"chip-detail"},Eae={key:7,class:"body-chip"},Tae={class:"chip-label"},Nae={class:"chip-value"},Iae={key:0,class:"chip-detail"},$ae={key:8,class:"body-todo"},Lae={class:"todo-glyph"},Fae={key:9,class:"body-plan"},Oae={key:10,class:"body-generic"},Rae={class:"gen-text"},Bae={key:11,class:"feedback-wrap"},Dae=["placeholder"],Pae={class:"feedback-hint"},Hae={key:0,class:"plan-actions"},Wae={key:1,class:"abtn"},zae=Ge({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=D(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=Q(!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=Q(!1),u=Q(""),d=Q(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 x=Q(null);Ze(()=>n.busy,N=>{N||(x.value=null)});function k(N,F){n.busy||(x.value=N,s("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function y(){k("reject",{decision:"rejected"})}function A(){k("approvePlan",{decision:"approved"})}function L(N){k(`option:${N}`,{decision:"approved",selectedLabel:N})}function $(){n.busy||f()}function _(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){N.key==="1"?(N.preventDefault(),A()):N.key==="2"?(N.preventDefault(),$()):N.key==="3"&&(N.preventDefault(),_());return}N.key==="1"&&S.options[0]?(N.preventDefault(),L(S.options[0].label)):N.key==="2"&&S.options[1]?(N.preventDefault(),L(S.options[1].label)):N.key==="3"&&S.options[2]&&(N.preventDefault(),L(S.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),v()):N.key==="3"?(N.preventDefault(),y()):N.key==="4"&&(N.preventDefault(),f())}return gn(()=>document.addEventListener("keydown",E)),_n(()=>document.removeEventListener("keydown",E)),(N,F)=>(b(),be(Pk,{class:Pe(["appr",{minimized:r.value}])},j4({head:Me(()=>[w("div",eae,[F[2]||(F[2]=w("span",{class:"ah-ic"},"!",-1)),w("span",tae,O(a()),1),w("span",nae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(b(),T(Be,{key:0},[Qe(O(e.block.path),1)],64)):e.block.kind==="shell"?(b(),T(Be,{key:1},[Qe(O(e.block.command),1)],64)):e.block.kind==="url"?(b(),T(Be,{key:2},[Qe(O(e.block.url),1)],64)):e.block.kind==="search"?(b(),T(Be,{key:3},[Qe(O(e.block.query),1)],64)):e.block.kind==="invocation"?(b(),T(Be,{key:4},[Qe(O(e.block.name),1)],64)):e.block.kind==="generic"?(b(),T(Be,{key:5},[Qe(O(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!r.value?(b(),be(Fo,{key:0,variant:"neutral",size:"sm"},{default:Me(()=>[Qe(O(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):re("",!0),r.value?re("",!0):(b(),be(Fo,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Me(()=>[Qe(O(C(o)("approval.required")),1)]),_:1})),ie(Wn,{class:"amin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Me(()=>[r.value?(b(),be(qe,{key:0,name:"chevron-down",size:"md"})):(b(),be(qe,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Me(()=>[e.block.kind==="plan_review"&&e.block.path?(b(),be(Zt,{key:0,text:e.block.path},{default:Me(()=>[w("div",sae,O(e.block.path),1)]),_:1},8,["text"])):re("",!0),e.block.kind==="diff"?(b(),T("div",oae,[(b(!0),T(Be,null,st(e.block.diff,(S,I)=>(b(),T("div",{key:I,class:Pe(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[w("span",iae,O(S.gutter),1),w("span",rae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(b(),T("div",lae,[w("div",aae,[F[3]||(F[3]=w("span",{class:"shell-dollar"},"$",-1)),Qe(" "+O(e.block.command),1)]),e.block.cwd?(b(),T("div",cae,"cwd: "+O(e.block.cwd),1)):re("",!0),e.block.danger?(b(),T("div",uae,O(C(o)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(b(),T("div",dae,[w("div",fae,[w("span",hae,O(e.block.language??""),1)]),w("div",pae,[(b(!0),T(Be,null,st(e.block.content.split(`
|
|
297
|
-
`),(S,I)=>(b(),T("div",{key:I,class:"file-line"},[w("span",mae,O(I+1),1),w("span",gae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(b(),T("div",vae,[w("span",yae,O(e.block.op),1),w("span",kae,O(e.block.path),1),e.block.detail?(b(),T("span",bae,O(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(b(),T("div",xae,[e.block.method?(b(),T("span",_ae,O(e.block.method),1)):re("",!0),w("span",wae,O(e.block.url),1)])):e.block.kind==="search"?(b(),T("div",Sae,[w("span",Cae,O(C(o)("approval.searchQueryLabel")),1),w("span",Aae,O(e.block.query),1),e.block.scope?(b(),T("span",Mae,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(b(),T("div",Eae,[w("span",Tae,O(e.block.kind2),1),w("span",Nae,O(e.block.name),1),e.block.description?(b(),T("span",Iae,O(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(b(),T("div",$ae,[(b(!0),T(Be,null,st(e.block.items,(S,I)=>(b(),T("div",{key:I,class:"todo-item"},[w("span",Lae,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),w("span",{class:Pe(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(b(),T("div",Fae,[ie(Rm,{text:e.block.plan},null,8,["text"])])):(b(),T("div",Oae,[w("span",Rae,O(e.block.summary),1)])),c.value?(b(),T("div",Bae,[Rn(w("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Dae),[[wo,u.value]]),w("div",Pae,O(C(o)("approval.feedbackHint")),1)])):re("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Me(()=>[i.value?(b(),T("div",Hae,[i.value.options.length>0?(b(!0),T(Be,{key:0},st(i.value.options,(S,I)=>(b(),be(Zt,{key:I,text:S.description},{default:Me(()=>[ie(Dt,{class:"kbtn",size:"sm",variant:"primary",loading:x.value===`option:${S.label}`,disabled:e.busy,onClick:R=>L(S.label)},{default:Me(()=>[Qe(O(S.label),1),ie(mr,{class:"k",keys:[String(I+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(b(),be(Dt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:x.value==="approvePlan",disabled:e.busy,onClick:A},{default:Me(()=>[Qe(O(C(o)("approval.approvePlan")),1),ie(mr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ie(Dt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:Me(()=>[Qe(O(C(o)("approval.revise")),1),i.value.options.length===0?(b(),be(mr,{key:0,class:"k",keys:["2"]})):re("",!0)]),_:1},8,["disabled"]),ie(Dt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:x.value==="rejectAndExit",disabled:e.busy,onClick:_},{default:Me(()=>[Qe(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(b(),be(mr,{key:0,class:"k",keys:["3"]})):re("",!0)]),_:1},8,["loading","disabled"])])):(b(),T("div",Wae,[ie(Dt,{class:"kbtn",size:"sm",variant:"primary",loading:x.value==="approve",disabled:e.busy,onClick:g},{default:Me(()=>[Qe(O(C(o)("approval.approve")),1),ie(mr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ie(Dt,{class:"kbtn",size:"sm",variant:"secondary",loading:x.value==="approveSession",disabled:e.busy,onClick:v},{default:Me(()=>[Qe(O(C(o)("approval.approveSession")),1),ie(mr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ie(Dt,{class:"kbtn",size:"sm",variant:"secondary",loading:x.value==="reject",disabled:e.busy,onClick:y},{default:Me(()=>[Qe(O(C(o)("approval.reject")),1),ie(mr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ie(Dt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Me(()=>[Qe(O(C(o)("approval.feedback")),1),ie(mr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),Uae=dt(zae,[["__scopeId","data-v-12609161"]]),qae=Ge({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(b(),T("span",{class:Pe(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),A5=dt(qae,[["__scopeId","data-v-f595d935"]]),jae={class:"taskspane"},Vae={class:"tp-head"},Kae={class:"tp-title"},Gae={class:"tp-count"},Yae={class:"tp-list"},Zae={key:0,class:"tp-empty"},Qae=["role","onClick"],Xae={class:"tp-name"},Jae={class:"tp-time"},ece=["onClick"],tce={key:0,class:"tp-detail"},nce={key:0,class:"tp-codebox"},sce=["onClick"],oce={class:"tp-pre"},ice={class:"tp-cmd"},rce={key:1,class:"tp-codebox"},lce=["onClick"],ace={class:"tp-pre"},cce=Ge({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Tt(),o=Hs(new Set),i=Hs(new Set),r=Hs(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,x){await oo(p)&&(x.add(m),setTimeout(()=>x.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
|
|
298
|
-
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(b(),T("div",jae,[w("div",Vae,[w("span",Kae,O(C(s)("tasks.tag")),1),w("span",Gae,O(e.tasks.length),1)]),w("div",Yae,[e.tasks.length===0?(b(),T("div",Zae,O(C(s)("tasks.emptyTasks")),1)):(b(!0),T(Be,{key:1},st(e.tasks,x=>(b(),T("div",{key:x.id,class:Pe(["tp-row",{done:x.state==="done",fail:x.state==="fail",expandable:c(x)}])},[w("div",{class:"tp-main",role:c(x)?"button":void 0,onClick:k=>a(x)},[ie(A5,{status:u(x.state)},null,8,["status"]),w("span",Xae,O(x.name),1),ie(Fo,{variant:"neutral",size:"sm"},{default:Me(()=>[Qe(O(x.kind),1)]),_:2},1024),w("span",Jae,O(x.timing),1),x.state==="run"?(b(),T("button",{key:0,class:"tp-stop",onClick:xt(k=>n("cancel",x.id),["stop"])},O(C(s)("tasks.stop")),9,ece)):re("",!0),x.kind==="subagent"?(b(),be(qe,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(x)?(b(),be(qe,{key:2,class:Pe(["tp-chevron",{open:o.has(x.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):re("",!0)],8,Qae),o.has(x.id)&&l(x)?(b(),T("div",tce,[x.meta?(b(),T("div",nce,[w("button",{class:Pe(["tp-copy",{copied:i.has(x.id)}]),onClick:xt(k=>f(x),["stop"])},O(i.has(x.id)?"已复制":"复制"),11,sce),w("pre",oce,[w("code",null,[w("span",ice,O(x.meta),1)])])])):re("",!0),x.output&&x.output.length>0?(b(),T("div",rce,[w("button",{class:Pe(["tp-copy",{copied:r.has(x.id)}]),onClick:xt(k=>h(x),["stop"])},O(r.has(x.id)?"已复制":"复制"),11,lce),w("pre",ace,[w("code",null,[m[0]||(m[0]=Qe(`
|
|
299
|
-
`,-1)),(b(!0),T(Be,null,st(x.output,(k,g)=>(b(),T("span",{key:g,class:"tp-line"},O(k),1))),128)),m[1]||(m[1]=Qe(`
|
|
300
|
-
`,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),BC=dt(cce,[["__scopeId","data-v-28fd5fc0"]]),uce={class:"todo-card"},dce={key:0,class:"tc-empty"},fce={class:"tc-name"},hce=Ge({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(b(),T("div",uce,[t.todos.length===0?(b(),T("div",dce,[i[0]||(i[0]=w("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"},[w("path",{d:"M9 11l2 2 4-4"}),w("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),w("span",null,O(C(n)("tasks.emptyTodo")),1)])):re("",!0),(b(!0),T(Be,null,st(t.todos,(r,l)=>(b(),T("div",{key:l,class:Pe(["tc-row",`s-${r.status}`])},[ie(A5,{status:s(r.status)},null,8,["status"]),w("span",fce,O(r.title),1)],2))),128))]))}}),pce=dt(hce,[["__scopeId","data-v-01c65735"]]),mce={class:"dock-work-head"},gce={key:0,class:"dock-work-tab static"},vce={key:1,class:"dock-work-tab static"},yce={key:2,class:"dock-work-tab static"},kce={class:"dock-work-body"},bce={class:"dw-count"},xce={class:"dw-count"},_ce={class:"dw-count"},wce=Ge({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=Tt(),r=Q(null),l=Q(null),a=Q(null);function c(h){return r.value?(r.value.loadForEdit(h),!0):!1}function u(h){r.value?.loadAttachmentsForEdit(h)}function d(){r.value?.focus()}function f(h){if(!s.dockPanel)return;const p=h.target;p&&(l.value?.contains(p)||a.value?.contains(p)||o("close-dock-panel"))}return Ze(()=>s.dockPanel,h=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),h&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),_n(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(h,p)=>(b(),T("div",{class:Pe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:p[28]||(p[28]=xt(()=>{},["stop"]))},[ie(Tl,{name:"dock-panel"},{default:Me(()=>[e.dockPanel?(b(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:p[3]||(p[3]=xt(()=>{},["stop"]))},[w("div",mce,[e.dockPanel==="bash"?(b(),T("span",gce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(b(),T("span",vce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(b(),T("span",yce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):re("",!0)]),w("div",kce,[e.dockPanel==="bash"?(b(),be(BC,{key:0,tasks:e.bashTasks,onCancel:p[0]||(p[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(b(),be(BC,{key:1,tasks:e.subagentTasks,onCancel:p[1]||(p[1]=m=>o("cancelTask",m)),onOpen:p[2]||(p[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(b(),be(pce,{key:2,todos:e.todos??[]},null,8,["todos"])):re("",!0)])],512)):re("",!0)]),_:1}),e.goal?(b(),be(Ale,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:p[4]||(p[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(b(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(b(),be(hh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:p[5]||(p[5]=m=>o("toggle-dock-panel","bash"))},{default:Me(()=>[ie(qe,{name:"clock",size:"md"}),w("span",null,O(C(i)("tasks.dockBash")),1),w("span",bce,[p[29]||(p[29]=Qe("(",-1)),w("b",null,O(e.bashTasks.length),1),p[30]||(p[30]=Qe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),e.subagentTasks.length>0?(b(),be(hh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:p[6]||(p[6]=m=>o("toggle-dock-panel","subagent"))},{default:Me(()=>[ie(qe,{name:"sparkles",size:"md"}),w("span",null,O(C(i)("tasks.dockSubagent")),1),w("span",xce,[p[31]||(p[31]=Qe("(",-1)),w("b",null,O(e.subagentTasks.length),1),p[32]||(p[32]=Qe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),(e.todos?.length??0)>0?(b(),be(hh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:p[7]||(p[7]=m=>o("toggle-dock-panel","todos"))},{default:Me(()=>[ie(qe,{name:"check-list",size:"md"}),w("span",null,O(C(i)("tasks.dockTodos")),1),w("span",_ce,[p[33]||(p[33]=Qe("(",-1)),w("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),p[34]||(p[34]=Qe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0)],512)):re("",!0),e.pendingQuestion?(b(),be(Jle,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:p[8]||(p[8]=(m,x)=>o("answer",m,x)),onDismiss:p[9]||(p[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(b(),be(Uae,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:p[10]||(p[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(b(),be(C5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:p[11]||(p[11]=m=>o("submit",m)),onSteer:p[12]||(p[12]=m=>o("steer",m)),onCommand:p[13]||(p[13]=m=>o("command",m)),onInterrupt:p[14]||(p[14]=m=>o("interrupt")),onSetPermission:p[15]||(p[15]=m=>o("setPermission",m)),onSetThinking:p[16]||(p[16]=m=>o("setThinking",m)),onTogglePlan:p[17]||(p[17]=m=>o("togglePlan")),onToggleSwarm:p[18]||(p[18]=m=>o("toggleSwarm")),onToggleGoal:p[19]||(p[19]=m=>o("toggleGoal")),onOpenBtw:p[20]||(p[20]=m=>o("openBtw")),onCreateGoal:p[21]||(p[21]=m=>o("createGoal",m)),onControlGoal:p[22]||(p[22]=m=>o("controlGoal",m)),onFocusGoal:p[23]||(p[23]=m=>o("focusGoal")),onFocusSwarm:p[24]||(p[24]=m=>o("focusSwarm")),onCompact:p[25]||(p[25]=m=>o("compact")),onPickModel:p[26]||(p[26]=m=>o("pickModel")),onSelectModel:p[27]||(p[27]=m=>o("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Sce=dt(wce,[["__scopeId","data-v-67df0d16"]]),Cce=["aria-label","aria-hidden"],Ace={class:"toc-scroll"},Mce=["onClick"],Ece={class:"toc-label"},Tce=240,Nce=Ge({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=Q(null),r=Q(!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>=Tce}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ze(c,u=>{l?.disconnect(),l=null,u&>(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ps(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(b(),T("nav",{key:0,ref_key:"navRef",ref:i,class:Pe(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[w("div",Ace,[(b(!0),T(Be,null,st(e.items,f=>(b(),T("button",{key:f.id,type:"button",class:Pe(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",Ece,O(f.title),1)],10,Mce))),128))])],10,Cce)):re("",!0)}}),Ice=dt(Nce,[["__scopeId","data-v-3f1c1f66"]]),$ce=5;function Lce(e,t,n,s=$ce){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 Fce={class:"chat-layout"},Oce={class:"empty-hint"},Rce={key:0,class:"empty-hint-text"},Bce={key:1,class:"ws-pick"},Dce={class:"ws-pick-name"},Pce={key:1,class:"ws-pick-menu"},Hce=["onClick"],Wce={class:"ws-pick-item-name"},zce={class:"ws-pick-item-path"},Uce=["aria-label"],qce={key:0,class:"abort-toast",role:"status","aria-live":"polite"},jce={class:"abort-toast-text"},pg=80,DC=1e3,Vce=420,Kce=3e3,Gce=Ge({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:s}=Tt(),o=e,i=n,r=Q(!1),l=Q(!1),a=D(()=>o.workspaces?.find(xe=>xe.id===o.activeWorkspaceId)?.name??o.workspaceName??""),c=D(()=>(o.workspaces?.length??0)>0),u=D(()=>Lce(o.workspaces??[],o.activeWorkspaceId,l.value)),d=D(()=>(o.workspaces?.length??0)-u.value.length);Ze(r,ve=>{ve||(l.value=!1)});function f(ve){r.value=!1,ve!==o.activeWorkspaceId&&i("selectWorkspace",ve)}Gc(Lt.contentAlign);const h=Q(null),p=Q(null),m=Q(null),x=Q(!1),k=Q(0);let g=null;function v(ve,xe){const De=m.value??p.value;return!De||De.loadForEdit(ve)===!1?!1:(De.loadAttachmentsForEdit(xe??[]),!0)}function y(){x.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,x.value=!1},2e3)}function A(){k.value++}const L=D(()=>o.tasks.filter(ve=>ve.kind!=="subagent")),$=D(()=>o.tasks.filter(ve=>ve.kind==="subagent"&&ve.runInBackground)),_=D(()=>L.value.filter(ve=>ve.state==="run").length),E=D(()=>$.value.filter(ve=>ve.state==="run").length);function N(ve){const xe=o.tasks,De=xe.find(Wt=>Wt.id===ve)??xe.find(Wt=>Wt.parentToolCallId===ve);if(De)return De.id;const Bt=xe.filter(Wt=>Wt.kind==="subagent"&&!Wt.parentToolCallId);if(Bt.length===1)return Bt[0].id}Fn("resolveAgentTaskId",N),Fn("pinScroll",qn);const F=D(()=>(o.todos??[]).filter(ve=>ve.status==="done").length),S=D(()=>L.value.length>0||$.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),I=Q(null),R=D(()=>o.gitInfo?o.changes?.length??0:0);function B(ve){I.value=I.value===ve?null:ve}function P(){I.value=null}Ze(S,ve=>{ve||P()});function z(ve){if(ve.role==="compaction")return s("conversation.compactedPlain");if(ve.role==="user"){if(ve.skillActivation)return`/${ve.skillActivation.name}`;if(ve.pluginCommand)return`/${ve.pluginCommand.pluginId}:${ve.pluginCommand.commandName}`;const De=ve.text.trim().replaceAll(/\s+/g," ");return De.length>0?De:"user"}const xe=(ve.text||ve.thinking||"").trim().replaceAll(/\s+/g," ");return xe.length>0?xe:(ve.tools?.length??0)>0?`${ve.tools.length} tools`:"kimi"}const W=D(()=>o.turns.filter(ve=>ve.role==="user").map((ve,xe)=>({id:ve.id,role:ve.role,no:xe+1,title:z(ve)}))),X=Q(null);function U(){const ve=de.value;if(!ve)return;const xe=ve.querySelectorAll(".turn-anchor[data-turn-id]");if(xe.length===0)return;const De=W.value;if(De.length===0)return;const Bt=new Set(De.map(Ws=>Ws.id));if(pe()<=pg){X.value=De[De.length-1].id;return}const Wt=ve.getBoundingClientRect(),An=Wt.height/2;let jn=null;xe.forEach(Ws=>{const Wo=Ws.dataset.turnId;if(!Wo||!Bt.has(Wo))return;Ws.getBoundingClientRect().top-Wt.top<=An&&(jn=Wo)}),X.value=jn??De[0].id}const Z=Q(!1);let ce=0;function fe(){ce||(ce=rt(()=>{ce=0,se()}))}function se(){const ve=de.value,xe=!o.mobile&&o.conversationToc&&ve?ve.closest(".con")?.querySelector(".conversation-toc"):null,De=xe?.querySelector(".toc-bar");let Bt=!1;if(ve&&xe&&De){const Wt=De.getBoundingClientRect(),An=xe.getBoundingClientRect(),jn=Wt.left+Wt.width/2;Bt=Array.from(ve.querySelectorAll(".table-node-wrapper")).some(Ws=>{const Wo=Ws.getBoundingClientRect();return Wo.left<=jn&&jn<=Wo.right&&Wo.top<An.bottom&&Wo.bottom>An.top})}Z.value!==Bt&&(Z.value=Bt)}const Y=D(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),J=D(()=>{const ve=Y.value;if(ve)return o.pendingQuestionActions?.[ve.questionId]}),le=D(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),He=D(()=>{const ve=le.value;return ve?!!o.pendingApprovalActions?.[ve.approvalId]:!1}),de=Q(null),G=Q(null),ae=Q(0),me=Q(0),q=D(()=>({"--panes-scrollbar-width":`${ae.value}px`}));function ne(ve){return ve instanceof HTMLElement?ve:ve&&"$el"in ve&&ve.$el instanceof HTMLElement?ve.$el:null}function ge(){const ve=de.value;ae.value=ve?Math.max(0,ve.offsetWidth-ve.clientWidth):0,me.value=G.value?.offsetHeight??0}function ue(ve){const xe=ne(ve);de.value=xe,xe&&ut()}function ye(ve){const xe=ne(ve);G.value=xe??null,ve&&"loadForEdit"in ve&&typeof ve.loadForEdit=="function"&&"focus"in ve&&typeof ve.focus=="function"?m.value={loadForEdit:ve.loadForEdit.bind(ve),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ve&&typeof ve.loadAttachmentsForEdit=="function"?ve.loadAttachmentsForEdit.bind(ve):()=>{},focus:ve.focus.bind(ve)}:m.value=null,Rs()}const j=Q(!0),te=Q(!1);function pe(){const ve=de.value;return ve?ve.scrollHeight-ve.scrollTop-ve.clientHeight:0}let Ce=0,Ie=0,$e=0,he=0,Ne=0,Je=0;function it(){return Date.now()<Ie}function At(){fe();const ve=de.value;if(!ve)return;const xe=ve.scrollTop;if(kn()){Ce=xe;return}if(performance.now()-$e<100){Ce=xe;return}const De=pe();if(it()){j.value=!0,te.value=!1,Ce=xe;return}xe<Ce-1&&De>1?(j.value=!1,te.value=!0):De<=pg&&xe>Ce+1&&(j.value=!0,te.value=!1),Ce=xe,U()}function bt(ve=!1){const xe=de.value;j.value=!0,te.value=!1,xe&&(!ve&&performance.now()<he||(ve&&typeof xe.scrollTo=="function"?($e=performance.now(),he=performance.now()+Vce,xe.scrollTo({top:xe.scrollHeight,behavior:"smooth"})):xe.scrollTop=xe.scrollHeight,Ce=xe.scrollTop))}function wt(ve,xe){return(xe.closest("[inert]")?.closest(".tool-group")??xe).getBoundingClientRect().top-ve.getBoundingClientRect().top+ve.scrollTop}function Gt(ve,xe){const De=Array.from(ve.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(An=>({node:An,top:wt(ve,An)})),Bt=De.findIndex(An=>An.top>=xe),Wt=Bt<0?Math.max(0,De.length-1):Bt;return De.slice(Wt,Wt+2).flatMap(An=>{const jn=An.node.dataset.scrollAnchorId,Ws=jn??An.node.dataset.turnId;return Ws?[{kind:jn?"tool":"turn",id:Ws,top:An.top}]:[]})}const vt=new Map;function ln(ve,xe){for(const De of xe.anchors){const Bt=De.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Wt=ve.querySelector(`[${Bt}="${Vt(De.id)}"]`);if(Wt)return wt(ve,Wt)-De.top}return ve.scrollHeight-xe.oldHeight}function Gn(ve,xe,De=ve.scrollTop){return ve.scrollTop=De+ln(ve,xe),Ce=ve.scrollTop,ve.scrollTop}async function Un(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||Dn.value||!o.hasMoreMessages)return;const ve=o.sessionId,xe=de.value,De=xe?.scrollTop??0,Bt={anchors:xe?Gt(xe,De):[],oldHeight:xe?.scrollHeight??0};ss(ve,!0),Os();try{if(await gt(),await o.loadOlderMessages(ve),await gt(),o.sessionId!==ve){vt.set(ve,Bt);return}const Wt=de.value;if(!Wt)return;Gn(Wt,Bt),vt.delete(ve)}finally{ss(ve,!1)}}function Vt(ve){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ve):ve.replaceAll(/["\\]/g,"\\$&")}function an(ve){const xe=de.value;if(!xe)return;const De=xe.querySelector(`.turn-anchor[data-turn-id="${Vt(ve)}"]`);De&&(si(),j.value=!1,te.value=pe()>pg,De.scrollIntoView({behavior:"smooth",block:"center"}))}function es(){const ve=de.value;if(!ve)return"none";const xe=ve.firstElementChild,De=xe instanceof HTMLElement?xe.offsetHeight:0,Bt=G.value?.offsetHeight??0;return`${ve.scrollHeight}:${ve.clientHeight}:${De}:${Bt}`}function rt(ve){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ve):setTimeout(ve,16)}function In(ve){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ve):clearTimeout(ve)}let gs=0,yn=0,us=null,ts=0;function kn(){return performance.now()<gs}function qn(ve,xe=260){const De=de.value;if(!De||(us=ve,ts=ve.getBoundingClientRect().top,gs=performance.now()+xe,yn))return;const Bt=()=>{if(yn=0,performance.now()>=gs||!us){us=null;return}const Wt=us.getBoundingClientRect().top-ts;Wt&&(De.scrollTop+=Wt),yn=rt(Bt)};yn=rt(Bt)}function $n(ve=36){if(!j.value&&!it())return;const xe=++Je;let De="",Bt=0,Wt=0;Ne&&(In(Ne),Ne=0);const An=()=>{if(Ne=0,xe!==Je||!j.value&&!it())return;bt(!1);const jn=es();Bt=jn===De?Bt+1:0,De=jn,Wt++,Bt<3&&Wt<ve&&(Ne=rt(An))};Ne=rt(An)}function ds(ve,xe){return ve!==void 0&&ve.length>0&&xe.length>=ve.length&&ve.firstId!==xe.firstId&&ve.lastId===xe.lastId&&ve.lastTextLen===xe.lastTextLen&&ve.lastThinkingLen===xe.lastThinkingLen&&ve.lastToolsLen===xe.lastToolsLen&&ve.approvalIds===xe.approvalIds}const Fs=D(()=>{const ve=(o.approvals??[]).map(An=>An.approvalId).join(","),xe=o.turns,De=xe.at(-1),Bt=De?.thinking?.length??0,Wt=De?.tools?.reduce((An,jn)=>An+jn.name.length+(jn.arg?.length??0)+(jn.output?.join("").length??0),0)??0;return{length:xe.length,firstId:xe[0]?.id??"",lastId:De?.id??"",lastTextLen:De?.text.length??0,lastThinkingLen:Bt,lastToolsLen:Wt,approvalIds:ve}});Ze(Fs,async(ve,xe)=>{if(Dn.value&&ds(xe,ve)){U();return}await gt(),j.value||it()?bt(ve.length<xe.length):te.value=!0,U()}),Ze(G,()=>{Rs()}),Ze(()=>o.mobile,async()=>{await gt(),ge()});const wn=new Map;Ze(()=>o.fileReloadKey,async(ve,xe)=>{const De=de.value;xe&&De&&wn.set(String(xe),{top:De.scrollTop,following:j.value}),si(),await gt();const Bt=de.value,Wt=ve?wn.get(String(ve)):void 0;if(Wt&&Bt){const An=vt.get(String(ve)),jn=An?Gn(Bt,An,Wt.top):Wt.top;An&&vt.delete(String(ve)),j.value=Wt.following,Bt.scrollTop=jn,Ce=Bt.scrollTop,te.value=!Wt.following&&pe()>1,Wt.following&&$n()}else j.value=!0,Ce=0,bt(!1),$n();U()}),Ze(()=>o.sessionLoading,async(ve,xe)=>{ve||!xe||(j.value=!0,await gt(),$n(),U())}),Ze(()=>o.running,async(ve,xe)=>{ve||!xe||!j.value&&!it()||(await gt(),$n(48),U())});function As(){j.value=!0,te.value=!1,Ie=Date.now()+DC,gt(()=>{bt(!0),$n(16)})}function zn(ve){As(),i("submit",ve)}function Pt(ve){j.value=!0,te.value=!1,Ie=Date.now()+DC,i("editMessage",ve)}function Ye(ve){const xe=o.queued?.[ve],De=xe?.text??"";v(De,xe?.attachments)&&i("editQueued",ve)}function je(ve){i("reorderQueue",ve)}function Ot(ve,xe){As(),i("answer",ve,xe)}function Ht(ve,xe){!ve||!xe||i("approval",ve,xe)}let dn=null,Qt=null,Sn=null,Cn=null,Nt=0,fs=0,ns=0;const ro=Q(new Set),Dn=D(()=>!!o.sessionId&&ro.value.has(o.sessionId));function ss(ve,xe){const De=new Set(ro.value);xe?De.add(ve):De.delete(ve),ro.value=De}function Ai(){Dn.value||ns||(ns=rt(()=>{ns=0,!Dn.value&&(kn()||(j.value||it())&&bt(!1))}))}function Os(){Je++,Ne&&(In(Ne),Ne=0),ns&&(In(ns),ns=0)}function si(){const ve=de.value;if(Ie=0,Os(),gs=0,us=null,ve){const xe=ve.scrollTop;typeof ve.scrollTo=="function"?ve.scrollTo({top:xe,behavior:"auto"}):ve.scrollTop=xe}he=0,$e=Number.NEGATIVE_INFINITY,ve&&(Ce=ve.scrollTop)}function So(){const ve=de.value;!ve||ve.scrollHeight-ve.clientHeight<=1&&!o.hasMoreMessages||(j.value=!1,si(),ve.scrollHeight-ve.clientHeight>1&&(te.value=!0))}function Pi(ve){const xe=de.value;if(!xe)return!1;for(const De of ve.composedPath()){if(De===xe)return!1;if(De instanceof HTMLElement&&De.scrollHeight>De.clientHeight+1&&De.scrollTop>1)return!0}return!1}function oi(ve){ve.defaultPrevented||ve.ctrlKey||ve.shiftKey||ve.deltaY>=0||Pi(ve)||So()}function vs(ve){const xe=de.value;if(!xe||ve.defaultPrevented||ve.button!==0||ve.pointerType==="touch")return;const De=xe.getBoundingClientRect(),Bt=xe.offsetWidth-xe.clientWidth,Wt=Bt>0?Bt:12;ve.target===xe&&ve.clientX>=De.right-Wt&&So()}let Co=null;function Hi(ve){Co=ve.touches.length===1?ve.touches[0].clientY:null}function ii(ve){const xe=ve.touches.length===1?ve.touches[0].clientY:null;xe!==null&&Co!==null&&xe>Co+2&&!Pi(ve)&&So(),Co=xe}function Yn(){if(!Qt)return;const ve=de.value?.firstElementChild??null;ve!==Sn&&(Sn&&Qt.unobserve(Sn),Sn=ve,ve&&Qt.observe(ve))}function Rs(){if(!Qt)return;const ve=G.value;ve!==Cn&&(Cn&&Qt.unobserve(Cn),Cn=ve,ve&&Qt.observe(ve))}function ut(){const ve=de.value;ge(),dn&&(dn.disconnect(),ve&&dn.observe(ve,{childList:!0,subtree:!0,characterData:!0})),Qt&&(Qt.disconnect(),Sn=null,Cn=null,ve&&Qt.observe(ve),Yn(),Rs()),Nt=ve?.scrollHeight??0,fs=ve?.clientHeight??0,fe()}function ke(){Yn(),Ai(),fe()}function Fe(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&$n()}const Ut=Q(!1);let lo=null;function Ke(){Ut.value=!0,lo!==null&&clearTimeout(lo),lo=setTimeout(()=>{Ut.value=!1},Kce)}function nt(){Ke(),i("interrupt")}function ot(ve){ve.key==="Escape"&&(o.running||o.sending)&&(ve.preventDefault(),nt())}gn(()=>{gt(()=>{typeof MutationObserver=="function"&&(dn=new MutationObserver(ke)),typeof ResizeObserver=="function"&&(Qt=new ResizeObserver(()=>{fe(),ge();const ve=de.value;if(!ve)return;const{scrollHeight:xe,clientHeight:De}=ve,Bt=xe>Nt+1,Wt=De<fs-1;Nt=xe,fs=De,!kn()&&(Bt||Wt)&&Ai()})),ut(),$n(48),U(),typeof document<"u"&&(document.addEventListener("visibilitychange",Fe),document.addEventListener("keydown",ot))})}),_n(()=>{dn&&dn.disconnect(),Qt&&Qt.disconnect(),ns&&In(ns),Ne&&In(Ne),yn&&In(yn),ce&&In(ce),lo!==null&&clearTimeout(lo),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Fe),document.removeEventListener("keydown",ot))});function Rt(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Rt}),(ve,xe)=>(b(),T("section",{class:Pe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(b(),be(Dse,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":R.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:x.value,onOpenChanges:xe[0]||(xe[0]=De=>i("openChanges")),onCopyAll:xe[1]||(xe[1]=De=>h.value?.copyConversation()),onCopyFinalSummary:xe[2]||(xe[2]=De=>h.value?.copyFinalSummary()),onOpenPr:xe[3]||(xe[3]=De=>e.pr&&i("openPr",e.pr.url)),onRenameSession:xe[4]||(xe[4]=(De,Bt)=>i("renameSession",De,Bt)),onForkSession:xe[5]||(xe[5]=De=>i("forkSession",De)),onArchiveSession:xe[6]||(xe[6]=De=>i("archiveSession",De)),onExportSession:xe[7]||(xe[7]=De=>i("exportSession",De))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),e.conversationToc?(b(),be(Ice,{key:1,items:W.value,"active-turn-id":X.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:Z.value,onSelect:an},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):re("",!0),w("div",Fce,[w("div",{ref:ue,class:Pe(["panes chat-scroll",{"is-following":j.value,"history-prepending":Dn.value}]),onScrollPassive:At,onWheelPassive:oi,onPointerdownPassive:vs,onTouchstartPassive:Hi,onTouchmovePassive:ii},[w("div",{class:Pe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(b(),T(Be,{key:0},[xe[55]||(xe[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",Oce,[w("span",{class:Pe(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(b(),be(Ho,{key:0,size:"sm"})):re("",!0),w("span",null,O(e.starting?C(s)("conversation.starting"):C(s)("composer.emptyConversationTitle")),1)],2),e.starting?re("",!0):(b(),T("span",Rce,O(C(s)("composer.emptyConversation")),1)),c.value&&!e.starting?(b(),T("div",Bce,[ie(Zt,{text:C(s)("conversation.switchWorkspace")},{default:Me(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:xe[8]||(xe[8]=xt(De=>r.value=!r.value,["stop"]))},[ie(qe,{name:"folder",size:"sm"}),w("span",Dce,O(a.value),1),ie(qe,{class:Pe(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(b(),T("div",{key:0,class:"ws-pick-backdrop",onClick:xe[9]||(xe[9]=De=>r.value=!1)})):re("",!0),r.value?(b(),T("div",Pce,[(b(!0),T(Be,null,st(u.value,De=>(b(),T("button",{key:De.id,type:"button",class:Pe(["ws-pick-item",{on:De.id===e.activeWorkspaceId}]),onClick:xt(Bt=>f(De.id),["stop"])},[w("span",Wce,O(De.name),1),w("span",zce,O(De.shortPath),1)],10,Hce))),128)),d.value>0?(b(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:xe[10]||(xe[10]=xt(De=>l.value=!l.value,["stop"]))},[w("span",null,O(C(s)("conversation.moreWorkspaces",{count:d.value})),1)])):re("",!0),xe[54]||(xe[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:xe[11]||(xe[11]=xt(De=>{r.value=!1,i("addWorkspace")},["stop"]))},[ie(qe,{name:"plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)])])):re("",!0)])):e.starting?re("",!0):(b(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:xe[12]||(xe[12]=De=>i("addWorkspace"))},[ie(qe,{name:"folder-plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)]))]),ie(C5,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:zn,onSteer:xe[13]||(xe[13]=De=>i("steer",De)),onCommand:xe[14]||(xe[14]=De=>i("command",De)),onInterrupt:nt,onUnqueue:xe[15]||(xe[15]=De=>i("unqueue",De)),onEditQueued:xe[16]||(xe[16]=De=>i("editQueued",De)),onSetPermission:xe[17]||(xe[17]=De=>i("setPermission",De)),onSetThinking:xe[18]||(xe[18]=De=>i("setThinking",De)),onTogglePlan:xe[19]||(xe[19]=De=>i("togglePlan")),onToggleSwarm:xe[20]||(xe[20]=De=>i("toggleSwarm")),onToggleGoal:xe[21]||(xe[21]=De=>i("toggleGoal")),onOpenBtw:xe[22]||(xe[22]=De=>i("command","/btw")),onCreateGoal:xe[23]||(xe[23]=De=>i("createGoal",De)),onControlGoal:xe[24]||(xe[24]=De=>i("controlGoal",De)),onFocusGoal:A,onCompact:xe[25]||(xe[25]=De=>i("compact")),onPickModel:xe[26]||(xe[26]=De=>i("pickModel")),onSelectModel:xe[27]||(xe[27]=De=>i("selectModel",De))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),xe[56]||(xe[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(b(),be(g5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:xe[28]||(xe[28]=De=>i("openFile",De)),onOpenMedia:xe[29]||(xe[29]=De=>i("openMedia",De)),onCopyConversationCopied:y,onOpenThinking:xe[30]||(xe[30]=De=>i("openThinking",De)),onOpenCompaction:xe[31]||(xe[31]=De=>i("openCompaction",De)),onOpenAgent:xe[32]||(xe[32]=De=>i("openAgent",De)),onOpenToolDiff:xe[33]||(xe[33]=De=>i("openToolDiff",De)),onEditMessage:Pt,onLoadOlderMessages:Un,onUnqueue:xe[34]||(xe[34]=De=>i("unqueue",De)),onEditQueued:Ye,onReorderQueue:je},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?re("",!0):(b(),be(Sce,{key:0,ref:ye,style:Yt(q.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":k.value,"dock-panel":I.value,"bash-tasks":L.value,"subagent-tasks":$.value,"bash-running":_.value,"subagent-running":E.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":Y.value,"question-busy-kind":J.value,"pending-approval":le.value,"approval-busy":He.value,mobile:e.mobile,onToggleDockPanel:xe[35]||(xe[35]=De=>B(De)),onCloseDockPanel:xe[36]||(xe[36]=De=>P()),onOpenAgent:xe[37]||(xe[37]=De=>i("openAgent",De)),onAnswer:Ot,onDismiss:xe[38]||(xe[38]=De=>i("dismiss",De)),onApproval:Ht,onCancelTask:xe[39]||(xe[39]=De=>i("cancelTask",De)),onControlGoal:xe[40]||(xe[40]=De=>i("controlGoal",De)),onSubmit:zn,onSteer:xe[41]||(xe[41]=De=>i("steer",De)),onCommand:xe[42]||(xe[42]=De=>i("command",De)),onInterrupt:nt,onSetPermission:xe[43]||(xe[43]=De=>i("setPermission",De)),onSetThinking:xe[44]||(xe[44]=De=>i("setThinking",De)),onTogglePlan:xe[45]||(xe[45]=De=>i("togglePlan")),onToggleSwarm:xe[46]||(xe[46]=De=>i("toggleSwarm")),onToggleGoal:xe[47]||(xe[47]=De=>i("toggleGoal")),onOpenBtw:xe[48]||(xe[48]=De=>i("command","/btw")),onCreateGoal:xe[49]||(xe[49]=De=>i("createGoal",De)),onFocusGoal:A,onCompact:xe[50]||(xe[50]=De=>i("compact")),onPickModel:xe[51]||(xe[51]=De=>i("pickModel")),onSelectModel:xe[52]||(xe[52]=De=>i("selectModel",De))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ie(Tl,{name:"pill"},{default:Me(()=>[te.value?(b(),T("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${me.value+12}px`}),"aria-label":C(s)("conversation.jumpToLatestAria"),onClick:xe[53]||(xe[53]=De=>bt(!0))},[ie(qe,{class:"pill-chevron",name:"chevron-down",size:"md"}),Qe(" "+O(C(s)("conversation.newMessages")),1)],12,Uce)):re("",!0)]),_:1}),ie(Tl,{name:"abort-toast"},{default:Me(()=>[Ut.value?(b(),T("div",qce,[w("span",jce,O(C(s)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),Yce=dt(Gce,[["__scopeId","data-v-bb386a4d"]]),Zce=["aria-selected","onClick"],Qce=Ge({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),T("div",{class:Pe(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(b(!0),T(Be,null,st(e.options,i=>(b(),T("button",{key:i.value,class:Pe(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},O(i.label),11,Zce))),128))],2))}}),go=dt(Qce,[["__scopeId","data-v-d1aaccd7"]]),Xce={class:"ui-panel-header__title"},Jce={key:0,class:"ui-panel-header__sub"},eue=Ge({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-panel-header",{wrap:e.wrap}])},[w("span",Xce,O(e.title),1),ie(Zt,{text:e.subtitle},{default:Me(()=>[e.subtitle?(b(),T("span",Jce,O(e.subtitle),1)):re("",!0)]),_:1},8,["text"]),Bn(t.$slots,"default",{},void 0,!0),e.closable?(b(),be(Wn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Me(()=>[ie(qe,{name:"close",size:"sm"})]),_:1},8,["label"])):re("",!0)],2))}}),Aa=dt(eue,[["__scopeId","data-v-c47879ad"]]),tue={key:0,class:"fp-empty fp-error"},nue={key:1,class:"fp-empty"},sue={key:2,class:"fp-loading"},oue={class:"fp-path"},iue={class:"fp-meta"},rue={key:0,class:"fp-lines"},lue={class:"fp-size"},aue={key:3,class:"fp-search"},cue=["placeholder"],uue={key:0,class:"fp-search-count"},due=["href","aria-label"],fue={key:1,class:"fp-code"},hue={class:"fp-line-table"},pue=["data-line"],mue={class:"fp-gutter"},gue=["innerHTML"],vue={key:1,class:"fp-body fp-code"},yue={class:"fp-line-table"},kue=["data-line"],bue={class:"fp-gutter"},xue=["innerHTML"],_ue={key:2,class:"fp-body"},wue=["srcdoc","title"],Sue={key:1,class:"fp-code"},Cue={class:"fp-line-table"},Aue=["data-line"],Mue={class:"fp-gutter"},Eue=["innerHTML"],Tue={key:3,class:"fp-body fp-pdf-wrap"},Nue=["src","title"],Iue={key:1,class:"fp-binary-card"},$ue={class:"fp-binary-label"},Lue={key:4,class:"fp-body fp-table-wrap"},Fue={class:"fp-table"},Oue=["data-line"],Rue={key:5,class:"fp-body fp-image-wrap"},Bue=["src","alt"],Due={key:1,class:"fp-binary-card"},Pue={class:"fp-binary-icon"},Hue={class:"fp-binary-label"},Wue={key:6,class:"fp-body fp-code"},zue={class:"fp-line-table"},Uue=["data-line"],que={class:"fp-gutter"},jue=["innerHTML"],Vue={key:7,class:"fp-body fp-binary-wrap"},Kue={class:"fp-binary-card"},Gue={class:"fp-binary-icon"},Yue={class:"fp-binary-label"},Zue=Ge({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Tt();function s(de,G){const ae=G?G.split("/").filter(Boolean):[];for(const me of de.split("/"))me===""||me==="."||(me===".."?ae.pop():ae.push(me));return ae.join("/")}const o=Kt("resolveImage",async de=>de),i=D(()=>{const de=c.file?.path??"",G=de.lastIndexOf("/");return G>0?de.slice(0,G):""});function r(de){if(/^(https?:|data:|blob:)/i.test(de)||de.startsWith("/"))return de;const G=i.value;return G?s(de,G):de}async function l(de){const G=r(de);return o?o(G):G}Fn("resolveImage",l);function a(de){let G=de.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(G)||G.startsWith("/"))return de;for(const me of["#","?"]){const q=G.indexOf(me);q!==-1&&(G=G.slice(0,q))}const ae=i.value;return{...de,path:s(G,ae)}}const c=e,u=t;function d(de){c.openFile?.(a(de))}const f=Q(null),h=D(()=>{const de=c.file;if(!de)return"binary";const G=de.mime??"",ae=de.languageId??"",me=de.path.toLowerCase();return G==="text/markdown"||ae==="markdown"||ae==="md"||me.endsWith(".mdx")?"markdown":G==="application/json"||ae==="json"?"json":G==="text/html"||ae==="html"||me.endsWith(".html")||me.endsWith(".htm")?"html":G==="application/pdf"||me.endsWith(".pdf")?"pdf":G==="text/csv"||ae==="csv"||me.endsWith(".csv")?"csv":G.startsWith("image/")?"image":de.isBinary?"binary":G.startsWith("text/")||ae!==""?"text":"binary"});function p(de){const G=atob(de),ae=Uint8Array.from(G,me=>me.charCodeAt(0));return new TextDecoder().decode(ae)}const m=D(()=>{const de=c.file;if(!de)return"";if(de.encoding==="base64")try{return p(de.content)}catch{return de.content}return de.content}),x=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"?x.value:m.value).split(`
|
|
301
|
-
`):[]),g=D(()=>c.file?h.value==="json"?x.value:m.value:""),v=Q(""),y=Q(0),A=D(()=>{const de=v.value.trim().toLowerCase();if(!de)return[];const G=[];return k.value.forEach((ae,me)=>{ae.toLowerCase().includes(de)&&G.push(me+1)}),G});Ze(v,()=>{y.value=0});function L(de,G=!1){de&>(()=>{const ae=f.value?.querySelector(".fp-body"),me=ae?.querySelector(`[data-line="${de}"]`);if(!ae||!me)return;G&&(ae.scrollTop=0);const q=ae.getBoundingClientRect(),ne=me.getBoundingClientRect(),ge=ne.top-q.top+ae.scrollTop;ae.scrollTop=ge-ae.clientHeight/2+ne.height/2})}Ze(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(de){const G=A.value;G.length!==0&&(y.value=(y.value+de+G.length)%G.length,L(G[y.value]))}function _(de){const G=A.value;return{target:c.line===de,hit:G.includes(de),active:G[y.value]===de}}function E(de){return de<1024?`${de} B`:de<1024*1024?`${(de/1024).toFixed(1)} KB`:`${(de/(1024*1024)).toFixed(1)} MB`}const N=Q(!1),F=Q(!1);function S(){c.file&&oo(g.value).then(de=>{de&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function I(){c.file&&oo(c.file.path).then(de=>{de&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=Q("preview"),B=Q("preview"),P=Q("fit");function z(de){R.value=de}function W(de){B.value=de}function X(de){P.value=de}Ze(h,de=>{R.value=de==="html"?"preview":"source",B.value="preview",P.value="fit"});const U=D(()=>{const de=c.file;return!de||h.value!=="image"?null:de.sourceUrl?de.sourceUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:de.mime==="image/svg+xml"?`data:${de.mime};charset=utf-8,${encodeURIComponent(de.content)}`:null}),Z=D(()=>{const de=c.file;return!de||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:null}),ce=D(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function fe(de){const G=[];let ae="",me=!1;for(let q=0;q<de.length;q++){const ne=de[q];ne==='"'&&de[q+1]==='"'?(ae+='"',q++):ne==='"'?me=!me:ne===","&&!me?(G.push(ae),ae=""):ae+=ne}return G.push(ae),G}const se=D(()=>k.value.slice(0,200).map(fe));function Y(de){return de.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function J(){const de=c.file;if(!de)return"";const G=de.languageId?.toLowerCase();return G||(de.path.split(".").pop()?.toLowerCase()??"")}function le(de){const G=J();let ae=Y(de);return h.value==="json"||G==="json"||G==="jsonc"?(ae=ae.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ae=ae.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ae=ae.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ae=ae.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ae):h.value==="html"||G==="html"||G==="xml"||G==="svg"?(ae=ae.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ae=ae.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ae):(ae=ae.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>'),ae=ae.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ae)}function He(de,G=55){return!de||de.length<=G?de:"…"+de.slice(de.length-G+1)}return(de,G)=>(b(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(b(),T("div",tue,[w("span",null,O(e.error),1),e.closable?(b(),be(Dt,{key:0,variant:"secondary",size:"sm",onClick:G[0]||(G[0]=ae=>u("close"))},{default:Me(()=>[Qe(O(C(n)("filePreview.close")),1)]),_:1})):re("",!0)])):!e.file&&!e.loading?(b(),T("div",nue,O(C(n)("filePreview.empty")),1)):e.loading?(b(),T("div",sue,[G[7]||(G[7]=w("span",{class:"spinner"},null,-1)),w("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(b(),T(Be,{key:3},[ie(Aa,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:G[6]||(G[6]=ae=>u("close"))},{default:Me(()=>[ie(Zt,{text:e.file.path},{default:Me(()=>[w("span",oue,O(He(e.file.path)),1)]),_:1},8,["text"]),w("span",iue,[e.file.lineCount?(b(),T("span",rue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),w("span",lue,O(E(e.file.size)),1)]),h.value==="html"?(b(),be(go,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):re("",!0),h.value==="markdown"?(b(),be(go,{key:1,"model-value":B.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):re("",!0),h.value==="image"?(b(),be(go,{key:2,"model-value":P.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":X},null,8,["model-value","options"])):re("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(b(),T("div",aue,[Rn(w("input",{"onUpdate:modelValue":G[1]||(G[1]=ae=>v.value=ae),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,cue),[[wo,v.value]]),v.value.trim()?(b(),T("span",uue,O(A.value.length),1)):re("",!0),ie(Wn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:G[2]||(G[2]=ae=>$(-1))},{default:Me(()=>[ie(qe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Wn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:G[3]||(G[3]=ae=>$(1))},{default:Me(()=>[ie(qe,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):re("",!0),ie(Wn,{size:"sm",class:Pe({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:I},{default:Me(()=>[F.value?(b(),be(qe,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),be(qe,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(b(),be(Wn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:G[4]||(G[4]=ae=>u("openExternal"))},{default:Me(()=>[ie(qe,{name:"external-link",size:"md"})]),_:1},8,["label"])):re("",!0),e.externalActions?(b(),be(Wn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:G[5]||(G[5]=ae=>u("reveal"))},{default:Me(()=>[ie(qe,{name:"folder",size:"md"})]),_:1},8,["label"])):re("",!0),e.downloadUrl?(b(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(qe,{name:"download",size:"md"})],8,due)):re("",!0),!e.file.isBinary&&h.value!=="image"?(b(),be(Wn,{key:7,size:"sm",class:Pe({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Me(()=>[N.value?(b(),be(qe,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),be(qe,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):re("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(b(),T("div",{key:0,class:Pe(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(b(),be(Rm,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(b(),T("div",fue,[w("div",hue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",mue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,gue)],10,pue))),128))])]))],2)):h.value==="json"?(b(),T("div",vue,[w("div",yue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",bue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,xue)],10,kue))),128))])])):h.value==="html"?(b(),T("div",_ue,[R.value==="preview"?(b(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ce.value,title:e.file.path},null,8,wue)):(b(),T("div",Sue,[w("div",Cue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",Mue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,Eue)],10,Aue))),128))])]))])):h.value==="pdf"?(b(),T("div",Tue,[Z.value?(b(),T("iframe",{key:0,class:"fp-pdf-frame",src:Z.value,title:e.file.path},null,8,Nue)):(b(),T("div",Iue,[w("span",$ue,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(b(),T("div",Lue,[w("table",Fue,[w("tbody",null,[(b(!0),T(Be,null,st(se.value,(ae,me)=>(b(),T("tr",{key:me,class:Pe(_(me+1)),"data-line":me+1},[w("th",null,O(me+1),1),(b(!0),T(Be,null,st(ae,(q,ne)=>(b(),T("td",{key:ne},O(q),1))),128))],10,Oue))),128))])])])):h.value==="image"?(b(),T("div",Rue,[U.value?(b(),T("img",{key:0,src:U.value,alt:e.file.path,class:Pe(["fp-image",{actual:P.value==="actual"}])},null,10,Bue)):(b(),T("div",Due,[w("span",Pue,[ie(qe,{name:"image-off",size:"lg"})]),w("span",Hue,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="text"?(b(),T("div",Wue,[w("div",zue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",que,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,jue)],10,Uue))),128))])])):(b(),T("div",Vue,[w("div",Kue,[w("span",Gue,[ie(qe,{name:"file-off",size:"lg"})]),w("span",Yue,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),Que=dt(Zue,[["__scopeId","data-v-62bfaf2d"]]),Xue={class:"tp"},Jue=Ge({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=Q(null);return Ze(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(b(),T("div",Xue,[ie(Aa,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),PC=dt(Jue,[["__scopeId","data-v-cf9c560b"]]),ede={class:"ap"},tde={key:0,class:"ap-type"},nde={key:1,class:"ap-reason"},sde={key:2,class:"ap-field"},ode={class:"ap-field-body"},ide={key:3,class:"ap-field"},rde={class:"ap-field-body ap-live"},lde={key:4,class:"ap-field"},ade={class:"ap-field-body ap-progress"},cde={key:0,class:"ap-call"},ude={key:1,class:"ap-output"},dde=["onClick"],fde={key:5,class:"ap-field"},hde={class:"ap-field-body"},pde=8,HC=5,WC=2,mde=Ge({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const x=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},x.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},x.push(k));return x}const a=D(()=>l(i.value)),c=Q(new Set);function u(m){return c.value.has(m)}function d(m){const x=new Set(c.value);x.has(m)?x.delete(m):x.add(m),c.value=x}function f(m){return m.output.length-HC-WC}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=Q(null);return Ze(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||gt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,x)=>(b(),T("div",ede,[ie(Aa,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:x[0]||(x[0]=k=>s("close"))},{default:Me(()=>[ie(Fo,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Me(()=>[Qe(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(b(),T("div",tde,O(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(b(),T("div",nde,O(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(b(),T("div",sde,[x[1]||(x[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",ode,O(e.member.prompt),1)])):re("",!0),r.value?(b(),T("div",ide,[x[2]||(x[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",rde,O(r.value),1)])):re("",!0),a.value.length>0?(b(),T("div",lde,[x[4]||(x[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",ade,[(b(!0),T(Be,null,st(a.value,k=>(b(),T("div",{key:k.key,class:"ap-group"},[k.call?(b(),T("div",cde,[x[3]||(x[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Qe(" "+O(k.call),1)])):re("",!0),k.output.length>0?(b(),T("div",ude,[k.output.length<=pde||u(k.key)?(b(!0),T(Be,{key:0},st(k.output,(g,v)=>(b(),T("div",{key:v,class:"ap-out-line"},O(g),1))),128)):(b(),T(Be,{key:1},[(b(!0),T(Be,null,st(k.output.slice(0,HC),(g,v)=>(b(),T("div",{key:v,class:"ap-out-line"},O(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+O(f(k))+" more) ",9,dde),(b(!0),T(Be,null,st(k.output.slice(-WC),(g,v)=>(b(),T("div",{key:"t"+v,class:"ap-out-line"},O(g),1))),128))],64))])):re("",!0)]))),128))])])):re("",!0),e.member.summary?(b(),T("div",fde,[x[5]||(x[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",hde,O(e.member.summary),1)])):re("",!0)],512)]))}}),gde=dt(mde,[["__scopeId","data-v-715bd93e"]]),vde={class:"diff-lines"},yde={key:0,class:"hunk-text"},kde={class:"dl-gutter old"},bde={class:"dl-gutter new"},xde={class:"dl-sign"},_de={class:"dl-text"},wde=Ge({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(b(),T("div",vde,[(b(!0),T(Be,null,st(e.lines,(r,l)=>(b(),T("div",{key:l,class:Pe(["dl",s(r)])},[r.type==="hunk"?(b(),T("span",yde,O(r.text),1)):(b(),T(Be,{key:1},[w("span",kde,O(t(r)),1),w("span",bde,O(n(r)),1),w("span",xde,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",_de,O(r.text),1)],64))],2))),128))]))}}),M5=dt(wde,[["__scopeId","data-v-2f6bc1cc"]]),Sde={class:"tdp"},Cde={class:"tdp-body"},Ade={key:1,class:"tdp-output"},Mde={key:2,class:"tdp-empty"},Ede=Ge({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Tt();return(o,i)=>(b(),T("div",Sde,[ie(Aa,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",Cde,[e.target.lines&&e.target.lines.length>0?(b(),be(M5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(b(),T("div",Ade,[(b(!0),T(Be,null,st(e.target.output,(r,l)=>(b(),T("div",{key:l},O(r),1))),128))])):(b(),T("div",Mde,O(C(s)("diff.noDiff")),1))])]))}}),Tde=dt(Ede,[["__scopeId","data-v-76f2fbca"]]),Nde={class:"sc"},Ide={key:0,class:"sc-empty"},$de={key:2,class:"sc-loading","aria-hidden":"true"},Lde={class:"sc-composer"},Fde=["placeholder"],Ode=["disabled"],Rde=Ge({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),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=Q(""),c=Q(null),u=Q(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const h=D(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((A,L)=>A+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ze(h,async()=>{!n.running&&!n.sending||(await gt(),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 x(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(b(),T("div",Nde,[ie(Aa,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(b(),T("div",Ide,O(C(o)("sideChat.empty")),1)):(b(),be(g5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(b(),T("div",$de,[ie(m5)])):re("",!0)],512),w("div",Lde,[Rn(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:x,onKeydown:m},null,40,Fde),[[wo,a.value]]),ie(Zt,{text:C(o)("sideChat.send")},{default:Me(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(qe,{name:"arrow-right",size:"sm"})],8,Ode)]),_:1},8,["text"])])]))}}),Bde=dt(Rde,[["__scopeId","data-v-9ee5df02"]]),Dde={class:"changes-pane"},Pde={class:"dv-path"},Hde={class:"diff-head"},Wde={class:"back-label"},zde={key:0,class:"empty-state"},Ude={key:1,class:"dv-lines-wrap"},qde={key:2,class:"empty-state"},jde={class:"dv-change-count"},Vde={class:"ch-head"},Kde={class:"br-label"},Gde={class:"br-name"},Yde={key:0,class:"sync-info"},Zde={key:0,class:"ahead"},Qde={key:0,class:"behind"},Xde={key:1,class:"empty-head"},Jde={key:0,class:"ch-list"},efe=["onClick"],tfe={class:"fpath"},nfe={key:1,class:"ch-list ch-tree"},sfe={class:"tree-list"},ofe=["onClick"],ife={class:"tree-name"},rfe=["onClick"],lfe={class:"tree-name"},afe={key:2,class:"empty-state"},cfe={key:3,class:"empty-state"},ufe=Ge({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=D(()=>s.gitInfo!==null),u=D(()=>s.changes.length>0),d=D(()=>(s.selectedDiffPath??null)!==null),f=D(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=D(()=>s.fileDiff??[]),p=D(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function x(){o("back")}function k(){o("close")}const g=Q("list");function v(F){g.value=F}function y(F){const S={children:[]},I=[...F].sort((R,B)=>R.path.localeCompare(B.path));for(const R of I){const B=R.path.split("/");let P=S;for(let z=0;z<B.length;z++){const W=B[z],X=z===B.length-1,U=B.slice(0,z+1).join("/");let Z=P.children.find(ce=>ce.name===W&&ce.kind===(X?"file":"folder"));Z||(Z={name:W,path:U,kind:X?"file":"folder",status:X?R.status:void 0,children:[]},P.children.push(Z)),P=Z}}return S.children}const A=D(()=>y(s.changes)),L=Q(new Set);function $(F){return!L.value.has(F)}const _=D(()=>{const F=[];function S(I,R){for(const B of I)F.push({node:B,depth:R}),B.kind==="folder"&&$(B.path)&&S(B.children,R+1)}return S(A.value,0),F});function E(F){const S=new Set(L.value);S.has(F.path)?S.delete(F.path):S.add(F.path),L.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(b(),T("div",Dde,[f.value?(b(),T(Be,{key:0},[ie(Aa,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Me(()=>[ie(Zt,{text:e.selectedDiffPath??""},{default:Me(()=>[w("span",Pde,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",Hde,[e.hideBack?re("",!0):(b(),be(Dt,{key:0,variant:"ghost",size:"sm",onClick:x},{default:Me(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",Wde,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(b(),T("div",zde,O(C(n)("diff.loading")),1)):h.value.length>0?(b(),T("div",Ude,[ie(M5,{lines:h.value},null,8,["lines"])])):(b(),T("div",qde,O(C(n)("diff.noDiff")),1))],64)):(b(),T(Be,{key:1},[ie(Aa,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Me(()=>[w("span",jde,O(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(go,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",Vde,[c.value?(b(),T(Be,{key:0},[w("span",Kde,O(C(n)("diff.branch")),1),w("span",Gde,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(b(),T("span",Yde,[ie(Zt,{text:C(n)("diff.aheadTitle")},{default:Me(()=>[e.gitInfo.ahead>0?(b(),T("span",Zde,"↑"+O(e.gitInfo.ahead),1)):re("",!0)]),_:1},8,["text"]),ie(Zt,{text:C(n)("diff.behindTitle")},{default:Me(()=>[e.gitInfo.behind>0?(b(),T("span",Qde,"↓"+O(e.gitInfo.behind),1)):re("",!0)]),_:1},8,["text"])])):re("",!0)],64)):(b(),T("span",Xde,O(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(b(),T("div",Jde,[(b(!0),T(Be,null,st(e.changes,I=>(b(),be(Zt,{key:I.path,text:I.path},{default:Me(()=>[w("button",{type:"button",class:"ch-row",onClick:R=>m(I.path)},[w("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),w("span",tfe,O(a(I.path)),1)],8,efe)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(b(),T("div",nfe,[w("ul",sfe,[(b(!0),T(Be,null,st(_.value,({node:I,depth:R})=>(b(),T("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(b(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:N(R)}),onClick:B=>E(I)},[ie(qe,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",ife,O(I.name),1)],12,ofe)):(b(),be(Zt,{key:1,text:I.path},{default:Me(()=>[w("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:N(R)}),onClick:B=>m(I.path)},[w("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),w("span",lfe,O(I.name),1)],12,rfe)]),_:2},1032,["text"]))]))),128))])])):c.value?(b(),T("div",afe,O(C(n)("diff.clean")),1)):(b(),T("div",cfe,O(C(n)("diff.empty")),1))],64))]))}}),dfe=dt(ufe,[["__scopeId","data-v-7778610a"]]);function Hk(e,t){let n=null;gn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),ps(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const ffe=["type","value","placeholder","disabled","readonly"],hfe=Ge({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const s=n,o=Q();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)=>(b(),T("input",{ref_key:"el",ref:o,class:Pe(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,ffe))}}),zc=dt(hfe,[["__scopeId","data-v-340f0da2"]]),pfe={class:"search-wrap"},mfe={key:0,class:"tab-strip"},gfe={key:1,class:"state-row"},vfe={key:2,class:"state-row unavail"},yfe={key:3,class:"model-list"},kfe=["aria-selected","onClick","onMouseenter"],bfe={class:"check"},xfe={class:"model-main"},_fe={class:"model-name"},wfe={class:"model-id"},Sfe={key:0,class:"caps"},Cfe={class:"model-provider"},Afe={class:"model-ctx"},Mfe={key:0,class:"empty"},Efe={class:"footer-hint"},Tfe=Ge({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=D(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=Q(""),a=Q(null),c=Q(null),u=Q("all");Hk(c,a);const d=D(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const A of s.models)v.has(A.provider)||(v.add(A.provider),y.push({id:A.provider,label:A.provider}));return y}),f=D(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const L=(A.displayName??A.model).toLowerCase().includes(v),$=A.provider.toLowerCase().includes(v),_=A.id.toLowerCase().includes(v);return!v||L||$||_});return u.value!=="all"?y:y.sort((A,L)=>{const $=r(A.id)?1:0;return(r(L.id)?1:0)-$})}),h=D(()=>f.value),p=Q(0);Ze([l,u],()=>{p.value=0}),Ze(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ze(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const y=h.value[p.value];y&&o("select",y.id)}}gn(()=>{document.addEventListener("keydown",m)}),_n(()=>{document.removeEventListener("keydown",m)});function x(v){o("select",v)}function k(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(b(),be(Wr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=A=>o("close"))},{default:Me(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",pfe,[ie(zc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(b(),T("div",mfe,[(b(!0),T(Be,null,st(d.value,A=>(b(),be(Dt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(A.id)},{default:Me(()=>[Qe(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):re("",!0),e.loading?(b(),T("div",gfe,[ie(Ho,{size:"sm"}),w("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(b(),T("div",vfe,[ie(qe,{name:"alert-triangle",size:"lg"}),w("span",null,O(C(n)("model.unavailable")),1)])):(b(),T("div",yfe,[(b(!0),T(Be,null,st(h.value,A=>(b(),T("div",{key:A.id,class:Pe(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:L=>x(A.id),onMouseenter:L=>p.value=k(A)},[w("span",bfe,[A.id===e.current?(b(),be(qe,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",xfe,[w("span",_fe,O(A.displayName??A.model),1),w("span",wfe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(b(),T("span",Sfe,[(b(!0),T(Be,null,st(A.capabilities,L=>(b(),be(Fo,{key:L,variant:"info",size:"sm"},{default:Me(()=>[Qe(O(L),1)]),_:2},1024))),128))])):re("",!0)]),w("span",Cfe,O(A.provider),1),w("span",Afe,O(C(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),ie(Wn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:xt(L=>o("toggle-star",A.id),["stop"])},{default:Me(()=>[r(A.id)?(b(),be(qe,{key:0,name:"star",size:"md"})):(b(),be(qe,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,kfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(b(),T("div",Mfe,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):re("",!0)])),w("div",Efe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Nfe=dt(Tfe,[["__scopeId","data-v-e93073d7"]]),Ife={key:0,class:"ui-field__label"},$fe={key:1,class:"ui-field__error"},Lfe={key:2,class:"ui-field__hint"},Ffe=Ge({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),T("label",Ife,O(e.label),1)):re("",!0),Bn(t.$slots,"default",{},void 0,!0),e.error?(b(),T("span",$fe,O(e.error),1)):e.hint?(b(),T("span",Lfe,O(e.hint),1)):re("",!0)],2))}}),rh=dt(Ffe,[["__scopeId","data-v-49bce958"]]),Ofe=["value","disabled"],Rfe=Ge({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(b(),T("select",{class:Pe(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Bn(o.$slots,"default",{},void 0,!0)],42,Ofe))}}),Kv=dt(Rfe,[["__scopeId","data-v-92a040fd"]]),Bfe={class:"prov-list"},Dfe={key:0,class:"state-row"},Pfe={key:1,class:"state-row unavail"},Hfe={key:2,class:"empty"},Wfe={class:"prov-info"},zfe={class:"prov-type"},Ufe={key:0,class:"prov-url"},qfe={class:"prov-meta"},jfe={key:0},Vfe={class:"prov-actions"},Kfe={key:0,class:"add-section"},Gfe={key:0,class:"add-btns"},Yfe={key:1,class:"add-form"},Zfe=["value"],Qfe={key:0,class:"add-error"},Xfe={class:"form-btns"},Jfe={class:"footer-hint"},ehe=Ge({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=zr(),o=Q(null);Hk(o);const i=t;async function r(k){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=Q(!1),a=Hs({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Q(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function h(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function p(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}gn(()=>document.addEventListener("keydown",p)),_n(()=>document.removeEventListener("keydown",p));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function x(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(b(),be(Wr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:Me(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",Bfe,[e.loading?(b(),T("div",Dfe,[ie(Ho,{size:"sm"}),w("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(b(),T("div",Pfe,[ie(qe,{name:"alert-triangle",size:"md"}),w("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(b(),T("div",Hfe,O(C(n)("providers.empty")),1)):(b(!0),T(Be,{key:3},st(e.providers,v=>(b(),T("div",{key:v.id,class:"prov-row"},[ie(Zt,{text:x(v.status)},{default:Me(()=>[w("span",{class:Pe(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Yt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",Wfe,[w("span",zfe,O(v.type),1),v.baseUrl?(b(),T("span",Ufe,O(v.baseUrl),1)):re("",!0),w("span",qfe,[ie(Fo,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:Me(()=>[Qe(O(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(b(),T("span",jfe," · "+O(C(n)("providers.modelCount",{count:v.models.length})),1)):re("",!0)])]),w("div",Vfe,[ie(Zt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:Me(()=>[ie(Dt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:Me(()=>[Qe(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(Zt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:Me(()=>[ie(Dt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:Me(()=>[Qe(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?re("",!0):(b(),T("div",Kfe,[l.value?(b(),T("div",Yfe,[ie(rh,{label:C(n)("providers.fieldType")},{default:Me(()=>[ie(Kv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:Me(()=>[(b(),T(Be,null,st(u,v=>w("option",{key:v,value:v},O(v),9,Zfe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(rh,{label:C(n)("providers.fieldApiKey")},{default:Me(()=>[ie(zc,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ie(rh,{label:C(n)("providers.fieldBaseUrl")},{default:Me(()=>[ie(zc,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(rh,{label:C(n)("providers.fieldDefaultModel")},{default:Me(()=>[ie(zc,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(b(),T("div",Qfe,O(c.value),1)):re("",!0),w("div",Xfe,[ie(Dt,{variant:"primary",size:"sm",onClick:h},{default:Me(()=>[Qe(O(C(n)("providers.add")),1)]),_:1}),ie(Dt,{variant:"secondary",size:"sm",onClick:f},{default:Me(()=>[Qe(O(C(n)("common.cancel")),1)]),_:1})])])):(b(),T("div",Gfe,[ie(Dt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:Me(()=>[ie(qe,{name:"user",size:"sm"}),Qe(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),ie(Dt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:Me(()=>[ie(qe,{name:"user",size:"sm"}),Qe(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Dt,{variant:"primary",size:"sm",onClick:d},{default:Me(()=>[ie(qe,{name:"plus",size:"sm"}),Qe(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",Jfe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),the=dt(ehe,[["__scopeId","data-v-fb6f1365"]]),nhe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},she={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},ohe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},mg=Ge({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),T("svg",nhe,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(b(),T("svg",she,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(b(),T("svg",ohe,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),ihe={key:0,class:"center-body"},rhe={class:"center-text"},lhe={key:1,class:"nb"},ahe={class:"nb-lead"},che=["href"],uhe={class:"nb-or"},dhe={class:"nb-fallback"},fhe={class:"nb-fb-text"},hhe=["href"],phe={class:"nb-code-row"},mhe={class:"nb-code"},ghe={class:"nb-status"},vhe={class:"nb-status-text"},yhe={class:"nb-countdown"},khe={key:2,class:"center-body"},bhe={class:"center-text success-text"},xhe={class:"center-hint"},_he={class:"center-body"},whe={class:"center-text err-text"},She={class:"center-hint"},Che={class:"actions"},Ahe={class:"center-body"},Mhe={class:"center-text warn-text"},Ehe={class:"center-hint"},The={class:"actions"},Nhe=Ge({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=Q(!0),o=t,i=e,r=Q("starting"),l=Q(null),a=Q(0),c=Q(!1);let u=null,d=null;gn(async()=>{await f()}),_n(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}if(y.status==="authenticated"){m(),r.value="success",setTimeout(()=>{o("success"),o("close")},800);return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",h(),p(y.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function p(y){u&&clearTimeout(u),u=setTimeout(async()=>{const A=await i.onPollOAuthLogin();A?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):A?.status==="expired"||A?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function x(){await f()}async function k(){!l.value||!await oo(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const A=Math.floor(y/60),L=y%60;return`${A}:${String(L).padStart(2,"0")}`}return(y,A)=>(b(),be(Wr,{open:s.value,"onUpdate:open":A[0]||(A[0]=L=>s.value=L),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:Me(()=>[r.value==="starting"?(b(),T("div",ihe,[ie(Ho,{size:"md"}),w("span",rhe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(b(),T("div",lhe,[w("div",ahe,O(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Qe(O(C(n)("login.authorizeInBrowser"))+" ",1),ie(qe,{name:"external-link",size:"sm"})],8,che),w("div",uhe,O(C(n)("login.orDivider")),1),w("div",dhe,[w("div",fhe,[Qe(O(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,hhe),Qe(O(C(n)("login.fallbackSuffix")),1)]),w("div",phe,[w("span",mhe,O(l.value.userCode),1),ie(Dt,{class:Pe(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:Me(()=>[c.value?(b(),T(Be,{key:0},[ie(qe,{name:"check",size:"sm"}),Qe(" "+O(C(n)("login.copied")),1)],64)):(b(),T(Be,{key:1},[ie(qe,{name:"copy",size:"sm"}),Qe(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",ghe,[ie(Ho,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",vhe,O(C(n)("login.waitingAutoClose")),1),w("span",yhe,O(v(a.value)),1)])])):r.value==="success"?(b(),T("div",khe,[ie(mg,{kind:"success"}),w("span",bhe,O(C(n)("login.success")),1),w("span",xhe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(b(),T(Be,{key:3},[w("div",_he,[ie(mg,{kind:"expired"}),w("span",whe,O(C(n)("login.expiredTitle")),1),w("span",She,O(C(n)("login.expiredHint")),1)]),w("div",Che,[ie(Dt,{variant:"primary",onClick:x},{default:Me(()=>[Qe(O(C(n)("login.retry")),1)]),_:1}),ie(Dt,{variant:"secondary",onClick:g},{default:Me(()=>[Qe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(b(),T(Be,{key:4},[w("div",Ahe,[ie(mg,{kind:"error"}),w("span",Mhe,O(C(n)("login.errorTitle")),1),w("span",Ehe,O(C(n)("login.errorHint")),1)]),w("div",The,[ie(Dt,{variant:"primary",onClick:x},{default:Me(()=>[Qe(O(C(n)("login.retry")),1)]),_:1}),ie(Dt,{variant:"secondary",onClick:g},{default:Me(()=>[Qe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):re("",!0)]),_:1},8,["open","title"]))}}),Ihe=dt(Nhe,[["__scopeId","data-v-43cf561c"]]);function $he(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Lhe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Fhe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:$he(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=Lhe(t,h);c.set(p,(c.get(p)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),m=c.get(p.id)??c.get(p.root)??0,x=r[p.id]===!1?m:Math.max(p.sessionCount,m);let k=p.branch;!k&&i&&o===p.root&&(k=i),f.push({...p,sessionCount:x,branch:k})}return f}function Ohe(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 zC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}function Rhe(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 Bhe(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 Dhe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Phe(e){return Dhe.has(e.type)}function Hhe(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Whe(e,t,n=Hhe){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const E5=["blue","mono"],T5=["light","dark","system"],N5=14,zhe=12,Uhe=20;function qhe(){const e=cs(Lt.accent);return e&&E5.includes(e)?e:"blue"}function jhe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Vhe(){const e=cs(Lt.colorScheme);return e&&T5.includes(e)?e:"system"}function Khe(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 Wk(e){return Number.isFinite(e)?Math.min(Uhe,Math.max(zhe,Math.round(e))):N5}function Ghe(){const e=cs(Lt.uiFontSize);return e===null?N5:Wk(Number(e))}function Yhe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Wk(e)}px`)}const zk=Q(Vhe()),Uk=Q(qhe()),qk=Q(Ghe());Ze(zk,Khe,{immediate:!0});Ze(Uk,jhe,{immediate:!0});Ze(qk,Yhe,{immediate:!0});function Zhe(e){T5.includes(e)&&(zk.value=e,ms(Lt.colorScheme,e))}function Qhe(e){E5.includes(e)&&(Uk.value=e,ms(Lt.accent,e))}function Xhe(e){const t=Wk(e);qk.value=t,ms(Lt.uiFontSize,String(t))}const Jhe=600,epe=250,Wm=250,tpe=1e3,npe=160,Op=Q(!1);let da=[],ma=null,Rp=-Wm;function spe(){da=[],Rp=-Wm,Op.value=!1,ma!==null&&(clearTimeout(ma),ma=null)}function ope(){Op.value=!0,ma!==null&&clearTimeout(ma),ma=setTimeout(()=>{ma=null,da=[],Rp=-Wm,Op.value=!1},tpe)}function ipe(e){if(e<=0)return;const t=Date.now();da.push({time:t,chars:e});const n=t-Jhe;if(da=da.filter(l=>l.time>=n),t-Rp<Wm)return;Rp=t;const s=da[0]?.time??t,o=Math.max(t-s,epe);da.reduce((l,a)=>l+a.chars,0)/o*1e3>=npe&&ope()}function I5(){return{colorScheme:zk,accent:Uk,uiFontSize:qk,fastMoon:Op,setColorScheme:Zhe,setAccent:Qhe,setUiFontSize:Xhe,resetFastMoon:spe,recordMoonDelta:ipe}}function rpe(e,t,n){return e==="idle"&&!t&&!n}function jk(e,t){const n=cs(e);return n===null?t:n==="1"}const Vk=Q(jk(Lt.notifyOnComplete,!0)),Kk=Q(jk(Lt.notifyOnQuestion,!1)),Gk=Q(jk(Lt.notifyOnApproval,!1)),Yk=Q(typeof Notification<"u"?Notification.permission:"denied"),lpe="/favicon.ico";async function Zk(e,t,n){if(!n){e.value=!1,ms(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}Yk.value=s,s==="granted"&&(e.value=!0,ms(t,"1"))}function ape(e){return Zk(Vk,Lt.notifyOnComplete,e)}function cpe(e){return Zk(Kk,Lt.notifyOnQuestion,e)}function upe(e){return Zk(Gk,Lt.notifyOnApproval,e)}function Qk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function dpe(e){return{title:En.global.t("settings.notifyTitle"),body:Qk(e,En.global.t("settings.notifyFallback"))}}function fpe(e,t){return{title:En.global.t("settings.notifyQuestionTitle"),body:Qk(t,e,En.global.t("settings.notifyQuestionFallback"))}}function hpe(e,t){return{title:En.global.t("settings.notifyApprovalTitle"),body:Qk(t,e,En.global.t("settings.notifyApprovalFallback"))}}function Xk(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{Yk.value=i,i==="granted"&&UC(t,n,s)});return}UC(t,n,s)}}function UC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:lpe});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function ppe(e,t){Xk(Vk.value,t,dpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function mpe(e){Xk(Kk.value,e,fpe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function gpe(e){Xk(Gk.value,e,hpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function vpe(){return{notifyOnComplete:Vk,notifyOnQuestion:Kk,notifyOnApproval:Gk,notifyPermission:Yk,setNotifyOnComplete:ape,setNotifyOnQuestion:cpe,setNotifyOnApproval:upe,maybeNotifyCompletion:ppe,maybeNotifyQuestion:mpe,maybeNotifyApproval:gpe}}function ype(){return cs(Lt.soundOnComplete)==="1"}const iu=Q(ype());function kpe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let gg=null;function $5(){const e=kpe();if(!e)return null;if(gg===null)try{gg=new e}catch{return null}return gg}function L5(){if(!iu.value)return;const e=$5();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 qC=!1;function bpe(){if(qC||typeof window>"u")return;qC=!0;const e=()=>{L5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}bpe();function xpe(e){iu.value=e,ms(Lt.soundOnComplete,e?"1":"0"),e&&L5()}function jC(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 Jk(){const e=$5();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{jC(e,880,0,.16,.18),jC(e,1320,.1,.22,.16),Sr("sound: chime scheduled",{state:e.state})}catch(t){Sr("sound: failed to play",{error:String(t)})}}function _pe(){iu.value&&Jk()}function wpe(){iu.value&&Jk()}function Spe(){iu.value&&Jk()}function Cpe(){return{soundOnComplete:iu,setSoundOnComplete:xpe,maybePlayCompletionSound:_pe,maybePlayQuestionSound:wpe,maybePlayApprovalSound:Spe}}const Ape=1e3,Mpe=4096,VC=32*1024;function Epe(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await pt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:zC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=pt(),x=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:VC});y.outputPreview!==void 0&&x.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),x.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=x.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=pt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const y=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!A)&&!(A&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?Mpe:VC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{A&&o.add(v.id)}}));const x=e.tasksBySession[f]??[],k=new Map(x.map(v=>[v.id,v])),g=p.map(v=>{const y=k.get(v.id),A=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:A?.preview??y?.outputPreview,outputBytes:A?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:zC(g,x)}}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())},Ape))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Q(0);let d=null;return Ze(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ze(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let x;h&&f!==void 0?a(f):f!==void 0?x=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{x!==void 0&&clearTimeout(x)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function Tpe(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 Npe(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
302
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Tpe(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 Gv="/sessions/";function KC(e){const{pathname:t}=e;if(!t.startsWith(Gv))return;const n=t.slice(Gv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Ipe(e){return e===void 0||e.length===0?"/":`${Gv}${encodeURIComponent(e)}`}const $pe=50,Yv=5,Lpe=40402,Fpe=40410,Ope=40902,Rpe=2e3;function vg(e){return Lr(e)&&e.code===Ope}const Bpe=40904;function Dpe(e){return Lr(e)&&e.code===Bpe}const ia=Hs({}),lh=Hs({}),yg=Hs({}),Ki=Hs(new Set),zm=new Map,Ma=new Map,Bp=new Map;let Ppe=0;function Hpe(e){return{generation:zm.get(e)??0,pending:(Ma.get(e)?.size??0)>0}}function Zv(e){const t=++Ppe;zm.set(e,t);const n=Ma.get(e)??new Set;return n.add(t),Ma.set(e,n),t}function Qv(e,t){const n=Ma.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Ma.delete(e);const s=Bp.get(e);Bp.delete(e),s?.()}function Wpe(e){zm.delete(e),Ma.delete(e),Bp.delete(e)}function zpe(e,t){return!t.pending&&t.generation===(zm.get(e)??0)}function Upe(e,t){if((Ma.get(e)?.size??0)===0){t();return}Bp.set(e,t)}function qpe(e,t){const{t:n}=En.global,{confirm:s}=zr(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:h,appendSession:p,forgetSession:m,setActiveSessionId:x,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:A,hasLoadedMessages:L,refreshSessionStatus:$,refreshSessionGoal:_,persistSessionProfile:E,mergedWorkspaces:N,workspacesView:F,status:S,workspaceIdForSession:I,savePermissionToStorage:R,savePlanModeToStorage:B,saveSwarmModeToStorage:P,saveGoalModeToStorage:z,draftModes:W,saveUnread:X,saveActiveWorkspaceToStorage:U,saveHiddenWorkspacesToStorage:Z,goalErrorMessage:ce,resetFastMoon:fe,initialized:se,connectIssue:Y,selectedDiffPath:J,fileDiffLines:le,fileDiffLoading:He}=t;let de=!1;async function G(ee){if(e.messagesLoadingMoreBySession[ee])return;const Se=e.messagesBySession[ee];if(!Se||Se.length===0)return;const we=Se[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!1};try{const Re=await pt().listMessages(ee,{beforeId:we,pageSize:$pe}),Xe=[...Re.items].reverse();k(ee,at=>[...Xe,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ee]:Re.hasMore}}catch(Re){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ee]:!0},l("loadOlderMessages",Re,{sessionId:ee})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ee]:!1}}}function ae(ee){o.loadTasksForSession(ee),ne(ee),$(ee),_(ee),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,ee)||r.loadSkillsForSession(ee)}async function me(ee){const Se=e.activeSessionId;if(Se){J.value=ee,le.value=[],He.value=!0;try{const Re=await pt().getFileDiff(Se,ee);if(J.value!==ee)return;le.value=Npe(Re.diff)}catch(we){J.value===ee&&(le.value=[]),console.warn("[loadFileDiff] diff unavailable for",ee,we)}finally{J.value===ee&&(He.value=!1)}}}function q(){J.value=null,le.value=[],He.value=!1}async function ne(ee){try{const we=await pt().getGitStatus(ee);e.gitStatusBySession={...e.gitStatusBySession,[ee]:we}}catch{}}async function ge(){try{const Se=await pt().getAuth();return e.authReady=Se.ready,e.defaultModel=Se.defaultModel,e.managedProviderStatus=Se.managedProvider?.status??null,Y.value=null,"proceed"}catch(ee){return Lr(ee)&&(ee.code===401||ee.code===p5)?(Y.value=null,"server-auth-required"):(Y.value=(ee instanceof Error?ee.message:String(ee)).slice(0,140),"retry")}}async function ue(){let ee=!0;for(;;){const Se=await ge();if(Se!=="retry")return Se;ee&&(Y.value=null,ee=!1),await new Promise(we=>{setTimeout(we,Rpe)})}}async function ye(){try{const ee=pt();e.config=await ee.getConfig()}catch{}}async function j(ee){try{const we=await pt().setConfig(ee);return e.config=we,e.defaultModel=we.defaultModel??null,!0}catch(Se){return l("setConfig",Se),!1}}const te=100,pe=30,Ce=720*60*1e3;async function Ie(){const ee=pt(),Se=[];let we;for(;;){const Re=await ee.listSessions({pageSize:te,beforeId:we,excludeEmpty:!0});if(Se.push(...Re.items),!Re.hasMore||Re.items.length===0)break;we=Re.items[Re.items.length-1].id}return Se}function $e(ee){const Se=new Map(e.sessions.map(we=>[we.id,we.usage]));d(ee.map(we=>{const Re=Se.get(we.id);return Re!==void 0&&Bv(we.usage)&&!Bv(Re)?{...we,usage:Re}:we}))}async function he(ee){const Se=pt(),we=[],Re=Date.now(),Xe=en=>Re-new Date(en.updatedAt).getTime();let at,Mt=!1,Ft=!0;for(;;){let en;try{en=await Se.listSessions({workspaceId:ee,pageSize:Yv,beforeId:at,excludeEmpty:!0})}catch(ri){if(Ft)throw ri;break}if(Mt=en.hasMore,en.items.length===0)break;const os=en.items[en.items.length-1],Ao=Xe(os)>=Ce;if(!Ft&&Ao){const ri=en.items.findIndex(Qs=>Xe(Qs)>=Ce),is=ri>=0?ri+1:en.items.length;we.push(...en.items.slice(0,is)),Mt=en.hasMore||is<en.items.length;break}if(we.push(...en.items),Ft=!1,!en.hasMore||Ao)break;at=os.id}return{workspaceId:ee,page:{items:we,hasMore:Mt}}}async function Ne(){const ee=e.workspaces;if(ee.length===0){const Mt=await Ie().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Mt}const Se=await Promise.all(ee.map(Mt=>he(Mt.id).catch(()=>({workspaceId:Mt.id,page:{items:[],hasMore:!1}})))),we=[],Re={},Xe={},at={};for(const{workspaceId:Mt,page:Ft}of Se)we.push(...Ft.items),Re[Mt]=Ft.hasMore,Xe[Mt]=Ft.items.length>0?Ft.items[Ft.items.length-1].id:void 0,at[Mt]=Math.max(Ft.items.length,Yv);return e.sessionsHasMoreByWorkspace=Re,e.sessionsCursorByWorkspace=Xe,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,we.sort((Mt,Ft)=>new Date(Ft.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),we}async function Je(ee){if(e.sessionsLoadingMoreByWorkspace[ee]||e.sessionsHasMoreByWorkspace[ee]===!1)return;const Se=e.sessionsCursorByWorkspace[ee];if(Se!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!0};try{const we=await pt().listSessions({workspaceId:ee,pageSize:pe,beforeId:Se,excludeEmpty:!0}),Re=new Set(e.sessions.map(at=>at.id)),Xe=we.items.filter(at=>!Re.has(at.id));Xe.length>0&&d([...e.sessions,...Xe]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ee]:we.items.length>0?we.items[we.items.length-1].id:Se},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ee]:we.hasMore}}catch(we){l("loadMoreSessions",we)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ee]:!1}}}}async function it(){if(e.sessionsFullyLoaded)return;const ee=await Ie().catch(()=>null);if(ee===null)return;$e(ee),e.sessionsFullyLoaded=!0;const Se={};for(const we of e.workspaces)Se[we.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function At(){const ee=await pt().getMeta().catch(()=>null);ee!==null&&(e.serverVersion=ee.serverVersion,e.availableOpenInApps=ee.openInApps,e.dangerousBypassAuth=ee.dangerousBypassAuth,e.backend=ee.backend)}async function bt(){const ee=Date.now();let Se="accepted";$s("app:load:start"),e.loading=!0;const we=!se.value;let Re=!0;try{if(we&&await ue()==="server-auth-required"){Re=!1,Se="auth-required";return}const Xe=pt();await Promise.all([Xe.getHealth().catch(()=>null),At(),r.loadModels()]),we||await ge(),await ye(),await wt();const at=await Ne();$e(at);const Mt=at[0],Ft=e.activeWorkspaceId;!(Ft!==null&&N.value.some(Ao=>Ao.id===Ft))&&Mt&&vt(I(Mt)),Fs();const os=typeof window<"u"?KC(window.location):void 0;!e.activeSessionId&&os!==void 0&&(e.sessions.some(ri=>ri.id===os)||await qn(os))&&await wn(os,{urlMode:"replace"}),!e.activeSessionId&&at.length>0&&await wn(at[0].id,{urlMode:"replace"})}catch(Xe){Se="failed",l("load",Xe)}finally{e.loading=!1,Re&&(se.value=!0),$s("app:load:complete",{status:Se,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-ee})}}async function wt(){try{const ee=pt(),[Se,we]=await Promise.all([ee.listWorkspaces().catch(()=>[]),ee.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Gt(Se),e.fsHome=we.home||null,e.recentRoots=we.recentRoots}catch{}}function Gt(ee){const Se=Rf();return Object.keys(Se).length===0?ee:ee.map(we=>{const Re=Se[we.root];return Re!==void 0?{...we,name:Re}:we})}function vt(ee){e.activeWorkspaceId=ee,U(ee)}function ln(ee){vt(ee);const Se=e.sessions.filter(we=>I(we)===ee);if(Se.length>0){const we=Se[0];we&&we.id!==e.activeSessionId&&wn(we.id)}else x(void 0),kn(void 0,"push")}function Gn(ee){const Se=Rf()[ee.root],we=Se!==void 0?{...ee,name:Se}:ee;e.hiddenWorkspaceRoots.includes(we.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==we.root),Z(e.hiddenWorkspaceRoots));const Re=e.workspaces.findIndex(at=>at.id===we.id||at.root===we.root);if(Re===-1){e.workspaces=[we,...e.workspaces];return}const Xe=[...e.workspaces];Xe[Re]=we,e.workspaces=Xe}function Un(ee){if(ee.type==="workspaceCreated"||ee.type==="workspaceUpdated"){Gn(ee.workspace);return}const Se=e.workspaces.find(Re=>Re.id===ee.workspaceId)?.root??ee.root;if(Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],Z(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Re=>Re.id!==ee.workspaceId&&Re.root!==Se),e.activeWorkspaceId===ee.workspaceId||e.activeWorkspaceId===Se){const Re=F.value[0]?.id??null;if(e.activeWorkspaceId=Re,Re)U(Re);else try{Gc(Lt.activeWorkspace)}catch{}x(void 0),e.sessionLoading=!1,q(),kn(void 0,"replace")}}function Vt(){x(void 0),kn(void 0,"push")}function an(ee){vt(ee),Vt(),q()}async function es(ee){const Se=N.value.find(os=>os.id===ee);if(!Se)return null;const we=pt();let Re,Xe=Se.root;try{const os=await we.addWorkspace({root:Se.root});Re=os.id,Xe=os.root,Gn(os)}catch{}const at=r.draftModel.value??void 0,Mt=await we.createSession({workspaceId:Re,cwd:Xe,model:at});r.draftModel.value=null;const Ft=at!==void 0&&(!Mt.model||Mt.model.length===0)?{...Mt,model:at}:Mt;h(Ft),vt(Mt.workspaceId??Re??ee),await wn(Mt.id);const en=Mt.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[en]:!0},B()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[en]:!0},P()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[en]:!0},z()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,en}async function rt(ee,Se,we){if(!Ki.has(ee)){Ki.add(ee);try{const Re=await es(ee);if(!Re)return;await zn(Re,Se,we)}catch(Re){l("startSessionAndSendPrompt",Re)}finally{Ki.delete(ee)}}}async function In(ee,Se,we){if(!Ki.has(ee)){Ki.add(ee);try{const Re=await es(ee);if(!Re)return;const Xe=e.planModeBySession[Re]??!1,at=e.swarmModeBySession[Re]??!1,Mt=e.sessions.find(en=>en.id===Re),Ft=(Mt?.model&&Mt.model.length>0?Mt.model:e.defaultModel)??void 0;await E({model:Ft,planMode:Xe,swarmMode:at,permissionMode:e.permission,thinking:As(Ft)},Re),await r.activateSkill(Se,we,Re)}catch(Re){l("startSessionAndActivateSkill",Re)}finally{Ki.delete(ee)}}}async function gs(ee,Se){if(!Ki.has(ee)){Ki.add(ee);try{const we=await es(ee);if(!we)return;await i.openSideChatOn(we,Se)}catch(we){l("startSessionAndOpenSideChat",we)}finally{Ki.delete(ee)}}}async function yn(ee){const Se=ee.trim();if(!Se)return!1;const we=pt();try{const Re=await we.addWorkspace({root:Se});return Gn(Re),an(Re.id),!0}catch{return!1}}async function us(ee){try{return await pt().browseFs(ee)}catch{return{path:"",parent:null,entries:[]}}}async function ts(){try{return await pt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function kn(ee,Se){if(Se==="none"||typeof window>"u"||!window.history)return;const we=Ipe(ee);if(window.location.pathname!==we)try{Se==="push"?window.history.pushState(null,"",we):window.history.replaceState(null,"",we)}catch{}}async function qn(ee){try{const Se=await pt().getSession(ee);return e.sessions.some(we=>we.id===Se.id)||p(Se),!0}catch{return!1}}function $n(){const ee=KC(window.location);if(ee===void 0){x(void 0);return}if(ee!==e.activeSessionId){if(e.sessions.some(Se=>Se.id===ee)){wn(ee,{urlMode:"none"});return}(async()=>{if(await qn(ee)){await wn(ee,{urlMode:"none"});return}const Se=e.sessions[0];Se?await wn(Se.id,{urlMode:"replace"}):(x(void 0),kn(void 0,"replace"))})()}}let ds=!1;function Fs(){ds||typeof window>"u"||(ds=!0,window.addEventListener("popstate",$n))}async function wn(ee,Se){const we=L(ee),Re=!we&&u.has(ee);u.delete(ee);try{kn(ee,Se?.urlMode??"push"),e.sessionLoading=!we&&!Re,x(ee),fe(),e.unreadBySession[ee]&&(e.unreadBySession={...e.unreadBySession,[ee]:!1},X({[ee]:!1})),q();const Xe=e.sessions.find(at=>at.id===ee);if(Xe){const at=I(Xe);e.activeWorkspaceId!==at&&vt(at)}if(we){if(await A(ee)==="not-found")return}else if(await y(ee)==="not-found")return;ae(ee)}catch(Xe){l("selectSession",Xe,{sessionId:ee})}finally{e.activeSessionId===ee&&(e.sessionLoading=!1)}}function As(ee){const Se=ee===void 0?void 0:r.models.value.find(we=>we.model===ee||we.id===ee||we.displayName===ee);return Fa(Se,e.thinking)}async function zn(ee,Se,we){const Re=Zv(ee);c.add(ee),e.sendingBySession={...e.sendingBySession,[ee]:!0};const Xe=g();try{const at=pt(),Mt=[];Se&&Mt.push({type:"text",text:Se});for(const ys of we??[])ys.kind==="video"?Mt.push({type:"video",source:{kind:"file",fileId:ys.fileId}}):Mt.push({type:"image",source:{kind:"file",fileId:ys.fileId}});if(Mt.length===0)return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},!1;const Ft={id:Xe,sessionId:ee,role:"user",content:Mt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(ee,ys=>[...ys,Ft]);const en=e.sessions.find(ys=>ys.id===ee),os=(en?.model&&en.model.length>0?en.model:e.defaultModel)??void 0,Ao=e.planModeBySession[ee]??!1,ri=e.swarmModeBySession[ee]??!1,is=e.goalModeBySession[ee]??!1;if(is&&Se)try{await at.updateSession(ee,{goalObjective:Se.trim()})}catch(ys){return l("createGoal",ys,{sessionId:ee}),c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,Ms=>Ms.some(Es=>Es.id===Xe)?Ms.filter(Es=>Es.id!==Xe):Ms),!1}const Qs=await at.submitPrompt(ee,{content:Mt,model:os,thinking:As(os),permissionMode:e.permission,planMode:Ao,swarmMode:ri});return is&&(e.goalModeBySession={...e.goalModeBySession,[ee]:!1},z()),e.promptIdBySession={...e.promptIdBySession,[ee]:Qs.promptId},k(ee,ys=>{const Ms=ys.findIndex(or=>or.id===Xe);if(Ms===-1)return ys;const Es=[...ys];return Es[Ms]={...Es[Ms],promptId:Es[Ms].promptId??Qs.promptId},Es}),v()?.bindNextPromptId(ee,Qs.promptId),!0}catch(at){return c.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},k(ee,Mt=>Mt.some(Ft=>Ft.id===Xe)?Mt.filter(Ft=>Ft.id!==Xe):Mt),l("sendPrompt",at,{sessionId:ee}),!1}finally{Qv(ee,Re)}}async function Pt(ee,Se){const we=e.activeSessionId;if(we){if(a.value!=="idle"||c.has(we)){Ot(ee,Se);return}await zn(we,ee,Se)}}async function Ye(ee,Se){const we=e.activeSessionId;if(!we)return;const Re=e.queuedBySession[we]??[],Xe=[],at=[];for(const is of Re){const Qs=is.text.trim();Qs&&Xe.push(Qs),is.attachments?.length&&at.push(...is.attachments)}const Mt=ee.trim();if(Mt&&Xe.push(Mt),Se?.length&&at.push(...Se),Xe.length===0&&at.length===0)return;Re.length>0&&(e.queuedBySession={...e.queuedBySession,[we]:[]});const Ft=Xe.join(`
|
|
303
|
-
|
|
304
|
-
`);if(a.value==="idle"&&!c.has(we)){await zn(we,Ft,at);return}const en=[];Ft&&en.push({type:"text",text:Ft});for(const is of at)is.kind==="video"?en.push({type:"video",source:{kind:"file",fileId:is.fileId}}):en.push({type:"image",source:{kind:"file",fileId:is.fileId}});const os=g(),Ao={id:os,sessionId:we,role:"user",content:en,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(we,is=>[...is,Ao]);const ri=Zv(we);try{const is=pt(),Qs=e.sessions.find(Es=>Es.id===we),ys=(Qs?.model&&Qs.model.length>0?Qs.model:e.defaultModel)??void 0,Ms=await is.submitPrompt(we,{content:en,model:ys,thinking:As(ys),permissionMode:e.permission,planMode:e.planModeBySession[we]??!1,swarmMode:e.swarmModeBySession[we]??!1});if(k(we,Es=>{const or=Es.findIndex(ef=>ef.id===os);if(or===-1)return Es;const Wl=[...Es];return Wl[or]={...Wl[or],promptId:Wl[or].promptId??Ms.promptId},Wl}),Ms.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[we]:Ms.promptId},v()?.bindNextPromptId(we,Ms.promptId);return}try{await is.steerPrompts(we,[Ms.promptId])}catch{}}catch(is){k(we,Qs=>Qs.filter(ys=>ys.id!==os)),l("steer",is,{sessionId:we})}finally{Qv(we,ri)}}async function je(ee,Se){try{const Re=await pt().uploadFile({file:ee,name:Se});return{fileId:Re.id,name:Re.name,mediaType:Re.mediaType}}catch(we){return l("uploadImage",we),null}}function Ot(ee,Se){const we=e.activeSessionId;if(!we)return;const Re=e.queuedBySession[we]??[];e.queuedBySession={...e.queuedBySession,[we]:[...Re,{text:ee,attachments:Se}]}}function Ht(ee){const Se=c.delete(ee);if(e.sendingBySession={...e.sendingBySession,[ee]:!1},e.promptIdBySession[ee]!==void 0){const Re={...e.promptIdBySession};delete Re[ee],e.promptIdBySession=Re}ee===e.activeSessionId&&fe();const we=e.queuedBySession[ee]??[];if(we.length>0){const[Re,...Xe]=we;e.queuedBySession={...e.queuedBySession,[ee]:Xe},Re!==void 0&&zn(ee,Re.text,Re.attachments).then(at=>{if(!at){const Mt=e.queuedBySession[ee]??[];e.queuedBySession={...e.queuedBySession,[ee]:[Re,...Mt]}}})}return Se}function dn(ee,Se){Se.inFlightTurn===null&&(Se.status!=="idle"&&Se.status!=="aborted"||Ht(ee))}async function Qt(){const ee=e.activeSessionId;if(!ee)return;const Se=e.sessions.find(Xe=>Xe.id===ee);let we=e.promptIdBySession[ee];if(we===void 0){const Xe=Se?.currentPromptId;Xe!==void 0&&Xe.length>0&&!Xe.startsWith("pr_")&&(we=Xe)}const Re=pt();if(we!==void 0)try{if((await Re.abortPrompt(ee,we)).aborted)return;const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}catch(Xe){if(Lr(Xe)&&Xe.code===Lpe){const at={...e.promptIdBySession};delete at[ee],e.promptIdBySession=at}else{l("abortCurrentPrompt",Xe,{sessionId:ee});return}}try{await Re.abortSession(ee)}catch(Xe){l("abortCurrentPrompt",Xe,{sessionId:ee})}}function Sn(ee,Se){const we=e.approvalsBySession[ee]??[];e.approvalsBySession={...e.approvalsBySession,[ee]:we.filter(Re=>Re.approvalId!==Se)}}function Cn(ee,Se){const we=e.questionsBySession[ee]??[];e.questionsBySession={...e.questionsBySession,[ee]:we.filter(Re=>Re.questionId!==Se)}}async function Nt(ee,Se){const we=e.activeSessionId;if(we&&!lh[ee]){lh[ee]=!0;try{const Re=pt(),Xe={decision:Se.decision,scope:Se.scope,feedback:Se.feedback,selectedLabel:Se.selectedLabel};await Re.respondApproval(we,ee,Xe),Sn(we,ee)}catch(Re){vg(Re)?Sn(we,ee):l("respondApproval",Re,{sessionId:we})}finally{delete lh[ee]}}}async function fs(ee,Se){const we=e.activeSessionId;if(we&&!ia[ee]){ia[ee]="answer";try{await pt().respondQuestion(we,ee,Se),Cn(we,ee)}catch(Re){vg(Re)?Cn(we,ee):l("respondQuestion",Re,{sessionId:we})}finally{delete ia[ee]}}}async function ns(ee){const Se=e.activeSessionId;if(Se&&!ia[ee]){ia[ee]="dismiss";try{await pt().dismissQuestion(Se,ee),Cn(Se,ee)}catch(we){vg(we)?Cn(Se,ee):l("dismissQuestion",we,{sessionId:Se})}finally{delete ia[ee]}}}async function ro(ee){const Se=e.activeSessionId;if(Se&&!yg[ee]){yg[ee]=!0;try{await pt().cancelTask(Se,ee);const Re=e.tasksBySession[Se]??[];e.tasksBySession={...e.tasksBySession,[Se]:Re.map(Xe=>Xe.id===ee?{...Xe,status:"cancelled"}:Xe)}}catch(we){Dpe(we)||l("cancelTask",we,{sessionId:Se})}finally{delete yg[ee]}}}function Dn(ee){const Se=e.activeSessionId;Se?(e.planModeBySession={...e.planModeBySession,[Se]:ee},B(),E({planMode:ee})):W.planMode=ee}function ss(){const ee=e.activeSessionId,Se=ee?e.planModeBySession[ee]??!1:W.planMode;Dn(!Se)}function Ai(ee){const Se=e.activeSessionId;Se?(e.swarmModeBySession={...e.swarmModeBySession,[Se]:ee},P(),E({swarmMode:ee})):W.swarmMode=ee}async function Os(){const ee=e.activeSessionId,we=!(ee?e.swarmModeBySession[ee]??!1:W.swarmMode);we&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Ai(we)}function si(ee){const Se=e.activeSessionId;Se?(e.goalModeBySession={...e.goalModeBySession,[Se]:ee},z()):W.goalMode=ee}function So(){const ee=e.activeSessionId,Se=ee?e.goalModeBySession[ee]??!1:W.goalMode;si(!Se)}async function Pi(ee){const Se=ee.trim();if(!Se||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:Se}),variant:"primary"}))return;let we=e.activeSessionId;if(!we){const Re=e.activeWorkspaceId,Xe=Re&&F.value.some(at=>at.id===Re)?Re:F.value[0]?.id??null;if(!Xe)return;try{we=await es(Xe)??void 0}catch(at){l("createGoal",at);return}if(!we)return}try{await pt().updateSession(we,{goalObjective:Se})}catch(Re){l("createGoal",Re,{sessionId:we,message:ce(Re)});return}e.goalModeBySession[we]&&(e.goalModeBySession={...e.goalModeBySession,[we]:!1},z()),e.activeSessionId===we?await Pt(Se):await zn(we,Se)}function oi(ee){const Se=e.activeSessionId;Se&&Promise.resolve(pt().updateSession(Se,{goalControl:ee})).catch(we=>{l("controlGoal",we,{sessionId:Se,message:ce(we)})})}function vs(ee){e.permission=ee,R(ee),E({permissionMode:ee})}function Co(ee){const Se=[...e.warnings];Se.splice(ee,1),e.warnings=Se}async function Hi(ee,Se){try{await pt().updateSession(ee,{title:Se}),f(ee,Re=>({...Re,title:Se}))}catch(we){l("renameSession",we,{sessionId:ee})}}async function ii(ee,Se){const we=e.workspaces.find(Xe=>Xe.id===ee)?.root,Re=()=>{e.workspaces=e.workspaces.map(Xe=>Xe.id===ee?{...Xe,name:Se}:Xe)};try{if(await pt().updateWorkspace(ee,{name:Se}),we!==void 0){const Xe=Rf();we in Xe&&(delete Xe[we],Gx(Xe))}Re()}catch(Xe){if(we!==void 0&&Lr(Xe)&&Xe.code===Fpe){Gx({...Rf(),[we]:Se}),Re();return}l("renameWorkspace",Xe)}}async function Yn(ee){const Se=e.workspaces.find(at=>at.id===ee)?.root??N.value.find(at=>at.id===ee)?.root??ee,we=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Re=e.activeWorkspaceId===ee||e.activeWorkspaceId===Se,Xe=!!(we&&(we.cwd===Se||we.workspaceId===ee||I(we)===ee));Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],Z(e.hiddenWorkspaceRoots));try{await pt().deleteWorkspace(ee)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==ee&&at.root!==Se),Re||Xe){const at=F.value[0]?.id??null;if(e.activeWorkspaceId=at,at)U(at);else try{Gc(Lt.activeWorkspace)}catch{}}(Re||Xe)&&(x(void 0),e.sessionLoading=!1,q(),kn(void 0,"replace"))}async function Rs(ee){try{await pt().archiveSession(ee),m(ee),i.clearSideChatForSession(ee);const{[ee]:we,...Re}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Re,e.activeSessionId===ee){const Xe=e.sessions[0];Xe?await wn(Xe.id,{urlMode:"replace"}):(x(void 0),kn(void 0,"replace"))}}catch(Se){l("archiveSession",Se,{sessionId:ee})}}async function ut(ee){if(de)return;const Se=ee??e.activeSessionId;if(!Se){const Re=n("commands.export.noSession");$s("export:failed",{status:"no-session"}),l("exportSession",new Error(Re),{message:Re});return}de=!0;const we=Date.now();$s("export:start",{sessionId:Se});try{const Re=$te(),{blob:Xe,fileName:at}=await pt().exportSession(Se,Re);if(typeof document>"u")throw new Error("Document is unavailable");const Mt=URL.createObjectURL(Xe);let Ft;try{Ft=document.createElement("a"),Ft.href=Mt,Ft.download=at,document.body.append(Ft),Ft.click()}finally{Ft?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Mt)}catch{}},0)}$s("export:accepted",{sessionId:Se,status:"accepted",zipBytes:Xe.size,durationMs:Date.now()-we})}catch(Re){const Xe=typeof Re=="object"&&Re!==null?Re:void 0;$s("export:failed",{sessionId:Se,status:"failed",durationMs:Date.now()-we,errorName:typeof Xe?.name=="string"?Xe.name:typeof Re,errorCode:typeof Xe?.code=="number"?Xe.code:void 0,requestId:typeof Xe?.requestId=="string"?Xe.requestId:void 0,phase:typeof Xe?.phase=="string"?Xe.phase:void 0,httpStatus:typeof Xe?.status=="number"?Xe.status:void 0}),l("exportSession",Re,{sessionId:Se})}finally{de=!1}}async function ke(ee){try{const Se=await pt().restoreSession(ee);return h(Se),!0}catch(Se){return l("restoreSession",Se,{sessionId:ee}),!1}}function Fe(ee){return pt().listSessions({archivedOnly:!0,beforeId:ee?.beforeId,pageSize:ee?.pageSize??50})}async function Ut(){try{await pt().logout(),await ge(),await bt()}catch(ee){l("logout",ee)}}function lo(ee){const Se=e.activeSessionId;Se&&pt().compactSession(Se,ee).catch(we=>{l("compact",we,{sessionId:Se})})}async function Ke(ee){const Se=ee??e.activeSessionId;if(Se)try{const we=await pt().forkSession(Se);h(we),await wn(we.id)}catch(we){l("fork",we,{sessionId:Se})}}async function nt(ee=1){const Se=e.activeSessionId;if(!Se)return null;const we=(()=>{const Re=e.messagesBySession[Se]??[];for(let Xe=Re.length-1;Xe>=0;Xe--){const at=Re[Xe];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Mt=>Mt.type==="text").map(Mt=>Mt.text).join(`
|
|
305
|
-
`)}return null})();try{return await pt().undoSession(Se,ee),await y(Se),we}catch(Re){return l("undo",Re,{sessionId:Se}),null}}function ot(ee){const Se=e.activeSessionId;if(!Se)return;const we=e.queuedBySession[Se]??[];if(ee<0||ee>=we.length)return;const Re=[...we];Re.splice(ee,1),e.queuedBySession={...e.queuedBySession,[Se]:Re}}function Rt(ee,Se){const we=e.activeSessionId;if(!we)return;const Re=e.queuedBySession[we]??[];if(ee===Se||ee<0||ee>=Re.length||Se<0||Se>=Re.length)return;const Xe=[...Re],[at]=Xe.splice(ee,1);at!==void 0&&(Xe.splice(Se,0,at),e.queuedBySession={...e.queuedBySession,[we]:Xe})}async function ve(ee){const Se=e.activeSessionId;if(!Se)return[];try{return(await pt().listDirectory(Se,{path:ee,includeGitStatus:!0})).items}catch{return[]}}async function xe(ee){const Se=e.activeSessionId;if(!Se)return null;try{const Re=await pt().readFile(Se,{path:ee});return{path:Re.path,content:Re.content,encoding:Re.encoding,mime:Re.mime,languageId:Re.languageId,isBinary:Re.isBinary,size:Re.size,lineCount:Re.lineCount}}catch{return null}}const De=10485760;function Bt(ee){const Se=e.activeSessionId;return Se?pt().getFileDownloadUrl(Se,ee):null}async function Wt(ee,Se){const we=e.activeSessionId;if(!we)return!1;try{return await pt().openFile(we,{path:ee,line:Se}),!0}catch(Re){return l("openFile",Re,{sessionId:we}),!1}}async function An(ee){const Se=e.activeSessionId;if(!Se)return;const we=S.value.cwd||".";try{await pt().openInApp(Se,ee,we)}catch(Re){l("openInApp",Re,{sessionId:Se})}}async function jn(ee){const Se=e.activeSessionId;if(!Se)return!1;try{return await pt().revealFile(Se,{path:ee}),!0}catch(we){return l("revealFile",we,{sessionId:Se}),!1}}async function Ws(ee){if(/^(https?:|data:|blob:)/i.test(ee))return ee;const Se=e.activeSessionId;if(!Se)return ee;let we=ee;if(we.startsWith("/")){const Re=e.sessions.find(Xe=>Xe.id===Se)?.cwd;if(Re&&(we===Re||we.startsWith(Re.endsWith("/")?Re:`${Re}/`))){if(we=we.slice(Re.length).replace(/^\//,""),!we)return ee}else return ee}try{const Xe=await pt().readFile(Se,{path:we,length:De});return!Xe.isBinary||Xe.encoding!=="base64"||Xe.truncated?ee:`data:${Xe.mime};base64,${Xe.content}`}catch{return ee}}async function Wo(ee){const Se=e.activeSessionId;if(!Se)return[];try{return(await pt().searchFiles(Se,{query:ee,limit:20})).items.map(Xe=>({path:Xe.path,name:Xe.name}))}catch{return[]}}return{loadFileDiff:me,clearFileDiff:q,loadGitStatus:ne,checkAuth:ge,loadConfig:ye,updateConfig:j,listAllSessionsGlobal:Ie,load:bt,refreshServerMeta:At,loadWorkspaces:wt,loadMoreSessions:Je,loadAllSessions:it,selectWorkspace:vt,openWorkspace:ln,upsertWorkspacePreserveOrder:Gn,applyWorkspaceEvent:Un,clearActiveSession:Vt,openWorkspaceDraft:an,startSessionAndSendPrompt:rt,startSessionAndActivateSkill:In,startSessionAndOpenSideChat:gs,addWorkspaceByPath:yn,browseFs:us,getFsHome:ts,writeSessionUrl:kn,fetchSessionIntoList:qn,onSessionRoutePopState:$n,bindSessionRoute:Fs,selectSession:wn,submitPromptInternal:zn,finishPromptLocal:Ht,localTurnStartState:Hpe,isLocalTurnSnapshotCurrent:zpe,afterLocalTurnStartsSettle:Upe,handleSessionSnapshot:dn,sendPrompt:Pt,steerPrompt:Ye,uploadImage:je,enqueue:Ot,unqueue:ot,reorderQueue:Rt,abortCurrentPrompt:Qt,respondApproval:Nt,respondQuestion:fs,dismissQuestion:ns,pendingQuestionActions:ia,pendingApprovalActions:lh,cancelTask:ro,setPlanMode:Dn,togglePlanMode:ss,setSwarmMode:Ai,toggleSwarmMode:Os,setGoalMode:si,toggleGoalMode:So,createGoal:Pi,controlGoal:oi,setPermission:vs,dismissWarning:Co,renameSession:Hi,renameWorkspace:ii,deleteWorkspace:Yn,archiveSession:Rs,exportSession:ut,restoreSession:ke,loadArchivedSessions:Fe,logout:Ut,compact:lo,forkSession:Ke,undo:nt,listDir:ve,readFileContent:xe,getFileDownloadUrl:Bt,openWorkspaceFile:Wt,openInApp:An,revealWorkspaceFile:jn,resolveImageUrl:Ws,searchFiles:Wo,loadOlderMessages:G,refreshSessionSidecars:ae,isStartingFirstPrompt:()=>Ki.size>0}}const F5=Lt.starredModels;function jpe(){try{const e=cs(F5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Vpe(e){try{ms(F5,JSON.stringify(e))}catch{}}function Kpe(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Q([]),d=Q(jpe()),f=Q({}),h=Q({}),p=Q([]),m=Q(null);function x(U){if(!(U==null||U.length===0))return u.value.find(Z=>Z.id===U)??u.value.find(Z=>Z.model===U)}function k(){const U=e.activeSessionId?e.sessions.find(ce=>ce.id===e.activeSessionId):void 0,Z=U===void 0?m.value??e.defaultModel:U.model||e.defaultModel;return x(Z)?.id??Z??void 0}function g(){return x(k())}function v(U){const Z=Fa(g(),U);return e.thinking=Z,l(Z),Z}async function y(U){try{const ce=await pt().listSkills(U);f.value={...f.value,[U]:ce}}catch{}}async function A(U){try{const ce=await pt().listSkillsForWorkspace(U);h.value={...h.value,[U]:ce}}catch{}}async function L(){try{const U=pt();u.value=await U.listModels(),v(e.thinking)}catch(U){n("loadModels",U)}}async function $(){try{const U=await pt().refreshOAuthProviderModels();for(const Z of U.failed)n("refreshOAuthProviderModels",new Error(Z.reason),{message:Z.provider})}catch{}}async function _(){try{const U=pt();p.value=await U.listProviders()}catch(U){n("loadProviders",U)}}async function E(U){const Z=e.activeSessionId,ce=x(U),fe=e.thinking,se=Z?e.sessions.find(le=>le.id===Z)?.model:void 0,Y=k()!==(ce?.id??U),J=Uie(ce,fe,Y);if(!Z)return m.value=U,v(J),!0;a(Z,le=>({...le,model:U})),J!==fe&&(e.thinking=J,l(J));try{await pt().updateSession(Z,{model:U,thinking:J!==fe?J:void 0})}catch(le){return a(Z,He=>({...He,model:se??He.model})),J!==fe&&(e.thinking=fe,l(fe)),n("setModel",le,{sessionId:Z}),!1}return await s(Z),!0}function N(U){const Z=new Set(d.value);Z.has(U)?Z.delete(U):Z.add(U),d.value=Array.from(Z),Vpe(d.value)}async function F(U,Z,ce){const fe=ce??e.activeSessionId;if(!fe)return;const se=i.value==="idle"&&!r.has(fe),Y=`msg_skill_opt_${Date.now().toString(36)}`,J=se?Zv(fe):void 0;if(se){r.add(fe),e.sendingBySession={...e.sendingBySession,[fe]:!0};const le={id:Y,sessionId:fe,role:"user",content:[{type:"text",text:`/${U}${Z?` ${Z}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:U,skillArgs:Z}}};c(fe,He=>[...He,le])}try{await pt().activateSkill(fe,U,Z)}catch(le){se&&(r.delete(fe),e.sendingBySession={...e.sendingBySession,[fe]:!1},c(fe,He=>He.filter(de=>de.id!==Y))),n("activateSkill",le,{sessionId:fe})}finally{J!==void 0&&Qv(fe,J)}}async function S(U){try{await pt().addProvider(U),await Promise.all([_(),L()])}catch(Z){n("addProvider",Z)}}async function I(U){try{await pt().deleteProvider(U),await Promise.all([_(),L()])}catch(Z){n("deleteProvider",Z)}}async function R(U){try{const Z=await pt().refreshProvider(U);for(const ce of Z.failed)n("refreshProvider",new Error(ce.reason),{message:ce.provider});await Promise.all([_(),L()])}catch(Z){n("refreshProvider",Z)}}async function B(){try{const U=await pt().refreshAllProviders();for(const Z of U.failed)n("refreshAllProviders",new Error(Z.reason),{message:Z.provider});await Promise.all([_(),L()])}catch(U){n("refreshAllProviders",U)}}async function P(){try{return await pt().startOAuthLogin()}catch{return null}}async function z(){try{return await pt().pollOAuthLogin()}catch{return null}}async function W(){try{await pt().cancelOAuthLogin()}catch{}}function X(U){const Z=v(U);o({thinking:Z})}return{models:u,starredModelIds:d,providers:p,draftModel:m,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:y,loadSkillsForWorkspace:A,loadModels:L,refreshOAuthProviderModels:$,loadProviders:_,setModel:E,toggleStarModel:N,activateSkill:F,addProvider:S,deleteProvider:I,refreshProvider:R,refreshAllProviders:B,startOAuthLogin:P,pollOAuthLogin:z,cancelOAuthLogin:W,setThinking:X}}const O5="kimiWeb.compaction",Gpe=/^read[_-]?media(?:file)?$/i,Ype=/^data:([^;]+);base64,(.*)$/s,Zpe=/^<(image|video|audio)\s+path="([^"]+)">$/,Qpe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Xpe=/Mime type:\s*([^.\s]+)/i,Jpe=/Size:\s*(\d+)\s*bytes/i,eme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,tme="<system>Image compressed to fit model limits:",nme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function sme(e){return e.includes(tme)?e.replace(nme,""):e}function ome(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function ime(e){const t=Qpe.exec(e.trim());return t?{kind:t[1],path:ome(t[2])}:null}const rme=/^f_[A-Za-z0-9]{10,}$/;function lme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return rme.test(s)?s:void 0}function ame(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 cme(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 ume(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 dme(e,t){if(!Gpe.test(e))return;const n=cme(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=Zpe.exec(h);p&&(o=p[1],s=p[2]);const m=Xpe.exec(h);m?.[1]&&(i=m[1]);const x=Jpe.exec(h);x?.[1]&&(r=Number(x[1]));const k=eme.exec(h);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=ume(d);f&&(a=f)}if(a===null)return;const c=Ype.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=ame(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function fme(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
306
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
307
|
-
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
308
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
309
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function hme(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 pme(e,t){const n=e.split(`
|
|
310
|
-
`),s=t.split(`
|
|
311
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function mme(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:pme(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 gme(e){const t=`<prompt>
|
|
312
|
-
`,n=`
|
|
313
|
-
</prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):vme(e)}function vme(e){const t=e.split(`
|
|
314
|
-
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
315
|
-
`):e}function yme(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function kme(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
316
|
-
`);return gme(t)}function bme(e,t){const n=e.metadata?.origin??{},s=kme(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 xme(e,t,n){const{text:s,cron:o}=bme(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function _me(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 wme(e){return e.metadata?.origin?.kind==="compaction_summary"}function Sme(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Cme(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 Ame(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 Mme(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 R5(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 x=p.tools[m];if(x.status!=="running")continue;const k={...x,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(`
|
|
317
|
-
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
318
|
-
`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const x=h.blocks.at(-1);x&&x.kind==="text"?x.text+=`
|
|
319
|
-
`+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const x=h.blocks.at(-1);x&&x.kind==="thinking"?x.thinking+=`
|
|
320
|
-
`+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const x=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}),x&&(h.approval=mme(x),h.approvalId=x.approvalId)}else if(m.type==="toolResult"){const x=h.tools.findIndex(k=>k.id===m.toolCallId);if(x!==-1){const k=h.tools[x],g={...k,status:m.isError?"error":"ok",output:fme(m.output),media:m.isError?void 0:dme(k.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=Cme(g.output)),h.tools[x]=g;const v=h.blocks.find(y=>y.kind==="tool"&&y.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 x=h.tools.findIndex(y=>y.id===m.toolCallId);if(x===-1)continue;const k=h.tools[x];if(k.output!==void 0)continue;const g={...k,output:m.outputLines};h.tools[x]=g;const v=h.blocks.find(y=>y.kind==="tool"&&y.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(wme(h)){c();const g=h.metadata?.[O5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(v=>v.type==="text").map(v=>v.text).join(`
|
|
321
|
-
`),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=yme(h);if(c(),g!==void 0){i.push(xme(h,r++,g));continue}if(!_me(h))continue;const v=h.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",A=v?.kind==="plugin_command"&&v?.trigger==="user-slash",L=[],$=[];for(const _ of h.content){if(_.type==="text")if(y)L.push(v.skillArgs??"");else if(A)L.push(v.commandArgs??"");else{const N=ime(_.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const S=lme(N.path);if(S){$.push({url:n(S),kind:N.kind,alt:S,fileId:S});continue}}const F=sme(_.text);if(F!==_.text&&F.trim().length===0)continue;L.push(F)}const E=f(_);E&&$.push({url:E.url,kind:E.kind,alt:_.type==="file"?_.name:void 0,fileId:E.fileId})}i.push({id:h.id,role:"user",no:r++,text:L.join(`
|
|
322
|
-
`),images:$.length>0?$:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:A?{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;Sme(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 x=a;if(x===null)continue;const k=Ame(h.content);if(x.promptId!==void 0&&x.foldedSigs.some(g=>Mme(g,k))){d(x,h.content);continue}x.foldedSigs.push(k),u(x,h.content)}return c(!0),i}function Eme(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=Q({}),l=D(()=>{const E=e.activeSessionId;if(!E)return null;const N=r.value[E];return N?{parentId:E,agentId:N.agentId}:null}),a=D(()=>l.value?.parentId??null),c=D(()=>l.value!==null),u=D(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=D(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(N=>N.id===E.agentId&&N.status==="running"):!1}),f=D(()=>{const E=l.value;if(!E)return[];const N=e.sideChatMessagesByAgent[E.agentId]??[];return R5(N,[],F=>pt().getFileUrl(F),d.value)});function h(E,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:N(e.sideChatMessagesByAgent[E]??[])}}function p(E,N){h(E,F=>[...F,N])}function m(E){h(E,N=>{const F=[...N].reverse().findIndex(I=>I.role==="user");if(F===-1)return N;const S=N.length-1-F;return N.filter((I,R)=>R!==S)})}function x(E,N){h(E,F=>{const S=[...F];for(let I=S.length-1;I>=0;I-=1){const R=S[I];if(R.role==="user")return S[I]={...R,promptId:R.promptId??N},S}return F})}function k(E,N,F){F&&h(E,S=>{const I=S.at(-1);if(I?.role==="assistant"){const R=I.content[0],B=R?.type==="text"?R.text:"";return[...S.slice(0,-1),{...I,content:[{type:"text",text:`${B}${F}`}]}]}return[...S,{id:s(),sessionId:N,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function g(E,N,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!F)return;const I=(e.sideChatMessagesByAgent[E]??[]).at(-1);(I?.role==="assistant"&&I.content[0]?.type==="text"?I.content[0].text:"").trim().length>0||k(E,N,F)}async function v(E){const N=e.activeSessionId;N&&await y(N,E)}async function y(E,N){if(!r.value[E]){let F;try{({agentId:F}=await pt().startBtw(E))}catch(S){n("openSideChat",S,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[F]:e.sideChatMessagesByAgent[F]??[]},r.value={...r.value,[E]:{agentId:F}},o(),i()?.markSideChannelAgent(F)}N&&N.trim()&&await A(E,N.trim())}async function A(E,N){const F=r.value[E],S=N.trim();if(!F||!S)return;const I=E,R=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!0};const B={id:s(),sessionId:I,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(R,B);try{const P=e.sessions.find(U=>U.id===I),z=(P?.model&&P.model.length>0?P.model:e.defaultModel)??void 0,W=z===void 0?void 0:t.models().find(U=>U.model===z||U.id===z||U.displayName===z),X=await pt().submitPrompt(I,{content:[{type:"text",text:S}],agentId:R,model:z,thinking:Fa(W,e.thinking),permissionMode:e.permission,planMode:e.planModeBySession[I]??!1,swarmMode:e.swarmModeBySession[I]??!1});x(R,X.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],X.userMessageId]}}catch(P){n("sendSideChatPrompt",P,{sessionId:I}),m(R),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!1}}}function L(){const E=e.activeSessionId;if(!E)return;const{[E]:N,...F}=r.value;r.value=F}async function $(E){const N=l.value;N&&await A(N.parentId,E)}function _(E){if(!r.value[E])return;const{[E]:N,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:k,finishSideChatAgent:g,openSideChat:v,openSideChatOn:y,closeSideChat:L,sendSideChatPrompt:$,clearSideChatForSession:_}}const Tme="kimiWeb.optimisticUserMessage",GC="Sub Agent";function Nme(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Ime(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function $me(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function kg(e){return e.role==="user"&&e.metadata?.[Tme]===!0}function Lme(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Fme(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Ome=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function YC(e){let t="",n=0;for(const s of e.content)s.type==="text"?Ome.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 Rme(e,t){const n=YC(e),s=YC(t);return n.text===s.text&&n.media===s.media}function Bme(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(kg(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(kg(o)&&Fme(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(kg(o)&&Rme(o,t))return s}return-1}function Dme(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Pme(e,t,n){const s=Ime(e);switch($me(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[O5]: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"&&!Lme(t.message)){const a=Bme(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]=Dme(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===GC&&a.description!==GC?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;s.goalVersionBySession[o]=(s.goalVersionBySession[o]??0)+1,t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?En.global.t("warnings.errorLabel"):En.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Hme(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Wme(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"||Ia(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:Hme(a.status)}]:[]})}}return[]}const zme=["queued","working","suspended","completed","failed"];function B5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Ume(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function qme(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:B5(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=Ume();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 jme(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of zme)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function Vme(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:B5(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=I5(),Qi=vpe(),Od=Cpe(),D5=Lt.permission,P5=Lt.activeWorkspace,H5=Lt.thinking,W5=Lt.planMode,z5=Lt.swarmMode,U5=Lt.goalMode,ZC=40401,q5=Lt.onboarded,Kme=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Gc(Lt.codeFont);Gc(Lt.theme);function Gme(){try{const e=cs(D5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Yme(e){try{ms(D5,e)}catch{}}function Zme(){try{const e=cs(H5);if(e&&Kme.test(e))return e}catch{}return"high"}function Qme(e){try{ms(H5,e)}catch{}}function bg(e){const t=cs(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 e2(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ms(e,JSON.stringify(n))}catch{}}function j5(){e2(W5,Ae.planModeBySession)}function V5(){e2(z5,Ae.swarmModeBySession)}function K5(){e2(U5,Ae.goalModeBySession)}function Xme(){try{return cs(P5)}catch{return null}}const G5=Lt.hiddenWorkspaces;function Jme(){try{const e=cs(G5);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function e1e(e){try{ms(G5,JSON.stringify(e))}catch{}}function t1e(e){try{ms(P5,e)}catch{}}function n1e(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 Ae=Hs({...Nme(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:Gme(),thinking:Zme(),planModeBySession:bg(W5),swarmModeBySession:bg(z5),goalModeBySession:bg(U5),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Ly(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Xme(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Jme(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Um=Hs({planMode:!1,swarmMode:!1,goalMode:!1});function Y5(e){Ae.sessions=e}function qm(e,t){Ae.sessions=Ae.sessions.map(n=>n.id===e?t(n):n)}function s1e(e){Ae.sessions=[e,...Ae.sessions.filter(t=>t.id!==e.id)]}function o1e(e){Ae.sessions=[...Ae.sessions,e]}function i1e(e){Ae.sessions=Ae.sessions.filter(t=>t.id!==e)}function Z5(){const e=Ae.activeSessionId;e&&Ae.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ae.unreadBySession={...Ae.unreadBySession,[e]:!1},Fy({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Lt.unread&&(Ae.unreadBySession=Ly(),Z5())});function Xv(){if(wi===null||!wi.health().stale)return;$s("ws:stale-reconnect",{sessionId:Ae.activeSessionId,status:"stale"}),Sr("ws: stale socket on focus, reconnecting",{activeSessionId:Ae.activeSessionId}),wi.reconnect();const e=Ae.activeSessionId;e&&Hp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(Z5(),Xv())});typeof window<"u"&&(window.addEventListener("focus",Xv),window.addEventListener("online",Xv));function t2(e){Ae.activeSessionId=e}function r1e(e){Ae.messagesBySession=e}function l1e(e,t){Ae.messagesBySession={...Ae.messagesBySession,[e]:t}}function Q5(e,t){Ae.messagesBySession={...Ae.messagesBySession,[e]:t(Ae.messagesBySession[e]??[])}}function a1e(e){const{[e]:t,...n}=Ae.messagesBySession;Ae.messagesBySession=n}function X5(e){wi?.unsubscribe(e),$1e(e),Dp.flush(),i1e(e),a1e(e),delete Ae.approvalsBySession[e],delete Ae.questionsBySession[e],delete Ae.tasksBySession[e],delete Ae.goalBySession[e],delete Ae.gitStatusBySession[e],delete Ae.lastSeqBySession[e],delete Ae.compactionBySession[e],delete Ae.messagesLoadingMoreBySession[e],delete Ae.messagesHasMoreBySession[e],delete Ae.messagesLoadMoreErrorBySession[e],delete Jv[e],Pp.delete(e),Ih.delete(e),u8.delete(e),n2.delete(e),Wpe(e),delete Ae.queuedBySession[e],delete Ae.promptIdBySession[e],delete Ae.sendingBySession[e],delete Ae.planModeBySession[e],delete Ae.swarmModeBySession[e],delete Ae.goalModeBySession[e],j5(),V5(),K5()}const J5=Q(null),e8=Q([]),t8=Q(!1),n8=Q(!1),s8=Q(null);async function Xd(e){let t;try{t=await pt().getSessionStatus(e)}catch{return}qm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ae.swarmModeBySession={...Ae.swarmModeBySession,[e]:t.swarmMode},Ae.planModeBySession={...Ae.planModeBySession,[e]:t.planMode}}async function c1e(e){const t=Ae.goalVersionBySession[e]??0;let n;try{n=await pt().getSessionGoal(e)}catch{return}if((Ae.goalVersionBySession[e]??0)!==t)return;const s={...Ae.goalBySession};n===null||n.status==="complete"?delete s[e]:s[e]=n,Ae.goalBySession=s}function o8(e,t){const n=t??Ae.activeSessionId;return n?Promise.resolve(pt().updateSession(n,e)).then(()=>Xd(n)).catch(()=>{}):Promise.resolve()}const i8=Lt.conversationToc;function u1e(){try{const e=cs(i8);return e===null?!0:e==="true"}catch{return!0}}function d1e(e){try{ms(i8,e?"true":"false")}catch{}}const r8=Q(u1e());function f1e(e){r8.value=e,d1e(e)}function h1e(e){try{return cs(e)??""}catch{return""}}const l8=Q(h1e(q5)==="1");function p1e(e){l8.value=e;try{ms(q5,e?"1":"0")}catch{}}let wi=null,QC=0;function a8(){return QC+=1,`msg_opt_${Date.now().toString(36)}_${QC}`}const n2=new Set;function m1e(e,t,n){const s={sessions:Ae.sessions,activeSessionId:Ae.activeSessionId,messagesBySession:Ae.messagesBySession,approvalsBySession:Ae.approvalsBySession,planReviewByToolCallId:Ae.planReviewByToolCallId,questionsBySession:Ae.questionsBySession,tasksBySession:Ae.tasksBySession,goalBySession:Ae.goalBySession,goalVersionBySession:Ae.goalVersionBySession,lastSeqBySession:Ae.lastSeqBySession,compactionBySession:Ae.compactionBySession,config:Ae.config,warnings:Ae.warnings},o=Pme(s,e,{sessionId:t,seq:n});Y5(o.sessions),t2(o.activeSessionId),r1e(o.messagesBySession),Ae.approvalsBySession=o.approvalsBySession,Ae.planReviewByToolCallId=o.planReviewByToolCallId,Ae.questionsBySession=o.questionsBySession,Ae.tasksBySession=o.tasksBySession,Ae.goalBySession=o.goalBySession,Ae.goalVersionBySession=o.goalVersionBySession,Ae.lastSeqBySession=o.lastSeqBySession,Ae.compactionBySession=o.compactionBySession,Ae.config=o.config??null,Ae.warnings=o.warnings,e.type==="configChanged"&&(Ae.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Mn.loadModels(),Mn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ae.swarmModeBySession={...Ae.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ae.planModeBySession={...Ae.planModeBySession,[e.sessionId]:e.planMode}))}function g1e(e,t){const n=Ae.lastSeqBySession[t.sessionId]??0;m1e(e,t.sessionId,t.seq);const s=eo.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:o}=s,i=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&eo.appendSideChatAssistantText(o,i,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?eo.finishSideChatAgent(o,i):e.type==="taskProgress"&&e.taskId===o?eo.appendSideChatAssistantText(o,i,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&eo.finishSideChatAgent(o,i,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;Ae.promptIdBySession[o]!==e.message.promptId&&(Ae.promptIdBySession={...Ae.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ae.activeSessionId&&xr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&t.seq>n&&B0e(e.sessionId,e.status),e.type==="questionRequested"&&D0e(e.sessionId,e.question),e.type==="approvalRequested"&&P0e(e.sessionId,e.approval)}const Dp=Whe(({appEvent:e,meta:t})=>g1e(e,t),({appEvent:e})=>Phe(e));function c8(){if(wi!==null||typeof WebSocket>"u")return;$s("ws:connection",{status:"connecting"}),Ae.connection="connecting",wi=pt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ht.applyWorkspaceEvent(t);return}Dp({appEvent:t,meta:n})},onResync(t,n,s){$s("ws:resync",{sessionId:t,status:"required",seq:n}),Dp.flush(),Pp.add(t),Hp.request(t)},onError(t,n,s){$s("ws:error",{status:"failed",errorCode:t,fatal:s}),s2({severity:"error",title:En.global.t("warnings.wsTitle"),message:n,details:[Zn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){$s("ws:connection",{status:t?"connected":"disconnected"}),Ae.connected=t,Ae.connection=t?"connected":"disconnected",t&&(S1e(),ht.refreshServerMeta())}})}const Jv={},Pp=new Set,Ih=new Set,u8=new Set;function v1e(e){return Lr(e)&&e.code===ZC?!0:typeof e=="object"&&e!==null&&e.code===ZC}function Zn(e,t){if(!(t==null||t===""))return{label:En.global.t(`warnings.details.${e}`),value:d8(t)}}function d8(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 y1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function k1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function b1e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function x1e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function XC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function _1e(e,t,n){const s=u5(t),o=Lr(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Zn("operation",e),Zn("sessionId",n??Ae.activeSessionId),Zn("connection",Ae.connection),Zn("timestamp",x1e(i??Date.now()))];return s?l.push(Zn("duration",XC(r)),Zn("request",`${t.method} ${t.path}`),Zn("endpoint",t.url),Zn("requestId",t.requestId),Zn("phase",t.phase),Zn("timeout",`${t.timeoutMs}ms`),Zn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Zn("contentType",t.contentType),Zn("responsePreview",t.bodyPreview),Zn("cause",t.cause)):o?l.push(Zn("duration",XC(r)),Zn("code",t.code),Zn("requestId",t.requestId),Zn("message",t.message),Zn("details",t.details)):l.push(Zn("errorName",y1e(t)),Zn("message",k1e(t)??d8(t)),Zn("stack",b1e(t))),l.filter(a=>a!==void 0)}function w1e(e,t,n={}){const s=u5(t),o=Lr(t),i=n.title??(s?En.global.t("warnings.daemonNetworkTitle"):o?En.global.t("warnings.daemonApiTitle"):En.global.t("warnings.operationFailedTitle")),r=n.message??(s?En.global.t("warnings.daemonNetworkMessage"):o?t.message:En.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:_1e(e,t,n.sessionId)}}function s2(e){Ae.warnings=[...Ae.warnings,e]}function S1e(){const e=En.global.t("warnings.wsTitle"),t=Ae.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ae.warnings.length&&(Ae.warnings=t)}function jm(e,t,n){s2(w1e(e,t,n))}const C1e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function A1e(e){if(!Lr(e))return;const t=C1e[e.code];return t?En.global.t(t):void 0}async function M1e(e){if(X5(e),Ae.activeSessionId!==e)return;const t=Ae.sessions[0];t?await ht.selectSession(t.id,{urlMode:"replace"}):(t2(void 0),Ae.sessionLoading=!1,ht.writeSessionUrl(void 0,"replace"))}const JC=new Set;async function E1e(e){if(!JC.has(e)){JC.add(e);try{const t=await pt().getSessionWarnings(e),n=En.global.t("warnings.noteLabel");for(const s of t)s2(`${n}: ${s.message}`)}catch{}}}async function o2(e){const t=ht.localTurnStartState(e);try{const s=await pt().getSessionSnapshot(e);if(!Ae.sessions.some(a=>a.id===e))return"ok";Dp.flush();const o=Ae.lastSeqBySession[e]??0,i=Jv[e];if(!(Pp.has(e)||Wp.has(e))&&i!==void 0&&i===s.epoch&&o>s.asOfSeq)return Ih.delete(e)||(Ih.add(e),Hp.request(e)),"ok";if(!ht.isLocalTurnSnapshotCurrent(e,t))return ht.afterLocalTurnStartsSettle(e,()=>{Hp.request(e)}),"ok";const l=Bv(s.session.usage);qm(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})),l1e(e,Ohe(Ae.messagesBySession[e]??[],s.messages)),Ae.tasksBySession={...Ae.tasksBySession,[e]:Rhe(s.subagents,Ae.tasksBySession[e]??[])},Ae.messagesHasMoreBySession={...Ae.messagesHasMoreBySession,[e]:s.hasMoreMessages},Ae.approvalsBySession={...Ae.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&&(Ae.planReviewByToolCallId={...Ae.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}return Ae.questionsBySession={...Ae.questionsBySession,[e]:s.pendingQuestions},Ae.lastSeqBySession={...Ae.lastSeqBySession,[e]:s.asOfSeq},Jv[e]=s.epoch,Pp.delete(e),Ih.delete(e),ht.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,status:s.session.status}),c8(),wi&&(wi.seedSnapshot(e,s),wi.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),I1e(e)),Wp.delete(e),l&&Xd(e),E1e(e),"ok"}catch(n){return v1e(n)?(await M1e(e),"not-found"):(jm("getSessionSnapshot",n,{title:En.global.t("warnings.sessionSnapshotTitle"),message:En.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Hp=Bhe(o2);function T1e(e){return Object.prototype.hasOwnProperty.call(Ae.messagesBySession,e)}const N1e=4,_r=[],Wp=new Set;function I1e(e){const t=_r.indexOf(e);for(t!==-1&&_r.splice(t,1),_r.unshift(e);_r.length>N1e;){let n=-1;for(let o=_r.length-1;o>=0;o--)if(_r[o]!==Ae.activeSessionId){n=o;break}if(n===-1)break;const[s]=_r.splice(n,1);if(s===void 0)break;wi?.unsubscribe(s),Wp.add(s)}}function $1e(e){const t=_r.indexOf(e);t!==-1&&_r.splice(t,1),Wp.delete(e)}async function L1e(e){return o2(e)}function Vm(e){if(!e||e.status!=="running")return!1;const t=e.id,n=eo.sideChatTargetBySession.value[t]?.agentId,o=(Ae.tasksBySession[t]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ae.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function i2(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return En.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}mo`:`${Math.round(r/365)}y`}catch{return e}}const F1e=3e4,Rd=Q(0);let xg=null;function O1e(){xg===null&&(xg=setInterval(()=>{Rd.value=(Rd.value+1)%Number.MAX_SAFE_INTEGER},F1e),xg.unref?.())}function R1e(e,t){const n=e.split(`
|
|
323
|
-
`),s=t.split(`
|
|
324
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function B1e(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:R1e(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 D1e(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 P1e(e){const t=Ae.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 H1e(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=En.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=En.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??P1e(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 W1e=D(()=>{const e=Ae.sessions.find(n=>n.id===Ae.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ae.workspaceName,branch:t}}),z1e=D(()=>(Rd.value,Ae.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:i2(e.updatedAt,e.status),status:e.status,busy:Vm(e)})))),U1e=D(()=>Ae.activeSessionId??""),q1e=D(()=>{const e=Ae.activeSessionId;if(e)return Mn.skillsBySession.value[e]??[];const t=Gm.value;return t?Mn.skillsByWorkspace.value[t]??[]:[]}),j1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.sendingBySession[e]??!1:!1}),V1e=D(()=>ht.isStartingFirstPrompt()),eo=Eme(Ae,{pushOperationFailure:jm,nextOptimisticMsgId:a8,connectEventsIfNeeded:c8,getEventConn:()=>wi,models:()=>Mn.models.value}),Jd=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=eo.sideChatTargetBySession.value[e]?.agentId;return(Ae.tasksBySession[e]??[]).filter(n=>n.id!==t)}),f8=Epe(Ae,Jd),K1e=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=new Set(Ae.sideChatUserMessageIdsBySession[e]??[]),n=(Ae.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ae.approvalsBySession[e]??[];return R5(n,s,o=>pt().getFileUrl(o),Km.value!=="idle",Ae.planReviewByToolCallId)}),G1e=D(()=>(f8.taskClock.value,Jd.value.map(H1e))),h8=D(()=>qme(Jd.value)),Y1e=D(()=>Vme(Jd.value)),mc=D(()=>{const e=Ae.activeSessionId;return e?Ae.goalBySession[e]??null:null}),Z1e=D(()=>{const e=Ae.activeSessionId;return e?Wme(Ae.messagesBySession[e]??[]):[]}),Q1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.compactionBySession[e]??null:null}),X1e=D(()=>Ae.connection),J1e=D(()=>Ae.loading),e0e=D(()=>Ae.sessionLoading),t0e=D(()=>{const e=Ae.activeSessionId;return e?Ae.messagesLoadingMoreBySession[e]??!1:!1}),n0e=D(()=>{const e=Ae.activeSessionId;return e?Ae.messagesHasMoreBySession[e]??!1:!1}),s0e=D(()=>{const e=Ae.activeSessionId;return e?Ae.messagesLoadMoreErrorBySession[e]??!1:!1}),o0e=D(()=>Ae.serverVersion),i0e=D(()=>Ae.backend),r0e=D(()=>Ae.dangerousBypassAuth);function l0e(){Ae.dangerousBypassAuth=!1}const a0e=D(()=>Ae.permission),c0e=D(()=>Ae.thinking),p8=D(()=>{const e=Ae.activeSessionId;return e?Ae.planModeBySession[e]??!1:Um.planMode}),u0e=D(()=>{const e=Ae.activeSessionId;return e?Ae.swarmModeBySession[e]??!1:Um.swarmMode}),d0e=D(()=>{const e=Ae.activeSessionId;return e?Ae.goalModeBySession[e]??!1:Um.goalMode}),f0e=D(()=>{const e=jme(h8.value);return{plan:p8.value,goal:mc.value&&mc.value.status!=="complete"?{status:mc.value.status,turnsUsed:mc.value.turnsUsed,elapsedMs:mc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),h0e=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=pt();return(Ae.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)}))}))}),p0e=D(()=>Ae.warnings),m0e=D(()=>{const e=Ae.activeSessionId;return e?(Ae.questionsBySession[e]??[]).map(D1e):[]}),g0e=D(()=>{const e=Ae.activeSessionId;return e?(Ae.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:B1e(t),agentName:t.agentName})):[]}),Km=D(()=>{const e=Ae.activeSessionId;if(!e)return"idle";if((Ae.approvalsBySession[e]??[]).length>0)return"awaiting-approval";if((Ae.questionsBySession[e]??[]).length>0)return"awaiting-question";const s=Ae.sessions.find(o=>o.id===e);return Vm(s)?"running":"idle"}),Mn=Kpe(Ae,{pushOperationFailure:jm,refreshSessionStatus:Xd,persistSessionProfile:o8,activity:Km,inFlightPromptSessions:n2,saveThinkingToStorage:Qme,updateSession:qm,updateSessionMessages:Q5}),zp=D(()=>{const e=Ae.activeSessionId;if(!e)return null;const t=Ae.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),v0e=D(()=>{const e=Ae.activeSessionId;return e?Ae.gitStatusBySession[e]?.pullRequest??null:null}),y0e=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=Ae.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),k0e=D(()=>{const e=Ae.activeSessionId;if(!e)return null;const t=Ae.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),m8=D(()=>{const e=Ae.sessions.find(r=>r.id===Ae.activeSessionId),t=zp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Mn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ae.defaultModel)??"—",o=Mn.models.value.find(r=>r.id===s)??Mn.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:Ae.permission,branch:t,cwd:e?.cwd??"",isGitRepo:zp.value!==null}}),b0e=D(()=>e8.value),x0e=D(()=>Ae.sessions.find(t=>t.id===Ae.activeSessionId)?.usage.totalCostUsd??0),_0e=D(()=>Ae.authReady),w0e=D(()=>Ae.defaultModel),S0e=D(()=>Ae.managedProviderStatus),C0e=D(()=>Ae.config),A0e=D(()=>{const e=Ae.activeSessionId;if(!e)return{};const t=Ae.gitStatusBySession[e];return t?{...t.entries}:{}});function Qc(e){return Ae.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const r2=D(()=>Fhe({workspaces:Ae.workspaces,sessions:Ae.sessions,hiddenWorkspaceRoots:Ae.hiddenWorkspaceRoots,activeRoot:Ae.sessions.find(e=>e.id===Ae.activeSessionId)?.cwd,activeBranch:zp.value?.branch??null,sessionsHasMoreByWorkspace:Ae.sessionsHasMoreByWorkspace})),Up=Q(lI()),Xc=Q(aI()==="manual"?"manual":"recent");Ze(()=>[r2.value.map(e=>e.id).join("\0"),Ae.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=_I(n,Up.value);s!==null&&(Up.value=s,uA(s))});const Ea=D(()=>{const e=r2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:n1e(t.root,Ae.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Xc.value==="recent"){const t=new Map;for(const n of Ae.sessions){if(n.parentSessionId)continue;const s=Qc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return CI(e,t)}return wI(e,Up.value)}),Gm=D(()=>{const e=Ae.activeWorkspaceId,t=Ea.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ze(Gm,e=>{e&&(Object.prototype.hasOwnProperty.call(Mn.skillsByWorkspace.value,e)||Mn.loadSkillsForWorkspace(e))},{immediate:!0});const M0e=D(()=>{const e=Gm.value;return e?Ea.value.find(t=>t.id===e)??null:null}),E0e=D(()=>{Rd.value;const e=new Set(Ea.value.map(n=>n.id)),t=new Map(Ea.value.map(n=>[n.id,n.name]));return Ae.sessions.filter(n=>!n.parentSessionId&&e.has(Qc(n))).map(n=>{const s=Qc(n);return{id:n.id,title:n.title,time:i2(n.updatedAt,n.status),status:n.status,busy:Vm(n),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),T0e=D(()=>{Rd.value;const e=new Map;for(const t of Ae.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Qc(t),s={id:t.id,title:t.title,time:i2(t.updatedAt,t.status),status:t.status,busy:Vm(t),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Ea.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ae.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ae.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ae.sessionsInitialCountByWorkspace[t.id]??Yv}))});function N0e(e){Up.value=e,uA(e),Xc.value!=="manual"&&(Xc.value="manual",dA("manual"))}function I0e(e){Xc.value!==e&&(Xc.value=e,dA(e))}const g8=D(()=>{const e={};for(const[t,n]of Object.entries(Ae.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ae.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),$0e=D(()=>{const e={};for(const[t,n]of Object.entries(Ae.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ae.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),L0e=D(()=>{const e={};for(const[t,n]of Object.entries(Ae.unreadBySession))n&&(e[t]=!0);return e}),F0e=D(()=>{const e={},t=g8.value;for(const n of Ae.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Qc(n);e[o]=(e[o]??0)+s}return e}),O0e=D(()=>Ae.recentRoots),R0e=D(()=>Ae.availableOpenInApps),ht=qpe(Ae,{taskPoller:f8,sideChat:eo,modelProvider:Mn,pushOperationFailure:jm,activity:Km,inFlightPromptSessions:n2,sessionsKnownEmpty:u8,setSessions:Y5,updateSession:qm,upsertSessionFront:s1e,appendSession:o1e,forgetSession:X5,setActiveSessionId:t2,updateSessionMessages:Q5,nextOptimisticMsgId:a8,getEventConn:()=>wi,syncSessionFromSnapshot:o2,reopenSession:L1e,hasLoadedMessages:T1e,refreshSessionStatus:Xd,refreshSessionGoal:c1e,persistSessionProfile:o8,mergedWorkspaces:r2,workspacesView:Ea,status:m8,workspaceIdForSession:Qc,savePermissionToStorage:Yme,savePlanModeToStorage:j5,saveSwarmModeToStorage:V5,saveGoalModeToStorage:K5,draftModes:Um,saveUnread:Fy,saveActiveWorkspaceToStorage:t1e,saveHiddenWorkspacesToStorage:e1e,goalErrorMessage:A1e,resetFastMoon:xr.resetFastMoon,initialized:n8,connectIssue:s8,selectedDiffPath:J5,fileDiffLines:e8,fileDiffLoading:t8});function l2(e){return e===Ae.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function B0e(e,t){const n=Ae.promptIdBySession[e];ht.finishPromptLocal(e),e===Ae.activeSessionId?(ht.loadGitStatus(e),Xd(e)):t==="idle"&&(Ae.unreadBySession={...Ae.unreadBySession,[e]:!0},Fy({[e]:!0}));const s=(Ae.approvalsBySession[e]??[]).length>0,o=(Ae.questionsBySession[e]??[]).length>0;rpe(t,s,o)&&Qi.maybeNotifyCompletion(e,{isUserWatching:l2(e),sessionTitle:Ae.sessions.find(i=>i.id===e)?.title??"",promptId:n,onClick:()=>{ht.selectSession(e)}}),t==="idle"&&Od.maybePlayCompletionSound()}function D0e(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Qi.maybeNotifyQuestion({isUserWatching:l2(e),sessionTitle:Ae.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ht.selectSession(e)}}),Od.maybePlayQuestionSound()}function P0e(e,t){Qi.maybeNotifyApproval({isUserWatching:l2(e),sessionTitle:Ae.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ht.selectSession(e)}}),Od.maybePlayApprovalSound()}function a2(){return O1e(),{workspace:W1e,sessions:z1e,activeSessionId:U1e,workspacesView:Ea,workspaceSortMode:Xc,visibleWorkspace:M0e,activeWorkspaceId:Gm,sessionsForView:E0e,workspaceGroups:T0e,attentionBySession:g8,pendingBySession:$0e,attentionByWorkspace:F0e,unreadBySession:L0e,recentRoots:O0e,turns:K1e,tasks:G1e,activeAppTasks:Jd,todos:Z1e,goal:mc,swarms:h8,swarmMembersByToolCallId:Y1e,activationBadges:f0e,compaction:Q1e,status:m8,sessionCost:x0e,fileDiff:b0e,selectedDiffPath:J5,fileDiffLoading:t8,changes:y0e,gitInfo:zp,gitDiffStats:k0e,activePullRequest:v0e,changesByPath:A0e,pendingApprovals:g0e,availableOpenInApps:R0e,connection:X1e,loading:J1e,sessionLoading:e0e,loadingMoreMessages:t0e,hasMoreMessages:n0e,loadMoreMessagesError:s0e,serverVersion:o0e,backend:i0e,dangerousBypassAuth:r0e,clearDangerousBypassAuth:l0e,initialized:n8,connectIssue:s8,permission:a0e,thinking:c0e,planMode:p8,swarmMode:u0e,goalMode:d0e,queued:h0e,warnings:p0e,questions:m0e,activity:Km,isSending:j1e,isStartingFirstPrompt:V1e,fastMoon:xr.fastMoon,models:Mn.models,starredModelIds:Mn.starredModelIds,providers:Mn.providers,uiFontSize:xr.uiFontSize,setUiFontSize:xr.setUiFontSize,conversationToc:r8,setConversationToc:f1e,colorScheme:xr.colorScheme,setColorScheme:xr.setColorScheme,accent:xr.accent,setAccent:xr.setAccent,notifyOnComplete:Qi.notifyOnComplete,notifyOnQuestion:Qi.notifyOnQuestion,notifyOnApproval:Qi.notifyOnApproval,notifyPermission:Qi.notifyPermission,setNotifyOnComplete:Qi.setNotifyOnComplete,setNotifyOnQuestion:Qi.setNotifyOnQuestion,setNotifyOnApproval:Qi.setNotifyOnApproval,soundOnComplete:Od.soundOnComplete,setSoundOnComplete:Od.setSoundOnComplete,onboarded:l8,setOnboarded:p1e,load:ht.load,selectSession:ht.selectSession,clearActiveSession:ht.clearActiveSession,loadOlderMessages:ht.loadOlderMessages,loadWorkspaces:ht.loadWorkspaces,loadMoreSessions:ht.loadMoreSessions,loadAllSessions:ht.loadAllSessions,selectWorkspace:ht.selectWorkspace,openWorkspace:ht.openWorkspace,openWorkspaceDraft:ht.openWorkspaceDraft,startSessionAndSendPrompt:ht.startSessionAndSendPrompt,startSessionAndActivateSkill:ht.startSessionAndActivateSkill,startSessionAndOpenSideChat:ht.startSessionAndOpenSideChat,addWorkspaceByPath:ht.addWorkspaceByPath,browseFs:ht.browseFs,getFsHome:ht.getFsHome,sendPrompt:ht.sendPrompt,steerPrompt:ht.steerPrompt,sideChatVisible:eo.sideChatVisible,sideChatSessionId:eo.sideChatSessionId,sideChatTurns:eo.sideChatTurns,sideChatRunning:eo.sideChatRunning,sideChatSending:eo.sideChatSending,openSideChat:eo.openSideChat,closeSideChat:eo.closeSideChat,sendSideChatPrompt:eo.sendSideChatPrompt,uploadImage:ht.uploadImage,abortCurrentPrompt:ht.abortCurrentPrompt,respondApproval:ht.respondApproval,respondQuestion:ht.respondQuestion,dismissQuestion:ht.dismissQuestion,pendingQuestionActions:ht.pendingQuestionActions,pendingApprovalActions:ht.pendingApprovalActions,cancelTask:ht.cancelTask,setPermission:ht.setPermission,setThinking:Mn.setThinking,setPlanMode:ht.setPlanMode,togglePlanMode:ht.togglePlanMode,setSwarmMode:ht.setSwarmMode,toggleSwarmMode:ht.toggleSwarmMode,setGoalMode:ht.setGoalMode,toggleGoalMode:ht.toggleGoalMode,createGoal:ht.createGoal,controlGoal:ht.controlGoal,enqueue:ht.enqueue,dismissWarning:ht.dismissWarning,renameSession:ht.renameSession,renameWorkspace:ht.renameWorkspace,deleteWorkspace:ht.deleteWorkspace,reorderWorkspaces:N0e,setWorkspaceSortMode:I0e,archiveSession:ht.archiveSession,exportSession:ht.exportSession,restoreSession:ht.restoreSession,loadArchivedSessions:ht.loadArchivedSessions,compact:ht.compact,forkSession:ht.forkSession,undo:ht.undo,unqueue:ht.unqueue,reorderQueue:ht.reorderQueue,searchFiles:ht.searchFiles,loadGitStatus:ht.loadGitStatus,loadFileDiff:ht.loadFileDiff,clearFileDiff:ht.clearFileDiff,listDir:ht.listDir,readFileContent:ht.readFileContent,getFileDownloadUrl:ht.getFileDownloadUrl,openWorkspaceFile:ht.openWorkspaceFile,openInApp:ht.openInApp,revealWorkspaceFile:ht.revealWorkspaceFile,resolveImageUrl:ht.resolveImageUrl,refreshOAuthProviderModels:Mn.refreshOAuthProviderModels,loadModels:Mn.loadModels,loadProviders:Mn.loadProviders,skills:q1e,activateSkill:Mn.activateSkill,setModel:Mn.setModel,toggleStarModel:Mn.toggleStarModel,addProvider:Mn.addProvider,deleteProvider:Mn.deleteProvider,refreshProvider:Mn.refreshProvider,refreshAllProviders:Mn.refreshAllProviders,authReady:_0e,defaultModel:w0e,managedProviderStatus:S0e,config:C0e,updateConfig:ht.updateConfig,checkAuth:ht.checkAuth,startOAuthLogin:Mn.startOAuthLogin,pollOAuthLogin:Mn.pollOAuthLogin,cancelOAuthLogin:Mn.cancelOAuthLogin,logout:ht.logout}}const v8=Ge({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=mA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&gA(o)}return(o,i)=>(b(),be(go,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),H0e=["aria-checked","aria-label","disabled"],W0e=Ge({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),T("button",{class:Pe(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,H0e))}}),pr=dt(W0e,[["__scopeId","data-v-dbe22dc4"]]),z0e=["aria-label"],U0e=["aria-selected","onClick"],q0e={class:"body"},j0e={class:"panel"},V0e={class:"sec"},K0e={class:"sec-title"},G0e={class:"row"},Y0e={class:"rlabel"},Z0e={class:"row"},Q0e={class:"rlabel"},X0e={class:"row"},J0e={class:"rlabel"},ege={class:"num-field"},tge=["value","aria-label"],nge={class:"row"},sge={class:"rlabel"},oge={class:"row"},ige={class:"rlabel"},rge={class:"hint"},lge={class:"sec"},age={class:"sec-title"},cge={class:"row"},uge={class:"rlabel"},dge={key:0,class:"hint"},fge={class:"row"},hge={class:"rlabel"},pge={key:0,class:"hint"},mge={class:"row"},gge={class:"rlabel"},vge={key:0,class:"hint"},yge={class:"row"},kge={class:"rlabel"},bge={class:"panel"},xge={class:"sec"},_ge={class:"sec-title"},wge={class:"row"},Sge={class:"rlabel"},Cge={key:0,class:"rvalue"},Age={class:"actions"},Mge={class:"panel"},Ege={class:"sec"},Tge={class:"sec-head"},Nge={class:"sec-title"},Ige={key:0,class:"saving"},$ge={class:"row"},Lge={class:"rlabel"},Fge={class:"hint"},Oge={key:0,class:"select-wrap"},Rge={key:0,value:"",disabled:""},Bge=["label"],Dge=["value"],Pge={key:1,class:"rvalue mono"},Hge={class:"row"},Wge={class:"rlabel"},zge={class:"hint"},Uge={class:"row"},qge={class:"rlabel"},jge={class:"hint"},Vge={class:"row"},Kge={class:"rlabel"},Gge={class:"hint"},Yge={class:"row"},Zge={class:"rlabel"},Qge={class:"hint"},Xge={key:1,class:"empty-config"},Jge={class:"panel"},eve={class:"sec"},tve={class:"sec-title"},nve={class:"row"},sve={class:"rlabel"},ove={class:"rvalue mono"},ive={class:"row"},rve={class:"rlabel"},lve={class:"rvalue mono"},ave={class:"row"},cve={class:"rlabel"},uve={class:"rvalue mono"},dve={key:0,class:"row"},fve={class:"rlabel"},hve={class:"hint"},pve={class:"hint"},mve={class:"row"},gve={class:"rlabel"},vve={key:0,class:"hint"},yve={class:"panel"},kve={class:"panel-head"},bve={class:"panel-title"},xve={class:"panel-desc"},_ve={class:"archive-toolbar"},wve={class:"archive-search"},Sve=["placeholder"],Cve={value:"all"},Ave=["value"],Mve={key:0,class:"archive-empty"},Eve={key:0,class:"archive-list"},Tve={class:"archive-workspace"},Nve={class:"path"},Ive={class:"count"},$ve={class:"setting-card"},Lve={class:"archive-meta"},Fve={class:"archive-name"},Ove={class:"archive-time"},Rve={key:1,class:"archive-empty"},Bve=100,Dve=Ge({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q("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=mI(),a=D(()=>s.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=Q(null);Hk(d);function f(se){se.key==="Escape"&&o("close")}gn(()=>document.addEventListener("keydown",f)),_n(()=>document.removeEventListener("keydown",f));function h(){i5()}const p=D(()=>{const se=new Map;for(const Y of s.models??[])se.set(Y.id,{id:Y.id,label:Y.displayName??Y.model??Y.id,provider:Y.provider});for(const[Y,J]of Object.entries(s.config?.models??{})){if(se.has(Y))continue;const le=k(J);se.set(Y,{id:Y,label:g(Y,J,le),provider:le??Y})}return Array.from(se.values())}),m=D(()=>{const se=new Map;for(const Y of p.value){const J=se.get(Y.provider)??[];J.push(Y),se.set(Y.provider,J)}for(const Y of se.values())Y.sort((J,le)=>J.label.localeCompare(le.label));return Array.from(se.entries()).toSorted(([Y],[J])=>Y.localeCompare(J)).map(([Y,J])=>({provider:Y,options:J}))}),x=D(()=>{const se=s.config?.defaultPermissionMode;return se==="auto"||se==="yolo"||se==="manual"?se:"manual"});function k(se){if(!se||typeof se!="object")return;const Y=se;return typeof Y.provider=="string"?Y.provider:void 0}function g(se,Y,J){if(!Y||typeof Y!="object")return se;const le=Y,He=typeof le.model=="string"?le.model:void 0,de=J??k(Y);return He&&de?`${se} (${de}/${He})`:He?`${se} (${He})`:se}function v(se){return se===!0}function y(se){!se||se===s.config?.defaultModel||o("updateConfig",{defaultModel:se})}function A(se){se!==x.value&&o("updateConfig",{defaultPermissionMode:se})}function L(se){const Y=s.config?.[se];o("updateConfig",{[se]:!v(Y)})}function $(){const se=s.config?.thinking;return!se||typeof se!="object"?!0:se.enabled!==!1}function _(){o("updateConfig",{thinking:{enabled:!$()}})}function E(){const se=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!se})}function N(se){i.value=se}const F=a2(),S=Q([]),I=Q(!1),R=Q(!1),B=Q(""),P=Q("all"),z=Q("archived-desc");async function W(){if(!(I.value||R.value)){I.value=!0;try{const se=[];let Y;for(;;){const J=await F.loadArchivedSessions({beforeId:Y,pageSize:Bve});if(se.push(...J.items),!J.hasMore||J.items.length===0)break;const le=J.items.at(-1)?.id;if(le===void 0)break;Y=le}S.value=se,R.value=!0}catch(se){console.warn("loadAllArchived failed",se)}finally{I.value=!1}}}Ze(i,se=>{se==="archived"&&!R.value&&W()});const X=D(()=>{const se=new Set;for(const Y of S.value)se.add(Y.cwd);return Array.from(se).sort((Y,J)=>Y.localeCompare(J))}),U=D(()=>{const se=B.value.trim().toLowerCase();let Y=S.value.filter(J=>J.archived===!0);return P.value!=="all"&&(Y=Y.filter(J=>J.cwd===P.value)),se&&(Y=Y.filter(J=>J.title.toLowerCase().includes(se))),Y=Y.slice(),z.value==="archived-desc"?Y.sort((J,le)=>le.updatedAt.localeCompare(J.updatedAt)):z.value==="created-desc"?Y.sort((J,le)=>le.createdAt.localeCompare(J.createdAt)):Y.sort((J,le)=>J.title.localeCompare(le.title,"zh")),Y}),Z=D(()=>{const se=new Map;for(const Y of U.value){const J=se.get(Y.cwd)??[];J.push(Y),se.set(Y.cwd,J)}return Array.from(se.entries()).map(([Y,J])=>({cwd:Y,items:J}))});async function ce(se){await F.restoreSession(se)&&(S.value=S.value.filter(J=>J.id!==se))}function fe(se){const Y=new Date(se);if(Number.isNaN(Y.getTime()))return se;const J=le=>String(le).padStart(2,"0");return`${Y.getFullYear()}-${J(Y.getMonth()+1)}-${J(Y.getDate())} ${J(Y.getHours())}:${J(Y.getMinutes())}`}return(se,Y)=>(b(),be(Wr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Y[19]||(Y[19]=J=>o("close"))},{default:Me(()=>[w("div",{ref_key:"dialogRef",ref:d,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(b(),T(Be,null,st(r,J=>w("button",{key:J.id,type:"button",class:Pe(["tab",{on:i.value===J.id}]),role:"tab","aria-selected":i.value===J.id,onClick:le=>N(J.id)},O(C(n)(J.labelKey)),11,U0e)),64))],8,z0e),w("div",q0e,[Rn(w("section",j0e,[w("section",V0e,[w("h3",K0e,O(C(n)("settings.appearance")),1),w("div",G0e,[w("span",Y0e,O(C(n)("theme.colorSchemeLabel")),1),ie(go,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":Y[0]||(Y[0]=J=>o("setColorScheme",J))},null,8,["model-value","options"])]),w("div",Z0e,[w("span",Q0e,O(C(n)("theme.accentLabel")),1),ie(go,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":Y[1]||(Y[1]=J=>o("setAccent",J))},null,8,["model-value","options"])]),w("div",X0e,[w("span",J0e,O(C(n)("settings.uiFontSize")),1),w("label",ege,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:Y[2]||(Y[2]=J=>o("setUiFontSize",Number(J.target.value)))},null,40,tge),Y[20]||(Y[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",nge,[w("span",sge,O(C(n)("sidebar.language")),1),ie(v8)]),w("div",oge,[w("span",ige,[Qe(O(C(n)("settings.conversationToc"))+" ",1),w("span",rge,O(C(n)("settings.conversationTocHint")),1)]),ie(pr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":Y[3]||(Y[3]=J=>o("setConversationToc",J))},null,8,["model-value","label"])])]),w("section",lge,[w("h3",age,O(C(n)("settings.notifications")),1),w("div",cge,[w("span",uge,[Qe(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(b(),T("span",dge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(pr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Y[4]||(Y[4]=J=>o("setNotify",J))},null,8,["model-value","disabled","label"])]),w("div",fge,[w("span",hge,[Qe(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(b(),T("span",pge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(pr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Y[5]||(Y[5]=J=>o("setNotifyQuestion",J))},null,8,["model-value","disabled","label"])]),w("div",mge,[w("span",gge,[Qe(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(b(),T("span",vge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(pr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Y[6]||(Y[6]=J=>o("setNotifyApproval",J))},null,8,["model-value","disabled","label"])]),w("div",yge,[w("span",kge,O(C(n)("settings.soundOnComplete")),1),ie(pr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":Y[7]||(Y[7]=J=>o("setSound",J))},null,8,["model-value","label"])])])],512),[[yi,i.value==="general"]]),Rn(w("section",bge,[w("section",xge,[w("h3",_ge,O(C(n)("settings.account")),1),w("div",wge,[w("span",Sge,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(Zt,{text:e.accountModel},{default:Me(()=>[e.authReady&&e.accountModel?(b(),T("span",Cge,O(e.accountModel),1)):re("",!0)]),_:1},8,["text"])]),w("div",Age,[ie(Dt,{variant:"secondary",size:"sm",onClick:Y[8]||(Y[8]=J=>{o("openOnboarding"),o("close")})},{default:Me(()=>[Qe(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(b(),be(Dt,{key:0,variant:"danger-soft",size:"sm",onClick:Y[9]||(Y[9]=J=>o("logout"))},{default:Me(()=>[Qe(O(C(n)("sidebar.signOut")),1)]),_:1})):(b(),be(Dt,{key:1,variant:"primary",size:"sm",onClick:Y[10]||(Y[10]=J=>o("login"))},{default:Me(()=>[Qe(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[yi,i.value==="account"]]),Rn(w("section",Mge,[w("section",Ege,[w("div",Tge,[w("h3",Nge,O(C(n)("settings.agentDefaults")),1),e.configSaving?(b(),T("span",Ige,O(C(n)("settings.saving")),1)):re("",!0)]),e.config?(b(),T(Be,{key:0},[w("div",$ge,[w("span",Lge,[Qe(O(C(n)("settings.defaultModel"))+" ",1),w("span",Fge,O(C(n)("settings.defaultModelHint")),1)]),m.value.length>0?(b(),T("div",Oge,[ie(Kv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":y},{default:Me(()=>[e.config.defaultModel?re("",!0):(b(),T("option",Rge,O(C(n)("settings.noDefaultModel")),1)),(b(!0),T(Be,null,st(m.value,J=>(b(),T("optgroup",{key:J.provider,label:J.provider},[(b(!0),T(Be,null,st(J.options,le=>(b(),T("option",{key:le.id,value:le.id},O(le.label),9,Dge))),128))],8,Bge))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(b(),T("span",Pge,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",Hge,[w("span",Wge,[Qe(O(C(n)("settings.defaultPermission"))+" ",1),w("span",zge,O(C(n)("settings.defaultPermissionHint")),1)]),ie(go,{"model-value":x.value,options:c.map(J=>({value:J,label:C(n)(u[J])})),"onUpdate:modelValue":Y[11]||(Y[11]=J=>A(J))},null,8,["model-value","options"])]),w("div",Uge,[w("span",qge,[Qe(O(C(n)("settings.defaultThinking"))+" ",1),w("span",jge,O(C(n)("settings.defaultThinkingHint")),1)]),ie(pr,{"model-value":$(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Y[12]||(Y[12]=J=>_())},null,8,["model-value","disabled","label"])]),w("div",Vge,[w("span",Kge,[Qe(O(C(n)("settings.defaultPlanMode"))+" ",1),w("span",Gge,O(C(n)("settings.defaultPlanModeHint")),1)]),ie(pr,{"model-value":v(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Y[13]||(Y[13]=J=>L("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",Yge,[w("span",Zge,[Qe(O(C(n)("settings.mergeSkills"))+" ",1),w("span",Qge,O(C(n)("settings.mergeSkillsHint")),1)]),ie(pr,{"model-value":v(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Y[14]||(Y[14]=J=>L("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(b(),T("div",Xge,O(C(n)("settings.configUnavailable")),1))])],512),[[yi,i.value==="agent"]]),Rn(w("section",Jge,[w("section",eve,[w("h3",tve,O(C(n)("settings.advanced")),1),w("div",nve,[w("span",sve,O(C(n)("sidebar.daemon")),1),w("span",ove,O(C(l)),1)]),w("div",ive,[w("span",rve,O(C(n)("settings.backend")),1),w("span",lve,O(a.value),1)]),w("div",ave,[w("span",cve,O(C(n)("settings.serverVersion")),1),w("span",uve,O(e.serverVersion||"-"),1)]),e.config?(b(),T("div",dve,[w("span",fve,[Qe(O(C(n)("settings.telemetry"))+" ",1),w("span",hve,O(C(n)("settings.telemetryHint")),1),w("span",pve,O(C(n)("settings.telemetryRestartHint")),1)]),ie(pr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Y[15]||(Y[15]=J=>E())},null,8,["model-value","disabled","label"])])):re("",!0),w("div",mve,[w("span",gve,[Qe(O(C(n)("settings.exportLog"))+" ",1),C(Di)()?re("",!0):(b(),T("span",vve,O(C(n)("settings.logHint")),1))]),ie(Dt,{variant:"secondary",size:"sm",onClick:h},{default:Me(()=>[Qe(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[yi,i.value==="advanced"]]),Rn(w("section",yve,[w("div",kve,[Y[21]||(Y[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",bve,O(C(n)("settings.archivedTitle")),1),w("p",xve,O(C(n)("settings.archivedDesc")),1)]),w("div",_ve,[w("label",wve,[Y[22]||(Y[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),Rn(w("input",{"onUpdate:modelValue":Y[16]||(Y[16]=J=>B.value=J),placeholder:C(n)("settings.archivedSearch")},null,8,Sve),[[wo,B.value]])]),ie(Kv,{"model-value":P.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Y[17]||(Y[17]=J=>P.value=J)},{default:Me(()=>[w("option",Cve,O(C(n)("settings.archivedAllWorkspaces")),1),(b(!0),T(Be,null,st(X.value,J=>(b(),T("option",{key:J,value:J},O(J),9,Ave))),128))]),_:1},8,["model-value","aria-label"]),ie(go,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":Y[18]||(Y[18]=J=>z.value=J)},null,8,["model-value","options"])]),I.value?(b(),T("div",Mve,O(C(n)("settings.archivedLoadingAll")),1)):(b(),T(Be,{key:1},[Z.value.length>0?(b(),T("div",Eve,[(b(!0),T(Be,null,st(Z.value,J=>(b(),T("section",{key:J.cwd,class:"archive-card"},[w("div",Tve,[Y[23]||(Y[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",Nve,O(J.cwd),1),w("span",Ive,O(C(n)("settings.archivedSessionsCount",{count:J.items.length})),1)]),w("div",$ve,[(b(!0),T(Be,null,st(J.items,le=>(b(),T("div",{key:le.id,class:"archive-row"},[w("div",Lve,[w("div",Fve,O(le.title),1),w("div",Ove,O(C(n)("settings.archivedAt",{time:fe(le.updatedAt)})),1)]),ie(Dt,{variant:"secondary",size:"sm",onClick:He=>ce(le.id)},{default:Me(()=>[Qe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(b(),T("div",Rve,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[yi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Pve=dt(Dve,[["__scopeId","data-v-2377814f"]]),Hve=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,y8=/^[A-Za-z]:[\\/]/,Wve=/^\/\/(?!\/)/;function _g(e){return Hve.test(e.trim())}function zve(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function Uve(e){return Wve.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function qve(e){return y8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function jve(e){return y8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function ey(e,t){let n=Uve(zve(e.trim(),t));const s=qve(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=jve(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 Vve(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Kve(e,t,n){if(n===null)return null;const{target:s}=ey(e,t);return s===n?n:null}const Gve={class:"aw"},Yve={key:0,class:"crumbbar"},Zve={class:"crumbs"},Qve={key:0,class:"crumb-sep"},Xve=["onClick"],Jve=["placeholder"],eye={key:2,class:"folder-list"},tye={key:0,class:"fl-loading"},nye={key:0,class:"fl-loading"},sye={key:0,class:"fl-note"},oye=["onClick"],iye={class:"folder-name"},rye={key:0,class:"git-branch"},lye={key:1,class:"fl-empty fl-error"},aye={key:2,class:"fl-empty fl-error"},cye=["onClick"],uye={class:"folder-name search-rel"},dye={key:0,class:"git-branch"},fye={key:0,class:"fl-empty"},hye={key:1,class:"fl-loading"},pye=["onClick"],mye={class:"folder-name"},gye={key:0,class:"git-branch"},vye={key:0,class:"fl-empty"},yye={key:3,class:"degraded-hint"},kye={key:4,class:"add-error",role:"alert"},bye={class:"actions"},xye={class:"footer-hint"},_ye=600,wye=6,e4=150,Sye=Ge({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q(!0),r=Q(!1),l=Q(!1),a=Q(""),c=Q(null),u=Q([]),d=Q(""),f=Q(!1),h=Q([]),p=D(()=>d.value.trim().length>0);let m=0,x=null;const k=D(()=>_g(d.value)),g=Q("idle"),v=Q(""),y=Q("/"),A=Q([]),L=Q(""),$=Q(null),_=Q(null),E=D(()=>g.value!=="valid"?null:Kve(d.value,L.value,_.value));let N=0,F=null;function S(Y,J){const le=Y.toLowerCase(),He=J.toLowerCase();let de=0;for(let G=0;G<He.length&&de<le.length;G++)He[G]===le[de]&&de++;return de===le.length}async function I(Y){const J=a.value,le=Y.trim();if(!J||le===""){h.value=[],f.value=!1;return}const He=++m;f.value=!0;const de=[],G=[{path:J,depth:0}];let ae=0;for(;G.length>0&&ae<_ye&&de.length<e4;){if(He!==m)return;const me=G.shift();ae++;let q;try{q=await s.browseFs(me.path)}catch{continue}if(He!==m)return;for(const ne of q.entries){if(!ne.isDir)continue;const ge=ne.path.startsWith(J)?ne.path.slice(J.length).replace(/^\/+/,""):ne.path;if(S(le,ge||ne.name)&&(de.push({path:ne.path,name:ne.name,rel:ge||ne.name,isGitRepo:ne.isGitRepo,branch:ne.branch}),de.length>=e4))break;me.depth+1<wye&&G.push({path:ne.path,depth:me.depth+1})}He===m&&(h.value=[...de])}He===m&&(f.value=!1)}Ze(d,Y=>{x&&clearTimeout(x),F&&clearTimeout(F),N++,g.value="idle",A.value=[],_.value=null;const J=Y.trim();if(J===""){m++,h.value=[],f.value=!1;return}if(_g(J)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void R(J),150);return}x=setTimeout(()=>void I(Y),220)});async function R(Y){const J=++N;g.value="checking",_.value=null;const le=ey(Y,L.value),{target:He}=le;try{const G=await s.browseFs(He);if(J!==N)return;if(G.path){g.value="valid",A.value=[],_.value=He,a.value=G.path,c.value=G.parent,u.value=G.entries,l.value=!1;return}}catch{}if(J!==N)return;const de=le.base.toLowerCase();v.value=le.parent,y.value=le.separator;try{const G=await s.browseFs(le.parent);if(J!==N)return;if(G.path){A.value=G.entries.filter(ae=>ae.isDir&&ae.name.toLowerCase().startsWith(de)),g.value="not-found";return}}catch{}J===N&&(A.value=[],g.value="bad-parent")}function B(Y){d.value=Vve(v.value,Y,y.value),$.value?.focus()}const P=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),z=D(()=>l.value?n("workspace.degradedHint"):k.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function W(Y){if(Y.key==="Escape"){d.value?d.value="":o("close");return}if(Y.key!=="Enter")return;const J=d.value.trim();if(_g(J)){if(Y.preventDefault(),l.value){const{target:le}=ey(J,L.value);le&&o("add",le);return}g.value==="valid"?se():g.value==="not-found"&&A.value[0]&&B(A.value[0].name)}}const X=D(()=>{const Y=a.value;if(!Y)return[];const J=Y.split("/").filter(Boolean),le=[{label:"/",path:"/"}];let He="";for(const de of J)He+=`/${de}`,le.push({label:de,path:He});return le}),U=D(()=>!(a.value.length===0||k.value&&E.value===null));async function Z(Y){r.value=!0;try{const J=await s.browseFs(Y);if(!J.path){l.value=!0;return}a.value=J.path,c.value=J.parent,u.value=J.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ce(Y){Y.isDir&&Z(Y.path)}function fe(){c.value&&Z(c.value)}function se(){U.value&&o("add",E.value??a.value)}return gn(async()=>{r.value=!0;try{const Y=await s.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(Y.home&&(L.value=Y.home),s.defaultPath&&(await Z(s.defaultPath),!l.value))return;L.value?await Z(L.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),_n(()=>{x&&clearTimeout(x),F&&clearTimeout(F)}),(Y,J)=>(b(),be(Wr,{open:i.value,"onUpdate:open":J[2]||(J[2]=le=>i.value=le),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:J[3]||(J[3]=le=>o("close"))},{default:Me(()=>[w("div",Gve,[l.value?re("",!0):(b(),T("div",Yve,[ie(Wn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Me(()=>[ie(qe,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",Zve,[(b(!0),T(Be,null,st(X.value,(le,He)=>(b(),T(Be,{key:le.path},[He>1?(b(),T("span",Qve,"/")):re("",!0),w("button",{class:Pe(["crumb",{last:He===X.value.length-1}]),onClick:de=>Z(le.path)},O(le.label),11,Xve)],64))),128))])])),!r.value||l.value?(b(),T("div",{key:1,class:Pe(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[ie(qe,{class:"filter-icon",name:"search",size:"md"}),Rn(w("input",{ref_key:"filterEl",ref:$,"onUpdate:modelValue":J[0]||(J[0]=le=>d.value=le),class:"filter-input",type:"text",placeholder:P.value,autocomplete:"off",spellcheck:"false",onKeydown:xt(W,["stop"])},null,40,Jve),[[wo,d.value]]),f.value||g.value==="checking"?(b(),be(Ho,{key:0,size:"sm"})):re("",!0)],2)):re("",!0),l.value?(b(),T("div",yye,O(C(n)("workspace.degradedHint")),1)):(b(),T("div",eye,[r.value?(b(),T("div",tye,O(C(n)("workspace.browsing")),1)):k.value&&g.value!=="valid"?(b(),T(Be,{key:1},[g.value==="checking"?(b(),T("div",nye,O(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(b(),T(Be,{key:1},[A.value.length>0?(b(),T("div",sye,O(C(n)("workspace.pathPickHint")),1)):re("",!0),(b(!0),T(Be,null,st(A.value,le=>(b(),T("button",{key:le.path,class:"folder-row",onClick:He=>B(le.name)},[ie(qe,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",iye,O(le.name),1),le.isGitRepo?(b(),be(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Qe(O(C(n)("workspace.gitTag")),1),le.branch?(b(),T("span",rye,O(le.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,oye))),128)),A.value.length===0?(b(),T("div",lye,O(C(n)("workspace.noPathMatch",{parent:v.value})),1)):re("",!0)],64)):g.value==="bad-parent"?(b(),T("div",aye,O(C(n)("workspace.badParent",{parent:v.value})),1)):re("",!0)],64)):p.value&&!k.value?(b(),T(Be,{key:2},[(b(!0),T(Be,null,st(h.value,le=>(b(),T("button",{key:le.path,class:"folder-row",onClick:He=>Z(le.path)},[ie(qe,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",uye,O(le.rel),1),le.isGitRepo?(b(),be(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Qe(O(C(n)("workspace.gitTag")),1),le.branch?(b(),T("span",dye,O(le.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,cye))),128)),!f.value&&h.value.length===0?(b(),T("div",fye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(b(),T("div",hye,O(C(n)("workspace.searching")),1)):re("",!0)],64)):(b(),T(Be,{key:3},[(b(!0),T(Be,null,st(u.value,le=>(b(),T("button",{key:le.path,class:"folder-row",onClick:He=>ce(le)},[ie(qe,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",mye,O(le.name),1),le.isGitRepo?(b(),be(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Qe(O(C(n)("workspace.gitTag")),1),le.branch?(b(),T("span",gye,O(le.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,pye))),128)),u.value.length===0?(b(),T("div",vye,O(C(n)("workspace.noSubfolders")),1)):re("",!0)],64))])),e.error?(b(),T("div",kye,O(e.error),1)):re("",!0),w("div",bye,[ie(Zt,{text:a.value},{default:Me(()=>[l.value?re("",!0):(b(),be(Dt,{key:0,variant:"primary",disabled:!U.value,onClick:se},{default:Me(()=>[Qe(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Dt,{variant:"secondary",onClick:J[1]||(J[1]=le=>o("close"))},{default:Me(()=>[Qe(O(C(n)("workspace.cancel")),1)]),_:1})]),w("div",xye,O(z.value),1)])]),_:1},8,["open","title"]))}}),Cye=dt(Sye,[["__scopeId","data-v-b24b02ce"]]),Aye={key:0,class:"confirm-dialog__message"},Mye=Ge({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=Q(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Tt();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!o.open||o.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),ps(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(b(),be(Wr,{open:e.open,title:e.title,height:"auto","initial-focus":s,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:Me(()=>[ie(Dt,{variant:"secondary",disabled:e.loading,onClick:l},{default:Me(()=>[Qe(O(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Dt,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Me(()=>[Qe(O(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Me(()=>[e.message?(b(),T("p",Aye,O(e.message),1)):re("",!0)]),_:1},8,["open","title"]))}}),Eye=dt(Mye,[["__scopeId","data-v-76e206e7"]]),Tye=Ge({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=zr();return(s,o)=>(b(),be(Eye,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),Nye={class:"rows"},Iye={class:"row"},$ye={class:"row"},Lye={class:"row"},Fye={class:"row"},Oye={class:"row"},Rye={class:"row"},Bye={class:"ctx-text"},Dye={key:0,class:"bar"},Pye={class:"row"},Hye=Ge({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q(!0),r=D(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=D(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=D(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=D(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(b(),be(Wr,{open:i.value,"onUpdate:open":m[0]||(m[0]=x=>i.value=x),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=x=>o("close"))},{default:Me(()=>[w("dl",Nye,[w("div",Iye,[w("dt",null,O(C(n)("status.statusModel")),1),w("dd",null,O(e.status.model),1)]),w("div",$ye,[w("dt",null,O(C(n)("status.statusThinking")),1),w("dd",null,O(e.thinking),1)]),w("div",Lye,[w("dt",null,O(C(n)("status.statusPermission")),1),w("dd",{style:Yt({color:c.value})},O(a(e.status.permission)),5)]),w("div",Fye,[w("dt",null,O(C(n)("status.statusPlanMode")),1),w("dd",{class:Pe({"plan-on":e.planMode})},O(u.value),3)]),w("div",Oye,[w("dt",null,O(C(n)("status.statusSwarmMode")),1),w("dd",{class:Pe({"swarm-on":e.swarmMode})},O(d.value),3)]),w("div",Rye,[w("dt",null,O(C(n)("status.statusContext")),1),w("dd",null,[w("span",Bye,O(l.value),1),e.status.ctxMax>0?(b(),T("span",Dye,[w("i",{style:Yt({width:r.value+"%"})},null,4)])):re("",!0)])]),w("div",Pye,[w("dt",null,O(C(n)("status.statusCost")),1),w("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Wye=dt(Hye,[["__scopeId","data-v-59dd31f3"]]),zye={class:"ui-toast__icon","aria-hidden":"true"},Uye={class:"ui-toast__body"},qye={class:"ui-toast__title"},jye={key:0,class:"ui-toast__msg"},Vye=Ge({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-toast",`ui-toast--${e.variant}`])},[w("span",zye,[Bn(t.$slots,"icon",{},()=>[e.variant==="success"?(b(),be(qe,{key:0,name:"check"})):e.variant==="danger"?(b(),be(qe,{key:1,name:"close"})):e.variant==="warning"?(b(),be(qe,{key:2,name:"alert-triangle"})):(b(),be(qe,{key:3,name:"info"}))],!0)]),w("div",Uye,[w("div",qye,O(e.title),1),e.message?(b(),T("div",jye,O(e.message),1)):re("",!0),Bn(t.$slots,"default",{},void 0,!0)]),ie(Wn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Me(()=>[ie(qe,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Kye=dt(Vye,[["__scopeId","data-v-adc6f346"]]),Gye={key:0,class:"actions"},Yye=["onClick"],Zye=["onClick"],Qye={key:1,class:"details"},Xye=Ge({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt();function i(_){return typeof _=="object"&&_!==null}function r(_){return i(_)?_.title:_}function l(_){return i(_)?_.message??"":""}function a(_){return i(_)?_.details:void 0}function c(_){return i(_)?_.severity==="error":_.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(_)}function u(_){return i(_)?`notice:${_.severity}:${_.title}:${_.message??""}:${JSON.stringify(_.details??[])}`:`text:${_}`}function d(_){if(!i(_))return _;const E=[_.title];_.message&&E.push(_.message);const N=_.details??[];if(N.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const F of N)E.push(`${F.label}: ${F.value}`)}return E.join(`
|
|
325
|
-
`)}let f=1;const h=Q([]),p=new Map,m=new Map;function x(_){const E=c(_)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function k(_,E){const N=p.get(_)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(_),E),N.deadline=Date.now()+E,p.set(_,N)}function g(_){const E=p.get(_);E&&E.handle!==null&&clearTimeout(E.handle),p.delete(_)}function v(_){const E=p.get(_);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(_){if(h.value.find(F=>F.id===_)?.detailsOpen)return;const N=p.get(_);!N||N.handle!==null||k(_,N.remaining)}function A(_){_.detailsOpen=!_.detailsOpen,_.detailsOpen?v(_.id):y(_.id)}async function L(_){if(!await oo(d(_.warning)))return;_.copied=!0;const N=m.get(_.id);N&&clearTimeout(N),m.set(_.id,setTimeout(()=>{_.copied=!1,m.delete(_.id)},1400))}function $(_){g(_);const E=m.get(_);E&&clearTimeout(E),m.delete(_);const N=h.value.findIndex(F=>F.id===_);N!==-1&&(h.value=h.value.filter(F=>F.id!==_),s("dismiss",N))}return Ze(()=>n.warnings,_=>{const E=[...h.value];h.value=_.map(N=>{const F=u(N),S=E.findIndex(B=>B.key===F),I=S===-1?void 0:E.splice(S,1)[0];if(I)return I.warning=N,I;const R={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(R.id,x(N)),R});for(const N of E){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),_n(()=>{p.forEach(_=>{_.handle!==null&&clearTimeout(_.handle)}),p.clear(),m.forEach(_=>clearTimeout(_)),m.clear()}),(_,E)=>(b(),be(z9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Me(()=>[(b(!0),T(Be,null,st(h.value,N=>(b(),be(Kye,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>y(N.id)},{default:Me(()=>[a(N.warning)?.length?(b(),T("div",Gye,[w("button",{class:"link",type:"button",onClick:F=>A(N)},O(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,Yye),w("button",{class:"link",type:"button",onClick:F=>L(N)},O(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,Zye)])):re("",!0),N.detailsOpen&&a(N.warning)?.length?(b(),T("dl",Qye,[(b(!0),T(Be,null,st(a(N.warning),F=>(b(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,O(F.label),1),w("dd",null,O(F.value),1)]))),128))])):re("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Jye=dt(Xye,[["__scopeId","data-v-92efeff8"]]),eke={class:"topbar"},tke={class:"wsq"},nke=["aria-label"],ske={class:"tb-path"},oke={class:"ws"},ike={class:"se"},rke={class:"tb-sub"},lke=Ge({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Tt(),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)=>(b(),T("div",eke,[w("span",tke,O(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[w("span",ske,[w("span",oke,O(r.value),1),e.sessionTitle?(b(),T(Be,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",ike,O(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",rke,[w("span",{class:Pe(["rd",{on:e.running}])},null,2),w("span",null,O(l.value),1),e.branch?(b(),T(Be,{key:0},[Qe(" · "+O(e.branch),1)],64)):re("",!0),e.sessionCount>0?(b(),T(Be,{key:1},[Qe(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,nke),ie(Wn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Me(()=>[ie(qe,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),ake=dt(lke,[["__scopeId","data-v-59a11935"]]),cke={key:0,class:"sheet-root"},uke=["aria-label"],dke=["aria-label"],fke={key:0,class:"sheet-head"},hke={class:"sheet-title"},pke={class:"sheet-body"},mke=Ge({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ze(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),_n(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(b(),be(Tl,{name:"sheet"},{default:Me(()=>[e.modelValue?(b(),T("div",cke,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,dke),e.title?(b(),T("div",fke,[w("span",hke,O(e.title),1)])):re("",!0),w("div",pke,[Bn(l.$slots,"default",{},void 0,!0)])],8,uke)])):re("",!0)]),_:3}))}}),k8=dt(mke,[["__scopeId","data-v-4441dd70"]]),gke={class:"mlist"},vke={key:0,class:"mempty"},yke=["onClick"],kke={class:"mgh-main"},bke={class:"mgh-name"},xke={class:"mgh-path"},_ke={key:2,class:"att"},wke={key:0,class:"mempty small"},Ske=["onClick"],Cke={class:"m"},Ake={class:"s"},Mke={key:0,class:"att"},Eke=["disabled","onClick"],Tke=["onClick"],Nke=Ge({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=zr(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Q(new Set);function f(S){return d.value.has(S)}function h(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,y.value=null,_.value=null}const p=Q(new Set);function m(S){return p.value.has(S)}function x(S){const I=new Set(p.value);I.has(S)?I.delete(S):I.add(S),p.value=I}function k(S){if(m(S.workspace.id))return S.sessions;const I=S.sessions.slice(0,S.initialCount);if(o.activeId&&!I.some(R=>R.id===o.activeId)){const R=S.sessions.find(B=>B.id===o.activeId);if(R)return[...I,R]}return I}function g(S){if(!p.value.has(S)){const I=new Set(p.value);I.add(S),p.value=I}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Q(null);function A(S){y.value=y.value===S?null:S,_.value=null}function L(S){y.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();R&&i("rename",S.id,R)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const _=Q(null);function E(S){_.value=_.value===S?null:S,y.value=null}function N(S){oo(S.root),_.value=null}async function F(S){_.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,I)=>(b(),be(k8,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=R=>i("update:modelValue",R))},{default:Me(()=>[w("button",{type:"button",class:"newrow",onClick:c},[ie(qe,{name:"message",size:"sm"}),Qe(" "+O(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:u},[ie(qe,{name:"folder",size:"sm"}),Qe(" "+O(C(n)("sidebar.newWorkspace")),1)]),w("div",gke,[e.groups.length===0?(b(),T("div",vke,O(C(n)("workspace.noWorkspace")),1)):re("",!0),(b(!0),T(Be,null,st(e.groups,R=>(b(),T("div",{key:R.workspace.id,class:"mgroup"},[w("div",{class:Pe(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:B=>h(R.workspace.id)},[f(R.workspace.id)?(b(),be(qe,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(b(),be(qe,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",kke,[w("span",bke,O(R.workspace.name),1),ie(Zt,{text:R.workspace.root},{default:Me(()=>[w("span",xke,O(R.workspace.branch||R.workspace.shortPath),1)]),_:2},1032,["text"])]),f(R.workspace.id)&&v(R.workspace.id)>0?(b(),T("span",_ke,O(v(R.workspace.id)),1)):re("",!0),ie(Wn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:xt(B=>E(R.workspace.id),["stop"])},{default:Me(()=>[ie(qe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Wn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:xt(B=>a(R.workspace.id),["stop"])},{default:Me(()=>[ie(qe,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),_.value===R.workspace.id?(b(),be(vl,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{size:"lg",onClick:B=>N(R.workspace)},{default:Me(()=>[Qe(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(pn,{size:"lg",danger:"",onClick:B=>F(R.workspace)},{default:Me(()=>[Qe(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,yke),Rn(w("div",null,[R.sessions.length===0?(b(),T("div",wke,O(C(n)("sidebar.noSessions")),1)):re("",!0),(b(!0),T(Be,null,st(k(R),B=>(b(),T("div",{key:B.id,class:Pe(["srow",{cur:B.id===e.activeId}]),onClick:P=>l(B.id)},[w("div",Cke,[w("div",{class:Pe(["t",{run:B.busy,aborted:B.status==="aborted"}])},O(B.title),3),w("div",Ake,O(B.time),1)]),(e.attentionBySession[B.id]??0)>0?(b(),T("span",Mke,O(e.attentionBySession[B.id]),1)):re("",!0),ie(Wn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:xt(P=>A(B.id),["stop"])},{default:Me(()=>[ie(qe,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===B.id?(b(),be(vl,{key:1,class:"kmenu",onClick:I[1]||(I[1]=xt(()=>{},["stop"]))},{default:Me(()=>[ie(pn,{size:"lg",onClick:P=>L(B)},{default:Me(()=>[Qe(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(pn,{size:"lg",danger:"",onClick:P=>$(B.id)},{default:Me(()=>[Qe(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Ske))),128)),R.hasMore||R.loadingMore?(b(),T("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:xt(B=>g(R.workspace.id),["stop"])},O(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,Eke)):re("",!0),R.sessions.length>R.initialCount?(b(),T("button",{key:2,type:"button",class:"mshow-more",onClick:xt(B=>x(R.workspace.id),["stop"])},O(m(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,Tke)):re("",!0)],512),[[yi,!f(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Ike=dt(Nke,[["__scopeId","data-v-7ca5a6a0"]]),$ke={class:"group-title"},Lke={class:"srow-main"},Fke={class:"srow-label"},Oke={class:"srow-sub"},Rke={class:"srow read-only"},Bke={class:"srow-main"},Dke={class:"srow-label"},Pke={key:0,class:"srow-sub"},Hke={class:"srow-main"},Wke={class:"srow-label"},zke={class:"srow-sub"},Uke=["aria-checked"],qke={class:"srow-main"},jke={class:"srow-label"},Vke={class:"srow-sub"},Kke=["aria-checked"],Gke={class:"srow-main"},Yke={class:"srow-label"},Zke={class:"srow read-only"},Qke={class:"srow-main"},Xke={class:"srow-label"},Jke={class:"srow-sub"},e2e=["aria-label"],t2e={class:"group-title"},n2e={class:"srow-main"},s2e={class:"srow-label"},o2e={class:"srow-sub"},i2e={class:"srow read-only pref"},r2e={class:"srow-main"},l2e={class:"srow-label"},a2e={class:"srow read-only pref"},c2e={class:"srow-main"},u2e={class:"srow-label"},d2e={class:"srow read-only pref"},f2e={class:"srow-main"},h2e={class:"srow-label"},p2e={class:"num-field"},m2e=["value","aria-label"],g2e={class:"srow-main"},v2e={class:"srow-label"},y2e={class:"srow-sub"},k2e=["aria-checked"],b2e={class:"srow-main"},x2e={class:"srow-label"},_2e={class:"srow-main"},w2e={class:"srow-label"},S2e={key:2,class:"srow read-only"},C2e={class:"srow-main"},A2e={class:"srow-label"},M2e={class:"srow-val dim"},E2e={class:"arch-subhead"},T2e={class:"arch-count"},N2e={class:"arch-tools"},I2e={key:0,class:"arch-empty"},$2e={class:"arch-meta"},L2e={class:"arch-name"},F2e={class:"arch-time"},O2e={key:2,class:"arch-empty"},R2e=100,B2e=Ge({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(ce){o("setColorScheme",ce)}const r=["manual","auto","yolo"],l=D(()=>s.models?.find(ce=>ce.id===s.status?.modelId)),a=D(()=>Qd(l.value)),c=D(()=>Bk(l.value)),u=D(()=>Fa(l.value,s.thinking??"off")),d=D(()=>{const ce=c.value,fe=u.value;return ce.includes(fe)?fe:ce.includes("on")?"on":ce[0]??"off"}),f=D(()=>c.value.map(ce=>({value:ce,label:Vv(ce)}))),h=D(()=>s.planMode===!0),p=D(()=>s.swarmMode===!0),m=D(()=>{const ce=s.status.permission;return ce==="yolo"?"var(--color-danger)":ce==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),x=D(()=>{const ce=s.status.permission,fe=n(ce==="yolo"?"mobile.permYoloSub":ce==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ce} · ${fe}`}),k=ce=>`${Math.round(ce/1e3)}k`,g=D(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=D(()=>s.status.ctxMax>0?`${k(s.status.ctxUsed)}/${k(s.status.ctxMax)}`:n("status.statusNone"));function y(ce){o("setThinking",Dk(l.value,ce))}function A(){const ce=r.indexOf(s.status.permission),fe=r[(ce+1)%r.length];o("setPermission",fe)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function _(){o("logout"),o("update:modelValue",!1)}const E=a2(),N=Q("main"),F=Q([]),S=Q(!1),I=Q(!1),R=Q(""),B=Q("archived-desc");async function P(){if(!S.value){S.value=!0,I.value=!1;try{const ce=[];let fe;for(;;){const se=await E.loadArchivedSessions({beforeId:fe,pageSize:R2e});if(ce.push(...se.items),!se.hasMore||se.items.length===0)break;const Y=se.items.at(-1)?.id;if(Y===void 0)break;fe=Y}F.value=ce,I.value=!0}catch(ce){console.warn("loadAllArchived failed",ce)}finally{S.value=!1}}}function z(){N.value="archived",R.value="",P()}function W(){N.value="main"}const X=D(()=>{const ce=R.value.trim().toLowerCase();let fe=F.value.filter(se=>se.archived===!0);return ce&&(fe=fe.filter(se=>se.title.toLowerCase().includes(ce))),fe=fe.slice(),B.value==="archived-desc"?fe.sort((se,Y)=>Y.updatedAt.localeCompare(se.updatedAt)):B.value==="created-desc"?fe.sort((se,Y)=>Y.createdAt.localeCompare(se.createdAt)):fe.sort((se,Y)=>se.title.localeCompare(Y.title,"zh")),fe});async function U(ce){await E.restoreSession(ce)&&(F.value=F.value.filter(se=>se.id!==ce))}function Z(ce){const fe=new Date(ce);if(Number.isNaN(fe.getTime()))return ce;const se=Y=>String(Y).padStart(2,"0");return`${fe.getFullYear()}-${se(fe.getMonth()+1)}-${se(fe.getDate())} ${se(fe.getHours())}:${se(fe.getMinutes())}`}return Ze(()=>s.modelValue,ce=>{ce||(N.value="main")}),(ce,fe)=>(b(),be(k8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":fe[6]||(fe[6]=se=>o("update:modelValue",se))},{default:Me(()=>[N.value==="main"?(b(),T(Be,{key:0},[w("div",$ke,O(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",Lke,[w("span",Fke,O(C(n)("status.statusModel")),1),w("span",Oke,O(e.status.model),1)]),fe[7]||(fe[7]=w("span",{class:"chev"},"›",-1))]),w("div",Rke,[w("span",Bke,[w("span",Dke,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(b(),T("span",Pke,O(C(n)("status.modeNotSupported")),1)):re("",!0)]),c.value.length>1?(b(),be(go,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(b(),T("span",{key:1,class:Pe(["srow-val",{dim:d.value==="off"}])},O(d.value==="off"?C(n)("status.planOff"):C(Vv)(d.value)),3))]),w("button",{type:"button",class:"srow",onClick:fe[0]||(fe[0]=se=>o("togglePlan"))},[w("span",Hke,[w("span",Wke,O(C(n)("status.statusPlanMode")),1),w("span",zke,O(C(n)("mobile.planModeSub")),1)]),w("span",{class:Pe(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,Uke)]),w("button",{type:"button",class:"srow",onClick:fe[1]||(fe[1]=se=>o("toggleSwarm"))},[w("span",qke,[w("span",jke,O(C(n)("status.statusSwarmMode")),1),w("span",Vke,O(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:Pe(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,Kke)]),w("button",{type:"button",class:"srow",onClick:A},[w("span",Gke,[w("span",Yke,O(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:Yt({color:m.value})},O(x.value),5)]),fe[8]||(fe[8]=w("span",{class:"chev"},"›",-1))]),w("div",Zke,[w("span",Qke,[w("span",Xke,O(C(n)("status.statusContext")),1),w("span",Jke,O(v.value),1)]),w("span",{class:"ctx-meter","aria-label":v.value},[w("i",{style:Yt({width:g.value+"%"})},null,4)],8,e2e)]),w("div",t2e,O(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:z},[w("span",n2e,[w("span",s2e,O(C(n)("mobile.archivedSessions")),1),w("span",o2e,O(C(n)("mobile.archivedSessionsSub")),1)]),fe[9]||(fe[9]=w("span",{class:"chev"},"›",-1))]),w("div",i2e,[w("span",r2e,[w("span",l2e,O(C(n)("theme.colorSchemeLabel")),1)]),ie(go,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),w("div",a2e,[w("span",c2e,[w("span",u2e,O(C(n)("sidebar.language")),1)]),ie(v8)]),w("div",d2e,[w("span",f2e,[w("span",h2e,O(C(n)("settings.uiFontSize")),1)]),w("label",p2e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:fe[2]||(fe[2]=se=>o("setUiFontSize",Number(se.target.value)))},null,40,m2e),fe[10]||(fe[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:fe[3]||(fe[3]=se=>o("setConversationToc",!e.conversationToc))},[w("span",g2e,[w("span",v2e,O(C(n)("settings.conversationToc")),1),w("span",y2e,O(C(n)("settings.conversationTocHint")),1)]),w("span",{class:Pe(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,k2e)]),e.authReady?(b(),T("button",{key:0,type:"button",class:"srow acct out",onClick:_},[w("span",b2e,[w("span",x2e,O(C(n)("sidebar.signOut")),1)])])):(b(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[w("span",_2e,[w("span",w2e,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(b(),T("div",S2e,[w("span",C2e,[w("span",A2e,O(C(n)("settings.serverVersion")),1)]),w("span",M2e,O(e.serverVersion),1)])):re("",!0)],64)):(b(),T(Be,{key:1},[w("div",E2e,[w("button",{type:"button",class:"arch-back",onClick:W},[fe[11]||(fe[11]=w("span",{class:"chev back"},"‹",-1)),Qe(" "+O(C(n)("mobile.archivedBack")),1)]),w("span",T2e,O(C(n)("mobile.sessionCount",{n:X.value.length})),1)]),w("div",N2e,[ie(zc,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":fe[4]||(fe[4]=se=>R.value=se)},null,8,["model-value","placeholder"]),ie(go,{size:"sm","model-value":B.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":fe[5]||(fe[5]=se=>B.value=se)},null,8,["model-value","options"])]),S.value?(b(),T("div",I2e,O(C(n)("settings.archivedLoadingAll")),1)):X.value.length>0?(b(!0),T(Be,{key:1},st(X.value,se=>(b(),T("div",{key:se.id,class:"arch-row"},[w("div",$2e,[w("div",L2e,O(se.title),1),w("div",F2e,O(C(n)("settings.archivedAt",{time:Z(se.updatedAt)})),1)]),ie(Dt,{variant:"secondary",size:"sm",onClick:Y=>U(se.id)},{default:Me(()=>[Qe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(b(),T("div",O2e,O(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),D2e=dt(B2e,[["__scopeId","data-v-24273113"]]),P2e={class:"ob-brand"},H2e={class:"ob-brand-text"},W2e={class:"ob-title"},z2e={class:"ob-sub"},U2e={class:"ob-sec"},q2e={class:"ob-label"},j2e={class:"ob-sec"},V2e={class:"ob-label"},K2e={class:"ob-sec"},G2e={class:"ob-label"},Y2e=Ge({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=I5();function c(d){o.value!==d&&gA(d)}function u(){n("complete")}return(d,f)=>(b(),be(Wr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Me(()=>[w("div",P2e,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",H2e,[w("div",W2e,O(C(s)("onboarding.title")),1),w("div",z2e,O(C(s)("onboarding.subtitle")),1)])])]),default:Me(()=>[w("section",U2e,[w("div",q2e,O(C(s)("onboarding.languageLabel")),1),ie(go,{"model-value":C(o),options:C(mA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),w("section",j2e,[w("div",V2e,O(C(s)("theme.colorSchemeLabel")),1),ie(go,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),w("section",K2e,[w("div",G2e,O(C(s)("theme.accentLabel")),1),ie(go,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),ie(Dt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Me(()=>[Qe(O(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),Z2e=dt(Y2e,[["__scopeId","data-v-fbdd3eab"]]),Q2e=["aria-label"],X2e={class:"gload-box"},J2e={class:"gload-text"},ebe={key:0,class:"gload-issue"},tbe={class:"gload-issue-detail"},nbe=Ge({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Tt();return(n,s)=>(b(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",X2e,[s[0]||(s[0]=xy('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-0b6dec6a></path></svg>',1)),ie(Ho,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",J2e,O(C(t)("app.connecting")),1),e.issue?(b(),T("div",ebe,[w("div",null,O(C(t)("app.connectRetrying")),1),w("div",tbe,O(e.issue),1)])):re("",!0)])],8,Q2e))}}),sbe=dt(nbe,[["__scopeId","data-v-0b6dec6a"]]),obe={class:"kap-root"},ibe={class:"kap-head"},rbe={class:"kap-count"},lbe={class:"kap-head-actions"},abe={class:"kap-filters"},cbe=["value"],ube={class:"kap-check"},dbe={class:"kap-check"},fbe={class:"kap-view-toggle",role:"group"},hbe={key:0,class:"kap-empty"},pbe=["onClick"],mbe={class:"kap-ts"},gbe={class:"kap-label"},vbe={key:0,class:"kap-detail"},ybe={class:"kap-detail-actions"},kbe=["onClick"],bbe={key:1,class:"kap-agg"},xbe={class:"mono"},_be={class:"mono"},wbe={class:"num"},Sbe={class:"num"},Cbe={key:0},Abe={class:"mono"},Mbe={class:"num"},Ebe={class:"num"},Tbe={key:0},Nbe=Ge({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=Q("all"),o=Q(""),i=Q(""),r=Q(!1),l=Q("timeline"),a=D(()=>(Ak.value,[..._te()])),c=D(()=>{const E=new Set;for(const N of a.value)N.sessionId&&E.add(N.sessionId);return[...E].sort()});function u(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=D(()=>{const E=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)||E&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(E)))}),f=D(()=>{const E=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,I=E.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};I.count++,N.seq!==void 0&&(I.lastSeq=N.seq),E.set(S,I)}return[...E.values()].sort((N,F)=>F.count-N.count)}),h=D(()=>{const E=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),E.set(F,S)}return[...E.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=Q(null),m=Q(!0),x=Q(null),k=Q(null);Ze(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await gt();const E=x.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){p.value=p.value===E?null:E}function v(E){const N=new Date(E),F=(S,I=2)=>String(S).padStart(I,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function A(E){await oo(y(E))&&(k.value=E.id,setTimeout(()=>{k.value===E.id&&(k.value=null)},1500))}function L(){i5(d.value)}function $(E){return u(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function _(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,N)=>(b(),T("section",obe,[w("header",ibe,[N[11]||(N[11]=w("strong",null,"KAP debug",-1)),w("span",rbe,O(d.value.length)+"/"+O(a.value.length),1),w("div",lbe,[w("button",{type:"button",class:Pe({on:C(Uu)}),onClick:N[0]||(N[0]=F=>Uu.value=!C(Uu))},O(C(Uu)?"resume":"pause"),3),w("button",{type:"button",onClick:N[1]||(N[1]=F=>C(wte)())},"clear"),w("button",{type:"button",onClick:N[2]||(N[2]=F=>L())},"export jsonl"),ie(Zt,{text:"Close window"},{default:Me(()=>[w("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",abe,[Rn(w("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[Wg,s.value]]),Rn(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=w("option",{value:""},"all sessions",-1)),(b(!0),T(Be,null,st(c.value,F=>(b(),T("option",{key:F,value:F},O(F),9,cbe))),128))],512),[[Wg,i.value]]),Rn(w("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[wo,o.value]]),w("label",ube,[Rn(w("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[Zh,r.value]]),N[14]||(N[14]=Qe(" errors",-1))]),w("label",dbe,[Rn(w("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[Zh,m.value]]),N[15]||(N[15]=Qe(" follow",-1))]),w("div",fbe,[w("button",{type:"button",class:Pe({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:Pe({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(b(),T("div",{key:0,ref_key:"listRef",ref:x,class:"kap-list"},[d.value.length===0?(b(),T("div",hbe," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(b(!0),T(Be,null,st(d.value,F=>(b(),T("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:Pe(["kap-row",{expanded:p.value===F.id}]),onClick:S=>g(F.id)},[w("span",mbe,O(v(F.ts)),1),w("span",{class:Pe(["kap-badge",$(F)])},O(_(F)),3),w("span",gbe,O(F.label),1)],10,pbe),p.value===F.id?(b(),T("div",vbe,[w("div",ybe,[w("button",{type:"button",onClick:S=>A(F)},O(k.value===F.id?"copied ✓":"copy json"),9,kbe)]),w("pre",null,O(y(F)),1)])):re("",!0)]))),128))],512)):(b(),T("div",bbe,[N[20]||(N[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[N[17]||(N[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(b(!0),T(Be,null,st(f.value,F=>(b(),T("tr",{key:F.key},[w("td",null,O(F.dir),1),w("td",xbe,O(F.eventType),1),w("td",_be,O(F.sessionId),1),w("td",wbe,O(F.count),1),w("td",Sbe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(b(),T("tr",Cbe,[...N[16]||(N[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),N[21]||(N[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[N[19]||(N[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(b(!0),T(Be,null,st(h.value,F=>(b(),T("tr",{key:F.key},[w("td",Abe,O(F.key),1),w("td",Mbe,O(F.count),1),w("td",{class:Pe(["num",{err:F.errors>0}])},O(F.errors),3),w("td",Ebe,O(F.avgMs),1)]))),128)),h.value.length===0?(b(),T("tr",Tbe,[...N[18]||(N[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),Ibe=dt(Nbe,[["__scopeId","data-v-3cda6fe3"]]),$be=Ge({__name:"DebugPanel",setup(e){const t=Q(!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=Qh(Ibe,{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 gn(()=>{c()}),ps(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(b(),be(Zt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Me(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Lbe=dt($be,[["__scopeId","data-v-21346738"]]);function Fbe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),s=D(()=>e.initialized.value&&!n.value),o="/login",i=Q(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ze(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return _n(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function Obe({running:e,showAuthGate:t}){const{t:n}=Tt(),s=["◐","◓","◑","◒"],o=Q(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ze(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});oT(()=>{typeof document<"u"&&(document.title=a.value)}),_n(()=>{l()})}const b8=Q(typeof window>"u"?0:window.innerWidth);let ah=0,qp=!1;function ty(){b8.value=window.innerWidth}function Rbe(){qp||typeof window>"u"||(window.addEventListener("resize",ty),qp=!0,ty())}function Bbe(){!qp||typeof window>"u"||(window.removeEventListener("resize",ty),qp=!1)}function x8(e,t,n){return Math.max(t,e-n)}function ny(e,t,n){return Math.min(n,Math.max(t,e))}function _8(){return gn(()=>{ah+=1,Rbe()}),ps(()=>{ah=Math.max(0,ah-1),ah===0&&Bbe()}),{viewportWidth:b8}}const Dbe="kimi-web.file-preview-width",gc=320;function Pbe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=_8(),i=D(()=>Math.max(0,o.value-t.value)),r=D(()=>x8(i.value,gc,gc));function l(me){return ny(Math.round(me),gc,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=Q(c.value),d=D(()=>ny(u.value,gc,r.value)),f=Q(null),h=D(()=>{const me=f.value;if(!me)return null;const ne=e.turns.value.find(ge=>ge.id===me.turnId)?.blocks?.[me.blockIndex];return ne?.kind==="thinking"?ne.thinking:null}),p=D(()=>h.value!==null);function m(me){const q=f.value;if(q&&q.turnId===me.turnId&&q.blockIndex===me.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=me}function x(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=Q(null),g=D(()=>{const me=k.value;if(!me)return null;const q=e.turns.value.find(ne=>ne.id===me.turnId);return q?.role==="compaction"&&q.text?q.text:null}),v=D(()=>g.value!==null);function y(me){if(k.value?.turnId===me.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=me}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const L=Q(null);function $(me){const q=e.activeAppTasks.value,ne=q.find(ue=>ue.id===me)??q.find(ue=>ue.parentToolCallId===me);if(ne)return ne.id;const ge=q.filter(ue=>ue.kind==="subagent"&&!ue.parentToolCallId);if(ge.length===1)return ge[0].id}const _=D(()=>{const me=L.value;if(!me)return null;const q=e.activeAppTasks.value.find(ne=>ne.id===me.subagentId);return q?hme(q):null}),E=D(()=>_.value!==null);function N(me){const q=$(me);if(q){if(L.value?.subagentId===q){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:q},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Q(null),I=D(()=>{const me=S.value;if(!me)return null;const q=XP(e.turns.value,me);return q?{id:me,title:$a(q.name),path:QP(q.arg),lines:q.status==="error"?null:kA(q),output:q.output}:null}),R=D(()=>I.value!==null);function B(me){if(n.value==="toolDiff"&&S.value===me){P();return}n.value="toolDiff",S.value=me}function P(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Q("list"),W=Q(null);function X(){if(n.value==="diff"){U();return}n.value="diff",z.value="list",W.value=null,e.loadGitStatus(e.activeSessionId.value)}function U(){n.value==="diff"&&(n.value=null),z.value="list",W.value=null,e.clearFileDiff()}async function Z(me){z.value="detail",W.value=me,await e.loadFileDiff(me)}async function ce(me){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,me):await e.openSideChat(me),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function se(){n.value==="btw"&&(n.value=null)}const Y=D(()=>e.sideChatVisible.value),J=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||Y.value)),le=Q(!1),He=Q({});function de(){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 L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function G(me){if(me)switch(me.kind){case"thinking":f.value={turnId:me.turnId,blockIndex:me.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:me.turnId},n.value="compaction";break;case"agent":L.value={subagentId:me.subagentId},n.value="agent";break;case"toolDiff":S.value=me.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ae(){return n.value==="thinking"&&p.value?(x(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&R.value?(P(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(U(),!0):n.value==="btw"?(fe(),!0):!1}return Ze(e.activeSessionId,(me,q)=>{if(q){const ne=de();ne?He.value[q]=ne:delete He.value[q]}s(),x(),A(),F(),P(),U(),se(),me&&G(He.value[me])}),{PREVIEW_WIDTH_KEY:Dbe,PREVIEW_MIN:gc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:x,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:A,agentPanelMember:_,agentPanelVisible:E,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:I,toolDiffVisible:R,openToolDiff:B,closeToolDiff:P,detailDiffMode:z,detailDiffPath:W,openDiffDetail:X,closeDiffDetail:U,selectDiffFile:Z,btwVisible:Y,openSideChatTab:ce,closeSideChat:fe,hideSideChatPanel:se,sidePanelVisible:J,panelDragging:le,closeOpenSidePanel:ae}}const Hbe=Lt.sidebarWidth,t4=Lt.sidebarCollapsed,n4=270,wg=170,Wbe=480,zbe=320;function Ube(e={}){const{viewportWidth:t}=_8(),n=Q(n4),s=Q(!1),o=Q(!1),i=D(()=>{const u=zbe+(A4(e.previewOpen)?gc:0);return Math.min(Wbe,x8(t.value,wg,u))}),r=D(()=>ny(n.value,wg,i.value));function l(){try{s.value=cs(t4)==="true"}catch{s.value=!1}}function a(){try{ms(t4,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:Hbe,SIDEBAR_DEFAULT:n4,SIDEBAR_MIN:wg,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function qbe({client:e,detailTarget:t}){const{t:n}=Tt(),s=Q(null),o=Q(null),i=Q(!1),r=Q(null),l=Q(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),f=D(()=>s.value!==null);function h($){return $.length>1?$.replace(/\/+$/,""):$}function p($){const _=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){_.pop();continue}_.push(E)}return _.join("/")}function m($){const _=$.trim();if(!_)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(_))return{error:n("filePreview.errors.unsupportedPath")};if(_.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=h(e.status.value.cwd);if(_.startsWith("/")){if(!E||_!==E&&!_.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=_===E?"":_.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(_.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=p(_);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function x($){const _=s.value;if(t.value==="file"&&_&&_.path===$.path&&_.line===$.line){y();return}const E=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=$,l.value=null;const N=m($.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if(E!==a)return;F?o.value={...F,path:F.path||N.path}:o.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function k($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const _=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const E={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??k($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,o.value=E,pt().getFileBlob($.fileId).then(N=>{if(_===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(N),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{_===a&&(o.value&&(o.value={...o.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,o.value={...E,sourceUrl:$.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ze(t,($,_)=>{_==="file"&&$!=="file"&&v()});function A(){const $=o.value?.path??s.value?.path;$&&e.openWorkspaceFile($,s.value?.line)}function L(){const $=o.value?.path??s.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:x,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:A,revealPreviewFile:L}}const jbe=640,Vbe=`(max-width: ${jbe}px)`;function Kbe(){const e=Q(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Vbe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),_n(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),_n(()=>t.removeListener(n))),e}const Gbe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Ybe={class:"server-auth-card"},Zbe={class:"server-auth-body"},Qbe={class:"server-auth-foot"},Xbe=Ge({__name:"ServerAuthDialog",setup(e){const t=Q(""),n=Q(null),s=Q(!1);gn(()=>{gt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,f5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(b(),T("div",Gbe,[w("div",Ybe,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[Qe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),Qe("). ")])],-1)),w("div",Zbe,[ie(zc,{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"])]),w("div",Qbe,[ie(Dt,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Me(()=>[Qe(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Jbe=dt(Xbe,[["__scopeId","data-v-6f624612"]]),exe=["aria-label"],txe=Ge({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=mB;return(s,o)=>C(n)?(b(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=w("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"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,O(C(t)("app.internalBuildBanner")),1)],8,exe)):re("",!0)}}),nxe=dt(txe,[["__scopeId","data-v-166b3735"]]),sxe={class:"app-shell"},oxe={key:1,class:"auth-page"},ixe={class:"auth-page-inner"},rxe={class:"auth-page-copy"},lxe=["aria-label","aria-hidden"],axe=Ge({__name:"App",setup(e){mne();const t=Q(!1);let n=null;const s=a2(),o=D(()=>!s.dangerousBypassAuth.value&&t.value);Fn("resolveImage",s.resolveImageUrl),Fn("resolveSwarmMembers",ut=>s.swarmMembersByToolCallId.value.get(ut)??[]);const{t:i}=Tt(),r=Di(),l=Kbe(),a=Q(!1),c=Q(!1),u=D(()=>{const ut=s.activeSessionId.value;return s.sessions.value.find(ke=>ke.id===ut)?.title??""}),d=D(()=>s.visibleWorkspace.value?.sessionCount??0),f=D(()=>s.activity.value!=="idle"),h=Q(null),{showAuthGate:p,blinkAuthLogo:m}=Fbe({client:s,authLogoRef:h});Obe({running:f,showAuthGate:p});function x(ut){const ke=s.models.value.find(nt=>nt.id===s.status.value.modelId),Fe=Bk(ke),Ut=Fa(ke,ut),lo=Fe.indexOf(Ut),Ke=Fe[(lo+1)%Fe.length]??Fe[0]??"off";return Dk(ke,Ke)}const k=Q(!s.onboarded.value);function g(){s.setOnboarded(!0),k.value=!1}function v(){k.value=!0}gn(()=>{n=yne(()=>{t.value=!0,s.clearDangerousBypassAuth()}),s.load(),le(),document.addEventListener("keydown",y,!0)}),_n(()=>{document.removeEventListener("keydown",y,!0),n!==null&&(n(),n=null)});function y(ut){ut.key==="Escape"&&(Fs.value||rt()&&(ut.stopPropagation(),ut.preventDefault()))}const A=Q(null),L=Q(!1);Ze(s.activeSessionId,()=>{L.value=!0,gt(()=>{L.value=!1})});const{previewTarget:$,previewFile:_,previewLoading:E,previewError:N,previewDownloadUrl:F,previewExternalActions:S,openFilePreview:I,openMediaPreview:R,closeFilePreview:B,openPreviewInEditor:P,revealPreviewFile:z}=qbe({client:s,detailTarget:A}),W=D(()=>A.value!==null),{SIDEBAR_WIDTH_KEY:X,SIDEBAR_DEFAULT:U,SIDEBAR_MIN:Z,sidebarMax:ce,sessionColWidth:fe,sidebarCollapsed:se,sidebarDragging:Y,sideWidth:J,loadSidebarCollapsed:le,toggleSidebarCollapse:He}=Ube({previewOpen:W}),{PREVIEW_WIDTH_KEY:de,PREVIEW_MIN:G,previewDefaultWidth:ae,previewMax:me,previewWidth:q,previewPanelWidth:ne,thinkingPanelText:ge,thinkingVisible:ue,openThinkingPanel:ye,closeThinkingPanel:j,compactionPanelText:te,compactionPanelVisible:pe,openCompactionPanel:Ce,closeCompactionPanel:Ie,agentPanelMember:$e,openAgentPanel:he,closeAgentPanel:Ne,toolDiffTarget:Je,openToolDiff:it,closeToolDiff:At,detailDiffMode:bt,detailDiffPath:wt,openDiffDetail:Gt,closeDiffDetail:vt,selectDiffFile:ln,btwVisible:Gn,openSideChatTab:Un,closeSideChat:Vt,sidePanelVisible:an,panelDragging:es,closeOpenSidePanel:rt}=Pbe({client:s,sideWidth:J,detailTarget:A,closeFilePreview:B}),In=Q(null),gs=Q(!1),yn=Q(!1),us=Q(!1),ts=Q(!1),kn=Q(!1),qn=Q(!1),$n=Q(null),ds=Q(null),Fs=D(()=>fc.value>0||gs.value||yn.value||us.value||ts.value||kn.value||qn.value||k.value||a.value||c.value),wn=Q(!1),As=Q(!1),zn=Q(!1),Pt=Q(!1),Ye=Q(!1);async function je(){wn.value=!0,As.value=!1,gs.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{As.value=!0}finally{wn.value=!1}}async function Ot(){zn.value=!0,Pt.value=!1,yn.value=!0;try{await s.loadProviders()}catch{Pt.value=!0}finally{zn.value=!1}}function Ht(){us.value=!0}async function dn(ut){gs.value=!1,await Qt(ut)}async function Qt(ut){await s.setModel(ut)&&ut!==s.defaultModel.value&&s.updateConfig({defaultModel:ut})}async function Sn(ut){await s.addProvider(ut)}async function Cn(ut){await s.deleteProvider(ut)}async function Nt(ut){await s.refreshProvider(ut)}async function fs(ut){Ye.value=!0;try{await s.updateConfig(ut)&&await s.checkAuth()}finally{Ye.value=!1}}async function ns(){return s.startOAuthLogin()}async function ro(){return s.pollOAuthLogin()}async function Dn(){return s.cancelOAuthLogin()}async function ss(){us.value=!1,await s.checkAuth(),await s.load()}async function Ai(ut){await s.undo(1),await gt(),In.value?.loadComposerForEdit(ut.text,ut.images)}function Os(ut){if(ut==="/compact"||ut.startsWith("/compact ")){s.compact(ut.slice(8).trim()||void 0);return}if(ut==="/swarm"||ut.startsWith("/swarm ")){const ke=ut.slice(6).trim();ke==="on"?s.setSwarmMode(!0):ke==="off"?s.setSwarmMode(!1):ke?(s.setSwarmMode(!0),s.sendPrompt(ke)):s.toggleSwarmMode();return}if(ut==="/goal"||ut.startsWith("/goal ")){const ke=ut.slice(5).trim();ke==="pause"||ke==="resume"||ke==="cancel"?s.controlGoal(ke):ke?s.createGoal(ke):s.toggleGoalMode();return}if(ut==="/btw"||ut.startsWith("/btw ")){const ke=ut.slice(4).trim();!ke&&s.sideChatVisible.value?Vt():Un(ke||void 0);return}switch(ut){case"/new":case"/clear":ii();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(x(s.thinking.value));break;case"/status":kn.value=!0;break;case"/login":Ht();break;default:{const ke=ut.indexOf(" "),Fe=Pie((ke===-1?ut:ut.slice(0,ke)).slice(1)),Ut=ke===-1?void 0:ut.slice(ke+1).trim()||void 0;if(!Fe)break;!s.activeSessionId.value&&s.activeWorkspaceId.value?s.startSessionAndActivateSkill(s.activeWorkspaceId.value,Fe,Ut):s.activateSkill(Fe,Ut);break}}}function si(ut){s.unqueue(ut)}function So(ut){s.unqueue(ut)}function Pi(ut){s.reorderQueue(ut.from,ut.to)}async function oi(ut){const ke=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&ke){await s.startSessionAndSendPrompt(ke,ut.text,ut.attachments);return}if(!s.activeSessionId.value&&!ke){$n.value=ut,ts.value=!0;return}s.sendPrompt(ut.text,ut.attachments)}async function vs(ut){if(ds.value=null,!await s.addWorkspaceByPath(ut)){ds.value=i("workspace.addFailed");return}ts.value=!1;const Fe=$n.value;$n.value=null;const Ut=s.activeWorkspaceId.value;Fe&&Ut&&await s.startSessionAndSendPrompt(Ut,Fe.text,Fe.attachments)}function Co(){$n.value=null,ds.value=null,ts.value=!1}function Hi(){gt(()=>{In.value?.focusComposer()})}function ii(){const ut=s.activeWorkspaceId.value;ut?s.openWorkspaceDraft(ut):s.clearActiveSession(),Hi()}function Yn(ut){s.openWorkspaceDraft(ut),Hi()}function Rs(ut){ut&&window.open(ut,"_blank","noopener")}return(ut,ke)=>(b(),T("div",sxe,[o.value?(b(),be(Jbe,{key:0})):re("",!0),C(p)?(b(),T("section",oxe,[w("div",ixe,[(b(),T("svg",{ref_key:"authLogoRef",ref:h,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:ke[0]||(ke[0]=xt(()=>{},["prevent"])),onClick:ke[1]||(ke[1]=(...Fe)=>C(m)&&C(m)(...Fe))},[...ke[98]||(ke[98]=[xy('<defs data-v-b5da0a91><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-b5da0a91><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-b5da0a91></rect><g class="ch-eyes" fill="#000" data-v-b5da0a91><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-b5da0a91></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-b5da0a91></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-b5da0a91></rect>',2)])],544)),w("div",rxe,[w("h1",null,O(C(i)("app.authPageTitle")),1),w("p",null,O(C(i)("app.authPageMessage")),1)]),ie(Dt,{class:"auth-page-btn",variant:"primary",onClick:Ht},{default:Me(()=>[ie(qe,{name:"log-in",size:"md"}),w("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(b(),T("div",{key:2,class:Pe(["app",{mobile:C(l),"sidebar-collapsed":C(se)&&!C(l),"macos-desktop":C(Fc)}]),style:Yt({"--preview-w":C(ne)+"px"})},[C(l)?(b(),be(ake,{key:1,workspace:C(s).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:C(s).status.value.branch,"session-count":d.value,onOpenSwitcher:ke[19]||(ke[19]=Fe=>a.value=!0),onOpenSettings:ke[20]||(ke[20]=Fe=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(b(),T(Be,{key:0},[ie(DB,{collapsed:C(se),dragging:C(Y),"col-width":C(J),"active-workspace":C(s).visibleWorkspace.value,"active-workspace-id":C(s).activeWorkspaceId.value,sessions:C(s).sessionsForView.value,groups:C(s).workspaceGroups.value,"active-id":C(s).activeSessionId.value,"attention-by-session":C(s).attentionBySession.value,"pending-by-session":C(s).pendingBySession.value,"unread-by-session":C(s).unreadBySession.value,"workspace-sort-mode":C(s).workspaceSortMode.value,backend:C(s).backend.value,onSelect:ke[2]||(ke[2]=Fe=>C(s).selectSession(Fe)),onCreate:ii,onCreateInWorkspace:ke[3]||(ke[3]=Fe=>Yn(Fe)),onSelectWorkspace:ke[4]||(ke[4]=Fe=>C(s).openWorkspace(Fe)),onAddWorkspace:ke[5]||(ke[5]=Fe=>ts.value=!0),onRename:ke[6]||(ke[6]=(Fe,Ut)=>C(s).renameSession(Fe,Ut)),onArchive:ke[7]||(ke[7]=Fe=>C(s).archiveSession(Fe)),onFork:ke[8]||(ke[8]=Fe=>C(s).forkSession(Fe)),onExport:ke[9]||(ke[9]=Fe=>C(s).exportSession(Fe)),onRenameWorkspace:ke[10]||(ke[10]=(Fe,Ut)=>C(s).renameWorkspace(Fe,Ut)),onDeleteWorkspace:ke[11]||(ke[11]=Fe=>C(s).deleteWorkspace(Fe)),onReorderWorkspaces:ke[12]||(ke[12]=Fe=>C(s).reorderWorkspaces(Fe)),onSetWorkspaceSortMode:ke[13]||(ke[13]=Fe=>C(s).setWorkspaceSortMode(Fe)),onLoadMoreSessions:ke[14]||(ke[14]=Fe=>void C(s).loadMoreSessions(Fe)),onLoadAllSessions:ke[15]||(ke[15]=Fe=>void C(s).loadAllSessions()),onOpenSettings:ke[16]||(ke[16]=Fe=>qn.value=!0),onCollapse:C(He)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),Rn(ie(r_,{class:"side-handle","storage-key":C(X),"default-width":C(U),min:C(Z),max:C(ce),"onUpdate:width":ke[17]||(ke[17]=Fe=>fe.value=Fe),"onUpdate:dragging":ke[18]||(ke[18]=Fe=>Y.value=Fe)},null,8,["storage-key","default-width","min","max"]),[[yi,!C(se)]])],64)),ie(Yce,{ref_key:"conversationPaneRef",ref:In,mobile:C(l),turns:C(s).turns.value,"session-id":C(s).activeSessionId.value,approvals:C(s).pendingApprovals.value,changes:C(s).changes.value,"git-info":C(s).gitInfo.value,tasks:C(s).tasks.value,todos:C(s).todos.value,goal:C(s).goal.value,"activation-badges":C(s).activationBadges.value,status:C(s).status.value,thinking:C(s).thinking.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"goal-mode":C(s).goalMode.value,models:C(s).models.value,"starred-ids":C(s).starredModelIds.value,skills:C(s).skills.value,questions:C(s).questions.value,"pending-question-actions":C(s).pendingQuestionActions,"pending-approval-actions":C(s).pendingApprovalActions,running:f.value,queued:C(s).queued.value,"search-files":C(s).searchFiles,"upload-image":C(s).uploadImage,sending:C(s).isSending.value,starting:C(s).isStartingFirstPrompt.value,"fast-moon":C(s).fastMoon.value,"file-reload-key":C(s).activeSessionId.value,"session-loading":C(s).sessionLoading.value,compaction:C(s).compaction.value,"has-more-messages":C(s).hasMoreMessages.value,"loading-more":C(s).loadingMoreMessages.value,"loading-more-error":C(s).loadMoreMessagesError.value,"load-older-messages":C(s).loadOlderMessages,"workspace-name":C(s).visibleWorkspace.value?.name,"workspace-root":C(s).visibleWorkspace.value?.root??C(s).status.value.cwd,"git-diff-stats":C(s).gitDiffStats.value,workspaces:C(s).workspacesView.value,"active-workspace-id":C(s).activeWorkspaceId.value,"session-title":u.value,pr:C(s).activePullRequest.value,"conversation-toc":C(s).conversationToc.value,onOpenChanges:ke[21]||(ke[21]=Fe=>C(Gt)()),onSelectWorkspace:ke[22]||(ke[22]=Fe=>Yn(Fe)),onAddWorkspace:ke[23]||(ke[23]=Fe=>ts.value=!0),onOpenPr:Rs,onSubmit:ke[24]||(ke[24]=Fe=>oi(Fe)),onSteer:ke[25]||(ke[25]=Fe=>C(s).steerPrompt(Fe.text,Fe.attachments)),onApproval:ke[26]||(ke[26]=(Fe,Ut)=>C(s).respondApproval(Fe,Ut)),onCancelTask:ke[27]||(ke[27]=Fe=>C(s).cancelTask(Fe)),onAnswer:ke[28]||(ke[28]=(Fe,Ut)=>C(s).respondQuestion(Fe,Ut)),onDismiss:ke[29]||(ke[29]=Fe=>C(s).dismissQuestion(Fe)),onCommand:Os,onInterrupt:ke[30]||(ke[30]=Fe=>C(s).abortCurrentPrompt()),onUnqueue:si,onEditQueued:So,onReorderQueue:Pi,onSetPermission:ke[31]||(ke[31]=Fe=>C(s).setPermission(Fe)),onSetThinking:ke[32]||(ke[32]=Fe=>C(s).setThinking(Fe)),onTogglePlan:ke[33]||(ke[33]=Fe=>C(s).togglePlanMode()),onToggleSwarm:ke[34]||(ke[34]=Fe=>C(s).toggleSwarmMode()),onToggleGoal:ke[35]||(ke[35]=Fe=>C(s).toggleGoalMode()),onCreateGoal:ke[36]||(ke[36]=Fe=>C(s).createGoal(Fe)),onControlGoal:ke[37]||(ke[37]=Fe=>C(s).controlGoal(Fe)),onRefreshGitStatus:ke[38]||(ke[38]=Fe=>C(s).activeSessionId.value&&C(s).loadGitStatus(C(s).activeSessionId.value)),onRenameSession:ke[39]||(ke[39]=(Fe,Ut)=>C(s).renameSession(Fe,Ut)),onForkSession:ke[40]||(ke[40]=Fe=>C(s).forkSession(Fe)),onArchiveSession:ke[41]||(ke[41]=Fe=>C(s).archiveSession(Fe)),onExportSession:ke[42]||(ke[42]=Fe=>C(s).exportSession(Fe)),onCompact:ke[43]||(ke[43]=Fe=>C(s).compact()),onPickModel:ke[44]||(ke[44]=Fe=>je()),onSelectModel:ke[45]||(ke[45]=Fe=>Qt(Fe)),onOpenFile:ke[46]||(ke[46]=Fe=>C(I)(Fe)),onOpenMedia:ke[47]||(ke[47]=Fe=>C(R)(Fe)),onOpenThinking:ke[48]||(ke[48]=Fe=>C(ye)(Fe)),onOpenCompaction:ke[49]||(ke[49]=Fe=>C(Ce)(Fe)),onOpenAgent:ke[50]||(ke[50]=Fe=>C(he)(Fe)),onOpenToolDiff:ke[51]||(ke[51]=Fe=>C(it)(Fe)),onEditMessage:Ai},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","queued","search-files","upload-image","sending","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(l)&&(C(Fc)||C(se))?(b(),be(Wn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(se)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(He)},{default:Me(()=>[ie(qe,{name:C(se)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):re("",!0),C(an)&&!C(l)?(b(),be(r_,{key:3,class:"preview-handle","storage-key":C(de),"default-width":C(ae),min:C(G),max:C(me),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":ke[52]||(ke[52]=Fe=>q.value=Fe),"onUpdate:dragging":ke[53]||(ke[53]=Fe=>es.value=Fe)},null,8,["storage-key","default-width","min","max","aria-label"])):re("",!0),!C(l)||C(an)?(b(),T("aside",{key:4,class:Pe(["global-preview",{open:C(an),mobile:C(l),"no-anim":C(es)||L.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(an)},[A.value==="thinking"&&C(ue)?(b(),be(PC,{key:0,text:C(ge)??"",onClose:C(j)},null,8,["text","onClose"])):A.value==="compaction"&&C(pe)?(b(),be(PC,{key:1,text:C(te)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(Ie)},null,8,["text","subtitle","onClose"])):A.value==="agent"&&C($e)?(b(),be(gde,{key:2,member:C($e),onClose:C(Ne)},null,8,["member","onClose"])):A.value==="btw"&&C(Gn)?(b(),be(Bde,{key:3,turns:C(s).sideChatTurns.value,running:C(s).sideChatRunning.value,sending:C(s).sideChatSending.value,onSend:ke[54]||(ke[54]=Fe=>C(s).sendSideChatPrompt(Fe)),onClose:C(Vt)},null,8,["turns","running","sending","onClose"])):A.value==="diff"?(b(),be(dfe,{key:4,mode:C(bt),changes:C(s).changes.value,"git-info":C(s).gitInfo.value,"file-diff":C(s).fileDiff.value,"selected-diff-path":C(s).selectedDiffPath.value,"file-diff-loading":C(s).fileDiffLoading.value,closable:"",onOpen:C(ln),onBack:ke[55]||(ke[55]=Fe=>{bt.value="list",wt.value=null,C(s).clearFileDiff()}),onClose:C(vt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):A.value==="toolDiff"&&C(Je)?(b(),be(Tde,{key:5,target:C(Je),onClose:C(At)},null,8,["target","onClose"])):A.value==="file"?(b(),be(Que,{key:6,file:C(_),loading:C(E),error:C(N),line:C($)?.line,"download-url":C(F),closable:"","external-actions":C(S),"open-file":C(I),onClose:C(B),onOpenExternal:C(P),onReveal:C(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):re("",!0)],10,lxe)):re("",!0),ie(nxe,{class:"internal-build-fab"}),gs.value?(b(),be(Nfe,{key:5,models:C(s).models.value,current:C(s).status.value.modelId,"starred-ids":C(s).starredModelIds.value,loading:wn.value,unavailable:As.value,onSelect:ke[56]||(ke[56]=Fe=>dn(Fe)),onToggleStar:ke[57]||(ke[57]=Fe=>C(s).toggleStarModel(Fe)),onClose:ke[58]||(ke[58]=Fe=>gs.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),qn.value?(b(),be(Pve,{key:6,"color-scheme":C(s).colorScheme.value,accent:C(s).accent.value,"ui-font-size":C(s).uiFontSize.value,"auth-ready":C(s).authReady.value,"account-model":C(s).defaultModel.value,notify:C(s).notifyOnComplete.value,"notify-question":C(s).notifyOnQuestion.value,"notify-approval":C(s).notifyOnApproval.value,"notify-permission":C(s).notifyPermission.value,sound:C(s).soundOnComplete.value,"conversation-toc":C(s).conversationToc.value,config:C(s).config.value,models:C(s).models.value,"config-saving":Ye.value,"server-version":C(s).serverVersion.value,backend:C(s).backend.value,onSetColorScheme:ke[59]||(ke[59]=Fe=>C(s).setColorScheme(Fe)),onSetAccent:ke[60]||(ke[60]=Fe=>C(s).setAccent(Fe)),onSetUiFontSize:ke[61]||(ke[61]=Fe=>C(s).setUiFontSize(Fe)),onSetNotify:ke[62]||(ke[62]=Fe=>C(s).setNotifyOnComplete(Fe)),onSetNotifyQuestion:ke[63]||(ke[63]=Fe=>C(s).setNotifyOnQuestion(Fe)),onSetNotifyApproval:ke[64]||(ke[64]=Fe=>C(s).setNotifyOnApproval(Fe)),onSetSound:ke[65]||(ke[65]=Fe=>C(s).setSoundOnComplete(Fe)),onSetConversationToc:ke[66]||(ke[66]=Fe=>C(s).setConversationToc(Fe)),onUpdateConfig:ke[67]||(ke[67]=Fe=>fs(Fe)),onLogin:ke[68]||(ke[68]=()=>{qn.value=!1,Ht()}),onLogout:C(s).logout,onOpenOnboarding:ke[69]||(ke[69]=()=>{qn.value=!1,v()}),onOpenProviders:ke[70]||(ke[70]=()=>{qn.value=!1,Ot()}),onClose:ke[71]||(ke[71]=Fe=>qn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):re("",!0),yn.value?(b(),be(the,{key:7,providers:C(s).providers.value,loading:zn.value,unavailable:Pt.value,onAdd:ke[72]||(ke[72]=Fe=>Sn(Fe)),onRefresh:ke[73]||(ke[73]=Fe=>Nt(Fe)),onDelete:ke[74]||(ke[74]=Fe=>Cn(Fe)),onOpenLogin:ke[75]||(ke[75]=()=>{yn.value=!1,Ht()}),onClose:ke[76]||(ke[76]=Fe=>yn.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),kn.value?(b(),be(Wye,{key:8,status:C(s).status.value,thinking:C(s).thinking.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"cost-usd":C(s).sessionCost.value,onClose:ke[77]||(ke[77]=Fe=>kn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),ts.value?(b(),be(Cye,{key:9,"browse-fs":C(s).browseFs,"get-fs-home":C(s).getFsHome,"default-path":C(s).visibleWorkspace.value?.root??C(s).status.value.cwd,error:ds.value,onAdd:ke[78]||(ke[78]=Fe=>vs(Fe)),onClose:Co},null,8,["browse-fs","get-fs-home","default-path","error"])):re("",!0),ie(Tl,{name:"gload-fade"},{default:Me(()=>[C(s).initialized.value?re("",!0):(b(),be(sbe,{key:0,issue:C(s).connectIssue.value},null,8,["issue"]))]),_:1}),C(s).initialized.value&&k.value&&!C(p)?(b(),be(Z2e,{key:10,onComplete:g,onSkip:g})):re("",!0),ie(Jye,{warnings:C(s).warnings.value,onDismiss:C(s).dismissWarning},null,8,["warnings","onDismiss"]),C(r)?(b(),be(Lbe,{key:11})):re("",!0),ie(Tye),C(l)?(b(),be(Ike,{key:12,modelValue:a.value,"onUpdate:modelValue":ke[79]||(ke[79]=Fe=>a.value=Fe),groups:C(s).workspaceGroups.value,"active-workspace-id":C(s).activeWorkspaceId.value,"active-id":C(s).activeSessionId.value,"attention-by-session":C(s).attentionBySession.value,"attention-by-workspace":C(s).attentionByWorkspace.value,onSelect:ke[80]||(ke[80]=Fe=>C(s).selectSession(Fe)),onCreate:ii,onCreateInWorkspace:ke[81]||(ke[81]=Fe=>Yn(Fe)),onAddWorkspace:ke[82]||(ke[82]=Fe=>ts.value=!0),onRename:ke[83]||(ke[83]=(Fe,Ut)=>C(s).renameSession(Fe,Ut)),onArchive:ke[84]||(ke[84]=Fe=>C(s).archiveSession(Fe)),onDeleteWorkspace:ke[85]||(ke[85]=Fe=>C(s).deleteWorkspace(Fe)),onLoadMore:ke[86]||(ke[86]=Fe=>void C(s).loadMoreSessions(Fe))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),C(l)?(b(),be(D2e,{key:13,modelValue:c.value,"onUpdate:modelValue":ke[87]||(ke[87]=Fe=>c.value=Fe),status:C(s).status.value,thinking:C(s).thinking.value,models:C(s).models.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"color-scheme":C(s).colorScheme.value,"ui-font-size":C(s).uiFontSize.value,"auth-ready":C(s).authReady.value,"conversation-toc":C(s).conversationToc.value,"server-version":C(s).serverVersion.value,onPickModel:ke[88]||(ke[88]=Fe=>je()),onSetThinking:ke[89]||(ke[89]=Fe=>C(s).setThinking(Fe)),onTogglePlan:ke[90]||(ke[90]=Fe=>C(s).togglePlanMode()),onToggleSwarm:ke[91]||(ke[91]=Fe=>C(s).toggleSwarmMode()),onSetPermission:ke[92]||(ke[92]=Fe=>C(s).setPermission(Fe)),onSetColorScheme:ke[93]||(ke[93]=Fe=>C(s).setColorScheme(Fe)),onSetUiFontSize:ke[94]||(ke[94]=Fe=>C(s).setUiFontSize(Fe)),onSetConversationToc:ke[95]||(ke[95]=Fe=>C(s).setConversationToc(Fe)),onLogin:ke[96]||(ke[96]=()=>{c.value=!1,Ht()}),onLogout:C(s).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):re("",!0)],6)),us.value?(b(),be(Ihe,{key:3,"on-start-o-auth-login":ns,"on-poll-o-auth-login":ro,"on-cancel-o-auth-login":Dn,onSuccess:ss,onClose:ke[97]||(ke[97]=Fe=>us.value=!1)})):re("",!0)]))}}),cxe=dt(axe,[["__scopeId","data-v-b5da0a91"]]);Tte();Qh(cxe).use(En).mount("#app");export{xE as $,j4 as A,dT as B,xs as C,a_e as D,c4 as E,Be as F,xy as G,Qe as H,ie as I,qE as J,Lxe as K,$i as L,Ge as M,B9 as N,Bxe as O,Dxe as P,Wxe as Q,Lh as R,$c as S,rm as T,Pxe as U,wy as V,Rxe as W,u_e as X,Hxe as Y,s_e as Z,dxe as _,D4 as a,Ks as a$,Zs as a0,iy as a1,kxe as a2,dy as a3,l9 as a4,mn as a5,eu as a6,Cxe as a7,h_e as a8,Txe as a9,U4 as aA,_T as aB,ET as aC,gn as aD,MT as aE,AT as aF,ry as aG,CT as aH,_n as aI,hy as aJ,YE as aK,b as aL,F9 as aM,wxe as aN,Fn as aO,M4 as aP,_xe as aQ,Dh as aR,Hs as aS,Oh as aT,Q as aU,Qxe as aV,J9 as aW,st as aX,Bn as aY,NT as aZ,Fxe as a_,$xe as aa,Ixe as ab,Nxe as ac,Jxe as ad,p_e as ae,Kt as af,h9 as ag,om as ah,xl as ai,Br as aj,hs as ak,Xxe as al,Yo as am,El as an,mt as ao,qxe as ap,jxe as aq,bn as ar,gt as as,y9 as at,Pe as au,uxe as av,Yt as aw,xT as ax,ST as ay,ps as az,xxe as b,oX as b$,r_e as b0,pd as b1,qh as b2,o_e as b3,Ml as b4,HE as b5,hxe as b6,Na as b7,nT as b8,i_e as b9,wo as bA,yi as bB,p9 as bC,t_e as bD,Ze as bE,oT as bF,Axe as bG,iT as bH,Kxe as bI,Me as bJ,zxe as bK,Rn as bL,Ji as bM,e_e as bN,xt as bO,Sxe as bP,vn as bQ,mo as bR,S_e as bS,KX as bT,IM as bU,A_e as bV,_Q as bW,pk as bX,C_e as bY,mv as bZ,$_e as b_,fxe as ba,O as bb,ch as bc,Oxe as bd,nn as be,gxe as bf,mxe as bg,A4 as bh,Zxe as bi,pxe as bj,C as bk,Wd as bl,f_e as bm,c_e as bn,P9 as bo,Mxe as bp,Gxe as bq,sT as br,d_e as bs,Uxe as bt,Exe as bu,B4 as bv,Zh as bw,G9 as bx,N3 as by,Wg as bz,n_e as c,sX as c0,dk as c1,nX as c2,x_e as c3,mQ as c4,b_e as c5,xp as c6,v_e as c7,tX as c8,CM as c9,I_e as ca,y_e as cb,F_e as cc,xv as cd,wc as ce,kv as cf,O_e as cg,L_e as ch,w_e as ci,Vo as cj,k_e as ck,__e as cl,SQ as cm,N_e as cn,bv as co,yv as cp,T_e as cq,g_e as cr,E_e as cs,M_e as ct,qe as cu,m_e as cv,dt as cw,Yxe as d,_l as e,vxe as f,Tl as g,z9 as h,yxe as i,bxe as j,Si as k,Dd as l,Ls as m,Zp as n,Dr as o,l_e as p,D as q,Qh as r,be as s,re as t,T as u,w as v,XT as w,Vxe as x,QT as y,e7 as z};
|