neoctl-web 0.1.13 → 0.1.14
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/README.md +41 -1
- package/chunk-uploads.mjs +125 -0
- package/core-runtime.mjs +1 -0
- package/dist/assets/App--pG9o2Yv.js +105 -0
- package/dist/assets/App-DmtsTXw2.css +1 -0
- package/dist/assets/index-Ckm5fgYu.js +18 -0
- package/dist/assets/index-Dgfhk2Ym.css +1 -0
- package/dist/index.html +2 -2
- package/execution-backend.mjs +74 -0
- package/isolation-auth.mjs +225 -0
- package/isolation.example.json +8 -0
- package/isolation.mjs +385 -0
- package/package.json +9 -2
- package/plugins/downloads/README.md +40 -0
- package/plugins/downloads/downloads.mjs +81 -120
- package/plugins/downloads/downloads.test.mjs +83 -0
- package/plugins/downloads/index.mjs +10 -8
- package/plugins/downloads/neo-plugin.json +2 -2
- package/plugins/video-share/README.md +55 -0
- package/plugins/video-share/http.mjs +86 -0
- package/plugins/video-share/index.mjs +65 -0
- package/plugins/video-share/neo-plugin.json +9 -0
- package/plugins/video-share/presentation.mjs +23 -0
- package/plugins/video-share/store.mjs +76 -0
- package/plugins/video-share/video-share.test.mjs +182 -0
- package/plugins/xhs-artifact/editor-page.mjs +4 -4
- package/runtime-workspaces.mjs +9 -6
- package/scripts/isolation-user.mjs +68 -0
- package/server.mjs +26 -7
- package/dist/assets/index-9hY14np_.css +0 -1
- package/dist/assets/index-BnJuxSfa.js +0 -121
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
var Jm=Object.defineProperty;var Xm=(e,t,n)=>t in e?Jm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>Xm(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
|
|
2
|
-
* @vue/shared v3.5.34
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function Tl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Fe={},Os=[],nn=()=>{},af=()=>!1,So=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Eo=e=>e.startsWith("onUpdate:"),st=Object.assign,Al=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},eb=Object.prototype.hasOwnProperty,$e=(e,t)=>eb.call(e,t),_e=Array.isArray,Ls=e=>Kr(e)==="[object Map]",Hs=e=>Kr(e)==="[object Set]",Fu=e=>Kr(e)==="[object Date]",Se=e=>typeof e=="function",qe=e=>typeof e=="string",sn=e=>typeof e=="symbol",Be=e=>e!==null&&typeof e=="object",lf=e=>(Be(e)||Se(e))&&Se(e.then)&&Se(e.catch),cf=Object.prototype.toString,Kr=e=>cf.call(e),tb=e=>Kr(e).slice(8,-1),uf=e=>Kr(e)==="[object Object]",Cl=e=>qe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ar=Tl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),To=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},nb=/-\w/g,_t=To(e=>e.replace(nb,t=>t.slice(1).toUpperCase())),sb=/\B([A-Z])/g,Un=To(e=>e.replace(sb,"-$1").toLowerCase()),Ao=To(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ra=To(e=>e?`on${Ao(e)}`:""),tn=(e,t)=>!Object.is(e,t),Xi=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},df=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},Co=e=>{const t=parseFloat(e);return isNaN(t)?e:t},rb=e=>{const t=qe(e)?Number(e):NaN;return isNaN(t)?e:t};let zu;const Io=()=>zu||(zu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ot(e){if(_e(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],o=qe(i)?lb(i):Ot(i);if(o)for(const a in o)t[a]=o[a]}return t}else if(qe(e)||Be(e))return e}const ib=/;(?![^(]*\))/g,ob=/:([^]+)/,ab=/\/\*[^]*?\*\//g;function lb(e){const t={};return e.replace(ab,"").split(ib).forEach(n=>{if(n){const i=n.split(ob);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function me(e){let t="";if(qe(e))t=e;else if(_e(e))for(let n=0;n<e.length;n++){const i=me(e[n]);i&&(t+=i+" ")}else if(Be(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const cb="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ub=Tl(cb);function ff(e){return!!e||e===""}function db(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&i<e.length;i++)n=Dn(e[i],t[i]);return n}function Dn(e,t){if(e===t)return!0;let n=Fu(e),i=Fu(t);if(n||i)return n&&i?e.getTime()===t.getTime():!1;if(n=sn(e),i=sn(t),n||i)return e===t;if(n=_e(e),i=_e(t),n||i)return n&&i?db(e,t):!1;if(n=Be(e),i=Be(t),n||i){if(!n||!i)return!1;const o=Object.keys(e).length,a=Object.keys(t).length;if(o!==a)return!1;for(const c in e){const u=e.hasOwnProperty(c),f=t.hasOwnProperty(c);if(u&&!f||!u&&f||!Dn(e[c],t[c]))return!1}}return String(e)===String(t)}function Il(e,t){return e.findIndex(n=>Dn(n,t))}const gf=e=>!!(e&&e.__v_isRef===!0),A=e=>qe(e)?e:e==null?"":_e(e)||Be(e)&&(e.toString===cf||!Se(e.toString))?gf(e)?A(e.value):JSON.stringify(e,pf,2):String(e),pf=(e,t)=>gf(t)?pf(e,t.value):Ls(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,o],a)=>(n[Na(i,a)+" =>"]=o,n),{})}:Hs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Na(n))}:sn(t)?Na(t):Be(t)&&!_e(t)&&!uf(t)?String(t):t,Na=(e,t="")=>{var n;return sn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
-
* @vue/reactivity v3.5.34
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let nt;class fb{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&&nt&&(nt.active?(this.parent=nt,this.index=(nt.scopes||(nt.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=nt;try{return nt=this,t()}finally{nt=n}}}on(){++this._on===1&&(this.prevScope=nt,nt=this)}off(){if(this._on>0&&--this._on===0){if(nt===this)nt=this.prevScope;else{let t=nt;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,i;for(n=0,i=this.effects.length;n<i;n++)this.effects[n].stop();for(this.effects.length=0,n=0,i=this.cleanups.length;n<i;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,i=this.scopes.length;n<i;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 gb(){return nt}function pb(e,t=!1){nt&&nt.cleanups.push(e)}let We;const Oa=new WeakSet;class hf{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,nt&&(nt.active?nt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Oa.has(this)&&(Oa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||bf(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Hu(this),yf(this);const t=We,n=Ht;We=this,Ht=!0;try{return this.fn()}finally{kf(this),We=t,Ht=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Nl(t);this.deps=this.depsTail=void 0,Hu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Oa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){tl(this)&&this.run()}get dirty(){return tl(this)}}let mf=0,Cr,Ir;function bf(e,t=!1){if(e.flags|=8,t){e.next=Ir,Ir=e;return}e.next=Cr,Cr=e}function Ml(){mf++}function Rl(){if(--mf>0)return;if(Ir){let t=Ir;for(Ir=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Cr;){let t=Cr;for(Cr=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function yf(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function kf(e){let t,n=e.depsTail,i=n;for(;i;){const o=i.prevDep;i.version===-1?(i===n&&(n=o),Nl(i),hb(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=o}e.deps=t,e.depsTail=n}function tl(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(vf(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function vf(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Dr)||(e.globalVersion=Dr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!tl(e))))return;e.flags|=2;const t=e.dep,n=We,i=Ht;We=e,Ht=!0;try{yf(e);const o=e.fn(e._value);(t.version===0||tn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{We=n,Ht=i,kf(e),e.flags&=-3}}function Nl(e,t=!1){const{dep:n,prevSub:i,nextSub:o}=e;if(i&&(i.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)Nl(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function hb(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ht=!0;const _f=[];function bn(){_f.push(Ht),Ht=!1}function yn(){const e=_f.pop();Ht=e===void 0?!0:e}function Hu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=We;We=void 0;try{t()}finally{We=n}}}let Dr=0;class mb{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 Ol{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(!We||!Ht||We===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==We)n=this.activeLink=new mb(We,this),We.deps?(n.prevDep=We.depsTail,We.depsTail.nextDep=n,We.depsTail=n):We.deps=We.depsTail=n,wf(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=We.depsTail,n.nextDep=void 0,We.depsTail.nextDep=n,We.depsTail=n,We.deps===n&&(We.deps=i)}return n}trigger(t){this.version++,Dr++,this.notify(t)}notify(t){Ml();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Rl()}}}function wf(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)wf(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const nl=new WeakMap,ls=Symbol(""),sl=Symbol(""),Br=Symbol("");function ut(e,t,n){if(Ht&&We){let i=nl.get(e);i||nl.set(e,i=new Map);let o=i.get(n);o||(i.set(n,o=new Ol),o.map=i,o.key=n),o.track()}}function pn(e,t,n,i,o,a){const c=nl.get(e);if(!c){Dr++;return}const u=f=>{f&&f.trigger()};if(Ml(),t==="clear")c.forEach(u);else{const f=_e(e),m=f&&Cl(n);if(f&&n==="length"){const h=Number(i);c.forEach((y,v)=>{(v==="length"||v===Br||!sn(v)&&v>=h)&&u(y)})}else switch((n!==void 0||c.has(void 0))&&u(c.get(n)),m&&u(c.get(Br)),t){case"add":f?m&&u(c.get("length")):(u(c.get(ls)),Ls(e)&&u(c.get(sl)));break;case"delete":f||(u(c.get(ls)),Ls(e)&&u(c.get(sl)));break;case"set":Ls(e)&&u(c.get(ls));break}}Rl()}function Es(e){const t=Le(e);return t===e?t:(ut(t,"iterate",Br),Lt(e)?t:t.map(jt))}function Mo(e){return ut(e=Le(e),"iterate",Br),e}function Xt(e,t){return kn(e)?Bs(us(e)?jt(t):t):jt(t)}const bb={__proto__:null,[Symbol.iterator](){return La(this,Symbol.iterator,e=>Xt(this,e))},concat(...e){return Es(this).concat(...e.map(t=>_e(t)?Es(t):t))},entries(){return La(this,"entries",e=>(e[1]=Xt(this,e[1]),e))},every(e,t){return cn(this,"every",e,t,void 0,arguments)},filter(e,t){return cn(this,"filter",e,t,n=>n.map(i=>Xt(this,i)),arguments)},find(e,t){return cn(this,"find",e,t,n=>Xt(this,n),arguments)},findIndex(e,t){return cn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return cn(this,"findLast",e,t,n=>Xt(this,n),arguments)},findLastIndex(e,t){return cn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return cn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Pa(this,"includes",e)},indexOf(...e){return Pa(this,"indexOf",e)},join(e){return Es(this).join(e)},lastIndexOf(...e){return Pa(this,"lastIndexOf",e)},map(e,t){return cn(this,"map",e,t,void 0,arguments)},pop(){return pr(this,"pop")},push(...e){return pr(this,"push",e)},reduce(e,...t){return ju(this,"reduce",e,t)},reduceRight(e,...t){return ju(this,"reduceRight",e,t)},shift(){return pr(this,"shift")},some(e,t){return cn(this,"some",e,t,void 0,arguments)},splice(...e){return pr(this,"splice",e)},toReversed(){return Es(this).toReversed()},toSorted(e){return Es(this).toSorted(e)},toSpliced(...e){return Es(this).toSpliced(...e)},unshift(...e){return pr(this,"unshift",e)},values(){return La(this,"values",e=>Xt(this,e))}};function La(e,t,n){const i=Mo(e),o=i[t]();return i!==e&&!Lt(e)&&(o._next=o.next,o.next=()=>{const a=o._next();return a.done||(a.value=n(a.value)),a}),o}const yb=Array.prototype;function cn(e,t,n,i,o,a){const c=Mo(e),u=c!==e&&!Lt(e),f=c[t];if(f!==yb[t]){const y=f.apply(e,a);return u?jt(y):y}let m=n;c!==e&&(u?m=function(y,v){return n.call(this,Xt(e,y),v,e)}:n.length>2&&(m=function(y,v){return n.call(this,y,v,e)}));const h=f.call(c,m,i);return u&&o?o(h):h}function ju(e,t,n,i){const o=Mo(e),a=o!==e&&!Lt(e);let c=n,u=!1;o!==e&&(a?(u=i.length===0,c=function(m,h,y){return u&&(u=!1,m=Xt(e,m)),n.call(this,m,Xt(e,h),y,e)}):n.length>3&&(c=function(m,h,y){return n.call(this,m,h,y,e)}));const f=o[t](c,...i);return u?Xt(e,f):f}function Pa(e,t,n){const i=Le(e);ut(i,"iterate",Br);const o=i[t](...n);return(o===-1||o===!1)&&$l(n[0])?(n[0]=Le(n[0]),i[t](...n)):o}function pr(e,t,n=[]){bn(),Ml();const i=Le(e)[t].apply(e,n);return Rl(),yn(),i}const kb=Tl("__proto__,__v_isRef,__isVue"),xf=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(sn));function vb(e){sn(e)||(e=String(e));const t=Le(this);return ut(t,"has",e),t.hasOwnProperty(e)}class Sf{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return i===(o?a?Mb:Cf:a?Af:Tf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const c=_e(t);if(!o){let f;if(c&&(f=bb[n]))return f;if(n==="hasOwnProperty")return vb}const u=Reflect.get(t,n,gt(t)?t:i);if((sn(n)?xf.has(n):kb(n))||(o||ut(t,"get",n),a))return u;if(gt(u)){const f=c&&Cl(n)?u:u.value;return o&&Be(f)?il(f):f}return Be(u)?o?il(u):cs(u):u}}class Ef extends Sf{constructor(t=!1){super(!1,t)}set(t,n,i,o){let a=t[n];const c=_e(t)&&Cl(n);if(!this._isShallow){const m=kn(a);if(!Lt(i)&&!kn(i)&&(a=Le(a),i=Le(i)),!c&>(a)&&!gt(i))return m||(a.value=i),!0}const u=c?Number(n)<t.length:$e(t,n),f=Reflect.set(t,n,i,gt(t)?t:o);return t===Le(o)&&(u?tn(i,a)&&pn(t,"set",n,i):pn(t,"add",n,i)),f}deleteProperty(t,n){const i=$e(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&i&&pn(t,"delete",n,void 0),o}has(t,n){const i=Reflect.has(t,n);return(!sn(n)||!xf.has(n))&&ut(t,"has",n),i}ownKeys(t){return ut(t,"iterate",_e(t)?"length":ls),Reflect.ownKeys(t)}}class _b extends Sf{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const wb=new Ef,xb=new _b,Sb=new Ef(!0);const rl=e=>e,Fi=e=>Reflect.getPrototypeOf(e);function Eb(e,t,n){return function(...i){const o=this.__v_raw,a=Le(o),c=Ls(a),u=e==="entries"||e===Symbol.iterator&&c,f=e==="keys"&&c,m=o[e](...i),h=n?rl:t?Bs:jt;return!t&&ut(a,"iterate",f?sl:ls),st(Object.create(m),{next(){const{value:y,done:v}=m.next();return v?{value:y,done:v}:{value:u?[h(y[0]),h(y[1])]:h(y),done:v}}})}}function zi(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Tb(e,t){const n={get(o){const a=this.__v_raw,c=Le(a),u=Le(o);e||(tn(o,u)&&ut(c,"get",o),ut(c,"get",u));const{has:f}=Fi(c),m=t?rl:e?Bs:jt;if(f.call(c,o))return m(a.get(o));if(f.call(c,u))return m(a.get(u));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&ut(Le(o),"iterate",ls),o.size},has(o){const a=this.__v_raw,c=Le(a),u=Le(o);return e||(tn(o,u)&&ut(c,"has",o),ut(c,"has",u)),o===u?a.has(o):a.has(o)||a.has(u)},forEach(o,a){const c=this,u=c.__v_raw,f=Le(u),m=t?rl:e?Bs:jt;return!e&&ut(f,"iterate",ls),u.forEach((h,y)=>o.call(a,m(h),m(y),c))}};return st(n,e?{add:zi("add"),set:zi("set"),delete:zi("delete"),clear:zi("clear")}:{add(o){const a=Le(this),c=Fi(a),u=Le(o),f=!t&&!Lt(o)&&!kn(o)?u:o;return c.has.call(a,f)||tn(o,f)&&c.has.call(a,o)||tn(u,f)&&c.has.call(a,u)||(a.add(f),pn(a,"add",f,f)),this},set(o,a){!t&&!Lt(a)&&!kn(a)&&(a=Le(a));const c=Le(this),{has:u,get:f}=Fi(c);let m=u.call(c,o);m||(o=Le(o),m=u.call(c,o));const h=f.call(c,o);return c.set(o,a),m?tn(a,h)&&pn(c,"set",o,a):pn(c,"add",o,a),this},delete(o){const a=Le(this),{has:c,get:u}=Fi(a);let f=c.call(a,o);f||(o=Le(o),f=c.call(a,o)),u&&u.call(a,o);const m=a.delete(o);return f&&pn(a,"delete",o,void 0),m},clear(){const o=Le(this),a=o.size!==0,c=o.clear();return a&&pn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Eb(o,e,t)}),n}function Ll(e,t){const n=Tb(e,t);return(i,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?i:Reflect.get($e(n,o)&&o in i?n:i,o,a)}const Ab={get:Ll(!1,!1)},Cb={get:Ll(!1,!0)},Ib={get:Ll(!0,!1)};const Tf=new WeakMap,Af=new WeakMap,Cf=new WeakMap,Mb=new WeakMap;function Rb(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Nb(e){return e.__v_skip||!Object.isExtensible(e)?0:Rb(tb(e))}function cs(e){return kn(e)?e:Pl(e,!1,wb,Ab,Tf)}function Ob(e){return Pl(e,!1,Sb,Cb,Af)}function il(e){return Pl(e,!0,xb,Ib,Cf)}function Pl(e,t,n,i,o){if(!Be(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=Nb(e);if(a===0)return e;const c=o.get(e);if(c)return c;const u=new Proxy(e,a===2?i:n);return o.set(e,u),u}function us(e){return kn(e)?us(e.__v_raw):!!(e&&e.__v_isReactive)}function kn(e){return!!(e&&e.__v_isReadonly)}function Lt(e){return!!(e&&e.__v_isShallow)}function $l(e){return e?!!e.__v_raw:!1}function Le(e){const t=e&&e.__v_raw;return t?Le(t):e}function Lb(e){return!$e(e,"__v_skip")&&Object.isExtensible(e)&&df(e,"__v_skip",!0),e}const jt=e=>Be(e)?cs(e):e,Bs=e=>Be(e)?il(e):e;function gt(e){return e?e.__v_isRef===!0:!1}function Ae(e){return If(e,!1)}function Pb(e){return If(e,!0)}function If(e,t){return gt(e)?e:new $b(e,t)}class $b{constructor(t,n){this.dep=new Ol,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Le(t),this._value=n?t:jt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||Lt(t)||kn(t);t=i?t:Le(t),tn(t,n)&&(this._rawValue=t,this._value=i?t:jt(t),this.dep.trigger())}}function Wu(e){e.dep&&e.dep.trigger()}function Mr(e){return gt(e)?e.value:e}const Db={get:(e,t,n)=>t==="__v_raw"?e:Mr(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const o=e[t];return gt(o)&&!gt(n)?(o.value=n,!0):Reflect.set(e,t,n,i)}};function Mf(e){return us(e)?e:new Proxy(e,Db)}class Bb{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ol(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Dr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&We!==this)return bf(this,!0),!0}get value(){const t=this.dep.track();return vf(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ub(e,t,n=!1){let i,o;return Se(e)?i=e:(i=e.get,o=e.set),new Bb(i,o,n)}const Hi={},oo=new WeakMap;let ss;function Fb(e,t=!1,n=ss){if(n){let i=oo.get(n);i||oo.set(n,i=[]),i.push(e)}}function zb(e,t,n=Fe){const{immediate:i,deep:o,once:a,scheduler:c,augmentJob:u,call:f}=n,m=O=>o?O:Lt(O)||o===!1||o===0?hn(O,1):hn(O);let h,y,v,C,S=!1,N=!1;if(gt(e)?(y=()=>e.value,S=Lt(e)):us(e)?(y=()=>m(e),S=!0):_e(e)?(N=!0,S=e.some(O=>us(O)||Lt(O)),y=()=>e.map(O=>{if(gt(O))return O.value;if(us(O))return m(O);if(Se(O))return f?f(O,2):O()})):Se(e)?t?y=f?()=>f(e,2):e:y=()=>{if(v){bn();try{v()}finally{yn()}}const O=ss;ss=h;try{return f?f(e,3,[C]):e(C)}finally{ss=O}}:y=nn,t&&o){const O=y,H=o===!0?1/0:o;y=()=>hn(O(),H)}const I=gb(),L=()=>{h.stop(),I&&I.active&&Al(I.effects,h)};if(a&&t){const O=t;t=(...H)=>{O(...H),L()}}let l=N?new Array(e.length).fill(Hi):Hi;const M=O=>{if(!(!(h.flags&1)||!h.dirty&&!O))if(t){const H=h.run();if(o||S||(N?H.some((se,J)=>tn(se,l[J])):tn(H,l))){v&&v();const se=ss;ss=h;try{const J=[H,l===Hi?void 0:N&&l[0]===Hi?[]:l,C];l=H,f?f(t,3,J):t(...J)}finally{ss=se}}}else h.run()};return u&&u(M),h=new hf(y),h.scheduler=c?()=>c(M,!1):M,C=O=>Fb(O,!1,h),v=h.onStop=()=>{const O=oo.get(h);if(O){if(f)f(O,4);else for(const H of O)H();oo.delete(h)}},t?i?M(!0):l=h.run():c?c(M.bind(null,!0),!0):h.run(),L.pause=h.pause.bind(h),L.resume=h.resume.bind(h),L.stop=L,L}function hn(e,t=1/0,n){if(t<=0||!Be(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,gt(e))hn(e.value,t,n);else if(_e(e))for(let i=0;i<e.length;i++)hn(e[i],t,n);else if(Hs(e)||Ls(e))e.forEach(i=>{hn(i,t,n)});else if(uf(e)){for(const i in e)hn(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&hn(e[i],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.34
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function Gr(e,t,n,i){try{return i?e(...i):e()}catch(o){Ro(o,t,n)}}function Wt(e,t,n,i){if(Se(e)){const o=Gr(e,t,n,i);return o&&lf(o)&&o.catch(a=>{Ro(a,t,n)}),o}if(_e(e)){const o=[];for(let a=0;a<e.length;a++)o.push(Wt(e[a],t,n,i));return o}}function Ro(e,t,n,i=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||Fe;if(t){let u=t.parent;const f=t.proxy,m=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const h=u.ec;if(h){for(let y=0;y<h.length;y++)if(h[y](e,f,m)===!1)return}u=u.parent}if(a){bn(),Gr(a,null,10,[e,f,m]),yn();return}}Hb(e,n,o,i,c)}function Hb(e,t,n,i=!0,o=!1){if(o)throw e;console.error(e)}const vt=[];let Jt=-1;const Ps=[];let Pn=null,Is=0;const Rf=Promise.resolve();let ao=null;function ct(e){const t=ao||Rf;return e?t.then(this?e.bind(this):e):t}function jb(e){let t=Jt+1,n=vt.length;for(;t<n;){const i=t+n>>>1,o=vt[i],a=Ur(o);a<e||a===e&&o.flags&2?t=i+1:n=i}return t}function Dl(e){if(!(e.flags&1)){const t=Ur(e),n=vt[vt.length-1];!n||!(e.flags&2)&&t>=Ur(n)?vt.push(e):vt.splice(jb(t),0,e),e.flags|=1,Nf()}}function Nf(){ao||(ao=Rf.then(Lf))}function Wb(e){_e(e)?Ps.push(...e):Pn&&e.id===-1?Pn.splice(Is+1,0,e):e.flags&1||(Ps.push(e),e.flags|=1),Nf()}function Ku(e,t,n=Jt+1){for(;n<vt.length;n++){const i=vt[n];if(i&&i.flags&2){if(e&&i.id!==e.uid)continue;vt.splice(n,1),n--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function Of(e){if(Ps.length){const t=[...new Set(Ps)].sort((n,i)=>Ur(n)-Ur(i));if(Ps.length=0,Pn){Pn.push(...t);return}for(Pn=t,Is=0;Is<Pn.length;Is++){const n=Pn[Is];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Pn=null,Is=0}}const Ur=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Lf(e){try{for(Jt=0;Jt<vt.length;Jt++){const t=vt[Jt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Gr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Jt<vt.length;Jt++){const t=vt[Jt];t&&(t.flags&=-2)}Jt=-1,vt.length=0,Of(),ao=null,(vt.length||Ps.length)&&Lf()}}let At=null,Pf=null;function lo(e){const t=At;return At=e,Pf=e&&e.type.__scopeId||null,t}function $f(e,t=At,n){if(!t||e._n)return e;const i=(...o)=>{i._d&&id(-1);const a=lo(t);let c;try{c=e(...o)}finally{lo(a),i._d&&id(1)}return c};return i._n=!0,i._c=!0,i._d=!0,i}function ot(e,t){if(At===null)return e;const n=Po(At),i=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,u,f=Fe]=t[o];a&&(Se(a)&&(a={mounted:a,updated:a}),a.deep&&hn(c),i.push({dir:a,instance:n,value:c,oldValue:void 0,arg:u,modifiers:f}))}return e}function es(e,t,n,i){const o=e.dirs,a=t&&t.dirs;for(let c=0;c<o.length;c++){const u=o[c];a&&(u.oldValue=a[c].value);let f=u.dir[i];f&&(bn(),Wt(f,n,8,[e.el,u,e,t]),yn())}}function Kb(e,t){if(dt){let n=dt.provides;const i=dt.parent&&dt.parent.provides;i===n&&(n=dt.provides=Object.create(i)),n[e]=t}}function eo(e,t,n=!1){const i=dg();if(i||$s){let o=$s?$s._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Se(t)?t.call(i&&i.proxy):t}}const Gb=Symbol.for("v-scx"),Vb=()=>eo(Gb);function Je(e,t,n){return Df(e,t,n)}function Df(e,t,n=Fe){const{immediate:i,deep:o,flush:a,once:c}=n,u=st({},n),f=t&&i||!t&&a!=="post";let m;if(Hr){if(a==="sync"){const C=Vb();m=C.__watcherHandles||(C.__watcherHandles=[])}else if(!f){const C=()=>{};return C.stop=nn,C.resume=nn,C.pause=nn,C}}const h=dt;u.call=(C,S,N)=>Wt(C,h,S,N);let y=!1;a==="post"?u.scheduler=C=>{kt(C,h&&h.suspense)}:a!=="sync"&&(y=!0,u.scheduler=(C,S)=>{S?C():Dl(C)}),u.augmentJob=C=>{t&&(C.flags|=4),y&&(C.flags|=2,h&&(C.id=h.uid,C.i=h))};const v=zb(e,t,u);return Hr&&(m?m.push(v):f&&v()),v}function qb(e,t,n){const i=this.proxy,o=qe(e)?e.includes(".")?Bf(i,e):()=>i[e]:e.bind(i,i);let a;Se(t)?a=t:(a=t.handler,n=t);const c=qr(this),u=Df(o,a.bind(i),n);return c(),u}function Bf(e,t){const n=t.split(".");return()=>{let i=e;for(let o=0;o<n.length&&i;o++)i=i[n[o]];return i}}const Rn=new WeakMap,Uf=Symbol("_vte"),Zb=e=>e.__isTeleport,rs=e=>e&&(e.disabled||e.disabled===""),Qb=e=>e&&(e.defer||e.defer===""),Gu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Vu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ol=(e,t)=>{const n=e&&e.to;return qe(n)?t?t(n):null:n},Yb={name:"Teleport",__isTeleport:!0,process(e,t,n,i,o,a,c,u,f,m){const{mc:h,pc:y,pbc:v,o:{insert:C,querySelector:S,createText:N,createComment:I,parentNode:L}}=m,l=rs(t.props);let{dynamicChildren:M}=t;const O=(J,ie,Z)=>{J.shapeFlag&16&&h(J.children,ie,Z,o,a,c,u,f)},H=(J=t)=>{const ie=rs(J.props),Z=J.target=ol(J.props,S),ce=al(Z,J,N,C);Z&&(c!=="svg"&&Gu(Z)?c="svg":c!=="mathml"&&Vu(Z)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(Z),ie||(O(J,Z,ce),kr(J,!1)))},se=J=>{const ie=()=>{if(Rn.get(J)===ie){if(Rn.delete(J),rs(J.props)){const Z=L(J.el)||n;O(J,Z,J.anchor),kr(J,!0)}H(J)}};Rn.set(J,ie),kt(ie,a)};if(e==null){const J=t.el=N(""),ie=t.anchor=N("");if(C(J,n,i),C(ie,n,i),Qb(t.props)||a&&a.pendingBranch){se(t);return}l&&(O(t,n,ie),kr(t,!0)),H()}else{t.el=e.el;const J=t.anchor=e.anchor,ie=Rn.get(e);if(ie){ie.flags|=8,Rn.delete(e),se(t);return}t.targetStart=e.targetStart;const Z=t.target=e.target,ce=t.targetAnchor=e.targetAnchor,X=rs(e.props),U=X?n:Z,oe=X?J:ce;if(c==="svg"||Gu(Z)?c="svg":(c==="mathml"||Vu(Z))&&(c="mathml"),M?(v(e.dynamicChildren,M,U,o,a,c,u),Fl(e,t,!0)):f||y(e,t,U,oe,o,a,c,u,!1),l)X?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ji(t,n,J,m,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const fe=t.target=ol(t.props,S);fe&&ji(t,fe,null,m,0)}else X&&ji(t,Z,ce,m,1);kr(t,l)}},remove(e,t,n,{um:i,o:{remove:o}},a){const{shapeFlag:c,children:u,anchor:f,targetStart:m,targetAnchor:h,target:y,props:v}=e;let C=a||!rs(v);const S=Rn.get(e);if(S&&(S.flags|=8,Rn.delete(e),C=!1),y&&(o(m),o(h)),a&&o(f),c&16)for(let N=0;N<u.length;N++){const I=u[N];i(I,t,n,C,!!I.dynamicChildren)}},move:ji,hydrate:Jb};function ji(e,t,n,{o:{insert:i},m:o},a=2){a===0&&i(e.targetAnchor,t,n);const{el:c,anchor:u,shapeFlag:f,children:m,props:h}=e,y=a===2;if(y&&i(c,t,n),!Rn.has(e)&&(!y||rs(h))&&f&16)for(let v=0;v<m.length;v++)o(m[v],t,n,2);y&&i(u,t,n)}function Jb(e,t,n,i,o,a,{o:{nextSibling:c,parentNode:u,querySelector:f,insert:m,createText:h}},y){function v(I,L){let l=L;for(;l;){if(l&&l.nodeType===8){if(l.data==="teleport start anchor")t.targetStart=l;else if(l.data==="teleport anchor"){t.targetAnchor=l,I._lpa=t.targetAnchor&&c(t.targetAnchor);break}}l=c(l)}}function C(I,L){L.anchor=y(c(I),L,u(I),n,i,o,a)}const S=t.target=ol(t.props,f),N=rs(t.props);if(S){const I=S._lpa||S.firstChild;t.shapeFlag&16&&(N?(C(e,t),v(S,I),t.targetAnchor||al(S,t,h,m,u(e)===S?e:null)):(t.anchor=c(e),v(S,I),t.targetAnchor||al(S,t,h,m),y(I&&c(I),t,S,n,i,o,a))),kr(t,N)}else N&&t.shapeFlag&16&&(C(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Ut=Yb;function kr(e,t){const n=e.ctx;if(n&&n.ut){let i,o;for(t?(i=e.el,o=e.anchor):(i=e.targetStart,o=e.targetAnchor);i&&i!==o;)i.nodeType===1&&i.setAttribute("data-v-owner",n.uid),i=i.nextSibling;n.ut()}}function al(e,t,n,i,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[Uf]=c,e&&(i(a,e,o),i(c,e,o)),c}const Nn=Symbol("_leaveCb"),hr=Symbol("_enterCb");function Xb(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Vr(()=>{e.isMounted=!0}),vn(()=>{e.isUnmounting=!0}),e}const Nt=[Function,Array],ey={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Nt,onEnter:Nt,onAfterEnter:Nt,onEnterCancelled:Nt,onBeforeLeave:Nt,onLeave:Nt,onAfterLeave:Nt,onLeaveCancelled:Nt,onBeforeAppear:Nt,onAppear:Nt,onAfterAppear:Nt,onAppearCancelled:Nt};function ty(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function ll(e,t,n,i,o){const{appear:a,mode:c,persisted:u=!1,onBeforeEnter:f,onEnter:m,onAfterEnter:h,onEnterCancelled:y,onBeforeLeave:v,onLeave:C,onAfterLeave:S,onLeaveCancelled:N,onBeforeAppear:I,onAppear:L,onAfterAppear:l,onAppearCancelled:M}=t,O=String(e.key),H=ty(n,e),se=(Z,ce)=>{Z&&Wt(Z,i,9,ce)},J=(Z,ce)=>{const X=ce[1];se(Z,ce),_e(Z)?Z.every(U=>U.length<=1)&&X():Z.length<=1&&X()},ie={mode:c,persisted:u,beforeEnter(Z){let ce=f;if(!n.isMounted)if(a)ce=I||f;else return;Z[Nn]&&Z[Nn](!0);const X=H[O];X&&Ms(e,X)&&X.el[Nn]&&X.el[Nn](),se(ce,[Z])},enter(Z){if(H[O]===e)return;let ce=m,X=h,U=y;if(!n.isMounted)if(a)ce=L||m,X=l||h,U=M||y;else return;let oe=!1;Z[hr]=Ee=>{oe||(oe=!0,Ee?se(U,[Z]):se(X,[Z]),ie.delayedLeave&&ie.delayedLeave(),Z[hr]=void 0)};const fe=Z[hr].bind(null,!1);ce?J(ce,[Z,fe]):fe()},leave(Z,ce){const X=String(e.key);if(Z[hr]&&Z[hr](!0),n.isUnmounting)return ce();se(v,[Z]);let U=!1;Z[Nn]=fe=>{U||(U=!0,ce(),fe?se(N,[Z]):se(S,[Z]),Z[Nn]=void 0,H[X]===e&&delete H[X])};const oe=Z[Nn].bind(null,!1);H[X]=e,C?J(C,[Z,oe]):oe()},clone(Z){return ll(Z,t,n,i)}};return ie}function Fr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Fr(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 Ff(e,t=!1,n){let i=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const u=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===de?(c.patchFlag&128&&o++,i=i.concat(Ff(c.children,t,u))):(t||c.type!==_n)&&i.push(u!=null?fs(c,{key:u}):c)}if(o>1)for(let a=0;a<i.length;a++)i[a].patchFlag=-2;return i}function zf(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function qu(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const co=new WeakMap;function Rr(e,t,n,i,o=!1){if(_e(e)){e.forEach((N,I)=>Rr(N,t&&(_e(t)?t[I]:t),n,i,o));return}if(Nr(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Rr(e,t,n,i.component.subTree);return}const a=i.shapeFlag&4?Po(i.component):i.el,c=o?null:a,{i:u,r:f}=e,m=t&&t.r,h=u.refs===Fe?u.refs={}:u.refs,y=u.setupState,v=Le(y),C=y===Fe?af:N=>qu(h,N)?!1:$e(v,N),S=(N,I)=>!(I&&qu(h,I));if(m!=null&&m!==f){if(Zu(t),qe(m))h[m]=null,C(m)&&(y[m]=null);else if(gt(m)){const N=t;S(m,N.k)&&(m.value=null),N.k&&(h[N.k]=null)}}if(Se(f))Gr(f,u,12,[c,h]);else{const N=qe(f),I=gt(f);if(N||I){const L=()=>{if(e.f){const l=N?C(f)?y[f]:h[f]:S()||!e.k?f.value:h[e.k];if(o)_e(l)&&Al(l,a);else if(_e(l))l.includes(a)||l.push(a);else if(N)h[f]=[a],C(f)&&(y[f]=h[f]);else{const M=[a];S(f,e.k)&&(f.value=M),e.k&&(h[e.k]=M)}}else N?(h[f]=c,C(f)&&(y[f]=c)):I&&(S(f,e.k)&&(f.value=c),e.k&&(h[e.k]=c))};if(c){const l=()=>{L(),co.delete(e)};l.id=-1,co.set(e,l),kt(l,n)}else Zu(e),L()}}}function Zu(e){const t=co.get(e);t&&(t.flags|=8,co.delete(e))}Io().requestIdleCallback;Io().cancelIdleCallback;const Nr=e=>!!e.type.__asyncLoader,Hf=e=>e.type.__isKeepAlive;function ny(e,t){jf(e,"a",t)}function sy(e,t){jf(e,"da",t)}function jf(e,t,n=dt){const i=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(No(t,i,n),n){let o=n.parent;for(;o&&o.parent;)Hf(o.parent.vnode)&&ry(i,t,n,o),o=o.parent}}function ry(e,t,n,i){const o=No(t,e,i,!0);Kf(()=>{Al(i[t],o)},n)}function No(e,t,n=dt,i=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{bn();const u=qr(n),f=Wt(t,n,e,c);return u(),yn(),f});return i?o.unshift(a):o.push(a),a}}const wn=e=>(t,n=dt)=>{(!Hr||e==="sp")&&No(e,(...i)=>t(...i),n)},iy=wn("bm"),Vr=wn("m"),oy=wn("bu"),Wf=wn("u"),vn=wn("bum"),Kf=wn("um"),ay=wn("sp"),ly=wn("rtg"),cy=wn("rtc");function uy(e,t=dt){No("ec",e,t)}const dy="components";function fy(e,t){return py(dy,e,!0,t)||e}const gy=Symbol.for("v-ndc");function py(e,t,n=!0,i=!1){const o=At||dt;if(o){const a=o.type;{const u=Jy(a,!1);if(u&&(u===t||u===_t(t)||u===Ao(_t(t))))return a}const c=Qu(o[e]||a[e],t)||Qu(o.appContext[e],t);return!c&&i?a:c}}function Qu(e,t){return e&&(e[t]||e[_t(t)]||e[Ao(_t(t))])}function Ce(e,t,n,i){let o;const a=n,c=_e(e);if(c||qe(e)){const u=c&&us(e);let f=!1,m=!1;u&&(f=!Lt(e),m=kn(e),e=Mo(e)),o=new Array(e.length);for(let h=0,y=e.length;h<y;h++)o[h]=t(f?m?Bs(jt(e[h])):jt(e[h]):e[h],h,void 0,a)}else if(typeof e=="number"){o=new Array(e);for(let u=0;u<e;u++)o[u]=t(u+1,u,void 0,a)}else if(Be(e))if(e[Symbol.iterator])o=Array.from(e,(u,f)=>t(u,f,void 0,a));else{const u=Object.keys(e);o=new Array(u.length);for(let f=0,m=u.length;f<m;f++){const h=u[f];o[f]=t(e[h],h,f,a)}}else o=[];return o}const cl=e=>e?fg(e)?Po(e):cl(e.parent):null,Or=st(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=>cl(e.parent),$root:e=>cl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Vf(e),$forceUpdate:e=>e.f||(e.f=()=>{Dl(e.update)}),$nextTick:e=>e.n||(e.n=ct.bind(e.proxy)),$watch:e=>qb.bind(e)}),$a=(e,t)=>e!==Fe&&!e.__isScriptSetup&&$e(e,t),hy={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:o,props:a,accessCache:c,type:u,appContext:f}=e;if(t[0]!=="$"){const v=c[t];if(v!==void 0)switch(v){case 1:return i[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if($a(i,t))return c[t]=1,i[t];if(o!==Fe&&$e(o,t))return c[t]=2,o[t];if($e(a,t))return c[t]=3,a[t];if(n!==Fe&&$e(n,t))return c[t]=4,n[t];ul&&(c[t]=0)}}const m=Or[t];let h,y;if(m)return t==="$attrs"&&ut(e.attrs,"get",""),m(e);if((h=u.__cssModules)&&(h=h[t]))return h;if(n!==Fe&&$e(n,t))return c[t]=4,n[t];if(y=f.config.globalProperties,$e(y,t))return y[t]},set({_:e},t,n){const{data:i,setupState:o,ctx:a}=e;return $a(o,t)?(o[t]=n,!0):i!==Fe&&$e(i,t)?(i[t]=n,!0):$e(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:o,props:a,type:c}},u){let f;return!!(n[u]||e!==Fe&&u[0]!=="$"&&$e(e,u)||$a(t,u)||$e(a,u)||$e(i,u)||$e(Or,u)||$e(o.config.globalProperties,u)||(f=c.__cssModules)&&f[u])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:$e(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Yu(e){return _e(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ul=!0;function my(e){const t=Vf(e),n=e.proxy,i=e.ctx;ul=!1,t.beforeCreate&&Ju(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:u,provide:f,inject:m,created:h,beforeMount:y,mounted:v,beforeUpdate:C,updated:S,activated:N,deactivated:I,beforeDestroy:L,beforeUnmount:l,destroyed:M,unmounted:O,render:H,renderTracked:se,renderTriggered:J,errorCaptured:ie,serverPrefetch:Z,expose:ce,inheritAttrs:X,components:U,directives:oe,filters:fe}=t;if(m&&by(m,i,null),c)for(const ee in c){const Q=c[ee];Se(Q)&&(i[ee]=Q.bind(n))}if(o){const ee=o.call(n,n);Be(ee)&&(e.data=cs(ee))}if(ul=!0,a)for(const ee in a){const Q=a[ee],ye=Se(Q)?Q.bind(n,n):Se(Q.get)?Q.get.bind(n,n):nn,ve=!Se(Q)&&Se(Q.set)?Q.set.bind(n):nn,Me=pe({get:ye,set:ve});Object.defineProperty(i,ee,{enumerable:!0,configurable:!0,get:()=>Me.value,set:Oe=>Me.value=Oe})}if(u)for(const ee in u)Gf(u[ee],i,n,ee);if(f){const ee=Se(f)?f.call(n):f;Reflect.ownKeys(ee).forEach(Q=>{Kb(Q,ee[Q])})}h&&Ju(h,e,"c");function F(ee,Q){_e(Q)?Q.forEach(ye=>ee(ye.bind(n))):Q&&ee(Q.bind(n))}if(F(iy,y),F(Vr,v),F(oy,C),F(Wf,S),F(ny,N),F(sy,I),F(uy,ie),F(cy,se),F(ly,J),F(vn,l),F(Kf,O),F(ay,Z),_e(ce))if(ce.length){const ee=e.exposed||(e.exposed={});ce.forEach(Q=>{Object.defineProperty(ee,Q,{get:()=>n[Q],set:ye=>n[Q]=ye,enumerable:!0})})}else e.exposed||(e.exposed={});H&&e.render===nn&&(e.render=H),X!=null&&(e.inheritAttrs=X),U&&(e.components=U),oe&&(e.directives=oe),Z&&zf(e)}function by(e,t,n=nn){_e(e)&&(e=dl(e));for(const i in e){const o=e[i];let a;Be(o)?"default"in o?a=eo(o.from||i,o.default,!0):a=eo(o.from||i):a=eo(o),gt(a)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[i]=a}}function Ju(e,t,n){Wt(_e(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gf(e,t,n,i){let o=i.includes(".")?Bf(n,i):()=>n[i];if(qe(e)){const a=t[e];Se(a)&&Je(o,a)}else if(Se(e))Je(o,e.bind(n));else if(Be(e))if(_e(e))e.forEach(a=>Gf(a,t,n,i));else{const a=Se(e.handler)?e.handler.bind(n):t[e.handler];Se(a)&&Je(o,a,e)}}function Vf(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,u=a.get(t);let f;return u?f=u:!o.length&&!n&&!i?f=t:(f={},o.length&&o.forEach(m=>uo(f,m,c,!0)),uo(f,t,c)),Be(t)&&a.set(t,f),f}function uo(e,t,n,i=!1){const{mixins:o,extends:a}=t;a&&uo(e,a,n,!0),o&&o.forEach(c=>uo(e,c,n,!0));for(const c in t)if(!(i&&c==="expose")){const u=yy[c]||n&&n[c];e[c]=u?u(e[c],t[c]):t[c]}return e}const yy={data:Xu,props:ed,emits:ed,methods:vr,computed:vr,beforeCreate:yt,created:yt,beforeMount:yt,mounted:yt,beforeUpdate:yt,updated:yt,beforeDestroy:yt,beforeUnmount:yt,destroyed:yt,unmounted:yt,activated:yt,deactivated:yt,errorCaptured:yt,serverPrefetch:yt,components:vr,directives:vr,watch:vy,provide:Xu,inject:ky};function Xu(e,t){return t?e?function(){return st(Se(e)?e.call(this,this):e,Se(t)?t.call(this,this):t)}:t:e}function ky(e,t){return vr(dl(e),dl(t))}function dl(e){if(_e(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function yt(e,t){return e?[...new Set([].concat(e,t))]:t}function vr(e,t){return e?st(Object.create(null),e,t):t}function ed(e,t){return e?_e(e)&&_e(t)?[...new Set([...e,...t])]:st(Object.create(null),Yu(e),Yu(t??{})):t}function vy(e,t){if(!e)return t;if(!t)return e;const n=st(Object.create(null),e);for(const i in t)n[i]=yt(e[i],t[i]);return n}function qf(){return{app:null,config:{isNativeTag:af,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 _y=0;function wy(e,t){return function(i,o=null){Se(i)||(i=st({},i)),o!=null&&!Be(o)&&(o=null);const a=qf(),c=new WeakSet,u=[];let f=!1;const m=a.app={_uid:_y++,_component:i,_props:o,_container:null,_context:a,_instance:null,version:ek,get config(){return a.config},set config(h){},use(h,...y){return c.has(h)||(h&&Se(h.install)?(c.add(h),h.install(m,...y)):Se(h)&&(c.add(h),h(m,...y))),m},mixin(h){return a.mixins.includes(h)||a.mixins.push(h),m},component(h,y){return y?(a.components[h]=y,m):a.components[h]},directive(h,y){return y?(a.directives[h]=y,m):a.directives[h]},mount(h,y,v){if(!f){const C=m._ceVNode||at(i,o);return C.appContext=a,v===!0?v="svg":v===!1&&(v=void 0),e(C,h,v),f=!0,m._container=h,h.__vue_app__=m,Po(C.component)}},onUnmount(h){u.push(h)},unmount(){f&&(Wt(u,m._instance,16),e(null,m._container),delete m._container.__vue_app__)},provide(h,y){return a.provides[h]=y,m},runWithContext(h){const y=$s;$s=m;try{return h()}finally{$s=y}}};return m}}let $s=null;const xy=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${_t(t)}Modifiers`]||e[`${Un(t)}Modifiers`];function Sy(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Fe;let o=n;const a=t.startsWith("update:"),c=a&&xy(i,t.slice(7));c&&(c.trim&&(o=n.map(h=>qe(h)?h.trim():h)),c.number&&(o=n.map(Co)));let u,f=i[u=Ra(t)]||i[u=Ra(_t(t))];!f&&a&&(f=i[u=Ra(Un(t))]),f&&Wt(f,e,6,o);const m=i[u+"Once"];if(m){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,Wt(m,e,6,o)}}const Ey=new WeakMap;function Zf(e,t,n=!1){const i=n?Ey:t.emitsCache,o=i.get(e);if(o!==void 0)return o;const a=e.emits;let c={},u=!1;if(!Se(e)){const f=m=>{const h=Zf(m,t,!0);h&&(u=!0,st(c,h))};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!a&&!u?(Be(e)&&i.set(e,null),null):(_e(a)?a.forEach(f=>c[f]=null):st(c,a),Be(e)&&i.set(e,c),c)}function Oo(e,t){return!e||!So(t)?!1:(t=t.slice(2).replace(/Once$/,""),$e(e,t[0].toLowerCase()+t.slice(1))||$e(e,Un(t))||$e(e,t))}function td(e){const{type:t,vnode:n,proxy:i,withProxy:o,propsOptions:[a],slots:c,attrs:u,emit:f,render:m,renderCache:h,props:y,data:v,setupState:C,ctx:S,inheritAttrs:N}=e,I=lo(e);let L,l;try{if(n.shapeFlag&4){const O=o||i,H=O;L=en(m.call(H,O,h,y,C,v,S)),l=u}else{const O=t;L=en(O.length>1?O(y,{attrs:u,slots:c,emit:f}):O(y,null)),l=t.props?u:Ty(u)}}catch(O){Lr.length=0,Ro(O,e,1),L=at(_n)}let M=L;if(l&&N!==!1){const O=Object.keys(l),{shapeFlag:H}=M;O.length&&H&7&&(a&&O.some(Eo)&&(l=Ay(l,a)),M=fs(M,l,!1,!0))}return n.dirs&&(M=fs(M,null,!1,!0),M.dirs=M.dirs?M.dirs.concat(n.dirs):n.dirs),n.transition&&Fr(M,n.transition),L=M,lo(I),L}const Ty=e=>{let t;for(const n in e)(n==="class"||n==="style"||So(n))&&((t||(t={}))[n]=e[n]);return t},Ay=(e,t)=>{const n={};for(const i in e)(!Eo(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function Cy(e,t,n){const{props:i,children:o,component:a}=e,{props:c,children:u,patchFlag:f}=t,m=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&f>=0){if(f&1024)return!0;if(f&16)return i?nd(i,c,m):!!c;if(f&8){const h=t.dynamicProps;for(let y=0;y<h.length;y++){const v=h[y];if(Qf(c,i,v)&&!Oo(m,v))return!0}}}else return(o||u)&&(!u||!u.$stable)?!0:i===c?!1:i?c?nd(i,c,m):!0:!!c;return!1}function nd(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let o=0;o<i.length;o++){const a=i[o];if(Qf(t,e,a)&&!Oo(n,a))return!0}return!1}function Qf(e,t,n){const i=e[n],o=t[n];return n==="style"&&Be(i)&&Be(o)?!Dn(i,o):i!==o}function Iy({vnode:e,parent:t,suspense:n},i){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=i,e=o),o===e)(e=t.vnode).el=i,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=i)}const Yf={},Jf=()=>Object.create(Yf),Xf=e=>Object.getPrototypeOf(e)===Yf;function My(e,t,n,i=!1){const o={},a=Jf();e.propsDefaults=Object.create(null),eg(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=i?o:Ob(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function Ry(e,t,n,i){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,u=Le(o),[f]=e.propsOptions;let m=!1;if((i||c>0)&&!(c&16)){if(c&8){const h=e.vnode.dynamicProps;for(let y=0;y<h.length;y++){let v=h[y];if(Oo(e.emitsOptions,v))continue;const C=t[v];if(f)if($e(a,v))C!==a[v]&&(a[v]=C,m=!0);else{const S=_t(v);o[S]=fl(f,u,S,C,e,!1)}else C!==a[v]&&(a[v]=C,m=!0)}}}else{eg(e,t,o,a)&&(m=!0);let h;for(const y in u)(!t||!$e(t,y)&&((h=Un(y))===y||!$e(t,h)))&&(f?n&&(n[y]!==void 0||n[h]!==void 0)&&(o[y]=fl(f,u,y,void 0,e,!0)):delete o[y]);if(a!==u)for(const y in a)(!t||!$e(t,y))&&(delete a[y],m=!0)}m&&pn(e.attrs,"set","")}function eg(e,t,n,i){const[o,a]=e.propsOptions;let c=!1,u;if(t)for(let f in t){if(Ar(f))continue;const m=t[f];let h;o&&$e(o,h=_t(f))?!a||!a.includes(h)?n[h]=m:(u||(u={}))[h]=m:Oo(e.emitsOptions,f)||(!(f in i)||m!==i[f])&&(i[f]=m,c=!0)}if(a){const f=Le(n),m=u||Fe;for(let h=0;h<a.length;h++){const y=a[h];n[y]=fl(o,f,y,m[y],e,!$e(m,y))}}return c}function fl(e,t,n,i,o,a){const c=e[n];if(c!=null){const u=$e(c,"default");if(u&&i===void 0){const f=c.default;if(c.type!==Function&&!c.skipFactory&&Se(f)){const{propsDefaults:m}=o;if(n in m)i=m[n];else{const h=qr(o);i=m[n]=f.call(null,t),h()}}else i=f;o.ce&&o.ce._setProp(n,i)}c[0]&&(a&&!u?i=!1:c[1]&&(i===""||i===Un(n))&&(i=!0))}return i}const Ny=new WeakMap;function tg(e,t,n=!1){const i=n?Ny:t.propsCache,o=i.get(e);if(o)return o;const a=e.props,c={},u=[];let f=!1;if(!Se(e)){const h=y=>{f=!0;const[v,C]=tg(y,t,!0);st(c,v),C&&u.push(...C)};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!a&&!f)return Be(e)&&i.set(e,Os),Os;if(_e(a))for(let h=0;h<a.length;h++){const y=_t(a[h]);sd(y)&&(c[y]=Fe)}else if(a)for(const h in a){const y=_t(h);if(sd(y)){const v=a[h],C=c[y]=_e(v)||Se(v)?{type:v}:st({},v),S=C.type;let N=!1,I=!0;if(_e(S))for(let L=0;L<S.length;++L){const l=S[L],M=Se(l)&&l.name;if(M==="Boolean"){N=!0;break}else M==="String"&&(I=!1)}else N=Se(S)&&S.name==="Boolean";C[0]=N,C[1]=I,(N||$e(C,"default"))&&u.push(y)}}const m=[c,u];return Be(e)&&i.set(e,m),m}function sd(e){return e[0]!=="$"&&!Ar(e)}const Bl=e=>e==="_"||e==="_ctx"||e==="$stable",Ul=e=>_e(e)?e.map(en):[en(e)],Oy=(e,t,n)=>{if(t._n)return t;const i=$f((...o)=>Ul(t(...o)),n);return i._c=!1,i},ng=(e,t,n)=>{const i=e._ctx;for(const o in e){if(Bl(o))continue;const a=e[o];if(Se(a))t[o]=Oy(o,a,i);else if(a!=null){const c=Ul(a);t[o]=()=>c}}},sg=(e,t)=>{const n=Ul(t);e.slots.default=()=>n},rg=(e,t,n)=>{for(const i in t)(n||!Bl(i))&&(e[i]=t[i])},Ly=(e,t,n)=>{const i=e.slots=Jf();if(e.vnode.shapeFlag&32){const o=t._;o?(rg(i,t,n),n&&df(i,"_",o,!0)):ng(t,i)}else t&&sg(e,t)},Py=(e,t,n)=>{const{vnode:i,slots:o}=e;let a=!0,c=Fe;if(i.shapeFlag&32){const u=t._;u?n&&u===1?a=!1:rg(o,t,n):(a=!t.$stable,ng(t,o)),c=t}else t&&(sg(e,t),c={default:1});if(a)for(const u in o)!Bl(u)&&c[u]==null&&delete o[u]},kt=Fy;function $y(e){return Dy(e)}function Dy(e,t){const n=Io();n.__VUE__=!0;const{insert:i,remove:o,patchProp:a,createElement:c,createText:u,createComment:f,setText:m,setElementText:h,parentNode:y,nextSibling:v,setScopeId:C=nn,insertStaticContent:S}=e,N=(w,T,D,j=null,W=null,G=null,B=void 0,ne=null,V=!!T.dynamicChildren)=>{if(w===T)return;w&&!Ms(w,T)&&(j=Kt(w),Oe(w,W,G,!0),w=null),T.patchFlag===-2&&(V=!1,T.dynamicChildren=null);const{type:$,ref:he,shapeFlag:re}=T;switch($){case Lo:I(w,T,D,j);break;case _n:L(w,T,D,j);break;case to:w==null&&l(T,D,j,B);break;case de:U(w,T,D,j,W,G,B,ne,V);break;default:re&1?H(w,T,D,j,W,G,B,ne,V):re&6?oe(w,T,D,j,W,G,B,ne,V):(re&64||re&128)&&$.process(w,T,D,j,W,G,B,ne,V,wt)}he!=null&&W?Rr(he,w&&w.ref,G,T||w,!T):he==null&&w&&w.ref!=null&&Rr(w.ref,null,G,w,!0)},I=(w,T,D,j)=>{if(w==null)i(T.el=u(T.children),D,j);else{const W=T.el=w.el;T.children!==w.children&&m(W,T.children)}},L=(w,T,D,j)=>{w==null?i(T.el=f(T.children||""),D,j):T.el=w.el},l=(w,T,D,j)=>{[w.el,w.anchor]=S(w.children,T,D,j,w.el,w.anchor)},M=({el:w,anchor:T},D,j)=>{let W;for(;w&&w!==T;)W=v(w),i(w,D,j),w=W;i(T,D,j)},O=({el:w,anchor:T})=>{let D;for(;w&&w!==T;)D=v(w),o(w),w=D;o(T)},H=(w,T,D,j,W,G,B,ne,V)=>{if(T.type==="svg"?B="svg":T.type==="math"&&(B="mathml"),w==null)se(T,D,j,W,G,B,ne,V);else{const $=w.el&&w.el._isVueCE?w.el:null;try{$&&$._beginPatch(),Z(w,T,W,G,B,ne,V)}finally{$&&$._endPatch()}}},se=(w,T,D,j,W,G,B,ne)=>{let V,$;const{props:he,shapeFlag:re,transition:ge,dirs:be}=w;if(V=w.el=c(w.type,G,he&&he.is,he),re&8?h(V,w.children):re&16&&ie(w.children,V,null,j,W,Da(w,G),B,ne),be&&es(w,null,j,"created"),J(V,w,w.scopeId,B,j),he){for(const Y in he)Y!=="value"&&!Ar(Y)&&a(V,Y,null,he[Y],G,j);"value"in he&&a(V,"value",null,he.value,G),($=he.onVnodeBeforeMount)&&qt($,j,w)}be&&es(w,null,j,"beforeMount");const z=By(W,ge);z&&ge.beforeEnter(V),i(V,T,D),(($=he&&he.onVnodeMounted)||z||be)&&kt(()=>{try{$&&qt($,j,w),z&&ge.enter(V),be&&es(w,null,j,"mounted")}finally{}},W)},J=(w,T,D,j,W)=>{if(D&&C(w,D),j)for(let G=0;G<j.length;G++)C(w,j[G]);if(W){let G=W.subTree;if(T===G||ag(G.type)&&(G.ssContent===T||G.ssFallback===T)){const B=W.vnode;J(w,B,B.scopeId,B.slotScopeIds,W.parent)}}},ie=(w,T,D,j,W,G,B,ne,V=0)=>{for(let $=V;$<w.length;$++){const he=w[$]=ne?gn(w[$]):en(w[$]);N(null,he,T,D,j,W,G,B,ne)}},Z=(w,T,D,j,W,G,B)=>{const ne=T.el=w.el;let{patchFlag:V,dynamicChildren:$,dirs:he}=T;V|=w.patchFlag&16;const re=w.props||Fe,ge=T.props||Fe;let be;if(D&&ts(D,!1),(be=ge.onVnodeBeforeUpdate)&&qt(be,D,T,w),he&&es(T,w,D,"beforeUpdate"),D&&ts(D,!0),(re.innerHTML&&ge.innerHTML==null||re.textContent&&ge.textContent==null)&&h(ne,""),$?ce(w.dynamicChildren,$,ne,D,j,Da(T,W),G):B||Q(w,T,ne,null,D,j,Da(T,W),G,!1),V>0){if(V&16)X(ne,re,ge,D,W);else if(V&2&&re.class!==ge.class&&a(ne,"class",null,ge.class,W),V&4&&a(ne,"style",re.style,ge.style,W),V&8){const z=T.dynamicProps;for(let Y=0;Y<z.length;Y++){const le=z[Y],ke=re[le],Ie=ge[le];(Ie!==ke||le==="value")&&a(ne,le,ke,Ie,W,D)}}V&1&&w.children!==T.children&&h(ne,T.children)}else!B&&$==null&&X(ne,re,ge,D,W);((be=ge.onVnodeUpdated)||he)&&kt(()=>{be&&qt(be,D,T,w),he&&es(T,w,D,"updated")},j)},ce=(w,T,D,j,W,G,B)=>{for(let ne=0;ne<T.length;ne++){const V=w[ne],$=T[ne],he=V.el&&(V.type===de||!Ms(V,$)||V.shapeFlag&198)?y(V.el):D;N(V,$,he,null,j,W,G,B,!0)}},X=(w,T,D,j,W)=>{if(T!==D){if(T!==Fe)for(const G in T)!Ar(G)&&!(G in D)&&a(w,G,T[G],null,W,j);for(const G in D){if(Ar(G))continue;const B=D[G],ne=T[G];B!==ne&&G!=="value"&&a(w,G,ne,B,W,j)}"value"in D&&a(w,"value",T.value,D.value,W)}},U=(w,T,D,j,W,G,B,ne,V)=>{const $=T.el=w?w.el:u(""),he=T.anchor=w?w.anchor:u("");let{patchFlag:re,dynamicChildren:ge,slotScopeIds:be}=T;be&&(ne=ne?ne.concat(be):be),w==null?(i($,D,j),i(he,D,j),ie(T.children||[],D,he,W,G,B,ne,V)):re>0&&re&64&&ge&&w.dynamicChildren&&w.dynamicChildren.length===ge.length?(ce(w.dynamicChildren,ge,D,W,G,B,ne),(T.key!=null||W&&T===W.subTree)&&Fl(w,T,!0)):Q(w,T,D,he,W,G,B,ne,V)},oe=(w,T,D,j,W,G,B,ne,V)=>{T.slotScopeIds=ne,w==null?T.shapeFlag&512?W.ctx.activate(T,D,j,B,V):fe(T,D,j,W,G,B,V):Ee(w,T,V)},fe=(w,T,D,j,W,G,B)=>{const ne=w.component=Vy(w,j,W);if(Hf(w)&&(ne.ctx.renderer=wt),qy(ne,!1,B),ne.asyncDep){if(W&&W.registerDep(ne,F,B),!w.el){const V=ne.subTree=at(_n);L(null,V,T,D),w.placeholder=V.el}}else F(ne,w,T,D,W,G,B)},Ee=(w,T,D)=>{const j=T.component=w.component;if(Cy(w,T,D))if(j.asyncDep&&!j.asyncResolved){ee(j,T,D);return}else j.next=T,j.update();else T.el=w.el,j.vnode=T},F=(w,T,D,j,W,G,B)=>{const ne=()=>{if(w.isMounted){let{next:re,bu:ge,u:be,parent:z,vnode:Y}=w;{const pt=ig(w);if(pt){re&&(re.el=Y.el,ee(w,re,B)),pt.asyncDep.then(()=>{kt(()=>{w.isUnmounted||$()},W)});return}}let le=re,ke;ts(w,!1),re?(re.el=Y.el,ee(w,re,B)):re=Y,ge&&Xi(ge),(ke=re.props&&re.props.onVnodeBeforeUpdate)&&qt(ke,z,re,Y),ts(w,!0);const Ie=td(w),Ze=w.subTree;w.subTree=Ie,N(Ze,Ie,y(Ze.el),Kt(Ze),w,W,G),re.el=Ie.el,le===null&&Iy(w,Ie.el),be&&kt(be,W),(ke=re.props&&re.props.onVnodeUpdated)&&kt(()=>qt(ke,z,re,Y),W)}else{let re;const{el:ge,props:be}=T,{bm:z,m:Y,parent:le,root:ke,type:Ie}=w,Ze=Nr(T);ts(w,!1),z&&Xi(z),!Ze&&(re=be&&be.onVnodeBeforeMount)&&qt(re,le,T),ts(w,!0);{ke.ce&&ke.ce._hasShadowRoot()&&ke.ce._injectChildStyle(Ie,w.parent?w.parent.type:void 0);const pt=w.subTree=td(w);N(null,pt,D,j,w,W,G),T.el=pt.el}if(Y&&kt(Y,W),!Ze&&(re=be&&be.onVnodeMounted)){const pt=T;kt(()=>qt(re,le,pt),W)}(T.shapeFlag&256||le&&Nr(le.vnode)&&le.vnode.shapeFlag&256)&&w.a&&kt(w.a,W),w.isMounted=!0,T=D=j=null}};w.scope.on();const V=w.effect=new hf(ne);w.scope.off();const $=w.update=V.run.bind(V),he=w.job=V.runIfDirty.bind(V);he.i=w,he.id=w.uid,V.scheduler=()=>Dl(he),ts(w,!0),$()},ee=(w,T,D)=>{T.component=w;const j=w.vnode.props;w.vnode=T,w.next=null,Ry(w,T.props,j,D),Py(w,T.children,D),bn(),Ku(w),yn()},Q=(w,T,D,j,W,G,B,ne,V=!1)=>{const $=w&&w.children,he=w?w.shapeFlag:0,re=T.children,{patchFlag:ge,shapeFlag:be}=T;if(ge>0){if(ge&128){ve($,re,D,j,W,G,B,ne,V);return}else if(ge&256){ye($,re,D,j,W,G,B,ne,V);return}}be&8?(he&16&&ze($,W,G),re!==$&&h(D,re)):he&16?be&16?ve($,re,D,j,W,G,B,ne,V):ze($,W,G,!0):(he&8&&h(D,""),be&16&&ie(re,D,j,W,G,B,ne,V))},ye=(w,T,D,j,W,G,B,ne,V)=>{w=w||Os,T=T||Os;const $=w.length,he=T.length,re=Math.min($,he);let ge;for(ge=0;ge<re;ge++){const be=T[ge]=V?gn(T[ge]):en(T[ge]);N(w[ge],be,D,null,W,G,B,ne,V)}$>he?ze(w,W,G,!0,!1,re):ie(T,D,j,W,G,B,ne,V,re)},ve=(w,T,D,j,W,G,B,ne,V)=>{let $=0;const he=T.length;let re=w.length-1,ge=he-1;for(;$<=re&&$<=ge;){const be=w[$],z=T[$]=V?gn(T[$]):en(T[$]);if(Ms(be,z))N(be,z,D,null,W,G,B,ne,V);else break;$++}for(;$<=re&&$<=ge;){const be=w[re],z=T[ge]=V?gn(T[ge]):en(T[ge]);if(Ms(be,z))N(be,z,D,null,W,G,B,ne,V);else break;re--,ge--}if($>re){if($<=ge){const be=ge+1,z=be<he?T[be].el:j;for(;$<=ge;)N(null,T[$]=V?gn(T[$]):en(T[$]),D,z,W,G,B,ne,V),$++}}else if($>ge)for(;$<=re;)Oe(w[$],W,G,!0),$++;else{const be=$,z=$,Y=new Map;for($=z;$<=ge;$++){const lt=T[$]=V?gn(T[$]):en(T[$]);lt.key!=null&&Y.set(lt.key,$)}let le,ke=0;const Ie=ge-z+1;let Ze=!1,pt=0;const on=new Array(Ie);for($=0;$<Ie;$++)on[$]=0;for($=be;$<=re;$++){const lt=w[$];if(ke>=Ie){Oe(lt,W,G,!0);continue}let St;if(lt.key!=null)St=Y.get(lt.key);else for(le=z;le<=ge;le++)if(on[le-z]===0&&Ms(lt,T[le])){St=le;break}St===void 0?Oe(lt,W,G,!0):(on[St-z]=$+1,St>=pt?pt=St:Ze=!0,N(lt,T[St],D,null,W,G,B,ne,V),ke++)}const Qr=Ze?Uy(on):Os;for(le=Qr.length-1,$=Ie-1;$>=0;$--){const lt=z+$,St=T[lt],xn=T[lt+1],Fn=lt+1<he?xn.el||og(xn):j;on[$]===0?N(null,St,D,Fn,W,G,B,ne,V):Ze&&(le<0||$!==Qr[le]?Me(St,D,Fn,2):le--)}}},Me=(w,T,D,j,W=null)=>{const{el:G,type:B,transition:ne,children:V,shapeFlag:$}=w;if($&6){Me(w.component.subTree,T,D,j);return}if($&128){w.suspense.move(T,D,j);return}if($&64){B.move(w,T,D,wt);return}if(B===de){i(G,T,D);for(let re=0;re<V.length;re++)Me(V[re],T,D,j);i(w.anchor,T,D);return}if(B===to){M(w,T,D);return}if(j!==2&&$&1&&ne)if(j===0)ne.beforeEnter(G),i(G,T,D),kt(()=>ne.enter(G),W);else{const{leave:re,delayLeave:ge,afterLeave:be}=ne,z=()=>{w.ctx.isUnmounted?o(G):i(G,T,D)},Y=()=>{G._isLeaving&&G[Nn](!0),re(G,()=>{z(),be&&be()})};ge?ge(G,z,Y):Y()}else i(G,T,D)},Oe=(w,T,D,j=!1,W=!1)=>{const{type:G,props:B,ref:ne,children:V,dynamicChildren:$,shapeFlag:he,patchFlag:re,dirs:ge,cacheIndex:be,memo:z}=w;if(re===-2&&(W=!1),ne!=null&&(bn(),Rr(ne,null,D,w,!0),yn()),be!=null&&(T.renderCache[be]=void 0),he&256){T.ctx.deactivate(w);return}const Y=he&1&&ge,le=!Nr(w);let ke;if(le&&(ke=B&&B.onVnodeBeforeUnmount)&&qt(ke,T,w),he&6)et(w.component,D,j);else{if(he&128){w.suspense.unmount(D,j);return}Y&&es(w,null,T,"beforeUnmount"),he&64?w.type.remove(w,T,D,wt,j):$&&!$.hasOnce&&(G!==de||re>0&&re&64)?ze($,T,D,!1,!0):(G===de&&re&384||!W&&he&16)&&ze(V,T,D),j&&Xe(w)}const Ie=z!=null&&be==null;(le&&(ke=B&&B.onVnodeUnmounted)||Y||Ie)&&kt(()=>{ke&&qt(ke,T,w),Y&&es(w,null,T,"unmounted"),Ie&&(w.el=null)},D)},Xe=w=>{const{type:T,el:D,anchor:j,transition:W}=w;if(T===de){Ye(D,j);return}if(T===to){O(w);return}const G=()=>{o(D),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(w.shapeFlag&1&&W&&!W.persisted){const{leave:B,delayLeave:ne}=W,V=()=>B(D,G);ne?ne(w.el,G,V):V()}else G()},Ye=(w,T)=>{let D;for(;w!==T;)D=v(w),o(w),w=D;o(T)},et=(w,T,D)=>{const{bum:j,scope:W,job:G,subTree:B,um:ne,m:V,a:$}=w;rd(V),rd($),j&&Xi(j),W.stop(),G&&(G.flags|=8,Oe(B,w,T,D)),ne&&kt(ne,T),kt(()=>{w.isUnmounted=!0},T)},ze=(w,T,D,j=!1,W=!1,G=0)=>{for(let B=G;B<w.length;B++)Oe(w[B],T,D,j,W)},Kt=w=>{if(w.shapeFlag&6)return Kt(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const T=v(w.anchor||w.el),D=T&&T[Uf];return D?v(D):T};let It=!1;const tt=(w,T,D)=>{let j;w==null?T._vnode&&(Oe(T._vnode,null,null,!0),j=T._vnode.component):N(T._vnode||null,w,T,null,null,null,D),T._vnode=w,It||(It=!0,Ku(j),Of(),It=!1)},wt={p:N,um:Oe,m:Me,r:Xe,mt:fe,mc:ie,pc:Q,pbc:ce,n:Kt,o:e};return{render:tt,hydrate:void 0,createApp:wy(tt)}}function Da({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 ts({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function By(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Fl(e,t,n=!1){const i=e.children,o=t.children;if(_e(i)&&_e(o))for(let a=0;a<i.length;a++){const c=i[a];let u=o[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=o[a]=gn(o[a]),u.el=c.el),!n&&u.patchFlag!==-2&&Fl(c,u)),u.type===Lo&&(u.patchFlag===-1&&(u=o[a]=gn(u)),u.el=c.el),u.type===_n&&!u.el&&(u.el=c.el)}}function Uy(e){const t=e.slice(),n=[0];let i,o,a,c,u;const f=e.length;for(i=0;i<f;i++){const m=e[i];if(m!==0){if(o=n[n.length-1],e[o]<m){t[i]=o,n.push(i);continue}for(a=0,c=n.length-1;a<c;)u=a+c>>1,e[n[u]]<m?a=u+1:c=u;m<e[n[a]]&&(a>0&&(t[i]=n[a-1]),n[a]=i)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function ig(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ig(t)}function rd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function og(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?og(t.subTree):null}const ag=e=>e.__isSuspense;function Fy(e,t){t&&t.pendingBranch?_e(e)?t.effects.push(...e):t.effects.push(e):Wb(e)}const de=Symbol.for("v-fgt"),Lo=Symbol.for("v-txt"),_n=Symbol.for("v-cmt"),to=Symbol.for("v-stc"),Lr=[];let Ct=null;function k(e=!1){Lr.push(Ct=e?null:[])}function zy(){Lr.pop(),Ct=Lr[Lr.length-1]||null}let zr=1;function id(e,t=!1){zr+=e,e<0&&Ct&&t&&(Ct.hasOnce=!0)}function lg(e){return e.dynamicChildren=zr>0?Ct||Os:null,zy(),zr>0&&Ct&&Ct.push(e),e}function _(e,t,n,i,o,a){return lg(d(e,t,n,i,o,a,!0))}function rt(e,t,n,i,o){return lg(at(e,t,n,i,o,!0))}function cg(e){return e?e.__v_isVNode===!0:!1}function Ms(e,t){return e.type===t.type&&e.key===t.key}const ug=({key:e})=>e??null,no=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?qe(e)||gt(e)||Se(e)?{i:At,r:e,k:t,f:!!n}:e:null);function d(e,t=null,n=null,i=0,o=null,a=e===de?0:1,c=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ug(t),ref:t&&no(t),scopeId:Pf,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:a,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:At};return u?(zl(f,n),a&128&&e.normalize(f)):n&&(f.shapeFlag|=qe(n)?8:16),zr>0&&!c&&Ct&&(f.patchFlag>0||a&6)&&f.patchFlag!==32&&Ct.push(f),f}const at=Hy;function Hy(e,t=null,n=null,i=0,o=null,a=!1){if((!e||e===gy)&&(e=_n),cg(e)){const u=fs(e,t,!0);return n&&zl(u,n),zr>0&&!a&&Ct&&(u.shapeFlag&6?Ct[Ct.indexOf(e)]=u:Ct.push(u)),u.patchFlag=-2,u}if(Xy(e)&&(e=e.__vccOpts),t){t=jy(t);let{class:u,style:f}=t;u&&!qe(u)&&(t.class=me(u)),Be(f)&&($l(f)&&!_e(f)&&(f=st({},f)),t.style=Ot(f))}const c=qe(e)?1:ag(e)?128:Zb(e)?64:Be(e)?4:Se(e)?2:0;return d(e,t,n,i,o,c,a,!0)}function jy(e){return e?$l(e)||Xf(e)?st({},e):e:null}function fs(e,t,n=!1,i=!1){const{props:o,ref:a,patchFlag:c,children:u,transition:f}=e,m=t?Wy(o||{},t):o,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:m,key:m&&ug(m),ref:t&&t.ref?n&&a?_e(a)?a.concat(no(t)):[a,no(t)]:no(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==de?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fs(e.ssContent),ssFallback:e.ssFallback&&fs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return f&&i&&Fr(h,f.clone(h)),h}function Ns(e=" ",t=0){return at(Lo,null,e,t)}function od(e,t){const n=at(to,null,e);return n.staticCount=t,n}function K(e="",t=!1){return t?(k(),rt(_n,null,e)):at(_n,null,e)}function en(e){return e==null||typeof e=="boolean"?at(_n):_e(e)?at(de,null,e.slice()):cg(e)?gn(e):at(Lo,null,String(e))}function gn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fs(e)}function zl(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(_e(t))n=16;else if(typeof t=="object")if(i&65){const o=t.default;o&&(o._c&&(o._d=!1),zl(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Xf(t)?t._ctx=At:o===3&&At&&(At.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Se(t)?(t={default:t,_ctx:At},n=32):(t=String(t),i&64?(n=16,t=[Ns(t)]):n=8);e.children=t,e.shapeFlag|=n}function Wy(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const o in i)if(o==="class")t.class!==i.class&&(t.class=me([t.class,i.class]));else if(o==="style")t.style=Ot([t.style,i.style]);else if(So(o)){const a=t[o],c=i[o];c&&a!==c&&!(_e(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!Eo(o)&&(t[o]=c)}else o!==""&&(t[o]=i[o])}return t}function qt(e,t,n,i=null){Wt(e,t,7,[n,i])}const Ky=qf();let Gy=0;function Vy(e,t,n){const i=e.type,o=(t?t.appContext:e.appContext)||Ky,a={uid:Gy++,vnode:e,type:i,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fb(!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:tg(i,o),emitsOptions:Zf(i,o),emit:null,emitted:null,propsDefaults:Fe,inheritAttrs:i.inheritAttrs,ctx:Fe,data:Fe,props:Fe,attrs:Fe,slots:Fe,refs:Fe,setupState:Fe,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=Sy.bind(null,a),e.ce&&e.ce(a),a}let dt=null;const dg=()=>dt||At;let fo,gl;{const e=Io(),t=(n,i)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(i),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};fo=t("__VUE_INSTANCE_SETTERS__",n=>dt=n),gl=t("__VUE_SSR_SETTERS__",n=>Hr=n)}const qr=e=>{const t=dt;return fo(e),e.scope.on(),()=>{e.scope.off(),fo(t)}},ad=()=>{dt&&dt.scope.off(),fo(null)};function fg(e){return e.vnode.shapeFlag&4}let Hr=!1;function qy(e,t=!1,n=!1){t&&gl(t);const{props:i,children:o}=e.vnode,a=fg(e);My(e,i,a,t),Ly(e,o,n||t);const c=a?Zy(e,t):void 0;return t&&gl(!1),c}function Zy(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hy);const{setup:i}=n;if(i){bn();const o=e.setupContext=i.length>1?Yy(e):null,a=qr(e),c=Gr(i,e,0,[e.props,o]),u=lf(c);if(yn(),a(),(u||e.sp)&&!Nr(e)&&zf(e),u){if(c.then(ad,ad),t)return c.then(f=>{ld(e,f)}).catch(f=>{Ro(f,e,0)});e.asyncDep=c}else ld(e,c)}else gg(e)}function ld(e,t,n){Se(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Be(t)&&(e.setupState=Mf(t)),gg(e)}function gg(e,t,n){const i=e.type;e.render||(e.render=i.render||nn);{const o=qr(e);bn();try{my(e)}finally{yn(),o()}}}const Qy={get(e,t){return ut(e,"get",""),e[t]}};function Yy(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Qy),slots:e.slots,emit:e.emit,expose:t}}function Po(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Mf(Lb(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Or)return Or[n](e)},has(t,n){return n in t||n in Or}})):e.proxy}function Jy(e,t=!0){return Se(e)?e.displayName||e.name:e.name||t&&e.__name}function Xy(e){return Se(e)&&"__vccOpts"in e}const pe=(e,t)=>Ub(e,t,Hr),ek="3.5.34";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.34
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let pl;const cd=typeof window<"u"&&window.trustedTypes;if(cd)try{pl=cd.createPolicy("vue",{createHTML:e=>e})}catch{}const pg=pl?e=>pl.createHTML(e):e=>e,tk="http://www.w3.org/2000/svg",nk="http://www.w3.org/1998/Math/MathML",fn=typeof document<"u"?document:null,ud=fn&&fn.createElement("template"),sk={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const o=t==="svg"?fn.createElementNS(tk,e):t==="mathml"?fn.createElementNS(nk,e):n?fn.createElement(e,{is:n}):fn.createElement(e);return e==="select"&&i&&i.multiple!=null&&o.setAttribute("multiple",i.multiple),o},createText:e=>fn.createTextNode(e),createComment:e=>fn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>fn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{ud.innerHTML=pg(i==="svg"?`<svg>${e}</svg>`:i==="mathml"?`<math>${e}</math>`:e);const u=ud.content;if(i==="svg"||i==="mathml"){const f=u.firstChild;for(;f.firstChild;)u.appendChild(f.firstChild);u.removeChild(f)}t.insertBefore(u,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},In="transition",mr="animation",Us=Symbol("_vtc"),hg={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},rk=st({},ey,hg),ns=(e,t=[])=>{_e(e)?e.forEach(n=>n(...t)):e&&e(...t)},dd=e=>e?_e(e)?e.some(t=>t.length>1):e.length>1:!1;function ik(e){const t={};for(const U in e)U in hg||(t[U]=e[U]);if(e.css===!1)return t;const{name:n="v",type:i,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:u=`${n}-enter-to`,appearFromClass:f=a,appearActiveClass:m=c,appearToClass:h=u,leaveFromClass:y=`${n}-leave-from`,leaveActiveClass:v=`${n}-leave-active`,leaveToClass:C=`${n}-leave-to`}=e,S=ok(o),N=S&&S[0],I=S&&S[1],{onBeforeEnter:L,onEnter:l,onEnterCancelled:M,onLeave:O,onLeaveCancelled:H,onBeforeAppear:se=L,onAppear:J=l,onAppearCancelled:ie=M}=t,Z=(U,oe,fe,Ee)=>{U._enterCancelled=Ee,On(U,oe?h:u),On(U,oe?m:c),fe&&fe()},ce=(U,oe)=>{U._isLeaving=!1,On(U,y),On(U,C),On(U,v),oe&&oe()},X=U=>(oe,fe)=>{const Ee=U?J:l,F=()=>Z(oe,U,fe);ns(Ee,[oe,F]),fd(()=>{On(oe,U?f:a),Zt(oe,U?h:u),dd(Ee)||gd(oe,i,N,F)})};return st(t,{onBeforeEnter(U){ns(L,[U]),Zt(U,a),Zt(U,c)},onBeforeAppear(U){ns(se,[U]),Zt(U,f),Zt(U,m)},onEnter:X(!1),onAppear:X(!0),onLeave(U,oe){U._isLeaving=!0;const fe=()=>ce(U,oe);Zt(U,y),U._enterCancelled?(Zt(U,v),hl(U)):(hl(U),Zt(U,v)),fd(()=>{U._isLeaving&&(On(U,y),Zt(U,C),dd(O)||gd(U,i,I,fe))}),ns(O,[U,fe])},onEnterCancelled(U){Z(U,!1,void 0,!0),ns(M,[U])},onAppearCancelled(U){Z(U,!0,void 0,!0),ns(ie,[U])},onLeaveCancelled(U){ce(U),ns(H,[U])}})}function ok(e){if(e==null)return null;if(Be(e))return[Ba(e.enter),Ba(e.leave)];{const t=Ba(e);return[t,t]}}function Ba(e){return rb(e)}function Zt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Us]||(e[Us]=new Set)).add(t)}function On(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.remove(i));const n=e[Us];n&&(n.delete(t),n.size||(e[Us]=void 0))}function fd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ak=0;function gd(e,t,n,i){const o=e._endId=++ak,a=()=>{o===e._endId&&i()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:u,propCount:f}=mg(e,t);if(!c)return i();const m=c+"end";let h=0;const y=()=>{e.removeEventListener(m,v),a()},v=C=>{C.target===e&&++h>=f&&y()};setTimeout(()=>{h<f&&y()},u+1),e.addEventListener(m,v)}function mg(e,t){const n=window.getComputedStyle(e),i=S=>(n[S]||"").split(", "),o=i(`${In}Delay`),a=i(`${In}Duration`),c=pd(o,a),u=i(`${mr}Delay`),f=i(`${mr}Duration`),m=pd(u,f);let h=null,y=0,v=0;t===In?c>0&&(h=In,y=c,v=a.length):t===mr?m>0&&(h=mr,y=m,v=f.length):(y=Math.max(c,m),h=y>0?c>m?In:mr:null,v=h?h===In?a.length:f.length:0);const C=h===In&&/\b(?:transform|all)(?:,|$)/.test(i(`${In}Property`).toString());return{type:h,timeout:y,propCount:v,hasTransform:C}}function pd(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,i)=>hd(n)+hd(e[i])))}function hd(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function hl(e){return(e?e.ownerDocument:document).body.offsetHeight}function lk(e,t,n){const i=e[Us];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const md=Symbol("_vod"),ck=Symbol("_vsh"),uk=Symbol(""),dk=/(?:^|;)\s*display\s*:/;function fk(e,t,n){const i=e.style,o=qe(n);let a=!1;if(n&&!o){if(t)if(qe(t))for(const c of t.split(";")){const u=c.slice(0,c.indexOf(":")).trim();n[u]==null&&_r(i,u,"")}else for(const c in t)n[c]==null&&_r(i,c,"");for(const c in n){c==="display"&&(a=!0);const u=n[c];u!=null?pk(e,c,!qe(t)&&t?t[c]:void 0,u)||_r(i,c,u):_r(i,c,"")}}else if(o){if(t!==n){const c=i[uk];c&&(n+=";"+c),i.cssText=n,a=dk.test(n)}}else t&&e.removeAttribute("style");md in e&&(e[md]=a?i.display:"",e[ck]&&(i.display="none"))}const bd=/\s*!important$/;function _r(e,t,n){if(_e(n))n.forEach(i=>_r(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=gk(e,t);bd.test(n)?e.setProperty(Un(i),n.replace(bd,""),"important"):e[i]=n}}const yd=["Webkit","Moz","ms"],Ua={};function gk(e,t){const n=Ua[t];if(n)return n;let i=_t(t);if(i!=="filter"&&i in e)return Ua[t]=i;i=Ao(i);for(let o=0;o<yd.length;o++){const a=yd[o]+i;if(a in e)return Ua[t]=a}return t}function pk(e,t,n,i){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&qe(i)&&n===i}const kd="http://www.w3.org/1999/xlink";function vd(e,t,n,i,o,a=ub(t)){i&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(kd,t.slice(6,t.length)):e.setAttributeNS(kd,t,n):n==null||a&&!ff(n)?e.removeAttribute(t):e.setAttribute(t,a?"":sn(n)?String(n):n)}function _d(e,t,n,i,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?pg(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const u=a==="OPTION"?e.getAttribute("value")||"":e.value,f=n==null?e.type==="checkbox"?"on":"":String(n);(u!==f||!("_value"in e))&&(e.value=f),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const u=typeof e[t];u==="boolean"?n=ff(n):n==null&&u==="string"?(n="",c=!0):u==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function mn(e,t,n,i){e.addEventListener(t,n,i)}function hk(e,t,n,i){e.removeEventListener(t,n,i)}const wd=Symbol("_vei");function mk(e,t,n,i,o=null){const a=e[wd]||(e[wd]={}),c=a[t];if(i&&c)c.value=i;else{const[u,f]=bk(t);if(i){const m=a[t]=vk(i,o);mn(e,u,m,f)}else c&&(hk(e,u,c,f),a[t]=void 0)}}const xd=/(?:Once|Passive|Capture)$/;function bk(e){let t;if(xd.test(e)){t={};let i;for(;i=e.match(xd);)e=e.slice(0,e.length-i[0].length),t[i[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Un(e.slice(2)),t]}let Fa=0;const yk=Promise.resolve(),kk=()=>Fa||(yk.then(()=>Fa=0),Fa=Date.now());function vk(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;Wt(_k(i,n.value),t,5,[i])};return n.value=e,n.attached=kk(),n}function _k(e,t){if(_e(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(i=>o=>!o._stopped&&i&&i(o))}else return t}const Sd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,wk=(e,t,n,i,o,a)=>{const c=o==="svg";t==="class"?lk(e,i,c):t==="style"?fk(e,n,i):So(t)?Eo(t)||mk(e,t,n,i,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):xk(e,t,i,c))?(_d(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&vd(e,t,i,c,a,t!=="value")):e._isVueCE&&(Sk(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!qe(i)))?_d(e,_t(t),i,a,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),vd(e,t,i,c))};function xk(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&Sd(t)&&Se(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 Sd(t)&&qe(n)?!1:t in e}function Sk(e,t){const n=e._def.props;if(!n)return!1;const i=_t(t);return Array.isArray(n)?n.some(o=>_t(o)===i):Object.keys(n).some(o=>_t(o)===i)}const bg=new WeakMap,yg=new WeakMap,go=Symbol("_moveCb"),Ed=Symbol("_enterCb"),Ek=e=>(delete e.props.mode,e),Tk=Ek({name:"TransitionGroup",props:st({},rk,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=dg(),i=Xb();let o,a;return Wf(()=>{if(!o.length)return;const c=e.moveClass||`${e.name||"v"}-move`;if(!Rk(o[0].el,n.vnode.el,c)){o=[];return}o.forEach(Ck),o.forEach(Ik);const u=o.filter(Mk);hl(n.vnode.el),u.forEach(f=>{const m=f.el,h=m.style;Zt(m,c),h.transform=h.webkitTransform=h.transitionDuration="";const y=m[go]=v=>{v&&v.target!==m||(!v||v.propertyName.endsWith("transform"))&&(m.removeEventListener("transitionend",y),m[go]=null,On(m,c))};m.addEventListener("transitionend",y)}),o=[]}),()=>{const c=Le(e),u=ik(c);let f=c.tag||de;if(o=[],a)for(let m=0;m<a.length;m++){const h=a[m];h.el&&h.el instanceof Element&&(o.push(h),Fr(h,ll(h,u,i,n)),bg.set(h,kg(h.el)))}a=t.default?Ff(t.default()):[];for(let m=0;m<a.length;m++){const h=a[m];h.key!=null&&Fr(h,ll(h,u,i,n))}return at(f,null,a)}}}),Ak=Tk;function Ck(e){const t=e.el;t[go]&&t[go](),t[Ed]&&t[Ed]()}function Ik(e){yg.set(e,kg(e.el))}function Mk(e){const t=bg.get(e),n=yg.get(e),i=t.left-n.left,o=t.top-n.top;if(i||o){const a=e.el,c=a.style,u=a.getBoundingClientRect();let f=1,m=1;return a.offsetWidth&&(f=u.width/a.offsetWidth),a.offsetHeight&&(m=u.height/a.offsetHeight),(!Number.isFinite(f)||f===0)&&(f=1),(!Number.isFinite(m)||m===0)&&(m=1),Math.abs(f-1)<.01&&(f=1),Math.abs(m-1)<.01&&(m=1),c.transform=c.webkitTransform=`translate(${i/f}px,${o/m}px)`,c.transitionDuration="0s",e}}function kg(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Rk(e,t,n){const i=e.cloneNode(),o=e[Us];o&&o.forEach(u=>{u.split(/\s+/).forEach(f=>f&&i.classList.remove(f))}),n.split(/\s+/).forEach(u=>u&&i.classList.add(u)),i.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(i);const{hasTransform:c}=mg(i);return a.removeChild(i),c}const Bn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _e(t)?n=>Xi(t,n):t};function Nk(e){e.target.composing=!0}function Td(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Pt=Symbol("_assign");function Ad(e,t,n){return t&&(e=e.trim()),n&&(e=Co(e)),e}const Tt={created(e,{modifiers:{lazy:t,trim:n,number:i}},o){e[Pt]=Bn(o);const a=i||o.props&&o.props.type==="number";mn(e,t?"change":"input",c=>{c.target.composing||e[Pt](Ad(e.value,n,a))}),(n||a)&&mn(e,"change",()=>{e.value=Ad(e.value,n,a)}),t||(mn(e,"compositionstart",Nk),mn(e,"compositionend",Td),mn(e,"change",Td))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:o,number:a}},c){if(e[Pt]=Bn(c),e.composing)return;const u=(a||e.type==="number")&&!/^0\d/.test(e.value)?Co(e.value):e.value,f=t??"";if(u===f)return;const m=e.getRootNode();(m instanceof Document||m instanceof ShadowRoot)&&m.activeElement===e&&e.type!=="range"&&(i&&t===n||o&&e.value.trim()===f)||(e.value=f)}},ml={deep:!0,created(e,t,n){e[Pt]=Bn(n),mn(e,"change",()=>{const i=e._modelValue,o=Fs(e),a=e.checked,c=e[Pt];if(_e(i)){const u=Il(i,o),f=u!==-1;if(a&&!f)c(i.concat(o));else if(!a&&f){const m=[...i];m.splice(u,1),c(m)}}else if(Hs(i)){const u=new Set(i);a?u.add(o):u.delete(o),c(u)}else c(_g(e,a))})},mounted:Cd,beforeUpdate(e,t,n){e[Pt]=Bn(n),Cd(e,t,n)}};function Cd(e,{value:t,oldValue:n},i){e._modelValue=t;let o;if(_e(t))o=Il(t,i.props.value)>-1;else if(Hs(t))o=t.has(i.props.value);else{if(t===n)return;o=Dn(t,_g(e,!0))}e.checked!==o&&(e.checked=o)}const bl={created(e,{value:t},n){e.checked=Dn(t,n.props.value),e[Pt]=Bn(n),mn(e,"change",()=>{e[Pt](Fs(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[Pt]=Bn(i),t!==n&&(e.checked=Dn(t,i.props.value))}},vg={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const o=Hs(t);mn(e,"change",()=>{const a=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>n?Co(Fs(c)):Fs(c));e[Pt](e.multiple?o?new Set(a):a:a[0]),e._assigning=!0,ct(()=>{e._assigning=!1})}),e[Pt]=Bn(i)},mounted(e,{value:t}){Id(e,t)},beforeUpdate(e,t,n){e[Pt]=Bn(n)},updated(e,{value:t}){e._assigning||Id(e,t)}};function Id(e,t){const n=e.multiple,i=_e(t);if(!(n&&!i&&!Hs(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],u=Fs(c);if(n)if(i){const f=typeof u;f==="string"||f==="number"?c.selected=t.some(m=>String(m)===String(u)):c.selected=Il(t,u)>-1}else c.selected=t.has(u);else if(Dn(Fs(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Fs(e){return"_value"in e?e._value:e.value}function _g(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ok={created(e,t,n){Wi(e,t,n,null,"created")},mounted(e,t,n){Wi(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){Wi(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){Wi(e,t,n,i,"updated")}};function Lk(e,t){switch(e){case"SELECT":return vg;case"TEXTAREA":return Tt;default:switch(t){case"checkbox":return ml;case"radio":return bl;default:return Tt}}}function Wi(e,t,n,i,o){const c=Lk(e.tagName,n.props&&n.props.type)[o];c&&c(e,t,n,i)}const Pk=["ctrl","shift","alt","meta"],$k={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)=>Pk.some(n=>e[`${n}Key`]&&!t.includes(n))},je=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=(o,...a)=>{for(let c=0;c<t.length;c++){const u=$k[t[c]];if(u&&u(o,t))return}return e(o,...a)})},Dk={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},is=(e,t)=>{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=o=>{if(!("key"in o))return;const a=Un(o.key);if(t.some(c=>c===a||Dk[c]===a))return e(o)})},Bk=st({patchProp:wk},sk);let Md;function Uk(){return Md||(Md=$y(Bk))}const Fk=(...e)=>{const t=Uk().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=Hk(i);if(!o)return;const a=t._component;!Se(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,zk(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function zk(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hk(e){return qe(e)?document.querySelector(e):e}function Hl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ps=Hl();function wg(e){ps=e}var os={exec:()=>null};function Ne(e,t=""){let n=typeof e=="string"?e:e.source,i={replace:(o,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace(ft.caret,"$1"),n=n.replace(o,c),i},getRegex:()=>new RegExp(n,t)};return i}var jk=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),ft={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Wk=/^(?:[ \t]*(?:\n|$))+/,Kk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jl=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Sg=Ne(xg).replace(/bull/g,jl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qk=Ne(xg).replace(/bull/g,jl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Wl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zk=/^[^\n]+/,Kl=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qk=Ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Kl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yk=Ne(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jl).getRegex(),$o="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Gl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jk=Ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gl).replace("tag",$o).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Eg=Ne(Wl).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$o).getRegex(),Xk=Ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Eg).getRegex(),Vl={blockquote:Xk,code:Kk,def:Qk,fences:Gk,heading:Vk,hr:Zr,html:Jk,lheading:Sg,list:Yk,newline:Wk,paragraph:Eg,table:os,text:Zk},Rd=Ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$o).getRegex(),ev={...Vl,lheading:qk,table:Rd,paragraph:Ne(Wl).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Rd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$o).getRegex()},tv={...Vl,html:Ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:os,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ne(Wl).replace("hr",Zr).replace("heading",` *#{1,6} *[^
|
|
18
|
-
]`).replace("lheading",Sg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Tg=/^( {2,}|\\)\n(?!\s*$)/,rv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,js=/[\p{P}\p{S}]/u,Do=/[\s\p{P}\p{S}]/u,ql=/[^\s\p{P}\p{S}]/u,iv=Ne(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Do).getRegex(),Ag=/(?!~)[\p{P}\p{S}]/u,ov=/(?!~)[\s\p{P}\p{S}]/u,av=/(?:[^\s\p{P}\p{S}]|~)/u,lv=Ne(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",jk?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Cg=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,cv=Ne(Cg,"u").replace(/punct/g,js).getRegex(),uv=Ne(Cg,"u").replace(/punct/g,Ag).getRegex(),Ig="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dv=Ne(Ig,"gu").replace(/notPunctSpace/g,ql).replace(/punctSpace/g,Do).replace(/punct/g,js).getRegex(),fv=Ne(Ig,"gu").replace(/notPunctSpace/g,av).replace(/punctSpace/g,ov).replace(/punct/g,Ag).getRegex(),gv=Ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ql).replace(/punctSpace/g,Do).replace(/punct/g,js).getRegex(),pv=Ne(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,js).getRegex(),hv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",mv=Ne(hv,"gu").replace(/notPunctSpace/g,ql).replace(/punctSpace/g,Do).replace(/punct/g,js).getRegex(),bv=Ne(/\\(punct)/,"gu").replace(/punct/g,js).getRegex(),yv=Ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),kv=Ne(Gl).replace("(?:-->|$)","-->").getRegex(),vv=Ne("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",kv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),po=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,_v=Ne(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",po).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Mg=Ne(/^!?\[(label)\]\[(ref)\]/).replace("label",po).replace("ref",Kl).getRegex(),Rg=Ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",Kl).getRegex(),wv=Ne("reflink|nolink(?!\\()","g").replace("reflink",Mg).replace("nolink",Rg).getRegex(),Nd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zl={_backpedal:os,anyPunctuation:bv,autolink:yv,blockSkip:lv,br:Tg,code:sv,del:os,delLDelim:os,delRDelim:os,emStrongLDelim:cv,emStrongRDelimAst:dv,emStrongRDelimUnd:gv,escape:nv,link:_v,nolink:Rg,punctuation:iv,reflink:Mg,reflinkSearch:wv,tag:vv,text:rv,url:os},xv={...Zl,link:Ne(/^!?\[(label)\]\((.*?)\)/).replace("label",po).getRegex(),reflink:Ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",po).getRegex()},yl={...Zl,emStrongRDelimAst:fv,emStrongLDelim:uv,delLDelim:pv,delRDelim:mv,url:Ne(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Nd).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ne(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Nd).getRegex()},Sv={...yl,br:Ne(Tg).replace("{2,}","*").getRegex(),text:Ne(yl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ki={normal:Vl,gfm:ev,pedantic:tv},br={normal:Zl,gfm:yl,breaks:Sv,pedantic:xv},Ev={"&":"&","<":"<",">":">",'"':""","'":"'"},Od=e=>Ev[e];function Qt(e,t){if(t){if(ft.escapeTest.test(e))return e.replace(ft.escapeReplace,Od)}else if(ft.escapeTestNoEncode.test(e))return e.replace(ft.escapeReplaceNoEncode,Od);return e}function Ld(e){try{e=encodeURI(e).replace(ft.percentDecode,"%")}catch{return null}return e}function Pd(e,t){var a;let n=e.replace(ft.findPipe,(c,u,f)=>{let m=!1,h=u;for(;--h>=0&&f[h]==="\\";)m=!m;return m?"|":" |"}),i=n.split(ft.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(ft.slashPipe,"|");return i}function Mn(e,t,n){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function $d(e){let t=e.split(`
|
|
19
|
-
`),n=t.length-1;for(;n>=0&&ft.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
20
|
-
`)}function Tv(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])n++;else if(e[i]===t[1]&&(n--,n<0))return i;return n>0?-2:-1}function Av(e,t=0){let n=t,i="";for(let o of e)if(o===" "){let a=4-n%4;i+=" ".repeat(a),n+=a}else i+=o,n++;return i}function Dd(e,t,n,i,o){let a=t.href,c=t.title||null,u=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let f={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,f}function Cv(e,t,n){let i=e.match(n.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
|
|
21
|
-
`).map(a=>{let c=a.match(n.other.beginningSpace);if(c===null)return a;let[u]=c;return u.length>=o.length?a.slice(o.length):a}).join(`
|
|
22
|
-
`)}var ho=class{constructor(e){Ue(this,"options");Ue(this,"rules");Ue(this,"lexer");this.options=e||ps}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:$d(t[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],i=Cv(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let i=Mn(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:Mn(t[0],`
|
|
23
|
-
`),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Mn(t[0],`
|
|
24
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Mn(t[0],`
|
|
25
|
-
`).split(`
|
|
26
|
-
`),i="",o="",a=[];for(;n.length>0;){let c=!1,u=[],f;for(f=0;f<n.length;f++)if(this.rules.other.blockquoteStart.test(n[f]))u.push(n[f]),c=!0;else if(!c)u.push(n[f]);else break;n=n.slice(f);let m=u.join(`
|
|
27
|
-
`),h=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
28
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
29
|
-
${m}`:m,o=o?`${o}
|
|
30
|
-
${h}`:h;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=y,n.length===0)break;let v=a.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let C=v,S=C.raw+`
|
|
31
|
-
`+n.join(`
|
|
32
|
-
`),N=this.blockquote(S);a[a.length-1]=N,i=i.substring(0,i.length-C.raw.length)+N.raw,o=o.substring(0,o.length-C.text.length)+N.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,S=C.raw+`
|
|
33
|
-
`+n.join(`
|
|
34
|
-
`),N=this.list(S);a[a.length-1]=N,i=i.substring(0,i.length-v.raw.length)+N.raw,o=o.substring(0,o.length-C.raw.length)+N.raw,n=S.substring(a.at(-1).raw.length).split(`
|
|
35
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),i=n.length>1,o={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),c=!1;for(;e;){let f=!1,m="",h="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;m=t[0],e=e.substring(m.length);let y=Av(t[2].split(`
|
|
36
|
-
`,1)[0],t[1].length),v=e.split(`
|
|
37
|
-
`,1)[0],C=!y.trim(),S=0;if(this.options.pedantic?(S=2,h=y.trimStart()):C?S=t[1].length+1:(S=y.search(this.rules.other.nonSpaceChar),S=S>4?1:S,h=y.slice(S),S+=t[1].length),C&&this.rules.other.blankLine.test(v)&&(m+=v+`
|
|
38
|
-
`,e=e.substring(v.length+1),f=!0),!f){let N=this.rules.other.nextBulletRegex(S),I=this.rules.other.hrRegex(S),L=this.rules.other.fencesBeginRegex(S),l=this.rules.other.headingBeginRegex(S),M=this.rules.other.htmlBeginRegex(S),O=this.rules.other.blockquoteBeginRegex(S);for(;e;){let H=e.split(`
|
|
39
|
-
`,1)[0],se;if(v=H,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),se=v):se=v.replace(this.rules.other.tabCharGlobal," "),L.test(v)||l.test(v)||M.test(v)||O.test(v)||N.test(v)||I.test(v))break;if(se.search(this.rules.other.nonSpaceChar)>=S||!v.trim())h+=`
|
|
40
|
-
`+se.slice(S);else{if(C||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(y)||l.test(y)||I.test(y))break;h+=`
|
|
41
|
-
`+v}C=!v.trim(),m+=H+`
|
|
42
|
-
`,e=e.substring(H.length+1),y=se.slice(S)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),o.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),o.raw+=m}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f of o.items){this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]);let m=f.tokens[0];if(f.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){f.text=f.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(f.raw);if(h){let y={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};f.checked=y.checked,o.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=y.raw+f.tokens[0].raw,f.tokens[0].text=y.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(y)):f.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):f.tokens.unshift(y)}}else f.task&&(f.task=!1);if(!o.loose){let h=f.tokens.filter(v=>v.type==="space"),y=h.length>0&&h.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=y}}if(o.loose)for(let f of o.items){f.loose=!0;for(let m of f.tokens)m.type==="text"&&(m.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=$d(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:Mn(t[0],`
|
|
43
|
-
`),href:i,title:o}}}table(e){var c;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Pd(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(c=t[3])!=null&&c.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
44
|
-
`):[],a={type:"table",raw:Mn(t[0],`
|
|
45
|
-
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of o)a.rows.push(Pd(u,a.header.length).map((f,m)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:a.align[m]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:Mn(t[0],`
|
|
46
|
-
`),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
47
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Mn(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Tv(t[2],"()");if(a===-2)return;if(a>-1){let c=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],o=a[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Dd(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[i.toLowerCase()];if(!o){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Dd(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let o=[...i[0]].length-1,a,c,u=o,f=0,m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+o);(i=m.exec(t))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&o%3&&!((o+c)%3)){f+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+f);let h=[...i[0]][0].length,y=e.slice(0,o+i.index+h+c);if(Math.min(o,c)%2){let C=y.slice(1,-1);return{type:"em",raw:y,text:C,tokens:this.lexer.inlineTokens(C)}}let v=y.slice(2,-2);return{type:"strong",raw:y,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...i[0]].length-1,a,c,u=o,f=this.rules.inline.delRDelim;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(i=f.exec(t))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(c=[...a].length,c!==o))continue;if(i[3]||i[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let m=[...i[0]][0].length,h=e.slice(0,o+i.index+m+c),y=h.slice(o,-o);return{type:"del",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,o;if(t[2]==="@")i=t[0],o="mailto:"+i;else{let a;do a=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(a!==t[0]);i=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Ft=class kl{constructor(t){Ue(this,"tokens");Ue(this,"options");Ue(this,"state");Ue(this,"inlineQueue");Ue(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ps,this.options.tokenizer=this.options.tokenizer||new ho,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ft,block:Ki.normal,inline:br.normal};this.options.pedantic?(n.block=Ki.pedantic,n.inline=br.pedantic):this.options.gfm&&(n.block=Ki.gfm,this.options.breaks?n.inline=br.breaks:n.inline=br.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ki,inline:br}}static lex(t,n){return new kl(n).lex(t)}static lexInline(t,n){return new kl(n).inlineTokens(t)}lex(t){t=t.replace(ft.carriageReturn,`
|
|
48
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],i=!1){var a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(ft.tabCharGlobal," ").replace(ft.spaceLine,""));let o=1/0;for(;t;){if(t.length<o)o=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let f;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(h=>(f=h.call({lexer:this},t,n))?(t=t.substring(f.raw.length),n.push(f),!0):!1))continue;if(f=this.tokenizer.space(t)){t=t.substring(f.raw.length);let h=n.at(-1);f.raw.length===1&&h!==void 0?h.raw+=`
|
|
49
|
-
`:n.push(f);continue}if(f=this.tokenizer.code(t)){t=t.substring(f.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
50
|
-
`)?"":`
|
|
51
|
-
`)+f.raw,h.text+=`
|
|
52
|
-
`+f.text,this.inlineQueue.at(-1).src=h.text):n.push(f);continue}if(f=this.tokenizer.fences(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.heading(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.hr(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.blockquote(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.list(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.html(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.def(t)){t=t.substring(f.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
53
|
-
`)?"":`
|
|
54
|
-
`)+f.raw,h.text+=`
|
|
55
|
-
`+f.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[f.tag]||(this.tokens.links[f.tag]={href:f.href,title:f.title},n.push(f));continue}if(f=this.tokenizer.table(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.lheading(t)){t=t.substring(f.raw.length),n.push(f);continue}let m=t;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,y=t.slice(1),v;this.options.extensions.startBlock.forEach(C=>{v=C.call({lexer:this},y),typeof v=="number"&&v>=0&&(h=Math.min(h,v))}),h<1/0&&h>=0&&(m=t.substring(0,h+1))}if(this.state.top&&(f=this.tokenizer.paragraph(m))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
56
|
-
`)?"":`
|
|
57
|
-
`)+f.raw,h.text+=`
|
|
58
|
-
`+f.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(f),i=m.length!==t.length,t=t.substring(f.raw.length);continue}if(f=this.tokenizer.text(t)){t=t.substring(f.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
59
|
-
`)?"":`
|
|
60
|
-
`)+f.raw,h.text+=`
|
|
61
|
-
`+f.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(f);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var m,h,y,v,C;this.tokenizer.lexer=this;let i=t,o=null;if(this.tokens.links){let S=Object.keys(this.tokens.links);if(S.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)S.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)a=o[2]?o[2].length:0,i=i.slice(0,o.index+a)+"["+"a".repeat(o[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let c=!1,u="",f=1/0;for(;t;){if(t.length<f)f=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}c||(u=""),c=!1;let S;if((v=(y=this.options.extensions)==null?void 0:y.inline)!=null&&v.some(I=>(S=I.call({lexer:this},t,n))?(t=t.substring(S.raw.length),n.push(S),!0):!1))continue;if(S=this.tokenizer.escape(t)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.tag(t)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.link(t)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(S.raw.length);let I=n.at(-1);S.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=S.raw,I.text+=S.text):n.push(S);continue}if(S=this.tokenizer.emStrong(t,i,u)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.codespan(t)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.br(t)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.del(t,i,u)){t=t.substring(S.raw.length),n.push(S);continue}if(S=this.tokenizer.autolink(t)){t=t.substring(S.raw.length),n.push(S);continue}if(!this.state.inLink&&(S=this.tokenizer.url(t))){t=t.substring(S.raw.length),n.push(S);continue}let N=t;if((C=this.options.extensions)!=null&&C.startInline){let I=1/0,L=t.slice(1),l;this.options.extensions.startInline.forEach(M=>{l=M.call({lexer:this},L),typeof l=="number"&&l>=0&&(I=Math.min(I,l))}),I<1/0&&I>=0&&(N=t.substring(0,I+1))}if(S=this.tokenizer.inlineText(N)){t=t.substring(S.raw.length),S.raw.slice(-1)!=="_"&&(u=S.raw.slice(-1)),c=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=S.raw,I.text+=S.text):n.push(S);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},mo=class{constructor(e){Ue(this,"options");Ue(this,"parser");this.options=e||ps}space(e){return""}code({text:e,lang:t,escaped:n}){var a;let i=(a=(t||"").match(ft.notSpaceStart))==null?void 0:a[0],o=e.replace(ft.endingNewline,"")+`
|
|
62
|
-
`;return i?'<pre><code class="language-'+Qt(i)+'">'+(n?o:Qt(o,!0))+`</code></pre>
|
|
63
|
-
`:"<pre><code>"+(n?o:Qt(o,!0))+`</code></pre>
|
|
64
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
65
|
-
${this.parser.parse(e)}</blockquote>
|
|
66
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
67
|
-
`}hr(e){return`<hr>
|
|
68
|
-
`}list(e){let t=e.ordered,n=e.start,i="";for(let c=0;c<e.items.length;c++){let u=e.items[c];i+=this.listitem(u)}let o=t?"ol":"ul",a=t&&n!==1?' start="'+n+'"':"";return"<"+o+a+`>
|
|
69
|
-
`+i+"</"+o+`>
|
|
70
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
71
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
72
|
-
`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let i="";for(let o=0;o<e.rows.length;o++){let a=e.rows[o];n="";for(let c=0;c<a.length;c++)n+=this.tablecell(a[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
73
|
-
<thead>
|
|
74
|
-
`+t+`</thead>
|
|
75
|
-
`+i+`</table>
|
|
76
|
-
`}tablerow({text:e}){return`<tr>
|
|
77
|
-
${e}</tr>
|
|
78
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
79
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),o=Ld(e);if(o===null)return i;e=o;let a='<a href="'+e+'"';return t&&(a+=' title="'+Qt(t)+'"'),a+=">"+i+"</a>",a}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let o=Ld(e);if(o===null)return Qt(n);e=o;let a=`<img src="${e}" alt="${Qt(n)}"`;return t&&(a+=` title="${Qt(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Qt(e.text)}},Ql=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},zt=class vl{constructor(t){Ue(this,"options");Ue(this,"renderer");Ue(this,"textRenderer");this.options=t||ps,this.options.renderer=this.options.renderer||new mo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ql}static parse(t,n){return new vl(n).parse(t)}static parseInline(t,n){return new vl(n).parseInline(t)}parse(t){var i,o;this.renderer.parser=this;let n="";for(let a=0;a<t.length;a++){let c=t[a];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[c.type]){let f=c,m=this.options.extensions.renderers[f.type].call({parser:this},f);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(f.type)){n+=m||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let f='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return n}parseInline(t,n=this.renderer){var o,a;this.renderer.parser=this;let i="";for(let c=0;c<t.length;c++){let u=t[c];if((a=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=m||"";continue}}let f=u;switch(f.type){case"escape":{i+=n.text(f);break}case"html":{i+=n.html(f);break}case"link":{i+=n.link(f);break}case"image":{i+=n.image(f);break}case"checkbox":{i+=n.checkbox(f);break}case"strong":{i+=n.strong(f);break}case"em":{i+=n.em(f);break}case"codespan":{i+=n.codespan(f);break}case"br":{i+=n.br(f);break}case"del":{i+=n.del(f);break}case"text":{i+=n.text(f);break}default:{let m='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},Ji,wr=(Ji=class{constructor(e){Ue(this,"options");Ue(this,"block");this.options=e||ps}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ft.lex:Ft.lexInline}provideParser(e=this.block){return e?zt.parse:zt.parseInline}},Ue(Ji,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ue(Ji,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ji),Iv=class{constructor(...e){Ue(this,"defaults",Hl());Ue(this,"options",this.setOptions);Ue(this,"parse",this.parseMarkdown(!0));Ue(this,"parseInline",this.parseMarkdown(!1));Ue(this,"Parser",zt);Ue(this,"Renderer",mo);Ue(this,"TextRenderer",Ql);Ue(this,"Lexer",Ft);Ue(this,"Tokenizer",ho);Ue(this,"Hooks",wr);this.use(...e)}walkTokens(e,t){var i,o;let n=[];for(let a of e)switch(n=n.concat(t.call(this,a)),a.type){case"table":{let c=a;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,t));for(let u of c.rows)for(let f of u)n=n.concat(this.walkTokens(f.tokens,t));break}case"list":{let c=a;n=n.concat(this.walkTokens(c.items,t));break}default:{let c=a;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let f=c[u].flat(1/0);n=n.concat(this.walkTokens(f,t))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let a=t.renderers[o.name];a?t.renderers[o.name]=function(...c){let u=o.renderer.apply(this,c);return u===!1&&(u=a.apply(this,c)),u}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[o.level];a?a.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),i.extensions=t),n.renderer){let o=this.defaults.renderer||new mo(this.defaults);for(let a in n.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let c=a,u=n.renderer[c],f=o[c];o[c]=(...m)=>{let h=u.apply(o,m);return h===!1&&(h=f.apply(o,m)),h||""}}i.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new ho(this.defaults);for(let a in n.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let c=a,u=n.tokenizer[c],f=o[c];o[c]=(...m)=>{let h=u.apply(o,m);return h===!1&&(h=f.apply(o,m)),h}}i.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new wr;for(let a in n.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let c=a,u=n.hooks[c],f=o[c];wr.passThroughHooks.has(a)?o[c]=m=>{if(this.defaults.async&&wr.passThroughHooksRespectAsync.has(a))return(async()=>{let y=await u.call(o,m);return f.call(o,y)})();let h=u.call(o,m);return f.call(o,h)}:o[c]=(...m)=>{if(this.defaults.async)return(async()=>{let y=await u.apply(o,m);return y===!1&&(y=await f.apply(o,m)),y})();let h=u.apply(o,m);return h===!1&&(h=f.apply(o,m)),h}}i.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(a.call(this,c)),o&&(u=u.concat(o.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ft.lex(e,t??this.defaults)}parser(e,t){return zt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let i={...n},o={...this.defaults,...i},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let c=o.hooks?await o.hooks.preprocess(t):t,u=await(o.hooks?await o.hooks.provideLexer(e):e?Ft.lex:Ft.lexInline)(c,o),f=o.hooks?await o.hooks.processAllTokens(u):u;o.walkTokens&&await Promise.all(this.walkTokens(f,o.walkTokens));let m=await(o.hooks?await o.hooks.provideParser(e):e?zt.parse:zt.parseInline)(f,o);return o.hooks?await o.hooks.postprocess(m):m})().catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let c=(o.hooks?o.hooks.provideLexer(e):e?Ft.lex:Ft.lexInline)(t,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let u=(o.hooks?o.hooks.provideParser(e):e?zt.parse:zt.parseInline)(c,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(e,t){return n=>{if(n.message+=`
|
|
80
|
-
Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+Qt(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}},gs=new Iv;function Re(e,t){return gs.parse(e,t)}Re.options=Re.setOptions=function(e){return gs.setOptions(e),Re.defaults=gs.defaults,wg(Re.defaults),Re};Re.getDefaults=Hl;Re.defaults=ps;Re.use=function(...e){return gs.use(...e),Re.defaults=gs.defaults,wg(Re.defaults),Re};Re.walkTokens=function(e,t){return gs.walkTokens(e,t)};Re.parseInline=gs.parseInline;Re.Parser=zt;Re.parser=zt.parse;Re.Renderer=mo;Re.TextRenderer=Ql;Re.Lexer=Ft;Re.lexer=Ft.lex;Re.Tokenizer=ho;Re.Hooks=wr;Re.parse=Re;Re.options;Re.setOptions;Re.use;Re.walkTokens;Re.parseInline;zt.parse;Ft.lex;const Mv={key:0,class:"terminal-output-reader","aria-label":"终端运行输出"},Rv={key:0,class:"background-task-live-output",tabindex:"0"},Nv={key:1,class:"background-task-live-output terminal-stderr",tabindex:"0"},Ov={__name:"TerminalOutputReader",props:{ownerSessionId:String,runId:String},setup(e){const t=e,n=cs({record:null,stdout:"",stderr:"",offsets:{stdout:0,stderr:0}});let i=0,o,a;async function c(){var f;const u=i;try{for(const m of["stdout","stderr"]){let h;do{const y=n.offsets[m],v=new URLSearchParams({sessionId:t.ownerSessionId,runId:t.runId,stream:m,offset:String(y),limitBytes:"65536"}),C=await fetch(`/api/terminal-output?${v}`,{signal:a.signal,cache:"no-store"});if(u!==i||!C.ok)return;const S=await C.json();if(u!==i||S.sessionId!==t.ownerSessionId||S.runId!==t.runId||S.stream!==m||S.offset!==y||!Number.isSafeInteger(S.nextOffset)||S.nextOffset<y||(n.record=S.record,((f=S.record)==null?void 0:f.availability)!=="available"||typeof S.text!="string")||S.text&&S.nextOffset===y)return;if(h??(h=S.record.streams[m].storedBytes),n[m]+=S.text,n.offsets[m]=S.nextOffset,S.endOfStoredOutput||S.nextOffset>=h)break}while(u===i)}}catch{}finally{u===i&&(!n.record||n.record.lifecycle==="running")&&(o=setTimeout(c,1e3))}}return Je(()=>[t.ownerSessionId,t.runId],()=>{i++,a==null||a.abort(),a=new AbortController,clearTimeout(o),Object.assign(n,{record:null,stdout:"",stderr:"",offsets:{stdout:0,stderr:0}}),t.ownerSessionId&&t.runId&&c()},{immediate:!0,flush:"pre"}),vn(()=>{i++,a==null||a.abort(),clearTimeout(o)}),(u,f)=>n.stdout||n.stderr?(k(),_("section",Mv,[n.stdout?(k(),_("pre",Rv,A(n.stdout),1)):K("",!0),n.stderr?(k(),_("pre",Nv,A(n.stderr),1)):K("",!0)])):K("",!0)}},Lv=["report","timeline","messages","delegation"],Ng=(e,t)=>e.ownerSessionId===t.ownerSessionId&&e.taskId===t.taskId&&e.runGeneration===t.runGeneration,Og=e=>typeof e.ownerSessionId=="string"&&!!e.ownerSessionId&&typeof e.taskId=="string"&&!!e.taskId&&Number.isSafeInteger(e.runGeneration)&&e.runGeneration>0;function Pv(e,t,n,i=!1){if(!Og(e)||!Lv.includes(t)||i&&(!n||t!=="timeline"))throw new Error("所属会话、任务、轮次或读取方式无效");const o=new URLSearchParams({sessionId:e.ownerSessionId,taskId:e.taskId,runGeneration:String(e.runGeneration),view:t,pageChars:"16000"});return n&&o.set("cursor",n),i&&o.set("refresh","true"),`/api/agent-content?${o}`}const $v=["complete","truncated","missing","unavailable"];function Bd(e,t){if(!t||!$v.includes(t.state)||typeof t.text!="string"||!Number.isSafeInteger(t.offset)||t.offset<0||!Number.isSafeInteger(t.totalChars)||t.totalChars<0||typeof t.hasMore!="boolean")throw new Error("内容分片格式无效");const n=t.offset+t.text.length;if(n>t.totalChars||t.hasMore!==n<t.totalChars)throw new Error("内容分片范围无效");if(e&&(e.totalChars!==t.totalChars||e.state!==t.state))throw new Error("分片源内容已改变,请重新读取");const i=(e==null?void 0:e.text)??"";if(t.offset>i.length)throw new Error("内容分片缺页,请重新读取");const o=Math.min(i.length-t.offset,t.text.length);if(i.slice(t.offset,t.offset+o)!==t.text.slice(0,o))throw new Error("内容分片冲突,请重新读取");const a=i+t.text.slice(o);return{...t,offset:0,text:a,hasMore:a.length<t.totalChars}}function Lg(){return{page:null,items:[],fragment:null}}function Dv(e,t,n,i,o="next"){var u,f,m,h,y;if(!t||!Ng(t,n))throw new Error("响应所属会话、任务或轮次不匹配,已丢弃");if(!["complete","partial","missing","unavailable"].includes(t.state))throw new Error("未知内容读取状态");for(const v of["nextCursor","refreshCursor","snapshotId"])if(t[v]!==void 0&&(typeof t[v]!="string"||!t[v]))throw new Error("响应游标或快照无效");const a=o==="start"?Lg():e;if(o==="next"&&((u=a.page)!=null&&u.snapshotId)&&t.snapshotId&&a.page.snapshotId!==t.snapshotId)throw new Error("分页快照已改变,请重新读取");if(o==="refresh"&&(i!=="timeline"||!((f=a.page)!=null&&f.refreshCursor)||a.page.nextCursor))throw new Error("尚未读完快照,不能增量刷新");if(t.state==="partial"&&!t.nextCursor)throw new Error("分页未完成但未提供继续游标");if(t.nextCursor&&t.refreshCursor)throw new Error("分页与刷新游标冲突");if(t.state==="unavailable")return{...a,page:t};if(i==="timeline"){if(!Array.isArray(t.items)&&t.state!=="missing")throw new Error("过程页未提供 items");const v=a.items.slice(),C=new Map(v.map((S,N)=>[S.id,N]));for(const S of t.items??[]){if(!S||typeof S.id!="string"||!S.id||!["assistant","tool_use","tool_result"].includes(S.kind))throw new Error("过程条目身份或类型无效");const N=C.get(S.id),I=N===void 0?void 0:v[N];if(I&&(I.kind!==S.kind||I.messageId!==S.messageId||I.toolUseId!==S.toolUseId||I.toolName!==S.toolName))throw new Error("过程条目身份冲突");const L={...S,content:Bd(I==null?void 0:I.content,S.content)};N===void 0?(C.set(S.id,v.length),v.push(L)):v[N]=L}return{page:t,items:v,fragment:null}}if(i==="delegation"&&t.delegation&&t.delegation.scope!=="task")throw new Error("未知委派 scope;不展示上下文或续跑指令");const c=i==="delegation"?(m=t.delegation)==null?void 0:m.prompt:i==="messages"?(h=t.messages)==null?void 0:h.content:(y=t.report)==null?void 0:y.content;if(!c&&t.state!=="missing")throw new Error("读取页未提供正文");return{page:t,items:[],fragment:c?Bd(a.fragment,c):null}}const Bv={class:"agent-content-reader agent-parent-messages","aria-label":"代理消息"},Uv=["innerHTML"],Fv={key:0,class:"reader-error",role:"alert"},zv={__name:"AgentExchangeReader",props:{ownerSessionId:String,task:Object,renderMarkdown:Function},setup(e){const t=e,n=Ae([]),i=Ae("");let o=0,a,c;const u={whiteSpace:"pre-wrap",overflowWrap:"anywhere"},f=()=>{var h,y;return{ownerSessionId:t.ownerSessionId,taskId:(h=t.task)==null?void 0:h.taskId,runGeneration:(y=t.task)==null?void 0:y.runGeneration}};async function m(){var se;const h=++o;a==null||a.abort(),a=new AbortController;const y=a.signal;clearTimeout(c);const v=t.task,C=f(),{ownerSessionId:S}=C;if(!Og(C))return;const N=()=>h===o&&!y.aborted&&Ng(C,f()),I=[];let L=!1;async function l(J,ie){var U;const Z={ownerSessionId:S,taskId:v.taskId,runGeneration:ie};let ce=Lg(),X;do{const oe=await fetch(Pv(Z,J,X),{signal:y,cache:"no-store"});if(!oe.ok)throw new Error("加载失败");const fe=await oe.json();if(!N())return"";if(fe.state==="unavailable")throw new Error("加载失败");if(ce=Dv(ce,fe,Z,J,X?"next":"start"),X&&fe.nextCursor===X)throw new Error("加载失败");X=fe.nextCursor}while(X&&N());return((U=ce.fragment)==null?void 0:U.text)||""}async function M(J,ie){try{return await l(J,ie)}catch(Z){return N()&&Z.name!=="AbortError"&&(L=!0),""}}function O(J,ie,Z){typeof Z=="string"&&Z.trim()&&I.push({id:J,direction:ie,text:Z})}O("delegation","主代理 → 子代理",await M("delegation",v.runGeneration));const H=[...v.runHistory||[],v].filter(J=>Number.isSafeInteger(J.runGeneration)).sort((J,ie)=>J.runGeneration-ie.runGeneration);for(const J of H){if(!N())return;const ie=await M("messages",J.runGeneration);try{const Z=JSON.parse(ie||"[]");if(!Array.isArray(Z))throw new Error;for(const ce of Z)O(`message:${J.runGeneration}:${ce.id}`,"主代理 → 子代理",ce.text)}catch{L=!0}O(`report:${J.runGeneration}`,"子代理 → 主代理",await M("report",J.runGeneration))}N()&&((!L||!n.value.length)&&(n.value=I),i.value=L?"加载失败":"",["pending","running"].includes((se=t.task)==null?void 0:se.status)&&(c=setTimeout(m,3e3)))}return Je([()=>t.ownerSessionId,()=>{var h;return(h=t.task)==null?void 0:h.taskId},()=>{var h;return(h=t.task)==null?void 0:h.runGeneration},()=>{var h;return(h=t.task)==null?void 0:h.status}],(h,y)=>{h.slice(0,3).some((v,C)=>v!==y[C])&&(n.value=[],i.value=""),m()},{immediate:!0}),vn(()=>{o++,a==null||a.abort(),clearTimeout(c)}),(h,y)=>(k(),_("section",Bv,[(k(!0),_(de,null,Ce(n.value,v=>(k(),_("article",{key:v.id,class:"agent-parent-message"},[d("header",null,[d("strong",null,A(v.direction),1)]),e.renderMarkdown?(k(),_("div",{key:0,class:"markdown",innerHTML:e.renderMarkdown(v.text)},null,8,Uv)):(k(),_("pre",{key:1,style:u},A(v.text),1))]))),128)),i.value?(k(),_("p",Fv,A(i.value),1)):K("",!0)]))}};function Hv(e,t,n){const i=new Array(e);return new Proxy(i,{get(o,a,c){if(typeof a=="string"){const u=a.charCodeAt(0);if(u>=48&&u<=57){const f=+a;if(Number.isInteger(f)&&f>=0&&f<e){let m=o[f];if(!m){const h=t[f*2];m=o[f]={index:f,key:n(f),start:h,size:t[f*2+1],end:h+t[f*2+1],lane:0}}return m}}if(a==="length")return e}return Reflect.get(o,a,c)}})}function Ts(e,t,n){let i=n.initialDeps??[],o,a=!0;function c(){const u=e();return(u.length!==i.length||u.some((m,h)=>i[h]!==m))&&(i=u,o=t(...u),n!=null&&n.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(o),a=!1),o}return c.updateDeps=u=>{i=u},c}function Ud(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const jv=(e,t)=>Math.abs(e-t)<1.01,Wv=(e,t,n)=>{let i;return Object.assign(function(...o){e.clearTimeout(i),i=e.setTimeout(()=>t.apply(this,o),n)},{cancel:()=>{e.clearTimeout(i)}})};let yr;const za=()=>{if(yr!==void 0)return yr;if(typeof navigator>"u")return yr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return yr=!0;const e=navigator.maxTouchPoints;return yr=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Fd=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Kv=e=>e,Pg=e=>{const t=Math.max(e.startIndex-e.overscan,0),i=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(i);for(let a=0;a<i;a++)o[a]=t+a;return o},Gv=(e,t)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;const o=c=>{const{width:u,height:f}=c;t({width:Math.round(u),height:Math.round(f)})};if(o(Fd(n)),!i.ResizeObserver)return()=>{};const a=new i.ResizeObserver(c=>{const u=()=>{const f=c[0];if(f!=null&&f.borderBoxSize){const m=f.borderBoxSize[0];if(m){o({width:m.inlineSize,height:m.blockSize});return}}o(Fd(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},bo={passive:!0},Vv=typeof window>"u"?!0:"onscrollend"in window,qv=(e,t,n)=>{const i=e.scrollElement;if(!i)return;const o=e.targetWindow;if(!o)return;const a=e.options.useScrollendEvent&&Vv;let c=0;const u=a?null:Wv(o,()=>t(c,!1),e.options.isScrollingResetDelay),f=y=>()=>{c=n(i),u==null||u(),t(c,y)},m=f(!0),h=f(!1);return i.addEventListener("scroll",m,bo),a&&i.addEventListener("scrollend",h,bo),()=>{i.removeEventListener("scroll",m),a&&i.removeEventListener("scrollend",h),u==null||u.cancel()}},Zv=(e,t)=>qv(e,t,n=>{const{horizontal:i,isRtl:o}=e.options;return i?n.scrollLeft*(o&&-1||1):n.scrollTop}),Qv=(e,t,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(e),o=n.options.getItemKey(i);return n.itemSizeCache.get(o)??n.options.estimateSize(i)}if(t!=null&&t.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const i=n.indexFromElement(e),o=n.options.getItemKey(i),a=n.itemSizeCache.get(o);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Yv=(e,{adjustments:t=0,behavior:n},i)=>{var o,a;(a=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||a.call(o,{[i.options.horizontal?"left":"top"]:e+t,behavior:n})},Jv=Yv;class Xv{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,i,o;return((o=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(a=>{const c=()=>{const u=a.target,f=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(const[m,h]of this.elementsCache)if(h===u){this.elementsCache.delete(m);break}return}this.isIndexInRange(f)&&this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(u,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),n=null},observe:o=>{var a;return(a=i())==null?void 0:a.observe(o,{box:"border-box"})},unobserve:o=>{var a;return(a=i())==null?void 0:a.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var i,o;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Kv,rangeExtractor:Pg,onChange:()=>{},measureElement:Qv,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const v in n){const C=n[v];C!==void 0&&(a[v]=C)}const c=this.options;let u=null,f=null,m=!1;if(c!==void 0&&c.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const v=c.count,C=a.count,S=this.getMeasurements(),N=v>0?((i=S[0])==null?void 0:i.key)??c.getItemKey(0):null,I=v>0?((o=S[v-1])==null?void 0:o.key)??c.getItemKey(v-1):null;if(C!==v||v>0&&C>0&&(a.getItemKey(0)!==N||a.getItemKey(C-1)!==I)){m=!0;const M=v>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;M&&(u=[M.key,this.getScrollOffset()-M.start]);const O=a.followOnAppend===!0?"auto":a.followOnAppend||null;O&&C>v&&this.isAtEnd(c.scrollEndThreshold)&&(v===0||a.getItemKey(C-1)!==I)&&(f=O)}}this.options=a,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,y=0;if(u&&this.scrollOffset!==null){const[v,C]=u,S=this.getMeasurements(),{count:N,getItemKey:I}=this.options;let L=0;for(;L<N&&I(L)!==v;)L++;if(L<N){const l=S[L];if(l){const M=Math.max(0,l.start+C);M!==this.scrollOffset&&(y=M-this.scrollOffset,this.scrollOffset=M,h=!0)}}}(h||f)&&(this.pendingScrollAnchor=[h?u[0]:null,h?u[1]:0,f,y])},this.notify=n=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,n)},this.maybeNotify=Ts(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,c)=>{if(c&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const u=this.getScrollOffset();this.scrollDirection=c?u===a?this.scrollDirection:u<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=c,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,c=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},u=()=>{this._iosTouching=!1,!(!za()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",c,bo),a.addEventListener("touchend",u,bo),this.unsubs.push(()=>{a.removeEventListener("touchstart",c),a.removeEventListener("touchend",u),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[a,c,u,f]=o;a!==null&&!u&&(za()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),u&&this.scrollToEnd({behavior:u})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;if(this._iosDeferredAdjustment<0&&n>=i-1){this._iosDeferredAdjustment=0;return}const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ts(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,i,o,a,c,u,f,m)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:o,getItemKey:a,enabled:c,lanes:u,laneAssignmentMode:f,gap:m}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=Ts(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:o,getItemKey:a,enabled:c,lanes:u,laneAssignmentMode:f,gap:m},h)=>{const y=this.itemSizeCache;if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const L of this.laneAssignments.keys())L>=n&&this.laneAssignments.delete(L);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(L=>{this.itemSizeCache.set(L.key,L.size)}));const v=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),u===1){const L=n*2;let l=this._flatMeasurements;if(!l||l.length<L){const H=new Float64Array(L);l&&v>0&&H.set(l.subarray(0,v*2)),l=H,this._flatMeasurements=l}let M;if(v===0)M=i+o;else{const H=v-1;M=l[H*2]+l[H*2+1]+m}for(let H=v;H<n;H++){const se=a(H),J=y.get(se),ie=typeof J=="number"?J:this.options.estimateSize(H);l[H*2]=M,l[H*2+1]=ie,M+=ie+m}const O=Hv(n,l,a);return this.measurementsCache=O,O}const C=this.measurementsCache.slice(0,v),S=new Array(u).fill(void 0),N=new Float64Array(u);let I=0;for(let L=0;L<v;L++){const l=C[L];l&&(S[l.lane]===void 0&&I++,S[l.lane]=L,N[l.lane]=l.end)}for(let L=v;L<n;L++){const l=a(L),M=this.laneAssignments.get(L);let O,H;const se=f==="estimate"||y.has(l);if(M!==void 0&&this.options.lanes>1){O=M;const ce=S[O],X=ce!==void 0?C[ce]:void 0;H=X?X.end+m:i+o}else if(I===u){let ce=0,X=N[0],U=S[0];for(let oe=1;oe<u;oe++){const fe=N[oe];(fe<X||fe===X&&S[oe]<U)&&(ce=oe,X=fe,U=S[oe])}O=ce,H=X+m,se&&this.laneAssignments.set(L,O)}else O=L%this.options.lanes,H=i+o,se&&this.laneAssignments.set(L,O);const J=y.get(l),ie=typeof J=="number"?J:this.options.estimateSize(L),Z=H+ie;C[L]={index:L,start:H,size:ie,end:Z,key:l,lane:O},S[O]===void 0&&I++,S[O]=L,N[O]=Z}return this.measurementsCache=C,C},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ts(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,o,a)=>n.length===0||i===0?(this.range=null,null):(this.range=t_(n,i,o,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ts(()=>{let n=null,i=null;const o=this.calculateRange();return o&&(n=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,o,a,c)=>a===null||c===null?[]:n({startIndex:a,endIndex:c,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,o=n.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),c=Math.max(0,o-a),u=Math.min(this.options.count-1,o+a);return n>=c&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,u)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(u))});return}const i=this.indexFromElement(n);if(!this.isIndexInRange(i))return;const o=this.options.getItemKey(i),a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var o,a;if(!this.isIndexInRange(n))return;let c,u,f;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)f=this.options.getItemKey(n),u=m[n*2],c=m[n*2+1];else{const v=this.measurementsCache[n];if(!v)return;f=v.key,u=v.start,c=v.size}const h=this.itemSizeCache.get(f)??c,y=i-h;if(y!==0){const v=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=v?this.getTotalSize():0,S=this.getScrollOffset()+this.scrollAdjustments,I=!this.itemSizeCache.has(f)?u<S:u+h<=S&&this.scrollDirection!=="backward",L=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:u,size:c,end:u+c,lane:0},y,this):I);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++;let l=!1;v?l=this.applyScrollAdjustment(this.getTotalSize()-C):L&&(l=this.applyScrollAdjustment(y)),this.notify(l)}},this.getVirtualItems=Ts(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const o=[];for(let a=0,c=n.length;a<c;a++){const u=n[a],f=i[u];o.push(f)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const o=this._flatMeasurements,a=this.options.lanes===1&&o!=null,c=$g(0,i.length-1,a?u=>o[u*2]:u=>Ud(i[u]).start,n);return Ud(i[c])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,o=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),c=this.getScrollOffset();i==="auto"&&(i=n>=c+a?"end":"start"),i==="center"?n+=(o-a)/2:i==="end"&&(n-=a);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),a=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(i==="auto")if(c.end>=a+o-this.options.scrollPaddingEnd)i="end";else if(c.start<=a+this.options.scrollPaddingStart)i="start";else return[a,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const u=i==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,i,c.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,i),c=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,i);if(!a)return;const[c,u]=a,f=this.now();this.scrollState={index:n,align:u,behavior:o,startedAt:f,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const o=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const a=i.length-1,c=this._flatMeasurements;c!=null?o=c[a*2]+c[a*2+1]:o=((n=i[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let c=i.length-1;for(;c>=0&&a.some(u=>u===null);){const u=i[c];a[u.lane]===null&&(a[u.lane]=u.end),c--}o=Math.max(...a.filter(u=>u!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const o of i)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:o})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:o,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:za()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,a=1,c=o!==this.scrollState.lastTargetOffset;if(!c&&jv(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,c){const u=this.getSize()||600,f=Math.abs(o-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&f>u;this.scrollState.lastTargetOffset=o,m||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const $g=(e,t,n,i)=>{for(;e<=t;){const o=(e+t)/2|0,a=n(o);if(a<i)e=o+1;else if(a>i)t=o-1;else return o}return e>0?e-1:0};function e_(e,t,n){let i=0;for(;i<=t;){const o=(i+t)/2|0,a=e[o*2];if(a<n)i=o+1;else if(a>n)t=o-1;else return o}return i>0?i-1:0}function t_(e,t,n,i,o){const a=e.length-1;if(e.length<=i)return{startIndex:0,endIndex:a};if(i===1&&o!==null){const m=e_(o,a,n);let h=m;const y=n+t;for(;h<a&&o[h*2]+o[h*2+1]<y;)h++;return{startIndex:m,endIndex:h}}let u=$g(0,a,m=>e[m].start,n),f=u;if(i===1)for(;f<a&&e[f].end<n+t;)f++;else if(i>1){const m=Array(i).fill(0);for(;f<a&&m.some(y=>y<n+t);){const y=e[f];m[y.lane]=y.end,f++}const h=Array(i).fill(n+t);for(;u>=0&&h.some(y=>y>=n);){const y=e[u];h[y.lane]=y.start,u--}u=Math.max(0,u-u%i),f=Math.min(a,f+(i-1-f%i))}return{startIndex:u,endIndex:f}}function n_(e){const t=new Xv(Mr(e)),n=Pb(t),i=t._didMount();return Je(()=>Mr(e).getScrollElement(),o=>{o&&t._willUpdate()},{immediate:!0}),Je(()=>Mr(e),o=>{t.setOptions({...o,onChange:(a,c)=>{var u;Wu(n),(u=o.onChange)==null||u.call(o,a,c)}}),t._willUpdate(),Wu(n)},{immediate:!0}),pb(i),n}function s_(e){return n_(pe(()=>({observeElementRect:Gv,observeElementOffset:Zv,scrollToFn:Jv,...Mr(e)})))}function r_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dg(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Dg(n)}),e}class zd{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Bg(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $n(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const o in i)n[o]=i[o]}),n}const i_="</span>",Hd=e=>!!e.scope,o_=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,o)=>`${i}${"_".repeat(o+1)}`)].join(" ")}return`${t}${e}`};class a_{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Bg(t)}openNode(t){if(!Hd(t))return;const n=o_(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Hd(t)&&(this.buffer+=i_)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const jd=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Yl{constructor(){this.rootNode=jd(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=jd({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Yl._collapse(n)}))}}class l_ extends Yl{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new a_(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function jr(e){return e?typeof e=="string"?e:e.source:null}function Ug(e){return hs("(?=",e,")")}function c_(e){return hs("(?:",e,")*")}function u_(e){return hs("(?:",e,")?")}function hs(...e){return e.map(n=>jr(n)).join("")}function d_(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Jl(...e){return"("+(d_(e).capture?"":"?:")+e.map(i=>jr(i)).join("|")+")"}function Fg(e){return new RegExp(e.toString()+"|").exec("").length-1}function f_(e,t){const n=e&&e.exec(t);return n&&n.index===0}const g_=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Xl(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const o=n;let a=jr(i),c="";for(;a.length>0;){const u=g_.exec(a);if(!u){c+=a;break}c+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+o):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(t)}const p_=/\b\B/,zg="[a-zA-Z]\\w*",ec="[a-zA-Z_]\\w*",Hg="\\b\\d+(\\.\\d+)?",jg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Wg="\\b(0b[01]+)",h_="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",m_=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=hs(t,/.*\b/,e.binary,/\b.*/)),$n({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},Wr={begin:"\\\\[\\s\\S]",relevance:0},b_={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Wr]},y_={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Wr]},k_={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Bo=function(e,t,n={}){const i=$n({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Jl("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:hs(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},v_=Bo("//","$"),__=Bo("/\\*","\\*/"),w_=Bo("#","$"),x_={scope:"number",begin:Hg,relevance:0},S_={scope:"number",begin:jg,relevance:0},E_={scope:"number",begin:Wg,relevance:0},T_={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Wr,{begin:/\[/,end:/\]/,relevance:0,contains:[Wr]}]},A_={scope:"title",begin:zg,relevance:0},C_={scope:"title",begin:ec,relevance:0},I_={begin:"\\.\\s*"+ec,relevance:0},M_=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Gi=Object.freeze({__proto__:null,APOS_STRING_MODE:b_,BACKSLASH_ESCAPE:Wr,BINARY_NUMBER_MODE:E_,BINARY_NUMBER_RE:Wg,COMMENT:Bo,C_BLOCK_COMMENT_MODE:__,C_LINE_COMMENT_MODE:v_,C_NUMBER_MODE:S_,C_NUMBER_RE:jg,END_SAME_AS_BEGIN:M_,HASH_COMMENT_MODE:w_,IDENT_RE:zg,MATCH_NOTHING_RE:p_,METHOD_GUARD:I_,NUMBER_MODE:x_,NUMBER_RE:Hg,PHRASAL_WORDS_MODE:k_,QUOTE_STRING_MODE:y_,REGEXP_MODE:T_,RE_STARTERS_RE:h_,SHEBANG:m_,TITLE_MODE:A_,UNDERSCORE_IDENT_RE:ec,UNDERSCORE_TITLE_MODE:C_});function R_(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function N_(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function O_(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=R_,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function L_(e,t){Array.isArray(e.illegal)&&(e.illegal=Jl(...e.illegal))}function P_(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function $_(e,t){e.relevance===void 0&&(e.relevance=1)}const D_=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=hs(n.beforeMatch,Ug(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},B_=["of","and","for","in","not","or","if","then","parent","list","value"],U_="keyword";function Kg(e,t,n=U_){const i=Object.create(null);return typeof e=="string"?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach(function(a){Object.assign(i,Kg(e[a],t,a))}),i;function o(a,c){t&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const f=u.split("|");i[f[0]]=[a,F_(f[0],f[1])]})}}function F_(e,t){return t?Number(t):z_(e)?0:1}function z_(e){return B_.includes(e.toLowerCase())}const Wd={},ds=e=>{console.error(e)},Kd=(e,...t)=>{console.log(`WARN: ${e}`,...t)},As=(e,t)=>{Wd[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Wd[`${e}/${t}`]=!0)},yo=new Error;function Gg(e,t,{key:n}){let i=0;const o=e[n],a={},c={};for(let u=1;u<=t.length;u++)c[u+i]=o[u],a[u+i]=!0,i+=Fg(t[u-1]);e[n]=c,e[n]._emit=a,e[n]._multi=!0}function H_(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ds("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yo;if(typeof e.beginScope!="object"||e.beginScope===null)throw ds("beginScope must be object"),yo;Gg(e,e.begin,{key:"beginScope"}),e.begin=Xl(e.begin,{joinWith:""})}}function j_(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ds("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yo;if(typeof e.endScope!="object"||e.endScope===null)throw ds("endScope must be object"),yo;Gg(e,e.end,{key:"endScope"}),e.end=Xl(e.end,{joinWith:""})}}function W_(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function K_(e){W_(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),H_(e),j_(e)}function G_(e){function t(c,u){return new RegExp(jr(c),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,f){f.position=this.position++,this.matchIndexes[this.matchAt]=f,this.regexes.push([f,u]),this.matchAt+=Fg(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(f=>f[1]);this.matcherRe=t(Xl(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const f=this.matcherRe.exec(u);if(!f)return null;const m=f.findIndex((y,v)=>v>0&&y!==void 0),h=this.matchIndexes[m];return f.splice(0,m),Object.assign(f,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const f=new n;return this.rules.slice(u).forEach(([m,h])=>f.addRule(m,h)),f.compile(),this.multiRegexes[u]=f,f}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,f){this.rules.push([u,f]),f.type==="begin"&&this.count++}exec(u){const f=this.getMatcher(this.regexIndex);f.lastIndex=this.lastIndex;let m=f.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,m=h.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function o(c){const u=new i;return c.contains.forEach(f=>u.addRule(f.begin,{rule:f,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function a(c,u){const f=c;if(c.isCompiled)return f;[N_,P_,K_,D_].forEach(h=>h(c,u)),e.compilerExtensions.forEach(h=>h(c,u)),c.__beforeBegin=null,[O_,L_,$_].forEach(h=>h(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=Kg(c.keywords,e.case_insensitive)),f.keywordPatternRe=t(m,!0),u&&(c.begin||(c.begin=/\B|\b/),f.beginRe=t(f.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(f.endRe=t(f.end)),f.terminatorEnd=jr(f.end)||"",c.endsWithParent&&u.terminatorEnd&&(f.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(f.illegalRe=t(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(h){return V_(h==="self"?c:h)})),c.contains.forEach(function(h){a(h,f)}),c.starts&&a(c.starts,u),f.matcher=o(f),f}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=$n(e.classNameAliases||{}),a(e)}function Vg(e){return e?e.endsWithParent||Vg(e.starts):!1}function V_(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return $n(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Vg(e)?$n(e,{starts:e.starts?$n(e.starts):null}):Object.isFrozen(e)?$n(e):e}var q_="11.11.1";class Z_ extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Ha=Bg,Gd=$n,Vd=Symbol("nomatch"),Q_=7,qg=function(e){const t=Object.create(null),n=Object.create(null),i=[];let o=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:l_};function f(F){return u.noHighlightRe.test(F)}function m(F){let ee=F.className+" ";ee+=F.parentNode?F.parentNode.className:"";const Q=u.languageDetectRe.exec(ee);if(Q){const ye=ie(Q[1]);return ye||(Kd(a.replace("{}",Q[1])),Kd("Falling back to no-highlight mode for this block.",F)),ye?Q[1]:"no-highlight"}return ee.split(/\s+/).find(ye=>f(ye)||ie(ye))}function h(F,ee,Q){let ye="",ve="";typeof ee=="object"?(ye=F,Q=ee.ignoreIllegals,ve=ee.language):(As("10.7.0","highlight(lang, code, ...args) has been deprecated."),As("10.7.0",`Please use highlight(code, options) instead.
|
|
81
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),ve=F,ye=ee),Q===void 0&&(Q=!0);const Me={code:ye,language:ve};fe("before:highlight",Me);const Oe=Me.result?Me.result:y(Me.language,Me.code,Q);return Oe.code=Me.code,fe("after:highlight",Oe),Oe}function y(F,ee,Q,ye){const ve=Object.create(null);function Me(z,Y){return z.keywords[Y]}function Oe(){if(!B.keywords){V.addText($);return}let z=0;B.keywordPatternRe.lastIndex=0;let Y=B.keywordPatternRe.exec($),le="";for(;Y;){le+=$.substring(z,Y.index);const ke=j.case_insensitive?Y[0].toLowerCase():Y[0],Ie=Me(B,ke);if(Ie){const[Ze,pt]=Ie;if(V.addText(le),le="",ve[ke]=(ve[ke]||0)+1,ve[ke]<=Q_&&(he+=pt),Ze.startsWith("_"))le+=Y[0];else{const on=j.classNameAliases[Ze]||Ze;et(Y[0],on)}}else le+=Y[0];z=B.keywordPatternRe.lastIndex,Y=B.keywordPatternRe.exec($)}le+=$.substring(z),V.addText(le)}function Xe(){if($==="")return;let z=null;if(typeof B.subLanguage=="string"){if(!t[B.subLanguage]){V.addText($);return}z=y(B.subLanguage,$,!0,ne[B.subLanguage]),ne[B.subLanguage]=z._top}else z=C($,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(he+=z.relevance),V.__addSublanguage(z._emitter,z.language)}function Ye(){B.subLanguage!=null?Xe():Oe(),$=""}function et(z,Y){z!==""&&(V.startScope(Y),V.addText(z),V.endScope())}function ze(z,Y){let le=1;const ke=Y.length-1;for(;le<=ke;){if(!z._emit[le]){le++;continue}const Ie=j.classNameAliases[z[le]]||z[le],Ze=Y[le];Ie?et(Ze,Ie):($=Ze,Oe(),$=""),le++}}function Kt(z,Y){return z.scope&&typeof z.scope=="string"&&V.openNode(j.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(et($,j.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),$=""):z.beginScope._multi&&(ze(z.beginScope,Y),$="")),B=Object.create(z,{parent:{value:B}}),B}function It(z,Y,le){let ke=f_(z.endRe,le);if(ke){if(z["on:end"]){const Ie=new zd(z);z["on:end"](Y,Ie),Ie.isMatchIgnored&&(ke=!1)}if(ke){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return It(z.parent,Y,le)}function tt(z){return B.matcher.regexIndex===0?($+=z[0],1):(be=!0,0)}function wt(z){const Y=z[0],le=z.rule,ke=new zd(le),Ie=[le.__beforeBegin,le["on:begin"]];for(const Ze of Ie)if(Ze&&(Ze(z,ke),ke.isMatchIgnored))return tt(Y);return le.skip?$+=Y:(le.excludeBegin&&($+=Y),Ye(),!le.returnBegin&&!le.excludeBegin&&($=Y)),Kt(le,z),le.returnBegin?0:Y.length}function rn(z){const Y=z[0],le=ee.substring(z.index),ke=It(B,z,le);if(!ke)return Vd;const Ie=B;B.endScope&&B.endScope._wrap?(Ye(),et(Y,B.endScope._wrap)):B.endScope&&B.endScope._multi?(Ye(),ze(B.endScope,z)):Ie.skip?$+=Y:(Ie.returnEnd||Ie.excludeEnd||($+=Y),Ye(),Ie.excludeEnd&&($=Y));do B.scope&&V.closeNode(),!B.skip&&!B.subLanguage&&(he+=B.relevance),B=B.parent;while(B!==ke.parent);return ke.starts&&Kt(ke.starts,z),Ie.returnEnd?0:Y.length}function w(){const z=[];for(let Y=B;Y!==j;Y=Y.parent)Y.scope&&z.unshift(Y.scope);z.forEach(Y=>V.openNode(Y))}let T={};function D(z,Y){const le=Y&&Y[0];if($+=z,le==null)return Ye(),0;if(T.type==="begin"&&Y.type==="end"&&T.index===Y.index&&le===""){if($+=ee.slice(Y.index,Y.index+1),!o){const ke=new Error(`0 width match regex (${F})`);throw ke.languageName=F,ke.badRule=T.rule,ke}return 1}if(T=Y,Y.type==="begin")return wt(Y);if(Y.type==="illegal"&&!Q){const ke=new Error('Illegal lexeme "'+le+'" for mode "'+(B.scope||"<unnamed>")+'"');throw ke.mode=B,ke}else if(Y.type==="end"){const ke=rn(Y);if(ke!==Vd)return ke}if(Y.type==="illegal"&&le==="")return $+=`
|
|
82
|
-
`,1;if(ge>1e5&&ge>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return $+=le,le.length}const j=ie(F);if(!j)throw ds(a.replace("{}",F)),new Error('Unknown language: "'+F+'"');const W=G_(j);let G="",B=ye||W;const ne={},V=new u.__emitter(u);w();let $="",he=0,re=0,ge=0,be=!1;try{if(j.__emitTokens)j.__emitTokens(ee,V);else{for(B.matcher.considerAll();;){ge++,be?be=!1:B.matcher.considerAll(),B.matcher.lastIndex=re;const z=B.matcher.exec(ee);if(!z)break;const Y=ee.substring(re,z.index),le=D(Y,z);re=z.index+le}D(ee.substring(re))}return V.finalize(),G=V.toHTML(),{language:F,value:G,relevance:he,illegal:!1,_emitter:V,_top:B}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:F,value:Ha(ee),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:re,context:ee.slice(re-100,re+100),mode:z.mode,resultSoFar:G},_emitter:V};if(o)return{language:F,value:Ha(ee),illegal:!1,relevance:0,errorRaised:z,_emitter:V,_top:B};throw z}}function v(F){const ee={value:Ha(F),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return ee._emitter.addText(F),ee}function C(F,ee){ee=ee||u.languages||Object.keys(t);const Q=v(F),ye=ee.filter(ie).filter(ce).map(Ye=>y(Ye,F,!1));ye.unshift(Q);const ve=ye.sort((Ye,et)=>{if(Ye.relevance!==et.relevance)return et.relevance-Ye.relevance;if(Ye.language&&et.language){if(ie(Ye.language).supersetOf===et.language)return 1;if(ie(et.language).supersetOf===Ye.language)return-1}return 0}),[Me,Oe]=ve,Xe=Me;return Xe.secondBest=Oe,Xe}function S(F,ee,Q){const ye=ee&&n[ee]||Q;F.classList.add("hljs"),F.classList.add(`language-${ye}`)}function N(F){let ee=null;const Q=m(F);if(f(Q))return;if(fe("before:highlightElement",{el:F,language:Q}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),u.throwUnescapedHTML))throw new Z_("One of your code blocks includes unescaped HTML.",F.innerHTML);ee=F;const ye=ee.textContent,ve=Q?h(ye,{language:Q,ignoreIllegals:!0}):C(ye);F.innerHTML=ve.value,F.dataset.highlighted="yes",S(F,Q,ve.language),F.result={language:ve.language,re:ve.relevance,relevance:ve.relevance},ve.secondBest&&(F.secondBest={language:ve.secondBest.language,relevance:ve.secondBest.relevance}),fe("after:highlightElement",{el:F,result:ve,text:ye})}function I(F){u=Gd(u,F)}const L=()=>{O(),As("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function l(){O(),As("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let M=!1;function O(){function F(){O()}if(document.readyState==="loading"){M||window.addEventListener("DOMContentLoaded",F,!1),M=!0;return}document.querySelectorAll(u.cssSelector).forEach(N)}function H(F,ee){let Q=null;try{Q=ee(e)}catch(ye){if(ds("Language definition for '{}' could not be registered.".replace("{}",F)),o)ds(ye);else throw ye;Q=c}Q.name||(Q.name=F),t[F]=Q,Q.rawDefinition=ee.bind(null,e),Q.aliases&&Z(Q.aliases,{languageName:F})}function se(F){delete t[F];for(const ee of Object.keys(n))n[ee]===F&&delete n[ee]}function J(){return Object.keys(t)}function ie(F){return F=(F||"").toLowerCase(),t[F]||t[n[F]]}function Z(F,{languageName:ee}){typeof F=="string"&&(F=[F]),F.forEach(Q=>{n[Q.toLowerCase()]=ee})}function ce(F){const ee=ie(F);return ee&&!ee.disableAutodetect}function X(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=ee=>{F["before:highlightBlock"](Object.assign({block:ee.el},ee))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=ee=>{F["after:highlightBlock"](Object.assign({block:ee.el},ee))})}function U(F){X(F),i.push(F)}function oe(F){const ee=i.indexOf(F);ee!==-1&&i.splice(ee,1)}function fe(F,ee){const Q=F;i.forEach(function(ye){ye[Q]&&ye[Q](ee)})}function Ee(F){return As("10.7.0","highlightBlock will be removed entirely in v12.0"),As("10.7.0","Please use highlightElement now."),N(F)}Object.assign(e,{highlight:h,highlightAuto:C,highlightAll:O,highlightElement:N,highlightBlock:Ee,configure:I,initHighlighting:L,initHighlightingOnLoad:l,registerLanguage:H,unregisterLanguage:se,listLanguages:J,getLanguage:ie,registerAliases:Z,autoDetection:ce,inherit:Gd,addPlugin:U,removePlugin:oe}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=q_,e.regex={concat:hs,lookahead:Ug,either:Jl,optional:u_,anyNumberOfTimes:c_};for(const F in Gi)typeof Gi[F]=="object"&&Dg(Gi[F]);return Object.assign(e,Gi),e},zs=qg({});zs.newInstance=()=>qg({});var Y_=zs;zs.HighlightJS=zs;zs.default=zs;const Ve=r_(Y_),qd="[A-Za-z$_][0-9A-Za-z$_]*",J_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],X_=["true","false","null","undefined","NaN","Infinity"],Zg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Qg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ew=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tw=[].concat(Yg,Zg,Qg);function ja(e){const t=e.regex,n=(Q,{after:ye})=>{const ve="</"+Q[0].slice(1);return Q.input.indexOf(ve,ye)!==-1},i=qd,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,ye)=>{const ve=Q[0].length+Q.index,Me=Q.input[ve];if(Me==="<"||Me===","){ye.ignoreMatch();return}Me===">"&&(n(Q,{after:ve})||ye.ignoreMatch());let Oe;const Xe=Q.input.substring(ve);if(Oe=Xe.match(/^\s*=/)){ye.ignoreMatch();return}if((Oe=Xe.match(/^\s+extends\s+/))&&Oe.index===0){ye.ignoreMatch();return}}},u={$pattern:qd,keyword:J_,literal:X_,built_in:tw,"variable.language":ew},f="[0-9](_?[0-9])*",m=`\\.(${f})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${h})((${m})|\\.)?|(${m}))[eE][+-]?(${f})\\b`},{begin:`\\b(${h})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},l={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,S,N,I,{match:/\$\d+/},y];v.contains=M.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(M)});const O=[].concat(l,v.contains),H=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(O)}]),se={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H},J={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},ie={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Zg,...Qg]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[se],illegal:/%/},X={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(Q){return t.concat("(?!",Q.join("|"),")")}const oe={match:t.concat(/\b/,U([...Yg,"super","import"].map(Q=>`${Q}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},fe={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ee={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},se]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[se]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:ie},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,S,N,I,l,{match:/\$\d+/},y,ie,{scope:"attr",match:i+t.lookahead(":"),relevance:0},ee,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[l,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[se,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},fe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[se]},oe,X,J,Ee,{match:/\$[(.]/}]}}const ko="[A-Za-z$_][0-9A-Za-z$_]*",Jg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Xg=["true","false","null","undefined","NaN","Infinity"],ep=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],tp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],np=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rp=[].concat(np,ep,tp);function nw(e){const t=e.regex,n=(Q,{after:ye})=>{const ve="</"+Q[0].slice(1);return Q.input.indexOf(ve,ye)!==-1},i=ko,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,ye)=>{const ve=Q[0].length+Q.index,Me=Q.input[ve];if(Me==="<"||Me===","){ye.ignoreMatch();return}Me===">"&&(n(Q,{after:ve})||ye.ignoreMatch());let Oe;const Xe=Q.input.substring(ve);if(Oe=Xe.match(/^\s*=/)){ye.ignoreMatch();return}if((Oe=Xe.match(/^\s+extends\s+/))&&Oe.index===0){ye.ignoreMatch();return}}},u={$pattern:ko,keyword:Jg,literal:Xg,built_in:rp,"variable.language":sp},f="[0-9](_?[0-9])*",m=`\\.(${f})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${h})((${m})|\\.)?|(${m}))[eE][+-]?(${f})\\b`},{begin:`\\b(${h})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},l={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,S,N,I,{match:/\$\d+/},y];v.contains=M.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(M)});const O=[].concat(l,v.contains),H=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(O)}]),se={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H},J={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},ie={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ep,...tp]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[se],illegal:/%/},X={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(Q){return t.concat("(?!",Q.join("|"),")")}const oe={match:t.concat(/\b/,U([...np,"super","import"].map(Q=>`${Q}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},fe={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ee={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},se]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[se]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:ie},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,S,N,I,l,{match:/\$\d+/},y,ie,{scope:"attr",match:i+t.lookahead(":"),relevance:0},ee,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[l,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[se,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},fe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[se]},oe,X,J,Ee,{match:/\$[(.]/}]}}function Wa(e){const t=e.regex,n=nw(e),i=ko,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:ko,keyword:Jg.concat(f),literal:Xg,built_in:rp.concat(o),"variable.language":sp},h={className:"meta",begin:"@"+i},y=(N,I,L)=>{const l=N.contains.findIndex(M=>M.label===I);if(l===-1)throw new Error("can not find mode to replace");N.contains.splice(l,1,L)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(h);const v=n.contains.find(N=>N.scope==="attr"),C=Object.assign({},v,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,v,C]),n.contains=n.contains.concat([h,a,c,C]),y(n,"shebang",e.SHEBANG()),y(n,"use_strict",u);const S=n.contains.find(N=>N.label==="func.def");return S.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Zd(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f,h,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f,h,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,h,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,h,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",C=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,S=`\\b|${i.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${C}))[eE][+-]?(${v})[jJ]?(?=${S})`},{begin:`(${C})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${v})[jJ](?=${S})`}]},I={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},L={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",f,N,y,e.HASH_COMMENT_MODE]}]};return m.contains=[y,N,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[f,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,I,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[L]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,L,y]}]}}function Ka(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(u);const f={match:/\\"/},m={className:"string",begin:/'/,end:/'/},h={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],C=e.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],L={match:/(\/[a-z._-]+)+/},l=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],H=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:I,built_in:[...l,...M,"set","shopt",...O,...H]},contains:[C,e.SHEBANG(),S,y,a,c,L,u,f,m,h,n]}}function sw(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],o={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const rw=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),iw=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ow=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],aw=[...iw,...ow],lw=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),cw=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),uw=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),dw=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function fw(e){const t=e.regex,n=rw(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",a=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+cw.join("|")+")"},{begin:":(:)?("+uw.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+dw.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:lw.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+aw.join("|")+")\\b"}]}}function Ga(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(a,{begin:/\(/,end:/\)/}),u=e.inherit(e.APOS_STRING_MODE,{className:"string"}),f=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,f,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,f,u]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Qd(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(m,{contains:[]}),v=e.inherit(h,{contains:[]});m.contains.push(v),h.contains.push(y);let C=[n,f];return[m,h,y,v].forEach(L=>{L.contains=L.contains.concat(C)}),C=C.concat(m,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:C},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:C}]}]},n,a,m,h,{className:"quote",begin:"^>\\s+",contains:C,end:"$"},o,i,f,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Yd(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},u=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},C={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},S={begin:/\{/,end:/\}/,contains:[C],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[C],illegal:"\\n",relevance:0},I=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},v,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,N,a,c],L=[...I];return L.pop(),L.push(u),C.contains=L,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}function gw(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}const ip=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},pw=["disabled","aria-label","aria-expanded"],hw=["aria-label"],mw=["disabled","aria-selected","onClick"],bw={__name:"NeoSelect",props:{modelValue:{default:""},options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:"请选择"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,i=t,o=Ae(null),a=Ae(null),c=Ae(!1),u=`neo-select-${Math.random().toString(36).slice(2,10)}`,f=pe(()=>n.options.map((M,O)=>M&&typeof M=="object"&&!Array.isArray(M)?{value:Object.prototype.hasOwnProperty.call(M,"value")?M.value:M.label,label:String(M.label??M.value??""),disabled:M.disabled===!0,key:String(M.key??M.value??O)}:{value:M,label:String(M??""),disabled:!1,key:`${String(M)}-${O}`})),m=pe(()=>f.value.find(M=>Object.is(M.value,n.modelValue))),h=pe(()=>{var M;return((M=m.value)==null?void 0:M.label)||"请选择"});function y(){c.value=!1}async function v(M=!1){var J,ie;if(n.disabled||c.value)return;c.value=!0,await ct();const O=[...((J=a.value)==null?void 0:J.querySelectorAll("button:not(:disabled)"))||[]],se=((ie=a.value)==null?void 0:ie.querySelector('button[aria-selected="true"]'))||(M?O.at(-1):O[0]);se==null||se.focus()}function C(){c.value?y():v()}function S(M){M.disabled||(y(),Object.is(M.value,n.modelValue)||(i("update:modelValue",M.value),i("change",M.value)),ct(()=>{var O,H;return(H=(O=o.value)==null?void 0:O.querySelector(".neo-select-trigger"))==null?void 0:H.focus()}))}function N(M){(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),v(M.key==="ArrowUp")),M.key==="Escape"&&c.value&&(M.preventDefault(),M.stopPropagation(),y())}function I(M,O){var ie,Z;const H=[...((ie=a.value)==null?void 0:ie.querySelectorAll("button:not(:disabled)"))||[]];if(!H.length)return;const se=H.indexOf(document.activeElement),J=O==="start"?0:O==="end"?H.length-1:(se+O+H.length)%H.length;M.preventDefault(),(Z=H[J])==null||Z.focus()}function L(M){M.key==="ArrowDown"?I(M,1):M.key==="ArrowUp"?I(M,-1):M.key==="Home"?I(M,"start"):M.key==="End"?I(M,"end"):M.key==="Escape"?(M.preventDefault(),M.stopPropagation(),y(),ct(()=>{var O,H;return(H=(O=o.value)==null?void 0:O.querySelector(".neo-select-trigger"))==null?void 0:H.focus()})):M.key==="Tab"&&y()}function l(M){var O;c.value&&!((O=o.value)!=null&&O.contains(M.target))&&y()}return Vr(()=>document.addEventListener("pointerdown",l)),vn(()=>document.removeEventListener("pointerdown",l)),(M,O)=>(k(),_("span",{ref_key:"root",ref:o,class:me(["neo-select",{open:c.value,disabled:e.disabled}])},[d("button",{type:"button",class:"neo-select-trigger",disabled:e.disabled,"aria-label":e.ariaLabel,"aria-haspopup":"listbox","aria-expanded":c.value,"aria-controls":u,onClick:C,onKeydown:N},[d("span",null,A(h.value),1)],40,pw),c.value?(k(),_("span",{key:0,id:u,ref_key:"menu",ref:a,class:"neo-select-menu",role:"listbox","aria-label":e.ariaLabel,onKeydown:L},[(k(!0),_(de,null,Ce(f.value,H=>(k(),_("button",{key:H.key,type:"button",role:"option",disabled:H.disabled,class:me({selected:Object.is(H.value,e.modelValue)}),"aria-selected":Object.is(H.value,e.modelValue),onClick:se=>S(H)},A(H.label),11,mw))),128))],40,hw)):K("",!0)],2))}},Vi=ip(bw,[["__scopeId","data-v-edb5aaac"]]),yw=["aria-busy"],kw={class:"prompt-config-toolbar"},vw={class:"prompt-config-scope"},_w={class:"prompt-config-actions"},ww=["disabled"],xw=["disabled"],Sw=["disabled"],Ew={class:"prompt-config-mode"},Tw=["disabled"],Aw={key:0,value:"legacy_full_override"},Cw={class:"prompt-config-note"},Iw={key:0,class:"prompt-config-note",role:"status"},Mw={key:1,class:"runtime-context-empty",role:"status"},Rw=["disabled"],Nw={key:3,class:"prompt-config-preview"},Ow={key:4,class:"prompt-config-preview"},Lw={key:5,class:"prompt-config-error",role:"alert"},Pw={__name:"PromptConfigEditor",props:{endpoint:{type:String,required:!0},session:{type:Boolean,default:!1},runtimePrompt:{type:Object,default:void 0}},emits:["saved"],setup(e,{emit:t}){const n=e,i=t,o=Ae(""),a=Ae(""),c=Ae(""),u=Ae(!1),f=Ae("append"),m=Ae("append"),h=Ae(!1),y=Ae(""),v=Ae(!1),C=pe(()=>{var X;return(X=n.runtimePrompt)!=null&&X.sessionPrompt?n.runtimePrompt.sessionPrompt.deferred:v.value}),S=pe(()=>{var X,U;return((U=(X=n.runtimePrompt)==null?void 0:X.systemPrompt)==null?void 0:U.replace("__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",""))||y.value}),N=Ae(!1),I=Ae(!1),L=Ae(!1),l=Ae("");let M=0,O;const H=pe(()=>o.value!==a.value||n.session&&f.value!==m.value),se=pe(()=>L.value&&H.value&&!!o.value.trim()&&!N.value&&!I.value);function J(X,U){const oe=String((X==null?void 0:X.errorCode)||"");return oe.includes("CONFLICT")?"配置已更新,请重新加载":oe.includes("INVALID")?"提示词内容无效":oe.includes("TOO_LARGE")?"提示词内容过长":oe.includes("BUSY")?"配置忙碌,请稍后重试":U}function ie(X){if(typeof(X==null?void 0:X.content)!="string"||typeof(X==null?void 0:X.revision)!="string")throw new Error("invalid payload");o.value=X.content,a.value=X.content,c.value=X.revision,u.value=X.override===!0,f.value=X.mode==="inherit"?"append":X.mode||"append",m.value=f.value,h.value=f.value==="legacy_full_override",y.value=X.effectiveContent||"",v.value=X.deferred===!0,L.value=!0}async function Z(){if(I.value)return;O==null||O.abort(),O=new AbortController;const X=++M,U=n.endpoint;N.value=!0,l.value="";try{const oe=await fetch(U,{cache:"no-store",signal:O.signal}),fe=await oe.json();if(X!==M||U!==n.endpoint)return;if(!oe.ok||(fe==null?void 0:fe.ok)===!1||fe!=null&&fe.error){l.value=J(fe,"加载失败");return}ie(fe)}catch(oe){X===M&&(oe==null?void 0:oe.name)!=="AbortError"&&(l.value="加载失败")}finally{X===M&&(N.value=!1)}}async function ce(X=!1){if(I.value||N.value||!L.value||!X&&!se.value||!X&&h.value&&f.value!=="legacy_full_override"&&!window.confirm("转换后将重新合成全局和工具上下文。请确认编辑框只保留你需要的自定义指令,避免重复注入旧内容。"))return;const U=M,oe=n.endpoint;I.value=!0,l.value="";try{const fe=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X?{reset:!0,revision:c.value}:{content:o.value,revision:c.value,...n.session?{mode:f.value}:{}}),signal:O==null?void 0:O.signal}),Ee=await fe.json();if(U!==M||oe!==n.endpoint)return;if(!fe.ok||(Ee==null?void 0:Ee.ok)===!1||Ee!=null&&Ee.error){l.value=J(Ee,"保存失败");return}ie(Ee),i("saved",Ee)}catch(fe){U===M&&(fe==null?void 0:fe.name)!=="AbortError"&&(l.value="保存失败")}finally{U===M&&(I.value=!1)}}return Je(()=>n.endpoint,()=>{M+=1,O==null||O.abort(),o.value="",a.value="",c.value="",L.value=!1,I.value=!1,u.value=!1,f.value=m.value="append",h.value=!1,y.value="",v.value=!1,Z()},{immediate:!0}),vn(()=>{M+=1,O==null||O.abort()}),(X,U)=>{var oe,fe;return k(),_("form",{class:"prompt-config-editor","aria-busy":N.value||I.value,onSubmit:U[5]||(U[5]=je(Ee=>ce(),["prevent"]))},[d("div",kw,[d("span",vw,A(e.session?"当前会话":"系统提示词"),1),d("div",_w,[d("button",{type:"button",class:"mini-button",disabled:N.value||I.value,onClick:Z},"重新加载",8,ww),e.session?(k(),_("button",{key:0,type:"button",class:"mini-button",disabled:!L.value||!u.value||N.value||I.value,onClick:U[0]||(U[0]=Ee=>ce(!0))},"恢复默认",8,xw)):K("",!0),d("button",{type:"submit",class:"primary",disabled:!se.value},A(I.value?"保存中":"保存"),9,Sw)])]),e.session&&L.value?(k(),_(de,{key:0},[d("label",Ew,[U[8]||(U[8]=Ns("会话指令模式 ",-1)),ot(d("select",{"onUpdate:modelValue":U[1]||(U[1]=Ee=>f.value=Ee),"aria-label":"会话指令模式",disabled:N.value||I.value},[U[6]||(U[6]=d("option",{value:"append"},"继承全局并追加",-1)),U[7]||(U[7]=d("option",{value:"replace_base"},"仅替换全局正文(保留工具和插件上下文)",-1)),h.value?(k(),_("option",Aw,"旧版完整覆盖(不继承)")):K("",!0)],8,Tw),[[vg,f.value]])]),d("p",Cw,A(u.value?"已配置会话指令":"当前继承全局;下方仅编辑会话追加指令")+"。工具开关只更新运行时能力说明,不改写自定义文本。",1),h.value?(k(),_("p",Iw,"旧版完整覆盖保留了原文,可能包含过期的工具说明。请手动保留自定义指令并切换模式,或恢复默认;不会自动删改旧内容。")):K("",!0)],64)):K("",!0),N.value&&!L.value?(k(),_("div",Mw,"加载中")):ot((k(),_("textarea",{key:2,"onUpdate:modelValue":U[2]||(U[2]=Ee=>o.value=Ee),class:"prompt-config-textarea","aria-label":"系统提示词",disabled:!L.value||N.value||I.value,spellcheck:"false",autocomplete:"off",rows:"18",onKeydown:[U[3]||(U[3]=is(je(Ee=>ce(),["ctrl","prevent"]),["enter"])),U[4]||(U[4]=is(je(Ee=>ce(),["meta","prevent"]),["enter"]))]},null,40,Rw)),[[Tt,o.value]]),e.session&&L.value?(k(),_("details",Nw,[d("summary",null,"当前有效上下文(只读)"+A((fe=(oe=e.runtimePrompt)==null?void 0:oe.sessionPrompt)!=null&&fe.deferred?" · 有待生效修改":""),1),d("pre",null,A(S.value),1)])):K("",!0),e.session&&C.value?(k(),_("details",Ow,[U[9]||(U[9]=d("summary",null,"已保存配置的合成预览(下一轮生效)",-1)),d("pre",null,A(y.value),1)])):K("",!0),l.value?(k(),_("div",Lw,A(l.value),1)):K("",!0)],40,yw)}}},Jd=ip(Pw,[["__scopeId","data-v-7f1ad447"]]),vo=1,_l=2,tc=3,nc=4,sc=5,rc=6,ic=7,oc=8,_o=9,wo=10,wl=11,so=12,xr=13,Sr=14,Er=15,Tr=16,Rs=17,xl=18,Et=19,Pr=20,Ln=21,op=22,$r=23,xo=24,Ws=25,ap=26,Sl=27,ro=28,io=29,un=30,Yt=31,qi=101,Xd=102,lp=103,ef=104,Va=105,Ds=1,ac=2,cp=4,up=8,dp=16;function $w(e){switch(e){case Ds:return"href";case ac:return"src";case cp:return"class";case up:return"checked";case dp:return"start"}}const Dw=e=>{switch(e){case 1:return tc;case 2:return nc;case 3:return sc;case 4:return rc;case 5:return ic;default:return oc}},Bw=Dw,tf=24;function Uw(e){const t=new Uint32Array(tf);return t[0]=vo,{renderer:e,text:"",pending:"",tokens:t,len:0,token:vo,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(tf),indent:"",indent_len:0,table_state:0}}function nf(e){e.pending.length>0&&it(e,`
|
|
83
|
-
`)}function Pe(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function Qe(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function De(e,t){(e.tokens[e.len]===xo||e.tokens[e.len]===$r)&&t!==Ws&&Qe(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function Fw(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function as(e,t){for(e.fence_start=0;e.len>t;)Qe(e)}function Zi(e,t){let n=0;for(let i=0;i<=e.len&&(t-=e.spaces[i],!(t<0));i+=1)switch(e.tokens[i]){case _o:case wo:case Pr:case Ws:n=i;break}for(;e.len>n;)Qe(e);return t}function qa(e,t){let n=-1,i=-1;for(let o=e.blockquote_idx+1;o<=e.len;o+=1)if(e.tokens[o]===Ws){if(e.indent_len<e.spaces[o]){i=-1;break}i=o}else e.tokens[o]===t&&(n=o);return i===-1?n===-1?(as(e,e.blockquote_idx),De(e,t),!0):(as(e,n),!1):(as(e,i),De(e,t),!0)}function Za(e,t){De(e,Ws),e.spaces[e.len]=e.indent_len+t,dn(e),e.token=lp}function dn(e){e.indent="",e.indent_len=0,e.pending=""}function El(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function zw(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function Hw(e){return El(e)||zw(e)}function it(e,t){for(const n of t){if(e.token===qi){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let o=Zi(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&it(e," ".repeat(o))}const i=e.pending+n;switch(e.token){case Ln:case vo:case Pr:case xo:case $r:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
|
|
84
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===Ws&&e.token===Ln){Qe(e),dn(e),e.pending=n;continue}as(e,e.blockquote_idx),dn(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=i;continue}break;case" ":Zi(e,e.indent_len),De(e,Bw(e.pending.length)),dn(e);continue}break;case">":{const a=Fw(e,Pr,e.blockquote_idx+1);a===-1?(as(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,De(e,Pr)):e.blockquote_idx=a,dn(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=i;continue;case" ":e.pending=i;continue;case`
|
|
85
|
-
`:if(e.hr_chars<3)break;Zi(e,e.indent_len),e.renderer.add_token(e.renderer.data,op),e.renderer.end_token(e.renderer.data),dn(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){qa(e,$r),Za(e,2),it(e,i.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=i,e.fence_start=i.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=i,e.fence_start=i.length):(De(e,_l),dn(e),e.fence_start=0,it(e,i));continue;case`
|
|
86
|
-
`:{Zi(e,e.indent_len),De(e,wo),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,cp,e.pending.slice(e.fence_start)),dn(e),e.token=qi;continue}default:e.pending=i;continue}case"+":if(n!==" ")break;qa(e,$r),Za(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;qa(e,xo)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,dp,e.pending.slice(0,-1)),Za(e,e.pending.length+1);continue}else{const a=n.charCodeAt(0);if(a===46||El(a)){e.pending=i;continue}}break;case"|":as(e,e.blockquote_idx),De(e,Sl),De(e,ro),e.pending="",it(e,n);continue}let o=i;if(e.token===Ln)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,Ln),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let a=0;for(;a<4;a+=1)if(e.indent[a]===" "){a=a+1;break}o=e.indent.slice(a)+i,De(e,_o)}else De(e,_l);dn(e),it(e,o);continue;case Sl:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=i;continue;case`
|
|
87
|
-
`:e.table_state=2,e.pending="";continue;default:Qe(e),e.table_state=0;break}else switch(e.pending){case"|":De(e,ro),e.pending="",it(e,n);continue;case`
|
|
88
|
-
`:Qe(e),e.pending="",e.table_state=0,it(e,n);continue}break;case ro:switch(e.pending){case"":break;case"|":De(e,io),Qe(e),e.pending="",it(e,n);continue;case`
|
|
89
|
-
`:Qe(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",it(e,n);continue;default:De(e,io),it(e,n);continue}break;case io:if(e.pending==="|"){Pe(e),Qe(e),e.pending="",it(e,n);continue}break;case _o:switch(i){case`
|
|
90
|
-
`:case`
|
|
91
|
-
`:case`
|
|
92
|
-
`:case`
|
|
93
|
-
`:case`
|
|
94
|
-
`:e.text+=`
|
|
95
|
-
`,e.pending="";continue;case`
|
|
96
|
-
`:case`
|
|
97
|
-
`:case`
|
|
98
|
-
`:case`
|
|
99
|
-
`:e.pending=i;continue;default:e.pending.length!==0?(Pe(e),Qe(e),e.pending=n):e.text+=n;continue}case wo:switch(n){case"`":e.pending=i;continue;case`
|
|
100
|
-
`:if(i.length===e.fence_start+e.fence_end+1){Pe(e),Qe(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=qi;continue}e.token=qi;break;case" ":if(e.pending[0]===`
|
|
101
|
-
`){e.pending=i,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case wl:switch(n){case"`":i.length===e.fence_start+ +(e.pending[0]===" ")?(Pe(e),Qe(e),e.pending="",e.fence_start=0):e.pending=i;continue;case`
|
|
102
|
-
`:e.text+=e.pending,e.pending="",e.token=Ln,e.blockquote_idx=0,Pe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=i,e.pending="";continue}case lp:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=i;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=i;continue;case 2:if(n!=="]")break;e.pending=i;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,ap),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,up,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",it(e,i);continue;case Sr:case Er:{let a="*",c=so;if(e.token===Er&&(a="_",c=xr),a===e.pending){if(Pe(e),a===n){Qe(e),e.pending="";continue}De(e,c),e.pending=n;continue}break}case so:case xr:{let a="*",c=Sr;switch(e.token===xr&&(a="_",c=Er),e.pending){case a:a===n?e.tokens[e.len-1]===c?e.pending=i:(Pe(e),De(e,c),e.pending=""):(Pe(e),Qe(e),e.pending=n);continue;case a+a:const u=e.token;Pe(e),Qe(e),Qe(e),a!==n?(De(e,u),e.pending=n):e.pending="";continue}break}case Tr:if(i==="~~"){Pe(e),Qe(e),e.pending="";continue}break;case Va:n===`
|
|
103
|
-
`?(Pe(e),De(e,un),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",it(e,n));continue;case un:if(i==="\\]"||i==="$$"){Pe(e),Qe(e),e.pending="";continue}break;case Yt:if(i==="\\)"||e.pending[0]==="$"){Pe(e),Qe(e),n===")"?e.pending="":e.pending=n;continue}break;case Xd:i==="http://"||i==="https://"?(Pe(e),De(e,xl),e.pending=i,e.text=i):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=i:(e.token=e.tokens[e.len],it(e,n));continue;case Rs:case Et:if(e.pending==="]"){Pe(e),n==="("?e.pending=i:(Qe(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){const a=e.token===Rs?Ds:ac,c=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,a,c),Qe(e),e.pending=""}else e.pending+=n;continue}break;case xl:n===" "||n===`
|
|
104
|
-
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Ds,e.pending),Pe(e),Qe(e),e.pending=n):(e.text+=n,e.pending=i);continue;case ef:if(i.startsWith("<br")){if(i.length===3||n===" "||n==="/"&&(i.length===4||e.pending[e.pending.length-1]===" ")){e.pending=i;continue}if(n===">"){Pe(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,Ln),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),it(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===Et||e.token===un||e.token===Yt)break;switch(n){case"(":Pe(e),De(e,Yt),e.pending="";continue;case"[":e.token=Va,e.pending=i;continue;case`
|
|
105
|
-
`:e.pending=n;continue;default:let o=n.charCodeAt(0);e.pending="",e.text+=El(o)||o>=65&&o<=90||o>=97&&o<=122?i:n;continue}case`
|
|
106
|
-
`:switch(e.token){case Et:case un:case Yt:break;case tc:case nc:case sc:case rc:case ic:case oc:Pe(e),as(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:Pe(e),e.pending=n,e.token=Ln,e.blockquote_idx=0;continue}break;case"<":if(e.token!==Et&&e.token!==un&&e.token!==Yt){Pe(e),e.pending=i,e.token=ef;continue}break;case"`":if(e.token===Et)break;n==="`"?(e.fence_start+=1,e.pending=i):(e.fence_start+=1,Pe(e),De(e,wl),e.text=n===" "||n===`
|
|
107
|
-
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===Et||e.token===un||e.token===Yt||e.token===Sr)break;let o=so,a=Sr;const c=e.pending[0];if(c==="_"&&(o=xr,a=Er),e.pending.length===1){if(c===n){e.pending=i;continue}if(n!==" "&&n!==`
|
|
108
|
-
`){Pe(e),De(e,o),e.pending=n;continue}}else{if(c===n){Pe(e),De(e,a),De(e,o),e.pending="";continue}if(n!==" "&&n!==`
|
|
109
|
-
`){Pe(e),De(e,a),e.pending=n;continue}}break}case"~":if(e.token!==Et&&e.token!==Tr){if(e.pending==="~"){if(n==="~"){e.pending=i;continue}}else if(n!==" "&&n!==`
|
|
110
|
-
`){Pe(e),De(e,Tr),e.pending=n;continue}}break;case"$":if(e.token!==Et&&e.token!==Tr&&e.pending==="$")if(n==="$"){e.token=Va,e.pending=i;continue}else{if(Hw(n.charCodeAt(0)))break;Pe(e),De(e,Yt),e.pending=n;continue}break;case"[":if(e.token!==Et&&e.token!==Rs&&e.token!==un&&e.token!==Yt&&n!=="]"){Pe(e),De(e,Rs),e.pending=n;continue}break;case"!":if(e.token!==Et&&n==="["){Pe(e),De(e,Et),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==Et&&e.token!==Rs&&e.token!==un&&e.token!==Yt&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=Xd;continue}e.text+=e.pending,e.pending=n}Pe(e)}function jw(e){return{add_token:Ww,end_token:Kw,add_text:Gw,set_attr:fp,data:{nodes:[e,,,,,],index:0}}}function Ww(e,t){var o;let n=e.nodes[e.index],i;switch(t){case vo:return;case Pr:i=document.createElement("blockquote");break;case _l:i=document.createElement("p");break;case Ln:i=document.createElement("br");break;case op:i=document.createElement("hr");break;case tc:i=document.createElement("h1");break;case nc:i=document.createElement("h2");break;case sc:i=document.createElement("h3");break;case rc:i=document.createElement("h4");break;case ic:i=document.createElement("h5");break;case oc:i=document.createElement("h6");break;case so:case xr:i=document.createElement("em");break;case Sr:case Er:i=document.createElement("strong");break;case Tr:i=document.createElement("s");break;case wl:i=document.createElement("code");break;case xl:case Rs:i=document.createElement("a");break;case Et:i=document.createElement("img");break;case $r:i=document.createElement("ul");break;case xo:i=document.createElement("ol");break;case Ws:i=document.createElement("li");break;case ap:let a=i=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case _o:case wo:n=n.appendChild(document.createElement("pre")),i=document.createElement("code");break;case Sl:i=document.createElement("table");break;case ro:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}i=document.createElement("tr");break;case io:i=document.createElement(((o=n.parentElement)==null?void 0:o.tagName)==="THEAD"?"th":"td");break;case un:i=document.createElement("equation-block");break;case Yt:i=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(i)}function Kw(e){e.index-=1}function Gw(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function fp(e,t,n){e.nodes[e.index].setAttribute($w(t),n)}const Vw={__name:"StreamingMarkdown",props:{text:{type:String,default:""},exposedResources:{type:Array,default:()=>[]}},setup(e){const t=e,n=Ae(null);let i,o="",a="",c;function u(){c&&clearTimeout(c),c=void 0}function f(){u(),c=setTimeout(()=>{c=void 0,i!=null&&i.pending&&o&&S(`${o}
|
|
111
|
-
`,o)},80)}function m(N){const I=String(N||"").trim();return I?/^(?:https?:|mailto:|\/|#)/i.test(I)?!0:!/^[a-z][a-z\d+.-]*:/i.test(I):!1}function h(N){const I=String(N||"").trim();return t.exposedResources.find(L=>String((L==null?void 0:L.reference)||"").trim()===I)}function y(N){const I=Number(N);if(!Number.isFinite(I)||I<=0)return"";const L=["B","KB","MB","GB"];let l=I,M=0;for(;l>=1024&&M<L.length-1;)l/=1024,M+=1;return`${l>=10||M===0?Math.round(l):l.toFixed(1)}${L[M]}`}function v(N){return{...jw(N),set_attr(L,l,M){const O=l===Ds?h(M):void 0,H=(O==null?void 0:O.url)||M;if(!((l===Ds||l===ac)&&!m(H))&&(fp(L,l,H),l===Ds)){const se=L.nodes[L.index];if(O){if(se.classList.add("inline-resource-link",`inline-resource-${O.kind||"link"}`),O.kind==="download"||O.downloadName){se.setAttribute("download",O.downloadName||O.label||""),se.setAttribute("title",`下载 ${O.label||O.downloadName||"资源"}`),se.removeAttribute("target"),se.removeAttribute("rel"),se.dataset.resourceDownload="true",se.dataset.resourceExpiresAt=String(Number(O.expiresAt)||0);const J=y(O.sizeBytes);J&&(se.dataset.resourceSize=`(${J})`)}}else se.setAttribute("target","_blank"),se.setAttribute("rel","noreferrer noopener")}}}}function C(N){if(!i)return;const I=String(N||"");if(u(),!I.startsWith(o)||a!==o){S(I),f();return}const L=I.slice(o.length);o=I,a=I,L&&it(i,L),f()}function S(N=t.text,I=N){const L=n.value;L&&(i&&nf(i),L.replaceChildren(),i=Uw(v(L)),a=String(N||""),o=String(I||""),a&&it(i,a))}return Vr(()=>{S(),f()}),Je(()=>t.text,C,{flush:"post"}),Je(()=>t.exposedResources,()=>S(),{deep:!0,flush:"post"}),vn(()=>{u(),i&&nf(i),i=void 0}),(N,I)=>(k(),_("div",{ref_key:"root",ref:n,class:"streaming-markdown-content"},null,512))}},qw=["onDblclick"],Zw=["aria-label","onClick"],Qw=["title","onClick"],Yw=["aria-label","onClick"],Jw=Object.assign({name:"CwdTreeNode"},{__name:"CwdTreeNode",props:{nodes:{type:Array,default:()=>[]},children:{type:Object,default:()=>({})},expanded:{type:Object,default:()=>({})},selectedPath:{type:String,default:""},level:{type:Number,default:0},allowDelete:{type:Boolean,default:!0}},emits:["toggle","select","delete"],setup(e,{emit:t}){const n=t;return(i,o)=>{const a=fy("CwdTreeNode",!0);return k(!0),_(de,null,Ce(e.nodes,c=>(k(),_("div",{key:c.path,class:"cwd-tree-branch"},[d("div",{class:me(["cwd-tree-row",{selected:e.selectedPath===c.path}]),style:Ot({"--cwd-tree-level":e.level}),onDblclick:u=>n("toggle",c)},[d("button",{type:"button",class:"cwd-tree-toggle","aria-label":e.expanded[c.path]?"收起":"展开",onClick:je(u=>n("toggle",c),["stop"])},A(e.expanded[c.path]?"▾":"▸"),9,Zw),d("button",{type:"button",class:"cwd-tree-name",title:c.path,onClick:u=>n("select",c)},[o[3]||(o[3]=d("span",{"aria-hidden":"true"},"◇",-1)),d("strong",null,A(c.name),1)],8,Qw),e.allowDelete?(k(),_("button",{key:0,type:"button",class:"cwd-tree-delete","aria-label":`删除 ${c.name}`,onClick:je(u=>n("delete",c),["stop"])},"×",8,Yw)):K("",!0)],46,qw),e.expanded[c.path]&&e.children[c.path]?(k(),rt(a,{key:0,nodes:e.children[c.path],children:e.children,expanded:e.expanded,"selected-path":e.selectedPath,level:e.level+1,onToggle:o[0]||(o[0]=u=>n("toggle",u)),onSelect:o[1]||(o[1]=u=>n("select",u)),onDelete:o[2]||(o[2]=u=>n("delete",u))},null,8,["nodes","children","expanded","selected-path","level"])):K("",!0)]))),128)}}});function Xw(e,t=Date.now()){const n=typeof(e==null?void 0:e.startedAt)=="string"?Date.parse(e.startedAt):NaN;if(!Number.isSafeInteger(n)||n<0)return;if(e.status==="running"){const o=t-n;return Number.isSafeInteger(o)&&o>=0?o:void 0}if(!["completed","failed","killed"].includes(e.status))return;const i=typeof e.completedAt=="string"?Date.parse(e.completedAt):NaN;return Number.isSafeInteger(i)&&i>=n&&Number.isSafeInteger(e.durationMs)&&e.durationMs>=0&&e.durationMs===i-n?e.durationMs:void 0}function e0(e){return e!=null&&e.live?{key:"running",label:"执行中"}:(e==null?void 0:e.titleStatus)==="failure"||(e==null?void 0:e.titleStatus)==="failed"||(e==null?void 0:e.kind)==="error"||e!=null&&e.toolError?{key:"failed",label:"失败"}:(e==null?void 0:e.titleStatus)==="success"?{key:"completed",label:"完成"}:{key:"unknown",label:"未提供"}}function t0(e,t){const n=String(e||"").trim();if(!n)return"模型未配置";const i=String(t||"").trim();return i?`${n}(${i})`:n}function n0({maxEntries:e=64,timeoutMs:t=15e3,createImage:n,fetchOriginal:i=n?null:(o,a)=>fetch(o,{cache:"no-store",signal:a})}={}){if(n||(n=()=>new Image),!Number.isInteger(e)||e<1||e>512)throw new RangeError("maxEntries must be 1..512");if(!Number.isFinite(t)||t<1)throw new RangeError("timeoutMs must be positive");const o=new Map;let a="";const c=(v,C)=>JSON.stringify([v,C]);function u(v){const C=o.get(v);o.delete(v),C==null||C.cancel()}function f(){for(const v of o.keys())u(v)}function m(v){v!==a&&(f(),a=v)}function h(v){u(c(a,v))}function y({sessionId:v,originalUrl:C,available:S=!0}){const N={sessionId:v,originalUrl:C},I=U=>Object.freeze({...N,state:U});if(!v||v!==a)return Promise.resolve(I("stale"));const L=c(v,C);if(S===!1)return u(L),Promise.resolve(I("unavailable"));if(typeof C!="string"||!C.trim())return Promise.resolve(I("unknown"));const l=o.get(L);if(l)return o.delete(L),o.set(L,l),l.promise;for(;o.size>=e;)u(o.keys().next().value);let M,O,H,se=!1,J;const ie=new AbortController,Z=new Promise(U=>{J=U}),ce=U=>{se||(se=!0,clearTimeout(O),ie.abort(),H&&URL.revokeObjectURL(H),J(Object.freeze(U)))},X={promise:Z,cancel:()=>{ce(I("stale")),M&&(M.src="")}};return o.set(L,X),O=setTimeout(()=>{ce(I("unknown")),M&&(M.src="")},t),(async()=>{try{let U=C;if(i&&!/^(data:|blob:)/i.test(C)){const Ee=await i(C,ie.signal);if(!Ee.ok)throw new Error("Original unavailable");const F=await Ee.blob();if(se)return;U=H=URL.createObjectURL(F)}if(se)return;M=n(),M.src=U,await M.decode();const oe=M.naturalWidth,fe=M.naturalHeight;Number.isInteger(oe)&&oe>0&&Number.isInteger(fe)&&fe>0?ce({...N,state:"actual",width:oe,height:fe,source:"original-decode"}):ce(I("unknown"))}catch{ce(I("unknown"))}})(),Z}return{setSession:m,load:y,invalidate:h,clear:f,get size(){return o.size}}}function Qa(e,t){const n=typeof e=="string"&&/^(\d+)x(\d+)$/.exec(e),i=(t==null?void 0:t.state)==="actual"&&Number.isInteger(t.width)&&t.width>0&&Number.isInteger(t.height)&&t.height>0;return{requested:e==="auto"?"auto(自动策略)":typeof e=="string"&&e?e:"未提供",actual:i?`${t.width} × ${t.height}`:(t==null?void 0:t.state)==="unavailable"?"不可获取":"未知",mismatch:!!(i&&n&&(+n[1]!==t.width||+n[2]!==t.height))}}const s0={class:"shell"},r0={class:"sidebar"},i0={class:"brand-row logo-only"},o0=["aria-label","aria-pressed","title"],a0={class:"nav"},l0=["title"],c0={class:"session-entry-main"},u0={key:0,"aria-hidden":"true"},d0={class:"sidebar-card prompt-stack"},f0={class:"prompt-stack-head"},g0={class:"prompt-list"},p0={key:0,class:"prompt-list-empty"},h0={key:1,class:"prompt-list-empty"},m0=["onDragstart","onDblclick"],b0={class:"prompt-card-body"},y0={class:"prompt-card-actions"},k0=["onClick"],v0=["onClick"],_0={class:"workspace"},w0={class:"topbar"},x0={class:"top-actions"},S0=["onClick"],E0=["onKeydown"],T0=["title"],A0=["aria-label","aria-pressed","title"],C0={key:0,class:"content-grid chat-grid"},I0={class:"chat-panel"},M0={key:0,class:"runtime-context-bar"},R0={key:0,class:"runtime-context-bar-actions"},N0={key:2,class:"runtime-context-syncing"},O0={key:1,class:"runtime-context-bar project-context-bar"},L0={class:"runtime-context-bar-actions"},P0=["data-index"],$0={class:"tool-group-shell"},D0=["aria-expanded","onClick"],B0={class:"tool-group-label"},U0={class:"tool-group-label-name"},F0={key:0,class:"tool-group-label-count"},z0={key:1,class:"tool-group-label-separator"},H0={key:1,class:"tool-group-lines"},j0=["open"],W0={class:"reasoning-reveal"},K0={class:"reasoning-paper"},G0=["innerHTML"],V0={class:"compaction-context-actions"},q0={key:0},Z0={class:"tool-result-title-row"},Q0={class:"tool-result-name"},Y0={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},J0={class:"tool-result-detail-row"},X0={key:0,class:"tool-result-primary"},ex={key:1},tx={key:2,class:"tool-group-shell"},nx=["aria-expanded","onClick"],sx={class:"tool-group-label"},rx={class:"tool-group-label-name"},ix={key:0,class:"tool-group-label-count"},ox={key:1,class:"tool-group-label-separator"},ax={key:0,class:"tool-group-purposes"},lx={key:3,class:"tool-result-primary"},cx={key:0},ux={key:4,class:"tool-result-previews"},dx={class:"tool-result-preview kind-list"},fx={tabindex:"0"},gx={key:5,class:"tool-result-previews"},px={class:"tool-result-preview kind-code"},hx={tabindex:"0"},mx={key:6,class:"tool-result-previews"},bx={tabindex:"0"},yx={key:3},kx={key:0,class:"message-head"},vx={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},_x=["innerHTML"],wx={key:0,class:"message-body compaction-message-body"},xx={class:"compaction-context-actions"},Sx={key:0},Ex={key:1,class:"message-body reasoning-body"},Tx=["open"],Ax={key:0,class:"reasoning-elapsed"},Cx={class:"reasoning-reveal"},Ix={class:"reasoning-paper"},Mx=["innerHTML"],Rx={key:2,class:"message-body"},Nx={key:0,class:"message-head"},Ox={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},Lx={key:1},Px={key:2,class:"elapsed-pill"},$x={key:1,class:"image2-result-shell"},Dx=["innerHTML"],Bx={key:0,class:"message-image-attachments image2-output-images"},Ux=["data-preview-src","aria-label"],Fx=["src","alt"],zx={key:1,class:"image-unavailable-placeholder",role:"status"},Hx={class:"image-card-actions"},jx=["href","download"],Wx=["onClick"],Kx=["onClick"],Gx={class:"tool-result-title-row"},Vx={class:"tool-result-name"},qx={key:0,class:"tool-result-failure-mark","aria-label":"执行失败"},Zx={class:"tool-result-detail-row"},Qx={key:0,class:"tool-result-primary"},Yx={key:1},Jx={key:2,class:"tool-group-shell"},Xx=["aria-expanded","onClick"],e1={class:"tool-group-label"},t1={class:"tool-group-label-name"},n1={key:0,class:"tool-group-label-count"},s1={key:1,class:"tool-group-label-separator"},r1={key:0,class:"tool-group-purposes"},i1={key:3,class:"tool-result-primary"},o1={key:0},a1={key:4,class:"tool-result-previews"},l1={class:"tool-result-preview kind-list"},c1={tabindex:"0"},u1={key:5,class:"tool-result-previews"},d1={class:"tool-result-preview kind-code"},f1={tabindex:"0"},g1={key:6,class:"tool-result-previews"},p1={tabindex:"0"},h1={class:"plugin-resource-stack"},m1=["src","title"],b1=["innerHTML"],y1={key:1,class:"message-text markdown streaming-markdown"},k1=["innerHTML"],v1={key:0,class:"message-image-attachments"},_1=["data-preview-src","aria-label"],w1=["src","alt"],x1={key:1,class:"image-unavailable-placeholder",role:"status"},S1=["href","download"],E1={key:2,class:"message-loading",role:"status","aria-live":"polite"},T1={class:"message-loading-body"},A1={class:"message-loading-label"},C1={key:0,class:"queued"},I1={key:0,class:"composer-app-prompt"},M1={key:1,class:"attachments file-attachments"},R1=["onClick"],N1={key:2,class:"attachments image-attachments"},O1=["src","alt"],L1=["onClick"],P1={class:"composer-path-row"},$1=["title"],D1={class:"mobile-session-options"},B1={class:"mobile-session-options-body"},U1={class:"mobile-session-actions"},F1=["aria-pressed"],z1=["disabled"],H1={class:"mobile-runtime-info"},j1={class:"mobile-runtime-grid"},W1={key:1,class:"mobile-runtime-card"},K1={key:2,class:"mobile-runtime-card"},G1={class:"mobile-runtime-card"},V1={class:"composer-footer"},q1={class:"composer-metrics","aria-label":"运行状态指标"},Z1=["aria-pressed","title"],Q1={class:"compress-wrap"},Y1=["disabled"],J1={class:"composer-actions"},X1=["disabled"],eS=["type","disabled","aria-label"],tS=["data-mobile-card","onKeydown"],nS={class:"background-task-section","data-card":"tasks"},sS={class:"background-task-head"},rS={class:"panel-title"},iS={key:0,class:"background-task-count"},oS=["title"],aS={key:0,class:"background-task-more"},lS={key:1,class:"background-task-history"},cS={class:"background-task-history-list"},uS=["title","onClick"],dS={key:1,class:"quota-card","data-card":"quota"},fS={class:"quota-card-head"},gS={class:"quota-card-controls"},pS=["aria-valuenow"],hS={class:"quota-card-foot"},mS={class:"quota-card-update"},bS={class:"quota-card memory-card","data-card":"memory"},yS={class:"memory-card-head"},kS={class:"memory-trend",viewBox:"0 0 260 44",preserveAspectRatio:"none",role:"img","aria-label":"最近一小时 RSS 趋势"},vS=["d"],_S=["cx","cy","r","onFocus"],wS={key:1,class:"memory-trend-empty"},xS={class:"memory-stats"},SS={class:"memory-card-foot"},ES={key:1,class:"content-grid single"},TS={class:"panel-page sessions-page"},AS={class:"session-toolbar"},CS={class:"session-search","aria-label":"搜索会话"},IS={class:"session-count"},MS={key:0,class:"empty-state"},RS={key:1,class:"empty-state"},NS={key:2,class:"empty-state"},OS={key:3,class:"session-list"},LS={class:"session-card-main"},PS={class:"session-card-title"},$S={key:0,class:"current-pill"},DS={key:1,class:"live-pill"},BS={class:"session-card-meta"},US=["title"],FS=["datetime"],zS={class:"session-actions"},HS=["disabled","onClick"],jS=["disabled","onClick"],WS={key:4,class:"session-pagination","aria-label":"会话分页"},KS=["disabled"],GS=["aria-current","onClick"],VS=["disabled"],qS={key:2,class:"content-grid single"},ZS={class:"panel-page prompt-page"},QS={class:"page-head"},YS={class:"page-head-actions"},JS={class:"prompt-workbench"},XS={class:"prompt-library-panel"},eE={class:"prompt-library-head"},tE={class:"prompt-library-list"},nE={key:0,class:"prompt-list-empty"},sE={key:1,class:"prompt-list-empty"},rE=["onClick","onDblclick","onDragstart","onDragover","onDrop"],iE={key:0},oE={class:"prompt-editor-panel"},aE={class:"prompt-editor-toolbar"},lE={class:"prompt-editor-current"},cE={class:"prompt-editor-toolbar-actions"},uE=["disabled"],dE=["disabled"],fE={class:"prompt-editor-grid"},gE={class:"prompt-editor-field"},pE={class:"prompt-editor-field prompt-editor-field-full"},hE={class:"prompt-editor-field prompt-editor-field-full"},mE={key:3,class:"content-grid single"},bE={class:"panel-page settings-page"},yE={class:"page-head settings-page-head"},kE={class:"settings-subpage-title"},vE={class:"page-head settings-page-head"},_E=["disabled"],wE={key:0,class:"empty-state"},xE={class:"settings-card"},SE={class:"settings-field-grid"},EE={class:"settings-field"},TE={key:0,class:"settings-required","aria-label":"必填"},AE=["onUpdate:modelValue","type","placeholder"],CE={class:"settings-card"},IE={class:"settings-field-grid"},ME={class:"settings-field"},RE={class:"settings-field"},NE={class:"settings-card settings-plugin-card"},OE={class:"settings-card-head"},LE=["disabled"],PE={class:"plugin-settings-list"},$E={class:"plugin-toggle"},DE=["onUpdate:modelValue","aria-label"],BE={class:"settings-card settings-plugin-card"},UE={class:"settings-card-head"},FE=["disabled"],zE={class:"plugin-settings-list"},HE={class:"plugin-toggle"},jE=["onUpdate:modelValue","disabled","aria-label"],WE={key:4,class:"content-grid single"},KE={class:"panel-page"},GE={class:"capability-grid"},VE={key:0,class:"toast"},qE=["title","onKeydown"],ZE={class:"cwd-picker-modal",role:"dialog","aria-modal":"true","aria-label":"选择工作目录"},QE=["disabled"],YE=["disabled"],JE={class:"cwd-picker-shortcuts"},XE={class:"cwd-picker-browser"},eT={class:"cwd-picker-locations","aria-label":"常用位置"},tT=["title","onClick"],nT={"aria-hidden":"true"},sT={class:"cwd-picker-tree"},rT={key:0,class:"cwd-picker-empty"},iT={key:1,class:"cwd-picker-error"},oT={class:"cwd-picker-actions"},aT=["disabled"],lT={class:"runtime-context-modal",role:"dialog","aria-modal":"true","aria-label":"项目上下文"},cT={class:"runtime-context-modal-head"},uT={key:0,class:"runtime-context-kicker"},dT=["aria-label"],fT={class:"runtime-context-modal-content"},gT={key:0,class:"runtime-context-index"},pT=["onClick"],hT={key:1,class:"project-context-document"},mT=["aria-label"],bT={class:"confirm-dialog-content"},yT={class:"confirm-dialog-actions"},kT={class:"session-model-list",role:"radiogroup","aria-label":"模型"},vT=["value","disabled"],_T=["disabled"],wT=["value"],xT={key:0,class:"context-window-error",role:"alert"},ST={class:"context-window-actions"},ET=["disabled"],TT={class:"context-window-input-wrap"},AT={key:0,class:"context-window-error",role:"alert"},CT={class:"context-window-actions"},IT=["disabled"],MT=["aria-label"],RT={class:"image-preview-canvas"},NT=["src","alt"],OT={key:0,class:"image-preview-caption"},LT={class:"runtime-context-detail-modal compaction-detail-modal",role:"dialog","aria-modal":"true","aria-label":"压缩上下文详情"},PT={class:"runtime-context-detail-content compaction-detail-content"},$T={class:"compaction-detail-stats"},DT={class:"runtime-context-modal",role:"dialog","aria-modal":"true","aria-label":"运行上下文"},BT={class:"runtime-context-modal-head"},UT={class:"runtime-context-modal-content"},FT={key:1,class:"runtime-plugin-list"},zT={key:0,class:"runtime-context-empty"},HT={class:"runtime-tool-status"},jT=["disabled","onClick"],WT={key:2,class:"runtime-plugin-list"},KT={key:0,class:"runtime-context-empty"},GT=["aria-label"],VT={class:"runtime-context-modal-head"},qT={key:0,class:"runtime-context-kicker"},ZT={class:"runtime-context-detail-content"},QT={key:0},YT={key:1},JT={class:"tool-result-modal background-task-modal",role:"dialog","aria-modal":"true","aria-label":"后台任务"},XT={class:"tool-result-modal-head"},eA={class:"tool-result-modal-title"},tA={class:"background-task-modal-count"},nA={key:0,class:"background-task-index","aria-label":"后台任务列表"},sA=["title","onClick"],rA={class:"background-task-index-copy"},iA={class:"background-task-detail"},oA={class:"background-task-detail-head"},aA={class:"background-task-detail-title"},lA={class:"background-task-meta"},cA={key:0},uA={key:1,class:"wide"},dA={class:"background-task-detail-body"},fA={key:0,class:"background-task-command-section"},gA={class:"background-task-command"},pA={key:2,style:{"min-width":"0",width:"100%"}},hA=["aria-label"],mA={class:"tool-result-modal-head"},bA={class:"tool-result-modal-title"},yA={key:0},kA={class:"tool-result-modal-content"},vA=["innerHTML"],_A=2048,wA=18e5,Ya=.62,Ja=10,xA="System hint: if the user is asking you to draw, render, create, generate, or illustrate a new image, you must call the image2 tool with mode=generate instead of replying with text-only description. After the tool returns images, continue the response normally so the UI can display them in the conversation.",SA="System hint: the user attached an image. If this request involves image editing, modification, redraw, background replacement, style transfer, repair, object removal, or localized changes, you must call the image2 tool with mode=edit and use the attached or most recent image as the source image. Image operations may take a while, so wait up to 10 minutes by default unless the tool returns an error or the user interrupts.",EA="System hint from web UI: if your final answer produces, creates, modifies, exports, packages, or identifies local files that the user should receive, you must call the expose_downloads tool with all relevant absolute file paths before your final textual response. Do not paste absolute paths as the primary delivery method; expose them as browser downloads.",TA="<<ATTACHMENT_MANIFEST>>",AA="<</ATTACHMENT_MANIFEST>>",Qi="••••••••••••••••••",Yi="neoctl-web.tabId",Cs="neoctl-web.sessionId",sf="neoctl-web.theme",Xa="neoctl-web.clientRevision",rf="neoctl-web.clientReloadRequest",el="__neo_reload",CA=112,of=4e4,IA={__name:"App",setup(e){Ve.registerLanguage("javascript",ja),Ve.registerLanguage("js",ja),Ve.registerLanguage("jsx",ja),Ve.registerLanguage("typescript",Wa),Ve.registerLanguage("ts",Wa),Ve.registerLanguage("tsx",Wa),Ve.registerLanguage("python",Zd),Ve.registerLanguage("py",Zd),Ve.registerLanguage("bash",Ka),Ve.registerLanguage("sh",Ka),Ve.registerLanguage("shell",Ka),Ve.registerLanguage("json",sw),Ve.registerLanguage("css",fw),Ve.registerLanguage("html",Ga),Ve.registerLanguage("xml",Ga),Ve.registerLanguage("vue",Ga),Ve.registerLanguage("markdown",Qd),Ve.registerLanguage("md",Qd),Ve.registerLanguage("yaml",Yd),Ve.registerLanguage("yml",Yd),Ve.registerLanguage("diff",gw);const t=[{value:"inherit",label:"跟随全局"},{value:"enabled",label:"启用"},{value:"disabled",label:"关闭"}],n={Assistant:"助手",You:"你",User:"你",System:"系统","Context compaction":"上下文压缩",Config:"配置",Reasoning:"思考","Runtime tool":"运行时工具",multi_tool_use:"并行执行工具",文件下载:"文件下载"},i={"API key":"API Key","Base URL":"Base URL",Model:"模型","Fallback model":"备用模型",Endpoint:"Endpoint","Reasoning effort":"推理强度","Reasoning summary":"推理摘要","Max output tokens":"最大输出 Token","Timeout ms":"请求超时(ms)","Stream idle timeout ms":"流式空闲超时(ms)","Max retries":"最大重试次数"},o={openai:"OpenAI"},a={INVALID_REQUEST:"请求参数无效",SESSION_ACTIVE:"当前会话不能删除,请先切换到其他会话",SESSION_RUNNING:"运行中的会话不能删除,请等待运行结束",SESSION_NOT_FOUND:"会话不存在或已被删除",SESSION_RESUME_FAILED:"打开会话失败",SESSION_CREATE_FAILED:"新建会话失败",SESSION_DELETE_FAILED:"删除会话失败",PLUGIN_UPDATE_BLOCKED:"模型回答期间不能修改会话插件",PLUGIN_NOT_CONFIGURED:"插件功能未配置",PLUGIN_INVALID:"插件配置无效",PLUGIN_UPDATE_FAILED:"插件配置更新失败",PLUGINS_LOCKED:"插件配置已由环境变量锁定",TOOL_UPDATE_BLOCKED:"模型回答期间不能修改会话工具",TOOL_NOT_CONFIGURED:"工具配置功能未启用",TOOL_INVALID:"工具配置无效",TOOL_UPDATE_FAILED:"工具配置更新失败",PROMPT_UPDATE_FAILED:"提示词更新失败",PROMPT_INVALID:"提示词内容无效",FAST_MODE_UPDATE_FAILED:"快速模式切换失败",CONTEXT_WINDOW_UPDATE_BLOCKED:"回答期间不能调整上下文窗口",CONTEXT_WINDOW_INVALID:"请输入大于 0 的整数",CONTEXT_WINDOW_UPDATE_FAILED:"上下文窗口调整失败",CWD_NOT_CONFIGURED:"当前运行时不支持工作目录切换",CWD_INVALID:"路径不存在或不可访问",CWD_UPDATE_BLOCKED:"模型回答期间不能切换工作目录",CWD_UPDATE_FAILED:"工作目录切换失败",CWD_CREATE_FAILED:"文件夹新建失败",CWD_DELETE_FAILED:"只能删除空文件夹,且不能删除当前目录或其上级目录",LOGIN_INVALID:"模型配置无效",LOGIN_SAVE_FAILED:"模型配置保存失败",API_NOT_FOUND:"当前运行时不支持此功能,请重启服务",WEB_REQUEST_FAILED:"请求处理失败"};let c=S(),u=sessionStorage.getItem(Cs)||"",f=!u,m=!1;const h=[];function y(){return{id:"",title:"",content:"",usage:""}}function v(s){if(!s||typeof s!="object")return null;const r=String(s.title||"").trim(),g=String(s.content||"").trim();return!r||!g?null:{id:String(s.id||C()).trim(),title:r,content:g,usage:String(s.usage||"").trim()}}function C(){return`prompt-${Math.random().toString(36).slice(2,10)}`}function S(){let s=sessionStorage.getItem(Yi);return s||(s=N(),sessionStorage.setItem(Yi,s)),s}function N(){var g,p;if((g=globalThis.crypto)!=null&&g.randomUUID)return globalThis.crypto.randomUUID();const s=new Uint8Array(16);if((p=globalThis.crypto)!=null&&p.getRandomValues)globalThis.crypto.getRandomValues(s);else for(let b=0;b<s.length;b+=1)s[b]=Math.floor(Math.random()*256);s[6]=s[6]&15|64,s[8]=s[8]&63|128;const r=[...s].map(b=>b.toString(16).padStart(2,"0"));return`${r.slice(0,4).join("")}-${r.slice(4,6).join("")}-${r.slice(6,8).join("")}-${r.slice(8,10).join("")}-${r.slice(10).join("")}`}function I(s){const r=new URL(s,window.location.origin);return r.searchParams.set("tabId",c),u&&r.searchParams.set("sessionId",u),`${r.pathname}${r.search}${r.hash}`}function L(s,r=!1){const g=(s==null?void 0:s.sessionId)||"";!g||g===u||!r&&!f&&u||(u=g,f=!1,sessionStorage.setItem(Cs,g))}const l=cs({connected:!1,connecting:!0,coreVersion:"",coreEasterEgg:!1,lines:[],status:{phase:"ready",streamedOutputTokens:0},appPrompt:{hasActivePrompt:!1,activePrompt:void 0},runtimeContext:void 0,runtimeContextLoading:!0,runtimeContextError:"",runtimeContextModal:"",runtimeContextDetail:void 0,settingsPage:"",projectContextOpen:!1,projectContextDocument:void 0,globalPlugins:{items:[],locked:!1,restartRequired:!0,loading:!1},sessionPlugins:{items:[],busy:!1,loading:!1},globalTools:{items:[],loading:!1},sessionTools:{items:[],busy:!1,loading:!1},fastMode:!1,fastModeMutating:!1,fastModeDraft:!1,pendingSessionSettings:{},compactSaving:!1,modelModalOpen:!1,modelDraft:"",reasoningDraft:"default",modelSearch:"",modelError:"",modelSaving:!1,contextWindowModalOpen:!1,contextWindowDraft:"",contextWindowError:"",contextWindowSaving:!1,busy:!1,queuedInput:void 0,backgroundTaskCount:0,backgroundTasks:[],agentTaskHistory:[],terminalTaskHistory:[],backgroundSessionRunCount:0,runningSessionIds:[],session:void 0,modelSettings:void 0,cwd:"",cwdPicker:{open:!1,cwd:"",parent:"",home:"",entries:[],locations:[],treeRoots:[],treeChildren:{},treeExpanded:{},selectedPath:"",selectionExplicit:!1,input:"",loading:!1,mutating:!1,error:""},sessionsLoading:!1,sessionResumeLoading:!1,pendingResumeSessionId:"",catalog:{commands:[],modelIds:[],reasoning:[]},interactive:{},sessions:[],login:void 0,cpaConfig:{url:"",password:"",hasPassword:!1,loaded:!1},cpaQuotas:[],cpaQuotaIndex:0,memory:{current:null,history:[],sampleMs:6e4,retentionMs:864e5},activePanel:"chat",toolDetailLineId:void 0,expandedToolGroups:{},compactionDetailLineId:void 0,backgroundTaskDetail:void 0,imagePreview:void 0,confirmDialog:{open:!1,title:"",message:"",confirmLabel:"确认",cancelLabel:"取消",tone:"warning"},promptLibrary:[],promptLibraryLoading:!0,promptManagerOpen:!1,selectedPromptId:"",composerDropActive:!1,composerDropMode:"prompt",attachments:[],attachmentCounter:0,uploadingFiles:!1,messageImagePreviews:[],liveToolStartedAt:{},clockTick:Date.now(),composerMetrics:{context:{display:0,target:0,bump:0,initialized:!1},inputTokens:{display:0,target:0,bump:0,initialized:!1},outputTokens:{display:0,target:0,bump:0,initialized:!1}},toast:""}),M=Ae(""),O=Ae(""),H=Ae(1),se=Ae(km()),J=Ae(null),ie=Ae(null),Z=Ae(null),ce=Ae(null),X=Ae(null),U=Ae(null),oe=Ae(""),fe=pe(()=>[{id:"tasks",title:"后台任务"},...Mt.value?[{id:"quota",title:"周额度"}]:[],{id:"memory",title:"服务端内存"}]),Ee=s=>{var r;return((r=fe.value.find(g=>g.id===s))==null?void 0:r.title)||""};function F(s){Bi(),l.activePanel="chat",oe.value=s,ct(()=>{var r;return(r=document.querySelector(".mobile-card-close"))==null?void 0:r.focus()})}function ee(){oe.value="",ct(()=>{var s,r;return(r=(s=U.value)==null?void 0:s.querySelector("summary"))==null?void 0:r.focus()})}const Q=Ae(""),ye=cs({}),ve=cs(y()),Me=Ae(""),Oe=Ae(""),Xe=Ae(""),Ye=Ae("before"),et=Ae(-1);let ze,Kt,It=0,tt=0,wt=0,rn,w=!1,T,D,j,W=0,G=Promise.resolve(),B=0,ne=0,V=0,$,he,re=!1,ge,be;Np();const z=new Map,Y=new Map,le=Ae(0),ke=pe(()=>[...l.lines||[]].reverse().find(s=>ta(s))||null),Ie=pe(()=>{var s;return Oh((s=l.status)==null?void 0:s.phase)}),Ze=pe(()=>{var s,r;if(ke.value)return eu(ke.value)?"整理图片结果":"图片生成中";if(((s=l.status)==null?void 0:s.phase)==="running_tools"){const g=(r=l.status)==null?void 0:r.currentTool;if(String((g==null?void 0:g.name)||"").toLowerCase()==="image_create")return"图片生成中";if(g!=null&&g.name)return`调用 ${g.name}${g.kind?` · ${g.kind}`:""}`}return Ie.value}),pt=pe(()=>{var s;return Qm((s=l.status)==null?void 0:s.phase)}),on=pe(()=>pt.value||l.busy||l.sessionResumeLoading),Qr=pe(()=>{if(l.sessionResumeLoading)return"正在加载会话";if(ke.value){const s=cr(ke.value),r=eu(ke.value)?"正在载入图片结果":"图片模型正在生成";return s?`${r} · 已用时 ${s}`:r}return`正在${Ze.value}`}),lt=s=>String(s||"").replace(/设计/g,"").trim(),St=s=>lt(s==null?void 0:s.title)||"未命名会话",xn=pe(()=>{var r;const s=lt((r=l.session)==null?void 0:r.title);return s&&s!=="neo"?s:""}),Fn=pe(()=>xn.value||"未命名会话"),Yr=Ae(null),lc=Ae(null),Uo=Ae(!1);let Jr;const Fo=async()=>{await ct();const s=Yr.value,r=lc.value;Uo.value=!!(s&&r&&r.scrollWidth>s.clientWidth+2)},cc=pe(()=>l.cwd||"—"),Ks=pe(()=>{var g,p;const s=l.pendingSessionSettings,r=l.modelSettings||{model:(p=(g=l.status)==null?void 0:g.metrics)==null?void 0:p.model};return{model:s.model??r.model,reasoning:Object.hasOwn(s,"reasoning")||Object.hasOwn(s,"model")?s.reasoning:r.reasoning}}),uc=pe(()=>{var s;return t0(Ks.value.model,(s=Ks.value.reasoning)==null?void 0:s.effort)}),ms=pe(()=>l.fastModeMutating?l.fastModeDraft:l.pendingSessionSettings.fastMode??l.fastMode),dc=pe(()=>{var s;return[...new Set([Ks.value.model,(s=l.modelSettings)==null?void 0:s.model,...l.catalog.modelIds||[]].filter(Boolean))]}),gp=pe(()=>dc.value.filter(s=>s.toLowerCase().includes(l.modelSearch.trim().toLowerCase()))),Xr=pe(()=>{var g;const s=((g=l.catalog.modelReasoning)==null?void 0:g[l.modelDraft])||[],r=l.catalog.reasoning||[];return["default","off",...s.filter(p=>r.includes(p)&&p!=="default"&&p!=="off")]});Je(()=>l.modelDraft,()=>{Xr.value.includes(l.reasoningDraft)||(l.reasoningDraft="default")});const fc=pe(()=>`${l.composerMetrics.context.display.toFixed(1)}%`),pp=pe(()=>{var r,g;const s=Number(l.pendingSessionSettings.contextWindowTokens??((g=(r=l.status)==null?void 0:r.metrics)==null?void 0:g.contextWindowTokens));return Number.isFinite(s)&&s>0?String(Math.max(1,Math.round(s/1e3))):""}),gc=pe(()=>Ss(l.composerMetrics.inputTokens.display)),pc=pe(()=>Ss(l.composerMetrics.outputTokens.display)),zn=pe(()=>pt.value||l.busy),Hn=pe(()=>l.backgroundTasks.length),ei=pe(()=>[...l.agentTaskHistory,...l.terminalTaskHistory].sort((s,r)=>{const g=p=>typeof p.completedAt=="number"?p.completedAt:Date.parse(p.completedAt||p.updatedAt||"")||(typeof p.createdAt=="number"?p.createdAt:0);return g(r)-g(s)})),Sn=pe(()=>{const s=new Set;return[...l.backgroundTasks,...ei.value].filter(r=>{const g=Qn(r);return s.has(g)?!1:(s.add(g),!0)})}),Gs=pe(()=>l.backgroundTasks[0]),hc=pe(()=>!!(M.value.trim()||l.attachments.length)),mc=pe(()=>zn.value?hc.value?"打断并发送":l.queuedInput?"立即发送":"停止":"发送 ↵"),Vs=pe(()=>{const s=O.value.trim().toLocaleLowerCase(),r=l.sessions||[];return s?r.filter(g=>[St(g),g.title,g.sessionId,g.updatedAt,g.createdAt].some(p=>String(p||"").toLocaleLowerCase().includes(s))):r}),ti=pe(()=>Math.max(1,Math.ceil(Vs.value.length/Ja))),hp=pe(()=>{const s=(H.value-1)*Ja;return Vs.value.slice(s,s+Ja)}),mp=pe(()=>{const s=ti.value,r=Math.max(1,Math.min(H.value-2,s-4)),g=Math.min(s,r+4);return Array.from({length:g-r+1},(p,b)=>r+b)}),jn=pe(()=>l.sessionResumeLoading?[]:_h((l.lines||[]).filter(s=>!Ih(s)))),ni=s_(pe(()=>({count:jn.value.length,getScrollElement:()=>Z.value,estimateSize:Km,getItemKey:s=>Wm(jn.value[s]),rangeExtractor:s=>{const r=new Set(Pg(s));return jn.value.forEach((g,p)=>{(g==null?void 0:g.live)===!0&&r.add(p)}),[...r].sort((g,p)=>g-p)},overscan:8,scrollMargin:le.value,anchorTo:"end",followOnAppend:!0,scrollEndThreshold:96,useAnimationFrameWithResizeObserver:!0}))),bp=pe(()=>ni.value.getVirtualItems().filter(s=>jn.value[s.index])),yp=pe(()=>ni.value.getTotalSize()),kp=pe(()=>{var s,r;return Array.isArray((r=(s=l.runtimeContext)==null?void 0:s.prompt)==null?void 0:r.sections)?l.runtimeContext.prompt.sections:[]}),zo=pe(()=>{var s;return Array.isArray((s=l.runtimeContext)==null?void 0:s.tools)?l.runtimeContext.tools:[]}),qs=pe(()=>{var s,r;return Array.isArray((r=(s=l.runtimeContext)==null?void 0:s.project)==null?void 0:r.documents)?l.runtimeContext.project.documents:[]}),vp=pe(()=>l.sessionPlugins.items.filter(s=>s.effectiveEnabled).length),_p=pe(()=>l.sessionTools.items.filter(s=>s.effectiveEnabled).length),$t=pe(()=>l.lines.find(s=>String(s.id)===String(l.toolDetailLineId))||null),an=pe(()=>l.lines.find(s=>String(s.id)===String(l.compactionDetailLineId))||null),Wn=pe(()=>{var s;return((s=l.appPrompt)==null?void 0:s.activePrompt)||void 0}),wp=pe(()=>{var s,r;return((s=Wn.value)==null?void 0:s.title)||((r=Wn.value)==null?void 0:r.id)||""}),si=pe(()=>l.promptLibrary.find(s=>s.id===l.selectedPromptId)||l.promptLibrary[0]||null),ri=pe(()=>se.value==="dark"),ii=pe(()=>ri.value?"切换到日间模式":"切换到夜间模式"),Mt=pe(()=>l.cpaQuotas.length?l.cpaQuotas[l.cpaQuotaIndex%l.cpaQuotas.length]||l.cpaQuotas[0]:null),Kn=pe(()=>{var s;return((s=l.memory)==null?void 0:s.current)||null}),oi=pe(()=>{var E;const s=(((E=l.memory)==null?void 0:E.history)||[]).filter(R=>Number.isFinite(Number(R==null?void 0:R.rss))),r=s.map(R=>Number(R.rss));if(!r.length)return[];const g=Math.min(...r),p=Math.max(...r),b=Math.max(1,p-g);return r.map((R,q)=>({entry:s[q],x:r.length===1?130:q/(r.length-1)*260,y:r.length===1?22:40-(R-g)/b*36}))}),bc=pe(()=>oi.value.map((s,r)=>`${r?"L":"M"} ${s.x.toFixed(1)} ${s.y.toFixed(1)}`).join(" ")),Zs=pe(()=>oi.value[et.value]||null);Je(se,vm,{immediate:!0}),Je([zn,ri],([s,r])=>{const p=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M32 4 50 32 32 60 14 32Z" fill="${s?r?"#bef264":"#a3e635":r?"#38bdf8":"#7dd3fc"}"/></svg>`,b=document.querySelector('link[rel="icon"]');b&&(b.href=`data:image/svg+xml,${encodeURIComponent(p)}`)},{immediate:!0}),Je(xn,s=>{document.title=s||"对话工作台"},{immediate:!0}),Je(Fn,Fo,{immediate:!0}),Je(O,()=>{H.value=1}),Je(ti,s=>{H.value>s&&(H.value=s)}),Je(()=>{var s;return(s=l.backgroundTaskDetail)==null?void 0:s.output},async()=>{await ct();const s=X.value;s&&(s.scrollTop=s.scrollHeight)}),Je(()=>jn.value.length,async()=>{await ct(),Ta(),$i()}),Je(()=>l.activePanel,async s=>{s==="chat"&&(await ct(),Ta(),$i())}),Vr(async()=>{typeof ResizeObserver<"u"&&(be=new ResizeObserver($i),Ta()),$i(),await Promise.all([Qs(),xp(),Ys(),Ho(),ai(),yc(),Ko(),Dc()]),li(),T=setInterval(()=>{l.clockTick=Date.now()},1e3),D=setInterval(Ko,6e4),j=setInterval(Dc,6e4),window.addEventListener("keydown",bu),document.addEventListener("click",Gc),document.addEventListener("click",Vc),document.addEventListener("pointerdown",Pu,!0),typeof ResizeObserver<"u"&&Yr.value&&(Jr=new ResizeObserver(Fo),Jr.observe(Yr.value)),Fo()}),vn(()=>{ze&&ze.close(),It&&cancelAnimationFrame(It),tt&&cancelAnimationFrame(tt),ci(),rn=void 0,W&&cancelAnimationFrame(W),T&&clearInterval(T),D&&clearInterval(D),j&&clearInterval(j),ge&&clearTimeout(ge),Jr&&Jr.disconnect(),be&&be.disconnect(),document.body.classList.remove("tool-detail-open","image-preview-open","runtime-context-open","context-window-open","cwd-picker-lock"),he&&ys(!1),window.removeEventListener("keydown",bu),document.removeEventListener("click",Gc),document.removeEventListener("click",Vc),document.removeEventListener("pointerdown",Pu,!0)});async function Qs(s={}){try{const r=await fetch(I("/api/state"));if(!r.ok)throw new Error(`state ${r.status}`);return ui(await r.json()),!0}catch(r){return s.silent||we(`运行时不可用:${r.message||r}`),!1}}async function xp(){try{const s=await fetch(I("/api/client-info"),{cache:"no-store"});if(!s.ok)return;kc(await s.json())}catch{}}async function Ys(){l.runtimeContextLoading=!0;try{const s=await fetch(I("/api/runtime-context")),r=await s.json().catch(()=>({}));if(!s.ok)throw new Error(r.error||`runtime-context ${s.status}`);return _c(r),!0}catch(s){return l.runtimeContextError=s.message||String(s),!1}finally{l.runtimeContextLoading=!1}}async function Sp(){l.globalTools.loading=!0;try{const s=await fetch(I("/api/tools")),r=await s.json().catch(()=>({}));if(!s.ok)throw new Error(r.error||`tools ${s.status}`);l.globalTools={items:Array.isArray(r.items)?r.items.map(g=>({...g})):[],loading:!1}}catch(s){l.globalTools.loading=!1,we(s.message||String(s))}}async function Ep(){const s=Object.fromEntries(l.globalTools.items.map(r=>[r.name,r.configuredEnabled!==!1]));l.globalTools.loading=!0;try{const r=await Ke("/api/tools/global",{overrides:s});l.globalTools={...r.state,loading:!1},await Promise.all([ai(),Ys()]),we("全局工具配置已保存,各会话在下一轮或刷新时生效")}catch(r){l.globalTools.loading=!1,xt(r,"工具配置保存失败")}}async function ai(){l.sessionTools.loading=!0;try{const s=await fetch(I("/api/session-tools")),r=await s.json().catch(()=>({}));if(!s.ok)throw new Error(r.error||`session-tools ${s.status}`);l.sessionTools={...r,items:Array.isArray(r.items)?r.items:[],loading:!1}}catch(s){l.sessionTools.loading=!1,we(s.message||String(s))}}async function Tp(s,r){const g=Object.fromEntries(l.sessionTools.items.map(p=>[p.name,p.name===s.name?r:p.mode]));l.sessionTools.busy=!0;try{const p=await Ke("/api/session-tools",{overrides:g});l.sessionTools={...p.state,loading:!1,busy:!1}}catch(p){l.sessionTools.busy=!1,xt(p,"会话工具更新失败")}}async function Ap(){l.globalPlugins.loading=!0;try{const s=await fetch(I("/api/plugins")),r=await s.json().catch(()=>({}));if(!s.ok)throw new Error(r.error||`plugins ${s.status}`);l.globalPlugins={items:Array.isArray(r.items)?r.items.map(g=>({...g})):[],locked:r.locked===!0,restartRequired:r.restartRequired!==!1,loading:!1}}catch(s){l.globalPlugins.loading=!1,we(s.message||String(s))}}async function Cp(){const s=l.globalPlugins.items.filter(r=>r.configuredEnabled!==!1).map(r=>r.id);l.globalPlugins.loading=!0;try{const r=await Ke("/api/plugins/global",{enabledIds:s}),g=new Set(r.enabledIds||s);l.globalPlugins.items=l.globalPlugins.items.map(p=>({...p,configuredEnabled:g.has(p.id)})),we("插件配置已保存,重启后生效")}catch(r){xt(r,"插件配置保存失败")}finally{l.globalPlugins.loading=!1}}async function Ho(){l.sessionPlugins.loading=!0;try{const s=await fetch(I("/api/session-plugins")),r=await s.json().catch(()=>({}));if(!s.ok)throw new Error(r.error||`session-plugins ${s.status}`);l.sessionPlugins={...r,items:Array.isArray(r.items)?r.items:[],loading:!1}}catch(s){l.sessionPlugins.loading=!1,we(s.message||String(s))}}async function Ip(s,r){const g=Object.fromEntries(l.sessionPlugins.items.map(p=>[p.id,p.id===s.id?r:p.mode]));l.sessionPlugins.busy=!0;try{const p=await Ke("/api/session-plugins",{overrides:g});l.sessionPlugins={...p.state,loading:!1,busy:!1}}catch(p){l.sessionPlugins.busy=!1,xt(p,"会话插件更新失败")}}async function yc(){l.promptLibraryLoading=!0;try{const s=await fetch(I("/api/prompt-library")),r=await s.json().catch(()=>({}));if(!s.ok)throw new Error(r.error||`prompt-library ${s.status}`);Js(Array.isArray(r.items)?r.items:h)}catch(s){Js([]),we(s.message||String(s))}finally{l.promptLibraryLoading=!1}}function li(){ze&&ze.close(),tt&&cancelAnimationFrame(tt),tt=0,ci(),rn=void 0,w=!1,l.connecting=!0,ze=new EventSource(I("/events")),ze.addEventListener("open",()=>{w=!1,l.connected=!0,l.connecting=!1}),ze.addEventListener("error",()=>{jo(),l.connected=!1,l.connecting=!1}),ze.addEventListener("sync",s=>{if(!w){w=!0,xc(s.data);return}Op(s.data)}),ze.addEventListener("delta",s=>{jo(),Lp(s.data)}),ze.addEventListener("terminal.output",s=>{try{jo(),Up(JSON.parse(s.data))}catch{}}),ze.addEventListener("client.version",s=>{try{kc(JSON.parse(s.data))}catch{}}),ze.addEventListener("client.reload",s=>{try{Mp(JSON.parse(s.data))}catch{}}),ze.addEventListener("runtime.context",s=>{try{_c(JSON.parse(s.data))}catch(r){l.runtimeContextError=r.message||String(r)}}),ze.addEventListener("runtime.context.error",s=>{try{const r=JSON.parse(s.data);l.runtimeContextError=r.message||"运行上下文同步失败"}catch{l.runtimeContextError="运行上下文同步失败"}})}function kc(s){if(Number(s==null?void 0:s.protocolVersion)!==1)return;l.coreVersion=String(s.coreVersion||"");const r=String(s.revision||"").trim();if(!r)return;const g=localStorage.getItem(Xa);localStorage.setItem(Xa,r),g&&g!==r&&vc({...s,requestId:`revision:${r}`,clearCache:!0})}async function Mp(s){if(Number(s==null?void 0:s.protocolVersion)!==1)return;const r=String(s.requestId||"").trim();if(!r||sessionStorage.getItem(rf)===r)return;sessionStorage.setItem(rf,r);const g=String(s.revision||"").trim();g&&localStorage.setItem(Xa,g),l.coreVersion=String(s.coreVersion||l.coreVersion||""),await vc(s)}async function vc(s){if(re)return;re=!0,s.clearCache!==!1&&await Rp();const r=new URL(window.location.href);r.searchParams.set(el,String(s.requestId||s.revision||Date.now())),window.location.replace(r.href)}async function Rp(){const s=[];"caches"in window&&s.push(caches.keys().then(r=>Promise.all(r.map(g=>caches.delete(g))))),"serviceWorker"in navigator&&s.push(navigator.serviceWorker.getRegistrations().then(r=>Promise.all(r.map(g=>g.unregister())))),await Promise.allSettled(s)}function Np(){const s=new URL(window.location.href);s.searchParams.has(el)&&(s.searchParams.delete(el),window.history.replaceState(window.history.state,"",s.href))}function bs(){ge&&clearTimeout(ge),l.coreEasterEgg=!1,requestAnimationFrame(()=>{l.coreEasterEgg=!0,ge=setTimeout(()=>{l.coreEasterEgg=!1},1300)})}function _c(s){var b,E;if(![1,2].includes(Number(s==null?void 0:s.protocolVersion)))throw new Error(`不支持的运行上下文协议版本:${(s==null?void 0:s.protocolVersion)??"未知"}`);const r=Number(s.revision||0),g=Number(((b=l.runtimeContext)==null?void 0:b.revision)||0);(!s.sessionId||!((E=l.runtimeContext)!=null&&E.sessionId)||s.sessionId===l.runtimeContext.sessionId)&&r<g||(l.runtimeContext=s,l.projectContextDocument&&!qs.value.some(R=>R.path===l.projectContextDocument.path)&&(l.projectContextDocument=void 0),l.projectContextOpen&&qs.value.length===0&&(l.projectContextOpen=!1,document.body.classList.remove("runtime-context-open")),l.runtimeContextLoading=!1,l.runtimeContextError="")}function Op(s){rn=s,!tt&&(tt=requestAnimationFrame(()=>{tt=0,wc()}))}function jo(){tt&&cancelAnimationFrame(tt),tt=0,wc()}function wc(){const s=rn;rn=void 0,s&&xc(s)}function xc(s){try{ui(JSON.parse(s))}catch(r){we(`运行状态同步失败:${r.message||r}`)}}function Lp(s){try{Bp(JSON.parse(s))}catch(r){we(`流式增量同步失败:${r.message||r}`),Qs()}}function Pp(s,r){const g=String(r||"");if(!g)return;const p=String(s);Y.set(p,`${Y.get(p)||""}${g}`),Sc()}function Sc(){wt||(wt=requestAnimationFrame($p))}function $p(){wt=0;const s=Sa(),r=[...Y];Y.clear();for(const[g,p]of r){const b=l.lines.findIndex(R=>String(R.id)===g);if(b<0)continue;const E=l.lines[b];l.lines[b]={...E,text:`${E.text||""}${p}`}}s&&Ca(),Y.size&&Sc()}function Dp(s){const r=String(s),g=Y.get(r);if(!g)return;Y.delete(r);const p=l.lines.findIndex(E=>String(E.id)===r);if(p<0)return;const b=l.lines[p];l.lines[p]={...b,text:`${b.text||""}${g}`}}function ci(){wt&&cancelAnimationFrame(wt),wt=0,Y.clear()}function Bp(s){const r=String(s.sessionId||"");if(u&&r&&r!==u&&!f){au();return}const g=Sa();for(const p of s.operations||[]){if(p.type==="line.append"){l.lines.some(E=>{var R;return String(E.id)===String((R=p.line)==null?void 0:R.id)})||l.lines.push(p.line);continue}const b=l.lines.findIndex(E=>String(E.id)===String(p.id));if(b<0)throw new Error(`找不到增量消息行 ${p.id}`);if(l.lines[b],p.type==="line.text.append")Pp(p.id,p.text);else if(p.type==="line.patch"){Dp(p.id);const E=l.lines[b];l.lines[b]={...E,...p.patch||{}}}}s.status&&(l.status=s.status),na(),l.connected=!0,l.connecting=!1,g&&Ca()}function Up(s){var r,g;for(const p of(s==null?void 0:s.updates)||[]){const b=String((p==null?void 0:p.sessionId)||"");if(!b||p.ownerSessionId!==((r=l.session)==null?void 0:r.sessionId)||p.invalidated===!0)continue;const E=l.backgroundTasks.findIndex(ln=>String((ln==null?void 0:ln.sessionId)||"")===b);if(E<0)continue;const R=String(p.text||"");if(!R)continue;const q=l.backgroundTasks[E],ae=String(q.output||""),ue=Number(q.outputEnd??ae.length),Te=Number(p.outputStart??ue),He=Number(p.outputEnd??Te+R.length),Bt=Te===ue?Fp(ae,R,of):R.slice(-of);l.backgroundTasks[E]={...q,output:Bt,outputEnd:He},String(((g=l.backgroundTaskDetail)==null?void 0:g.sessionId)||"")===b&&(l.backgroundTaskDetail={...l.backgroundTaskDetail,output:Bt,outputEnd:He})}}function Fp(s,r,g){const p=`${s}${r}`;return p.length<=g?p:p.slice(-g)}function ui(s){var b,E,R,q;ci();const r=String(((b=s.session)==null?void 0:b.sessionId)||""),g=String(((E=l.session)==null?void 0:E.sessionId)||"");if(r&&r!==g&&vs(),u&&r&&r!==u&&!f){au();return}V+=1;const p=Sa();if(r!==g&&(gi(),Aa(),l.messageImagePreviews=l.messageImagePreviews.filter(ae=>ae.sessionId===r),l.attachmentCounter=0),l.lines=s.lines||[],l.toolDetailLineId!==void 0&&!l.lines.some(ae=>String(ae.id)===String(l.toolDetailLineId))&&vs(),l.compactionDetailLineId!==void 0&&!l.lines.some(ae=>String(ae.id)===String(l.compactionDetailLineId))&&ki(),Am(l.lines),Mh(l.lines),l.status=s.status||l.status,na(),l.busy=!!s.busy,l.queuedInput=s.queuedInput,l.backgroundTaskCount=s.backgroundTaskCount||0,l.backgroundTasks=s.backgroundTasks||[],l.agentTaskHistory=s.agentTaskHistory||[],l.terminalTaskHistory=s.terminalTaskHistory||[],l.backgroundTaskDetail){const ae=Sn.value.find(ue=>Qn(ue)===Qn(l.backgroundTaskDetail));ae?l.backgroundTaskDetail={...ae}:l.backgroundTaskDetail.kind==="terminal"&&l.backgroundTaskDetail.ownerSessionId===((R=s.session)==null?void 0:R.sessionId)?l.backgroundTaskDetail={...l.backgroundTaskDetail,status:"unknown",outputAvailability:"unavailable"}:Ti()}if(l.backgroundSessionRunCount=s.backgroundSessionRunCount||0,l.runningSessionIds=s.runningSessionIds||[],l.session=s.session,l.modelSettings=s.modelSettings,l.pendingSessionSettings={...s.pendingSessionSettings||{}},l.cwd=s.cwd||"",l.fastMode=s.fastMode===!0,l.appPrompt=s.appPrompt||{hasActivePrompt:!1,activePrompt:void 0},L(s.session,f),r&&r!==g&&Promise.all([Ho(),ai()]),l.sessionResumeLoading){const ae=((q=s.session)==null?void 0:q.sessionId)||"";l.pendingResumeSessionId&&ae===l.pendingResumeSessionId&&(l.sessionResumeLoading=!1,l.pendingResumeSessionId="")}s.catalog&&(l.catalog=s.catalog),s.interactive&&(l.interactive=s.interactive),s.tips&&(l.tips=s.tips),s.tipIndex!==void 0&&l.tipIndex===0&&(l.tipIndex=s.tipIndex),l.connected=!0,l.connecting=!1,Nh(l.backgroundTasks),Zm(),p&&Ca()}function Js(s,r=l.selectedPromptId){const g=(s||[]).map(v).filter(Boolean);l.promptLibrary=g;const p=g.find(b=>b.id===r)||g[0]||null;l.selectedPromptId=(p==null?void 0:p.id)||"",Xs(p||y())}function Xs(s){ve.id=(s==null?void 0:s.id)||"",ve.title=(s==null?void 0:s.title)||"",ve.content=(s==null?void 0:s.content)||"",ve.usage=(s==null?void 0:s.usage)||""}function Wo(s){l.activePanel="prompts",l.promptManagerOpen=!0,s&&(l.selectedPromptId=s);const r=l.promptLibrary.find(g=>g.id===l.selectedPromptId)||l.promptLibrary[0]||y();l.selectedPromptId=r.id||"",Xs(r)}function zp(s){l.selectedPromptId=s.id,Wo(s.id)}function Hp(){l.selectedPromptId="",Xs(y()),l.activePanel="prompts",l.promptManagerOpen=!0}function jp(s){l.selectedPromptId=s.id,Xs(s)}async function Wp(){const s=v({id:ve.id||C(),title:ve.title,content:ve.content,usage:ve.usage});if(!s){we("标题和内容不能为空");return}try{const r=await Ke("/api/prompt-library",{item:s});Js(r.items,s.id)}catch(r){we(r.message||String(r));return}we("已保存提示词")}async function Kp(){var p;const s=String(ve.id||"").trim();if(!s){Xs(y());return}const r=l.promptLibrary.find(b=>b.id===s);if(!(!r||!await tr({title:"删除提示词?",message:`“${r.title}”删除后无法恢复。`,confirmLabel:"确认删除",tone:"danger"}))){try{const b=await Ke("/api/prompt-library/delete",{id:s});Js(b.items)}catch(b){we(b.message||String(b));return}((p=Wn.value)==null?void 0:p.id)===r.id&&Ec({confirm:!1}),we("已删除提示词")}}async function er(s){const r=v(s);if(!r){we("提示词无效");return}const g=Wn.value;if(g&&(g.id!==r.id||String(g.content||"").trim()!==r.content)){const b=g.id===r.id;if(!await tr({title:b?"更新当前提示词?":"切换当前提示词?",message:b?`“${r.title}”的内容已经变化。重新应用会影响模型对后续问题的理解和回答方式。`:`将从“${g.title||g.id||"当前提示词"}”切换为“${r.title}”。提示词变化会影响模型对后续问题的理解和回答方式。`,confirmLabel:b?"确认更新":"确认切换"}))return}try{const b=await Ke("/api/app-prompt",{id:r.id,title:r.title,usage:r.usage,source:"sidebar-library",content:r.content});(b==null?void 0:b.ok)!==!1&&(l.appPrompt=b.appPrompt||{hasActivePrompt:!0,activePrompt:r},we(`已应用:${r.title}`))}catch(b){xt(b,"应用提示词失败")}}async function Ec(s={}){if(Wn.value&&!(s.confirm!==!1&&!await tr({title:"清除当前提示词?",message:"清除后,模型将不再遵循当前应用提示词,这会改变它对后续问题的理解和回答方式。",confirmLabel:"确认清除",tone:"danger"})))try{const r=await Ke("/api/app-prompt",{clear:!0});(r==null?void 0:r.ok)!==!1&&(l.appPrompt=r.appPrompt||{hasActivePrompt:!1,activePrompt:void 0},we("已清空应用提示词"))}catch(r){xt(r,"清空提示词失败")}}function tr(s){return he&&ys(!1),Object.assign(l.confirmDialog,{open:!0,title:String((s==null?void 0:s.title)||"请确认"),message:String((s==null?void 0:s.message)||""),confirmLabel:String((s==null?void 0:s.confirmLabel)||"确认"),cancelLabel:String((s==null?void 0:s.cancelLabel)||"取消"),tone:(s==null?void 0:s.tone)==="danger"?"danger":"warning"}),new Promise(r=>{he=r})}function ys(s){const r=he;he=void 0,l.confirmDialog.open=!1,r==null||r(s===!0)}function Gp(s,r){Me.value=r.id,s!=null&&s.dataTransfer&&(s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData("application/x-neoctl-prompt-id",r.id),s.dataTransfer.setData("text/plain",r.title))}function Vp(s){var p;const r=Array.from(((p=s==null?void 0:s.dataTransfer)==null?void 0:p.types)||[]),g=Qp(s);!r.includes("application/x-neoctl-prompt-id")&&!g||(s.preventDefault(),l.composerDropActive=!0,l.composerDropMode=g?"files":"prompt",s.dataTransfer&&(s.dataTransfer.dropEffect="copy"))}function qp(s){s!=null&&s.currentTarget&&(s!=null&&s.relatedTarget)&&s.currentTarget.contains(s.relatedTarget)||(l.composerDropActive=!1,l.composerDropMode="prompt")}async function Zp(s){var b,E;const r=Yp(s==null?void 0:s.dataTransfer);if(r.length){s.preventDefault(),l.composerDropActive=!1,l.composerDropMode="prompt",Me.value="",await ku(r),(b=J.value)==null||b.focus();return}const g=((E=s==null?void 0:s.dataTransfer)==null?void 0:E.getData("application/x-neoctl-prompt-id"))||Me.value;if(l.composerDropActive=!1,l.composerDropMode="prompt",!g)return;s.preventDefault();const p=l.promptLibrary.find(R=>R.id===g);if(Me.value="",!p){we("未找到提示词");return}await er(p)}function Qp(s){var g,p;return Array.from(((g=s==null?void 0:s.dataTransfer)==null?void 0:g.types)||[]).includes("Files")?!0:Array.from(((p=s==null?void 0:s.dataTransfer)==null?void 0:p.items)||[]).some(b=>b.kind==="file")}function Yp(s){const r=Array.from((s==null?void 0:s.files)||[]);return r.length?r:Array.from((s==null?void 0:s.items)||[]).filter(g=>g.kind==="file").map(g=>g.getAsFile()).filter(Boolean)}function Jp(){Me.value="",l.composerDropActive=!1,l.composerDropMode="prompt"}function Xp(s,r){Oe.value=r.id,Xe.value="",s!=null&&s.dataTransfer&&(s.dataTransfer.effectAllowed="move",s.dataTransfer.setData("application/x-neoctl-prompt-sort-id",r.id),s.dataTransfer.setData("text/plain",r.title))}function eh(s,r){var b,E,R;const g=Oe.value||((b=s==null?void 0:s.dataTransfer)==null?void 0:b.getData("application/x-neoctl-prompt-sort-id"));if(!g||g===r.id)return;s.preventDefault();const p=(R=(E=s.currentTarget)==null?void 0:E.getBoundingClientRect)==null?void 0:R.call(E);Xe.value=r.id,Ye.value=p&&s.clientY>p.top+p.height/2?"after":"before",s.dataTransfer&&(s.dataTransfer.dropEffect="move")}async function th(s,r){var ae;s.preventDefault();const g=((ae=s==null?void 0:s.dataTransfer)==null?void 0:ae.getData("application/x-neoctl-prompt-sort-id"))||Oe.value,p=Ye.value;if(Tc(),!g||g===r.id)return;const b=[...l.promptLibrary],E=b.findIndex(ue=>ue.id===g);if(E<0)return;const[R]=b.splice(E,1),q=b.findIndex(ue=>ue.id===r.id);if(!(q<0)){b.splice(q+(p==="after"?1:0),0,R),l.promptLibrary=b;try{const ue=await Ke("/api/prompt-library/reorder",{ids:b.map(Te=>Te.id)});Js(ue.items,l.selectedPromptId),we("提示词顺序已更新")}catch(ue){await yc(),we(ue.message||String(ue))}}}function Tc(){Oe.value="",Xe.value="",Ye.value="before"}async function Ac(){const s=M.value;if(!s.trim()&&l.attachments.length===0)return;if(s.trim()==="/sessions"){M.value="",fr(),await mi();return}if(s.trim()==="/login"){M.value="",fr(),await sr();return}if(s.trim()==="/new"){M.value="",fr(),await bi();return}const r=[...l.attachments],g=r.filter(E=>E.kind==="image"),p=r.filter(E=>E.kind==="file"&&E.absolutePath),b=_u(s,g);wu(g),M.value="",l.attachments=[],fr();try{const E=await fetch(I("/api/submit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b,attachments:[...g,...p]})}),R=await E.json();if(!E.ok||R!=null&&R.error)throw new Error(R.error||`submit ${E.status}`)}catch(E){we(E.message||String(E))}}async function nh(){if(!hc.value){l.queuedInput?await Ic():await Cc();return}const s=M.value,r=[...l.attachments],g=r.filter(E=>E.kind==="image"),p=r.filter(E=>E.kind==="file"&&E.absolutePath),b=_u(s,g);wu(g),M.value="",l.attachments=[],fr();try{await Ke("/api/submit-now",{text:b,attachments:[...g,...p]})}catch(E){we(E.message||String(E))}}async function Cc(){try{await Ke("/api/interrupt",{})}catch(s){xt(s,"停止回答失败")}}async function sh(){try{const s=await Ke("/api/queue/cancel",{});we(s.cancelled?"已撤回排队消息":"没有待撤回的消息")}catch(s){xt(s,"撤回排队消息失败")}}async function Ic(){try{const s=await Ke("/api/queue/send-now",{});we(s.interrupted?"已打断并发送排队消息":"已发送排队消息")}catch(s){xt(s,"发送排队消息失败")}}function di(s){const r=I(s),g=ne;return{url:r,revision:V,isCurrent:()=>g===ne&&r===I(s)}}async function fi(s,r=()=>!0){if(!s.isCurrent()||!r()||s.revision===V)return;const g=V;try{const p=new URL(s.url,window.location.origin);p.pathname="/api/state";const b=await fetch(`${p.pathname}${p.search}`,{cache:"no-store"}),E=await b.json();b.ok&&s.isCurrent()&&r()&&g===V&&ui(E)}catch{}}function gi(){ne+=1,B+=1,G=Promise.resolve(),l.fastModeMutating=!1,l.compactSaving=!1,l.modelSaving=!1,l.contextWindowSaving=!1,l.modelModalOpen=!1,l.contextWindowModalOpen=!1,l.modelError="",l.contextWindowError="",l.pendingSessionSettings={},$=void 0,document.body.classList.remove("context-window-open")}function pi(s,r){we(`${s}${r.deferred===!0?"将在下一轮生效":"已生效"}`)}function Mc(s){$=document.activeElement,document.body.classList.add("context-window-open"),ct(()=>{var r;return(r=document.querySelector(s))==null?void 0:r.focus()})}function Rc(){document.body.classList.remove("context-window-open"),$!=null&&$.isConnected&&$.focus(),$=void 0}function Nc(s){if(s.key!=="Tab")return;const r=[...s.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex="0"]')].filter(b=>b.getClientRects().length),g=r[0],p=r.at(-1);s.shiftKey&&document.activeElement===g?(s.preventDefault(),p==null||p.focus()):!s.shiftKey&&document.activeElement===p&&(s.preventDefault(),g==null||g.focus())}async function Oc(){if(l.compactSaving||l.pendingSessionSettings.compact)return;const s=di("/api/compact");l.compactSaving=!0;try{const r=await Ke(s.url,{},!0);if(!s.isCurrent())return;r.deferred&&(l.pendingSessionSettings.compact=!0),pi("压缩会话",r),await fi(s)}catch(r){s.isCurrent()&&xt(r,"压缩上下文失败")}finally{s.isCurrent()&&(l.compactSaving=!1)}}function Lc(){l.modelDraft=Ks.value.model||dc.value[0]||"";const s=Ks.value.reasoning;l.reasoningDraft=s===null?"off":(s==null?void 0:s.effort)||"default",Xr.value.includes(l.reasoningDraft)||(l.reasoningDraft="default"),l.modelSearch="",l.modelError="",l.modelModalOpen=!0,Mc("#session-model-search")}function nr(){l.modelModalOpen=!1,l.modelError="",Rc()}async function rh(){if(l.modelSaving||!l.modelDraft)return;const s=di("/api/session-model"),r=l.modelDraft,g=Xr.value.includes(l.reasoningDraft)?l.reasoningDraft:"default";l.modelSaving=!0,l.modelError="";try{const p=await Ke(s.url,{model:r,reasoning:g},!0);if(!s.isCurrent())return;delete l.pendingSessionSettings.model,delete l.pendingSessionSettings.reasoning,p.deferred?Object.assign(l.pendingSessionSettings,{model:p.modelSettings.model,reasoning:p.modelSettings.reasoning}):l.modelSettings=p.modelSettings,nr(),pi("模型",p),await fi(s)}catch(p){s.isCurrent()&&(l.modelError=Gt(p,"模型切换失败"))}finally{s.isCurrent()&&(l.modelSaving=!1)}}function Pc(){l.contextWindowDraft=pp.value,l.contextWindowError="",l.contextWindowModalOpen=!0,Mc("#context-window-input")}function hi(){l.contextWindowModalOpen=!1,l.contextWindowError="",Rc()}function ih(){l.contextWindowError=""}async function oh(){var g;if(l.contextWindowSaving)return;const s=String(l.contextWindowDraft||"").trim();if(!/^\d+$/.test(s)||!Number.isSafeInteger(Number(s)*1e3)||Number(s)<=0){l.contextWindowError="请输入大于 0 的整数";return}const r=di("/api/context-window");l.contextWindowSaving=!0,l.contextWindowError="";try{const p=await Ke(r.url,{value:s},!0);if(!r.isCurrent())return;const b=Number(p.contextWindowTokens);if(p.deferred)l.pendingSessionSettings.contextWindowTokens=b;else{delete l.pendingSessionSettings.contextWindowTokens;const E=((g=l.status)==null?void 0:g.metrics)||{};l.status={...l.status,metrics:{...E,contextWindowTokens:b,contextWindowSource:"session",contextUsageRatio:b>0?Number(E.estimatedInputTokens||0)/b:void 0}},na()}hi(),pi("上下文窗口",p),await fi(r)}catch(p){r.isCurrent()&&(l.contextWindowError=Gt(p,"调整失败"))}finally{r.isCurrent()&&(l.contextWindowSaving=!1)}}function $c(){const s=!ms.value,r=++B,g=di("/api/fast-mode");l.fastModeDraft=s,l.fastModeMutating=!0,G=G.catch(()=>{}).then(()=>Ke(g.url,{enabled:s},!0)).then(async p=>{!g.isCurrent()||r!==B||(p.deferred?l.pendingSessionSettings.fastMode=p.fastMode===!0:(delete l.pendingSessionSettings.fastMode,l.fastMode=p.fastMode===!0),l.fastModeMutating=!1,pi("快速模式",p),await fi(g,()=>r===B))}).catch(async p=>{if(!(!g.isCurrent()||r!==B)){l.fastModeMutating=!1,xt(p,"快速模式切换失败");try{const b=await fetch(g.url.replace("/api/fast-mode?","/api/state?")),E=await b.json();b.ok&&g.isCurrent()&&r===B&&ui(E)}catch{}}})}async function mi(){l.activePanel="sessions",l.sessionsLoading=!0;try{const s=await fetch(I("/api/sessions")),r=await s.json().catch(()=>({}));if(!s.ok||r!=null&&r.error||(r==null?void 0:r.ok)===!1)throw rr(r,s.status);l.sessions=r.sessions||[],l.runningSessionIds=r.runningSessionIds||[]}catch(s){xt(s,"加载会话失败")}finally{l.sessionsLoading=!1}}async function ah(s){const r=c,g=u;if(l.pendingResumeSessionId=s,l.sessionResumeLoading=!0,await lu(s))l.activePanel="chat",we("已打开会话");else{const b=await cu(r,g);we(b?"打开会话失败,已恢复原会话":"打开会话失败,运行时连接已断开")}l.sessionResumeLoading=!1,l.pendingResumeSessionId=""}async function Ko(){try{const s=await fetch(I("/api/cpa-quota"));if(!s.ok)throw new Error(`cpa-quota ${s.status}`);const r=await s.json();l.cpaQuotas=Array.isArray(r==null?void 0:r.quotas)?r.quotas:[],l.cpaQuotaIndex>=l.cpaQuotas.length&&(l.cpaQuotaIndex=0),r!=null&&r.config&&(l.cpaConfig.loaded||(l.cpaConfig.url=String(r.config.url||""),l.cpaConfig.password=r.config.hasPassword?Qi:"",l.cpaConfig.loaded=!0),l.cpaConfig.hasPassword=!!r.config.hasPassword)}catch{l.cpaQuotas=[],l.cpaQuotaIndex=0}}async function Dc(){try{const s=await fetch(I("/api/memory"));if(!s.ok)throw new Error(`memory ${s.status}`);const r=await s.json();l.memory={current:(r==null?void 0:r.current)||null,history:Array.isArray(r==null?void 0:r.history)?r.history:[],sampleMs:Number(r==null?void 0:r.sampleMs)||6e4,retentionMs:Number(r==null?void 0:r.retentionMs)||864e5}}catch{}}async function bi(){gi();const s=c,r=u;if(ga(),c=N(),u="",f=!0,sessionStorage.setItem(Yi,c),sessionStorage.removeItem(Cs),l.sessionResumeLoading=!0,l.pendingResumeSessionId="",await Qs({silent:!0}))l.activePanel="chat",we("已创建新会话"),li();else{const p=await cu(s,r);we(p?"新建会话失败,已恢复原会话":"新建会话失败,运行时连接已断开")}l.sessionResumeLoading=!1}function Go(s){var r;return!!s&&String(((r=l.session)==null?void 0:r.sessionId)||"")===String(s)}function Vo(s){return l.runningSessionIds.includes(s)}async function lh(s){const r=l.sessions.find(p=>p.sessionId===s);if(Go(s)){we(a.SESSION_ACTIVE);return}if(Vo(s)){we(a.SESSION_RUNNING);return}if(await tr({title:"删除会话?",message:`“${(r==null?void 0:r.title)||s||"这个会话"}”删除后无法恢复。`,confirmLabel:"确认删除",tone:"danger"}))try{await Ke("/api/sessions/delete",{sessionId:s}),await mi(),we("会话已删除")}catch(p){xt(p,"删除会话失败")}}async function sr(s){l.activePanel="settings",l.settingsPage="";const r=s?`?provider=${encodeURIComponent(s)}`:"";try{const g=await fetch(I(`/api/login${r}`)),p=await g.json().catch(()=>({}));if(!g.ok||p!=null&&p.error||(p==null?void 0:p.ok)===!1)throw rr(p,g.status);l.login=p,Q.value=p.provider,Object.keys(ye).forEach(b=>delete ye[b]),Object.assign(ye,p.values||{}),await Promise.all([Ko(),Ap(),Sp()])}catch(g){xt(g,"加载模型配置失败")}}async function Bc(s){we(s!=null&&s.deferred?"已保存,下一轮生效":"提示词已保存"),await Ys()}async function ch(){await sr(Q.value)}async function Uc(){var p;const[s,r]=await Promise.allSettled([Ke("/api/login",{provider:Q.value,values:{...ye}}),Ke("/api/cpa-config",{url:l.cpaConfig.url,password:l.cpaConfig.password===Qi?"":l.cpaConfig.password,preservePassword:l.cpaConfig.hasPassword&&(!l.cpaConfig.password||l.cpaConfig.password===Qi)})]);if(r.status==="fulfilled"){const b=r.value;l.cpaQuotas=Array.isArray(b==null?void 0:b.quotas)?b.quotas:[],l.cpaQuotaIndex=0,l.cpaConfig.loaded=!0,l.cpaConfig.hasPassword=!!((p=b==null?void 0:b.config)!=null&&p.hasPassword),l.cpaConfig.password=l.cpaConfig.hasPassword?Qi:""}if(s.status==="fulfilled"&&r.status==="fulfilled"){we("模型配置已保存");return}const g=[];s.status==="rejected"&&g.push(Gt(s.reason,"模型配置保存失败")),r.status==="rejected"&&g.push(Gt(r.reason,"CPA 配置保存失败")),we(g.join(";"))}function qo(s){const r=Number.parseFloat(String(s??"").replace("%",""));return Number.isFinite(r)?Math.max(0,Math.min(100,r)):0}function Zo(s){const r=Number.parseFloat(String(s??"").replace("%",""));if(!Number.isFinite(r))return"—";const g=qo(r);return`${g.toFixed(g%1?1:0)}%`}function Qo(s){const r=new Date(s);return Number.isNaN(r.getTime())?"—":new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r)}function Fc(s){const r=new Date(s);return Number.isNaN(r.getTime())?"—":new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r)}function zc(s){const r=l.cpaQuotas.length;r<2||(l.cpaQuotaIndex=(l.cpaQuotaIndex+s+r)%r)}function uh(s){const r=String(s||"").trim();if(!r)return"Codex 凭据";const[g,p]=r.split("@");return!p||g.length<=3?r:`${g.slice(0,3)}***@${p}`}function Gn(s){const r=Number(s);if(!Number.isFinite(r)||r<0)return"—";const g=r/1024/1024;return`${g.toFixed(g>=100?0:1)} MB`}function dh(s){const r=new Date(s);return Number.isNaN(r.getTime())?"等待采样":new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(r)}function fh(s){const r=new Date(s);return Number.isNaN(r.getTime())?"—":new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(r)}function gh(s){const r=oi.value.length;if(!r)return;const g=s.currentTarget.getBoundingClientRect(),p=Math.min(1,Math.max(0,(s.clientX-g.left)/Math.max(1,g.width)));et.value=r===1?0:Math.round(p*(r-1))}function Hc(){et.value=-1}async function Ke(s,r,g=!1){const p=await fetch(g?s:I(s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),b=await p.json().catch(()=>({}));if(!p.ok||b!=null&&b.error||(b==null?void 0:b.ok)===!1)throw rr(b,p.status);return b}class ph extends Error{constructor(r,g=""){super(r),this.name="ActionRequestError",this.code=g}}function rr(s,r){const g=String((s==null?void 0:s.errorCode)||(r===404?"API_NOT_FOUND":""));return new ph((s==null?void 0:s.error)||`请求失败(${r})`,g)}function Gt(s,r="操作失败"){const g=String((s==null?void 0:s.code)||"");if(g&&a[g])return a[g];const p=String((s==null?void 0:s.message)||s||"").trim();return p?`${r}:${p}`:r}function xt(s,r){we(Gt(s,r))}function Vn(s){const r=Tm(Em(Sm(s.text||"")));return s.kind==="system"||s.kind==="meta"?hh(r):r}function hh(s){return String(s||"").replace(/^Interactive web UI enabled\.\s*Type \/help for commands\.\s*/i,"工作台已连接。输入 `/help` 可查看命令说明。").replace(/\bSession:\s*/gi,"会话:").replace(/\bTip:\s*/gi,"提示:").replace(/Start fresh/gi,"重新开始").replace(/\/reset clears the visible conversation and adds a reset marker so you can start a fresh thread in the same session\./gi,"`/reset` 会清空当前可见对话,并插入一个重置标记,方便你在同一会话中重新开始。").replace(/^new session\s+/i,"已新建会话:").replace(/^deleted session\s+/i,"已删除会话:").replace(/^resumed session\s+(.+?):\s+(\d+)\s+messages?\s+from\s+(.+)$/i,"已恢复会话:$1,共载入 $2 条消息,来源:$3").replace(/\((\d+)\s+resumed messages\)/gi,"(已恢复 $1 条消息)").replace(/\bType \/help for commands\./gi,"输入 `/help` 可查看命令说明。")}function qn(s){var r;if(s.kind==="tool"||s.toolName){const g=Zn(s);return(r=s==null?void 0:s.toolPresentation)!=null&&r.label?String(s.toolPresentation.label):ir(s)?"任务计划":s.title?n[s.title]||n[String(s.title).toLowerCase()]||s.title:n[g]||g}return s.title?n[s.title]||n[String(s.title).toLowerCase()]||s.title:s.kind==="assistant"?"助手":s.kind==="user"?"你":s.kind==="thinking"?"思考":"系统"}function Zn(s){return String((s==null?void 0:s.toolName)||"tool").trim()||"tool"}function ir(s){return(s==null?void 0:s.kind)==="tool"&&Zn(s)==="plan_update"}function mh(s){return ir(s)||Dt(s)||_s(s).length>0}function bh(s){return(s==null?void 0:s.kind)==="meta"&&String((s==null?void 0:s.title)||"")==="提示词用法"}function yi(s){return!!(s!=null&&s.compaction&&typeof s.compaction=="object")}function yh(s){var r;return(r=s==null?void 0:s.compaction)!=null&&r.modelDriven?"模型生成摘要":"确定性摘要"}function ki(){l.compactionDetailLineId=void 0,!l.runtimeContextModal&&!l.runtimeContextDetail&&!l.projectContextOpen&&document.body.classList.remove("runtime-context-open")}function or(s){return((s==null?void 0:s.kind)==="tool"||(s==null?void 0:s.kind)==="error"&&(s==null?void 0:s.toolName))&&!mh(s)}function Yo(s){return(s==null?void 0:s.kind)==="tool-group"&&Array.isArray(s.lines)}function kh(s){return!s||s.presentationLevel==="primary"||s.kind==="user"||s.kind==="assistant"?!0:Dt(s)}function vh(s){return!s||kh(s)?!1:["thinking","tool","error","meta","system","agent"].includes(String(s.kind||"system"))}function _h(s){const r=[];let g=[];const p=()=>{if(!g.length)return;const b=g.some(E=>(E==null?void 0:E.kind)!=="thinking");g.length===1||!b?r.push(...g):r.push({id:`tool-group:${g[0].id}`,kind:"tool-group",lines:g,live:g.some(E=>(E==null?void 0:E.live)===!0)}),g=[]};for(const b of s||[])vh(b)?g.push(b):(p(),r.push(b));return p(),r}function ks(s){return l.expandedToolGroups[s==null?void 0:s.id]===!0}async function wh(s){Yo(s)&&(l.expandedToolGroups[s.id]=!ks(s),await ct(),Aa())}function jc(s){const r=new Map;for(const p of(s==null?void 0:s.lines)||[]){const b=(p==null?void 0:p.kind)==="thinking"?"思考":qn(p);b&&r.set(b,(r.get(b)||0)+1)}const g=[...r.entries()].map(([p,b])=>({name:p,count:b}));return g.length?g:[{name:"过程",count:1}]}function Jo(s){return((s==null?void 0:s.lines)||[]).flatMap((r,g)=>{var b;const p=String(((b=r==null?void 0:r.toolDisplay)==null?void 0:b.purpose)||"").trim();return p?[{id:`${r.id}:purpose:${g}`,text:p,live:(r==null?void 0:r.live)===!0}]:[]})}let Wc;function Kc(s,r){Cn(s)&&(Wc=document.activeElement,l.toolDetailLineId=s.id,document.body.classList.add("tool-detail-open"),ct(()=>{var g;return(g=document.querySelector(".tool-result-modal-close"))==null?void 0:g.focus()}))}function xh(s){return ws(Re.parse(String(s??"")))}function vs(){l.toolDetailLineId=void 0,document.body.classList.remove("tool-detail-open");const s=Wc;ct(()=>{s!=null&&s.isConnected&&s.focus()})}function Sh(s){if(s.key!=="Tab")return;const r=Array.from(s.currentTarget.querySelectorAll('button:not(:disabled), [tabindex="0"]')),g=r[0],p=r.at(-1);s.shiftKey&&document.activeElement===g?(s.preventDefault(),p==null||p.focus()):!s.shiftKey&&document.activeElement===p&&(s.preventDefault(),g==null||g.focus())}function Gc(s){var p;const r=s.target instanceof HTMLImageElement?s.target:null;if(!r||r.closest(".image-preview-modal"))return;const g=((p=r.closest("[data-preview-src]"))==null?void 0:p.dataset.previewSrc)||r.currentSrc||r.src;g&&(s.preventDefault(),s.stopPropagation(),Eh(g,r.alt))}async function Vc(s){const r=s.target instanceof Element?s.target.closest('a[data-resource-download="true"]'):null;if(!(r instanceof HTMLAnchorElement))return;s.preventDefault(),s.stopPropagation();const g=Number(r.dataset.resourceExpiresAt);if(Number.isFinite(g)&&g>0&&Date.now()>=g){we("下载链接已过期,请重新生成");return}try{const p=await fetch(r.href);if(!p.ok){we(p.status===404||p.status===410?"下载链接已过期,请重新生成":`下载失败(${p.status})`);return}const b=URL.createObjectURL(await p.blob()),E=document.createElement("a");E.href=b,E.download=r.download||"download",document.body.appendChild(E),E.click(),E.remove(),setTimeout(()=>URL.revokeObjectURL(b),3e4)}catch{we("下载失败,请稍后重试")}}function Eh(s,r=""){l.imagePreview={src:String(s||""),caption:String(r||"").trim()},document.body.classList.add("image-preview-open")}function Xo(){l.imagePreview=void 0,document.body.classList.remove("image-preview-open")}function En(s){return e0(s)}function qc(s){return Ah(s).summary}function Zc(s){var r;return(((r=s==null?void 0:s.toolDisplay)==null?void 0:r.previews)||[]).filter(g=>g.content!==void 0&&g.content!==null&&String(g.content).trim()!=="")}function Tn(s){var r;return Array.isArray((r=s==null?void 0:s.toolStream)==null?void 0:r.steps)?s.toolStream.steps:[]}function An(s){return Zn(s)==="subagent_run"}function vi(s){return["file_write","file_edit","write_file","edit_file"].includes(Zn(s).toLowerCase())}function ea(s){const r=Zn(s).toLowerCase();return r==="terminal_run"||r==="terminal_control"}function Qc(s){var r;return Array.isArray((r=s==null?void 0:s.toolDisplay)==null?void 0:r.previews)&&s.toolDisplay.previews.length>0&&(!Zn(s).startsWith("subagent_")||Zn(s)==="subagent_message")&&!(ea(s)&&(s==null?void 0:s.live)===!0&&Th(s))}function ar(s){var E,R,q,ae;const r=Array.isArray((E=s==null?void 0:s.toolStream)==null?void 0:E.chunks)?s.toolStream.chunks:[];if(r.length)return r.map(ue=>String((ue==null?void 0:ue.text)||"")).join("").trimEnd();const g=String(((R=s==null?void 0:s.toolStream)==null?void 0:R.stdout)||""),p=String(((q=s==null?void 0:s.toolStream)==null?void 0:q.stderr)||""),b=String(((ae=s==null?void 0:s.toolStream)==null?void 0:ae.output)||"");return[g,p,b].filter(Boolean).join(`
|
|
112
|
-
`).trimEnd()}function lr(s){var p,b,E;const r=String(((p=s==null?void 0:s.toolStream)==null?void 0:p.message)||"").trim(),g=String(((b=s==null?void 0:s.toolDisplay)==null?void 0:b.purpose)||((E=s==null?void 0:s.toolDisplay)==null?void 0:E.subject)||"").trim();return r&&r!==g?r:""}function Yc(s){return Tn(s).map(r=>`${(r==null?void 0:r.status)==="completed"?"✓":(r==null?void 0:r.status)==="failed"?"×":"•"} ${String((r==null?void 0:r.message)||"").trim()}${(r==null?void 0:r.status)==="unknown"||!(s!=null&&s.live)&&(r==null?void 0:r.status)==="running"?"(阶段结果未提供)":""}`.trimEnd()).join(`
|
|
113
|
-
`)}function _i(s){const r=new Map;for(const g of Tn(s)){const p=String((g==null?void 0:g.toolName)||"").trim();if(!p)continue;const b=r.get(p);r.set(p,{label:(b==null?void 0:b.label)||String((g==null?void 0:g.toolLabel)||p),count:((b==null?void 0:b.count)||0)+1})}return[...r.entries()].map(([g,p])=>({name:g,label:p.label,count:p.count}))}function Jc(s){return Tn(s).flatMap((r,g)=>{const p=String((r==null?void 0:r.message)||"").trim();return p?[{key:`${r.key}:${g}`,purpose:p}]:[]})}function wi(s){return l.expandedToolGroups[`agent:${s==null?void 0:s.id}`]===!0}async function Xc(s){const r=`agent:${s==null?void 0:s.id}`;l.expandedToolGroups[r]=!l.expandedToolGroups[r],await ct(),Aa()}function Th(s){return!!(lr(s)||Tn(s).length||ar(s))}function xi(s){var b,E,R;const r=Number((b=s==null?void 0:s.toolStream)==null?void 0:b.current),g=Number((E=s==null?void 0:s.toolStream)==null?void 0:E.total);if(!Number.isFinite(r))return"";const p=String(((R=s==null?void 0:s.toolStream)==null?void 0:R.unit)||"").trim();return Number.isFinite(g)&&g>0?`${r}/${g}${p?` ${p}`:""}`:`${r}${p?` ${p}`:""}`}function Ah(s){const r=(s==null?void 0:s.live)===!0,g=(s==null?void 0:s.titleStatus)==="failure"||(s==null?void 0:s.kind)==="error",p=r?{key:"running",label:"运行中"}:g?{key:"failed",label:"失败"}:{key:"completed",label:"成功"},b=s!=null&&s.toolDisplay&&typeof s.toolDisplay=="object"?s.toolDisplay:void 0,E=String((b==null?void 0:b.purpose)||(b==null?void 0:b.subject)||(s==null?void 0:s.bodyTitle)||"").trim();return{status:p,summary:E}}function Ch(s,r){const g=String(s||"").replace(/\s+/g," ").trim();return g.length>r?`${g.slice(0,r)}…`:g}function Dt(s){return(s==null?void 0:s.kind)==="tool"&&String((s==null?void 0:s.toolName)||"").toLowerCase()==="image_create"}function ta(s){return(s==null?void 0:s.live)&&Dt(s)}function eu(s){return Dt(s)&&(s==null?void 0:s.pendingReplacement)===!0}function Ih(s){var g,p;if(Pi(s)&&!Dt(s)||((g=s==null?void 0:s.toolPresentation)==null?void 0:g.visibility)==="hidden"&&(s==null?void 0:s.kind)!=="error")return!0;if((s==null?void 0:s.kind)!=="user")return!1;const r=Su(s);return Im(r)?String((p=Mm(r))==null?void 0:p.id)!==String(s==null?void 0:s.id):!Vn(s)&&Oi(s).length===0&&Ni(s==null?void 0:s.text).length===0}function Mh(s){const r=new Set,g=Date.now();for(const p of s||[]){if(!ta(p))continue;const b=String(p.id);r.add(b),l.liveToolStartedAt[b]||(l.liveToolStartedAt[b]=g)}for(const p of Object.keys(l.liveToolStartedAt))r.has(p)||delete l.liveToolStartedAt[p]}function cr(s){if(!ta(s))return"";const r=l.liveToolStartedAt[String(s.id)];return r?Yn(l.clockTick-r):""}function na(){var r,g,p,b,E,R,q,ae,ue;const s=(g=(r=l.status)==null?void 0:r.metrics)==null?void 0:g.contextUsageRatio;sa("context",s===void 0?0:s*100),sa("inputTokens",Number(((b=(p=l.status)==null?void 0:p.usage)==null?void 0:b.inputTokens)??((R=(E=l.status)==null?void 0:E.metrics)==null?void 0:R.estimatedInputTokens)??0)),sa("outputTokens",Number(((ae=(q=l.status)==null?void 0:q.usage)==null?void 0:ae.outputTokens)??((ue=l.status)==null?void 0:ue.streamedOutputTokens)??0))}function sa(s,r){const g=l.composerMetrics[s],p=Number.isFinite(r)?Math.max(0,r):0;if(!g.initialized){g.display=p,g.target=p,g.initialized=!0;return}Math.abs(g.target-p)<.001||(g.target=p,g.bump+=1,Rh())}function Rh(){if(W)return;const s=()=>{let r=!1;for(const g of Object.values(l.composerMetrics)){const p=g.target-g.display;if(Math.abs(p)<.01){g.display=g.target;continue}const b=Math.min(.42,Math.max(.14,Math.abs(p)>1e3?.32:.2)),E=Math.sin(Date.now()/90)*Math.min(Math.abs(p)*.018,g.target*.006+1);g.display+=p*b+E,g.display<0&&(g.display=0),r=!0}r?W=requestAnimationFrame(s):W=0};W=requestAnimationFrame(s)}function ra(s){return`bump-${l.composerMetrics[s].bump%2}`}function Nh(s=[]){return new Map(s.map(r=>[String(r.taskId||r.agentId||r.description||r.type),r.status]))}function Qn(s){var g;const r=String((s==null?void 0:s.taskId)||(s==null?void 0:s.agentId)||(s==null?void 0:s.sessionId)||"");return(s==null?void 0:s.kind)==="terminal"?`${s.ownerSessionId||((g=l.session)==null?void 0:g.sessionId)||""}:${r}`:r}function Si(s){return String((s==null?void 0:s.description)||(s==null?void 0:s.command)||(s==null?void 0:s.type)||"后台任务").replace(/\s+/g," ").trim()||"后台任务"}function ur(s){const r=Si(s);return r.length>72?`${r.slice(0,72)}…`:r}function tu(s){if((s==null?void 0:s.kind)==="terminal")return s.status!=="running"?Number.isFinite(s.durationMs)&&s.durationMs>=0?Yn(s.durationMs):"":Number.isFinite(s.createdAt)&&s.createdAt<=l.clockTick?Yn(l.clockTick-s.createdAt):"";if((s==null?void 0:s.kind)==="agent"){const b=Xw(s,l.clockTick);return b===void 0?"":Yn(b)}const r=s==null?void 0:s.createdAt,g=Number(r),p=Number.isFinite(g)&&g>0?g:Date.parse(String(r||""));return!Number.isFinite(p)||p<=0?"":Yn((s!=null&&s.completedAt?Date.parse(s.completedAt):l.clockTick)-p)}function nu(s){return String((s==null?void 0:s.prompt)||(s==null?void 0:s.command)||"").trim()}function Ei(s){l.backgroundTaskDetail={...s},document.body.classList.add("tool-detail-open")}function Ti(){l.backgroundTaskDetail=void 0,document.body.classList.remove("tool-detail-open")}function Oh(s="ready"){return{ready:"就绪",running:"运行中",preparing:"准备中",calling_model:"调用模型",thinking:"推理中",running_tools:"调用工具",injecting_context:"注入上下文",compacting:"压缩上下文",stopped:"已停止",error:"出错"}[s]||s}function ia(s){return{pending:"排队中",running:"运行中",completed:"已完成",failed:"失败",killed:"已停止",stopped:"已停止",exited:"已退出",lost:"已失联",unknown:"未提供"}[s]||(s?"未知状态":"未提供")}function oa(s){return i[s]||s}function Lh(s){return(s||[]).map(r=>({value:r,label:o[r]||r}))}function Ph(s){return((s==null?void 0:s.options)||[]).map(r=>({value:r,label:r||"默认"}))}function $h(s){return!["ansi","plain","diff"].includes(s.format)&&["assistant","thinking","system","tool"].includes(s.kind)}function Dh(s){return JSON.stringify((s==null?void 0:s.inputSchema)||{},null,2)}function aa(s){l.runtimeContextModal=s,l.runtimeContextDetail=void 0,document.body.classList.add("runtime-context-open"),s==="plugins"&&Ho(),s==="tools"&&ai()}function la(){l.runtimeContextDetail=void 0,l.runtimeContextModal="",document.body.classList.remove("runtime-context-open")}function ca(){l.runtimeContextDetail=void 0}function Bh(){l.projectContextOpen=!0,l.projectContextDocument=void 0,document.body.classList.add("runtime-context-open")}function Uh(s){l.projectContextDocument=s}function ua(){if(l.projectContextDocument){l.projectContextDocument=void 0;return}l.projectContextOpen=!1,document.body.classList.remove("runtime-context-open")}async function Fh(){l.cwdPicker.open=!0,l.cwdPicker.input=l.cwd||"",l.cwdPicker.selectionExplicit=!1,l.cwdPicker.error="",document.body.classList.add("cwd-picker-lock"),await Ci(l.cwd)}function Ai(){l.cwdPicker.mutating||(l.cwdPicker.open=!1,l.cwdPicker.error="",document.body.classList.remove("cwd-picker-lock"))}async function Ci(s=l.cwdPicker.input){l.cwdPicker.loading=!0,l.cwdPicker.error="";try{const r=new URL("/api/cwd",window.location.origin);String(s||"").trim()&&r.searchParams.set("path",String(s).trim());const g=await fetch(I(`${r.pathname}${r.search}`)),p=await g.json().catch(()=>({}));if(!g.ok||p!=null&&p.error||(p==null?void 0:p.ok)===!1)throw rr(p,g.status);da(p)}catch(r){l.cwdPicker.error=Gt(r,"无法打开路径")}finally{l.cwdPicker.loading=!1}}function zh(s){return String(s||"").replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).at(-1)||String(s||"")}function da(s){const r=String(s.cwd||""),g={name:zh(r),path:r};l.cwdPicker.cwd=r,l.cwdPicker.parent=s.parent||"",l.cwdPicker.home=s.home||"",l.cwdPicker.locations=Array.isArray(s.locations)?s.locations:l.cwdPicker.locations,l.cwdPicker.entries=Array.isArray(s.entries)?s.entries:[],l.cwdPicker.input=r,l.cwdPicker.selectedPath=s.fallback?"":r,l.cwdPicker.selectionExplicit=!1,l.cwdPicker.treeRoots=[g],l.cwdPicker.treeChildren={[r]:l.cwdPicker.entries},l.cwdPicker.treeExpanded={[r]:!0}}async function Hh(s){const r=new URL("/api/cwd",window.location.origin);r.searchParams.set("path",s);const g=await fetch(I(`${r.pathname}${r.search}`)),p=await g.json().catch(()=>({}));if(!g.ok||p!=null&&p.error||(p==null?void 0:p.ok)===!1)throw rr(p,g.status);return Array.isArray(p.locations)&&(l.cwdPicker.locations=p.locations),p}async function jh(s){const r=s.path;if(l.cwdPicker.treeExpanded[r]){l.cwdPicker.treeExpanded={...l.cwdPicker.treeExpanded,[r]:!1};return}l.cwdPicker.error="";try{if(!l.cwdPicker.treeChildren[r]){const g=await Hh(r);l.cwdPicker.treeChildren={...l.cwdPicker.treeChildren,[r]:g.entries||[]}}l.cwdPicker.treeExpanded={...l.cwdPicker.treeExpanded,[r]:!0}}catch(g){l.cwdPicker.error=Gt(g,"无法展开路径")}}function Wh(s){l.cwdPicker.selectedPath=s.path,l.cwdPicker.selectionExplicit=!0,l.cwdPicker.input=s.path}async function Kh(){const s=String(l.cwdPicker.input||"").trim();if(s){l.cwdPicker.mutating=!0,l.cwdPicker.error="";try{const r=await Ke("/api/cwd/create",{path:s});da(r)}catch(r){l.cwdPicker.error=Gt(r,"新建失败")}finally{l.cwdPicker.mutating=!1}}}async function Gh(s){if(await tr({title:"删除文件夹?",message:s.path,confirmLabel:"删除",tone:"danger"})){l.cwdPicker.mutating=!0;try{const g=await Ke("/api/cwd/delete",{path:s.path});da(g)}catch(g){l.cwdPicker.error=Gt(g,"删除失败")}finally{l.cwdPicker.mutating=!1}}}async function Vh(){const s=String(l.cwdPicker.selectionExplicit?l.cwdPicker.selectedPath:l.cwdPicker.input).trim();if(s&&!(!l.cwdPicker.selectionExplicit&&s===l.cwdPicker.cwd&&s!==l.cwd)){l.cwdPicker.mutating=!0,l.cwdPicker.error="";try{const r=await Ke("/api/cwd/change",{path:s});l.cwd=r.cwd||s,l.cwdPicker.open=!1,document.body.classList.remove("cwd-picker-lock"),await Ys(),we(r.unchanged?"工作目录未变":"工作目录已切换")}catch(r){l.cwdPicker.error=Gt(r,"切换失败")}finally{l.cwdPicker.mutating=!1}}}function qh(s){s&&(l.runtimeContextDetail={kind:"tool",title:s.name,meta:s.strict?"严格模式":"兼容模式",description:s.description||"",schema:Dh(s)})}function Ii(s){if(ir(s))return Qh(s);if(Cn(s))return ma(s);if(_s(s).length)return fu(s);if(Xh(s))return sm(s);if(em(s))return tm(s);const r=Vn(s),g=gu(s),p=g.map(q=>`${q.kind}:${q.reference||""}:${q.url}:${q.label||q.downloadName||""}:${q.expiresAt||""}`).join("|"),b=[s.id,s.kind,s.format,s.title,s.titleStatus,s.live?"1":"0",p,r].join(""),E=z.get(b);if(E!==void 0)return E;let R;return s.format==="diff"?R=ou(r):s.format==="ansi"||!$h(s)?R=Lu(Ge(Di(r))):R=am(ws(Re.parse(r||""),g.map(pu)),g),z.set(b,R),R}function Zh(s){if(!s)return"";if(Dt(s))return pm(s);const r=Vn(s);if(s.format==="diff"||/(?:^|\n)---\s+.+\n\+\+\+\s+/.test(r))return ou(r);if(s.format==="ansi")return`<pre class="tool-detail-pre">${Ge(Di(r))}</pre>`;const g=ha(r);if(g){const p=JSON.stringify(g,null,2);return ws(Re.parse(`\`\`\`json
|
|
114
|
-
${p}
|
|
115
|
-
\`\`\``))}return`<pre class="tool-detail-pre">${Ge(Di(r))}</pre>`}function Qh(s){const r=Yh(s),g=Array.isArray(r==null?void 0:r.items)?r.items:[];if(!r||!g.length)return ws(Re.parse(Vn(s)||""));const p=ru(g),b=Number.isFinite(Number(r.completed))?Number(r.completed):p.completed,E=Number.isFinite(Number(r.total))?Number(r.total):p.total,R=Ge(r.title||"任务计划"),q=su(g);return`<section class="plan-card"><div class="plan-card-head"><strong>${R}</strong><span class="plan-progress-label">${b} / ${E}</span></div><ol class="plan-items">${q}</ol></section>`}function su(s,r=0){return s.map((g,p)=>{const b=iu(g==null?void 0:g.status),E=b==="completed"?"✓":b==="in_progress"?"●":b==="failed"?"!":String(p+1),R=Array.isArray(g==null?void 0:g.subitems)?g.subitems:[],q=R.length?`<ol class="plan-subitems" aria-label="${Ge((g==null?void 0:g.description)||`步骤 ${p+1}`)}的子步骤">${su(R,r+1)}</ol>`:"";return`<li class="plan-item status-${b}" data-plan-depth="${r}"><div class="plan-item-row"><span class="plan-item-marker" role="img" aria-label="${Jh(b)}">${E}</span><span class="plan-item-text">${Ge((g==null?void 0:g.description)||`步骤 ${p+1}`)}</span></div>${q}</li>`}).join("")}function ru(s){return s.reduce((r,g)=>{if(r.total+=1,iu(g==null?void 0:g.status)==="completed"&&(r.completed+=1),Array.isArray(g==null?void 0:g.subitems)&&g.subitems.length){const p=ru(g.subitems);r.total+=p.total,r.completed+=p.completed}return r},{total:0,completed:0})}function Yh(s){const r=String((s==null?void 0:s.text)||""),g=ha(r),p=g!=null&&g.output&&typeof g.output=="object"?g.output:g;if(Array.isArray(p==null?void 0:p.items))return p;const b=r.split(/\r?\n/).map(ue=>ue.trim()).filter(Boolean),E=/^(\d+)\s*\/\s*(\d+)\s+completed/i.exec(b[0]||""),q=b.filter(ue=>/^[-*]\s+/.test(ue)).map(ue=>{let Te=ue.replace(/^[-*]\s+/,"").trim(),He="pending";return/^~~[\s\S]+~~$/.test(Te)?(He="completed",Te=Te.slice(2,-2).trim()):/^[▶►●]\s*/.test(Te)?(He="in_progress",Te=Te.replace(/^[▶►●]\s*/,"").trim()):/^[!✗×]\s*/.test(Te)&&(He="failed",Te=Te.replace(/^[!✗×]\s*/,"").trim()),{description:Te,status:He}});return{title:"当前执行计划",note:b.slice(E?1:0).filter(ue=>!/^[-*]\s+/.test(ue)).join(" "),items:q,completed:E?Number(E[1]):q.filter(ue=>ue.status==="completed").length,total:E?Number(E[2]):q.length}}function iu(s){const r=String(s||"pending").toLowerCase().replace(/[\s-]+/g,"_");return r==="complete"||r==="done"?"completed":r==="running"||r==="inprogress"?"in_progress":r==="error"?"failed":["completed","in_progress","failed","pending"].includes(r)?r:"pending"}function Jh(s){return{completed:"已完成",in_progress:"进行中",failed:"失败",pending:"待处理"}[s]||"待处理"}function ou(s){return`<pre class="diff-block">${Ge(s)}</pre>`}function Cn(s){return Dt(s)&&/\b(ok|failed|generated|edited|image\s+(?:generate|edit)\s+failed)\b/i.test(String((s==null?void 0:s.text)||""))}function Xh(s){const r=String((s==null?void 0:s.title)||"").toLowerCase();return(s==null?void 0:s.kind)==="tool"&&r==="image_note"}function em(s){const r=String((s==null?void 0:s.title)||"").toLowerCase();return(s==null?void 0:s.kind)==="tool"&&r==="skill_read"}function tm(s){return ws(Re.parse(`技能${nm((s==null?void 0:s.text)||"")}`))}function nm(s){var b,E,R;const r=String(s||""),g=((b=/\bname:\s*([^\s]+)/i.exec(r))==null?void 0:b[1])||((E=/(?:^|\s)skill:\s*([^\s]+)/i.exec(r))==null?void 0:E[1])||((R=/(?:^|\s)id:\s*([^\s]+)/i.exec(r))==null?void 0:R[1]),p=String(g||"").trim();return p||""}function sm(s){return ws(Re.parse(`图片记录${rm((s==null?void 0:s.text)||"")}`))}function rm(s){const r=im(s);return r?` ${r}`:""}function im(s){var q,ae,ue,Te,He;const r=String(s||""),g=(q=/(?:^|\s)(?:storagePath|path|file|filename):\s*([^\s]+\.(?:png|jpe?g|webp|gif|bmp|avif|txt))/i.exec(r))==null?void 0:q[1],p=g?fa(g.split(/[\\/]/).pop()||""):"";if(p)return p;const b=(ae=/(?:^|\s)imageRef:\s*([^\s]+)/i.exec(r))==null?void 0:ae[1],E=fa(b||"");if(E)return E;const R=((ue=/(?:^|\s)tags:\s*(?:[-*]\s*)?([^\n\r,,]+)/i.exec(r))==null?void 0:ue[1])||((Te=/(?:^|\s)detectedText:\s*(?:[-*]\s*)?([^\n\r,,]+)/i.exec(r))==null?void 0:Te[1])||((He=/(?:^|\s)caption:\s*([^.,,。;\n\r]{2,24})/i.exec(r))==null?void 0:He[1]);return fa(R||"")}function fa(s){let r=String(s||"").trim();return r=r.replace(/\.base64\.txt$/i,"").replace(/\.(?:png|jpe?g|webp|gif|bmp|avif|txt)$/i,""),r=r.replace(/^[-*]\s*/,"").replace(/[_-]+/g," ").replace(/\s+/g," ").trim(),!r||/^ok$/i.test(r)?"":r.length>18?`${r.slice(0,18)}...`:r}async function au(){if(!(m||!u)){m=!0;try{if(!await lu(u))throw new Error("无法重新绑定目标会话")}catch(s){we(`会话恢复失败:${s.message||s}`)}finally{m=!1}}}async function lu(s){var p;const r=String(s||"").trim();return!r||(r!==u&&gi(),ga(),u=r,f=!1,sessionStorage.setItem(Cs,r),!await Qs({silent:!0})||String(((p=l.session)==null?void 0:p.sessionId)||"")!==r)?!1:(li(),!0)}async function cu(s,r){gi(),ga(),c=s,u=r,f=!r,sessionStorage.setItem(Yi,s),r?sessionStorage.setItem(Cs,r):sessionStorage.removeItem(Cs);const g=await Qs({silent:!0});return g&&li(),g}function ga(){ze&&ze.close(),ze=void 0,tt&&cancelAnimationFrame(tt),tt=0,ci(),rn=void 0,w=!1,l.connected=!1,l.connecting=!0}function _s(s){return Array.isArray(s==null?void 0:s.resources)?s.resources.filter(r=>r&&typeof r=="object"&&typeof r.url=="string"&&r.url):[]}function pa(s){return _s(s).filter(r=>r.kind==="embed")}function uu(s){return _s(s).filter(r=>r.kind!=="embed")}function om(s){const r=new URL(s.url,window.location.origin);return r.searchParams.set("theme",se.value),r.origin===window.location.origin?`${r.pathname}${r.search}${r.hash}`:r.href}function du(s){const r=Number(s==null?void 0:s.height);return Number.isFinite(r)?Math.max(240,Math.min(1600,Math.round(r))):640}function fu(s){const r=uu(s);return r.length?`<div class="resource-result"><div class="resource-grid">${r.map((p,b)=>{const E=Ge(p.label||p.downloadName||`资源 ${b+1}`),R=Ge(p.url),q=p.sizeBytes?_a(p.sizeBytes):"",ae=p.expiresAt?cm(p.expiresAt):"",ue=[q,ae].filter(Boolean).join(" · "),Te=p.kind==="download"||p.downloadName,He=Te?"下载":"打开",Bt=Te?` download="${Ge(p.downloadName||p.label||"")}"`:' target="_blank" rel="noreferrer noopener"';if(Te){const ln=Ge(q.replace(/\s+/g,"")),x=Number(p.expiresAt)||0;return`<a class="resource-file-link" href="${R}"${Bt} data-resource-download="true" data-resource-expires-at="${x}"><span class="resource-file-name">${E}</span>${ln?`<span class="resource-file-size">(${ln})</span>`:""}</a>`}return`<a class="resource-card resource-${Ge(p.kind||"link")}" href="${R}"${Bt}><span class="resource-icon" aria-hidden="true"></span><span class="resource-main"><strong>${E}</strong><span>${Ge(ue||(Te?"文件已就绪":"资源已就绪"))}</span></span><span class="resource-action"><span>${He}</span><i aria-hidden="true">${Te?"↓":"↗"}</i></span></a>`}).join("")}</div></div>`:Lu(Ge(Di(Vn(s))))}function gu(s){if((s==null?void 0:s.kind)!=="assistant")return[];const r=l.lines||[],g=r.findIndex(R=>String(R==null?void 0:R.id)===String(s==null?void 0:s.id)),p=g>=0?g:r.length,b=[],E=new Set;for(let R=0;R<p;R+=1){const q=r[R];if(!(q!=null&&q.live))for(const ae of _s(q))E.has(ae.url)||(E.add(ae.url),b.push(ae))}return b}function am(s,r){if(!r.length)return s;const g=new Map(r.map(b=>[pu(b),b]).filter(([b])=>b)),p=document.createElement("template");p.innerHTML=String(s||"");for(const b of p.content.querySelectorAll("a[href]")){const E=b.getAttribute("href")||"",R=g.get(E);R&&(b.classList.add("inline-resource-link",`inline-resource-${R.kind||"link"}`),b.setAttribute("href",R.url),(R.kind==="download"||R.downloadName)&&(b.setAttribute("download",R.downloadName||R.label||""),b.removeAttribute("target"),b.removeAttribute("rel"),b.setAttribute("title",`下载 ${R.label||R.downloadName||"资源"}`),b.dataset.resourceDownload="true",b.dataset.resourceExpiresAt=String(Number(R.expiresAt)||0),R.sizeBytes&&(b.dataset.resourceSize=`(${_a(R.sizeBytes).replace(/\s+/g,"")})`)))}return p.innerHTML}function pu(s){return String((s==null?void 0:s.reference)||"").trim()}function ha(s){const r=String(s||"");if(!r.includes("{"))return null;const g=lm(r);g.sort((p,b)=>p.start-b.start||b.end-p.end);for(const{start:p,end:b}of g)try{return JSON.parse(r.slice(p,b+1))}catch{}return null}function lm(s){const r=[],g=[];let p=!1,b=!1;for(let E=0;E<s.length;E+=1){const R=s[E];if(p){b?b=!1:R==="\\"?b=!0:R==='"'?p=!1:(R===`
|
|
116
|
-
`||R==="\r")&&(p=!1,b=!1);continue}if(g.length&&R==='"'){p=!0;continue}if(R==="{"){g.push(E);continue}R==="}"&&g.length&&r.push({start:g.pop(),end:E})}return r}function cm(s){const r=Number(s);if(!Number.isFinite(r))return"";const g=r-Date.now();return g<=0?"已过期":`${Yn(g)} 后过期`}function um(s){return Jn(s).length||Cn(s)?ma(s):dm(s)}function dm(s){const r=fm(s),g=r.prompt?`<div class="image2-stage-prompt"><p>${Ge(Ch(r.prompt,240))}</p></div>`:"";return`<div class="image2-stage"><div class="image2-diamond-field" aria-hidden="true">${Array.from({length:11},(b,E)=>`<i class="diamond-${E+1}"></i>`).join("")}<b></b></div>${g}</div>`}function fm(s){const r=ha((s==null?void 0:s.text)||"")||{},g=r.input||r.arguments||r.args||r;return{mode:String(g.mode||"").toLowerCase(),model:String(g.model||""),size:String(g.size||""),prompt:String(g.prompt||"")}}function ma(s){const r=mu(s.text||""),g=String(s.text||""),p=/\bfail(?:ed)?\b|failed/i.test(g)?"生成失败":/^edited\b/i.test(g.trim())?"修改完成":"生成完成",b=[r.count?`${r.count} 张`:"",r.model,`请求尺寸 ${Qa(r.size).requested}`,r.quality,r.outputFormat,r.sourceImages?`源图 ${r.sourceImages} 张`:"",r.duration].filter(Boolean);return`<div class="image2-result"><div class="image2-summary"><strong>${Ge(p)}</strong>${b.map(E=>`<span>${Ge(E)}</span>`).join("")}</div></div>`}const Mi=n0(),Ri=Ae([]);let ba=0;const hu=pe(()=>{var r;const s=$t.value;return JSON.stringify([((r=l.session)==null?void 0:r.sessionId)||"",s==null?void 0:s.id,s==null?void 0:s.toolUseId,s==null?void 0:s.messageId,s&&Cn(s)?Jn(s).map(g=>[g.originalDecodeUrl,g.available,xs(g)]):[]])});Je(hu,async s=>{var E;const r=++ba;Ri.value=[],Mi.clear();const g=((E=l.session)==null?void 0:E.sessionId)||"";Mi.setSession(g);const p=$t.value;if(!p||!Cn(p))return;const b=Jn(p);Ri.value=b.map(R=>({state:R.available?"loading":"unavailable"})),await Promise.all(b.map(async(R,q)=>{const ae=await Mi.load({sessionId:g,originalUrl:R.originalDecodeUrl,available:R.available});r!==ba||s!==hu.value||ae.state==="stale"||(Ri.value[q]=ae)}))},{immediate:!0,flush:"sync"}),vn(()=>{++ba,Mi.clear()});function gm(s,r){const g=Jn(s);return g.length?g.map((p,b)=>{const E=Ri.value[b],R=Qa(r,p.available?E:{state:"unavailable"}),q=(E==null?void 0:E.state)==="loading"&&p.available?"加载中…":R.actual;return`<section class="image2-detail-prompt" data-original-dimensions="${b}"><span>${Ge(Xn(p,b))}</span><dl class="image2-detail-grid"><div><dt>请求尺寸</dt><dd>${Ge(R.requested)}</dd></div><div><dt>实际尺寸</dt><dd>${Ge(q)}</dd></div></dl>${R.mismatch?"<p>实际尺寸与请求尺寸不同(保留原图)</p>":""}</section>`}).join(""):"<p>实际尺寸:未知(未提供原图资源)</p>"}function pm(s){const r=mu((s==null?void 0:s.text)||""),g=[["模型",r.model],["模式",r.mode],["请求尺寸",Qa(r.size).requested],["质量",r.quality],["格式",r.outputFormat],["背景",r.background],["图片数量",r.count?`${r.count} 张`:""],["源图数量",r.sourceImages?`${r.sourceImages} 张`:""],["耗时",r.duration],["语义名称",r.semanticName],["开始时间",r.startedAt],["完成时间",r.finishedAt]].filter(([,R])=>R),p=g.length?`<dl class="image2-detail-grid">${g.map(([R,q])=>`<div><dt>${Ge(R)}</dt><dd>${Ge(q)}</dd></div>`).join("")}</dl>`:"",b=r.prompt?`<section class="image2-detail-prompt"><span>调用提示词</span><p>${Ge(r.prompt)}</p></section>`:'<section class="image2-detail-prompt empty"><span>调用提示词</span><p>当前历史记录未保存提示词;新执行的 image_create 调用会在这里显示。</p></section>',E=r.revisedPrompt&&r.revisedPrompt!==r.prompt?`<section class="image2-detail-prompt"><span>修订提示词</span><p>${Ge(r.revisedPrompt)}</p></section>`:"";return`<div class="image2-detail-view">${p}${gm(s,r.size)}${b}${E}</div>`}function mu(s){const r=String(s||""),g=r.replace(/\s+/g," ").trim(),p=r.split(/\r?\n/).map(ae=>ae.trim()).filter(Boolean),b=/^(generated|edited)\s+(\d+)\s+images?/i.exec(p[0]||g),R=(p.find(ae=>ae.includes(" · "))||"").split(" · ").map(ae=>ae.trim()).filter(Boolean),q=hm(g,["duration","durationMs","elapsed","elapsedMs"]);return{provider:ht(g,"provider",["model","prompt"])||R[0]||"",model:ht(g,"model",["prompt"])||R[1]||"",prompt:ht(g,"prompt",["revisedPrompt","mode","semanticName","size","quality","outputFormat","background","returnedImages","startedAt","finishedAt","duration"]),mode:ht(g,"mode",["semanticName","prompt","size","quality"]),semanticName:ht(g,"semanticName",["prompt","size","quality","outputFormat"]),size:ht(g,"size",["quality","outputFormat","background","returnedImages","duration"])||R.find(ae=>/^\d+x\d+$/i.test(ae))||"",quality:ht(g,"quality",["outputFormat","background","returnedImages","duration"])||R.find(ae=>["low","medium","high"].includes(ae.toLowerCase()))||"",outputFormat:ht(g,"outputFormat",["background","returnedImages","images","duration"])||R.find(ae=>["png","jpeg","jpg","webp"].includes(ae.toLowerCase()))||"",background:ht(g,"background",["returnedImages","images","startedAt","finishedAt","duration"]),sourceImages:ht(g,"source images",["prompt","mode","semanticName","duration"]),count:ht(g,"returnedImages",["images","index","duration"])||(b==null?void 0:b[2])||"",revisedPrompt:ht(g,"revisedPrompt",["mode","semanticName","raw","created","data","b64_json","background","output_format","quality","size","usage","startedAt","finishedAt","duration"]),usage:ht(g,"usage",["duration"]),startedAt:ht(g,"startedAt",["finishedAt","duration"]),finishedAt:ht(g,"finishedAt",["duration"]),duration:q===void 0?"":Yn(q)}}function ht(s,r,g){var R;const p=g.length?`(?=\\s(?:${g.map(dr).join("|")}):)`:"$",E=new RegExp(`(?:^|\\s)${dr(r)}:\\s*([\\s\\S]*?)${p}`,"i").exec(s);return((R=E==null?void 0:E[1])==null?void 0:R.replace(/\[(?:base64 image|data URL) omitted[^\]]*\]/gi,"").trim().replace(/\s{2,}/g," "))||""}function hm(s,r){for(const g of r){const p=new RegExp(`(?:^|\\s)${dr(g)}:\\s*(\\d+(?:\\.\\d+)?)\\s*ms?\\b`,"i").exec(s);if(p)return Number(p[1])}}function Yn(s){const r=Math.max(0,Number(s)||0);if(r<1e3)return`${Math.round(r)}ms`;if(r<6e4)return`${(r/1e3).toFixed(r<1e4?1:0).replace(/\.0$/,"")}s`;const g=Math.floor(r/6e4),p=Math.round(r%6e4/1e3);return`${g}m ${p}s`}function dr(s){return String(s).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ws(s,r=[]){const g=new Set(r.map(q=>String(q||"").trim()).filter(Boolean)),p=document.createElement("template");p.innerHTML=String(s);const b=new Set(["A","P","BR","STRONG","B","EM","I","CODE","PRE","BLOCKQUOTE","UL","OL","LI","H1","H2","H3","H4","H5","H6","HR","TABLE","THEAD","TBODY","TR","TH","TD","DEL","S","INPUT"]),E=document.createTreeWalker(p.content,NodeFilter.SHOW_ELEMENT),R=[];for(;E.nextNode();)R.push(E.currentNode);for(const q of R){if(!b.has(q.tagName)){q.replaceWith(document.createTextNode(q.textContent||""));continue}for(const ae of Array.from(q.attributes)){const ue=ae.name.toLowerCase(),Te=ae.value;q.tagName==="A"&&ue==="href"&&(Ym(Te)||g.has(Te))||q.tagName==="A"&&ue==="title"||q.tagName==="CODE"&&ue==="class"&&/^language-[\w-]+$/.test(Te)||q.tagName==="PRE"&&ue==="data-lang"&&/^[\w-]+$/.test(Te)||q.tagName==="INPUT"&&["type","checked","disabled"].includes(ue)||q.removeAttribute(ae.name)}q.tagName==="A"&&!g.has(q.getAttribute("href")||"")&&(q.setAttribute("target","_blank"),q.setAttribute("rel","noreferrer noopener"))}return mm(p.content),p.innerHTML}function mm(s){for(const r of s.querySelectorAll("pre > code")){const g=bm(r.className),p=r.textContent||"",b=r.parentElement;b&&g&&b.setAttribute("data-lang",g);try{const E=g&&Ve.getLanguage(g)?Ve.highlight(p,{language:g,ignoreIllegals:!0}):p.length<=2e4?Ve.highlightAuto(p):void 0;if(!E)continue;r.innerHTML=E.value,r.className=["hljs",E.language?`language-${E.language}`:g?`language-${g}`:""].filter(Boolean).join(" "),b&&E.language&&!b.hasAttribute("data-lang")&&b.setAttribute("data-lang",E.language)}catch{r.textContent=p}}}function bm(s){const r=/(?:^|\s)language-([\w-]+)/.exec(s||"")||/(?:^|\s)lang-([\w-]+)/.exec(s||"");if(!r)return"";const g=r[1].toLowerCase();return{cjs:"javascript",mjs:"javascript",node:"javascript",shell:"bash",zsh:"bash",powershell:"bash",ps1:"bash",python3:"python",yml:"yaml",html:"xml",vue:"xml"}[g]||g}function ym(s){s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),Ac())}function bu(s){var r;if(s.key==="Escape"&&l.confirmDialog.open){s.preventDefault(),ys(!1);return}if(s.key==="Escape"&&l.modelModalOpen){s.preventDefault(),nr();return}if(s.key==="Escape"&&l.contextWindowModalOpen){s.preventDefault(),hi();return}if(s.key==="Escape"&&l.compactionDetailLineId!==void 0){s.preventDefault(),ki();return}if(s.key==="Escape"&&l.backgroundTaskDetail){s.preventDefault(),Ti();return}if(s.key==="Escape"&&l.projectContextOpen){s.preventDefault(),ua();return}if(s.key==="Escape"&&l.cwdPicker.open){s.preventDefault(),Ai();return}if(s.key==="Escape"&&l.runtimeContextDetail){s.preventDefault(),ca();return}if(s.key==="Escape"&&l.runtimeContextModal){s.preventDefault(),la();return}if(s.key==="Escape"&&l.imagePreview){s.preventDefault(),Xo();return}if(s.key==="Escape"&&l.toolDetailLineId!==void 0){s.preventDefault(),vs();return}(s.ctrlKey||s.metaKey)&&s.key.toLowerCase()==="k"&&(s.preventDefault(),(r=J.value)==null||r.focus()),(s.ctrlKey||s.metaKey)&&s.key.toLowerCase()==="c"&&!M.value&&Cc()}function km(){var s;try{const r=localStorage.getItem(sf);if(r==="light"||r==="dark")return r}catch{}return(s=window.matchMedia)!=null&&s.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}function vm(s){var r,g,p,b;document.documentElement.dataset.theme=s,document.documentElement.style.colorScheme=s,(r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",s==="dark"?"#0c0c0f":"#ffffff"),(b=(p=(g=window.__TAURI__)==null?void 0:g.core)==null?void 0:p.invoke)==null||b.call(p,"sync_window_theme",{theme:s}).catch(()=>{});try{localStorage.setItem(sf,s)}catch{}}function yu(){se.value=se.value==="dark"?"light":"dark"}async function _m(s){var p;const r=Array.from(((p=s.clipboardData)==null?void 0:p.files)||[]).filter(b=>b.type.startsWith("image/"));if(!r.length)return;s.preventDefault();const g=[];for(const b of r){const E=++l.attachmentCounter,R=`[img#${E}]`,q=await Iu(b);q.compressionRate>0&&g.push(q.compressionRate),l.attachments.push({kind:"image",imageId:vu(),label:R,mimeType:q.mimeType,data:q.data,previewUrl:q.previewUrl,name:b.name||`图片 ${E}`})}we(`已添加 ${r.length} 张图片附件`),g.length&&setTimeout(()=>we(Ru(g)),0)}function wm(){var s;(s=ie.value)==null||s.click()}async function xm(s){var g;const r=Array.from(((g=s==null?void 0:s.target)==null?void 0:g.files)||[]);r.length&&(await ku(r),s!=null&&s.target&&(s.target.value=""))}async function ku(s){var r;l.uploadingFiles=!0;try{const g=[],p=[];for(const b of s){if(b.type.startsWith("image/")){const q=await Iu(b),ae=`[img#${++l.attachmentCounter}]`;q.compressionRate>0&&p.push(q.compressionRate),g.push({kind:"image",imageId:vu(),label:ae,name:b.name||ae,mimeType:q.mimeType,data:q.data,previewUrl:q.previewUrl});continue}const E=await Dm(b),R=await Ke("/api/uploads",{name:b.name,mimeType:b.type||"application/octet-stream",data:E.data});if(!((r=R==null?void 0:R.file)!=null&&r.absolutePath))throw new Error("upload response missing path");g.push({kind:"file",label:`[file#${++l.attachmentCounter}]`,name:R.file.name||b.name||`附件 ${l.attachmentCounter}`,mimeType:R.file.mimeType||b.type||"application/octet-stream",size:Number(R.file.size||b.size||0),absolutePath:R.file.absolutePath,relativePath:R.file.relativePath||""})}l.attachments.push(...g),p.length&&setTimeout(()=>we(Ru(p)),0),we(`已上传 ${g.length} 个附件`)}catch(g){we(g.message||String(g))}finally{l.uploadingFiles=!1}}function vu(){return typeof(crypto==null?void 0:crypto.randomUUID)=="function"?`image_${crypto.randomUUID()}`:`image_${Date.now().toString(16).slice(-8).padStart(8,"0")}-${Math.random().toString(16).slice(2,6).padEnd(4,"0")}-4${Math.random().toString(16).slice(2,5).padEnd(3,"0")}-a${Math.random().toString(16).slice(2,5).padEnd(3,"0")}-${Math.random().toString(16).slice(2,14).padEnd(12,"0")}`}function _u(s,r){if(!r.length)return s;const g=r.map(p=>p.label).join(" ");return s.trim()?`${s.trim()}
|
|
117
|
-
|
|
118
|
-
${g}`:g}function Sm(s){return String(s).replace(/\s*\[img#\d+\]\s*/g," ").replace(/[ \t]{2,}/g," ").trim()}function Em(s){return String(s).replace(xA,"").replace(SA,"").replace(EA,"").replace(/[ \t]{2,}/g," ").trim()}function Tm(s){return String(s||"").replace(new RegExp(`${dr(TA)}[\\s\\S]*?${dr(AA)}`,"g"),"").replace(/[ \t]{2,}/g," ").replace(/\n{3,}/g,`
|
|
119
|
-
|
|
120
|
-
`).trim()}function Ni(s){return Array.from(new Set(String(s||"").match(/\[img#\d+\]/g)||[]))}function wu(s){var p;const r=String(((p=l.session)==null?void 0:p.sessionId)||u||""),g=s.filter(b=>(b==null?void 0:b.kind)==="image"&&b.imageId&&b.previewUrl).map(b=>({sessionId:r,imageId:b.imageId,label:b.label,mimeType:b.mimeType,previewUrl:b.previewUrl,originalUrl:b.previewUrl,name:b.name,available:!0,pending:!0}));xu(g)}function Am(s){const r=[];for(const g of s||[])Li(g,r);xu(r.map(ya).filter(Boolean))}function xs(s){var g;const r=String((s==null?void 0:s.sessionId)||((g=l.session)==null?void 0:g.sessionId)||u||"");return s!=null&&s.imageId?`${r}:image:${s.imageId}`:s!=null&&s.messageId&&Number.isInteger(Number(s==null?void 0:s.blockIndex))?`${r}:block:${s.messageId}:${Number(s.blockIndex)}`:""}function xu(s){if(!s.length)return;const r=s.map(p=>{var b;return{...p,sessionId:String(p.sessionId||((b=l.session)==null?void 0:b.sessionId)||u||"")}}),g=new Set(r.map(xs).filter(Boolean));l.messageImagePreviews=[...l.messageImagePreviews.filter(p=>{const b=xs(p);return!b||!g.has(b)}),...r].slice(-200)}function Jn(s){var p;if(Dt(s))return Cm(s);const r=(s==null?void 0:s.kind)==="user"?Su(s):[s],g=[];for(const b of r){g.push(...Oi(b));for(const E of Ni(b==null?void 0:b.text)){const R=String(((p=l.session)==null?void 0:p.sessionId)||u||""),q=l.messageImagePreviews.filter(ue=>ue.sessionId===R&&ue.label===E),ae=String((b==null?void 0:b.messageId)||"").startsWith("web-user-")?[...q].reverse().find(ue=>ue.pending):q.length===1?q[0]:void 0;ae&&g.push(ae)}}return va(g)}function Cm(s){const r=[];Li(s,r);for(const g of Rm(s))Li(g,r);return va(r.map(ya).filter(Boolean))}function Oi(s){const r=[];return Li(s,r),va(r.map(g=>ya(g)).filter(Boolean))}function Su(s){if((s==null?void 0:s.kind)!=="user")return[s];const r=String((s==null?void 0:s.messageId)||"");return r?(l.lines||[]).filter(p=>(p==null?void 0:p.kind)==="user"&&String((p==null?void 0:p.messageId)||"")===r):[s]}function Im(s){return s.some(r=>Oi(r).length>0||Ni(r==null?void 0:r.text).length>0)}function Mm(s){return s.find(r=>Vn(r))||s.find(r=>Oi(r).length>0||Ni(r==null?void 0:r.text).length>0)||s[0]}function Rm(s){const r=l.lines||[],g=String((s==null?void 0:s.toolUseId)||"");if(g)return r.filter(E=>Pi(E)&&String((E==null?void 0:E.parentToolUseId)||"")===g);const p=r.findIndex(E=>(E==null?void 0:E.id)===(s==null?void 0:s.id));if(p<0)return[];const b=[];for(let E=p+1;E<r.length;E+=1){const R=r[E];if(Pi(R)&&!Dt(R)){b.push(R);continue}if((R==null?void 0:R.kind)==="tool"||(R==null?void 0:R.kind)==="user"||(R==null?void 0:R.kind)==="assistant"&&String((R==null?void 0:R.text)||"").trim())break}return b}function Li(s,r){if(!s||typeof s!="object")return;const g=b=>{var E;return r.push({...b,messageId:b.messageId||s.messageId,sessionId:b.sessionId||((E=l.session)==null?void 0:E.sessionId)||u||""})},p=[s.images,s.imageAttachments,s.attachments,s.thumbnails];for(const b of p)if(Array.isArray(b))for(const E of b)!E||E.kind&&E.kind!=="image"||E.type&&E.type!=="image"||g(E);if(Array.isArray(s.blocks))for(const b of s.blocks)(b==null?void 0:b.type)==="image"&&g(b);s.image&&g(s.image)}function ya(s){var E,R,q,ae,ue,Te,He,Bt;if(!s||typeof s!="object")return;const r=s.mimeType||((E=s.thumbnail)==null?void 0:E.mimeType)||((R=s.original)==null?void 0:R.mimeType)||"image/png",g=s.thumbnailSrc||((q=s.thumbnail)==null?void 0:q.src)||s.previewUrl||s.src||s.originalSrc||((ae=s.original)==null?void 0:ae.src)||ka(s.data,r);if(!g&&s.available!==!1)return;const p=g?Ia(g):"",b=s.originalSrc||((ue=s.original)==null?void 0:ue.src)||s.src||s.previewUrl||g;return{sessionId:String(s.sessionId||((Te=l.session)==null?void 0:Te.sessionId)||u||""),messageId:s.messageId,blockIndex:Number.isInteger(Number(s.blockIndex??s.index))?Number(s.blockIndex??s.index):void 0,imageId:s.imageId,label:s.label,mimeType:r,available:s.available!==!1&&!!p,error:s.error,previewUrl:p,originalUrl:b?Ia(b):"",originalDecodeUrl:s.originalSrc||(He=s.original)!=null&&He.src||s.originalUrl||ka(s.data,r)?Ia(s.originalSrc||((Bt=s.original)==null?void 0:Bt.src)||s.originalUrl||ka(s.data,r)):"",name:s.name||s.filename||s.label,sizeBytes:s.sizeBytes,pending:s.pending===!0}}function ka(s,r){return!s||typeof s!="string"?"":s.startsWith("data:")?s:`data:${r};base64,${s}`}function va(s){const r=new Set,g=[];for(const[p,b]of s.entries()){const E=xs(b)||(b.previewUrl?`url:${b.previewUrl}`:`position:${b.messageId||"unknown"}:${b.blockIndex??p}`);r.has(E)||(r.add(E),g.push(b))}return g}function Xn(s,r){return(s==null?void 0:s.label)||(s!=null&&s.name&&!/^\[img#\d+\]$/.test(s.name)?s.name:`图片 ${r+1}`)}function Eu(s,r){const g=Nm(s==null?void 0:s.mimeType),p=((s==null?void 0:s.name)||(s==null?void 0:s.label)||`image-${r+1}`).replace(/[^\p{L}\p{N}._-]+/gu,"-").replace(/^-+|-+$/g,"")||`image-${r+1}`;return/\.[a-z0-9]{2,5}$/i.test(p)?p:`${p}.${g}`}function Nm(s){const r=String(s||"").toLowerCase();return r.includes("jpeg")?"jpg":r.includes("webp")?"webp":r.includes("gif")?"gif":"png"}function Pi(s){return(s==null?void 0:s.kind)==="tool"&&String((s==null?void 0:s.parentToolName)||"").toLowerCase()==="image_create"}function Om(s){return Pi(s)&&Jn(s).length>0}function Tu(s){l.attachments=l.attachments.filter(r=>r.label!==s)}function Au(){return l.attachments.filter(s=>s.kind==="file")}function Cu(){return l.attachments.filter(s=>s.kind==="image")}function Lm(s,r){return(s==null?void 0:s.name)||`附件 ${r+1}`}function Pm(s){return`${$m(s)} · ${_a(s==null?void 0:s.size)}`}function $m(s){const r=String((s==null?void 0:s.mimeType)||"").toLowerCase();return r?r.includes("pdf")?"PDF":r.includes("spreadsheet")||r.includes("excel")||r.includes("csv")?"表格":r.includes("word")||r.includes("document")?"文档":r.startsWith("text/")?"文本":r.startsWith("image/")?"图片":"文件":"文件"}function _a(s){const r=Number(s||0);return!Number.isFinite(r)||r<=0?"0 B":r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(r<10*1024?1:0).replace(/\.0$/,"")} KB`:r<1024*1024*1024?`${(r/(1024*1024)).toFixed(r<10*1024*1024?1:0).replace(/\.0$/,"")} MB`:`${(r/(1024*1024*1024)).toFixed(1).replace(/\.0$/,"")} GB`}async function Iu(s){const r=await wa(s);return Bm(r,s.type||"image/png")}async function Dm(s){const r=await wa(s),g=r.indexOf(",");return{mimeType:s.type||"application/octet-stream",data:g>=0?r.slice(g+1):r}}async function wa(s){return new Promise((r,g)=>{const p=new FileReader;p.onload=()=>r(String(p.result||"")),p.onerror=()=>g(p.error||new Error("read failed")),p.readAsDataURL(s)})}async function Bm(s,r="image/png"){const g=Mu(s,r),p=Um(g.base64),b=await zm(g.dataUrl).catch(()=>{});if(!b){const He=xa(g.base64);if(!He)throw new Error("图片格式异常,无法读取为有效图片");return{mimeType:g.mimeType,data:He,previewUrl:`data:${g.mimeType};base64,${He}`,compressionRate:0}}const E=Math.min(1,_A/Math.max(b.naturalWidth||b.width,b.naturalHeight||b.height));let R=Math.max(1,Math.round((b.naturalWidth||b.width)*E)),q=Math.max(1,Math.round((b.naturalHeight||b.height)*E)),ae=.88,ue;for(let He=0;He<8&&(ue=await Hm(b,R,q,"image/jpeg",ae),!(ue.bytes<=wA||ae<=Ya&&Math.max(R,q)<=1280));He+=1)ae>Ya?ae=Math.max(Ya,ae-.1):(R=Math.max(1,Math.round(R*.82)),q=Math.max(1,Math.round(q*.82)));const Te=xa(ue==null?void 0:ue.base64);if(!Te)throw new Error("图片格式异常,无法转换为有效图片");return{mimeType:ue.mimeType,data:Te,previewUrl:`data:${ue.mimeType};base64,${Te}`,compressionRate:Fm(p,ue.bytes)}}function Mu(s,r){var R;const g=String(s||"").trim(),p=/^data:([^;,]+);base64,([\s\S]*)$/i.exec(g),b=(R=p==null?void 0:p[1])!=null&&R.startsWith("image/")?p[1]:r,E=p?p[2]:g;return{mimeType:b,base64:E,dataUrl:p?g:`data:${b};base64,${E}`}}function Um(s){const r=xa(s);if(!r)return 0;const g=r.endsWith("==")?2:r.endsWith("=")?1:0;return Math.max(0,Math.floor(r.length*.75)-g)}function Fm(s,r){return!s||!r||r>=s?0:Math.round((1-r/s)*100)}function Ru(s){const r=Math.max(...s);return s.length>1?`图片已压缩,最高压缩率为 ${r}%`:`图片已压缩,压缩率为 ${r}%`}function xa(s){let r=String(s||"").trim().replace(/^data:[^;,]+;base64,/i,"").replace(/\s+/g,"");if(!r)return"";r=r.replace(/-/g,"+").replace(/_/g,"/");const g=r.length%4;if(g&&(r+="=".repeat(4-g)),!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return"";try{return atob(r),r}catch{return""}}function zm(s){return new Promise((r,g)=>{const p=new Image;p.onload=()=>r(p),p.onerror=()=>g(new Error("image decode failed")),p.src=s})}async function Hm(s,r,g,p,b){const E=document.createElement("canvas");E.width=r,E.height=g;const R=E.getContext("2d");if(!R)throw new Error("canvas unavailable");R.fillStyle="#fff",R.fillRect(0,0,r,g),R.drawImage(s,0,0,r,g);const q=await new Promise(Te=>E.toBlob(Te,p,b));if(!q)throw new Error("image encode failed");const ae=await wa(q),ue=Mu(ae,p);return{mimeType:ue.mimeType,base64:ue.base64,bytes:q.size}}function Nu(){return window.matchMedia("(max-width: 820px)").matches?50:64}function fr(){const s=J.value;s&&(s.style.height=`${Nu()}px`,s.scrollTop=0)}function jm(){const s=J.value;if(!s)return;s.style.height="auto";const r=window.innerHeight*(window.matchMedia("(max-width: 820px)").matches?.28:.34);s.style.height=`${Math.max(Nu(),Math.min(s.scrollHeight,r))}px`}function Sa(s=96){const r=Z.value;return r?r.scrollHeight-r.scrollTop-r.clientHeight<=s:!0}function Wm(s){return String((s==null?void 0:s.id)??"")}function Km(s){const r=jn.value[s];if(!r)return CA;if(Yo(r))return ks(r)?Math.min(1200,72+r.lines.reduce((p,b)=>p+Ea(b),0)):Math.max(72,52+Jo(r).length*28);if(yi(r))return 74;if(or(r))return 88;const g=pa(r);return g.length?64+g.reduce((p,b)=>p+du(b),0):Dt(r)||Gm(r)?Math.max(560,Ea(r)):Ea(r)}function Ea(s){const r=Vn(s),g=Math.max(1,r.split(`
|
|
121
|
-
`).length),p=Math.ceil(r.length/72);return Math.max(72,Math.min(1200,52+Math.max(g,p)*24))}function Gm(s){return s!=null&&s.image||[s==null?void 0:s.images,s==null?void 0:s.imageAttachments,s==null?void 0:s.thumbnails].some(r=>Array.isArray(r)&&r.length)||Array.isArray(s==null?void 0:s.attachments)&&s.attachments.some(r=>(r==null?void 0:r.kind)==="image"||(r==null?void 0:r.type)==="image"||String((r==null?void 0:r.mimeType)||"").startsWith("image/"))?!0:Array.isArray(s==null?void 0:s.blocks)&&s.blocks.some(r=>(r==null?void 0:r.type)==="image")}function $i(){const s=Z.value,r=ce.value;!s||!r||(le.value=Math.max(0,r.getBoundingClientRect().top-s.getBoundingClientRect().top+s.scrollTop))}function Ta(){be&&(be.disconnect(),Z.value&&be.observe(Z.value),ce.value&&be.observe(ce.value))}function Vm(s){s instanceof Element&&ni.value.measureElement(s)}function Aa(){ni.value.measure()}function Ca(){It||(It=requestAnimationFrame(()=>{It=0,qm()}))}function qm(){const s=Z.value;s&&(s.scrollTop=s.scrollHeight)}function Zm(){if(z.size<300)return;const s=new Set(l.lines.map(r=>r.id));for(const r of z.keys()){const g=Number(String(r).split("",1)[0]);s.has(g)||z.delete(r)}z.size>500&&z.clear()}function we(s){l.toast=s,clearTimeout(Kt),Kt=setTimeout(()=>{l.toast=""},3600)}function Qm(s){return["running","preparing","calling_model","thinking","running_tools","compacting","injecting_context"].includes(s)}function Ss(s){if(s==null||!Number.isFinite(Number(s)))return"—";const r=Math.max(0,Math.round(Number(s)));return r>=1e6?`${Ou(r/1e6)}m`:r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Ou(r/1e3)}k`:String(r)}function Ou(s){return s>=10?s.toFixed(0):s.toFixed(1).replace(/\.0$/,"")}function Di(s){return String(s).replace(/\x1b\[[0-9;]*m/g,"")}function Ym(s){try{const r=new URL(s,window.location.href);return["http:","https:","mailto:"].includes(r.protocol)}catch{return!1}}function Ge(s){return String(s).replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r])}function Lu(s){return s.replace(/(https?:\/\/[^\s<]+)/g,'<a target="_blank" rel="noreferrer noopener" href="$1">$1</a>')}function Ia(s){const r=String(s||"");return r.startsWith("/api/images/")?I(r):r}function Bi(){var s;(s=U.value)==null||s.removeAttribute("open")}function Pu(s){const r=U.value;r!=null&&r.open&&!s.composedPath().includes(r)&&Bi()}function Ui(s){if(oe.value="",Bi(),s==="sessions")return mi();if(s==="prompts")return Wo();if(s==="settings")return sr();l.activePanel="chat"}function $u(){return oe.value="",Bi(),bi()}return(s,r)=>{var g,p,b,E,R,q,ae,ue,Te,He,Bt,ln;return k(),_(de,null,[d("div",s0,[d("aside",r0,[d("div",i0,[d("button",{class:"theme-toggle celestial-theme-toggle",type:"button","aria-label":ii.value,"aria-pressed":ri.value,title:ii.value,onClick:yu},[...r[40]||(r[40]=[od('<span class="theme-orbit-scene" aria-hidden="true"><i class="theme-cloud theme-cloud-one"></i><i class="theme-cloud theme-cloud-two"></i><i class="theme-star theme-star-one"></i><i class="theme-star theme-star-two"></i><i class="theme-star theme-star-three"></i><span class="theme-orbit-body"><svg class="theme-sun" viewBox="0 0 28 28"><circle cx="14" cy="14" r="5.2"></circle><path d="M14 2.5v3M14 22.5v3M2.5 14h3M22.5 14h3M5.9 5.9 8 8M20 20l2.1 2.1M22.1 5.9 20 8M8 20l-2.1 2.1"></path></svg><svg class="theme-moon" viewBox="0 0 28 28"><path d="M20.8 18.8A9.2 9.2 0 0 1 9.2 7.2a9.2 9.2 0 1 0 11.6 11.6Z"></path><circle cx="10.2" cy="16.8" r="1"></circle><circle cx="15.4" cy="21" r=".75"></circle></svg></span></span>',1)])],8,o0)]),d("nav",a0,[d("button",{class:me({active:l.activePanel==="chat"}),onClick:bi},[...r[41]||(r[41]=[d("span",{class:"nav-button-content"},[d("svg",{class:"ui-icon nav-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[d("path",{d:"M10 4v12M4 10h12"})]),d("span",null,"新建会话")],-1)])],2),d("button",{class:me({active:l.activePanel==="sessions"}),onClick:mi},[...r[42]||(r[42]=[d("span",{class:"nav-button-content"},[d("svg",{class:"ui-icon nav-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[d("path",{d:"M5 4.5h10a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 15 15.5H8l-3.5 2v-3.5A1.5 1.5 0 0 1 3 12.5V6A1.5 1.5 0 0 1 4.5 4.5Z"}),d("path",{d:"M6.75 8h6.5M6.75 11h4.5"})]),d("span",null,"会话管理")],-1)])],2),d("button",{class:me({active:l.activePanel==="settings"}),onClick:r[0]||(r[0]=x=>sr())},[...r[43]||(r[43]=[d("span",{class:"nav-button-content"},[d("svg",{class:"ui-icon nav-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[d("path",{d:"M10 3.5v2M10 14.5v2M5.4 5.4l1.4 1.4M13.2 13.2l1.4 1.4M3.5 10h2M14.5 10h2M5.4 14.6l1.4-1.4M13.2 6.8l1.4-1.4"}),d("circle",{cx:"10",cy:"10",r:"2.75"})]),d("span",null,"模型配置")],-1)])],2)]),d("button",{class:me(["sidebar-card","session-entry",{working:zn.value}]),type:"button",onClick:r[1]||(r[1]=x=>l.activePanel="chat"),title:Fn.value},[r[44]||(r[44]=d("span",{class:"session-entry-icon","aria-hidden":"true"},[d("i",{class:"session-diamond"})],-1)),d("span",c0,[d("span",{ref_key:"sessionTitleViewport",ref:Yr,class:me(["session-title-line",{marquee:Uo.value}])},[d("strong",{ref_key:"sessionTitleText",ref:lc},A(Fn.value),513),Uo.value?(k(),_("strong",u0,A(Fn.value),1)):K("",!0)],2)])],10,l0),d("section",d0,[d("div",f0,[d("button",{type:"button",class:"mini-button",onClick:r[2]||(r[2]=x=>Wo())},"提示词管理")]),d("div",g0,[l.promptLibraryLoading?(k(),_("div",p0,"正在加载…")):l.promptLibrary.length?(k(!0),_(de,{key:2},Ce(l.promptLibrary,x=>{var P;return k(),_("article",{key:x.id,class:me(["prompt-card",{active:((P=Wn.value)==null?void 0:P.id)===x.id}]),draggable:"true",onDragstart:mt=>Gp(mt,x),onDragend:Jp,onDblclick:mt=>er(x)},[d("div",b0,[d("strong",null,A(x.title),1)]),d("div",y0,[d("button",{type:"button",class:"mini-button",onClick:mt=>er(x)},"应用",8,k0),d("button",{type:"button",class:"mini-button",onClick:mt=>zp(x)},"编辑",8,v0)])],42,m0)}),128)):(k(),_("div",h0,"暂无提示词"))])])]),d("main",_0,[d("header",w0,[d("div",x0,[d("details",{ref_key:"mobileMenu",ref:U,class:"mobile-nav-menu"},[r[48]||(r[48]=d("summary",{"aria-label":"打开导航菜单",title:"导航菜单"},[d("svg",{class:"ui-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[d("path",{d:"M4 5.5h12M4 10h12M4 14.5h12"})])],-1)),d("nav",null,[d("button",{type:"button",class:me({active:l.activePanel==="chat"}),onClick:r[3]||(r[3]=x=>Ui("chat"))},"对话",2),d("button",{type:"button",onClick:$u},"新建会话"),d("button",{type:"button",class:me({active:l.activePanel==="sessions"}),onClick:r[4]||(r[4]=x=>Ui("sessions"))},"会话",2),d("button",{type:"button",class:me({active:l.activePanel==="prompts"}),onClick:r[5]||(r[5]=x=>Ui("prompts"))},"提示词",2),d("button",{type:"button",class:me({active:l.activePanel==="settings"}),onClick:r[6]||(r[6]=x=>Ui("settings"))},"模型配置",2),(k(!0),_(de,null,Ce(fe.value,x=>(k(),_("button",{key:x.id,type:"button",onClick:P=>F(x.id)},A(x.title),9,S0))),128)),l.coreVersion?(k(),_("div",{key:0,class:me(["core-version","mobile-core-version",{celebrating:l.coreEasterEgg}]),role:"button",tabindex:"0",onClick:bs,onKeydown:[is(je(bs,["prevent"]),["enter"]),is(je(bs,["prevent"]),["space"])]},[r[45]||(r[45]=d("span",{class:"core-version-spark spark-a","aria-hidden":"true"},null,-1)),r[46]||(r[46]=d("span",{class:"core-version-spark spark-b","aria-hidden":"true"},null,-1)),r[47]||(r[47]=d("span",{class:"core-version-spark spark-c","aria-hidden":"true"},null,-1)),d("span",null,"内核版本 "+A(l.coreVersion),1)],42,E0)):K("",!0)])],512),xn.value?(k(),_("strong",{key:0,class:"mobile-session-title",title:xn.value},A(xn.value),9,T0)):K("",!0),d("button",{class:"ghost mobile-theme-toggle celestial-theme-toggle",type:"button","aria-label":ii.value,"aria-pressed":ri.value,title:ii.value,onClick:yu},[...r[49]||(r[49]=[od('<span class="theme-orbit-scene" aria-hidden="true"><i class="theme-cloud theme-cloud-one"></i><i class="theme-cloud theme-cloud-two"></i><i class="theme-star theme-star-one"></i><i class="theme-star theme-star-two"></i><i class="theme-star theme-star-three"></i><span class="theme-orbit-body"><svg class="theme-sun" viewBox="0 0 28 28"><circle cx="14" cy="14" r="5.2"></circle><path d="M14 2.5v3M14 22.5v3M2.5 14h3M22.5 14h3M5.9 5.9 8 8M20 20l2.1 2.1M22.1 5.9 20 8M8 20l-2.1 2.1"></path></svg><svg class="theme-moon" viewBox="0 0 28 28"><path d="M20.8 18.8A9.2 9.2 0 0 1 9.2 7.2a9.2 9.2 0 1 0 11.6 11.6Z"></path><circle cx="10.2" cy="16.8" r="1"></circle><circle cx="15.4" cy="21" r=".75"></circle></svg></span></span>',1)])],8,A0),d("button",{class:"ghost desktop-config-button",onClick:r[7]||(r[7]=x=>sr())},"配置模型"),d("button",{class:"primary new-session-button",onClick:$u},"+ 新建")])]),l.activePanel==="chat"?(k(),_("section",C0,[d("div",I0,[d("div",{ref_key:"transcript",ref:Z,class:"transcript"},[l.runtimeContext||l.runtimeContextLoading||l.runtimeContextError?(k(),_("section",M0,[r[53]||(r[53]=d("div",{class:"runtime-context-bar-title"},[d("strong",null,"运行上下文")],-1)),l.runtimeContext?(k(),_("div",R0,[d("button",{type:"button",onClick:r[8]||(r[8]=x=>aa("prompt"))},[r[50]||(r[50]=d("span",null,"系统提示词",-1)),d("strong",null,A(kp.value.length),1)]),d("button",{type:"button",onClick:r[9]||(r[9]=x=>aa("tools"))},[r[51]||(r[51]=d("span",null,"工具",-1)),d("strong",null,A(zo.value.length),1)]),d("button",{type:"button",onClick:r[10]||(r[10]=x=>aa("plugins"))},[r[52]||(r[52]=d("span",null,"插件",-1)),d("strong",null,A(vp.value),1)])])):l.runtimeContextError?(k(),_("button",{key:1,type:"button",class:"runtime-context-retry",onClick:Ys},"重试")):(k(),_("span",N0,"同步中"))])):K("",!0),qs.value.length?(k(),_("section",O0,[r[55]||(r[55]=d("div",{class:"runtime-context-bar-title"},[d("strong",null,"项目上下文")],-1)),d("div",L0,[d("button",{type:"button",onClick:Bh},[r[54]||(r[54]=d("span",null,"文档",-1)),d("strong",null,A(qs.value.length),1)])])])):K("",!0),d("div",{ref_key:"messageList",ref:ce,class:"virtual-message-list",style:Ot({height:`${yp.value}px`})},[(k(!0),_(de,null,Ce(bp.value,x=>(k(),_("div",{key:x.key,ref_for:!0,ref:Vm,class:"virtual-message-row","data-index":x.index,style:Ot({transform:`translateY(${x.start-le.value}px)`})},[(k(!0),_(de,null,Ce([jn.value[x.index]],P=>{var mt,Vt,Du,Bu;return k(),_(de,{key:P.id},[Yo(P)?(k(),_("article",{key:0,class:me(["message","tool-group-message",{live:P.live,expanded:ks(P)}])},[d("div",$0,[d("button",{type:"button",class:"tool-group-trigger","aria-expanded":ks(P),onClick:te=>wh(P)},[d("span",B0,[(k(!0),_(de,null,Ce(jc(P),(te,xe)=>(k(),_(de,{key:te.name},[d("span",U0,A(te.name),1),te.count>1?(k(),_("span",F0,"×"+A(te.count),1)):K("",!0),xe<jc(P).length-1?(k(),_("span",z0,"、")):K("",!0)],64))),128))]),r[56]||(r[56]=d("span",{class:"tool-group-chevron","aria-hidden":"true"},null,-1))],8,D0),!ks(P)&&Jo(P).length?(k(),rt(Ak,{key:0,name:"tool-purpose",tag:"div",class:"tool-group-purposes"},{default:$f(()=>[(k(!0),_(de,null,Ce(Jo(P),(te,xe)=>(k(),_("div",{key:te.id,class:me(["tool-group-purpose",{live:te.live}]),style:Ot({"--purpose-index":xe})},[d("span",null,A(te.text),1)],6))),128))]),_:2},1024)):K("",!0),ks(P)?(k(),_("div",H0,[(k(!0),_(de,null,Ce(P.lines,te=>{var xe,bt,Ma,Uu;return k(),_("div",{key:te.id,class:me(["tool-group-result",`kind-${te.kind||"system"}`])},[te.kind==="thinking"?(k(),_("details",{key:0,class:"reasoning-sheet",open:te.live||void 0},[r[57]||(r[57]=d("summary",null,[d("span",{class:"reasoning-title-mark","aria-hidden":"true"},[d("i"),d("i"),d("i")]),d("span",{class:"reasoning-heading"},"思考")],-1)),d("div",W0,[d("div",K0,[d("div",{class:"message-text markdown reasoning-text",innerHTML:Ii(te)},null,8,G0)])])],8,j0)):yi(te)?(k(),_("section",{key:1,class:me(["compaction-context-bar",{current:te.compaction.current}])},[r[60]||(r[60]=d("div",{class:"compaction-context-title"},[d("strong",null,"压缩上下文")],-1)),d("div",V0,[d("span",null,[r[58]||(r[58]=d("span",null,"摘要",-1)),d("strong",null,A(Ss(String(te.compaction.summary||"").length)),1)]),te.compaction.imageCount?(k(),_("span",q0,[r[59]||(r[59]=d("span",null,"图片",-1)),d("strong",null,A(te.compaction.imageCount),1)])):K("",!0)])],2)):or(te)?(k(),_("div",{key:2,class:me(["tool-result-summary",`status-${En(te).key}`])},[d("div",Z0,[(k(),_("svg",{class:me(["tool-result-diamond",{spinning:te.live}]),viewBox:"0 0 20 20","aria-hidden":"true"},[...r[61]||(r[61]=[d("path",{d:"M10 2.75 17.25 10 10 17.25 2.75 10Z"},null,-1)])],2)),d("strong",Q0,A(qn(te)),1),En(te).key==="failed"?(k(),_("span",Y0,"×")):K("",!0)]),d("div",J0,[(xe=te.toolDisplay)!=null&&xe.purpose||(bt=te.toolDisplay)!=null&&bt.subject?(k(),_("p",X0,A(((Ma=te.toolDisplay)==null?void 0:Ma.purpose)||((Uu=te.toolDisplay)==null?void 0:Uu.subject)),1)):K("",!0),te.toolError?(k(),_("p",ex,A(te.toolError),1)):K("",!0),An(te)&&Tn(te).length?(k(),_("div",tx,[d("button",{type:"button",class:"tool-group-trigger","aria-expanded":wi(te),onClick:Rt=>Xc(te)},[d("span",sx,[(k(!0),_(de,null,Ce(_i(te),(Rt,gr)=>(k(),_(de,{key:Rt.name},[d("span",rx,A(Rt.label),1),Rt.count>1?(k(),_("span",ix,"×"+A(Rt.count),1)):K("",!0),gr<_i(te).length-1?(k(),_("span",ox,"、")):K("",!0)],64))),128))]),r[62]||(r[62]=d("span",{class:"tool-group-chevron","aria-hidden":"true"},null,-1))],8,nx),wi(te)?(k(),_("div",ax,[(k(!0),_(de,null,Ce(Jc(te),(Rt,gr)=>(k(),_("div",{key:Rt.key,class:"tool-group-purpose",style:Ot({"--purpose-index":gr})},[d("span",null,A(Rt.purpose),1)],4))),128))])):K("",!0)])):!vi(te)&&lr(te)?(k(),_("p",lx,[Ns(A(lr(te)),1),xi(te)?(k(),_("span",cx,A(xi(te)),1)):K("",!0)])):K("",!0),!vi(te)&&!An(te)&&Tn(te).length?(k(),_("div",ux,[d("section",dx,[d("pre",fx,A(Yc(te)),1)])])):K("",!0),!An(te)&&ar(te)&&(!ea(te)||te.live===!0)?(k(),_("div",gx,[d("section",px,[d("pre",hx,A(ar(te)),1)])])):K("",!0),!An(te)&&Qc(te)?(k(),_("div",mx,[(k(!0),_(de,null,Ce(Zc(te),(Rt,gr)=>(k(),_("section",{key:`${Rt.kind}-${gr}`,class:me(["tool-result-preview",`kind-${Rt.kind}`])},[d("pre",bx,A(Rt.content),1)],2))),128))])):K("",!0)])],2)):(k(),_("div",yx,[ir(te)?K("",!0):(k(),_("div",kx,[d("strong",null,A(qn(te)),1),te.toolName&&En(te).key==="failed"?(k(),_("span",vx,"×")):K("",!0)])),d("div",{class:"message-text markdown",innerHTML:Ii(te)},null,8,_x)]))],2)}),128))])):K("",!0)])],2)):(k(),_("article",{key:1,class:me(["message",P.kind||"system",{live:P.live,"prompt-usage":bh(P),"context-compaction":yi(P),"compact-tool":or(P)}])},[d("div",{class:me(["message-marker",{spinning:P.live}])},[...r[63]||(r[63]=[d("svg",{class:"message-marker-icon",viewBox:"0 0 20 20","aria-hidden":"true"},[d("path",{d:"M10 2.75 17.25 10 10 17.25 2.75 10Z"})],-1)])],2),yi(P)?(k(),_("div",wx,[d("section",{class:me(["compaction-context-bar",{current:P.compaction.current}])},[r[66]||(r[66]=d("div",{class:"compaction-context-title"},[d("strong",null,"压缩上下文")],-1)),d("div",xx,[d("span",null,[r[64]||(r[64]=d("span",null,"摘要",-1)),d("strong",null,A(Ss(String(P.compaction.summary||"").length)),1)]),P.compaction.imageCount?(k(),_("span",Sx,[r[65]||(r[65]=d("span",null,"图片",-1)),d("strong",null,A(P.compaction.imageCount),1)])):K("",!0)])],2)])):P.kind==="thinking"?(k(),_("div",Ex,[d("details",{class:"reasoning-sheet",open:P.live||void 0},[d("summary",null,[r[67]||(r[67]=d("span",{class:"reasoning-title-mark","aria-hidden":"true"},[d("i"),d("i"),d("i")],-1)),r[68]||(r[68]=d("span",{class:"reasoning-heading"},"思考",-1)),cr(P)?(k(),_("span",Ax,A(cr(P)),1)):K("",!0)]),d("div",Cx,[d("div",Ix,[d("div",{class:"message-text markdown reasoning-text",innerHTML:Ii(P)},null,8,Mx)])])],8,Tx)])):(k(),_("div",Rx,[!ir(P)&&(P.kind!=="tool"||_s(P).length)&&!or(P)?(k(),_("div",Nx,[d("strong",null,A(qn(P)),1),P.toolName&&En(P).key==="failed"?(k(),_("span",Ox,"×")):K("",!0),!P.toolName&&P.titleStatus?(k(),_("span",Lx,A(P.titleStatus),1)):K("",!0),cr(P)?(k(),_("span",Px,A(cr(P)),1)):K("",!0)])):K("",!0),Dt(P)?(k(),_("div",$x,[d("div",{class:"message-text markdown image2-stage-wrap",innerHTML:um(P)},null,8,Dx),(k(!0),_(de,null,Ce([Jn(P)],te=>(k(),_(de,{key:`${P.id}-image2-images`},[te.length?(k(),_("div",Bx,[(k(!0),_(de,null,Ce(te,(xe,bt)=>(k(),_("figure",{key:xs(xe)||xe.previewUrl||bt,class:me(["message-image-attachment",{"image-unavailable":!xe.available}])},[xe.available&&xe.previewUrl?(k(),_("button",{key:0,type:"button",class:"image-preview-trigger","data-preview-src":xe.originalUrl||xe.previewUrl,"aria-label":`预览 ${Xn(xe,bt)}`},[d("img",{src:xe.previewUrl,alt:Xn(xe,bt),loading:"lazy",decoding:"async"},null,8,Fx)],8,Ux)):(k(),_("div",zx,"图片不可用")),d("figcaption",null,A(Xn(xe,bt)),1),d("div",Hx,[xe.available&&xe.previewUrl?(k(),_("a",{key:0,class:"image-download",href:xe.originalUrl||xe.previewUrl,download:Eu(xe,bt)},"下载",8,jx)):K("",!0),bt===0&&Cn(P)?(k(),_("button",{key:1,type:"button",class:"image2-detail-button",onClick:Ma=>Kc(P)},"详情",8,Wx)):K("",!0)])],2))),128))])):Cn(P)?(k(),_("button",{key:1,type:"button",class:"image2-detail-button",onClick:xe=>Kc(P)},"详情",8,Kx)):K("",!0)],64))),128))])):or(P)?(k(),_("div",{key:2,class:me(["tool-result-summary",`status-${En(P).key}`])},[d("div",Gx,[(k(),_("svg",{class:me(["tool-result-diamond",{spinning:P.live}]),viewBox:"0 0 20 20","aria-hidden":"true"},[...r[69]||(r[69]=[d("path",{d:"M10 2.75 17.25 10 10 17.25 2.75 10Z"},null,-1)])],2)),d("strong",Vx,A(qn(P)),1),En(P).key==="failed"?(k(),_("span",qx,"×")):K("",!0)]),d("div",Zx,[(mt=P.toolDisplay)!=null&&mt.purpose||(Vt=P.toolDisplay)!=null&&Vt.subject?(k(),_("p",Qx,A(((Du=P.toolDisplay)==null?void 0:Du.purpose)||((Bu=P.toolDisplay)==null?void 0:Bu.subject)),1)):K("",!0),P.toolError?(k(),_("p",Yx,A(P.toolError),1)):K("",!0),An(P)&&Tn(P).length?(k(),_("div",Jx,[d("button",{type:"button",class:"tool-group-trigger","aria-expanded":wi(P),onClick:te=>Xc(P)},[d("span",e1,[(k(!0),_(de,null,Ce(_i(P),(te,xe)=>(k(),_(de,{key:te.name},[d("span",t1,A(te.label),1),te.count>1?(k(),_("span",n1,"×"+A(te.count),1)):K("",!0),xe<_i(P).length-1?(k(),_("span",s1,"、")):K("",!0)],64))),128))]),r[70]||(r[70]=d("span",{class:"tool-group-chevron","aria-hidden":"true"},null,-1))],8,Xx),wi(P)?(k(),_("div",r1,[(k(!0),_(de,null,Ce(Jc(P),(te,xe)=>(k(),_("div",{key:te.key,class:"tool-group-purpose",style:Ot({"--purpose-index":xe})},[d("span",null,A(te.purpose),1)],4))),128))])):K("",!0)])):!vi(P)&&lr(P)?(k(),_("p",i1,[Ns(A(lr(P)),1),xi(P)?(k(),_("span",o1,A(xi(P)),1)):K("",!0)])):K("",!0),!vi(P)&&!An(P)&&Tn(P).length?(k(),_("div",a1,[d("section",l1,[d("pre",c1,A(Yc(P)),1)])])):K("",!0),!An(P)&&ar(P)&&(!ea(P)||P.live===!0)?(k(),_("div",u1,[d("section",d1,[d("pre",f1,A(ar(P)),1)])])):K("",!0),!An(P)&&Qc(P)?(k(),_("div",g1,[(k(!0),_(de,null,Ce(Zc(P),(te,xe)=>(k(),_("section",{key:`${te.kind}-${xe}`,class:me(["tool-result-preview",`kind-${te.kind}`])},[d("pre",p1,A(te.content),1)],2))),128))])):K("",!0)])],2)):(k(),_(de,{key:3},[pa(P).length?(k(),_(de,{key:0},[d("div",h1,[(k(!0),_(de,null,Ce(pa(P),te=>(k(),_("iframe",{key:te.url,class:"plugin-resource-frame",src:om(te),title:te.label||"插件资源",style:Ot({height:`${du(te)}px`}),loading:"lazy",allow:"fullscreen",allowfullscreen:""},null,12,m1))),128))]),uu(P).length?(k(),_("div",{key:0,class:"message-text markdown",innerHTML:fu(P)},null,8,b1)):K("",!0)],64)):P.kind==="assistant"&&P.live?(k(),_("div",y1,[at(Vw,{text:P.text||"","exposed-resources":gu(P)},null,8,["text","exposed-resources"])])):Om(P)?K("",!0):(k(),_("div",{key:2,class:"message-text markdown",innerHTML:Ii(P)},null,8,k1)),(k(!0),_(de,null,Ce([Jn(P)],te=>(k(),_(de,{key:`${P.id}-images`},[te.length?(k(),_("div",v1,[(k(!0),_(de,null,Ce(te,(xe,bt)=>(k(),_("figure",{key:xs(xe)||xe.previewUrl||bt,class:me(["message-image-attachment",{"image-unavailable":!xe.available}])},[xe.available&&xe.previewUrl?(k(),_("button",{key:0,type:"button",class:"image-preview-trigger","data-preview-src":xe.originalUrl||xe.previewUrl,"aria-label":`预览 ${Xn(xe,bt)}`},[d("img",{src:xe.previewUrl,alt:Xn(xe,bt),loading:"lazy",decoding:"async"},null,8,w1)],8,_1)):(k(),_("div",x1,"图片不可用")),d("figcaption",null,A(Xn(xe,bt)),1),xe.available&&xe.previewUrl?(k(),_("a",{key:2,class:"image-download",href:xe.originalUrl||xe.previewUrl,download:Eu(xe,bt)},"下载",8,S1)):K("",!0)],2))),128))])):K("",!0)],64))),128))],64))]))],2))],64)}),128))],12,P0))),128))],4),on.value?(k(),_("div",E1,[d("div",T1,[d("span",A1,A(Qr.value),1)]),r[71]||(r[71]=d("span",{class:"message-loading-emblem","aria-hidden":"true"},[d("i"),d("i"),d("i")],-1))])):K("",!0)],512),l.queuedInput?(k(),_("div",C1,[d("span",null,"已排队:"+A(l.queuedInput),1),d("div",null,[d("button",{type:"button",onClick:Ic},"立即发送"),d("button",{type:"button",onClick:sh},"取消")])])):K("",!0),d("form",{class:me(["composer",{"drop-active":l.composerDropActive}]),onSubmit:je(Ac,["prevent"]),onDragover:Vp,onDragleave:qp,onDrop:Zp},[(g=l.appPrompt)!=null&&g.hasActivePrompt?(k(),_("div",I1,[r[72]||(r[72]=d("span",{class:"composer-app-prompt-label"},"当前提示词",-1)),d("strong",null,A(wp.value),1),d("button",{type:"button",class:"mini-button danger",onClick:Ec},"清空")])):K("",!0),Au().length?(k(),_("div",M1,[(k(!0),_(de,null,Ce(Au(),(x,P)=>(k(),_("figure",{key:x.label,class:"file-attachment"},[d("figcaption",null,[d("strong",null,A(Lm(x,P)),1),d("span",null,A(Pm(x)),1)]),d("button",{type:"button","aria-label":"移除附件",onClick:mt=>Tu(x.label)},"×",8,R1)]))),128))])):K("",!0),Cu().length?(k(),_("div",N1,[(k(!0),_(de,null,Ce(Cu(),(x,P)=>(k(),_("figure",{key:x.label,class:"image-attachment"},[d("img",{src:x.previewUrl,alt:x.name||`图片 ${P+1}`},null,8,O1),d("figcaption",null,"图片 "+A(P+1),1),d("button",{type:"button","aria-label":"移除图片",onClick:mt=>Tu(x.label)},"×",8,L1)]))),128))])):K("",!0),d("input",{ref_key:"fileInput",ref:ie,type:"file",multiple:"",hidden:"",onChange:xm},null,544),ot(d("textarea",{ref_key:"composer",ref:J,"onUpdate:modelValue":r[11]||(r[11]=x=>M.value=x),placeholder:"在这里输入你的问题、需求或下一步安排…",onKeydown:ym,onPaste:_m,onInput:jm},null,544),[[Tt,M.value]]),d("div",P1,[d("button",{type:"button",class:"composer-cwd",title:"切换工作目录","aria-label":"切换工作目录",onClick:Fh},[r[73]||(r[73]=d("svg",{class:"composer-cwd-icon",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round","aria-hidden":"true"},[d("path",{d:"M2.5 5h5l2 2h8v9h-15Z"})],-1)),d("span",{title:cc.value},A(cc.value),9,$1)])]),d("details",D1,[d("summary",null,[r[74]||(r[74]=d("span",null,"会话选项",-1)),d("small",null,A(Ze.value),1),r[75]||(r[75]=d("svg",{class:"mobile-session-chevron",viewBox:"0 0 12 12","aria-hidden":"true"},[d("path",{d:"m3 4.5 3 3 3-3"})],-1))]),d("div",B1,[d("dl",null,[d("div",null,[r[76]||(r[76]=d("dt",null,"模型",-1)),d("dd",null,[d("button",{type:"button",class:"mobile-context-button model-trigger","aria-label":"选择模型",onClick:Lc},A(uc.value),1)])]),d("div",null,[r[77]||(r[77]=d("dt",null,"上下文",-1)),d("dd",null,[d("button",{type:"button",class:"mobile-context-button",onClick:Pc},A(fc.value),1)])]),d("div",null,[r[78]||(r[78]=d("dt",null,"Token",-1)),d("dd",null,"↑ "+A(gc.value)+" / ↓ "+A(pc.value),1)])]),d("div",U1,[d("button",{type:"button",class:me(["fast-mode-button",{active:ms.value,syncing:l.fastModeMutating}]),"aria-pressed":ms.value,onClick:$c},[...r[79]||(r[79]=[d("span",null,"快速模式",-1)])],10,F1),d("button",{type:"button",class:"compact-button",disabled:l.compactSaving||l.pendingSessionSettings.compact===!0,onClick:Oc},"压缩会话",8,z1)]),d("details",H1,[d("summary",null,[r[80]||(r[80]=Ns("运行信息 ",-1)),d("span",null,A(Hn.value?`${Hn.value} 个后台任务`:"无后台任务"),1)]),d("div",j1,[Sn.value.length?(k(),_("button",{key:0,type:"button",class:"mobile-runtime-card",onClick:r[12]||(r[12]=x=>Ei(Sn.value[0]))},[d("span",null,A(Hn.value?"后台任务":"最近结束"),1),d("strong",null,A(ur(Sn.value[0])),1)])):(k(),_("div",W1,[...r[81]||(r[81]=[d("span",null,"后台任务",-1),d("strong",null,"暂无",-1)])])),Mt.value?(k(),_("div",K1,[r[82]||(r[82]=d("span",null,"周额度",-1)),d("strong",null,A(Zo(Mt.value.remainingPercent)),1),d("small",null,"续期 "+A(Qo(Mt.value.resetAt)),1)])):K("",!0),d("div",G1,[d("span",null,A(Ee("memory")),1),d("strong",null,A(Gn((p=Kn.value)==null?void 0:p.rss)),1),d("small",null,"堆 "+A(Gn((b=Kn.value)==null?void 0:b.heapUsed))+" · 外部 "+A(Gn((E=Kn.value)==null?void 0:E.external)),1)])])])])]),d("div",V1,[d("div",q1,[d("button",{type:"button",class:"metric-chip model-chip context-window-trigger model-trigger","aria-label":"选择模型",onClick:Lc},[r[83]||(r[83]=d("em",null,"模型",-1)),d("strong",null,A(uc.value),1)]),(k(),_("button",{type:"button",class:me(["metric-chip","numeric","context-window-trigger",ra("context")]),key:`context-${l.composerMetrics.context.bump}`,onClick:Pc},[r[84]||(r[84]=d("em",null,"上下文",-1)),d("strong",null,A(fc.value),1)],2)),(k(),_("span",{class:me(["metric-chip numeric",ra("inputTokens")]),key:`input-${l.composerMetrics.inputTokens.bump}`},[r[85]||(r[85]=d("em",null,"输入",-1)),d("strong",null,A(gc.value),1)],2)),(k(),_("span",{class:me(["metric-chip numeric",ra("outputTokens")]),key:`output-${l.composerMetrics.outputTokens.bump}`},[r[86]||(r[86]=d("em",null,"输出",-1)),d("strong",null,A(pc.value),1)],2)),d("button",{type:"button",class:me(["fast-mode-button",{active:ms.value,syncing:l.fastModeMutating}]),"aria-pressed":ms.value,title:ms.value?"关闭当前会话的快速模式":"为当前会话启动快速模式",onClick:$c},[...r[87]||(r[87]=[d("span",null,"快速模式",-1)])],10,Z1),d("span",Q1,[d("button",{type:"button",class:"compact-button",disabled:l.compactSaving||l.pendingSessionSettings.compact===!0,onClick:Oc},"压缩会话",8,Y1)])]),d("div",J1,[d("button",{type:"button",class:"ghost",disabled:l.uploadingFiles,onClick:wm},A(l.uploadingFiles?"上传中…":"上传附件"),9,X1),d("button",{type:zn.value?"button":"submit",class:me(["primary","composer-action",{stop:zn.value}]),disabled:!zn.value&&(l.uploadingFiles||!M.value.trim()&&!l.attachments.length),"aria-label":mc.value,onClick:r[13]||(r[13]=x=>zn.value?nh():void 0)},A(mc.value),11,eS)])])],34)]),d("aside",{class:me(["right-panel",{"mobile-card-open":oe.value}]),"data-mobile-card":oe.value,onKeydown:is(je(ee,["stop"]),["esc"])},[oe.value?(k(),_("button",{key:0,type:"button",class:"mobile-card-close","aria-label":"关闭卡片",onClick:ee},"×")):K("",!0),d("section",nS,[d("div",sS,[d("div",rS,A(Ee("tasks")),1),Hn.value?(k(),_("strong",iS,A(Hn.value),1)):K("",!0)]),Gs.value?(k(),_("button",{key:0,type:"button",class:"background-task-summary",title:Si(Gs.value),onClick:r[14]||(r[14]=x=>Ei(Gs.value))},[d("span",{class:me(["background-task-dot",`status-${Gs.value.status}`])},null,2),d("strong",null,A(ur(Gs.value)),1),Hn.value>1?(k(),_("span",aS,"+"+A(Hn.value-1),1)):K("",!0),r[88]||(r[88]=d("b",{"aria-hidden":"true"},"›",-1))],8,oS)):K("",!0),ei.value.length?(k(),_("details",lS,[d("summary",null,[r[89]||(r[89]=d("span",null,"最近结束",-1)),d("strong",null,A(ei.value.length),1)]),d("div",cS,[(k(!0),_(de,null,Ce(ei.value,x=>(k(),_("button",{key:Qn(x),type:"button",class:"background-task-summary background-task-history-item",title:Si(x),onClick:P=>Ei(x)},[d("span",{class:me(["background-task-dot",`status-${x.status}`])},null,2),d("strong",null,A(ur(x)),1),d("span",{class:me(["background-task-summary-status",`status-${x.status}`])},A(ia(x.status)),3)],8,uS))),128))])])):K("",!0)]),Mt.value?(k(),_("section",dS,[d("div",fS,[d("div",null,[d("span",null,A(Ee("quota"))+" · "+A(uh(Mt.value.account)),1),d("strong",null,A(Zo(Mt.value.remainingPercent)),1)]),d("div",gS,[l.cpaQuotas.length>1?(k(),_("button",{key:0,type:"button","aria-label":"上一个凭据",onClick:r[15]||(r[15]=x=>zc(-1))},"‹")):K("",!0),d("small",null,A(l.cpaQuotas.length>1?`${l.cpaQuotaIndex+1}/${l.cpaQuotas.length}`:"剩余"),1),l.cpaQuotas.length>1?(k(),_("button",{key:1,type:"button","aria-label":"下一个凭据",onClick:r[16]||(r[16]=x=>zc(1))},"›")):K("",!0)])]),d("div",{class:"quota-progress",role:"progressbar","aria-label":"周额度剩余","aria-valuenow":qo(Mt.value.remainingPercent),"aria-valuemin":"0","aria-valuemax":"100"},[d("span",{class:"quota-progress-fill",style:Ot({width:`${qo(Mt.value.remainingPercent)}%`})},null,4)],8,pS),d("div",hS,[d("span",null,"已使用 "+A(Zo(Mt.value.usedPercent)),1),d("span",null,"续期时间 "+A(Qo(Mt.value.resetAt)),1)]),d("div",mS,"更新于 "+A(Qo(Mt.value.updatedAt)),1)])):K("",!0),d("section",bS,[d("div",yS,[d("div",null,[d("span",null,A(Ee("memory")),1),d("strong",null,A(Gn((R=Kn.value)==null?void 0:R.rss)),1)]),r[90]||(r[90]=d("small",null,"RSS",-1))]),bc.value?(k(),_("div",{key:0,class:"memory-chart",onMousemove:gh,onMouseleave:Hc},[(k(),_("svg",kS,[d("path",{d:bc.value},null,8,vS),(k(!0),_(de,null,Ce(oi.value,(x,P)=>(k(),_("circle",{key:x.entry.at,class:me(["memory-trend-point",{active:P===et.value}]),cx:x.x,cy:x.y,r:P===et.value?3.2:1.5,tabindex:"0",onFocus:mt=>et.value=P,onBlur:Hc},null,42,_S))),128))])),Zs.value?(k(),_("div",{key:0,class:"memory-tooltip",style:Ot({left:`clamp(58px, ${Zs.value.x/260*100}%, calc(100% - 58px))`,top:`${Zs.value.y/44*100}%`})},[d("strong",null,A(Gn(Zs.value.entry.rss)),1),d("span",null,A(fh(Zs.value.entry.at)),1)],4)):K("",!0)],32)):(k(),_("div",wS,"—")),d("div",xS,[d("div",null,[r[91]||(r[91]=d("span",null,"V8 堆",-1)),d("strong",null,A(Gn((q=Kn.value)==null?void 0:q.heapUsed)),1)]),d("div",null,[r[92]||(r[92]=d("span",null,"外部内存",-1)),d("strong",null,A(Gn((ae=Kn.value)==null?void 0:ae.external)),1)])]),d("div",SS,[d("span",null,"更新于 "+A(dh((ue=Kn.value)==null?void 0:ue.at)),1)])])],42,tS)])):l.activePanel==="sessions"?(k(),_("section",ES,[d("div",TS,[d("div",{class:"page-head sessions-page-head"},[r[93]||(r[93]=d("div",null,[d("h2",null,"会话管理"),d("p",null,"查找、继续或整理历史会话")],-1)),d("button",{class:"primary",onClick:bi},"+ 新建会话")]),d("div",AS,[d("label",CS,[ot(d("input",{"onUpdate:modelValue":r[17]||(r[17]=x=>O.value=x),type:"search",placeholder:"搜索标题或 ID",autocomplete:"off"},null,512),[[Tt,O.value]])]),d("span",IS,A(O.value.trim()?`${Vs.value.length} / ${l.sessions.length}`:`${l.sessions.length} 个会话`),1)]),l.sessionsLoading?(k(),_("div",MS,"正在加载会话…")):l.sessions.length?Vs.value.length?(k(),_("div",OS,[(k(!0),_(de,null,Ce(hp.value,x=>(k(),_("article",{key:x.sessionId,class:me(["session-card",{current:Go(x.sessionId),running:Vo(x.sessionId)}])},[d("div",LS,[d("div",PS,[d("strong",null,A(St(x)),1),Go(x.sessionId)?(k(),_("span",$S,"当前")):Vo(x.sessionId)?(k(),_("span",DS,"运行中")):K("",!0)]),d("div",BS,[d("code",{title:x.sessionId},"ID · "+A(x.sessionId),9,US),d("time",{datetime:x.updatedAt||x.createdAt},"更新于 "+A(Fc(x.updatedAt||x.createdAt)),9,FS)])]),d("div",zS,[d("button",{disabled:l.sessionResumeLoading||l.sessionsLoading,onClick:P=>ah(x.sessionId)},A(l.pendingResumeSessionId===x.sessionId&&l.sessionResumeLoading?"打开中…":"打开"),9,HS),d("button",{class:"danger",disabled:l.sessionResumeLoading||l.sessionsLoading,onClick:P=>lh(x.sessionId)},"删除",8,jS)])],2))),128))])):(k(),_("div",NS,"没有匹配的会话")):(k(),_("div",RS,"暂无会话")),!l.sessionsLoading&&Vs.value.length&&ti.value>1?(k(),_("nav",WS,[d("button",{type:"button",disabled:H.value===1,onClick:r[18]||(r[18]=x=>H.value-=1)},"上一页",8,KS),(k(!0),_(de,null,Ce(mp.value,x=>(k(),_("button",{key:x,type:"button",class:me({active:x===H.value}),"aria-current":x===H.value?"page":void 0,onClick:P=>H.value=x},A(x),11,GS))),128)),d("button",{type:"button",disabled:H.value===ti.value,onClick:r[19]||(r[19]=x=>H.value+=1)},"下一页",8,VS)])):K("",!0)])])):l.activePanel==="prompts"?(k(),_("section",qS,[d("div",ZS,[d("div",QS,[r[94]||(r[94]=d("h2",null,"提示词",-1)),d("div",YS,[d("button",{class:"ghost",onClick:r[20]||(r[20]=x=>l.activePanel="chat")},"回到对话"),d("button",{class:"primary",onClick:Hp},"+ 新建提示词")])]),d("div",JS,[d("aside",XS,[d("div",eE,[d("strong",null,A(l.promptLibrary.length)+" 个提示词",1)]),d("div",tE,[l.promptLibraryLoading?(k(),_("div",nE,"正在加载…")):l.promptLibrary.length?(k(!0),_(de,{key:2},Ce(l.promptLibrary,x=>{var P,mt;return k(),_("button",{key:x.id,class:me(["prompt-library-item",{active:((P=si.value)==null?void 0:P.id)===x.id,applied:((mt=Wn.value)==null?void 0:mt.id)===x.id,dragging:Oe.value===x.id,"drop-before":Xe.value===x.id&&Ye.value==="before","drop-after":Xe.value===x.id&&Ye.value==="after"}]),type:"button",draggable:"true",onClick:Vt=>jp(x),onDblclick:Vt=>er(x),onDragstart:Vt=>Xp(Vt,x),onDragover:Vt=>eh(Vt,x),onDrop:Vt=>th(Vt,x),onDragend:Tc},[d("strong",null,A(x.title),1),x.usage?(k(),_("span",iE,"用法:"+A(x.usage),1)):K("",!0)],42,rE)}),128)):(k(),_("div",sE,"暂无提示词"))])]),d("section",oE,[d("div",aE,[d("strong",lE,A(ve.title||"新提示词"),1),d("div",cE,[d("button",{class:"mini-button",type:"button",disabled:!si.value,onClick:r[21]||(r[21]=x=>si.value&&er(si.value))},"应用",8,uE),d("button",{class:"mini-button",type:"button",onClick:Wp},"保存"),d("button",{class:"mini-button danger",type:"button",disabled:!ve.id,onClick:Kp},"删除",8,dE)])]),d("div",fE,[d("label",gE,[r[95]||(r[95]=d("span",null,"名称",-1)),ot(d("input",{"onUpdate:modelValue":r[22]||(r[22]=x=>ve.title=x),type:"text",placeholder:"例如:代码评审"},null,512),[[Tt,ve.title]])]),d("label",pE,[r[96]||(r[96]=d("span",null,"提示词内容",-1)),ot(d("textarea",{"onUpdate:modelValue":r[23]||(r[23]=x=>ve.content=x),rows:"14",placeholder:"输入提示词内容"},null,512),[[Tt,ve.content]])]),d("label",hE,[r[97]||(r[97]=d("span",null,"用法(选填)",-1)),ot(d("textarea",{"onUpdate:modelValue":r[24]||(r[24]=x=>ve.usage=x),rows:"4",placeholder:"输入适用场景"},null,512),[[Tt,ve.usage]])])])])])])])):l.activePanel==="settings"?(k(),_("section",mE,[d("div",bE,[l.settingsPage==="prompt"?(k(),_(de,{key:0},[d("div",yE,[d("div",kE,[d("button",{type:"button",class:"mini-button","aria-label":"返回模型配置",onClick:r[25]||(r[25]=x=>l.settingsPage="")},"←"),r[98]||(r[98]=d("h2",null,"提示词配置",-1))])]),at(Jd,{endpoint:"/api/prompt-config",onSaved:Bc})],64)):(k(),_(de,{key:1},[d("div",vE,[r[99]||(r[99]=d("h2",null,"模型配置",-1)),d("button",{class:"primary",onClick:Uc,disabled:!l.login},"保存",8,_E)]),l.login?(k(),_("form",{key:1,class:"settings-form",onSubmit:je(Uc,["prevent"])},[d("button",{type:"button",class:"settings-prompt-entry",onClick:r[26]||(r[26]=x=>l.settingsPage="prompt")},[...r[100]||(r[100]=[d("strong",null,"提示词配置",-1),d("span",{"aria-hidden":"true"},"›",-1)])]),d("section",xE,[r[102]||(r[102]=d("header",{class:"settings-card-head"},[d("strong",null,"模型")],-1)),d("div",SE,[d("label",EE,[r[101]||(r[101]=d("span",null,"供应商",-1)),at(Vi,{modelValue:Q.value,"onUpdate:modelValue":r[27]||(r[27]=x=>Q.value=x),options:Lh(l.login.providers),"aria-label":"供应商",onChange:ch},null,8,["modelValue","options"])]),(k(!0),_(de,null,Ce(l.login.fields,x=>(k(),_("label",{key:x.key,class:"settings-field"},[d("span",null,[Ns(A(oa(x.label)),1),x.required?(k(),_("i",TE)):K("",!0)]),x.options?(k(),rt(Vi,{key:0,modelValue:ye[x.key],"onUpdate:modelValue":P=>ye[x.key]=P,options:Ph(x),"aria-label":oa(x.label)},null,8,["modelValue","onUpdate:modelValue","options","aria-label"])):ot((k(),_("input",{key:1,"onUpdate:modelValue":P=>ye[x.key]=P,type:x.secret?"password":"text",placeholder:x.placeholder||`请输入${oa(x.label)}`},null,8,AE)),[[Ok,ye[x.key]]])]))),128))])]),d("section",CE,[r[105]||(r[105]=d("header",{class:"settings-card-head"},[d("strong",null,"CPA")],-1)),d("div",IE,[d("label",ME,[r[103]||(r[103]=d("span",null,"URL",-1)),ot(d("input",{"onUpdate:modelValue":r[28]||(r[28]=x=>l.cpaConfig.url=x),type:"text",placeholder:"http://127.0.0.1:8317",autocomplete:"off"},null,512),[[Tt,l.cpaConfig.url]])]),d("label",RE,[r[104]||(r[104]=d("span",null,"管理密码",-1)),ot(d("input",{"onUpdate:modelValue":r[29]||(r[29]=x=>l.cpaConfig.password=x),type:"password",placeholder:"请输入管理密码",autocomplete:"new-password"},null,512),[[Tt,l.cpaConfig.password]])])])]),d("section",NE,[d("header",OE,[r[106]||(r[106]=d("div",null,[d("strong",null,"工具"),d("small",null,"内置与插件工具默认开启,关闭后立即对当前会话生效。")],-1)),d("button",{type:"button",class:"mini-button",disabled:l.busy||l.globalTools.loading,onClick:Ep},"保存",8,LE)]),d("div",PE,[(k(!0),_(de,null,Ce(l.globalTools.items,x=>(k(),_("label",{key:x.name,class:"plugin-settings-row"},[d("span",null,[d("strong",null,[d("code",null,A(x.name),1)]),d("small",null,A(x.source==="plugin"?`插件 · ${x.pluginName||x.pluginId}`:x.source==="external"?"外部工具":"内置工具"),1)]),d("span",$E,[ot(d("input",{"onUpdate:modelValue":P=>x.configuredEnabled=P,type:"checkbox","aria-label":x.name},null,8,DE),[[ml,x.configuredEnabled]]),r[107]||(r[107]=d("span",{"aria-hidden":"true"},null,-1))])]))),128))])]),d("section",BE,[d("header",UE,[r[108]||(r[108]=d("strong",null,"插件",-1)),d("button",{type:"button",class:"mini-button",disabled:l.globalPlugins.locked||l.globalPlugins.loading,onClick:Cp},"保存",8,FE)]),d("div",zE,[(k(!0),_(de,null,Ce(l.globalPlugins.items,x=>(k(),_("label",{key:x.id,class:"plugin-settings-row"},[d("span",null,[d("strong",null,A(x.name),1),d("small",null,A(x.tools.length)+" 个工具",1)]),d("span",HE,[ot(d("input",{"onUpdate:modelValue":P=>x.configuredEnabled=P,type:"checkbox",disabled:l.globalPlugins.locked,"aria-label":x.name},null,8,jE),[[ml,x.configuredEnabled]]),r[109]||(r[109]=d("span",{"aria-hidden":"true"},null,-1))])]))),128))])])],32)):(k(),_("div",wE,"正在加载配置…"))],64))])])):(k(),_("section",WE,[d("div",KE,[r[110]||(r[110]=d("h2",null,"运行时能力",-1)),d("div",GE,[(k(),_(de,null,Ce(["流式模型循环","工具执行","上下文指标","会话恢复","后台代理","登录配置","图片附件","Markdown 输出"],x=>d("div",{key:x,class:"capability-card"},A(x),1)),64))])])]))]),l.toast?(k(),_("div",VE,A(l.toast),1)):K("",!0)]),(k(),rt(Ut,{to:"body"},[l.coreVersion?(k(),_("div",{key:0,class:me(["core-version",{celebrating:l.coreEasterEgg}]),role:"button",tabindex:"0",title:`内核版本 ${l.coreVersion} · 点击试试`,onClick:bs,onKeydown:[is(je(bs,["prevent"]),["enter"]),is(je(bs,["prevent"]),["space"])]},[r[111]||(r[111]=d("span",{class:"core-version-spark spark-a","aria-hidden":"true"},null,-1)),r[112]||(r[112]=d("span",{class:"core-version-spark spark-b","aria-hidden":"true"},null,-1)),r[113]||(r[113]=d("span",{class:"core-version-spark spark-c","aria-hidden":"true"},null,-1)),d("span",null,"内核版本 "+A(l.coreVersion),1)],42,qE)):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.cwdPicker.open?(k(),_("div",{key:0,class:"cwd-picker-backdrop",onClick:je(Ai,["self"])},[d("section",ZE,[d("header",{class:"cwd-picker-head"},[r[114]||(r[114]=d("strong",null,"CWD",-1)),d("button",{type:"button","aria-label":"关闭",onClick:Ai},"×")]),d("form",{class:"cwd-picker-path",onSubmit:r[31]||(r[31]=je(x=>Ci(),["prevent"]))},[ot(d("input",{"onUpdate:modelValue":r[30]||(r[30]=x=>l.cwdPicker.input=x),autocomplete:"off",spellcheck:"false","aria-label":"工作目录路径"},null,512),[[Tt,l.cwdPicker.input]]),d("button",{type:"submit",disabled:l.cwdPicker.loading},"前往",8,QE),d("button",{type:"button",disabled:l.cwdPicker.mutating,onClick:Kh},"新建",8,YE)],32),d("div",JE,[l.cwdPicker.parent?(k(),_("button",{key:0,type:"button",onClick:r[32]||(r[32]=x=>Ci(l.cwdPicker.parent))},"← 上级")):K("",!0),d("span",null,A(l.cwdPicker.selectedPath||l.cwdPicker.cwd),1)]),d("div",XE,[d("nav",eT,[(k(!0),_(de,null,Ce(l.cwdPicker.locations,x=>(k(),_("button",{key:`${x.id}-${x.path}`,type:"button",class:me({active:l.cwdPicker.cwd===x.path}),title:x.path,onClick:P=>Ci(x.path)},[d("span",nT,A(x.kind==="drive"||x.kind==="volume"?"▣":x.kind==="home"?"◆":"◇"),1),d("strong",null,A(x.label),1)],10,tT))),128))]),d("div",sT,[l.cwdPicker.loading?(k(),_("div",rT,"读取中")):l.cwdPicker.error?(k(),_("div",iT,A(l.cwdPicker.error),1)):(k(),rt(Jw,{key:2,nodes:l.cwdPicker.treeRoots,children:l.cwdPicker.treeChildren,expanded:l.cwdPicker.treeExpanded,"selected-path":l.cwdPicker.selectedPath,"allow-delete":!1,onToggle:jh,onSelect:Wh,onDelete:Gh},null,8,["nodes","children","expanded","selected-path"]))])]),d("footer",oT,[d("button",{type:"button",onClick:Ai},"取消"),d("button",{type:"button",class:"primary",disabled:l.cwdPicker.mutating||l.cwdPicker.loading,onClick:Vh},"选择",8,aT)])])])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.projectContextOpen?(k(),_("div",{key:0,class:"runtime-context-modal-backdrop",onClick:je(ua,["self"])},[d("section",lT,[d("header",cT,[d("div",null,[l.projectContextDocument?(k(),_("span",uT,A(l.projectContextDocument.path),1)):K("",!0),d("strong",null,A(((Te=l.projectContextDocument)==null?void 0:Te.name)||"项目上下文"),1)]),d("button",{type:"button","aria-label":l.projectContextDocument?"返回":"关闭",onClick:ua},"×",8,dT)]),d("div",fT,[l.projectContextDocument?(k(),_("pre",hT,A(l.projectContextDocument.content),1)):(k(),_("div",gT,[(k(!0),_(de,null,Ce(qs.value,x=>(k(),_("button",{key:x.path,type:"button",class:"runtime-context-index-item",onClick:P=>Uh(x)},[d("span",null,[d("strong",null,A(x.name),1),d("small",null,A(Ss(x.chars||0))+" 字符",1)]),r[115]||(r[115]=d("b",null,"›",-1))],8,pT))),128))]))])])])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.confirmDialog.open?(k(),_("div",{key:0,class:"confirm-dialog-backdrop",onClick:r[35]||(r[35]=je(x=>ys(!1),["self"]))},[d("section",{class:"confirm-dialog",role:"alertdialog","aria-modal":"true","aria-label":l.confirmDialog.title},[d("div",{class:me(["confirm-dialog-icon",`tone-${l.confirmDialog.tone}`]),"aria-hidden":"true"},"!",2),d("div",bT,[d("h3",null,A(l.confirmDialog.title),1),d("p",null,A(l.confirmDialog.message),1)]),d("div",yT,[d("button",{type:"button",class:"ghost",onClick:r[33]||(r[33]=x=>ys(!1))},A(l.confirmDialog.cancelLabel),1),d("button",{type:"button",class:me(["primary",{danger:l.confirmDialog.tone==="danger"}]),onClick:r[34]||(r[34]=x=>ys(!0))},A(l.confirmDialog.confirmLabel),3)])],8,mT)])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.modelModalOpen?(k(),_("div",{key:0,class:"context-window-backdrop",onClick:je(nr,["self"])},[d("section",{class:"context-window-modal session-model-modal",role:"dialog","aria-modal":"true","aria-label":"选择模型",onKeydown:Nc},[d("form",{onSubmit:je(rh,["prevent"])},[d("header",{class:"session-model-header"},[r[116]||(r[116]=d("h2",null,"模型",-1)),d("button",{type:"button",class:"ghost","aria-label":"关闭模型选择",onClick:nr},"×")]),ot(d("input",{id:"session-model-search","onUpdate:modelValue":r[36]||(r[36]=x=>l.modelSearch=x),type:"search",placeholder:"搜索模型","aria-label":"搜索模型",autocomplete:"off"},null,512),[[Tt,l.modelSearch]]),d("div",kT,[(k(!0),_(de,null,Ce(gp.value,x=>(k(),_("label",{key:x,class:me(["session-model-option",{selected:l.modelDraft===x}])},[ot(d("input",{"onUpdate:modelValue":r[37]||(r[37]=P=>l.modelDraft=P),type:"radio",name:"session-model",value:x,disabled:l.modelSaving},null,8,vT),[[bl,l.modelDraft]]),d("span",null,A(x),1)],2))),128))]),d("fieldset",{class:"session-reasoning-options",disabled:l.modelSaving},[r[117]||(r[117]=d("legend",null,"推理强度",-1)),(k(!0),_(de,null,Ce(Xr.value,x=>(k(),_("label",{key:x,class:me({selected:l.reasoningDraft===x})},[ot(d("input",{"onUpdate:modelValue":r[38]||(r[38]=P=>l.reasoningDraft=P),type:"radio",name:"session-reasoning",value:x},null,8,wT),[[bl,l.reasoningDraft]]),d("span",null,A(x==="default"?"默认":x==="off"?"关闭":x),1)],2))),128))],8,_T),l.modelError?(k(),_("p",xT,A(l.modelError),1)):K("",!0),d("div",ST,[d("button",{type:"button",class:"ghost",onClick:nr},"取消"),d("button",{type:"submit",class:"primary",disabled:l.modelSaving||!l.modelDraft},A(l.modelSaving?"保存中…":"确认"),9,ET)])],32)],32)])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.contextWindowModalOpen?(k(),_("div",{key:0,class:"context-window-backdrop",onClick:je(hi,["self"])},[d("section",{class:"context-window-modal",role:"dialog","aria-modal":"true","aria-label":"上下文窗口",onKeydown:Nc},[d("form",{onSubmit:je(oh,["prevent"])},[r[119]||(r[119]=d("label",{for:"context-window-input"},"上下文窗口",-1)),d("div",TT,[ot(d("input",{id:"context-window-input","onUpdate:modelValue":r[39]||(r[39]=x=>l.contextWindowDraft=x),type:"text",inputmode:"numeric",autocomplete:"off",autofocus:"","aria-describedby":"context-window-unit",onInput:ih},null,544),[[Tt,l.contextWindowDraft]]),r[118]||(r[118]=d("span",{id:"context-window-unit"},"k",-1))]),l.contextWindowError?(k(),_("p",AT,A(l.contextWindowError),1)):K("",!0),d("div",CT,[d("button",{type:"button",class:"ghost",onClick:hi},"取消"),d("button",{type:"submit",class:"primary",disabled:l.contextWindowSaving},A(l.contextWindowSaving?"保存中…":"确认"),9,IT)])],32)],32)])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.imagePreview?(k(),_("div",{key:0,class:"image-preview-backdrop",onClick:je(Xo,["self"])},[d("section",{class:"image-preview-modal",role:"dialog","aria-modal":"true","aria-label":l.imagePreview.caption||"图片预览"},[d("button",{type:"button",class:"image-preview-close","aria-label":"关闭图片预览",onClick:Xo},"×"),d("div",RT,[d("img",{src:l.imagePreview.src,alt:l.imagePreview.caption||"图片预览"},null,8,NT)]),l.imagePreview.caption?(k(),_("footer",OT,A(l.imagePreview.caption),1)):K("",!0)],8,MT)])):K("",!0)])),(k(),rt(Ut,{to:"body"},[an.value?(k(),_("div",{key:0,class:"runtime-context-detail-backdrop",onClick:je(ki,["self"])},[d("section",LT,[d("header",{class:"runtime-context-modal-head"},[r[120]||(r[120]=d("div",null,[d("strong",null,"压缩上下文详情")],-1)),d("button",{type:"button","aria-label":"关闭",onClick:ki},"×")]),d("div",PT,[d("dl",$T,[d("div",null,[r[121]||(r[121]=d("dt",null,"压缩方式",-1)),d("dd",null,A(yh(an.value)),1)]),d("div",null,[r[122]||(r[122]=d("dt",null,"发生时间",-1)),d("dd",null,A(Fc(an.value.compaction.createdAt)),1)]),d("div",null,[r[123]||(r[123]=d("dt",null,"新窗口消息",-1)),d("dd",null,A(an.value.compaction.newWindowMessages),1)]),d("div",null,[r[124]||(r[124]=d("dt",null,"保留用户消息",-1)),d("dd",null,A(an.value.compaction.preservedUserMessages),1)]),d("div",null,[r[125]||(r[125]=d("dt",null,"释放字符",-1)),d("dd",null,A(Ss(an.value.compaction.charsFreed)),1)]),d("div",null,[r[126]||(r[126]=d("dt",null,"图片引用",-1)),d("dd",null,A(an.value.compaction.imageCount||0),1)])]),r[127]||(r[127]=d("h3",null,"实际续接上下文",-1)),d("pre",null,A(an.value.compaction.continuationState||an.value.compaction.summary||"未提供续接上下文"),1)])])])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.runtimeContextModal?(k(),_("div",{key:0,class:"runtime-context-modal-backdrop",onClick:je(la,["self"])},[d("section",DT,[d("header",BT,[d("div",null,[d("strong",null,A(l.runtimeContextModal==="prompt"?"系统提示词":l.runtimeContextModal==="tools"?"可用工具":"会话插件"),1)]),d("button",{type:"button","aria-label":"关闭",onClick:la},"×")]),d("div",UT,[l.runtimeContextModal==="prompt"?(k(),rt(Jd,{key:0,endpoint:I("/api/session-prompt"),session:"","runtime-prompt":(He=l.runtimeContext)==null?void 0:He.prompt,onSaved:Bc},null,8,["endpoint","runtime-prompt"])):l.runtimeContextModal==="tools"?(k(),_("div",FT,[l.sessionTools.loading?(k(),_("div",zT,"同步中")):(k(),_(de,{key:1},[d("div",HT,[d("span",null,"可用 "+A(_p.value)+" / "+A(l.sessionTools.items.length),1)]),(k(!0),_(de,null,Ce(l.sessionTools.items,x=>(k(),_("div",{key:x.name,class:"runtime-plugin-row"},[d("button",{type:"button",class:"runtime-tool-detail-button",disabled:!zo.value.some(P=>P.name===x.name),onClick:P=>qh(zo.value.find(mt=>mt.name===x.name))},[d("code",null,A(x.name),1),d("small",null,A(x.available===!1?`插件未启用 · ${x.pluginName||x.pluginId}`:x.source==="plugin"?`插件 · ${x.pluginName||x.pluginId}`:x.source==="external"?"外部工具":"内置工具"),1)],8,jT),at(Vi,{class:"runtime-plugin-control","model-value":x.mode,options:t,disabled:l.busy||l.sessionTools.busy||x.available===!1,"aria-label":`${x.name}状态`,"data-mode":x.mode,"onUpdate:modelValue":P=>Tp(x,P)},null,8,["model-value","disabled","aria-label","data-mode","onUpdate:modelValue"])]))),128))],64))])):(k(),_("div",WT,[l.sessionPlugins.loading?(k(),_("div",KT,"同步中")):(k(!0),_(de,{key:1},Ce(l.sessionPlugins.items,x=>(k(),_("div",{key:x.id,class:"runtime-plugin-row"},[d("span",null,[d("strong",null,A(x.name),1),d("small",null,A(x.tools.length)+" 个工具",1)]),at(Vi,{class:"runtime-plugin-control","model-value":x.mode,options:t,disabled:l.busy||l.sessionPlugins.busy||!x.globallyEnabled,"aria-label":`${x.name}状态`,"data-mode":x.mode,"onUpdate:modelValue":P=>Ip(x,P)},null,8,["model-value","disabled","aria-label","data-mode","onUpdate:modelValue"])]))),128))]))])])])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.runtimeContextDetail?(k(),_("div",{key:0,class:"runtime-context-detail-backdrop",onClick:je(ca,["self"])},[d("section",{class:"runtime-context-detail-modal",role:"dialog","aria-modal":"true","aria-label":l.runtimeContextDetail.title},[d("header",VT,[d("div",null,[l.runtimeContextDetail.meta?(k(),_("span",qT,A(l.runtimeContextDetail.meta),1)):K("",!0),d("strong",null,A(l.runtimeContextDetail.title),1)]),d("button",{type:"button","aria-label":"返回",onClick:ca},"×")]),d("div",ZT,[l.runtimeContextDetail.kind==="tool"?(k(),_(de,{key:0},[l.runtimeContextDetail.description?(k(),_("p",QT,A(l.runtimeContextDetail.description),1)):K("",!0),d("pre",null,A(l.runtimeContextDetail.schema),1)],64)):(k(),_("pre",YT,A(l.runtimeContextDetail.content),1))])],8,GT)])):K("",!0)])),(k(),rt(Ut,{to:"body"},[l.backgroundTaskDetail?(k(),_("div",{key:0,class:"tool-result-modal-backdrop",onClick:je(Ti,["self"])},[d("section",JT,[d("header",XT,[d("div",eA,[r[128]||(r[128]=d("strong",null,"后台任务",-1)),d("span",tA,A(Sn.value.length),1)]),d("button",{type:"button",class:"tool-result-modal-close","aria-label":"关闭",onClick:Ti},"×")]),d("div",{class:me(["tool-result-modal-content","background-task-page",{single:Sn.value.length<=1}])},[Sn.value.length>1?(k(),_("nav",nA,[(k(!0),_(de,null,Ce(Sn.value,x=>(k(),_("button",{key:Qn(x),type:"button",class:me(["background-task-index-item",{active:Qn(x)===Qn(l.backgroundTaskDetail)}]),title:Si(x),onClick:P=>Ei(x)},[d("span",{class:me(["background-task-dot",`status-${x.status}`])},null,2),d("span",rA,[d("strong",null,A(ur(x)),1),d("small",null,A(ia(x.status)),1)])],10,sA))),128))])):K("",!0),d("article",iA,[d("header",oA,[d("div",aA,[d("span",{class:me(["background-task-dot",`status-${l.backgroundTaskDetail.status}`])},null,2),d("strong",null,A(ur(l.backgroundTaskDetail)),1)]),d("span",{class:me(["tool-result-modal-status",`status-${l.backgroundTaskDetail.status}`])},A(ia(l.backgroundTaskDetail.status)),3)]),d("dl",lA,[tu(l.backgroundTaskDetail)?(k(),_("div",cA,[r[129]||(r[129]=d("dt",null,"耗时",-1)),d("dd",null,A(tu(l.backgroundTaskDetail)),1)])):K("",!0),l.backgroundTaskDetail.cwd?(k(),_("div",uA,[r[130]||(r[130]=d("dt",null,"目录",-1)),d("dd",null,A(l.backgroundTaskDetail.cwd),1)])):K("",!0)]),d("div",dA,[l.backgroundTaskDetail.kind!=="agent"&&nu(l.backgroundTaskDetail)?(k(),_("section",fA,[r[131]||(r[131]=d("header",null,"命令",-1)),d("pre",gA,A(nu(l.backgroundTaskDetail)),1)])):K("",!0),l.backgroundTaskDetail.kind==="terminal"?(k(),rt(Ov,{key:1,"owner-session-id":l.backgroundTaskDetail.ownerSessionId||((Bt=l.session)==null?void 0:Bt.sessionId),"run-id":l.backgroundTaskDetail.sessionId},null,8,["owner-session-id","run-id"])):K("",!0),l.backgroundTaskDetail.kind==="agent"?(k(),_("div",pA,[at(zv,{"owner-session-id":(ln=l.session)==null?void 0:ln.sessionId,task:l.backgroundTaskDetail,"render-markdown":xh},null,8,["owner-session-id","task"])])):K("",!0)])])],2)])])):K("",!0),$t.value?(k(),_("div",{key:1,class:"tool-result-modal-backdrop",onClick:je(vs,["self"])},[d("section",{class:"tool-result-modal",onKeydown:Sh,role:"dialog","aria-modal":"true","aria-label":`${qn($t.value)}详情`},[d("header",mA,[d("div",null,[d("div",bA,[d("strong",null,A(qn($t.value)),1),d("span",{class:me(["tool-result-modal-status",`status-${En($t.value).key}`])},A(En($t.value).label),3)]),qc($t.value)?(k(),_("p",yA,A(qc($t.value)),1)):K("",!0)]),d("button",{type:"button",class:"tool-result-modal-close","aria-label":"关闭工具结果",onClick:vs},"×")]),d("div",kA,[Cn($t.value)?(k(),_("div",{key:0,class:"message-text markdown tool-detail-markdown",innerHTML:Zh($t.value)},null,8,vA)):K("",!0)]),d("footer",{class:"tool-result-modal-footer"},[d("button",{type:"button",class:"primary",onClick:vs},"关闭")])],40,hA)])):K("",!0)]))],64)}}};Fk(IA).mount("#app");
|