@vuagent/console 0.7.0-next.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,49 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).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 s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function Gi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ie={},Zn=[],en=()=>{},eu=()=>!1,ua=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),da=e=>e.startsWith("onUpdate:"),Ye=Object.assign,Xi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xp=Object.prototype.hasOwnProperty,Le=(e,t)=>xp.call(e,t),be=Array.isArray,En=e=>lo(e)==="[object Map]",wn=e=>lo(e)==="[object Set]",Vl=e=>lo(e)==="[object Date]",De=e=>typeof e=="function",qe=e=>typeof e=="string",Ut=e=>typeof e=="symbol",Oe=e=>e!==null&&typeof e=="object",tu=e=>(Oe(e)||De(e))&&De(e.then)&&De(e.catch),nu=Object.prototype.toString,lo=e=>nu.call(e),Cp=e=>lo(e).slice(8,-1),su=e=>lo(e)==="[object Object]",Yi=e=>qe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Fs=Gi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fa=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},$p=/-\w/g,mt=fa(e=>e.replace($p,t=>t.slice(1).toUpperCase())),Ap=/\B([A-Z])/g,xn=fa(e=>e.replace(Ap,"-$1").toLowerCase()),pa=fa(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ja=fa(e=>e?`on${pa(e)}`:""),ct=(e,t)=>!Object.is(e,t),zo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ou=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},ro=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Dp=e=>{const t=qe(e)?Number(e):NaN;return isNaN(t)?e:t};let ql;const va=()=>ql||(ql=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Fe(e){if(be(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=qe(s)?Tp(s):Fe(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(qe(e)||Oe(e))return e}const Rp=/;(?![^(]*\))/g,Sp=/:([^]+)/,Ep=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Tp(e){const t={};return e.replace(Ep,n=>n.startsWith("/*")?"":n).split(Rp).forEach(n=>{if(n){const s=n.split(Sp);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function _e(e){let t="";if(qe(e))t=e;else if(be(e))for(let n=0;n<e.length;n++){const s=_e(e[n]);s&&(t+=s+" ")}else if(Oe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Mp(e){if(!e)return null;let{class:t,style:n}=e;return t&&!qe(t)&&(e.class=_e(t)),n&&(e.style=Fe(n)),e}const Fp="itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",Ip=Gi(Fp);function au(e){return!!e||e===""}function Pp(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Wt(e[o],t[o],n);return s}function Hl(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let i=-1;for(let l=0;l<s.length;l++)if(!o[l]&&Wt(a,s[l],n)){i=l;break}if(i<0)return!1;o[i]=1}return!0}function Bp(e,t,n){let s=En(e),o=En(t);if(s||o||(s=wn(e),o=wn(t),s||o))return s&&o?Hl(e,t,n):!1;const a=Object.keys(e).length,i=Object.keys(t).length;if(a!==i)return!1;for(const l in e){const r=e.hasOwnProperty(l),c=t.hasOwnProperty(l);if(r&&!c||!r&&c||!Wt(e[l],t[l],n))return!1}return String(e)===String(t)}function Kl(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const i=s(e,t,n);return o.delete(e),a.delete(t),i}function Wt(e,t,n){if(e===t)return!0;let s=Vl(e),o=Vl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=Ut(e),o=Ut(t),s||o?e===t:(s=be(e),o=be(t),s||o?s&&o?Kl(e,t,n,Pp):!1:(s=Oe(e),o=Oe(t),s||o?!s||!o?!1:Kl(e,t,n,Bp):String(e)===String(t))))}function Qi(e,t){return e.findIndex(n=>Wt(n,t))}const iu=e=>!!(e&&e.__v_isRef===!0),$=e=>qe(e)?e:e==null?"":be(e)||Oe(e)&&(e.toString===nu||!De(e.toString))?iu(e)?$(e.value):JSON.stringify(e,lu,2):String(e),lu=(e,t)=>iu(t)?lu(e,t.value):En(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[Za(s,a)+" =>"]=o,n),{})}:wn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Za(n))}:Ut(t)?Za(t):Oe(t)&&!be(t)&&!su(t)?String(t):t,Za=(e,t="")=>{var n;return Ut(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let rt;class Lp{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&&rt&&(rt.active?(this.parent=rt,this.index=(rt.scopes||(rt.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){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[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){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=rt;try{return rt=this,t()}finally{rt=n}}}on(){++this._on===1&&(this.prevScope=rt,rt=this)}off(){if(this._on>0&&--this._on===0){if(rt===this)rt=this.prevScope;else{let t=rt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[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 Op(){return rt}let We;const Ga=new WeakSet;class ru{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,rt&&(rt.active?rt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ga.has(this)&&(Ga.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||uu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Jl(this),du(this);const t=We,n=Nt;We=this,Nt=!0;try{return this.fn()}finally{fu(this),We=t,Nt=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,Jl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ga.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){bi(this)&&this.run()}get dirty(){return bi(this)}}let cu=0,Is,Ps;function uu(e,t=!1){if(e.flags|=8,t){e.next=Ps,Ps=e;return}e.next=Is,Is=e}function el(){cu++}function tl(){if(--cu>0)return;if(Ps){let t=Ps;for(Ps=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Is;){let t=Is;for(Is=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function du(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fu(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),nl(s),zp(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function bi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(pu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function pu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vs)||(e.globalVersion=Vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!bi(e))))return;e.flags|=2;const t=e.dep,n=We,s=Nt;We=e,Nt=!0;try{du(e);const o=e.fn(e._value);(t.version===0||ct(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{We=n,Nt=s,fu(e),e.flags&=-3}}function nl(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)nl(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function zp(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Nt=!0;const vu=[];function tn(){vu.push(Nt),Nt=!1}function nn(){const e=vu.pop();Nt=e===void 0?!0:e}function Jl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=We;We=void 0;try{t()}finally{We=n}}}let Vs=0;class jp{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 ha{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||!Nt||We===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==We)n=this.activeLink=new jp(We,this),We.deps?(n.prevDep=We.depsTail,We.depsTail.nextDep=n,We.depsTail=n):We.deps=We.depsTail=n,hu(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=We.depsTail,n.nextDep=void 0,We.depsTail.nextDep=n,We.depsTail=n,We.deps===n&&(We.deps=s)}return n}trigger(t){this.version++,Vs++,this.notify(t)}notify(t){el();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{tl()}}}function hu(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)hu(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ki=new WeakMap,Gn=Symbol(""),wi=Symbol(""),qs=Symbol("");function vt(e,t,n){if(Nt&&We){let s=ki.get(e);s||ki.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new ha),o.map=s,o.key=n),o.track()}}function pn(e,t,n,s,o,a){const i=ki.get(e);if(!i){Vs++;return}const l=r=>{r&&r.trigger()};if(el(),t==="clear")i.forEach(l);else{const r=be(e),c=r&&Yi(n);if(r&&n==="length"){const u=Number(s);i.forEach((d,_)=>{(_==="length"||_===qs||!Ut(_)&&_>=u)&&l(d)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),c&&l(i.get(qs)),t){case"add":r?c&&l(i.get("length")):(l(i.get(Gn)),En(e)&&l(i.get(wi)));break;case"delete":r||(l(i.get(Gn)),En(e)&&l(i.get(wi)));break;case"set":En(e)&&l(i.get(Gn));break}}tl()}function ts(e){const t=Pe(e);return t===e||(vt(t,"iterate",qs),Mt(e))?t:sn(e)?Tn(e)?t.map(n=>In(It(n))):t.map(In):t.map(It)}function ma(e){return vt(e=Pe(e),"iterate",qs),e}function Jt(e,t){return sn(e)?In(Tn(e)?It(t):t):It(t)}const Np={__proto__:null,[Symbol.iterator](){return Xa(this,Symbol.iterator,e=>Jt(this,e))},concat(...e){return ts(this).concat(...e.map(t=>be(t)?ts(t):t))},entries(){return Xa(this,"entries",e=>(e[1]=Jt(this,e[1]),e))},every(e,t){return un(this,"every",e,t,void 0,arguments)},filter(e,t){return un(this,"filter",e,t,n=>n.map(s=>Jt(this,s)),arguments)},find(e,t){return un(this,"find",e,t,n=>Jt(this,n),arguments)},findIndex(e,t){return un(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return un(this,"findLast",e,t,n=>Jt(this,n),arguments)},findLastIndex(e,t){return un(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return un(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ya(this,"includes",e)},indexOf(...e){return Ya(this,"indexOf",e)},join(e){return ts(this).join(e)},lastIndexOf(...e){return Ya(this,"lastIndexOf",e)},map(e,t){return un(this,"map",e,t,void 0,arguments)},pop(){return ws(this,"pop")},push(...e){return ws(this,"push",e)},reduce(e,...t){return Gl(this,"reduce",e,t)},reduceRight(e,...t){return Gl(this,"reduceRight",e,t)},shift(){return ws(this,"shift")},some(e,t){return un(this,"some",e,t,void 0,arguments)},splice(...e){return ws(this,"splice",e)},toReversed(){return ts(this).toReversed()},toSorted(e){return ts(this).toSorted(e)},toSpliced(...e){return ts(this).toSpliced(...e)},unshift(...e){return ws(this,"unshift",e)},values(){return Xa(this,"values",e=>Jt(this,e))}};function Xa(e,t,n){const s=ma(e),o=s[t],a=o.call(s);if(s!==e&&!Mt(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const i=Object.create(Object.getPrototypeOf(a));return i.next=()=>Zl(a.next(),n),o!==mu[t]&&Object.defineProperties(i,{return:{get(){const l=a.return;return typeof l=="function"?l.bind(a):l}},throw:{get(){const l=a.throw;return typeof l=="function"?l.bind(a):l}}}),i}a._next=a.next,a.next=()=>Zl(a._next(),n)}return a}function Zl(e,t){return e.done||(e.value=t(e.value)),e}const mu=Array.prototype;function un(e,t,n,s,o,a){const i=ma(e),l=i!==e&&!Mt(e),r=i[t];if(r!==mu[t]){const d=r.apply(e,a);return l?It(d):d}let c=n;i!==e&&(l?c=function(d,_){return n.call(this,Jt(e,d),_,e)}:n.length>2&&(c=function(d,_){return n.call(this,d,_,e)}));const u=r.call(i,c,s);return l&&o?o(u):u}function Gl(e,t,n,s){const o=ma(e),a=o!==e&&!Mt(e);let i=n,l=!1;o!==e&&(a?(l=s.length===0,i=function(c,u,d){return l&&(l=!1,c=Jt(e,c)),n.call(this,c,Jt(e,u),d,e)}):n.length>3&&(i=function(c,u,d){return n.call(this,c,u,d,e)}));const r=o[t](i,...s);return l?Jt(e,r):r}function Ya(e,t,n){const s=Pe(e);vt(s,"iterate",qs);const o=s[t](...n);return(o===-1||o===!1)&&al(n[0])?(n[0]=Pe(n[0]),s[t](...n)):o}function ws(e,t,n=[]){tn(),el();const s=Pe(e)[t].apply(e,n);return tl(),nn(),s}const Up=Gi("__proto__,__v_isRef,__isVue"),_u=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ut));function Wp(e){Ut(e)||(e=String(e));const t=Pe(this);return vt(t,"has",e),t.hasOwnProperty(e)}class gu{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,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 s===(o?a?Qp:wu:a?ku:bu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=be(t);if(!o){let r;if(i&&(r=Np[n]))return r;if(n==="hasOwnProperty")return Wp}const l=Reflect.get(t,n,et(t)?t:s);if((Ut(n)?_u.has(n):Up(n))||(o||vt(t,"get",n),a))return l;if(et(l)){const r=i&&Yi(n)?l:l.value;return o&&Oe(r)?Ci(r):r}return Oe(l)?o?Ci(l):Ft(l):l}}class yu extends gu{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const i=be(t)&&Yi(n);if(!this._isShallow){const c=sn(a);if(!Mt(s)&&!sn(s)&&(a=Pe(a),s=Pe(s)),!i&&et(a)&&!et(s))return c||(a.value=s),!0}const l=i?Number(n)<t.length:Le(t,n),r=Reflect.set(t,n,s,et(t)?t:o);return t===Pe(o)&&r&&(l?ct(s,a)&&pn(t,"set",n,s):pn(t,"add",n,s)),r}deleteProperty(t,n){const s=Le(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&pn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Ut(n)||!_u.has(n))&&vt(t,"has",n),s}ownKeys(t){return vt(t,"iterate",be(t)?"length":Gn),Reflect.ownKeys(t)}}class Vp extends gu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const qp=new yu,Hp=new Vp,Kp=new yu(!0);const xi=e=>e,xo=e=>Reflect.getPrototypeOf(e);function Jp(e,t,n){return function(...s){const o=this.__v_raw,a=Pe(o),i=En(a),l=e==="entries"||e===Symbol.iterator&&i,r=e==="keys"&&i,c=o[e](...s),u=n?xi:t?In:It;return!t&&vt(a,"iterate",r?wi:Gn),Ye(Object.create(c),{next(){const{value:d,done:_}=c.next();return _?{value:d,done:_}:{value:l?[u(d[0]),u(d[1])]:u(d),done:_}}})}}function Co(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Zp(e,t){const n={get(o){const a=this.__v_raw,i=Pe(a),l=Pe(o);e||(ct(o,l)&&vt(i,"get",o),vt(i,"get",l));const{has:r}=xo(i),c=t?xi:e?In:It;if(r.call(i,o))return c(a.get(o));if(r.call(i,l))return c(a.get(l));a!==i&&a.get(o)},get size(){const o=this.__v_raw;return!e&&vt(Pe(o),"iterate",Gn),o.size},has(o){const a=this.__v_raw,i=Pe(a),l=Pe(o);return e||(ct(o,l)&&vt(i,"has",o),vt(i,"has",l)),o===l?a.has(o):a.has(o)||a.has(l)},forEach(o,a){const i=this,l=i.__v_raw,r=Pe(l),c=t?xi:e?In:It;return!e&&vt(r,"iterate",Gn),l.forEach((u,d)=>o.call(a,c(u),c(d),i))}};return Ye(n,e?{add:Co("add"),set:Co("set"),delete:Co("delete"),clear:Co("clear")}:{add(o){const a=Pe(this),i=xo(a),l=Pe(o),r=!t&&!Mt(o)&&!sn(o)?l:o;return i.has.call(a,r)||ct(o,r)&&i.has.call(a,o)||ct(l,r)&&i.has.call(a,l)||(a.add(r),pn(a,"add",r,r)),this},set(o,a){!t&&!Mt(a)&&!sn(a)&&(a=Pe(a));const i=Pe(this),{has:l,get:r}=xo(i);let c=l.call(i,o);c||(o=Pe(o),c=l.call(i,o));const u=r.call(i,o);return i.set(o,a),c?ct(a,u)&&pn(i,"set",o,a):pn(i,"add",o,a),this},delete(o){const a=Pe(this),{has:i,get:l}=xo(a);let r=i.call(a,o);r||(o=Pe(o),r=i.call(a,o)),l&&l.call(a,o);const c=a.delete(o);return r&&pn(a,"delete",o,void 0),c},clear(){const o=Pe(this),a=o.size!==0,i=o.clear();return a&&pn(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Jp(o,e,t)}),n}function sl(e,t){const n=Zp(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(Le(n,o)&&o in s?n:s,o,a)}const Gp={get:sl(!1,!1)},Xp={get:sl(!1,!0)},Yp={get:sl(!0,!1)};const bu=new WeakMap,ku=new WeakMap,wu=new WeakMap,Qp=new WeakMap;function ev(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ft(e){return sn(e)?e:ol(e,!1,qp,Gp,bu)}function tv(e){return ol(e,!1,Kp,Xp,ku)}function Ci(e){return ol(e,!0,Hp,Yp,wu)}function ol(e,t,n,s,o){if(!Oe(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const i=ev(Cp(e));if(i===0)return e;const l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function Tn(e){return sn(e)?Tn(e.__v_raw):!!(e&&e.__v_isReactive)}function sn(e){return!!(e&&e.__v_isReadonly)}function Mt(e){return!!(e&&e.__v_isShallow)}function al(e){return e?!!e.__v_raw:!1}function Pe(e){const t=e&&e.__v_raw;return t?Pe(t):e}function nv(e){return!Le(e,"__v_skip")&&Object.isExtensible(e)&&ou(e,"__v_skip",!0),e}const It=e=>Oe(e)?Ft(e):e,In=e=>Oe(e)?Ci(e):e;function et(e){return e?e.__v_isRef===!0:!1}function P(e){return Cu(e,!1)}function xu(e){return Cu(e,!0)}function Cu(e,t){return et(e)?e:new sv(e,t)}class sv{constructor(t,n){this.dep=new ha,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Pe(t),this._value=n?t:It(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Mt(t)||sn(t);t=s?t:Pe(t),ct(t,n)&&(this._rawValue=t,this._value=s?t:It(t),this.dep.trigger())}}function p(e){return et(e)?e.value:e}const ov={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return et(o)&&!et(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function $u(e){return Tn(e)?e:new Proxy(e,ov)}class av{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ha,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function iv(e){return new av(e)}class lv{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ha(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&We!==this)return uu(this,!0),!0}get value(){const t=this.dep.track();return pu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function rv(e,t,n=!1){let s,o;return De(e)?s=e:(s=e.get,o=e.set),new lv(s,o,n)}const $o={},Vo=new WeakMap;let Hn;function cv(e,t=!1,n=Hn){if(n){let s=Vo.get(n);s||Vo.set(n,s=[]),s.push(e)}}function uv(e,t,n=Ie){const{immediate:s,deep:o,once:a,scheduler:i,augmentJob:l,call:r}=n,c=C=>o?C:Mt(C)||o===!1||o===0?vn(C,1):vn(C);let u,d,_,h,g=!1,m=!1;if(et(e)?(d=()=>e.value,g=Mt(e)):Tn(e)?(d=()=>c(e),g=!0):be(e)?(m=!0,g=e.some(C=>Tn(C)||Mt(C)),d=()=>e.map(C=>{if(et(C))return C.value;if(Tn(C))return c(C);if(De(C))return r?r(C,2):C()})):De(e)?t?d=r?()=>r(e,2):e:d=()=>{if(_){tn();try{_()}finally{nn()}}const C=Hn;Hn=u;try{return r?r(e,3,[h]):e(h)}finally{Hn=C}}:d=en,t&&o){const C=d,D=o===!0?1/0:o;d=()=>vn(C(),D)}const b=Op(),w=()=>{u.stop(),b&&b.active&&Xi(b.effects,u)};if(a&&t){const C=t;t=(...D)=>{try{return C(...D)}finally{w()}}}let x=m?new Array(e.length).fill($o):$o;const k=C=>{if(!(!(u.flags&1)||!u.dirty&&!C))if(t){const D=u.run();if(C||o||g||(m?D.some((I,L)=>ct(I,x[L])):ct(D,x))){const I=Hn;tn();try{_&&_(),Hn=u;const L=[D,x===$o?void 0:m&&x[0]===$o?[]:x,h];x=D,r?r(t,3,L):t(...L)}finally{Hn=I,nn()}}}else u.run()};return l&&l(k),u=new ru(d),u.scheduler=i?()=>i(k,!1):k,h=C=>cv(C,!1,u),_=u.onStop=()=>{const C=Vo.get(u);if(C){if(r)r(C,4);else for(const D of C)D();Vo.delete(u)}},t?s?k(!0):x=u.run():i?i(k.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function vn(e,t=1/0,n){if(t<=0||!Oe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,et(e))vn(e.value,t,n);else if(be(e))for(let s=0;s<e.length;s++)vn(e[s],t,n);else if(wn(e)||En(e))e.forEach(s=>{vn(s,t,n)});else if(su(e)){for(const s in e)vn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&vn(e[s],t,n)}return e}function co(e,t,n,s){try{return s?e(...s):e()}catch(o){_a(o,t,n)}}function Pt(e,t,n,s){if(De(e)){const o=co(e,t,n,s);return o&&tu(o)&&o.catch(a=>{_a(a,t,n,void 0,!0)}),o}if(be(e)){const o=[];for(let a=0;a<e.length;a++)o.push(Pt(e[a],t,n,s));return o}}function _a(e,t,n,s=!0,o=!1){const a=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||Ie;if(t){let r=t.parent;const c=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){const d=r.ec;if(d&&!r.isUnmounted&&(!o||r.scope.active)){for(let _=0;_<d.length;_++)if(d[_](e,c,u)===!1)return}r=r.parent}if(i){tn(),co(i,null,10,[e,c,u]),nn();return}}dv(e,n,a,s,l)}function dv(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const yt=[];let jt=-1;const Zt=[];let Rn=null,os=0;const Au=Promise.resolve();let qo=null;function Ge(e){const t=qo||Au;return e?t.then(this?e.bind(this):e):t}function fv(e){let t=jt+1,n=yt.length;for(;t<n;){const s=t+n>>>1,o=yt[s],a=Hs(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function ga(e){if(!(e.flags&1)){const t=Hs(e),n=yt[yt.length-1];!n||!(e.flags&2)&&t>=Hs(n)?yt.push(e):yt.splice(fv(t),0,e),e.flags|=1,Du()}}function Du(){qo||(qo=Au.then(Eu))}function pv(e){if(!be(e))Rn&&e.id===-1?Rn.splice(os+1,0,e):e.flags&1||(Zt.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Zt.push(e[t]);Du()}function Ru(e,t,n,s=jt+1){for(;s<yt.length;s++){const o=yt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;yt.splice(s,1),s=e?s-1:jt,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Su(e,t,n=0){if(Zt.length){let s=Zt,o=0;if(t){s=[];for(let i=0;i<Zt.length;i++){const l=Zt[i];(l.i!==void 0?!l.i||l.i.uid<n:t.has(l))?Zt[o++]=l:s.push(l)}}const a=[...new Set(s)].sort((i,l)=>Hs(i)-Hs(l));if(Zt.length=o,Rn){for(let i=0;i<a.length;i++)Rn.push(a[i]);return}for(Rn=a,os=0;os<Rn.length;os++){const i=Rn[os];i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2}Rn=null,os=0}}let Qa=!1;function vv(e,t){if(Qa){e();return}const n=t===void 0?void 0:new Set(Zt);e(),Qa=!0;try{Ru(void 0,t),Su(void 0,n,t)}finally{Qa=!1}}const Hs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Eu(e){try{for(jt=0;jt<yt.length;jt++){const t=yt[jt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),co(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;jt<yt.length;jt++){const t=yt[jt];t&&(t.flags&=-2)}jt=-1,yt.length=0,Su(),qo=null,(yt.length||Zt.length)&&Eu()}}let ut=null,Tu=null;function Ho(e){const t=ut;return ut=e,Tu=e&&e.type.__scopeId||null,t}function ye(e,t=ut,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Xo(-1);const a=Ho(t),i=bn.length;let l;try{l=e(...o)}finally{for(let r=bn.length;r>i;r--)pl();Ho(a),s._d&&Xo(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function ze(e,t){if(ut===null)return e;const n=$a(ut),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,i,l,r=Ie]=t[o];a&&(De(a)&&(a={mounted:a,updated:a}),a.deep&&vn(i),s.push({dir:a,instance:n,value:i,oldValue:void 0,arg:l,modifiers:r}))}return e}function Un(e,t,n,s){let o=e;if(s==="beforeMount")e._mount=e;else if(s==="beforeUpdate"){const l=t&&t._mount;l&&(l._latest=e,e._mount=l)}else if(s==="mounted"){const l=e._latest;e._mount=e._latest=void 0,l&&(o=l,l._mount=void 0)}const a=o.dirs,i=t&&t.dirs;for(let l=0;l<a.length;l++){let r=a[l];i?r.oldValue=i[l].value:s==="mounted"&&r.oldValue!==void 0&&(r=Ye({},r,{oldValue:void 0}));let c=r.dir[s];c&&(tn(),Pt(c,n,8,[e.el,r,o,t]),nn())}}function hv(e,t){if(ht){let n=ht.provides;const s=ht.parent&&ht.parent.provides;s===n&&(n=ht.provides=Object.create(s)),n[e]=t}}function Bs(e,t,n=!1){const s=On();if(s||rs){let o=rs?rs._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&De(t)?t.call(s&&s.proxy):t}}const mv=Symbol.for("v-scx"),_v=()=>Bs(mv);function gv(e,t){return ya(e,null,t)}function yv(e,t){return ya(e,null,{flush:"sync"})}function $e(e,t,n){return ya(e,t,n)}function ya(e,t,n=Ie){const{immediate:s,deep:o,flush:a,once:i}=n,l=Ye({},n),r=t&&s||!t&&a!=="post";let c;if(Ys){if(a==="sync"){const h=_v();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!r){const h=()=>{};return h.stop=en,h.resume=en,h.pause=en,h}}const u=ht;l.call=(h,g,m)=>Pt(h,u,g,m);let d=!1;a==="post"?l.scheduler=h=>{h.i=u,pt(h,u&&u.suspense)}:a!=="sync"&&(d=!0,l.scheduler=(h,g)=>{g?h():ga(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const _=uv(e,t,l);return Ys&&(c?c.push(_):r&&_()),_}function bv(e,t,n){const s=this.proxy,o=qe(e)?e.includes(".")?Mu(s,e):()=>s[e]:e.bind(s,s);let a;De(t)?a=t:(a=t.handler,n=t);const i=fo(this),l=ya(o,a.bind(s),n);return i(),l}function Mu(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const An=new WeakMap,Fu=Symbol("_vte"),ba=e=>e.__isTeleport,Kn=e=>e&&(e.disabled||e.disabled===""),kv=e=>e&&(e.defer||e.defer===""),Xl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Yl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,$i=(e,t)=>{const n=e&&e.to;return qe(n)?t?t(n):null:n},wv={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,i,l,r,c){const{mc:u,pc:d,pbc:_,o:{insert:h,querySelector:g,createText:m,createComment:b,parentNode:w}}=c,x=Kn(t.props);let{dynamicChildren:k}=t;const C=(L,K,X)=>{L.shapeFlag&16&&u(L.children,K,X,o,a,i,l,r)},D=(L=t)=>{const K=Kn(L.props),X=L.target=$i(L.props,g),oe=Ai(X,L,m,h);X&&(i!=="svg"&&Xl(X)?i="svg":i!=="mathml"&&Yl(X)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(X),K||(C(L,X,oe),Rs(L,!1)))},I=L=>{const K=()=>{if(An.get(L)===K){if(An.delete(L),Kn(L.props)){const X=w(L.el)||n;C(L,X,L.anchor),Rs(L,!0)}D(L)}};An.set(L,K),pt(K,a)};if(e==null){const L=t.el=m(""),K=t.anchor=m("");if(h(L,n,s),h(K,n,s),kv(t.props)||a&&a.pendingBranch){I(t);return}x&&(C(t,n,K),Rs(t,!0)),D()}else{t.el=e.el;const L=t.anchor=e.anchor,K=An.get(e);if(K){K.flags|=8,An.delete(e),I(t);return}t.targetStart=e.targetStart;const X=t.target=e.target,oe=t.targetAnchor=e.targetAnchor,Y=Kn(e.props),N=Y?n:X,U=Y?L:oe;if(i==="svg"||Xl(X)?i="svg":(i==="mathml"||Yl(X))&&(i="mathml"),k?(_(e.dynamicChildren,k,N,o,a,i,l),fl(e,t,!0)):r||d(e,t,N,U,o,a,i,l,!1),x)Y?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ao(t,n,L,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ne=$i(t.props,g);ne&&(t.target=ne,Ao(t,ne,null,c,0))}else Y&&Ao(t,X,oe,c,1);Rs(t,x)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:i,children:l,anchor:r,targetStart:c,targetAnchor:u,target:d,props:_}=e,h=Kn(_),g=a||!h,m=An.get(e);if(m&&(m.flags|=8,An.delete(e)),d&&(o(c),o(u)),a&&o(r),!m&&(h||d)&&i&16)for(let b=0;b<l.length;b++){const w=l[b];s(w,t,n,g,!!w.dynamicChildren)}},move:Ao,hydrate:xv};function Ao(e,t,n,{o:{insert:s},m:o},a=2){a===0&&(e.targetStart&&s(e.targetStart,t,n),s(e.targetAnchor,t,n),n=e.targetAnchor);const{el:i,anchor:l,shapeFlag:r,children:c,props:u}=e,d=a===2;if(d&&s(i,t,n),!An.has(e)&&(!d||Kn(u))&&r&16)for(let _=0;_<c.length;_++)o(c[_],t,n,2);d&&s(l,t,n)}function xv(e,t,n,s,o,a,{o:{nextSibling:i,parentNode:l,querySelector:r,insert:c,createText:u}},d){function _(b,w){let x=w;for(;x;){if(x&&x.nodeType===8){if(x.data==="teleport start anchor")t.targetStart=x;else if(x.data==="teleport anchor"){t.targetAnchor=x,b._lpa=t.targetAnchor&&i(t.targetAnchor);break}}x=i(x)}}function h(b,w){w.anchor=d(i(b),w,l(b),n,s,o,a)}const g=t.target=$i(t.props,r),m=Kn(t.props);if(g){const b=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(h(e,t),_(g,b),t.targetAnchor||Ai(g,t,u,c,l(e)===g?e:null)):(t.anchor=i(e),_(g,b),t.targetAnchor||Ai(g,t,u,c),d(b&&i(b),t,g,n,s,o,a))),Rs(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const il=wv;function Rs(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Ai(e,t,n,s,o=null){const a=t.targetStart=n(""),i=t.targetAnchor=n("");return a[Fu]=i,e&&(s(a,e,o),s(i,e,o)),i}const St=Symbol("_leaveCb"),xs=Symbol("_enterCb");function Iu(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return it(()=>{e.isMounted=!0}),tt(()=>{e.isUnmounting=!0}),e}const Rt=[Function,Array],Pu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Rt,onEnter:Rt,onAfterEnter:Rt,onEnterCancelled:Rt,onBeforeLeave:Rt,onLeave:Rt,onAfterLeave:Rt,onLeaveCancelled:Rt,onBeforeAppear:Rt,onAppear:Rt,onAfterAppear:Rt,onAppearCancelled:Rt},Cv={name:"BaseTransition",props:Pu,setup(e,{slots:t}){const n=On(),s=Iu();return()=>{const o=t.default&&ll(t.default(),!0),a=o&&o.length?Bu(o):n.subTree?R():void 0;if(!a)return;const i=Pe(e),{mode:l}=i;if(s.isLeaving)return ei(a);const r=Ko(a);if(!r)return ei(a);const c=Ks(r,i,s,n);r.type!==dt&&yn(r,c);let u=n.subTree&&Ko(n.subTree);if(u&&u.type!==dt&&!Jn(u,r)&&Js(n.subTree)){let d=Ks(u,i,s,n);if(yn(u,d),l==="out-in"&&r.type!==dt)return s.isLeaving=!0,d.afterLeave=()=>{if(s.isLeaving=!1,!(n.job.flags&8))if(n.effect.flags&2){const _=()=>{n.job.flags&8||n.update()};_.i=n,ga(_)}else n.update();delete d.afterLeave,u=void 0},ei(a);l==="in-out"&&r.type!==dt?d.delayLeave=(_,h,g)=>{const m=Lu(s,u);m[String(u.key)]=u,_[St]=()=>{h(),_[St]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return a}}};function Bu(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==dt){t=n;break}}return t}const $v=Cv;function Lu(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Ks(e,t,n,s){const{appear:o,mode:a,persisted:i=!1,onBeforeEnter:l,onEnter:r,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:_,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:b,onAfterAppear:w,onAppearCancelled:x}=t,k=String(e.key),C=Lu(n,e),D=(K,X)=>{K&&Pt(K,s,9,X)},I=(K,X)=>{const oe=X[1];D(K,X),be(K)?K.every(Y=>Y.length<=1)&&oe():K.length<=1&&oe()},L={mode:a,persisted:i,beforeEnter(K){let X=l;if(!n.isMounted)if(o)X=m||l;else return;K[St]&&K[St](!0);const oe=C[k];if(oe&&Jn(e,oe)){let Y=oe.el[St];if(!Y){const N=Js(oe);Y=N&&N.el[St]}Y&&Y()}D(X,[K])},enter(K){if(C[k]===e)return;let X=r,oe=c,Y=u;if(!n.isMounted)if(o)X=b||r,oe=w||c,Y=x||u;else return;let N=!1;K[xs]=ne=>{N||(N=!0,ne?D(Y,[K]):D(oe,[K]),L.delayedLeave&&L.delayedLeave(),K[xs]=void 0)};const U=K[xs].bind(null,!1);X?I(X,[K,U]):U()},leave(K,X){const oe=String(e.key);if(K[xs]&&K[xs](!0),n.isUnmounting)return X();D(d,[K]);let Y=!1;K[St]=U=>{Y||(Y=!0,X(),U?D(g,[K]):D(h,[K]),K[St]=void 0,C[oe]===e&&delete C[oe])};const N=K[St].bind(null,!1);C[oe]=e,_?I(_,[K,N]):N()},clone(K){const X=Ks(K,t,n,s);return X.afterLeave=()=>{L.afterLeave&&L.afterLeave()},X.delayLeave=(oe,Y,N)=>{L.delayLeave?L.delayLeave(oe,Y,N):N()},X.delayedLeave=()=>{L.delayedLeave&&L.delayedLeave()},X}};return L}function ei(e){if(ka(e))return e=Pn(e),e.children=null,e}function Ko(e){if(!ka(e))return ba(e.type)&&e.children?Bu(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&De(n.default))return n.default()}}function yn(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;yn(ba(n.type)&&Ko(n)||n,t)}else if(e.shapeFlag&128){const n=e.suspense;if(n){const s=n.isHydrating?n.pendingBranch:n.activeBranch;s&&yn(s,t.clone(s))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===J&&be(e.children)){const n=Zu(e.children,!1);n&&yn(n,t)}}function ll(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let i=e[a];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:a);i.type===J?(i.patchFlag&128&&o++,s=s.concat(ll(i.children,t,l))):(t||i.type!==dt)&&s.push(l!=null?Pn(i,{key:l}):i)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function Js(e){if(e.component)return Js(e.component.subTree);if(e.type===J){const t=be(e.children)&&Zu(e.children,!1);return t?Js(t):void 0}if(e.type!==dt)return e}function we(e,t){return De(e)?Ye({name:e.name},t,{setup:e}):e}function uo(){const e=On();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Ou(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Xe(e){const t=On(),n=xu(null);if(t){const o=t.refs===Ie?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:a=>n.value=a})}return n}function Ql(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jo=new WeakMap;function Ls(e,t,n,s,o=!1){if(be(e)){e.forEach((m,b)=>Ls(m,t&&(be(t)?t[b]:t),n,s,o));return}if(ls(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ls(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?$a(s.component):s.el,i=o?null:a,{i:l,r}=e,c=t&&t.r,u=l.refs===Ie?l.refs={}:l.refs,d=l.setupState,_=Pe(d),h=d===Ie?eu:m=>Ql(u,m)?!1:Le(_,m),g=(m,b)=>!(b&&Ql(u,b));if(c!=null&&c!==r){if(er(t),qe(c))u[c]=null,h(c)&&(d[c]=null);else if(et(c)){const m=t;g(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(De(r))co(r,l,12,[i,u]);else{const m=qe(r),b=et(r);if(m||b){const w=()=>{if(e.f){const x=m?h(r)?d[r]:u[r]:g()||!e.k?r.value:u[e.k];if(o)be(x)&&Xi(x,a);else if(be(x))x.includes(a)||x.push(a);else if(m)u[r]=[a],h(r)&&(d[r]=u[r]);else{const k=[a];g(r,e.k)&&(r.value=k),e.k&&(u[e.k]=k)}}else m?(u[r]=i,h(r)&&(d[r]=i)):b&&(g(r,e.k)&&(r.value=i),e.k&&(u[e.k]=i))};if(i){const x=()=>{w(),Jo.delete(e)};x.id=-1,Jo.set(e,x),pt(x,n)}else er(e),w()}}}function er(e){const t=Jo.get(e);t&&(t.flags|=8,Jo.delete(e))}va().requestIdleCallback;va().cancelIdleCallback;const ls=e=>!!e.type.__asyncLoader,ka=e=>e.type.__isKeepAlive;function Av(e,t){zu(e,"a",t)}function Dv(e,t){zu(e,"da",t)}function zu(e,t,n=ht){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Zs(t,s,n),n){let o=n.parent;for(;o&&o.parent;)ka(o.parent.vnode)&&Rv(s,t,n,o),o=o.parent}}function Rv(e,t,n,s){const o=Zs(t,e,s,!0),a=Zs("um",()=>Xi(s[t],o),n);a.flags=16}function Zs(e,t,n=ht,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...i)=>{tn();const l=fo(n),r=Pt(t,n,e,i);return l(),nn(),r});return s?o.unshift(a):o.push(a),a}}const Cn=e=>(t,n=ht)=>{(!Ys||e==="sp")&&Zs(e,(...s)=>t(...s),n)},Sv=Cn("bm"),it=Cn("m"),Ev=Cn("bu"),ju=Cn("u"),tt=Cn("bum"),rl=Cn("um"),Tv=Cn("sp"),Mv=Cn("rtg"),Fv=Cn("rtc");function Iv(e,t=ht){Zs("ec",e,t)}const Pv="components",Nu=Symbol.for("v-ndc");function cl(e){return qe(e)?Bv(Pv,e,!1)||e:e||Nu}function Bv(e,t,n=!0,s=!1){const o=ut||ht;if(o){const a=o.type;{const l=yh(a,!1);if(l&&(l===t||l===mt(t)||l===pa(mt(t))))return a}const i=tr(o[e]||a[e],t)||tr(o.appContext[e],t);return!i&&s?a:i}}function tr(e,t){return e&&(e[t]||e[mt(t)]||e[pa(mt(t))])}function ve(e,t,n,s){let o;const a=n,i=be(e);if(i||qe(e)){const l=i&&Tn(e);let r=!1,c=!1;l&&(r=!Mt(e),c=sn(e),e=ma(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(r?c?In(It(e[u])):It(e[u]):e[u],u,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,a)}else if(Oe(e))if(e[Symbol.iterator])o=Array.from(e,(l,r)=>t(l,r,void 0,a));else{const l=Object.keys(e);o=new Array(l.length);for(let r=0,c=l.length;r<c;r++){const u=l[r];o[r]=t(e[u],u,r,a)}}else o=[];return o}function Lv(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(be(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const a=s.fn(...o);return a&&(a.key=s.key),a}:s.fn)}return e}function je(e,t,n,s,o,a){if(n==null&&(n={}),ut.ce||ut.parent&&ls(ut.parent)&&ut.parent.ce){const c=n,u=Object.keys(c).length>0;return t!=="default"&&(c.name=t),v(),le(J,null,[O("slot",c,s&&s())],u?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=bn.length;v();let r;try{const c=i&&Uu(i(n)),u=n.key||a||c&&c.key;r=le(J,{key:(u&&!Ut(u)?u:`_${t}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&e._===1?64:-2)}catch(c){for(let u=bn.length;u>l;u--)pl();throw c}finally{i&&i._c&&(i._d=!0)}return r.scopeId&&(r.slotScopeIds=[r.scopeId+"-s"]),r}function Uu(e){return e.some(t=>fs(t)?!(t.type===dt||t.type===J&&!Uu(t.children)):!0)?e:null}const Di=e=>e?dd(e)?$a(e):Di(e.parent):null,Os=Ye(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=>Di(e.parent),$root:e=>Di(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>qu(e),$forceUpdate:e=>e.f||(e.f=()=>{ga(e.update)}),$nextTick:e=>e.n||(e.n=Ge.bind(e.proxy)),$watch:e=>bv.bind(e)}),ti=(e,t)=>e!==Ie&&!e.__isScriptSetup&&Le(e,t),Ov={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:i,type:l,appContext:r}=e;if(t[0]!=="$"){const _=i[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(ti(s,t))return i[t]=1,s[t];if(o!==Ie&&Le(o,t))return i[t]=2,o[t];if(Le(a,t))return i[t]=3,a[t];if(n!==Ie&&Le(n,t))return i[t]=4,n[t];Ri&&(i[t]=0)}}const c=Os[t];let u,d;if(c)return t==="$attrs"&&vt(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Ie&&Le(n,t))return i[t]=4,n[t];if(d=r.config.globalProperties,Le(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return ti(o,t)?(o[t]=n,!0):s!==Ie&&Le(s,t)?(s[t]=n,!0):Le(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:i}},l){let r;return!!(n[l]||e!==Ie&&l[0]!=="$"&&Le(e,l)||ti(t,l)||Le(a,l)||Le(s,l)||Le(Os,l)||Le(o.config.globalProperties,l)||(r=i.__cssModules)&&r[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Le(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Wu(){return zv().slots}function zv(e){const t=On();return t.setupContext||(t.setupContext=vd(t))}function Zo(e){return be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function ds(e,t){return!e||!t?e||t:be(e)&&be(t)?e.concat(t):Ye({},Zo(e),Zo(t))}let Ri=!0;function jv(e){const t=qu(e),n=e.proxy,s=e.ctx;Ri=!1,t.beforeCreate&&nr(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:i,watch:l,provide:r,inject:c,created:u,beforeMount:d,mounted:_,beforeUpdate:h,updated:g,activated:m,deactivated:b,beforeDestroy:w,beforeUnmount:x,destroyed:k,unmounted:C,render:D,renderTracked:I,renderTriggered:L,errorCaptured:K,serverPrefetch:X,expose:oe,inheritAttrs:Y,components:N,directives:U,filters:ne}=t;if(c&&Nv(c,s,null),i)for(const pe in i){const ue=i[pe];De(ue)&&(s[pe]=ue.bind(n))}if(o){const pe=o.call(n,n);Oe(pe)&&(e.data=Ft(pe))}if(Ri=!0,a)for(const pe in a){const ue=a[pe],B=De(ue)?ue.bind(n,n):De(ue.get)?ue.get.bind(n,n):en,H=!De(ue)&&De(ue.set)?ue.set.bind(n):en,W=E({get:B,set:H});Object.defineProperty(s,pe,{enumerable:!0,configurable:!0,get:()=>W.value,set:G=>W.value=G})}if(l)for(const pe in l)Vu(l[pe],s,n,pe);if(r){const pe=De(r)?r.call(n):r;Reflect.ownKeys(pe).forEach(ue=>{hv(ue,pe[ue])})}u&&nr(u,e,"c");function ae(pe,ue){be(ue)?ue.forEach(B=>pe(B.bind(n))):ue&&pe(ue.bind(n))}if(ae(Sv,d),ae(it,_),ae(Ev,h),ae(ju,g),ae(Av,m),ae(Dv,b),ae(Iv,K),ae(Fv,I),ae(Mv,L),ae(tt,x),ae(rl,C),ae(Tv,X),be(oe))if(oe.length){const pe=e.exposed||(e.exposed={});oe.forEach(ue=>{Object.defineProperty(pe,ue,{get:()=>n[ue],set:B=>n[ue]=B,enumerable:!0})})}else e.exposed||(e.exposed={});D&&e.render===en&&(e.render=D),Y!=null&&(e.inheritAttrs=Y),N&&(e.components=N),U&&(e.directives=U),X&&Ou(e)}function Nv(e,t,n=en){be(e)&&(e=Si(e));for(const s in e){const o=e[s];let a;Oe(o)?"default"in o?a=Bs(o.from||s,o.default,!0):a=Bs(o.from||s):a=Bs(o),et(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:i=>a.value=i}):t[s]=a}}function nr(e,t,n){Pt(be(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vu(e,t,n,s){let o=s.includes(".")?Mu(n,s):()=>n[s];if(qe(e)){const a=t[e];De(a)&&$e(o,a)}else if(De(e))$e(o,e.bind(n));else if(Oe(e))if(be(e))e.forEach(a=>Vu(a,t,n,s));else{const a=De(e.handler)?e.handler.bind(n):t[e.handler];De(a)&&$e(o,a,e)}}function qu(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:i}}=e.appContext,l=a.get(t);let r;return l?r=l:!o.length&&!n&&!s?r=t:(r={},o.length&&o.forEach(c=>Go(r,c,i,!0)),Go(r,t,i)),Oe(t)&&a.set(t,r),r}function Go(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&Go(e,a,n,!0),o&&o.forEach(i=>Go(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=Uv[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const Uv={data:sr,props:or,emits:or,methods:Ss,computed:Ss,beforeCreate:_t,created:_t,beforeMount:_t,mounted:_t,beforeUpdate:_t,updated:_t,beforeDestroy:_t,beforeUnmount:_t,destroyed:_t,unmounted:_t,activated:_t,deactivated:_t,errorCaptured:_t,serverPrefetch:_t,components:Ss,directives:Ss,watch:Vv,provide:sr,inject:Wv};function sr(e,t){return t?e?function(){return Ye(De(e)?e.call(this,this):e,De(t)?t.call(this,this):t)}:t:e}function Wv(e,t){return Ss(Si(e),Si(t))}function Si(e){if(be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function _t(e,t){return e?[...new Set([].concat(e,t))]:t}function Ss(e,t){return e?Ye(Object.create(null),e,t):t}function or(e,t){return e?be(e)&&be(t)?[...new Set([...e,...t])]:Ye(Object.create(null),Zo(e),Zo(t??{})):t}function Vv(e,t){if(!e)return t;if(!t)return e;const n=Ye(Object.create(null),e);for(const s in t)n[s]=_t(e[s],t[s]);return n}function Hu(){return{app:null,config:{isNativeTag:eu,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 qv=0;function Hv(e,t){return function(s,o=null){De(s)||(s=Ye({},s)),o!=null&&!Oe(o)&&(o=null);const a=Hu(),i=new WeakSet,l=[];let r=!1;const c=a.app={_uid:qv++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:kh,get config(){return a.config},set config(u){},use(u,...d){return i.has(u)||(u&&De(u.install)?(i.add(u),u.install(c,...d)):De(u)&&(i.add(u),u(c,...d))),c},mixin(u){return a.mixins.includes(u)||a.mixins.push(u),c},component(u,d){return d?(a.components[u]=d,c):a.components[u]},directive(u,d){return d?(a.directives[u]=d,c):a.directives[u]},mount(u,d,_){if(!r){const h=c._ceVNode||O(s,o);return h.appContext=a,_===!0?_="svg":_===!1&&(_=void 0),e(h,u,_),r=!0,c._container=u,u.__vue_app__=c,$a(h.component)}},onUnmount(u){l.push(u)},unmount(){r&&(Pt(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return a.provides[u]=d,c},runWithContext(u){const d=rs;rs=c;try{return u()}finally{rs=d}}};return c}}let rs=null;function wa(e,t,n=Ie){const s=On(),o=mt(t),a=xn(t),i=Ku(e,o),l=iv((r,c)=>{let u,d=Ie,_;return yv(()=>{const h=e[o];ct(u,h)&&(u=h,c())}),{get(){return r(),n.get?n.get(u):u},set(h){const g=n.set?n.set(h):h;if(!ct(g,u)&&!(d!==Ie&&ct(h,d)))return;const m=s.vnode.props,b=!!(m&&(t in m||o in m||a in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${a}`in m));b||(u=h,c()),s.emit(`update:${t}`,g),ct(h,d)&&(ct(h,g)&&!ct(g,_)||b&&d!==Ie&&!ct(g,u))&&c(),d=h,_=g}}});return l[Symbol.iterator]=()=>{let r=0;return{next(){return r<2?{value:r++?i||Ie:l,done:!1}:{done:!0}}}},l}const Ku=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${mt(t)}Modifiers`]||e[`${xn(t)}Modifiers`];function Kv(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Ie;let o=n;const a=t.startsWith("update:"),i=a&&Ku(s,t.slice(7));i&&(i.trim&&(o=n.map(u=>qe(u)?u.trim():u)),i.number&&(o=o.map(ro)));let l,r=s[l=Ja(t)]||s[l=Ja(mt(t))];!r&&a&&(r=s[l=Ja(xn(t))]),r&&Pt(r,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Pt(c,e,6,o)}}const Jv=new WeakMap;function Ju(e,t,n=!1){const s=n?Jv:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let i={},l=!1;if(!De(e)){const r=c=>{const u=Ju(c,t,!0);u&&(l=!0,Ye(i,u))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!l?(Oe(e)&&s.set(e,null),null):(be(a)?a.forEach(r=>i[r]=null):Ye(i,a),Oe(e)&&s.set(e,i),i)}function xa(e,t){return!e||!ua(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Le(e,t[0].toLowerCase()+t.slice(1))||Le(e,xn(t))||Le(e,t))}function ar(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:i,attrs:l,emit:r,render:c,renderCache:u,props:d,data:_,setupState:h,ctx:g,inheritAttrs:m}=e,b=Ho(e);let w,x;try{if(n.shapeFlag&4){const C=o||s,D=C;w=Gt(c.call(D,C,u,d,h,_,g)),x=l}else{const C=t;w=Gt(C.length>1?C(d,{attrs:l,slots:i,emit:r}):C(d,null)),x=t.props?l:Zv(l)}}catch(C){bn.length=0,_a(C,e,1),w=O(dt)}let k=w;if(x&&m!==!1){const C=Object.keys(x),{shapeFlag:D}=k;C.length&&D&7&&(a&&C.some(da)&&(x=Gv(x,a)),k=Pn(k,x,!1,!0))}if(n.dirs&&(k=Pn(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition){const C=ba(k.type)&&Ko(k)||k;yn(C,n.transition)}return w=k,Ho(b),w}function Zu(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(fs(o)){if(o.type!==dt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const Zv=e=>{let t;for(const n in e)(n==="class"||n==="style"||ua(n))&&((t||(t={}))[n]=e[n]);return t},Gv=(e,t)=>{const n={};for(const s in e)(!da(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Xv(e,t,n){const{props:s,children:o,component:a}=e,{props:i,children:l,patchFlag:r}=t,c=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&r>=0){if(r&1024)return!0;if(r&16)return s?ir(s,i,c):!!i;if(r&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const _=u[d];if(Gu(i,s,_)&&!xa(c,_))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===i?!1:s?i?ir(s,i,c):!0:!!i;return!1}function ir(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!Le(e,a)||Gu(t,e,a)&&!xa(n,a))return!0}return!1}function Gu(e,t,n){const s=e[n],o=t[n];return n==="style"&&Oe(s)&&Oe(o)?!Wt(s,o):s!==o}function Yv({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Xu={},Yu=()=>Object.create(Xu),Qu=e=>Object.getPrototypeOf(e)===Xu;function Qv(e,t,n,s=!1){const o={},a=Yu();e.propsDefaults=Object.create(null),ed(e,t,o,a);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:tv(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function eh(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:i}}=e,l=Pe(o),[r]=e.propsOptions;let c=!1;if((s||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let _=u[d];if(xa(e.emitsOptions,_))continue;const h=t[_];if(r)if(Le(a,_))h!==a[_]&&(a[_]=h,c=!0);else{const g=mt(_);o[g]=Ei(r,l,g,h,e,!1)}else h!==a[_]&&(a[_]=h,c=!0)}}}else{ed(e,t,o,a)&&(c=!0);let u;for(const d in l)(!t||!Le(t,d)&&((u=xn(d))===d||!Le(t,u)))&&(r?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Ei(r,l,d,void 0,e,!0)):delete o[d]);if(a!==l)for(const d in a)(!t||!Le(t,d))&&(delete a[d],c=!0)}c&&pn(e.attrs,"set","")}function ed(e,t,n,s){const[o,a]=e.propsOptions;let i=!1,l;if(t)for(let r in t){if(Fs(r))continue;const c=t[r];let u;o&&Le(o,u=mt(r))?!a||!a.includes(u)?n[u]=c:(l||(l={}))[u]=c:xa(e.emitsOptions,r)||(!(r in s)||c!==s[r])&&(s[r]=c,i=!0)}if(a){const r=Pe(n),c=l||Ie;for(let u=0;u<a.length;u++){const d=a[u];n[d]=Ei(o,r,d,c[d],e,!Le(c,d))}}return i}function Ei(e,t,n,s,o,a){const i=e[n];if(i!=null){const l=Le(i,"default");if(l&&s===void 0){const r=i.default;if(i.type!==Function&&!i.skipFactory&&De(r)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=fo(o);s=c[n]=r.call(null,t),u()}}else s=r;o.ce&&o.ce._setProp(n,s)}i[0]&&(a&&!l?s=!1:i[1]&&(s===""||s===xn(n))&&(s=!0))}return s}const th=new WeakMap;function td(e,t,n=!1){const s=n?th:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,i={},l=[];let r=!1;if(!De(e)){const u=d=>{r=!0;const[_,h]=td(d,t,!0);Ye(i,_),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!a&&!r)return Oe(e)&&s.set(e,Zn),Zn;if(be(a))for(let u=0;u<a.length;u++){const d=mt(a[u]);lr(d)&&(i[d]=Ie)}else if(a)for(const u in a){const d=mt(u);if(lr(d)){const _=a[u],h=i[d]=be(_)||De(_)?{type:_}:Ye({},_),g=h.type;let m=!1,b=!0;if(be(g))for(let w=0;w<g.length;++w){const x=g[w],k=De(x)&&x.name;if(k==="Boolean"){m=!0;break}else k==="String"&&(b=!1)}else m=De(g)&&g.name==="Boolean";h[0]=m,h[1]=b,(m||Le(h,"default"))&&l.push(d)}}const c=[i,l];return Oe(e)&&s.set(e,c),c}function lr(e){return e[0]!=="$"&&!Fs(e)}const ul=e=>e==="_"||e==="_ctx"||e==="$stable",dl=e=>be(e)?e.map(Gt):[Gt(e)],nh=(e,t,n)=>{if(t._n)return t;const s=ye((...o)=>dl(t(...o)),n);return s._c=!1,s},nd=(e,t,n)=>{const s=e._ctx;for(const o in e){if(ul(o))continue;const a=e[o];if(De(a))t[o]=nh(o,a,s);else if(a!=null){const i=dl(a);t[o]=()=>i}}},sd=(e,t)=>{const n=dl(t);e.slots.default=()=>n},od=(e,t,n)=>{for(const s in t)(n||!ul(s))&&(e[s]=t[s])},sh=(e,t,n)=>{const s=e.slots=Yu();if(e.vnode.shapeFlag&32){const o=t._;o?(od(s,t,n),n&&ou(s,"_",o,!0)):nd(t,s)}else t&&sd(e,t)},oh=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,i=Ie;if(s.shapeFlag&32){const l=t._;l?n&&l===1?a=!1:od(o,t,n):(a=!t.$stable,nd(t,o)),i=t}else t&&(sd(e,t),i={default:1});if(a)for(const l in o)!ul(l)&&i[l]==null&&delete o[l]},pt=uh;function ah(e){return ih(e)}function ih(e,t){const n=va();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:i,createText:l,createComment:r,setText:c,setElementText:u,parentNode:d,nextSibling:_,setScopeId:h=en,insertStaticContent:g}=e,m=(A,F,Z,se=null,Q=null,ee=null,ce=void 0,re=null,M=!!F.dynamicChildren)=>{if(A===F)return;A&&!Jn(A,F)&&(se=fe(A),G(A,Q,ee,!0),A=null),F.patchFlag===-2&&(M=!1,F.dynamicChildren=null),F.dynamicChildren&&A&&A.dynamicChildren&&A.dynamicChildren.hasOnce&&(F.dynamicChildren===Zn&&(F.dynamicChildren=[]),F.dynamicChildren.hasOnce=!0);const{type:j,ref:he,shapeFlag:S}=F;switch(j){case Ca:b(A,F,Z,se);break;case dt:w(A,F,Z,se);break;case si:A==null&&x(F,Z,se,ce);break;case J:N(A,F,Z,se,Q,ee,ce,re,M);break;default:S&1?D(A,F,Z,se,Q,ee,ce,re,M):S&6?U(A,F,Z,se,Q,ee,ce,re,M):(S&64||S&128)&&j.process(A,F,Z,se,Q,ee,ce,re,M,wt)}he!=null&&Q?Ls(he,A&&A.ref,ee,F||A,!F):he==null&&A&&A.ref!=null&&Ls(A.ref,null,ee,A,!0)},b=(A,F,Z,se)=>{if(A==null)s(F.el=l(F.children),Z,se);else{const Q=F.el=A.el;F.children!==A.children&&c(Q,F.children)}},w=(A,F,Z,se)=>{A==null?s(F.el=r(F.children||""),Z,se):F.el=A.el},x=(A,F,Z,se)=>{[A.el,A.anchor]=g(A.children,F,Z,se,A.el,A.anchor)},k=({el:A,anchor:F},Z,se)=>{let Q;for(;A&&A!==F;)Q=_(A),s(A,Z,se),A=Q;s(F,Z,se)},C=({el:A,anchor:F})=>{let Z;for(;A&&A!==F;)Z=_(A),o(A),A=Z;o(F)},D=(A,F,Z,se,Q,ee,ce,re,M)=>{if(F.type==="svg"?ce="svg":F.type==="math"&&(ce="mathml"),A==null)I(F,Z,se,Q,ee,ce,re,M);else{const j=A.el&&A.el._isVueCE?A.el:null;try{j&&j._beginPatch(),X(A,F,Q,ee,ce,re,M)}finally{j&&j._endPatch()}}},I=(A,F,Z,se,Q,ee,ce,re)=>{let M,j;const{props:he,shapeFlag:S,transition:V,dirs:te}=A;if(M=A.el=i(A.type,ee,he&&he.is,he),S&8?u(M,A.children):S&16&&K(A.children,M,null,se,Q,ni(A,ee),ce,re),te&&Un(A,null,se,"created"),L(M,A,A.scopeId,ce,se),he){for(const Me in he)Me!=="value"&&!Fs(Me)&&a(M,Me,null,he[Me],ee,se);"value"in he&&a(M,"value",null,he.value,ee),(j=he.onVnodeBeforeMount)&&Ht(j,se,A)}te&&Un(A,null,se,"beforeMount");const me=lh(Q,V);me?V.beforeEnter(M):V&&!V.persisted&&(M[ch]=!0),s(M,F,Z),((j=he&&he.onVnodeMounted)||me||te)&&pt(()=>{j&&Ht(j,se,A),me&&V.enter(M),te&&Un(A,null,se,"mounted")},Q)},L=(A,F,Z,se,Q)=>{if(Z&&h(A,Z),se)for(let ee=0;ee<se.length;ee++)h(A,se[ee]);if(Q){let ee=Q.subTree;if(F===ee||id(ee.type)&&(ee.ssContent===F||ee.ssFallback===F)){const ce=Q.vnode;L(A,ce,ce.scopeId,ce.slotScopeIds,Q.parent)}}},K=(A,F,Z,se,Q,ee,ce,re,M=0)=>{for(let j=M;j<A.length;j++){const he=A[j]=re?fn(A[j]):Gt(A[j]);m(null,he,F,Z,se,Q,ee,ce,re)}},X=(A,F,Z,se,Q,ee,ce)=>{const re=F.el=A.el;let{patchFlag:M,dynamicChildren:j,dirs:he}=F;M|=A.patchFlag&16;const S=A.props||Ie,V=F.props||Ie;let te;if(Z&&Wn(Z,!1),(te=V.onVnodeBeforeUpdate)&&Ht(te,Z,F,A),he&&Un(F,A,Z,"beforeUpdate"),Z&&Wn(Z,!0),j&&(!A.dynamicChildren||A.dynamicChildren.length!==j.length)&&(M=0,ce=!1,j=null),(S.innerHTML&&V.innerHTML==null||S.textContent&&V.textContent==null)&&u(re,""),j?oe(A.dynamicChildren,j,re,Z,se,ni(F,Q),ee):ce||ue(A,F,re,null,Z,se,ni(F,Q),ee,!1),M>0){if(M&16)Y(re,S,V,Z,Q);else if(M&2&&S.class!==V.class&&a(re,"class",null,V.class,Q),M&4&&a(re,"style",S.style,V.style,Q),M&8){const me=F.dynamicProps;for(let Me=0;Me<me.length;Me++){const Ce=me[Me],Ke=S[Ce],Qe=V[Ce];(Qe!==Ke||Ce==="value")&&a(re,Ce,Ke,Qe,Q,Z)}}M&1&&A.children!==F.children&&u(re,F.children)}else!ce&&j==null&&Y(re,S,V,Z,Q);((te=V.onVnodeUpdated)||he)&&pt(()=>{te&&Ht(te,Z,F,A),he&&Un(F,A,Z,"updated")},se)},oe=(A,F,Z,se,Q,ee,ce)=>{for(let re=0;re<F.length;re++){const M=A[re],j=F[re],he=M.el||zs(M),S=he&&(M.type===J||!Jn(M,j)||M.shapeFlag&198)?d(he):Z;m(M,j,S,null,se,Q,ee,ce,!0)}},Y=(A,F,Z,se,Q)=>{if(F!==Z){if(F!==Ie)for(const ee in F)!Fs(ee)&&!(ee in Z)&&a(A,ee,F[ee],null,Q,se);for(const ee in Z){if(Fs(ee))continue;const ce=Z[ee],re=F[ee];ce!==re&&ee!=="value"&&a(A,ee,re,ce,Q,se)}"value"in Z&&a(A,"value",F.value,Z.value,Q)}},N=(A,F,Z,se,Q,ee,ce,re,M)=>{const j=F.el=A?A.el:l(""),he=F.anchor=A?A.anchor:l("");let{patchFlag:S,dynamicChildren:V,slotScopeIds:te}=F;te&&(re=re?re.concat(te):te),A==null?(s(j,Z,se),s(he,Z,se),K(F.children||[],Z,he,Q,ee,ce,re,M)):S>0&&S&64&&V&&A.dynamicChildren&&A.dynamicChildren.length===V.length?(oe(A.dynamicChildren,V,Z,Q,ee,ce,re),(F.key!=null||Q&&F===Q.subTree)&&fl(A,F,!0)):ue(A,F,Z,he,Q,ee,ce,re,M)},U=(A,F,Z,se,Q,ee,ce,re,M)=>{F.slotScopeIds=re,A==null?F.shapeFlag&512?Q.ctx.activate(F,Z,se,ce,M):ne(F,Z,se,Q,ee,ce,M):ie(A,F,M)},ne=(A,F,Z,se,Q,ee,ce)=>{const re=A.component=hh(A,se,Q);if(ka(A)&&(re.ctx.renderer=wt),mh(re,!1,ce),re.asyncDep){if(Q&&Q.registerDep(re,ae,ce,ee),!A.el){const M=re.subTree=O(dt);w(null,M,F,Z),A.placeholder=M.el}}else ae(re,A,F,Z,Q,ee,ce)},ie=(A,F,Z)=>{const se=F.component=A.component;if(Xv(A,F,Z))if(se.asyncDep&&!se.asyncResolved){F.el=A.el,F.placeholder=A.placeholder,pe(se,F,Z);return}else se.next=F,se.update();else F.el=A.el,F.placeholder=A.placeholder,se.vnode=F},ae=(A,F,Z,se,Q,ee,ce)=>{const re=()=>{if(A.isMounted){let{next:S,bu:V,u:te,parent:me,vnode:Me}=A;{const $t=ad(A);if($t){S&&(S.el=Me.el,pe(A,S,ce)),$t.asyncDep.then(()=>{const Bt=()=>{A.job.flags&8||(Q&&Q.pendingBranch?pt(Bt,Q):j())};Bt.flags=48,pt(Bt,Q)});return}}let Ce=S,Ke;Wn(A,!1),S?(S.el=Me.el,pe(A,S,ce)):S=Me,V&&zo(V),(Ke=S.props&&S.props.onVnodeBeforeUpdate)&&Ht(Ke,me,S,Me),Wn(A,!0);const Qe=ar(A),Je=A.subTree;A.subTree=Qe,m(Je,Qe,d(Je.el||zs(Je)),fe(Je),A,Q,ee),S.el=Qe.el,Ce===null&&Yv(A,Qe.el),te&&pt(te,Q),(Ke=S.props&&S.props.onVnodeUpdated)&&pt(()=>Ht(Ke,me,S,Me),Q)}else{let S;const{el:V,props:te}=F,{bm:me,m:Me,parent:Ce,root:Ke,type:Qe}=A,Je=ls(F);Wn(A,!1),me&&zo(me),!Je&&(S=te&&te.onVnodeBeforeMount)&&Ht(S,Ce,F),Wn(A,!0);{Ke.ce&&Ke.ce._hasShadowRoot()&&Ke.ce._injectChildStyle(Qe,A.parent?A.parent.type:void 0);const $t=A.subTree=ar(A);m(null,$t,Z,se,A,Q,ee),F.el=$t.el}if(Me&&pt(Me,Q),!Je&&(S=te&&te.onVnodeMounted)){const $t=F;pt(()=>Ht(S,Ce,$t),Q)}(F.shapeFlag&256||Ce&&ls(Ce.vnode)&&Ce.vnode.shapeFlag&256)&&A.a&&pt(A.a,Q),A.isMounted=!0,F=Z=se=null}};A.scope.on();const M=A.effect=new ru(re);A.scope.off();const j=A.update=M.run.bind(M),he=A.job=M.runIfDirty.bind(M);he.i=A,he.id=A.uid,M.scheduler=()=>ga(he),Wn(A,!0),j()},pe=(A,F,Z)=>{F.component=A;const se=A.vnode.props;A.vnode=F,A.next=null,eh(A,F.props,se,Z),oh(A,F.children,Z),tn(),Ru(A),nn()},ue=(A,F,Z,se,Q,ee,ce,re,M=!1)=>{const j=A&&A.children,he=A?A.shapeFlag:0,S=F.children,{patchFlag:V,shapeFlag:te}=F;if(V>0){if(V&128){H(j,S,Z,se,Q,ee,ce,re,M);return}else if(V&256){B(j,S,Z,se,Q,ee,ce,re,M);return}}te&8?(he&16&&Re(j,Q,ee),S!==j&&u(Z,S)):he&16?te&16?H(j,S,Z,se,Q,ee,ce,re,M):Re(j,Q,ee,!0):(he&8&&u(Z,""),te&16&&K(S,Z,se,Q,ee,ce,re,M))},B=(A,F,Z,se,Q,ee,ce,re,M)=>{A=A||Zn,F=F||Zn;const j=A.length,he=F.length,S=Math.min(j,he);let V;for(V=0;V<S;V++){const te=F[V]=M?fn(F[V]):Gt(F[V]);m(A[V],te,Z,null,Q,ee,ce,re,M)}j>he?Re(A,Q,ee,!0,!1,S):K(F,Z,se,Q,ee,ce,re,M,S)},H=(A,F,Z,se,Q,ee,ce,re,M)=>{let j=0;const he=F.length;let S=A.length-1,V=he-1;for(;j<=S&&j<=V;){const te=A[j],me=F[j]=M?fn(F[j]):Gt(F[j]);if(Jn(te,me))m(te,me,Z,null,Q,ee,ce,re,M);else break;j++}for(;j<=S&&j<=V;){const te=A[S],me=F[V]=M?fn(F[V]):Gt(F[V]);if(Jn(te,me))m(te,me,Z,null,Q,ee,ce,re,M);else break;S--,V--}if(j>S){if(j<=V){const te=V+1,me=te<he?F[te].el:se;for(;j<=V;)m(null,F[j]=M?fn(F[j]):Gt(F[j]),Z,me,Q,ee,ce,re,M),j++}}else if(j>V)for(;j<=S;)G(A[j],Q,ee,!0),j++;else{const te=j,me=j,Me=new Map;for(j=me;j<=V;j++){const ft=F[j]=M?fn(F[j]):Gt(F[j]);ft.key!=null&&Me.set(ft.key,j)}let Ce,Ke=0;const Qe=V-me+1;let Je=!1,$t=0;const Bt=new Array(Qe);for(j=0;j<Qe;j++)Bt[j]=0;for(j=te;j<=S;j++){const ft=A[j];if(Ke>=Qe){G(ft,Q,ee,!0);continue}let At;if(ft.key!=null)At=Me.get(ft.key);else for(Ce=me;Ce<=V;Ce++)if(Bt[Ce-me]===0&&Jn(ft,F[Ce])){At=Ce;break}At===void 0?G(ft,Q,ee,!0):(Bt[At-me]=j+1,At>=$t?$t=At:Je=!0,m(ft,F[At],Z,null,Q,ee,ce,re,M),Ke++)}const vo=Je?rh(Bt):Zn;for(Ce=vo.length-1,j=Qe-1;j>=0;j--){const ft=me+j,At=F[ft],ho=F[ft+1],mo=ft+1<he?ho.el||zs(ho):se;Bt[j]===0?m(null,At,Z,mo,Q,ee,ce,re,M):Je&&(Ce<0||j!==vo[Ce]?W(At,Z,mo,2):Ce--)}}},W=(A,F,Z,se,Q=null)=>{const{el:ee,type:ce,transition:re,children:M,shapeFlag:j}=A;if(j&6){W(A.component.subTree,F,Z,se);return}if(j&128){A.suspense.move(F,Z,se);return}if(j&64){ce.move(A,F,Z,wt);return}if(ce===J){s(ee,F,Z);for(let S=0;S<M.length;S++)W(M[S],F,Z,se);s(A.anchor,F,Z);return}if(ce===si){k(A,F,Z);return}if(se!==2&&j&1&&re)if(se===0)re.persisted&&!ee[St]?s(ee,F,Z):(re.beforeEnter(ee),s(ee,F,Z),pt(()=>re.enter(ee),Q));else{const{leave:S,delayLeave:V,afterLeave:te}=re,me=()=>{A.ctx.isUnmounted?o(ee):s(ee,F,Z)},Me=()=>{const Ce=ee._isLeaving||!!ee[St];ee._isLeaving&&ee[St](!0),re.persisted&&!Ce?me():S(ee,()=>{me(),te&&te()})};V?V(ee,me,Me):Me()}else s(ee,F,Z)},G=(A,F,Z,se=!1,Q=!1)=>{const{type:ee,props:ce,ref:re,children:M,dynamicChildren:j,shapeFlag:he,patchFlag:S,dirs:V,cacheIndex:te,memo:me}=A;if((S===-2||j&&j.hasOnce)&&(Q=!1),re!=null&&(tn(),Ls(re,null,Z,A,!0),nn()),te!=null&&(!A.ctx||A.ctx===F)&&(F.renderCache[te]=void 0),he&256&&F.ctx.deactivate(A))return;const Me=he&1&&V,Ce=!ls(A);let Ke;if(Ce&&(Ke=ce&&ce.onVnodeBeforeUnmount)&&Ht(Ke,F,A),he&6)Ne(A.component,Z,se);else{if(he&128){A.suspense.unmount(Z,se);return}Me&&Un(A,null,F,"beforeUnmount"),he&64?A.type.remove(A,F,Z,wt,se):j&&!j.hasOnce&&(ee!==J||S>0&&S&64)?Re(j,F,Z,!1,!0):(ee===J&&S&384||!Q&&he&16)&&Re(M,F,Z),se&&xe(A)}const Qe=me!=null&&te==null;(Ce&&(Ke=ce&&ce.onVnodeUnmounted)||Me||Qe)&&pt(()=>{Ke&&Ht(Ke,F,A),Me&&Un(A,null,F,"unmounted"),Qe&&(A.el=null)},Z)},xe=A=>{const{type:F,el:Z,anchor:se,transition:Q}=A,ee=F===J;if(ee&&!Q){Be(Z,se);return}if(F===si){C(A),Q&&!Q.persisted&&Q.afterLeave&&Q.afterLeave();return}const ce=ee?Js(A):A,re=()=>{ee?d(Z)&&Be(Z,se):o(Z),Q&&!Q.persisted&&Q.afterLeave&&Q.afterLeave()};if(ce&&ce.shapeFlag&1&&Q&&!Q.persisted){const{leave:M,delayLeave:j}=Q,he=ce.el,S=()=>M(he,re);j?j(he,re,S):S()}else re()},Be=(A,F)=>{let Z;for(;A!==F;)Z=_(A),o(A),A=Z;o(F)},Ne=(A,F,Z)=>{const{bum:se,scope:Q,job:ee,subTree:ce,um:re,m:M,a:j}=A;rr(M),rr(j),se&&zo(se),Q.stop(),ee?(ee.flags|=8,G(ce,A,F,Z)):ce&&(ce.transition=A.vnode.transition,G(ce,A,F,Z)),re&&pt(re,F);const he=()=>{A.isUnmounted=!0};he.flags=16,pt(he,F)},Re=(A,F,Z,se=!1,Q=!1,ee=0)=>{for(let ce=ee;ce<A.length;ce++)G(A[ce],F,Z,se,Q)},fe=A=>{if(A.shapeFlag&6)return fe(A.component.subTree);if(A.shapeFlag&128)return A.suspense.next();const F=_(A.anchor||A.el),Z=F&&F[Fu];return Z?_(Z):F},lt=(A,F,Z)=>{const se=A&&F._vnode?void 0:A&&A.component?A.component.uid:vh();vv(()=>{A==null?F._vnode&&G(F._vnode,null,null,!0):m(F._vnode||null,A,F,null,null,null,Z),F._vnode=A},se)},wt={p:m,um:G,m:W,r:xe,mt:ne,mc:K,pc:ue,pbc:oe,n:fe,o:e};return{render:lt,hydrate:void 0,createApp:Hv(lt)}}function ni({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 Wn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function lh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function fl(e,t,n=!1){const s=e.children,o=t.children;if(be(s)&&be(o))for(let a=0;a<s.length;a++){const i=s[a];let l=o[a];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[a]=fn(o[a]),l.el=i.el),!n&&l.patchFlag!==-2&&fl(i,l)),l.type===Ca&&(l.patchFlag===-1&&(l=o[a]=fn(l)),l.el=i.el),l.type===dt&&!l.el&&(l.el=i.el)}}function rh(e){const t=e.slice(),n=[0];let s,o,a,i,l;const r=e.length;for(s=0;s<r;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(a=0,i=n.length-1;a<i;)l=a+i>>1,e[n[l]]<c?a=l+1:i=l;c<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,i=n[a-1];a-- >0;)n[a]=i,i=t[i];return n}function ad(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ad(t)}function rr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zs(e){if(e.placeholder)return e.placeholder;const t=e.component;if(t)return zs(t.subTree);const n=e.suspense;return n&&n.activeBranch?zs(n.activeBranch):null}const id=e=>e.__isSuspense,ch=Symbol("_deferredEnter");function uh(e,t){t&&t.pendingBranch?be(e)?t.effects.push(...e):t.effects.push(e):pv(e)}const J=Symbol.for("v-fgt"),Ca=Symbol.for("v-txt"),dt=Symbol.for("v-cmt"),si=Symbol.for("v-stc"),bn=[];let xt=null;function v(e=!1){bn.push(xt=e?null:[])}function pl(){bn.pop(),xt=bn[bn.length-1]||null}let Gs=1;function Xo(e,t=!1){Gs+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function ld(e){return e.dynamicChildren=Gs>0?xt||Zn:null,pl(),Gs>0&&xt&&xt.push(e),e}function y(e,t,n,s,o,a){return ld(f(e,t,n,s,o,a,!0))}function le(e,t,n,s,o){return ld(O(e,t,n,s,o,!0))}function fs(e){return e?e.__v_isVNode===!0:!1}function Jn(e,t){return e.type===t.type&&e.key===t.key}const rd=({key:e})=>e??null,jo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?qe(e)||et(e)||De(e)?{i:ut,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,s=0,o=null,a=e===J?0:1,i=!1,l=!1){const r={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rd(t),ref:t&&jo(t),scopeId:Tu,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:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:ut};return l?(Yo(r,n),a&128&&e.normalize(r)):n&&(r.shapeFlag|=qe(n)?8:16),Gs>0&&!i&&xt&&(r.patchFlag>0||a&6)&&r.patchFlag!==32&&xt.push(r),r}const O=dh;function dh(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===Nu)&&(e=dt),fs(e)){const l=Pn(e,t,!0);return n&&Yo(l,n),Gs>0&&!a&&xt&&(l.shapeFlag&6?xt[xt.indexOf(e)]=l:xt.push(l)),l.patchFlag=-2,l}if(bh(e)&&(e=e.__vccOpts),t){t=fh(t);let{class:l,style:r}=t;l&&!qe(l)&&(t.class=_e(l)),Oe(r)&&(al(r)&&!be(r)&&(r=Ye({},r)),t.style=Fe(r))}const i=qe(e)?1:id(e)?128:ba(e)?64:Oe(e)?4:De(e)?2:0;return f(e,t,n,s,o,i,a,!0)}function fh(e){return e?al(e)?Ye({},e):Qu(e)?Ye({},e[pd]||e):e:null}function Pn(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:i,children:l,transition:r}=e,c=t?cd(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&rd(c),ref:t&&t.ref?n&&a?be(a)?a.concat(jo(t)):[a,jo(t)]:jo(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==J?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:r,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Pn(e.ssContent),ssFallback:e.ssFallback&&Pn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return r&&s&&yn(u,r.clone(u)),u}function de(e=" ",t=0){return O(Ca,null,e,t)}function R(e="",t=!1){return t?(v(),le(dt,null,e)):O(dt,null,e)}function Gt(e){return e==null||typeof e=="boolean"?O(dt):be(e)?O(J,null,e.slice()):fs(e)?fn(e):O(Ca,null,String(e))}function fn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Pn(e)}function Yo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(be(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Yo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Qu(t)?t._ctx=ut:o===3&&ut&&(ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(De(t)){if(s&65){Yo(e,{default:t});return}t={default:t,_ctx:ut},n=32}else t=String(t),s&64?(n=16,t=[de(t)]):n=8;e.children=t,e.shapeFlag|=n}function cd(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=_e([t.class,s.class]));else if(o==="style")t.style=Fe([t.style,s.style]);else if(ua(o)){const a=t[o],i=s[o];i&&a!==i&&!(be(a)&&a.includes(i))?t[o]=a?[].concat(a,i):i:i==null&&a==null&&!da(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function Ht(e,t,n,s=null){Pt(e,t,7,[n,s])}const ph=Hu();let ud=0;function vh(){return ud}function hh(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||ph,a={uid:ud++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Lp(!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:td(s,o),emitsOptions:Ju(s,o),emit:null,emitted:null,propsDefaults:Ie,inheritAttrs:s.inheritAttrs,ctx:Ie,data:Ie,props:Ie,attrs:Ie,slots:Ie,refs:Ie,setupState:Ie,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=Kv.bind(null,a),e.ce&&e.ce(a),a}let ht=null;const On=()=>ht||ut;let Qo,Xs;{const e=va(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(i=>i(a)):o[0](a)}};Qo=t("__VUE_INSTANCE_SETTERS__",n=>ht=n),Xs=t("__VUE_SSR_SETTERS__",n=>Ys=n)}const fo=e=>{const t=ht;return Qo(e),e.scope.on(),()=>{e.scope.off(),Qo(t)}},cr=()=>{ht&&ht.scope.off(),Qo(null)};function dd(e){return e.vnode.shapeFlag&4}let Ys=!1;function mh(e,t=!1,n=!1){t&&Xs(t);const{props:s,children:o}=e.vnode,a=dd(e);Qv(e,s,a,t),sh(e,o,n||t);const i=a?_h(e,t):void 0;return t&&Xs(!1),i}function _h(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ov);const{setup:s}=n;if(s){tn();const o=e.setupContext=s.length>1?vd(e):null,a=fo(e),i=co(s,e,0,[e.props,o]),l=tu(i);if(nn(),a(),(l||e.sp)&&!ls(e)&&Ou(e),l){if(i.then(cr,cr),t)return i.then(r=>{Xs(!0);try{ur(e,r,t)}finally{Xs(!1)}}).catch(r=>{_a(r,e,0,void 0,!0),e.ssrRender=(c,u)=>u("<!---->")});e.asyncDep=i}else ur(e,i)}else fd(e)}function ur(e,t,n){De(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Oe(t)&&(e.setupState=$u(t)),fd(e)}function fd(e,t,n){const s=e.type;e.render||(e.render=s.render||en);{const o=fo(e);tn();try{jv(e)}finally{nn(),o()}}}const pd=Symbol(),gh={get(e,t){return vt(e,"get",""),t===pd?e:e[t]}};function vd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,gh),slots:e.slots,emit:e.emit,expose:t}}function $a(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy($u(nv(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Os)return Os[n](e)},has(t,n){return n in t||n in Os}})):e.proxy}function yh(e,t=!0){return De(e)?e.displayName||e.name:e.name||t&&e.__name}function bh(e){return De(e)&&"__vccOpts"in e}const E=(e,t)=>rv(e,t,Ys);function Tt(e,t,n){try{Xo(-1);const s=arguments.length;return s===2?Oe(t)&&!be(t)?fs(t)?O(e,null,[t]):O(e,t):O(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&fs(n)&&(n=[n]),O(e,t,n))}finally{Xo(1)}}const kh="3.5.45";let Ti;const dr=typeof window<"u"&&window.trustedTypes;if(dr)try{Ti=dr.createPolicy("vue",{createHTML:e=>e})}catch{}const hd=Ti?e=>Ti.createHTML(e):e=>e,wh="http://www.w3.org/2000/svg",xh="http://www.w3.org/1998/Math/MathML",dn=typeof document<"u"?document:null,fr=dn&&dn.createElement("template"),Ch={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?dn.createElementNS(wh,e):t==="mathml"?dn.createElementNS(xh,e):n?dn.createElement(e,{is:n}):dn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>dn.createTextNode(e),createComment:e=>dn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const i=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{fr.innerHTML=hd(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=fr.content;if(s==="svg"||s==="mathml"){const r=l.firstChild;for(;r.firstChild;)l.appendChild(r.firstChild);l.removeChild(r)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},$n="transition",Cs="animation",ps=Symbol("_vtc"),md={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},_d=Ye({},Pu,md),$h=e=>(e.displayName="Transition",e.props=_d,e),Xn=$h((e,{slots:t})=>Tt($v,gd(e),t)),Vn=(e,t=[])=>{be(e)?e.forEach(n=>n(...t)):e&&e(...t)},pr=e=>e?be(e)?e.some(t=>t.length>1):e.length>1:!1;function gd(e){const t={};for(const N in e)N in md||(t[N]=e[N]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:r=a,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:_=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,g=Ah(o),m=g&&g[0],b=g&&g[1],{onBeforeEnter:w,onEnter:x,onEnterCancelled:k,onLeave:C,onLeaveCancelled:D,onBeforeAppear:I=w,onAppear:L=x,onAppearCancelled:K=k}=t,X=(N,U,ne,ie)=>{N._enterCancelled=ie,Dn(N,U?u:l),Dn(N,U?c:i),ne&&ne()},oe=(N,U)=>{N._isLeaving=!1,Dn(N,d),Dn(N,h),Dn(N,_),U&&U()},Y=N=>(U,ne)=>{const ie=N?L:x,ae=()=>X(U,N,ne);Vn(ie,[U,ae]),vr(()=>{Dn(U,N?r:a),Kt(U,N?u:l),pr(ie)||hr(U,s,m,ae)})};return Ye(t,{onBeforeEnter(N){Vn(w,[N]),Kt(N,a),Kt(N,i)},onBeforeAppear(N){Vn(I,[N]),Kt(N,r),Kt(N,c)},onEnter:Y(!1),onAppear:Y(!0),onLeave(N,U){N._isLeaving=!0;const ne=()=>oe(N,U);Kt(N,d),N._enterCancelled?(Kt(N,_),Mi(N)):(Mi(N),Kt(N,_)),vr(()=>{N._isLeaving&&(Dn(N,d),Kt(N,h),pr(C)||hr(N,s,b,ne))}),Vn(C,[N,ne])},onEnterCancelled(N){X(N,!1,void 0,!0),Vn(k,[N])},onAppearCancelled(N){X(N,!0,void 0,!0),Vn(K,[N])},onLeaveCancelled(N){oe(N),Vn(D,[N])}})}function Ah(e){if(e==null)return null;if(Oe(e))return[oi(e.enter),oi(e.leave)];{const t=oi(e);return[t,t]}}function oi(e){return Dp(e)}function Kt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ps]||(e[ps]=new Set)).add(t)}function Dn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ps];n&&(n.delete(t),n.size||(e[ps]=void 0))}function vr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Dh=0;function hr(e,t,n,s){const o=e._endId=++Dh,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:i,timeout:l,propCount:r}=yd(e,t);if(!i)return s();const c=i+"end";let u=0;const d=()=>{e.removeEventListener(c,_),a()},_=h=>{h.target===e&&++u>=r&&d()};setTimeout(()=>{u<r&&d()},l+1),e.addEventListener(c,_)}function yd(e,t){const n=window.getComputedStyle(e),s=g=>(n[g]||"").split(", "),o=s(`${$n}Delay`),a=s(`${$n}Duration`),i=mr(o,a),l=s(`${Cs}Delay`),r=s(`${Cs}Duration`),c=mr(l,r);let u=null,d=0,_=0;t===$n?i>0&&(u=$n,d=i,_=a.length):t===Cs?c>0&&(u=Cs,d=c,_=r.length):(d=Math.max(i,c),u=d>0?i>c?$n:Cs:null,_=u?u===$n?a.length:r.length:0);const h=u===$n&&/\b(?:transform|all)(?:,|$)/.test(s(`${$n}Property`).toString());return{type:u,timeout:d,propCount:_,hasTransform:h}}function mr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>_r(n)+_r(e[s])))}function _r(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Mi(e){return(e?e.ownerDocument:document).body.offsetHeight}function Rh(e,t,n){const s=e[ps];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ea=Symbol("_vod"),vl=Symbol("_vsh"),Fi={name:"show",beforeMount(e,{value:t},{transition:n}){e[ea]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):$s(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),$s(e,!0),s.enter(e)):s.leave(e,()=>{$s(e,!1)}):$s(e,t))},beforeUnmount(e,{value:t}){$s(e,t)}};function $s(e,t){e.style.display=t?e[ea]:"none",e[vl]=!t}const Sh=Symbol(""),Eh=/(?:^|;)\s*display\s*:/;function Th(e,t,n){const s=e.style,o=qe(n);let a=!1;if(n&&!o){if(t)if(qe(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Es(s,l,"")}else for(const i in t)n[i]==null&&Es(s,i,"");for(const i in n){i==="display"&&(a=!0);const l=n[i];l!=null?Fh(e,i,!qe(t)&&t?t[i]:void 0,l)||Es(s,i,l):Es(s,i,"")}}else if(o){if(t!==n){const i=s[Sh];i&&(n+=";"+i),s.cssText=n,a=Eh.test(n)}}else t&&e.removeAttribute("style");ea in e&&((!o||t!==n)&&(e[ea]=a?s.display:""),e[vl]&&(s.display="none"))}const Do=/\s*!important$/;function Es(e,t,n){if(be(n))n.forEach(s=>Es(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Do.test(n)?e.setProperty(t,n.replace(Do,""),"important"):e.setProperty(t,n);else{const s=Mh(e,t);Do.test(n)?e.setProperty(xn(s),n.replace(Do,""),"important"):e[s]=n}}const gr=["Webkit","Moz","ms"],ai={};function Mh(e,t){const n=ai[t];if(n)return n;let s=mt(t);if(s!=="filter"&&s in e)return ai[t]=s;s=pa(s);for(let o=0;o<gr.length;o++){const a=gr[o]+s;if(a in e)return ai[t]=a}return t}function Fh(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&qe(s)&&n===s}const yr="http://www.w3.org/1999/xlink";function br(e,t,n,s,o,a=Ip(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(yr,t.slice(6,t.length)):e.setAttributeNS(yr,t,n):n==null||a&&!au(n)?e.removeAttribute(t):e.setAttribute(t,a?"":Ut(n)?String(n):n)}function kr(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?hd(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const l=a==="OPTION"?e.getAttribute("value")||"":e.value,r=n==null?e.type==="checkbox"?"on":"":String(n);(l!==r||!("_value"in e))&&(e.value=r),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=au(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function hn(e,t,n,s){e.addEventListener(t,n,s)}function Ih(e,t,n,s){e.removeEventListener(t,n,s)}const wr=Symbol("_vei");function Ph(e,t,n,s,o=null){const a=e[wr]||(e[wr]={}),i=a[t];if(s&&i)i.value=s;else{const[l,r]=Oh(t);if(s){const c=a[t]=Nh(s,o);hn(e,l,c,r)}else i&&(Ih(e,l,i,r),a[t]=void 0)}}const Bh=/(Once|Passive|Capture)$/,Lh=/^on:?(?:Once|Passive|Capture)$/;function Oh(e){let t,n;for(;(n=e.match(Bh))&&!Lh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):xn(e.slice(2)),t]}let ii=0;const zh=Promise.resolve(),jh=()=>ii||(zh.then(()=>ii=0),ii=Date.now());function Nh(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(be(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const i=o.slice(),l=[s];for(let r=0;r<i.length&&!s._stopped;r++){const c=i[r];c&&Pt(c,t,5,l)}}else Pt(o,t,5,[s])};return n.value=e,n.attached=jh(),n}const xr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Uh=(e,t,n,s,o,a)=>{const i=o==="svg";t==="class"?Rh(e,s,i):t==="style"?Th(e,n,s):ua(t)?da(t)||Ph(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Wh(e,t,s,i))?(kr(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&br(e,t,s,i,a,t!=="value")):e._isVueCE&&(Vh(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!qe(s)))?kr(e,mt(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),br(e,t,s,i))};function Wh(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&xr(t)&&De(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 xr(t)&&qe(n)?!1:t in e}function Vh(e,t){const n=e._def.props;if(!n)return!1;const s=mt(t);return Array.isArray(n)?n.some(o=>mt(o)===s):Object.keys(n).some(o=>mt(o)===s)}const bd=new WeakMap,kd=new WeakMap,ta=Symbol("_moveCb"),Cr=Symbol("_enterCb"),Ii=new WeakMap,qh=e=>(delete e.props.mode,e),Hh=qh({name:"TransitionGroup",props:Ye({},_d,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=On(),s=Iu();let o,a,i,l;const r=()=>(l===void 0&&(l=o.length>0&&Qh(o[0].el,n.vnode.el,$r(e))),l);return ju(()=>{if(Ii.delete(n),!r()){o=[],i=void 0;return}const c=$r(e);o.forEach(Kh);const u=i&&Yh(i,n.vnode.el);i=void 0,o.forEach(_=>Jh(_,u));const d=o.filter(Zh);Mi(n.vnode.el),d.forEach(_=>{const h=_.el,g=h.style;Kt(h,c),g.transform=g.webkitTransform=g.transitionDuration="";const m=h[ta]=b=>{b&&b.target!==h||(!b||b.propertyName.endsWith("transform"))&&(h.removeEventListener("transitionend",m),h[ta]=null,Dn(h,c))};h.addEventListener("transitionend",m)}),o=[]}),()=>{const c=Pe(e),u=gd(c);let d=c.tag||J;if(o=[],l=void 0,a)for(let _=0;_<a.length;_++){const h=a[_];h.el&&h.el instanceof Element&&!h.el[vl]&&(o.push(h),yn(h,Ks(h,u,s,n)),bd.set(h,Aa(h.el)))}a=t.default?ll(t.default()):[];for(let _=0;_<a.length;_++){const h=a[_];h.key!=null&&yn(h,Ks(h,u,s,n))}return o.length&&(i=Gh(n),Ii.set(n,r)),O(d,null,a)}}}),vs=Hh;function Kh(e){const t=e.el;t[ta]&&t[ta](),t[Cr]&&t[Cr]()}function $r(e){return e.moveClass||`${e.name||"v"}-move`}function Jh(e,t){kd.set(e,Aa(e.el,t))}function Zh(e){const t=bd.get(e),n=kd.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,i=a.style,l=a.getBoundingClientRect();let r=1,c=1;return a.offsetWidth&&(r=l.width/a.offsetWidth),a.offsetHeight&&(c=l.height/a.offsetHeight),(!Number.isFinite(r)||r===0)&&(r=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(r-1)<.01&&(r=1),Math.abs(c-1)<.01&&(c=1),i.transform=i.webkitTransform=`translate(${s/r}px,${o/c}px)`,i.transitionDuration="0s",e}}function Aa(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Gh(e){let t;for(let n=e.parent;n;n=n.parent){const s=Ii.get(n);if(s){const o=Xh(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(Ye(Aa(o),{item:o,willMove:s}))}}return t}function Xh(e,t){const n=e.nodeType===1?e:e.parentNode;for(;t&&t.parentNode!==n;)t=t.parentNode;if(t&&t.nodeType===1)return t}function Yh(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&Aa(n.item,n)}function Qh(e,t,n){const s=e.cloneNode(),o=e[ps];o&&o.forEach(l=>{l.split(/\s+/).forEach(r=>r&&s.classList.remove(r))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:i}=yd(s);return a.removeChild(s),i}const Bn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return be(t)?n=>zo(t,n):t};function em(e){e.target.composing=!0}function Ar(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ct=Symbol("_assign"),Ro=Symbol("_initialValue");function li(e,t,n){return t&&(e=e.trim()),n&&(e=ro(e)),e}const Ze={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Ro]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Ro]=e.defaultValue.replace(/\r\n?/g,`
2
+ `))),e[Ct]=Bn(o);const a=s||o.props&&o.props.type==="number";hn(e,t?"change":"input",i=>{i.target.composing||e[Ct](li(e.value,n,a))}),(n||a)&&hn(e,"change",()=>{e.value=li(e.value,n,a)}),t||(hn(e,"compositionstart",em),hn(e,"compositionend",Ar),hn(e,"change",Ar))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[Ro];delete e[Ro],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Ct](li(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},i){if(e[Ct]=Bn(i),e.composing)return;const l=(a||e.type==="number")&&!/^0\d/.test(e.value)?ro(e.value):e.value,r=t??"";if(l===r)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===r)||(e.value=r)}},hl={deep:!0,created(e,t,n){e[Ct]=Bn(n),hn(e,"change",()=>{const s=e._modelValue,o=hs(e),a=e.checked,i=e[Ct];if(be(s)){const l=Qi(s,o),r=l!==-1;if(a&&!r)i(s.concat(o));else if(!a&&r){const c=[...s];c.splice(l,1),i(c)}}else if(wn(s)){const l=new Set(s);a?l.add(o):l.delete(o),i(l)}else i(wd(e,a))})},mounted:Dr,beforeUpdate(e,t,n){e[Ct]=Bn(n),Dr(e,t,n)}};function Dr(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(be(t))o=Qi(t,s.props.value)>-1;else if(wn(t))o=t.has(s.props.value);else{if(t===n)return;o=Wt(t,wd(e,!0))}e.checked!==o&&(e.checked=o)}const tm={created(e,{value:t},n){e.checked=Wt(t,n.props.value),e[Ct]=Bn(n),hn(e,"change",()=>{e[Ct](hs(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Ct]=Bn(s),t!==n&&(e.checked=Wt(t,s.props.value))}},nm={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,hn(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?ro(hs(r)):hs(r)),a=e.multiple,i=a?wn(e._modelValue)?new Set(o):o:o[0],l=e._pendingValue=[a,a?be(i)?o.slice():o:i];try{e[Ct](i)}finally{Ge(()=>{e._pendingValue===l&&(e._pendingValue=void 0)})}}),e[Ct]=Bn(s)},mounted(e,{value:t,modifiers:{number:n}}){Rr(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ct]=Bn(n)},updated(e,{value:t,modifiers:{number:n}}){const s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!sm(t,s[1],s[0]))&&Rr(e,t,n)}};function sm(e,t,n){if(!n||be(e))return Wt(e,t);if(wn(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function Rr(e,t,n=!1){const s=e.multiple,o=be(t);if(!(s&&!o&&!wn(t))){for(let a=0,i=e.options.length;a<i;a++){const l=e.options[a],r=hs(l);if(s)if(o){const c=typeof r;c==="string"||c==="number"?l.selected=t.some(u=>String(u)===String(r)):l.selected=Qi(t,r)>-1}else l.selected=t.has(r)||n&&typeof r=="string"&&t.has(ro(r));else if(Wt(hs(l),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function hs(e){return"_value"in e?e._value:e.value}function wd(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const xd={created(e,t,n){So(e,t,n,null,"created")},mounted(e,t,n){So(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){So(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){So(e,t,n,s,"updated")}};function om(e,t){switch(e){case"SELECT":return nm;case"TEXTAREA":return Ze;default:switch(t){case"checkbox":return hl;case"radio":return tm;default:return Ze}}}function So(e,t,n,s,o){const i=om(e.tagName,n.props&&n.props.type)[o];i&&i(e,t,n,s)}const am=["ctrl","shift","alt","meta"],im={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)=>am.some(n=>e[`${n}Key`]&&!t.includes(n))},Se=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...a)=>{for(let i=0;i<t.length;i++){const l=im[t[i]];if(l&&l(o,t))return}return e(o,...a)}))},lm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},at=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const a=xn(o.key);if(t.some(i=>i===a||lm[i]===a))return e(o)}))},rm=Ye({patchProp:Uh},Ch);let Sr;function cm(){return Sr||(Sr=ah(rm))}const um=((...e)=>{const t=cm().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=fm(s);if(!o)return;const a=t._component;!De(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,dm(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function dm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function fm(e){return qe(e)?document.querySelector(e):e}const pm=["type","disabled","aria-busy"],vm={key:0,class:"va-btn__icon"},hm={key:1,class:"va-btn__label"},mm={key:2,class:"va-btn__icon"},cs=we({__name:"VaButton",props:{variant:{default:"primary"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},setup(e){return(t,n)=>(v(),y("button",{class:_e(["va-btn",[`va-btn--${e.variant}`,`va-btn--${e.size}`,{"va-btn--block":e.block,"va-btn--loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading,"aria-busy":e.loading||void 0},[t.$slots.icon?(v(),y("span",vm,[je(t.$slots,"icon")])):R("",!0),t.$slots.default?(v(),y("span",hm,[je(t.$slots,"default")])):R("",!0),t.$slots["icon-right"]?(v(),y("span",mm,[je(t.$slots,"icon-right")])):R("",!0)],10,pm))}});function _m(e,t){const n=P(!1);let s=null,o;const a=E(()=>new Intl.NumberFormat(e.locale??void 0,e.format)),i=E(()=>a.value.format(e.value)),l=E(()=>{const c=[];let u=0,d=0;for(let _=i.value.length-1;_>=0;_--){const h=i.value[_];h>="0"&&h<="9"?c.unshift({key:`d${u++}`,digit:h.charCodeAt(0)-48}):c.unshift({key:`s${d++}`,char:h})}return c});function r(){n.value||(o=window.setTimeout(()=>n.value=!0,e.delay))}return it(()=>{if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){n.value=!0;return}if(typeof IntersectionObserver>"u"){r();return}s=new IntersectionObserver(c=>{c.some(u=>u.isIntersecting)&&(r(),s?.disconnect(),s=null)},{threshold:.3}),s.observe(t.value)}),tt(()=>{s?.disconnect(),o!==void 0&&window.clearTimeout(o)}),{rolled:n,parts:l,formatted:i}}const gm=["aria-label"],ym=["data-static"],bm={key:1,class:"va-ticker__char"},Er=we({__name:"VaNumberTicker",props:{value:{},format:{},locale:{},duration:{default:900},delay:{default:0}},setup(e){const t=e,n=Xe("root"),{rolled:s,parts:o,formatted:a}=_m(t,n);return(i,l)=>(v(),y("span",{ref_key:"root",ref:n,class:"va-ticker",role:"img","aria-label":p(a)},[(v(!0),y(J,null,ve(p(o),r=>(v(),y("span",{key:r.key,class:"va-ticker__col","data-static":r.digit===void 0||void 0},[r.digit!==void 0?(v(),y("span",{key:0,class:"va-ticker__reel",style:Fe({transform:p(s)?`translateY(${-r.digit/11*100}%)`:"translateY(0)",transitionDuration:`${e.duration}ms`})},[(v(),y(J,null,ve(11,c=>f("span",{key:c,class:"va-ticker__num"},$((c-1)%10),1)),64))],4)):(v(),y("span",bm,$(r.char),1))],8,ym))),128))],8,gm))}}),_n=we({__name:"VaSkeleton",props:{width:{},height:{},radius:{},circle:{type:Boolean}},setup(e){const t=e,n=o=>{if(o!==void 0)return typeof o=="number"?`${o}px`:/^\d+(\.\d+)?$/.test(o)?`${o}px`:o},s=E(()=>{const o=n(t.width??"100%"),a=n(t.height??"12px");return{width:t.circle?a:o,height:a,borderRadius:t.circle?"50%":n(t.radius??"6px")}});return(o,a)=>(v(),y("span",{class:"va-skel",style:Fe(s.value),"aria-hidden":"true"},null,4))}}),km=Symbol("va-tool-call-group");function ml(e){if(!Number.isFinite(e)||e<0)return"0ms";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t<10?t.toFixed(1):Math.round(t)}s`;const n=Math.floor(t/60);if(n<60)return`${n}m ${String(Math.round(t%60)).padStart(2,"0")}s`;const s=Math.floor(n/60);return s<24?`${s}h ${String(n%60).padStart(2,"0")}m`:`${Math.floor(s/24)}d ${s%24}h`}function gt(e){if(!Number.isFinite(e)||e<0)return"0";if(e<1e3)return String(Math.round(e));if(e<1e6){const n=e/1e3;return`${n<100?n.toFixed(1).replace(/\.0$/,""):String(Math.round(n))}K`}const t=e/1e6;return t<100?t.toFixed(1).replace(/\.0$/,"")+"M":`${Math.round(t)}M`}function Tr(e){if(e==null)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function Da(e,t){const n=P(Date.now());let s;function o(){s!==void 0||typeof window>"u"||(n.value=Date.now(),s=window.setInterval(()=>n.value=Date.now(),e))}function a(){s!==void 0&&(window.clearInterval(s),s=void 0)}return $e(t,i=>i?o():a(),{immediate:!0}),tt(a),n}function wm(e,t){const n=Bs(km,null),s=P(!1),o=P(!1),a=E(()=>e.open!==void 0?e.open:o.value?s.value:e.defaultOpen??!1);function i(D){o.value=!0,s.value=D,t(D)}const l=E(()=>e.status==="running"&&e.startedAt!=null),r=Da(200,l),c=P(void 0);$e(l,D=>{D||(c.value=u.value||void 0)});const u=E(()=>e.startedAt!=null?Math.max(0,r.value-e.startedAt):0),d=E(()=>e.status==="running"?u.value:e.duration!=null?e.duration:c.value??0),_=E(()=>ml(d.value)),h=P(!1);$e(()=>e.status,(D,I)=>{!e.openOnError||o.value||(D==="error"&&I!=="error"&&!a.value?(i(!0),h.value=!0):I==="error"&&D!=="error"&&h.value&&(i(!1),h.value=!1))});function g(){i(!a.value)}const m=E(()=>Tr(e.args)),b=E(()=>e.status==="error"?"":Tr(e.result)),w=P({});function x(D){return D.length>400}const k=`va-tcl-${Math.random().toString(36).slice(2,8)}`,C=()=>({name:e.name,status:e.status,duration:e.status==="running"?void 0:e.duration??c.value,hasIcon:!0});return it(()=>{n?.register(C),e.status==="error"&&e.openOnError&&!a.value&&(i(!0),h.value=!0)}),tt(()=>{n?.unregister(C)}),{id:k,isOpen:a,timeLabel:_,timeMs:d,argsText:m,resultText:b,expanded:w,isLong:x,toggle:g}}const xm=["data-status"],Cm=["id","aria-expanded"],$m=["data-status"],Am={key:0,class:"va-tcl__spin","aria-hidden":"true"},Dm={class:"va-tcl__meta"},Rm={class:"va-tcl__name"},Sm={key:0,class:"va-tcl__summary"},Em={class:"va-tcl__side"},Tm={class:"va-tcl__time"},Mm={key:0,class:"va-tcl__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},Fm={key:1,class:"va-tcl__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},Im=["aria-label"],Pm={class:"va-tcl__inner"},Bm={key:0,class:"va-tcl__error"},Lm={class:"va-tcl__error-text"},Om={key:1,class:"va-tcl__sec"},zm={key:2,class:"va-tcl__sec"},jm=we({__name:"VaToolCallCard",props:{name:{},summary:{default:void 0},status:{},args:{default:void 0},result:{default:void 0},error:{default:void 0},startedAt:{default:void 0},duration:{default:void 0},maxCodeHeight:{default:220},openOnError:{type:Boolean,default:!0},defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0}},emits:["retry","update:open"],setup(e,{emit:t}){const n=e,s=t,{id:o,isOpen:a,timeLabel:i,argsText:l,resultText:r,expanded:c,isLong:u,toggle:d}=wm(n,_=>s("update:open",_));return(_,h)=>(v(),y("div",{class:_e(["va-tcl",[`va-tcl--${n.status}`,p(a)?"va-tcl--open":""]]),"data-status":n.status},[f("button",{id:p(o),class:"va-tcl__head",type:"button","aria-expanded":p(a),onClick:h[0]||(h[0]=(...g)=>p(d)&&p(d)(...g))},[f("span",{class:"va-tcl__tile","data-status":n.status},[je(_.$slots,"icon",{},()=>[h[4]||(h[4]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M14.7 6.3a4.6 4.6 0 0 0-6.16 5.44L3.4 16.9a2 2 0 1 0 2.83 2.83l5.16-5.16a4.6 4.6 0 0 0 5.44-6.16l-2.6 2.6-2.3-.62-.62-2.3 2.6-2.6Z"})],-1))]),n.status==="running"?(v(),y("span",Am)):R("",!0)],8,$m),f("span",Dm,[f("code",Rm,$(n.name),1),n.summary?(v(),y("span",Sm,$(n.summary),1)):R("",!0)]),f("span",Em,[f("span",Tm,$(p(i)),1),n.status==="success"?(v(),y("svg",Mm,[...h[5]||(h[5]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):n.status==="error"?(v(),y("svg",Fm,[...h[6]||(h[6]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):R("",!0),h[7]||(h[7]=f("svg",{class:"va-tcl__chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m9.5 7 5 5-5 5"})],-1))])],8,Cm),f("div",{class:"va-tcl__body",role:"region","aria-label":`${n.name} 详情`},[f("div",Pm,[n.error?(v(),y("div",Bm,[f("span",Lm,$(n.error),1),f("button",{class:"va-act va-act--sm va-act--danger va-tcl__retry",type:"button",onClick:h[1]||(h[1]=g=>s("retry"))},"↻ 重试")])):R("",!0),p(l)?(v(),y("section",Om,[h[8]||(h[8]=f("h4",{class:"va-tcl__sec-title"},"参数",-1)),f("pre",{class:_e(["va-tcl__code",{"va-tcl__code--capped":p(u)(p(l))&&!p(c).args}]),style:Fe(p(c).args||!p(u)(p(l))?void 0:{maxHeight:`${n.maxCodeHeight}px`})},$(p(l)),7),p(u)(p(l))?(v(),y("button",{key:0,class:"va-tcl__more",type:"button",onClick:h[2]||(h[2]=g=>p(c).args=!p(c).args)},$(p(c).args?"收起":"显示全部"),1)):R("",!0)])):R("",!0),p(r)?(v(),y("section",zm,[h[9]||(h[9]=f("h4",{class:"va-tcl__sec-title"},"结果",-1)),f("pre",{class:_e(["va-tcl__code",{"va-tcl__code--capped":p(u)(p(r))&&!p(c).result}]),style:Fe(p(c).result||!p(u)(p(r))?void 0:{maxHeight:`${n.maxCodeHeight}px`})},$(p(r)),7),p(u)(p(r))?(v(),y("button",{key:0,class:"va-tcl__more",type:"button",onClick:h[3]||(h[3]=g=>p(c).result=!p(c).result)},$(p(c).result?"收起":"显示全部"),1)):R("",!0)])):R("",!0)])],8,Im)],10,xm))}});function Nm(e){const t=P({});$e(()=>e.decisions,a=>{const i=new Set;for(const l of a)i.add(l.id),t.value[l.id]||(t.value[l.id]={open:!l.collapsed});for(const l of Object.keys(t.value))i.has(l)||delete t.value[l]},{immediate:!0,deep:!1});function n(a,i){const l=t.value[a.id];return!l||l.answered?!1:(l.answered=i,window.setTimeout(()=>{const r=t.value[a.id];r?.answered===i&&(r.gone=!0)},1e3),!0)}const s=E(()=>e.decisions.filter(a=>!t.value[a.id]?.gone)),o=E(()=>s.value.filter(a=>!t.value[a.id]?.answered));return{states:t,answer:n,visible:s,pending:o}}const Um=["data-empty"],Wm={key:0,class:"va-dib__head",role:"status"},Vm=["onClick"],qm={class:"va-dib__fold-title"},Hm={class:"va-dib__title"},Km={key:0,class:"va-dib__detail"},Jm={key:1,class:"va-dib__confirm",role:"status"},Zm={key:2,class:"va-dib__detail"},Gm={key:3,class:"va-dib__actions"},Xm=["onClick"],Ym=["onClick"],Qm=we({__name:"VaDecisionInbox",props:{decisions:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{states:o,answer:a,visible:i,pending:l}=Nm(n);function r(c,u){a(c,u)&&s("decide",c,u)}return(c,u)=>(v(),y("div",{class:"va-dib","data-empty":!p(i).length||void 0},[p(i).length?(v(),y("p",Wm,[u[0]||(u[0]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"M12 9v4M12 16.5h.01M10.3 3.9 2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"})],-1)),de(" "+$(p(l).length?`${p(l).length} 项待你拍板`:"全部已处理"),1)])):(v(),le(vs,{key:1,name:"va-dib-fade",tag:"div"},{default:ye(()=>[...u[1]||(u[1]=[f("p",{key:"empty",class:"va-dib__empty va-fade-in"},"收件箱清空了,去忙别的吧。",-1)])]),_:1})),O(vs,{name:"va-dib",tag:"div",class:"va-dib__list"},{default:ye(()=>[(v(!0),y(J,null,ve(p(i),d=>(v(),y("article",{key:d.id,class:_e(["va-dib__item",{"va-dib__item--folded":!p(o)[d.id]?.open,"va-dib__item--answered":p(o)[d.id]?.answered}])},[!p(o)[d.id]?.open&&!p(o)[d.id]?.answered?(v(),y("button",{key:0,class:"va-dib__fold",type:"button",onClick:_=>p(o)[d.id].open=!0},[f("span",qm,$(d.title),1),u[2]||(u[2]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m9.5 7 5 5-5 5"})],-1))],8,Vm)):(v(),y(J,{key:1},[f("h4",Hm,$(d.title),1),d.detail?(v(),y("p",Km,$(d.detail),1)):R("",!0),p(o)[d.id]?.answered?(v(),y("div",Jm,[u[3]||(u[3]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"M5.5 12.5l4 4L18.5 8"})],-1)),de(" 已选择「"+$(p(o)[d.id]?.answered==="primary"?d.primary??"":d.secondary??"")+"」 ",1)])):!d.primary&&!d.secondary&&d.detail?(v(),y("p",Zm,$(d.detail),1)):d.primary||d.secondary?(v(),y("div",Gm,[d.primary?(v(),y("button",{key:0,class:"va-act va-act--ink va-dib__btn",type:"button",onClick:_=>r(d,"primary")},$(d.primary),9,Xm)):R("",!0),d.secondary?(v(),y("button",{key:1,class:"va-act va-dib__btn",type:"button",onClick:_=>r(d,"secondary")},$(d.secondary),9,Ym)):R("",!0)])):R("",!0)],64))],2))),128))]),_:1})],8,Um))}});function e_(e,t,n){const s=P(e.value);let o,a=0,i=0;function l(){o!==void 0&&(window.clearInterval(o),o=void 0)}function r(){l(),!(typeof window>"u")&&(s.value=e.value,!(s.value<=0)&&(a=Date.now()+s.value*1e3,i=Date.now(),o=window.setInterval(()=>{const c=Date.now();if(t.value){a+=c-i,i=c;return}i=c,s.value=Math.max(0,(a-c)/1e3),s.value<=0&&(l(),n())},100)))}return tt(l),{remaining:s,start:r,stop:l}}function t_(e,t){const n=e.status==="approved"||e.status==="denied"?e.status:null,s=e.reason&&e.reason.toLowerCase().includes("timeout")?"timeout":void 0,o=P(n),a=P(s),i=P(!1),l=P(e.defaultCollapsed??!!n);$e(()=>e.status,k=>{k==="approved"||k==="denied"?(o.value=k,k==="denied"&&e.reason?.toLowerCase().includes("timeout")&&(a.value="timeout"),l.value=!0,d()):k==="pending"&&(o.value=null,l.value=!1,u())});const r=E(()=>o.value?0:e.countdown??0),{remaining:c,start:u,stop:d}=e_(r,i,()=>g("denied","timeout")),_=E(()=>({low:"低风险",medium:"中风险",high:"高风险"})[e.risk??"medium"]),h=E(()=>r.value>0?c.value/r.value*100:0);function g(k,C){o.value||(o.value=k,a.value=C,d(),l.value=!0,k==="approved"?t.approve():t.deny(C))}function m(){g("approved")}function b(){g("denied","manual")}function w(){l.value=!l.value}function x(k){if(o.value)return;const C=k.target?.closest?.("button")!=null;k.key==="Enter"&&!C?(k.preventDefault(),e.approveShortcut?m():b()):k.key==="Escape"&&(k.preventDefault(),b())}return n||u(),{result:o,denyReason:a,paused:i,remaining:c,percent:h,riskLabel:_,isCollapsed:l,toggleCollapse:w,onApprove:m,onDeny:b,onKeydown:x}}const n_=["aria-label","aria-describedby"],s_={key:0,class:"va-acd__count","aria-hidden":"true"},o_=["data-risk"],a_={class:"va-acd__title"},i_={key:0,class:"va-acd__timer",role:"timer","aria-live":"off"},l_={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true"},r_={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},c_=["title"],u_={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},d_={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},f_={class:"va-acd__main"},p_=["id"],v_={key:1,class:"va-acd__preview"},h_={key:2,class:"va-acd__actions"},m_={key:0,class:"va-acd__kbd-hint"},__={key:3,class:"va-acd__done",role:"status"},g_={key:0,class:"va-acd__done-detail"},y_=we({__name:"VaApprovalCard",props:{title:{},detail:{default:void 0},risk:{default:"medium"},preview:{default:void 0},confirmLabel:{default:"批准"},denyLabel:{default:"拒绝"},countdown:{default:void 0},shortcuts:{type:Boolean,default:!0},approveShortcut:{type:Boolean,default:!1},status:{default:void 0},reason:{default:void 0},collapsible:{type:Boolean,default:!0},defaultCollapsed:{type:Boolean,default:void 0}},emits:["approve","deny"],setup(e,{emit:t}){const n=e,s=t,{result:o,denyReason:a,paused:i,percent:l,remaining:r,riskLabel:c,isCollapsed:u,toggleCollapse:d,onApprove:_,onDeny:h,onKeydown:g}=t_(n,{approve:()=>s("approve"),deny:k=>s("deny",k)}),m=P(null),b=uo();it(()=>{o.value||m.value?.focus()});function w(k){k.target!==m.value&&(i.value=!0)}function x(k){k.relatedTarget&&m.value?.contains(k.relatedTarget)||(i.value=!1)}return(k,C)=>(v(),y("div",{ref_key:"rootEl",ref:m,class:_e(["va-acd",[`va-acd--${n.risk}`,p(o)?`va-acd--${p(o)}`:"",p(u)?"va-acd--collapsed":""]]),tabindex:"-1",role:"alertdialog","aria-modal":"true","aria-label":n.title,"aria-describedby":n.detail?p(b):void 0,onKeydown:C[4]||(C[4]=(...D)=>p(g)&&p(g)(...D)),onPointerenter:C[5]||(C[5]=D=>i.value=!0),onPointerleave:C[6]||(C[6]=D=>i.value=!1),onFocusin:w,onFocusout:x},[n.countdown&&!p(o)&&!p(u)?(v(),y("div",s_,[f("span",{class:"va-acd__count-fill",style:Fe({width:`${p(l)}%`})},null,4)])):R("",!0),f("header",{class:_e(["va-acd__head",{"va-acd__head--clickable":n.collapsible!==!1}]),onClick:C[1]||(C[1]=D=>n.collapsible!==!1?p(d)():null)},[f("span",{class:"va-acd__risk","data-risk":n.risk},$(p(c)),9,o_),f("h3",a_,$(n.title),1),n.countdown&&!p(o)?(v(),y("span",i_,$(Math.ceil(p(r)))+"s 后自动拒绝 ",1)):p(o)?(v(),y("span",{key:1,class:_e(["va-acd__status-badge",`va-acd__status-badge--${p(o)}`])},[p(o)==="approved"?(v(),y("svg",l_,[...C[7]||(C[7]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):(v(),y("svg",r_,[...C[8]||(C[8]=[f("path",{d:"m7.5 7.5 9 9m0-9-9 9"},null,-1)])])),f("span",null,$(p(o)==="approved"?"已批准":p(a)==="timeout"?"超时已拒":"已拒绝"),1)],2)):R("",!0),n.collapsible!==!1?(v(),y("button",{key:2,class:"va-acd__collapse-btn",type:"button",title:p(u)?"展开详情":"收起卡片",onClick:C[0]||(C[0]=Se((...D)=>p(d)&&p(d)(...D),["stop"]))},[p(u)?(v(),y("svg",u_,[...C[9]||(C[9]=[f("polyline",{points:"6 9 12 15 18 9"},null,-1)])])):(v(),y("svg",d_,[...C[10]||(C[10]=[f("polyline",{points:"18 15 12 9 6 15"},null,-1)])]))],8,c_)):R("",!0)],2),ze(f("div",f_,[n.detail?(v(),y("p",{key:0,id:p(b),class:"va-acd__detail"},$(n.detail),9,p_)):R("",!0),n.preview?(v(),y("pre",v_,$(n.preview),1)):R("",!0),p(o)?(v(),y("div",__,[f("span",null,$(p(o)==="approved"?"已批准执行该操作":p(a)==="timeout"?"超时未响应,已自动拒绝":"已拒绝执行该操作"),1),n.detail?(v(),y("span",g_,$(n.detail),1)):R("",!0)])):(v(),y("div",h_,[f("button",{class:"va-act va-acd__btn",type:"button",onClick:C[2]||(C[2]=Se((...D)=>p(h)&&p(h)(...D),["stop"]))},$(n.denyLabel),1),f("button",{class:"va-act va-act--ink va-acd__btn",type:"button",onClick:C[3]||(C[3]=Se((...D)=>p(_)&&p(_)(...D),["stop"]))},$(n.confirmLabel),1),n.shortcuts&&!p(o)?(v(),y("span",m_,[n.approveShortcut?(v(),y(J,{key:0},[C[11]||(C[11]=f("kbd",null,"Enter",-1)),C[12]||(C[12]=de(" 批准 · ",-1)),C[13]||(C[13]=f("kbd",null,"Esc",-1)),C[14]||(C[14]=de(" 拒绝",-1))],64)):(v(),y(J,{key:1},[C[15]||(C[15]=f("kbd",null,"Enter / Esc",-1)),C[16]||(C[16]=de(" 拒绝",-1))],64))])):R("",!0)]))],512),[[Fi,!p(u)]])],42,n_))}}),b_=["aria-label"],k_={class:"va-chart-header"},w_={class:"va-chart-title"},x_={class:"va-chart-summary"},C_={class:"va-chart-max-val"},$_={key:0,class:"va-chart-unit"},A_={class:"va-bar-container"},D_={class:"va-bar-tooltip"},R_={class:"va-bar-labels"},S_=["title"],E_={class:"va-line-container"},T_={class:"va-line-svg",viewBox:"0 0 300 100",preserveAspectRatio:"none"},M_=["d"],F_=["points"],I_=["cx","cy"],P_={class:"va-bar-labels"},B_=["title"],Mr=we({__name:"VaMetricChart",props:{title:{},chartType:{default:"bar"},unit:{default:""},series:{default:()=>[]}},setup(e){const t=e,n=E(()=>{if(t.series.length===0)return 1;const l=Math.max(...t.series.map(r=>r.value));return l>0?l:1}),s=E(()=>t.series.length===0?0:t.series[t.series.length-1].value),o=E(()=>{const l=t.series.length;if(l<2)return[];const r=300,c=90,u=10,d=8,_=r-u*2,h=c-d*2;return t.series.map((g,m)=>{const b=u+m/(l-1)*_,w=c-d-g.value/n.value*h;return{x:b,y:w,...g}})}),a=E(()=>o.value.map(l=>`${l.x.toFixed(1)},${l.y.toFixed(1)}`).join(" ")),i=E(()=>{const l=o.value;if(l.length<2)return"";const r=l[0],c=l[l.length-1];return`M ${r.x},90 L ${a.value} L ${c.x},90 Z`});return(l,r)=>(v(),y("div",{class:"va-metric-chart",role:"region","aria-label":e.title},[f("header",k_,[f("h4",w_,$(e.title),1),f("div",x_,[f("span",C_,$(s.value),1),e.unit?(v(),y("span",$_,$(e.unit),1)):R("",!0)])]),e.chartType==="bar"?(v(),y(J,{key:0},[f("div",A_,[(v(!0),y(J,null,ve(e.series,(c,u)=>(v(),y("div",{key:u,class:"va-bar-col"},[f("div",D_,$(c.value)+$(e.unit),1),f("div",{class:"va-bar-pill",style:Fe({height:`${Math.max(4,c.value/n.value*100)}%`})},null,4)]))),128))]),f("div",R_,[(v(!0),y(J,null,ve(e.series,(c,u)=>(v(),y("span",{key:u,class:"va-bar-label",title:c.label},$(c.label),9,S_))),128))])],64)):e.chartType==="line"?(v(),y(J,{key:1},[f("div",E_,[(v(),y("svg",T_,[r[0]||(r[0]=f("defs",null,[f("linearGradient",{id:"va-line-gradient",x1:"0",y1:"0",x2:"0",y2:"1"},[f("stop",{offset:"0%","stop-color":"var(--va-accent, #c2410c)"}),f("stop",{offset:"100%","stop-color":"transparent"})])],-1)),f("path",{d:i.value,class:"va-line-area"},null,8,M_),f("polyline",{points:a.value,class:"va-line-path"},null,8,F_),(v(!0),y(J,null,ve(o.value,(c,u)=>(v(),y("circle",{key:u,cx:c.x,cy:c.y,r:"3",class:"va-line-dot"},[f("title",null,$(c.label)+": "+$(c.value)+$(e.unit),1)],8,I_))),128))]))]),f("div",P_,[(v(!0),y(J,null,ve(e.series,(c,u)=>(v(),y("span",{key:u,class:"va-bar-label",title:c.label},$(c.label),9,B_))),128))])],64)):R("",!0)],8,b_))}});function L_(e,t){const n=E(()=>e.steps.some(w=>w.status==="running")),s=Da(500,n);function o(w){if(w.status==="running")return w.startedAt!=null?s.value-w.startedAt:void 0;if(w.status==="done")return w.duration}const a=E(()=>e.steps.filter(w=>w.status==="done").length),i=E(()=>e.steps.some(w=>w.status==="error"));let l=0;const r=P(null),c=P(""),u=P("");function d(w){t["update:steps"](w)}function _(w){r.value=w.id,c.value=w.title}function h(w){const x=c.value.trim();r.value=null,!(!x||x===w.title)&&d(e.steps.map(k=>k.id===w.id?{...k,title:x}:k))}function g(w,x){const k=w+x;if(k<0||k>=e.steps.length)return;const C=[...e.steps],[D]=C.splice(w,1);C.splice(k,0,D),d(C)}function m(w){d(e.steps.filter(x=>x.id!==w.id))}function b(){const w=u.value.trim();w&&(d([...e.steps,{id:`step-${Date.now()}-${l++}`,title:w}]),u.value="")}return{now:s,elapsedOf:o,doneCount:a,anyError:i,editingId:r,draft:c,addDraft:u,startRename:_,rename:h,move:g,remove:m,add:b}}const O_={class:"va-plan__head"},z_={class:"va-plan__title"},j_=["data-error"],N_={key:1,class:"va-plan__progress"},U_=["data-status"],W_={key:0,class:"va-plan__edit-row"},V_={class:"va-plan__idx"},q_=["onKeydown","onBlur"],H_=["onClick"],K_={class:"va-plan__ops"},J_=["disabled","onClick"],Z_=["disabled","onClick"],G_=["onClick"],X_={class:"va-plan__node","aria-hidden":"true"},Y_={key:0,class:"va-plan__spin"},Q_={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round"},eg={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},tg={key:3,class:"va-plan__dot"},ng={class:"va-plan__body"},sg=["data-done"],og={key:0,class:"va-plan__step-detail"},ag={class:"va-plan__side"},ig={key:0,class:"va-plan__time"},lg=["onClick"],rg={key:0,class:"va-plan__add"},cg=["disabled"],ug={key:1,class:"va-plan__collab"},dg={key:0,class:"va-plan__errors",role:"alert"},fg={class:"va-plan__collab-actions"},pg=["disabled"],vg=["disabled"],hg=we({__name:"VaAgentPlan",props:{steps:{},editable:{type:Boolean,default:!1},title:{default:"执行计划"},collaborative:{type:Boolean},disabled:{type:Boolean},fieldErrors:{}},emits:["update:steps","retry","confirm","cancel"],setup(e,{emit:t}){const n=e,s=t,{elapsedOf:o,doneCount:a,anyError:i,editingId:l,draft:r,addDraft:c,startRename:u,rename:d,move:_,remove:h,add:g}=L_(n,{"update:steps":w=>s("update:steps",w)}),m=E(()=>w=>{const x=o(w);return x===void 0?void 0:ml(x)}),b=E(()=>Object.entries(n.fieldErrors??{}).map(([w,x])=>`${w}:${x}`));return(w,x)=>(v(),y("div",{class:_e(["va-plan",n.editable?"va-plan--edit":""])},[f("header",O_,[f("h4",z_,$(n.title),1),!n.editable&&n.steps.length?(v(),y("span",{key:0,class:"va-plan__progress","data-error":p(i)||void 0},[de($(p(a))+"/"+$(n.steps.length)+" 步 ",1),p(i)?(v(),y(J,{key:0},[de(" · 有失败")],64)):R("",!0)],8,j_)):n.editable?(v(),y("span",N_,"可调整后交给 agent 执行")):R("",!0)]),O(vs,{tag:"ol",class:"va-plan__list",name:"va-plan"},{default:ye(()=>[(v(!0),y(J,null,ve(n.steps,(k,C)=>(v(),y("li",{key:k.id,class:"va-plan__item","data-status":k.status??"pending"},[n.editable?(v(),y("div",W_,[f("span",V_,$(C+1),1),p(l)===k.id?ze((v(),y("input",{key:0,"onUpdate:modelValue":x[0]||(x[0]=D=>et(r)?r.value=D:null),class:"va-plan__input",type:"text",autofocus:"",onKeydown:[at(D=>p(d)(k),["enter"]),x[1]||(x[1]=at(D=>l.value=null,["esc"]))],onBlur:D=>p(d)(k)},null,40,q_)),[[Ze,p(r)]]):(v(),y("button",{key:1,class:"va-plan__rename",type:"button",title:"点击重命名",onClick:D=>p(u)(k)},$(k.title),9,H_)),f("span",K_,[f("button",{class:"va-act va-act--ghost va-plan__op",type:"button","aria-label":"上移",disabled:C===0,onClick:D=>p(_)(C,-1)},"↑",8,J_),f("button",{class:"va-act va-act--ghost va-plan__op",type:"button","aria-label":"下移",disabled:C===n.steps.length-1,onClick:D=>p(_)(C,1)},"↓",8,Z_),f("button",{class:"va-act va-act--ghost va-plan__op va-plan__op--danger",type:"button","aria-label":"删除步骤",onClick:D=>p(h)(k)},"✕",8,G_)])])):(v(),y(J,{key:1},[f("span",X_,[k.status==="running"?(v(),y("span",Y_)):k.status==="done"?(v(),y("svg",Q_,[...x[7]||(x[7]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):k.status==="error"?(v(),y("svg",eg,[...x[8]||(x[8]=[f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):(v(),y("span",tg))]),f("div",ng,[f("span",{class:"va-plan__step-title","data-done":k.status==="done"||void 0},$(k.title),9,sg),k.detail?(v(),y("span",og,$(k.detail),1)):R("",!0)]),f("div",ag,[m.value(k)!==void 0?(v(),y("span",ig,$(m.value(k)),1)):R("",!0),k.status==="error"?(v(),y("button",{key:1,class:"va-act va-act--sm va-act--danger va-plan__retry",type:"button",onClick:D=>s("retry",k)},"↻ 重试",8,lg)):R("",!0)])],64))],8,U_))),128))]),_:1}),n.editable?(v(),y("div",rg,[ze(f("input",{"onUpdate:modelValue":x[2]||(x[2]=k=>et(c)?c.value=k:null),class:"va-plan__input",type:"text",placeholder:"添加步骤…",onKeydown:x[3]||(x[3]=at((...k)=>p(g)&&p(g)(...k),["enter"]))},null,544),[[Ze,p(c)]]),f("button",{class:"va-plan__add-btn",type:"button",disabled:!p(c).trim(),onClick:x[4]||(x[4]=(...k)=>p(g)&&p(g)(...k))},"+ 添加",8,cg)])):R("",!0),n.collaborative?(v(),y("footer",ug,[b.value.length?(v(),y("div",dg,[(v(!0),y(J,null,ve(b.value,k=>(v(),y("span",{key:k,class:"va-plan__error"},$(k),1))),128))])):R("",!0),f("div",fg,[f("button",{class:"va-plan__confirm",type:"button",disabled:n.disabled,onClick:x[5]||(x[5]=k=>s("confirm"))},"确认计划",8,pg),f("button",{class:"va-plan__giveup",type:"button",disabled:n.disabled,onClick:x[6]||(x[6]=k=>s("cancel"))},"放弃",8,vg)])])):R("",!0)],2))}}),Pi={system:"系统提示",file:"文件",history:"对话历史",tools:"工具结果"};function mg(e){const t=E(()=>e.parts.reduce((r,c)=>r+c.tokens,0)),n=E(()=>Math.max(e.capacity,t.value,1)),s=E(()=>Math.min(100,t.value/e.capacity*100)),o=E(()=>e.parts.some(r=>r.kind==="history"));function a(r){return e.compacting&&r.kind==="history"}function i(r){return a(r)?"0%":`${Math.max(r.tokens/n.value*100,2)}%`}const l=E(()=>{const r=Object.keys(Pi),c=new Set(e.parts.map(u=>u.kind));return r.filter(u=>c.has(u))});return{used:t,scale:n,percent:s,hasHistory:o,shrinking:a,widthOf:i,legendKinds:l}}const _g=["aria-label"],gg={class:"va-ctx__head"},yg={class:"va-ctx__used"},bg={class:"va-ctx__pct"},kg=["disabled"],wg={class:"va-ctx__bar","aria-hidden":"true"},xg=["data-kind","data-shrink"],Cg=["aria-label","onClick","onKeydown"],$g={class:"va-ctx__tip"},Ag={class:"va-ctx__legend"},Dg=["data-kind"],Fr=we({__name:"VaContextWindow",props:{parts:{},capacity:{},compacting:{type:Boolean,default:!1},removable:{type:Boolean,default:!0}},emits:["remove","compact"],setup(e,{emit:t}){const n=e,s=t,{used:o,percent:a,hasHistory:i,shrinking:l,widthOf:r,legendKinds:c}=mg(n);return(u,d)=>(v(),y("div",{class:_e(["va-ctx",{"va-ctx--compacting":n.compacting}]),role:"img","aria-label":`上下文已用 ${p(gt)(p(o))} / ${p(gt)(n.capacity)}`},[f("header",gg,[f("span",yg,[f("strong",null,$(p(gt)(p(o))),1),de(" / "+$(p(gt)(n.capacity)),1)]),f("span",bg,$(Math.round(p(a)))+"%",1),f("button",{class:"va-act va-act--sm va-ctx__compact",type:"button",disabled:n.compacting||!p(i),onClick:d[0]||(d[0]=_=>s("compact"))},$(n.compacting?"压缩中…":"压缩对话"),9,kg)]),f("div",wg,[(v(!0),y(J,null,ve(n.parts,_=>(v(),y("div",{key:_.id,class:"va-ctx__cell","data-kind":_.kind,"data-shrink":p(l)(_)||void 0,style:Fe({width:p(r)(_)}),tabindex:"0"},[n.removable&&_.kind==="file"?(v(),y("button",{key:0,class:"va-ctx__remove",type:"button","aria-label":`移除 ${_.label}`,onClick:Se(h=>s("remove",_),["stop"]),onKeydown:at(Se(h=>s("remove",_),["stop"]),["enter"])},"×",40,Cg)):R("",!0),f("span",$g,[f("strong",null,$(_.label),1),f("em",null,$(p(Pi)[_.kind])+" · "+$(p(gt)(_.tokens))+" tokens",1)])],12,xg))),128))]),f("footer",Ag,[(v(!0),y(J,null,ve(p(c),_=>(v(),y("span",{key:_,class:"va-ctx__legend-item"},[f("i",{"data-kind":_},null,8,Dg),de($(p(Pi)[_]),1)]))),128))])],10,_g))}}),Rg=/([\u4e00-\u9fff\u3400-\u4dbf\u3040-\u30ff\uac00-\ud7af])|([A-Za-z0-9][A-Za-z0-9'_-]*)|(\s+)|([\s\S])/g;function Ir(e){const t=[];let n=!1;for(const s of e.matchAll(Rg)){if(s[3]!==void 0){n=!0;continue}t.push({t:s[0],sp:n&&t.length>0}),n=!1}return t}const Sg=1e6;function Eg(e,t){const n=Ir(e),s=Ir(t),o=n.length,a=s.length;if(o*a>Sg){const u=[];for(const d of n)u.push({type:"del",t:d.t,sp:d.sp});for(const d of s)u.push({type:"add",t:d.t,sp:d.sp});return u}const i=Array.from({length:o+1},()=>new Uint32Array(a+1));for(let u=o-1;u>=0;u--)for(let d=a-1;d>=0;d--)i[u][d]=n[u].t===s[d].t?i[u+1][d+1]+1:Math.max(i[u+1][d],i[u][d+1]);const l=[];let r=0,c=0;for(;r<o&&c<a;)n[r].t===s[c].t?(l.push({type:"same",t:n[r].t,sp:n[r].sp}),r++,c++):i[r+1][c]>=i[r][c+1]?(l.push({type:"del",t:n[r].t,sp:n[r].sp}),r++):(l.push({type:"add",t:s[c].t,sp:s[c].sp}),c++);for(;r<o;)l.push({type:"del",t:n[r].t,sp:n[r].sp}),r++;for(;c<a;)l.push({type:"add",t:s[c].t,sp:s[c].sp}),c++;return l}const Tg=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Pr=e=>e==="";const Mg=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const Br=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Fg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const Ig=e=>{const t=Fg(e);return t.charAt(0).toUpperCase()+t.slice(1)};var As={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Pg=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":s,strokeWidth:o,"stroke-width":a,size:i=As.width,color:l=As.stroke,...r},{slots:c})=>Tt("svg",{...As,...r,width:i,height:i,stroke:l,"stroke-width":Pr(n)||Pr(s)||n===!0||s===!0?Number(o||a||As["stroke-width"])*24/Number(i):o||a||As["stroke-width"],class:Mg("lucide",r.class,...e?[`lucide-${Br(Ig(e))}-icon`,`lucide-${Br(e)}`]:["lucide-icon"]),...!c.default&&!Tg(r)&&{"aria-hidden":"true"}},[...t.map(u=>Tt(...u)),...c.default?[c.default()]:[]]);const He=(e,t)=>(n,{slots:s,attrs:o})=>Tt(Pg,{...o,...n,iconNode:t,name:e},s);const Bg=He("archive-restore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);const Lr=He("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Lg=He("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]);const js=He("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Qn=He("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Or=He("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Og=He("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const zg=He("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const jg=He("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);const Ng=He("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Cd=He("folder-closed",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]]);const Ug=He("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const Wg=He("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Vg=He("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);const Bi=He("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);const zr=He("pin-off",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);const Eo=He("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);const No=He("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const qg=He("repeat-2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);const $d=He("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const Hg=He("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const Kg=He("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);const To=He("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Jg=He("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);const Mn=He("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Ad=He("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Zg={class:"va-queuedock__tag"},Gg=["onKeydown"],Xg=["onClick"],Yg=["title"],Qg=["aria-label","disabled","onClick"],e1=["disabled","onClick"],t1=["disabled","onClick"],n1=we({__name:"VaQueueDock",props:{items:{},disabled:{type:Boolean,default:!1}},emits:["remove","sendNow","edit"],setup(e,{emit:t}){const n=e,s=t,o=P(null),a=P(""),i=Xe("input");function l(u,d){n.disabled||(o.value=u,a.value=d,Ge(()=>i.value?.focus()))}function r(u){const d=a.value.trim();d&&d!==n.items[u]?.text&&s("edit",u,d),o.value=null}function c(){o.value=null}return(u,d)=>(v(),le(vs,{tag:"div",class:"va-queuedock",role:"list","aria-label":"排队消息","enter-active-class":"va-enter-up","leave-active-class":"va-exit-left","move-class":"va-queuedock-move"},{default:ye(()=>[(v(!0),y(J,null,ve(n.items,(_,h)=>(v(),y("div",{key:_.id,class:"va-queuedock__row",role:"listitem"},[f("span",Zg,"排队 "+$(h+1),1),o.value===h?(v(),y(J,{key:0},[ze(f("input",{ref_for:!0,ref:"input","onUpdate:modelValue":d[0]||(d[0]=g=>a.value=g),class:"va-queuedock__input",type:"text",maxlength:"2000",onKeydown:[at(Se(g=>r(h),["prevent"]),["enter"]),at(Se(c,["prevent"]),["escape"])]},null,40,Gg),[[Ze,a.value]]),f("button",{class:"va-queuedock__op",type:"button","aria-label":"确认编辑",onClick:g=>r(h)},[O(p(js),{size:13})],8,Xg),f("button",{class:"va-queuedock__op",type:"button","aria-label":"取消编辑",onClick:c},[O(p(Mn),{size:13})])],64)):(v(),y(J,{key:1},[f("span",{class:"va-queuedock__text",title:_.text},$(_.text),9,Yg),f("button",{class:"va-queuedock__op",type:"button","aria-label":`插队:立即发送第 ${h+1} 条`,title:"插队:run 结束后立即下发",disabled:n.disabled,onClick:g=>s("sendNow",h)},[O(p(Ad),{size:13})],8,Qg),f("button",{class:"va-queuedock__op",type:"button","aria-label":"编辑",disabled:n.disabled,onClick:g=>l(h,_.text)},[O(p(Bi),{size:12})],8,e1),f("button",{class:"va-queuedock__op",type:"button","aria-label":"移除排队",disabled:n.disabled,onClick:g=>s("remove",h)},[O(p(Mn),{size:13})],8,t1)],64))]))),128))]),_:1}))}});function s1(e,t,n,s){const o=P(!1);async function a(){const c=n.value;if(!c)return;c.style.height="auto",await Ge();const u=e.maxHeight??160;c.style.height=`${Math.min(c.scrollHeight,u)}px`}function i(c){t.value=c.target.value,a()}function l(){const c=t.value.trim();e.disabled||!e.allowEmpty&&!c||(s.send(c),t.value="",a())}function r(c){c.key!=="Enter"||c.shiftKey||o.value||(c.preventDefault(),l())}return it(()=>{t.value&&a()}),{composing:o,onInput:i,submit:l,onKeydown:r}}const o1=[{id:"claude",name:"Claude",tag:"推荐"},{id:"gpt",name:"GPT"},{id:"gemini",name:"Gemini"},{id:"deepseek",name:"DeepSeek"},{id:"qwen",name:"Qwen"}];function a1(e,t,n){const s=E(()=>e.models?.length?e.models:o1),o=P(!1),a=P(0),i=E(()=>s.value.find(g=>g.id===t.value)??s.value[0]);function l(g){const m=n.value;m&&!m.contains(g.target)&&c()}function r(){o.value=!0,a.value=Math.max(0,s.value.findIndex(g=>g.id===t.value)),typeof document<"u"&&document.addEventListener("pointerdown",l,!0)}function c(){o.value=!1,typeof document<"u"&&document.removeEventListener("pointerdown",l,!0)}function u(){o.value?c():r()}function d(g){g.detail!==0&&u()}function _(g){t.value=g.id,c()}function h(g){if(g.key==="Escape"){g.preventDefault(),c();return}if(o.value){if(g.key==="ArrowDown"||g.key==="ArrowUp"){g.preventDefault();const m=g.key==="ArrowDown"?1:-1;a.value=(a.value+m+s.value.length)%s.value.length}else if(g.key==="Enter"){g.preventDefault();const m=s.value[a.value];m&&_(m)}}}return it(()=>{s.value.some(g=>g.id===t.value)||(t.value=s.value[0]?.id??"")}),tt(c),{models:s,open:o,activeIdx:a,current:i,toggle:u,onTriggerClick:d,closeMenu:c,pick:_,onKeydown:h}}const i1=["aria-expanded","aria-label"],l1={class:"va-mpk__group-header"},r1={class:"va-mpk__group-title"},c1={class:"va-mpk__group-count"},u1=["aria-label"],d1=["aria-selected","onMouseenter","onClick"],f1={class:"va-mpk__check","aria-hidden":"true"},p1={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round"},v1=["title"],h1=["title"],m1={key:1,class:"va-mpk__list",role:"listbox"},_1=["aria-selected","onMouseenter","onClick"],g1={class:"va-mpk__check","aria-hidden":"true"},y1={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round"},b1=["title"],k1=["title"],w1=we({__name:"VaModelPicker",props:ds({models:{default:void 0},align:{default:"left"},ariaLabel:{default:"选择模型"}},{selected:{default:""},selectedModifiers:{}}),emits:["update:selected"],setup(e){const t=e,n=wa(e,"selected"),s=Xe("root"),{models:o,open:a,activeIdx:i,current:l,onTriggerClick:r,pick:c,onKeydown:u}=a1(t,n,s),d=E(()=>{const g=[],m=new Map;return o.value.forEach((b,w)=>{let x=(b.provider||"").trim();!x&&b.tag&&b.tag.includes("·")&&(x=b.tag.split("·")[0].trim());const k=x||"默认";let C=m.get(k);C||(C={provider:k,items:[]},m.set(k,C),g.push(C)),C.items.push({model:b,flatIndex:w})}),g}),_=E(()=>d.value.length>1||d.value.length===1&&d.value[0].provider!=="默认");function h(g,m){const b=g.model||(m&&g.tag?.includes("·")?g.tag.split("·").slice(1).join("·").trim():g.tag)||"";return b===g.name?"":b}return(g,m)=>(v(),y("div",{ref_key:"root",ref:s,class:"va-mpk",onKeydown:m[1]||(m[1]=(...b)=>p(u)&&p(u)(...b))},[je(g.$slots,"trigger",{current:p(l),open:p(a),toggle:p(r)},()=>[f("button",{class:"va-mpk__btn",type:"button","aria-expanded":p(a),"aria-label":t.ariaLabel,onClick:m[0]||(m[0]=(...b)=>p(r)&&p(r)(...b))},[de($(p(l)?.name??"选择模型")+" ",1),m[2]||(m[2]=f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m7 9.5 5 5 5-5"})],-1))],8,i1)]),O(Xn,{name:"va-mpk"},{default:ye(()=>[p(a)?(v(),y("div",{key:0,class:_e(["va-mpk__menu",`va-mpk__menu--${t.align}`]),role:"listbox"},[_.value?(v(!0),y(J,{key:0},ve(d.value,b=>(v(),y("div",{key:b.provider,class:"va-mpk__group"},[f("div",l1,[f("span",r1,$(b.provider),1),f("span",c1,$(b.items.length),1)]),f("ul",{class:"va-mpk__list",role:"group","aria-label":b.provider},[(v(!0),y(J,null,ve(b.items,w=>(v(),y("li",{key:w.model.id},[f("button",{class:_e(["va-mpk__item",{"va-mpk__item--active":w.flatIndex===p(i),"va-mpk__item--selected":w.model.id===n.value}]),type:"button",role:"option","aria-selected":w.model.id===n.value,onMouseenter:x=>i.value=w.flatIndex,onClick:x=>p(c)(w.model)},[f("span",f1,[w.model.id===n.value?(v(),y("svg",p1,[...m[3]||(m[3]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):R("",!0)]),f("span",{class:"va-mpk__name",title:w.model.name},$(w.model.name),9,v1),h(w.model,!0)?(v(),y("span",{key:0,class:"va-mpk__tag",title:w.model.tag||w.model.model},$(h(w.model,!0)),9,h1)):R("",!0)],42,d1)]))),128))],8,u1)]))),128)):(v(),y("ul",m1,[(v(!0),y(J,null,ve(p(o),(b,w)=>(v(),y("li",{key:b.id},[f("button",{class:_e(["va-mpk__item",{"va-mpk__item--active":w===p(i),"va-mpk__item--selected":b.id===n.value}]),type:"button",role:"option","aria-selected":b.id===n.value,onMouseenter:x=>i.value=w,onClick:x=>p(c)(b)},[f("span",g1,[b.id===n.value?(v(),y("svg",y1,[...m[4]||(m[4]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):R("",!0)]),f("span",{class:"va-mpk__name",title:b.name},$(b.name),9,b1),h(b,!1)?(v(),y("span",{key:0,class:"va-mpk__tag",title:b.tag||b.model},$(h(b,!1)),9,k1)):R("",!0)],42,_1)]))),128))]))],2)):R("",!0)]),_:1})],544))}}),x1={key:0,class:"va-cmp__atts"},C1=["src"],$1=["title"],A1={key:2,class:"va-cmp__att-size"},D1=["aria-label","onClick"],R1={key:1,class:"va-cmp__prefix"},S1={class:"va-cmp__input-wrap"},E1=["innerHTML"],T1=["value","placeholder","disabled"],M1={class:"va-cmp__foot"},F1={class:"va-cmp__actions"},I1=["aria-expanded","aria-label","disabled","onClick"],P1={class:"va-cmp__seat-label"},B1={key:1,class:"va-cmp__seat-wrap"},L1=["aria-label","disabled"],O1={class:"va-cmp__seat-label"},z1={key:0,class:"va-cmp__menu",role:"menu","aria-label":"权限预设"},j1=["data-active","onClick"],N1={key:1,class:"va-cmp__menu-gap","aria-hidden":"true"},U1={class:"va-cmp__menu-col"},W1={class:"va-cmp__menu-name"},V1={key:0,class:"va-cmp__menu-desc"},q1=["disabled"],H1={key:3,class:"va-cmp__trailing"},K1=["disabled"],jr=we({__name:"VaComposer",props:ds({placeholder:{default:"给 agent 一个任务…"},disabled:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},maxHeight:{default:160},allowEmpty:{type:Boolean,default:!1},models:{default:()=>[]},model:{default:""},permissions:{default:()=>[]},permission:{default:""},attachable:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},attachments:{default:()=>[]},mentionPaths:{default:()=>[]}},{text:{default:""},textModifiers:{}}),emits:ds(["update:text","send","stop","update:model","update:permission","removeAttachment","filesSelected"],["update:text"]),setup(e,{expose:t,emit:n}){const s=e,o=wa(e,"text"),a=n,i=Xe("area"),{composing:l,onInput:r,submit:c,onKeydown:u}=s1(s,o,i,{send:ae=>a("send",ae)}),d=E(()=>s.model||s.models[0]?.id||""),_=E(()=>s.permission||s.permissions[0]?.id||""),h=P(!1);function g(){h.value=!h.value}function m(ae){ae!==_.value&&a("update:permission",ae),h.value=!1}const b=E(()=>s.models.map(ae=>({id:ae.id,name:ae.label,tag:ae.meta,provider:ae.provider,model:ae.model})));function w(ae){ae!==d.value&&a("update:model",ae)}const x=E(()=>s.models.find(ae=>ae.id===d.value)?.label??d.value),k=E(()=>s.permissions.find(ae=>ae.id===_.value)?.label??_.value),C=Xe("backdrop"),D=E(()=>new Set(s.mentionPaths??[]));function I(ae){return ae.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const L=E(()=>{const ae=o.value;if(!ae)return"";const pe=D.value;if(pe.size===0)return I(ae);let ue="",B=0;const H=/@[^\s@]+/g;let W;for(;(W=H.exec(ae))!==null;)pe.has(W[0].slice(1))&&(ue+=I(ae.slice(B,W.index)),ue+=`<mark class="va-cmp__hl">${I(W[0])}</mark>`,B=W.index+W[0].length);return ue+=I(ae.slice(B)),ue});function K(){const ae=i.value,pe=C.value;!ae||!pe||(pe.scrollTop=ae.scrollTop,pe.scrollLeft=ae.scrollLeft)}const X=Xe("file"),oe=P(!1);function Y(){s.disabled||s.uploading||X.value?.click()}function N(ae){const pe=ae.target.files;pe?.length&&a("filesSelected",Array.from(pe)),ae.target.value=""}function U(ae){if(oe.value=!1,!s.attachable||s.disabled)return;const pe=ae.dataTransfer?.files;pe?.length&&a("filesSelected",Array.from(pe))}function ne(ae){if(!s.attachable||s.disabled)return;const pe=ae.clipboardData?.files;pe?.length&&(ae.preventDefault(),a("filesSelected",Array.from(pe)))}function ie(ae){return!ae&&ae!==0?"":ae<1024?`${ae} B`:ae<1024*1024?`${(ae/1024).toFixed(0)} KB`:`${(ae/1024/1024).toFixed(1)} MB`}return t({focus:()=>i.value?.focus()}),(ae,pe)=>(v(),y("div",{class:_e(["va-cmp",{"va-cmp--busy":s.busy,"va-cmp--drag":oe.value}]),onDragover:pe[6]||(pe[6]=Se(ue=>oe.value=s.attachable,["prevent"])),onDragleave:pe[7]||(pe[7]=ue=>oe.value=!1),onDrop:U},[s.attachments.length?(v(),y("div",x1,[(v(!0),y(J,null,ve(s.attachments,ue=>(v(),y("span",{key:ue.id,class:"va-cmp__att"},[ue.kind==="image"&&ue.previewUrl?(v(),y("img",{key:0,class:"va-cmp__att-thumb",src:ue.previewUrl,alt:""},null,8,C1)):(v(),le(p(Ng),{key:1,size:13,"aria-hidden":"true"})),f("span",{class:"va-cmp__att-name",title:ue.name},$(ue.name),9,$1),ue.size!==void 0?(v(),y("span",A1,$(ie(ue.size)),1)):R("",!0),f("button",{class:"va-cmp__att-x",type:"button","aria-label":`移除附件 ${ue.name}`,onClick:B=>a("removeAttachment",ue.id)},[O(p(Mn),{size:11,"aria-hidden":"true"})],8,D1)]))),128))])):R("",!0),ae.$slots.prefix?(v(),y("div",R1,[je(ae.$slots,"prefix")])):R("",!0),f("div",S1,[f("div",{ref_key:"backdrop",ref:C,class:"va-cmp__backdrop","aria-hidden":"true",innerHTML:L.value},null,8,E1),f("textarea",{ref_key:"area",ref:i,class:"va-cmp__area",value:o.value,placeholder:s.placeholder,disabled:s.disabled,rows:"1",onInput:pe[0]||(pe[0]=(...ue)=>p(r)&&p(r)(...ue)),onKeydown:pe[1]||(pe[1]=(...ue)=>p(u)&&p(u)(...ue)),onCompositionstart:pe[2]||(pe[2]=ue=>l.value=!0),onCompositionend:pe[3]||(pe[3]=ue=>l.value=!1),onPaste:ne,onScroll:K},null,40,T1)]),f("div",M1,[f("div",F1,[je(ae.$slots,"actions"),s.models.length?(v(),le(p(w1),{key:0,class:"va-cmp__seat-wrap",models:b.value,selected:d.value,align:"left","aria-label":`切换模型(当前 ${x.value})`,"onUpdate:selected":w},{trigger:ye(({open:ue,toggle:B})=>[f("button",{class:"va-cmp__seat",type:"button","aria-expanded":ue,"aria-label":`切换模型(当前 ${x.value})`,disabled:s.disabled,onClick:Se(B,["stop"])},[O(p(Ad),{size:12,"aria-hidden":"true"}),f("span",P1,$(x.value),1),O(p(Qn),{size:11,"aria-hidden":"true"})],8,I1)]),_:1},8,["models","selected","aria-label"])):R("",!0),s.permissions.length?(v(),y("span",B1,[f("button",{class:"va-cmp__seat",type:"button","aria-label":`权限预设(当前 ${k.value})`,disabled:s.disabled,onClick:Se(g,["stop"])},[O(p(Hg),{size:12,"aria-hidden":"true"}),f("span",O1,$(k.value),1),O(p(Qn),{size:11,"aria-hidden":"true"})],8,L1),h.value?(v(),y("div",z1,[(v(!0),y(J,null,ve(s.permissions,ue=>(v(),y("button",{key:ue.id,class:"va-cmp__menu-row",type:"button",role:"menuitem","data-active":ue.id===_.value||void 0,onClick:Se(B=>m(ue.id),["stop"])},[ue.id===_.value?(v(),le(p(js),{key:0,size:13,"aria-hidden":"true"})):(v(),y("span",N1)),f("span",U1,[f("span",W1,$(ue.label),1),ue.desc?(v(),y("span",V1,$(ue.desc),1)):R("",!0)])],8,j1))),128))])):R("",!0)])):R("",!0),s.attachable?(v(),y("button",{key:2,class:"va-cmp__seat va-cmp__seat--icon",type:"button","aria-label":"上传附件",title:"上传附件(也可拖入/粘贴)",disabled:s.disabled||s.uploading,onClick:Y},[s.uploading?(v(),le(p(Wg),{key:0,size:12,class:"va-cmp__spin","aria-hidden":"true"})):(v(),le(p(Vg),{key:1,size:12,"aria-hidden":"true"}))],8,q1)):R("",!0),f("input",{ref:"file",class:"va-cmp__file",type:"file",multiple:"",hidden:"",onChange:N},null,544),ae.$slots.trailing?(v(),y("div",H1,[je(ae.$slots,"trailing")])):R("",!0)]),s.busy?(v(),y("button",{key:0,class:"va-cmp__send va-cmp__send--stop",type:"button","aria-label":"停止运行",title:"停止(Esc)",onClick:pe[4]||(pe[4]=ue=>a("stop"))},[...pe[8]||(pe[8]=[f("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[f("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"})],-1)])])):(v(),y("button",{key:1,class:"va-cmp__send",type:"button",disabled:s.disabled||!s.allowEmpty&&!o.value.trim(),"aria-label":"发送",onClick:pe[5]||(pe[5]=(...ue)=>p(c)&&p(c)(...ue))},[...pe[9]||(pe[9]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M12 19V5M5.5 11.5 12 5l6.5 6.5"})],-1)])],8,K1))])],34))}});function J1(e,t){const n=P(!1),s=P(new Set),o=P(!1);let a=null;function i(c){return!n.value||s.value.has(c)}const l=E(()=>!n.value||o.value);async function r(){await Ge();const c=e.value;if(!(!c||!a)){if(a.disconnect(),!o.value){const u=c.querySelector(".va-traj__lanes");u&&a.observe(u)}for(const u of c.querySelectorAll(".va-traj__row[data-id]")){const d=u.dataset.id;d&&!s.value.has(d)&&a.observe(u)}}}return it(()=>{e.value&&(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||typeof IntersectionObserver>"u"||(n.value=!0,a=new IntersectionObserver(u=>{for(const d of u){if(!d.isIntersecting)continue;const _=d.target;if(_.classList.contains("va-traj__lanes"))o.value=!0;else if(_.dataset.id){const h=new Set(s.value);h.add(_.dataset.id),s.value=h}a?.unobserve(_)}},{threshold:.15}),r()))}),$e(t,()=>{n.value&&r()}),tt(()=>{a?.disconnect(),a=null}),{active:n,rowVisible:i,blocksVisible:l}}const Z1=["data-reveal"],G1={class:"va-traj__panel"},X1={class:"va-traj__bar"},Y1={class:"va-traj__chip"},Q1={class:"va-traj__chip"},e0={class:"va-traj__chip"},t0={class:"va-traj__chip"},n0={class:"va-traj__search"},s0={class:"va-traj__lanes"},o0={class:"va-traj__lane-label"},a0={class:"va-traj__track"},i0=["data-lane","data-shown","title"],l0={key:0,class:"va-traj__empty"},r0=["data-id","data-shown","title","data-open","data-selected","onClick","onKeydown"],c0={class:"va-traj__rail"},u0={key:0,class:"va-traj__turn"},d0=["data-role"],f0=["data-tool"],p0={class:"va-traj__toolname"},v0={key:0,class:"va-traj__detail"},h0={class:"va-traj__detail-head"},m0=["data-role"],_0={class:"va-traj__detail-meta"},g0={class:"va-traj__detail-title"},y0={key:0},b0={key:1},k0={key:2,class:"va-traj__detail-none"},Li=we({__name:"VaTrajectory",props:{events:{type:Array,required:!0},ledgerMaxHeight:{type:Number,default:void 0},bordered:{type:Boolean,default:!0},splitDetail:{type:Boolean,default:!1}},emits:["toggle","select"],setup(e,{emit:t}){const n=e,s=t,o=E(()=>n.events[0]?.at??0),a=E(()=>{const U=n.events.at(-1);return U?Math.max(U.endAt??U.at,n.events[0]?.at??0):0}),i=E(()=>Math.max(a.value-o.value,1)),l=E(()=>({durationMs:Math.max(a.value-o.value,0),turns:new Set(n.events.map(U=>U.turn)).size,calls:n.events.filter(U=>U.lane==="tool").length,subcalls:0})),r=U=>U<1e3?`${U}ms`:`${(U/1e3).toFixed(1)}s`,c=[{key:"input",label:"输入"},{key:"model",label:"模型"},{key:"tool",label:"工具"}],u=U=>n.events.filter(ne=>ne.lane===U);function d(U){const ne=(U.at-o.value)/i.value*100;return{left:`${Math.min(Math.max(ne,0),99)}%`}}const _=P(""),h=P(new Set);function g(U){const ne=!h.value.has(U),ie=new Set(h.value);ne?ie.add(U):ie.delete(U),h.value=ie,s("toggle",U,ne)}const m=P(null),b=E(()=>n.events.find(U=>U.id===m.value)??null);function w(U){m.value=m.value===U?null:U,s("select",m.value)}function x(){m.value=null,s("select",null)}function k(U){n.splitDetail?w(U.id):g(U.id)}const C=E(()=>{const U=_.value.trim().toLowerCase();return U?n.events.filter(ne=>ne.title.toLowerCase().includes(U)||(ne.detail??"").toLowerCase().includes(U)||(ne.result??"").toLowerCase().includes(U)):n.events}),D=E(()=>{const U=new Set,ne=new Set;for(const ie of C.value)U.has(ie.turn)||(U.add(ie.turn),ne.add(ie.id));return ne}),I=U=>new Date(U).toLocaleTimeString("zh-CN",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),L=P(null),{active:K,rowVisible:X,blocksVisible:oe}=J1(L,C),Y={user:"用户",assistant:"助手",tool:"工具",system:"系统",context:"上下文"};function N(U){if(U.lane==="tool"){const ne=U.detail&&U.detail.length>240?`${U.detail.slice(0,240)}…`:U.detail??"",ie=U.result&&U.result.length>240?`${U.result.slice(0,240)}…`:U.result??"";return ne?`${ne} → ${ie}`:ie}return U.title}return(U,ne)=>(v(),y("div",{ref_key:"rootEl",ref:L,class:_e(["va-traj",{"va-traj--plain":n.bordered===!1,"va-traj--split":n.splitDetail}]),"data-reveal":p(K)?"on":void 0},[f("div",G1,[f("div",X1,[f("span",Y1,[O(p(jg),{size:12,"aria-hidden":"true"}),de("时长 "+$(r(l.value.durationMs)),1)]),f("span",Q1,[O(p(qg),{size:12,"aria-hidden":"true"}),de("轮次 "+$(l.value.turns),1)]),f("span",e0,[O(p(Jg),{size:12,"aria-hidden":"true"}),de("调用 "+$(l.value.calls),1)]),f("span",t0,[O(p(Ug),{size:12,"aria-hidden":"true"}),de("子调用 "+$(l.value.subcalls),1)]),ne[1]||(ne[1]=f("span",{class:"va-traj__spacer"},null,-1)),f("label",n0,[O(p($d),{size:13,"aria-hidden":"true"}),ze(f("input",{"onUpdate:modelValue":ne[0]||(ne[0]=ie=>_.value=ie),type:"text",placeholder:"搜索","aria-label":"搜索轨迹事件"},null,512),[[Ze,_.value]])])]),f("div",s0,[(v(),y(J,null,ve(c,ie=>f("div",{key:ie.key,class:"va-traj__lane"},[f("span",o0,$(ie.label),1),f("div",a0,[(v(!0),y(J,null,ve(u(ie.key),ae=>(v(),y("span",{key:ae.id,class:"va-traj__block","data-lane":ie.key,"data-shown":p(oe)?"true":void 0,style:Fe(d(ae)),title:`${I(ae.at)} ${ae.title}`},null,12,i0))),128))])])),64))]),f("div",{class:"va-traj__ledger",style:Fe(n.ledgerMaxHeight?{maxHeight:`${n.ledgerMaxHeight}px`}:void 0)},[C.value.length?R("",!0):(v(),y("p",l0,$(n.events.length?"没有匹配的事件。":"还没有轨迹。发一条任务,这里会按轮记录全部事件。"),1)),(v(!0),y(J,null,ve(C.value,ie=>(v(),y("div",{key:ie.id,class:"va-traj__row","data-id":ie.id,"data-shown":p(X)(ie.id)?"true":void 0,title:`${I(ie.at)}${ie.endAt?` · ${r(ie.endAt-ie.at)}`:""}`,"data-open":!n.splitDetail&&h.value.has(ie.id)||void 0,"data-selected":n.splitDetail&&m.value===ie.id||void 0,role:"button",tabindex:"0",onClick:ae=>k(ie),onKeydown:at(Se(ae=>k(ie),["prevent"]),["enter"])},[f("span",c0,[D.value.has(ie.id)?(v(),y("span",u0,"第"+$(ie.turn)+"轮",1)):R("",!0),ne[2]||(ne[2]=f("i",{class:"va-traj__dot","aria-hidden":"true"},null,-1))]),f("span",{class:"va-traj__role","data-role":ie.role},$(Y[ie.role]??ie.role),9,d0),f("span",{class:"va-traj__content","data-tool":ie.lane==="tool"||void 0},[ie.lane==="tool"?(v(),y(J,{key:0},[f("b",p0,$(ie.title),1),de(" "+$(N(ie)),1)],64)):(v(),y(J,{key:1},[de($(ie.title),1)],64))],8,f0)],40,r0))),128))],4)]),n.splitDetail&&b.value?(v(),y("aside",v0,[f("header",h0,[f("span",{class:"va-traj__role","data-role":b.value.role},$(Y[b.value.role]??b.value.role),9,m0),f("span",_0,[de($(I(b.value.at)),1),b.value.endAt?(v(),y(J,{key:0},[de(" · "+$(r(b.value.endAt-b.value.at)),1)],64)):R("",!0),de(" · 第"+$(b.value.turn)+"轮 ",1)]),f("button",{class:"va-traj__detail-close",type:"button",title:"关闭详情","aria-label":"关闭详情",onClick:x},[O(p(Mn),{size:14})])]),f("div",g0,$(b.value.title),1),b.value.detail?(v(),y("section",y0,[ne[3]||(ne[3]=f("h4",null,"输入 / 参数",-1)),f("pre",null,$(b.value.detail),1)])):R("",!0),b.value.result?(v(),y("section",b0,[ne[4]||(ne[4]=f("h4",null,"结果 / 输出",-1)),f("pre",null,$(b.value.result),1)])):R("",!0),!b.value.detail&&!b.value.result?(v(),y("p",k0," 该事件没有更多详情 ")):R("",!0)])):R("",!0)],10,Z1))}}),w0={class:"va-hero va-enter-up"},x0={class:"va-hero__badge","aria-hidden":"true"},C0={class:"va-hero__title"},$0={class:"va-hero__desc"},A0={class:"va-hero__cards"},D0=["disabled","title","onClick"],R0={class:"va-hero__card-name"},S0={key:0,class:"va-hero__card-path"},E0=["disabled"],T0=we({__name:"VaEmptyHero",props:{workspaces:{default:()=>[]},creating:{type:Boolean,default:!1},title:{default:"开始一个任务"},description:{default:"选择一个工作区开启会话;agent 的文件读写都限定在其目录内。"}},emits:["createWorkspace","createSession"],setup(e,{emit:t}){const n=e,s=t;return(o,a)=>(v(),y("div",w0,[f("div",x0,[je(o.$slots,"icon",{},()=>[O(p(Kg),{size:20,class:"va-hero__icon"})])]),f("h3",C0,$(n.title),1),f("p",$0,$(n.description),1),f("div",A0,[(v(!0),y(J,null,ve(n.workspaces,i=>(v(),y("button",{key:i.id,class:"va-hero__card",type:"button",disabled:n.creating,title:i.path||i.name,onClick:l=>s("createSession",i.id)},[O(p(Cd),{size:18,"aria-hidden":"true"}),f("span",R0,$(i.name),1),i.path?(v(),y("span",S0,$(i.path),1)):R("",!0)],8,D0))),128)),f("button",{class:"va-hero__card va-hero__card--new",type:"button",disabled:n.creating,onClick:a[0]||(a[0]=i=>s("createWorkspace"))},[O(p(No),{size:18,"aria-hidden":"true"}),a[1]||(a[1]=f("span",{class:"va-hero__card-name"},"新建工作区",-1)),a[2]||(a[2]=f("span",{class:"va-hero__card-path"},"弹出系统文件夹选择框",-1))],8,E0)])]))}}),M0=["data-hover-ops"],F0=["disabled","title"],I0={key:0,class:"va-stree__ws-create"},P0=["onKeydown"],B0=["disabled"],L0={key:2,class:"va-stree__search"},O0=["data-current"],z0={class:"va-stree__head"},j0=["aria-label","onClick"],N0=["title"],U0={class:"va-stree__ws-icon","aria-hidden":"true"},W0={class:"va-stree__ws-name"},V0={class:"va-stree__count"},q0={key:0,class:"va-stree__tag"},H0=["disabled","onClick"],K0=["data-danger","aria-label","disabled","onClick"],J0={key:0,class:"va-stree__confirm"},Z0={key:0,class:"va-stree__list"},G0={class:"va-stree__list-clip"},X0=["data-active"],Y0=["onKeydown"],Q0=["title","onClick"],ey={key:0,class:"va-stree__dot va-stree__dot--warn","aria-hidden":"true"},ty={key:1,class:"va-stree__dot va-stree__dot--run","aria-hidden":"true"},ny={class:"va-stree__session-title"},sy={key:3,class:"va-stree__warn-tag"},oy={class:"va-stree__time"},ay=["aria-label","disabled","onClick"],iy=["disabled","onClick"],ly=["disabled","onClick"],ry=["data-danger","aria-label","disabled","onClick"],cy={key:0,class:"va-stree__confirm"},uy={key:0,class:"va-stree__empty va-fade-in"},dy={key:3,class:"va-stree__empty va-stree__search-empty va-fade-in"},fy={key:4,class:"va-stree__group"},py={class:"va-stree__head"},vy={class:"va-stree__ws"},hy={class:"va-stree__count"},my={class:"va-stree__list"},_y={class:"va-stree__list-clip"},gy=["data-active"],yy=["onKeydown"],by=["title","onClick"],ky={key:0,class:"va-stree__dot va-stree__dot--warn","aria-hidden":"true"},wy={key:1,class:"va-stree__dot va-stree__dot--run","aria-hidden":"true"},xy={class:"va-stree__session-title"},Cy={key:3,class:"va-stree__warn-tag"},$y={class:"va-stree__time"},Ay=["aria-label","disabled","onClick"],Dy=["disabled","onClick"],Ry=["disabled","onClick"],Sy=["data-danger","aria-label","disabled","onClick"],Ey={key:0,class:"va-stree__confirm"},Ty={key:5,class:"va-stree__archived"},My={key:0,class:"va-stree__list"},Fy={class:"va-stree__list-clip"},Iy={class:"va-stree__session-main va-stree__session-main--static"},Py={class:"va-stree__session-title"},By={class:"va-stree__time"},Ly=["disabled","onClick"],Oy=["data-danger","aria-label","disabled","onClick"],zy={key:0,class:"va-stree__confirm"},jy={key:6,class:"va-stree__footer"},Ny=we({__name:"VaSessionTree",props:{workspaces:{},sessions:{},archived:{},currentWorkspaceId:{},currentSessionId:{},disabled:{type:Boolean,default:!1},workspaceCreateMode:{default:"input"},newSession:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!1},hoverOps:{type:Boolean,default:!1},confirmMode:{default:"inline"}},emits:["createWorkspace","createWorkspacePick","selectSession","createSession","removeWorkspace","togglePin","rename","archive","remove"],setup(e,{emit:t}){const n=e,s=t,o=Ft(new Set);$e(()=>n.workspaces.map(B=>B.id).join(","),B=>{if(n.collapsible)for(const H of B.split(","))H&&o.add(H)},{immediate:!0});function a(B){o.has(B)?o.delete(B):o.add(B)}const i=B=>!n.collapsible||o.has(B);function l(){n.disabled||!n.currentWorkspaceId||s("createSession",n.currentWorkspaceId)}const r=P(""),c=B=>!r.value.trim()||(B.title||"未命名会话").toLowerCase().includes(r.value.trim().toLowerCase()),u=E(()=>r.value.trim().length>0),d=P(!1),_=P("");function h(){if(!n.disabled){if(n.workspaceCreateMode==="picker"){s("createWorkspacePick");return}d.value=!0,_.value=""}}function g(){const B=_.value.trim();B&&s("createWorkspace",B),d.value=!1}function m(){d.value=!1}const b=P(null),w=P("");function x(B){n.disabled||(b.value=B.id,w.value=B.title||"未命名会话")}function k(){if(b.value){const B=w.value.trim(),H=[...n.sessions,...n.archived].find(W=>W.id===b.value)?.title??"";B&&B!==H&&s("rename",b.value,B)}b.value=null}function C(){b.value=null}const D=P(null);let I;function L(B,H,W,G){if(n.confirmMode==="none"){G();return}B===W?(G(),H(null)):(H(W),window.clearTimeout(I),I=window.setTimeout(()=>H(null),3e3))}function K(B){n.disabled||L(D.value,H=>D.value=H,B,()=>s("remove",B))}const X=P(null);function oe(B){n.disabled||L(X.value,H=>X.value=H,B,()=>s("removeWorkspace",B))}const Y=E(()=>n.workspaces.map(B=>({workspace:B,sessions:n.sessions.filter(H=>(H.workspaceId??"")===B.id&&c(H))}))),N=E(()=>n.sessions.filter(B=>!U(B)&&c(B)));function U(B){return n.workspaces.some(H=>H.id===(B.workspaceId??""))}const ne=P(!1),ie=B=>B.title||"未命名会话";function ae(B){const H=Date.now()-B;return H<6e4?"刚刚":H<36e5?`${Math.floor(H/6e4)} 分钟前`:H<864e5?`${Math.floor(H/36e5)} 小时前`:H<7*864e5?`${Math.floor(H/864e5)} 天前`:new Date(B).toLocaleDateString("zh-CN")}function pe(B){n.disabled||B.id!==n.currentSessionId&&s("selectSession",B.id)}function ue(B){n.disabled||s("createSession",B)}return(B,H)=>(v(),y("div",{class:"va-stree","data-hover-ops":n.hoverOps||void 0},[n.newSession?(v(),y("button",{key:0,class:"va-stree__new-session",type:"button",disabled:n.disabled||!n.currentWorkspaceId,title:n.currentWorkspaceId?`在「${n.workspaces.find(W=>W.id===n.currentWorkspaceId)?.name??""}」新建会话`:"先选择或新建工作区",onClick:l},[O(p(No),{size:15,"aria-hidden":"true"}),H[5]||(H[5]=de("新建会话",-1))],8,F0)):R("",!0),O(Xn,{name:"va-stree-pop"},{default:ye(()=>[d.value?(v(),y("div",I0,[ze(f("input",{"onUpdate:modelValue":H[0]||(H[0]=W=>_.value=W),class:"va-stree__input",type:"text",placeholder:"本地文件夹路径,如 ~/code/my-proj",maxlength:"60",onKeydown:[at(Se(g,["prevent"]),["enter"]),at(Se(m,["prevent"]),["escape"])]},null,40,P0),[[Ze,_.value]]),f("button",{class:"va-stree__op",type:"button","aria-label":"确认创建",onClick:g},[O(p(js),{size:14})]),f("button",{class:"va-stree__op",type:"button","aria-label":"取消",onClick:m},[O(p(Mn),{size:14})])])):R("",!0)]),_:1}),d.value?R("",!0):(v(),y("button",{key:1,class:"va-stree__new",type:"button",disabled:n.disabled,onClick:h},[O(p(No),{size:15,"aria-hidden":"true"}),H[6]||(H[6]=de("新建工作区",-1))],8,B0)),n.searchable?(v(),y("label",L0,[O(p($d),{size:13,"aria-hidden":"true"}),ze(f("input",{"onUpdate:modelValue":H[1]||(H[1]=W=>r.value=W),type:"text",placeholder:"搜索会话","aria-label":"搜索会话"},null,512),[[Ze,r.value]])])):R("",!0),(v(!0),y(J,null,ve(Y.value,W=>(v(),y("section",{key:W.workspace.id,class:"va-stree__group","data-current":W.workspace.id===n.currentWorkspaceId||void 0},[f("div",z0,[n.collapsible?(v(),y("button",{key:0,class:"va-stree__toggle",type:"button","aria-label":i(W.workspace.id)?`收起 ${W.workspace.name} 的会话`:`展开 ${W.workspace.name} 的会话`,onClick:Se(G=>a(W.workspace.id),["stop"])},[i(W.workspace.id)?(v(),le(p(Qn),{key:0,size:13,"aria-hidden":"true"})):(v(),le(p(Or),{key:1,size:13,"aria-hidden":"true"}))],8,j0)):R("",!0),f("span",{class:"va-stree__ws",title:W.workspace.description||W.workspace.name},[f("span",U0,[O(p(Cd),{size:14})]),f("span",W0,$(W.workspace.name),1),f("span",V0,$(W.sessions.length),1),W.workspace.id===n.currentWorkspaceId?(v(),y("span",q0,"当前")):R("",!0)],8,N0),f("button",{class:"va-stree__op",type:"button","aria-label":"在此工作区新建会话",disabled:n.disabled,onClick:Se(G=>ue(W.workspace.id),["stop"])},[O(p(No),{size:14})],8,H0),f("button",{class:"va-stree__op",type:"button","data-danger":X.value===W.workspace.id||void 0,"aria-label":X.value===W.workspace.id?"确认删除工作区":"删除工作区",disabled:n.disabled,onClick:Se(G=>oe(W.workspace.id),["stop"])},[X.value===W.workspace.id?(v(),y("span",J0,"确认?")):(v(),le(p(To),{key:1,size:13}))],8,K0)]),O(Xn,{name:"va-stree-fold"},{default:ye(()=>[i(W.workspace.id)?(v(),y("div",Z0,[f("div",G0,[(v(!0),y(J,null,ve(W.sessions,G=>(v(),y("div",{key:G.id,class:"va-stree__session","data-active":G.id===n.currentSessionId||void 0},[b.value===G.id?(v(),y(J,{key:0},[ze(f("input",{"onUpdate:modelValue":H[2]||(H[2]=xe=>w.value=xe),class:"va-stree__input",type:"text",onKeydown:[at(Se(k,["prevent"]),["enter"]),at(Se(C,["prevent"]),["escape"])]},null,40,Y0),[[Ze,w.value]]),f("button",{class:"va-stree__op",type:"button","aria-label":"确认重命名",onClick:k},[O(p(js),{size:14})]),f("button",{class:"va-stree__op",type:"button","aria-label":"取消",onClick:C},[O(p(Mn),{size:14})])],64)):(v(),y(J,{key:1},[f("button",{class:"va-stree__session-main",type:"button",title:ie(G),onClick:xe=>pe(G)},[G.waitingApproval?(v(),y("span",ey)):G.running?(v(),y("span",ty)):G.pinned?(v(),le(p(Eo),{key:2,class:"va-stree__pin",size:11,"aria-hidden":"true"})):R("",!0),f("span",ny,$(ie(G)),1),G.waitingApproval?(v(),y("span",sy,"待审批")):R("",!0),f("span",oy,$(ae(G.updatedAt)),1)],8,Q0),f("button",{class:"va-stree__op",type:"button","aria-label":G.pinned?"取消置顶":"置顶",disabled:n.disabled,onClick:Se(xe=>s("togglePin",G.id),["stop"])},[G.pinned?(v(),le(p(zr),{key:0,size:13})):(v(),le(p(Eo),{key:1,size:13}))],8,ay),f("button",{class:"va-stree__op",type:"button","aria-label":"重命名",disabled:n.disabled,onClick:Se(xe=>x(G),["stop"])},[O(p(Bi),{size:13})],8,iy),f("button",{class:"va-stree__op",type:"button","aria-label":"归档",disabled:n.disabled,onClick:Se(xe=>s("archive",G.id,!0),["stop"])},[O(p(Lr),{size:13})],8,ly),f("button",{class:"va-stree__op",type:"button","data-danger":D.value===G.id||void 0,"aria-label":D.value===G.id?"确认删除":"删除",disabled:n.disabled,onClick:Se(xe=>K(G.id),["stop"])},[D.value===G.id?(v(),y("span",cy,"确认?")):(v(),le(p(To),{key:1,size:13}))],8,ry)],64))],8,X0))),128)),W.sessions.length===0?(v(),y("p",uy,$(u.value?"无匹配会话":"暂无会话"),1)):R("",!0)])])):R("",!0)]),_:2},1024)],8,O0))),128)),u.value&&Y.value.every(W=>W.sessions.length===0)&&N.value.length===0?(v(),y("p",dy," 没有匹配「"+$(r.value.trim())+"」的会话 ",1)):R("",!0),N.value.length?(v(),y("section",fy,[f("div",py,[f("span",vy,[H[7]||(H[7]=f("span",{class:"va-stree__ws-name"},"未分组",-1)),f("span",hy,$(N.value.length),1)])]),f("div",my,[f("div",_y,[(v(!0),y(J,null,ve(N.value,W=>(v(),y("div",{key:W.id,class:"va-stree__session","data-active":W.id===n.currentSessionId||void 0},[b.value===W.id?(v(),y(J,{key:0},[ze(f("input",{"onUpdate:modelValue":H[3]||(H[3]=G=>w.value=G),class:"va-stree__input",type:"text",onKeydown:[at(Se(k,["prevent"]),["enter"]),at(Se(C,["prevent"]),["escape"])]},null,40,yy),[[Ze,w.value]]),f("button",{class:"va-stree__op",type:"button","aria-label":"确认重命名",onClick:k},[O(p(js),{size:14})]),f("button",{class:"va-stree__op",type:"button","aria-label":"取消",onClick:C},[O(p(Mn),{size:14})])],64)):(v(),y(J,{key:1},[f("button",{class:"va-stree__session-main",type:"button",title:ie(W),onClick:G=>pe(W)},[W.waitingApproval?(v(),y("span",ky)):W.running?(v(),y("span",wy)):W.pinned?(v(),le(p(Eo),{key:2,class:"va-stree__pin",size:11,"aria-hidden":"true"})):R("",!0),f("span",xy,$(ie(W)),1),W.waitingApproval?(v(),y("span",Cy,"待审批")):R("",!0),f("span",$y,$(ae(W.updatedAt)),1)],8,by),f("button",{class:"va-stree__op",type:"button","aria-label":W.pinned?"取消置顶":"置顶",disabled:n.disabled,onClick:Se(G=>s("togglePin",W.id),["stop"])},[W.pinned?(v(),le(p(zr),{key:0,size:13})):(v(),le(p(Eo),{key:1,size:13}))],8,Ay),f("button",{class:"va-stree__op",type:"button","aria-label":"重命名",disabled:n.disabled,onClick:Se(G=>x(W),["stop"])},[O(p(Bi),{size:13})],8,Dy),f("button",{class:"va-stree__op",type:"button","aria-label":"归档",disabled:n.disabled,onClick:Se(G=>s("archive",W.id,!0),["stop"])},[O(p(Lr),{size:13})],8,Ry),f("button",{class:"va-stree__op",type:"button","data-danger":D.value===W.id||void 0,"aria-label":D.value===W.id?"确认删除":"删除",disabled:n.disabled,onClick:Se(G=>K(W.id),["stop"])},[D.value===W.id?(v(),y("span",Ey,"确认?")):(v(),le(p(To),{key:1,size:13}))],8,Sy)],64))],8,gy))),128))])])])):R("",!0),n.archived.length&&!u.value?(v(),y("div",Ty,[f("button",{class:"va-stree__archived-toggle",type:"button",onClick:H[4]||(H[4]=W=>ne.value=!ne.value)},[de(" 已归档("+$(n.archived.length)+") ",1),ne.value?(v(),le(p(Qn),{key:0,size:14,"aria-hidden":"true"})):(v(),le(p(Or),{key:1,size:14,"aria-hidden":"true"}))]),O(Xn,{name:"va-stree-fold"},{default:ye(()=>[ne.value?(v(),y("div",My,[f("div",Fy,[(v(!0),y(J,null,ve(n.archived,W=>(v(),y("div",{key:W.id,class:"va-stree__session","data-archived":"true"},[f("span",Iy,[f("span",Py,$(ie(W)),1),f("span",By,$(ae(W.updatedAt)),1)]),f("button",{class:"va-stree__op",type:"button","aria-label":"恢复",disabled:n.disabled,onClick:Se(G=>s("archive",W.id,!1),["stop"])},[O(p(Bg),{size:13})],8,Ly),f("button",{class:"va-stree__op",type:"button","data-danger":D.value===W.id||void 0,"aria-label":D.value===W.id?"确认删除":"删除",disabled:n.disabled,onClick:Se(G=>K(W.id),["stop"])},[D.value===W.id?(v(),y("span",zy,"确认?")):(v(),le(p(To),{key:1,size:13}))],8,Oy)]))),128))])])):R("",!0)]),_:1})])):R("",!0),B.$slots.footer?(v(),y("footer",jy,[je(B.$slots,"footer")])):R("",!0)],8,M0))}}),Uy=["不够准确","太啰嗦","没听懂指令"];function _l(e,t){const n=P(!1);let s;async function o(){const a=e();try{if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(a);else if(typeof document<"u"){const i=document.createElement("textarea");i.value=a,document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove()}}catch{}n.value=!0,t?.(a),s!==void 0&&window.clearTimeout(s),s=window.setTimeout(()=>n.value=!1,1500)}return tt(()=>{s!==void 0&&window.clearTimeout(s)}),{copied:n,copy:o}}function Wy(e,t,n){const{copied:s,copy:o}=_l(()=>e.text??"",b=>n.copy(b)),a=P(null),i=P(!1),l=E(()=>e.reasons??Uy),r=P("");function c(b){if(b==="up"){a.value=a.value==="up"?null:"up",i.value=!1,n.feedback(a.value);return}if(i.value){i.value=!1;return}a.value="down",i.value=!0,r.value=""}function u(b){a.value="down",i.value=!1,n.feedback("down",b||void 0)}function d(){a.value=null,i.value=!1,n.feedback(null)}const _=E(()=>typeof e.versions=="number"?Math.max(1,e.versions):1),h=E(()=>_.value>=2),g=E(()=>{const b=t.value;return b==null||b<0||b>=_.value?_.value-1:b});function m(b){const w=Math.min(_.value-1,Math.max(0,g.value+b));t.value=w,n.versionChange(w)}return{copied:s,copy:o,chosen:a,panelOpen:i,reasons:l,customReason:r,thumb:c,sendDown:u,takeBack:d,count:_,effective:g,showVersions:h,go:m}}const Vy={class:"va-msg__bar"},qy=["aria-label"],Hy=["aria-label"],Ky={key:0,class:"va-msg__versions"},Jy=["disabled"],Zy={class:"va-msg__ver-label"},Gy=["disabled"],Xy=["aria-pressed"],Yy=["aria-pressed"],Qy={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",style:{transform:"rotate(180deg)"}},eb={key:0,class:"va-msg__panel"},tb={class:"va-msg__reasons"},nb=["onClick"],sb={class:"va-msg__other"},ob=["disabled"],ab=we({__name:"VaMessageActions",props:ds({text:{default:void 0},versions:{default:void 0},regenerating:{type:Boolean,default:!1},quiet:{type:Boolean,default:!1},reasons:{default:void 0}},{version:{},versionModifiers:{}}),emits:ds(["copy","regenerate","versionChange","feedback"],["update:version"]),setup(e,{emit:t}){const n=e,s=t,o=wa(e,"version"),{copied:a,copy:i,chosen:l,panelOpen:r,reasons:c,customReason:u,thumb:d,sendDown:_,takeBack:h,count:g,effective:m,showVersions:b,go:w}=Wy(n,o,{copy:x=>s("copy",x),regenerate:()=>s("regenerate"),versionChange:x=>s("versionChange",x),feedback:(x,k)=>s("feedback",x,k)});return(x,k)=>(v(),y("div",{class:_e(["va-msg",{"va-msg--quiet":n.quiet,"va-msg--panel":p(r)}])},[f("div",Vy,[f("button",{class:"va-msg__act",type:"button","aria-label":p(a)?"已复制":"复制",onClick:k[0]||(k[0]=(...C)=>p(i)&&p(i)(...C))},[f("span",{class:_e(["va-copy",{"va-copy--done":p(a)}]),"aria-hidden":"true"},[...k[10]||(k[10]=[f("svg",{class:"va-copy__idle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round"},[f("path",{d:"M9 9.5A1.5 1.5 0 0 1 10.5 8h8A1.5 1.5 0 0 1 20 9.5v9a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 9 18.5zM15 8V5.5A1.5 1.5 0 0 0 13.5 4h-8A1.5 1.5 0 0 0 4 5.5v9A1.5 1.5 0 0 0 5.5 16H9"})],-1),f("svg",{class:"va-copy__done",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},[f("path",{d:"M5.5 12.5l4 4L18.5 8"})],-1)])],2)],8,qy),f("button",{class:"va-msg__act",type:"button","aria-label":n.regenerating?"再生成中":"再生成",onClick:k[1]||(k[1]=C=>s("regenerate"))},[(v(),y("svg",{class:_e({"va-msg__spin":n.regenerating}),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...k[11]||(k[11]=[f("path",{d:"M19.5 12a7.5 7.5 0 1 1-2.2-5.3L19.5 9M19.5 4.5V9H15"},null,-1)])],2))],8,Hy),p(b)?(v(),y("span",Ky,[f("button",{class:"va-msg__act",type:"button","aria-label":"上一版本",disabled:p(m)<=0,onClick:k[2]||(k[2]=C=>p(w)(-1))},[...k[12]||(k[12]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m14.5 7-5 5 5 5"})],-1)])],8,Jy),f("span",Zy,$(p(m)+1)+" / "+$(p(g)),1),f("button",{class:"va-msg__act",type:"button","aria-label":"下一版本",disabled:p(m)>=p(g)-1,onClick:k[3]||(k[3]=C=>p(w)(1))},[...k[13]||(k[13]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[f("path",{d:"m9.5 7 5 5-5 5"})],-1)])],8,Gy)])):R("",!0),k[16]||(k[16]=f("span",{class:"va-msg__sep","aria-hidden":"true"},null,-1)),f("button",{class:_e(["va-msg__act",{"va-msg__act--on":p(l)==="up"}]),type:"button","aria-label":"赞","aria-pressed":p(l)==="up",onClick:k[4]||(k[4]=C=>p(d)("up"))},[...k[14]||(k[14]=[f("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[f("path",{d:"M7.5 10.5v9M7.5 10.5l3.3-6a1.8 1.8 0 0 1 3.3 1.2l-.6 3.8H18a2 2 0 0 1 2 2.3l-1.2 6.4a2 2 0 0 1-2 1.8H5a1 1 0 0 1-1-1v-7.5a1 1 0 0 1 1-1z"})],-1)])],10,Xy),f("button",{class:_e(["va-msg__act",{"va-msg__act--on":p(l)==="down"}]),type:"button","aria-label":"踩","aria-pressed":p(l)==="down",onClick:k[5]||(k[5]=C=>p(d)("down"))},[(v(),y("svg",Qy,[...k[15]||(k[15]=[f("path",{d:"M7.5 10.5v9M7.5 10.5l3.3-6a1.8 1.8 0 0 1 3.3 1.2l-.6 3.8H18a2 2 0 0 1 2 2.3l-1.2 6.4a2 2 0 0 1-2 1.8H5a1 1 0 0 1-1-1v-7.5a1 1 0 0 1 1-1z"},null,-1)])]))],10,Yy)]),O(Xn,{name:"va-msg-panel"},{default:ye(()=>[p(r)?(v(),y("div",eb,[k[17]||(k[17]=f("p",{class:"va-msg__panel-title"},"哪里不满意?",-1)),f("div",tb,[(v(!0),y(J,null,ve(p(c),C=>(v(),y("button",{key:C,class:"va-msg__reason",type:"button",onClick:D=>p(_)(C)},$(C),9,nb))),128))]),f("div",sb,[ze(f("input",{"onUpdate:modelValue":k[6]||(k[6]=C=>et(u)?u.value=C:null),class:"va-msg__other-input",type:"text",placeholder:"其他原因…",onKeydown:k[7]||(k[7]=at(C=>p(_)(p(u)),["enter"]))},null,544),[[Ze,p(u)]]),f("button",{class:"va-msg__reason va-msg__reason--go",type:"button",disabled:!p(u).trim(),onClick:k[8]||(k[8]=C=>p(_)(p(u)))},"发送",8,ob),f("button",{class:"va-msg__reason",type:"button",onClick:k[9]||(k[9]=(...C)=>p(h)&&p(h)(...C))},"撤回反馈")])])):R("",!0)]),_:1})],2))}});function ib(e,t,n){const s=P({left:0,width:0}),o=E(()=>Math.max(0,e.options.findIndex(c=>c.value===t.value)));function a(){const c=n.value;if(!c||typeof window>"u")return;const u=c.querySelector(`[data-idx="${o.value}"]`);u&&(s.value={left:u.offsetLeft,width:u.offsetWidth})}function i(){a()}$e(()=>[e.options,t.value],()=>{Ge(a)},{deep:!1}),it(()=>{Ge(a),typeof window<"u"&&window.addEventListener("resize",i)}),tt(()=>{typeof window<"u"&&window.removeEventListener("resize",i)});function l(c){t.value=c}function r(c){const u=e.options,d=o.value,_=c.key==="ArrowRight"||c.key==="ArrowDown"?1:c.key==="ArrowLeft"||c.key==="ArrowUp"?-1:0;if(_===0&&c.key!=="Home"&&c.key!=="End")return;let h=c.key==="Home"?0:c.key==="End"?u.length-1:(d+_+u.length)%u.length,g=u.length;for(;u[h]?.disabled&&g-- >0;)h=(h+_+u.length)%u.length;const m=u[h];!m||m.disabled||(c.preventDefault(),t.value=m.value,n.value?.querySelector(`[data-idx="${h}"]`)?.focus())}return{indicator:s,activeIdx:o,select:l,onKeydown:r}}const lb=["aria-label"],rb=["data-idx","data-active","aria-checked","tabindex","disabled","onClick"],Dd=we({__name:"VaSegmentedControl",props:ds({options:{},size:{default:"md"},fullWidth:{type:Boolean,default:!1},ariaLabel:{default:void 0}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=wa(e,"modelValue"),s=Xe("root"),{indicator:o,activeIdx:a,select:i,onKeydown:l}=ib(t,n,s);return(r,c)=>(v(),y("div",{ref_key:"root",ref:s,class:_e(["va-seg",[`va-seg--${t.size}`,{"va-seg--full":t.fullWidth}]]),role:"radiogroup","aria-label":t.ariaLabel,onKeydown:c[0]||(c[0]=(...u)=>p(l)&&p(l)(...u))},[f("span",{class:"va-seg__thumb","aria-hidden":"true",style:Fe({transform:`translateX(${p(o).left}px)`,width:`${p(o).width}px`})},null,4),(v(!0),y(J,null,ve(t.options,(u,d)=>(v(),y("button",{key:u.value,class:"va-seg__btn","data-idx":d,"data-active":n.value===u.value||void 0,type:"button",role:"radio","aria-checked":n.value===u.value,tabindex:d===p(a)?0:-1,disabled:u.disabled,onClick:_=>p(i)(u.value)},$(u.label),9,rb))),128))],42,lb))}}),na=Ft({toasts:[]});let cb=0;function Rd(e){const t=na.toasts.findIndex(n=>n.id===e);t>=0&&na.toasts.splice(t,1)}function ub(e){const t={id:++cb,kind:"info",duration:4200,...e};return na.toasts.push(t),t.duration>0&&typeof window<"u"&&window.setTimeout(()=>Rd(t.id),t.duration),t.id}const Ae={state:na,add:ub,dismiss:Rd},db=["data-kind"],fb={class:"va-toast__icon","aria-hidden":"true"},pb={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},vb={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},hb={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},mb={key:3,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},_b={class:"va-toast__body"},gb={class:"va-toast__title"},yb={key:0,class:"va-toast__desc"},bb=["onClick"],kb=we({__name:"VaToaster",props:{position:{default:"bottom-right"}},setup(e){const t=new Map;let n=new Set;return $e(()=>Ae.state.toasts.map(s=>s.id),s=>{let o=0;for(const a of s)n.has(a)||(t.set(a,Math.min(o,8)*40),o++);n=new Set(s);for(const a of[...t.keys()])n.has(a)||t.delete(a)},{immediate:!0}),(s,o)=>(v(),y("div",{class:_e(["va-toast",`va-toast--${e.position}`]),"aria-live":"polite",role:"status"},[O(vs,{name:"va-toast"},{default:ye(()=>[(v(!0),y(J,null,ve(p(Ae).state.toasts,a=>(v(),y("div",{key:a.id,class:"va-toast__item","data-kind":a.kind,style:Fe({"--va-toast-stagger":`${p(t).get(a.id)??0}ms`})},[f("span",fb,[a.kind==="success"?(v(),y("svg",pb,[...o[0]||(o[0]=[f("path",{d:"M5.5 12.5l4 4L18.5 8"},null,-1)])])):a.kind==="danger"?(v(),y("svg",vb,[...o[1]||(o[1]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):a.kind==="warning"?(v(),y("svg",hb,[...o[2]||(o[2]=[f("path",{d:"M12 9v4M12 16.5h.01M10.3 3.9 2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"},null,-1)])])):(v(),y("svg",mb,[...o[3]||(o[3]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 11v5M12 8h.01"},null,-1)])]))]),f("div",_b,[f("p",gb,$(a.title),1),a.description?(v(),y("p",yb,$(a.description),1)):R("",!0)]),f("button",{class:"va-toast__close",type:"button","aria-label":"关闭通知",onClick:i=>p(Ae).dismiss(a.id)},"×",8,bb)],12,db))),128))]),_:1})],2))}});function Nr(e){if(e==="")return[];const t=e.replace(/\r\n?/g,`
3
+ `).split(`
4
+ `);return t[t.length-1]===""&&e.endsWith(`
5
+ `)&&t.pop(),t}const wb=4e6;function xb(e,t){const n=Nr(e),s=Nr(t),o=n.length,a=s.length;if(o*a>wb)return[...n.map((d,_)=>({type:"del",oldNo:_+1,text:d})),...s.map((d,_)=>({type:"add",newNo:_+1,text:d}))];const i=Array.from({length:o+1},()=>new Uint32Array(a+1));for(let d=o-1;d>=0;d--)for(let _=a-1;_>=0;_--)i[d][_]=n[d]===s[_]?i[d+1][_+1]+1:Math.max(i[d+1][_],i[d][_+1]);const l=[];let r=0,c=0;const u=()=>l.push({type:"same",oldNo:r+1,newNo:c+1,text:n[r]});for(;r<o&&c<a;)n[r]===s[c]?(u(),r++,c++):i[r+1][c]>=i[r][c+1]?(l.push({type:"del",oldNo:r+1,text:n[r]}),r++):(l.push({type:"add",newNo:c+1,text:s[c]}),c++);for(;r<o;)l.push({type:"del",oldNo:r+1,text:n[r]}),r++;for(;c<a;)l.push({type:"add",newNo:c+1,text:s[c]}),c++;return l}function Cb(e){const t=[];for(const n of e){const s=n.sp&&t.length>0?" ":"",o=t[t.length-1];o&&o.kind===n.type?o.text+=s+n.t:t.push({kind:n.type,text:s+n.t})}return t}function $b(e,t=!0){const n=new Array(e.length).fill(void 0);if(!t)return n;let s=0;for(;s<e.length;){if(e[s].type!=="del"){s++;continue}const o=s;for(;s<e.length&&e[s].type==="del";)s++;const a=s,i=s;for(;s<e.length&&e[s].type==="add";)s++;const l=s,r=Math.min(a-o,l-i);for(let c=0;c<r;c++){const u=e[o+c].text,d=e[i+c].text;if(u===d)continue;const _=[],h=[];for(const g of Cb(Eg(u,d)))(g.kind==="del"||g.kind==="same")&&_.push({kind:g.kind,text:g.text}),(g.kind==="add"||g.kind==="same")&&h.push({kind:g.kind,text:g.text});n[o+c]={del:_,add:h}}}return n}function Sd(e){return`${e.from}-${e.to}`}function Ab(e,t=3,n,s){const o=new Uint8Array(e.length);e.forEach((l,r)=>{if(l.type!=="same")for(let c=Math.max(0,r-t);c<=Math.min(e.length-1,r+t);c++)o[c]=1});const a=[];let i=0;for(;i<e.length;){if(o[i]){const _=e[i];a.push(_.type==="same"?{kind:"row",row:_}:{kind:"row",row:_,inline:n?.[i]}),i++;continue}const l=i;for(;i<e.length&&!o[i];)i++;const r=e[l].oldNo??e[l].newNo??l+1,c=e[i-1],u=c.oldNo??c.newNo??i,d=Sd({from:r,to:u});if(s?.has(d))for(let _=l;_<i;_++){const h=e[_];a.push(h.type==="same"?{kind:"row",row:h}:{kind:"row",row:h,inline:n?.[_]})}else a.push({kind:"expand",count:i-l,from:r,to:u})}return a}function Db(e){const t=E(()=>e.defaultExpandAll?Number.POSITIVE_INFINITY:e.context??3),n=E(()=>xb(e.oldText,e.newText)),s=E(()=>$b(n.value,e.wordLevel!==!1)),o=E(()=>{let d=0,_=0;for(const h of n.value)h.type==="add"?d++:h.type==="del"&&_++;return{additions:d,deletions:_}}),a=P(new Set);$e([()=>e.oldText,()=>e.newText],()=>{a.value=new Set});const i=E(()=>Ab(n.value,t.value,s.value,a.value)),l=E(()=>i.value.some(d=>d.kind==="expand")),r=P(e.defaultExpandAll??!1);$e(r,d=>{d||(a.value=new Set)});function c(d){const _=new Set(a.value);_.add(Sd(d)),a.value=_}const u=E(()=>n.value.length===0||o.value.additions+o.value.deletions===0);return{render:i,stats:o,hasCollapsed:l,expandAll:r,toggleExpand:c,empty:u,rows:n,inline:s}}const Rb={class:"va-cdiff"},Sb={class:"va-cdiff__head"},Eb={key:0,class:"va-cdiff__file"},Tb={class:"va-cdiff__stats",role:"status"},Mb=["aria-pressed"],Fb=["aria-label"],Ib=["aria-label"],Pb={key:0,class:"va-cdiff__empty"},Bb={key:1,class:"va-cdiff__side"},Lb=["data-type"],Ob={class:"va-cdiff__no","aria-hidden":"true"},zb=["data-side"],jb=["data-kind"],Nb={class:"va-cdiff__no","aria-hidden":"true"},Ub=["data-side"],Wb=["data-kind"],Vb=["data-type"],qb={class:"va-cdiff__no","aria-hidden":"true"},Hb={class:"va-cdiff__no","aria-hidden":"true"},Kb={class:"va-cdiff__sign","aria-hidden":"true"},Jb={class:"va-cdiff__code"},Zb=["data-seg"],Gb=["title","onClick"],Ur=we({__name:"VaCodeDiff",props:{oldText:{},newText:{},fileName:{},context:{},wordLevel:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean},maxHeight:{},layout:{default:"unified"}},emits:["copy"],setup(e,{emit:t}){const n=e,s=t,{render:o,stats:a,hasCollapsed:i,expandAll:l,toggleExpand:r,empty:c,rows:u,inline:d}=Db(n),{copied:_,copy:h}=_l(()=>n.newText,b=>s("copy",b)),g=b=>b==="add"?"+":b==="del"?"−":"",m=E(()=>{if(n.layout!=="side")return[];const b=u.value,w=d.value,x=[];let k=0;const C=(D,I)=>{const L=w[I];return D.type==="del"&&L?{no:D.oldNo,text:D.text,segs:L.del}:D.type==="add"&&L?{no:D.newNo,text:D.text,segs:L.add}:{no:D.oldNo??D.newNo,text:D.text}};for(;k<b.length;){if(b[k].type==="same"){x.push({type:"eq",left:C(b[k],k),right:C(b[k],k)}),k++;continue}const D=k;for(;k<b.length&&b[k].type==="del";)k++;const I=k,L=k;for(;k<b.length&&b[k].type==="add";)k++;const K=k,X=I-D,oe=K-L,Y=Math.max(X,oe);for(let N=0;N<Y;N++){const U=D+N,ne=L+N;x.push({type:U<I&&ne<K?"pair":U<I?"del":"add",left:U<I?C(b[U],U):void 0,right:ne<K?C(b[ne],ne):void 0})}}return x});return(b,w)=>(v(),y("figure",Rb,[f("header",Sb,[n.fileName?(v(),y("span",Eb,$(n.fileName),1)):R("",!0),f("span",Tb,[p(c)?(v(),y(J,{key:1},[de("无变更")],64)):(v(),y(J,{key:0},[de("+"+$(p(a).additions)+" −"+$(p(a).deletions),1)],64))]),w[3]||(w[3]=f("span",{class:"va-cdiff__spacer"},null,-1)),p(i)?(v(),y("button",{key:1,class:"va-act va-act--sm va-cdiff__btn",type:"button","aria-pressed":p(l),onClick:w[0]||(w[0]=x=>l.value=!p(l))},$(p(l)?"折叠上下文":"全部展开"),9,Mb)):R("",!0),f("button",{class:"va-act va-act--sm va-cdiff__btn",type:"button","aria-label":p(_)?"已复制":"复制新文件内容",onClick:w[1]||(w[1]=(...x)=>p(h)&&p(h)(...x))},[f("span",{class:_e(["va-copy",{"va-copy--done":p(_)}]),"aria-hidden":"true"},[...w[2]||(w[2]=[f("span",{class:"va-copy__idle"},"复制新文件",-1),f("span",{class:"va-copy__done"},"已复制 ✓",-1)])],2)],8,Fb)]),f("div",{class:"va-cdiff__body",style:Fe(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0),tabindex:"0",role:"region","aria-label":`代码差异${n.fileName?`:${n.fileName}`:""}`},[p(c)?(v(),y("p",Pb,"两个版本内容一致。")):R("",!0),!p(c)&&n.layout==="side"?(v(),y("div",Bb,[(v(!0),y(J,null,ve(m.value,(x,k)=>(v(),y("div",{key:k,class:"va-cdiff__srow","data-type":x.type},[f("span",Ob,$(x.left?.no??""),1),f("code",{class:"va-cdiff__code va-cdiff__code--half","data-side":x.left?"old":"empty"},[x.left?.segs?(v(!0),y(J,{key:0},ve(x.left.segs,(C,D)=>(v(),y("span",{key:D,class:"va-cdiff__seg","data-kind":C.kind},$(C.text),9,jb))),128)):(v(),y(J,{key:1},[de($(x.left?.text??""),1)],64))],8,zb),f("span",Nb,$(x.right?.no??""),1),f("code",{class:"va-cdiff__code va-cdiff__code--half","data-side":x.right?"new":"empty"},[x.right?.segs?(v(!0),y(J,{key:0},ve(x.right.segs,(C,D)=>(v(),y("span",{key:D,class:"va-cdiff__seg","data-kind":C.kind},$(C.text),9,Wb))),128)):(v(),y(J,{key:1},[de($(x.right?.text??""),1)],64))],8,Ub)],8,Lb))),128))])):R("",!0),!p(c)&&n.layout!=="side"?(v(!0),y(J,{key:2},ve(p(o),(x,k)=>(v(),y(J,{key:k},[x.kind==="row"?(v(),y("div",{key:0,class:"va-cdiff__row","data-type":x.row.type},[f("span",qb,$(x.row.oldNo??""),1),f("span",Hb,$(x.row.newNo??""),1),f("span",Kb,$(g(x.row.type)),1),f("code",Jb,[x.inline?(v(!0),y(J,{key:0},ve(x.row.type==="del"?x.inline.del:x.inline.add,(C,D)=>(v(),y("span",{key:D,class:"va-cdiff__seg","data-seg":C.kind},$(C.text),9,Zb))),128)):(v(),y(J,{key:1},[de($(x.row.text),1)],64))])],8,Vb)):(v(),y("button",{key:1,class:"va-cdiff__expand",type:"button","aria-expanded":!1,title:`展开第 ${x.from}–${x.to} 行`,onClick:C=>p(r)(x)}," ⋯ 展开隐藏的 "+$(x.count)+" 行 ",9,Gb))],64))),128)):R("",!0)],12,Ib)]))}}),Oi={modified:"M",added:"A",deleted:"D",untracked:"U"};function Xb(e,t){const n=[],s=(o,a)=>{for(const i of o){const l=i.type==="dir"||(i.children?.length??0)>0,r=l&&t(i.path);n.push({node:i,level:a,isDir:l,expanded:r}),r&&i.children?.length&&s(i.children,a+1)}};return s(e,1),n}function zi(e){return e.children?.length?e.children.reduce((t,n)=>t+zi(n),0):e.status?1:0}function Yb(e){const t=P(new Set);$e(()=>e.tree,d=>{const _=new Set,h=e.defaultExpandDepth??1,g=(m,b)=>{for(const w of m)w.children?.length&&b<=h&&(_.add(w.path),g(w.children,b+1))};g(d,1),t.value=_},{immediate:!0});function n(d,_){const h=new Set(t.value),g=_??!h.has(d);return g?h.add(d):h.delete(d),t.value=h,g}const s=P(!1),o=P(e.defaultSelected),a=E(()=>e.selected!==void 0||s.value?e.selected:o.value);function i(d){return s.value=!0,o.value=d,d}const l=E(()=>Xb(e.tree,d=>t.value.has(d))),r=P(l.value[0]?.node.path);$e(l,d=>{d.some(_=>_.node.path===r.value)||(r.value=d[0]?.node.path)});function c(d){const _=l.value,h=_.findIndex(m=>m.node.path===r.value),g=_[Math.min(_.length-1,Math.max(0,h+d))];g&&(r.value=g.node.path)}function u(d){return r.value===d}return{expanded:t,toggleDir:n,currentSelected:a,select:i,rows:l,focusedPath:r,moveFocus:c,isActive:u}}const Qb={class:"va-ftree"},ek={key:0,class:"va-ftree__head"},tk=["aria-label"],nk=["aria-level","aria-expanded","aria-selected","data-active","tabindex","onClick","onKeydown"],sk=["data-open"],ok={key:1,class:"va-ftree__dot","aria-hidden":"true"},ak={class:"va-ftree__name"},ik={key:2,class:"va-ftree__count","aria-label":"含变更文件"},lk=["data-status","title"],rk={key:0,class:"va-ftree__empty va-fade-in"},ji=we({__name:"VaFileTree",props:{tree:{},defaultExpandDepth:{},selected:{},defaultSelected:{},title:{},maxHeight:{},lazy:{type:Boolean,default:!1}},emits:["update:selected","select","toggle","load","open"],setup(e,{emit:t}){const n=e,s=t,o={modified:"已修改",added:"新增",deleted:"删除",untracked:"未跟踪"},{toggleDir:a,currentSelected:i,select:l,rows:r,moveFocus:c,isActive:u}=Yb(n),d=P(null);function _(w){n.lazy&&w.isDir&&!w.expanded&&w.node.children===void 0&&s("load",w.node)}function h(w){if(w.isDir){_(w);const x=a(w.node.path);s("toggle",w.node,x);return}s("update:selected",l(w.node.path)),s("select",w.node),s("open",w.node)}function g(){Ge(()=>d.value?.querySelector("[data-active='true']")?.focus())}function m(w,x){switch(w.key){case"ArrowUp":w.preventDefault(),c(-1),g();break;case"ArrowDown":w.preventDefault(),c(1),g();break;case"ArrowRight":x.isDir&&!x.expanded&&(w.preventDefault(),_(x),s("toggle",x.node,a(x.node.path,!0)));break;case"ArrowLeft":if(x.isDir&&x.expanded)w.preventDefault(),s("toggle",x.node,a(x.node.path,!1));else{const k=x.node.path.split("/").slice(0,-1).join("/");k&&(w.preventDefault(),b(k))}break;case"Enter":case" ":w.preventDefault(),h(x);break}}function b(w){const x=r.value.findIndex(k=>k.node.path===w);if(x>=0){const k=r.value.findIndex(C=>u(C.node.path));k>=0&&c(x-k),g()}}return(w,x)=>(v(),y("div",Qb,[n.title?(v(),y("header",ek,$(n.title),1)):R("",!0),f("div",{ref_key:"rootEl",ref:d,class:"va-ftree__body",role:"tree","aria-label":n.title||"文件树",style:Fe(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},[(v(!0),y(J,null,ve(p(r),k=>(v(),y("div",{key:k.node.path,role:"treeitem","aria-level":k.level,"aria-expanded":k.isDir?k.expanded:void 0,"aria-selected":k.isDir?void 0:p(i)===k.node.path,"data-active":p(u)(k.node.path),tabindex:p(u)(k.node.path)?0:-1,class:_e(["va-ftree__row",{"va-ftree__row--dir":k.isDir,"va-ftree__row--selected":!k.isDir&&p(i)===k.node.path}]),style:Fe({paddingLeft:`${(k.level-1)*16+8}px`}),onClick:C=>h(k),onKeydown:C=>m(C,k)},[k.isDir?(v(),y("span",{key:0,class:"va-ftree__caret","aria-hidden":"true","data-open":k.expanded||void 0},[O(p(Qn),{size:12})],8,sk)):(v(),y("span",ok)),f("span",ak,$(k.node.path.split("/").pop()),1),x[0]||(x[0]=f("span",{class:"va-ftree__spacer"},null,-1)),k.isDir&&p(zi)(k.node)?(v(),y("span",ik,$(p(zi)(k.node)),1)):R("",!0),k.node.status?(v(),y("span",{key:3,class:"va-ftree__status","data-status":k.node.status,title:`${p(Oi)[k.node.status]} · ${o[k.node.status]}`},$(p(Oi)[k.node.status]),9,lk)):R("",!0)],46,nk))),128)),p(r).length?R("",!0):(v(),y("p",rk,"没有文件。"))],12,tk)]))}}),Uo=["#4f5b66","#e06c75","#98c379","#e5c07b","#61afef","#c678dd","#56b6c2","#abb2bf","#5c6370","#e06c75","#98c379","#e5c07b","#61afef","#c678dd","#56b6c2","#ffffff"];function ck(e){if(e<16)return Uo[e];if(e<232){const n=e-16,s=[0,95,135,175,215,255],o=s[Math.floor(n/36)%6],a=s[Math.floor(n/6)%6],i=s[n%6];return`rgb(${o}, ${a}, ${i})`}const t=8+(e-232)*10;return`rgb(${t}, ${t}, ${t})`}const Wr=/\x1b\[([0-9;:]*)([A-Za-z])/g,uk=/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g;function dk(e,t){let n=0;for(;n<t.length;){const s=t[n];if(s===0)e.color=e.bgColor=void 0,e.bold=e.dim=e.italic=e.underline=void 0;else if(s===1)e.bold=!0;else if(s===2)e.dim=!0;else if(s===3)e.italic=!0;else if(s===4)e.underline=!0;else if(s===22)e.bold=e.dim=void 0;else if(s===23)e.italic=void 0;else if(s===24)e.underline=void 0;else if(s>=30&&s<=37)e.color=Uo[s-30];else if(s===38||s===48){const o=t[n+1],a=s===38?"color":"bgColor";o===5&&t[n+2]!==void 0?(e[a]=ck(t[n+2]),n+=2):o===2&&t[n+4]!==void 0&&(e[a]=`rgb(${t[n+2]}, ${t[n+3]}, ${t[n+4]})`,n+=4)}else s===39?e.color=void 0:s===49?e.bgColor=void 0:s>=90&&s<=97?e.color=Uo[s-90+8]:s>=100&&s<=107&&(e.bgColor=Uo[s-100+8]);n++}}function Vr(e,t,n){const s=n.color||n.bgColor||n.bold||n.dim||n.italic||n.underline;e.push(s?{text:t,...n}:{text:t})}function fk(e){const t=e.split("\r");let n=t[t.length-1]??"";n=n.replace(uk,"");const s=[],o={};let a="",i=0;Wr.lastIndex=0;for(const l of n.matchAll(Wr)){if(l.index>i&&(a+=n.slice(i,l.index)),i=l.index+l[0].length,l[2]!=="m")continue;a&&(Vr(s,a,o),a="");const r=(l[1]??"").split(";").map(c=>c===""?0:Number.parseInt(c,10));dk(o,r.length?r:[0])}return i<n.length&&(a+=n.slice(i)),a&&Vr(s,a,o),s}function pk(e,t){const n=E(()=>{const c=e.maxLines??1e3,u=e.lines.map((d,_)=>typeof d=="string"?{text:d,id:String(_)}:{id:String(_),...d});return u.length>c?u.slice(u.length-c):u}),s=E(()=>n.value.map(c=>c.text.includes("\x1B")?fk(c.text):[{text:c.text}])),o=c=>s.value[c].map(u=>u.text).join(""),a=P(!0);function i(){const c=t.value;c&&(a.value=c.scrollTop+c.clientHeight>=c.scrollHeight-32)}function l(){const c=t.value;if(!c)return;const u=typeof window<"u"&&(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1);c.scrollTo({top:c.scrollHeight,behavior:u?"auto":"smooth"})}$e(()=>e.lines.length,()=>{!e.autoScroll||!a.value||Ge(l)});let r;return it(()=>{const c=t.value;c&&e.autoScroll&&(c.scrollTop=c.scrollHeight),typeof ResizeObserver<"u"&&c&&(r=new ResizeObserver(()=>{a.value&&e.autoScroll&&(c.scrollTop=c.scrollHeight)}),r.observe(c))}),tt(()=>r?.disconnect()),{rows:n,spans:s,plainText:o,onScroll:i}}const vk={class:"va-term"},hk={class:"va-term__head"},mk={class:"va-term__title"},_k={key:0,class:"va-term__count"},gk=["aria-label"],yk={key:0,class:"va-term__empty"},bk=["data-kind"],kk={key:0,class:"va-term__no","aria-hidden":"true"},wk={class:"va-term__code"},xk=["aria-label","onClick"],Ck=we({__name:"VaTerminalLog",props:{lines:{},title:{},autoScroll:{type:Boolean,default:!0},maxLines:{},showLineNumbers:{type:Boolean},maxHeight:{}},emits:["copy"],setup(e,{emit:t}){const n=e,s=t,o=Xe("body"),{rows:a,spans:i,plainText:l,onScroll:r}=pk(n,o),c=P(null),{copied:u,copy:d}=_l(()=>c.value!==null?l(c.value):"");$e(u,g=>{g&&c.value!==null&&s("copy",l(c.value))});function _(g,m){m.stopPropagation(),c.value=g,d()}const h=(g,m)=>({color:g,backgroundColor:m});return(g,m)=>(v(),y("figure",vk,[f("header",hk,[m[1]||(m[1]=f("span",{class:"va-term__dots","aria-hidden":"true"},[f("i"),f("i"),f("i")],-1)),f("span",mk,$(n.title??"terminal"),1),m[2]||(m[2]=f("span",{class:"va-term__spacer"},null,-1)),p(a).length?(v(),y("span",_k,$(p(a).length)+" 行",1)):R("",!0)]),f("div",{ref:"body",class:_e(["va-term__body",{"va-term__body--scroll":n.maxHeight}]),style:Fe(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0),tabindex:"0",role:"log","aria-label":`${n.title??"终端"}输出`,onScroll:m[0]||(m[0]=(...b)=>p(r)&&p(r)(...b))},[p(a).length?R("",!0):(v(),y("p",yk,"等待输出…")),(v(!0),y(J,null,ve(p(a),(b,w)=>(v(),y("div",{key:b.id,class:"va-term__row","data-kind":b.kind??"out"},[n.showLineNumbers?(v(),y("span",kk,$(w+1),1)):R("",!0),f("code",wk,[(v(!0),y(J,null,ve(p(i)[w],(x,k)=>(v(),y("span",{key:k,style:Fe(h(x.color,x.bgColor)),class:_e({"va-term__b":x.bold,"va-term__i":x.italic,"va-term__u":x.underline,"va-term__dim":x.dim})},$(x.text),7))),128))]),f("button",{class:"va-term__copy",type:"button","aria-label":p(u)&&c.value===w?`第 ${w+1} 行已复制`:`复制第 ${w+1} 行`,onClick:x=>_(w,x)},[f("span",{class:_e(["va-copy",{"va-copy--done":p(u)&&c.value===w}]),"aria-hidden":"true"},[...m[3]||(m[3]=[f("span",{class:"va-copy__idle"},"⧉",-1),f("span",{class:"va-copy__done"},"✓",-1)])],2)],8,xk)],8,bk))),128))],46,gk)]))}});function Ed(e,t=Date.now()){const n=Math.max(0,t-e),s=Math.floor(n/6e4);if(s<1)return"刚刚";if(s<60)return`${s} 分钟前`;const o=new Date(e),a=`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`,i=new Date(t),l=new Date(t-864e5);return o.toDateString()===i.toDateString()?`今天 ${a}`:o.toDateString()===l.toDateString()?`昨天 ${a}`:`${o.getMonth()+1}-${o.getDate()} ${a}`}const $k={class:"va-cmt"},Ak={key:0,class:"va-cmt__empty va-fade-in"},Dk=["src","alt"],Rk={class:"va-cmt__main"},Sk={class:"va-cmt__head"},Ek={class:"va-cmt__author"},Tk=["data-agent"],Mk={key:1,class:"va-cmt__time"},Fk={class:"va-cmt__text"},Ik={key:0,class:"va-cmt__pending-ops"},Pk=["onClick"],Bk=["onClick"],Lk=["onClick"],Ok=["placeholder"],zk=["disabled"],jk=we({__name:"VaCommentThread",props:{comments:{},placeholder:{},busy:{type:Boolean},composer:{type:Boolean,default:!0},maxHeight:{}},emits:["submit","adopt","rewrite","discard"],setup(e,{emit:t}){const n=e,s=t,o=E(()=>n.comments.length>0),a=Da(3e4,o),i=P(""),l=Xe("area");function r(){const h=i.value.trim();!h||n.busy||(s("submit",h),i.value="",requestAnimationFrame(()=>l.value?.focus()))}function c(h){h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),r())}const u=[16,145,210,268,34,190],d=h=>({background:`hsl(${u[h.length%u.length]} 45% 88%)`,color:`hsl(${u[h.length%u.length]} 45% 30%)`}),_=(h,g)=>g??h.slice(0,1).toUpperCase();return(h,g)=>(v(),y("div",$k,[f("div",{class:"va-cmt__list",style:Fe(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},[n.comments.length?R("",!0):(v(),y("p",Ak,"还没有评论,说点什么吧。")),(v(!0),y(J,null,ve(n.comments,m=>(v(),y("article",{key:m.id,class:_e(["va-cmt__item",{"va-cmt__item--pending":m.pending}])},[m.avatar?(v(),y("img",{key:0,class:"va-cmt__avatar",src:m.avatar,alt:m.author},null,8,Dk)):(v(),y("span",{key:1,class:"va-cmt__avatar va-cmt__avatar--text",style:Fe(d(m.author)),"aria-hidden":"true"},$(_(m.author,m.initials)),5)),f("div",Rk,[f("header",Sk,[f("span",Ek,$(m.author),1),m.role?(v(),y("span",{key:0,class:"va-cmt__role","data-agent":m.pending??!1},$(m.role),9,Tk)):R("",!0),m.createdAt?(v(),y("span",Mk,$(p(Ed)(m.createdAt,p(a))),1)):R("",!0)]),f("p",Fk,$(m.text),1),m.pending?(v(),y("footer",Ik,[f("button",{class:"va-act va-act--sm va-act--primary va-cmt__op",type:"button",onClick:b=>s("adopt",m.id)},"以此发布",8,Pk),f("button",{class:"va-act va-act--sm va-cmt__op",type:"button",onClick:b=>s("rewrite",m.id)},"让 agent 重写",8,Bk),f("button",{class:"va-act va-act--sm va-act--ghost va-cmt__op va-cmt__op--discard",type:"button",onClick:b=>s("discard",m.id)},"丢弃",8,Lk)])):R("",!0)])],2))),128))],4),n.composer?(v(),y("form",{key:0,class:"va-cmt__composer",onSubmit:Se(r,["prevent"])},[ze(f("textarea",{ref_key:"area",ref:l,"onUpdate:modelValue":g[0]||(g[0]=m=>i.value=m),class:"va-cmt__area",rows:"1",placeholder:n.placeholder??"写下评论…","aria-label":"评论输入",onKeydown:c},null,40,Ok),[[Ze,i.value]]),f("button",{class:"va-act va-act--primary va-cmt__send",type:"submit",disabled:!i.value.trim()||n.busy},$(n.busy?"发布中…":"发布"),9,zk)],32)):R("",!0)]))}}),Nk=["data-level"],Uk={class:"va-usage__head"},Wk={class:"va-usage__amount"},Vk={class:"va-usage__limit"},qk={class:"va-usage__period"},Hk=["aria-valuemax","aria-valuenow","aria-label"],Kk={key:0,class:"va-usage__alert",role:"status"},Jk={key:1,class:"va-usage__legend"},Zk={class:"va-usage__label"},Gk={class:"va-usage__value"},Xk={class:"va-usage__pct"},qr=we({__name:"VaUsageMeter",props:{segments:{},limit:{},unit:{},period:{},warnAt:{},barHeight:{}},emits:["manage"],setup(e,{emit:t}){const n=e,s=t,o=["var(--va-info)","var(--va-accent)","var(--va-success)","var(--va-warning)"],a=E(()=>n.segments.reduce((d,_)=>d+_.used,0)),i=E(()=>n.limit>0?a.value/n.limit:0),l=E(()=>n.warnAt??.8),r=E(()=>i.value>=1?"exceeded":i.value>=l.value?"warn":"ok"),c=d=>d.toLocaleString("en-US"),u=(d,_)=>({width:n.limit>0?`${Math.min(100,_/n.limit*100)}%`:"0%",background:n.segments[d].color??o[d%o.length]});return(d,_)=>(v(),y("div",{class:"va-usage","data-level":r.value},[f("header",Uk,[f("span",Wk,[f("strong",null,$(c(a.value)),1),f("span",Vk,"/ "+$(c(n.limit))+" "+$(n.unit??""),1)]),f("span",qk,$(n.period),1)]),f("div",{class:"va-usage__bar",role:"meter","aria-valuemin":0,"aria-valuemax":n.limit,"aria-valuenow":a.value,"aria-label":`已用 ${c(a.value)} / ${c(n.limit)} ${n.unit??""}`,style:Fe({height:`${n.barHeight??10}px`})},[(v(!0),y(J,null,ve(n.segments,(h,g)=>(v(),y("span",{key:h.label,class:"va-usage__seg",style:Fe(u(g,h.used))},null,4))),128))],12,Hk),r.value!=="ok"?(v(),y("p",Kk,[r.value==="exceeded"?(v(),y(J,{key:0},[de("已超出限额,新任务将被限流")],64)):(v(),y(J,{key:1},[de("已用 "+$(Math.round(i.value*100))+"%,接近本期限额",1)],64)),f("button",{class:"va-act va-act--sm va-usage__manage",type:"button",onClick:_[0]||(_[0]=h=>s("manage"))},"管理额度")])):(v(),y("ul",Jk,[(v(!0),y(J,null,ve(n.segments,(h,g)=>(v(),y("li",{key:h.label,class:"va-usage__item"},[f("span",{class:"va-usage__swatch",style:Fe({background:h.color??o[g%o.length]})},null,4),f("span",Zk,$(h.label),1),f("span",Gk,$(c(h.used)),1),f("span",Xk,$(n.limit>0?Math.round(h.used/n.limit*100):0)+"%",1)]))),128))]))],8,Nk))}});function Yk(e,t,n,s){const o=P(!1),a=P(e.defaultOpen??!1),i=E(()=>e.open!==void 0||o.value?e.open:a.value);let l=null;function r(){o.value=!0,a.value=!0,s["update:open"](!0)}function c(){o.value=!0,a.value=!1,s["update:open"](!1)}$e(i,C=>{C?(typeof document<"u"&&(l=document.activeElement),u.value="",g.value=0,Ge(()=>t.value?.focus())):l&&typeof l.focus=="function"&&(l.focus(),l=null)});const u=P(""),d=E(()=>{const C=u.value.trim().toLowerCase();return C?e.commands.filter(D=>D.label.toLowerCase().includes(C)||D.keywords?.toLowerCase().includes(C)):e.commands}),_=E(()=>{const C=[];for(const D of d.value){const I=C[C.length-1];I&&I.group===D.group?I.items.push(D):C.push({group:D.group,items:[D]})}return C}),h=E(()=>_.value.flatMap(C=>C.items)),g=P(0);$e(d,()=>{g.value=0});function m(C){const D=h.value.length;D&&(g.value=(g.value+C+D)%D,Ge(()=>{n.value?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"})}))}function b(C){C.disabled||(s.select(C),c())}function w(C){if(C.key==="ArrowDown")C.preventDefault(),m(1);else if(C.key==="ArrowUp")C.preventDefault(),m(-1);else if(C.key==="Enter"){C.preventDefault();const D=h.value[g.value];D&&b(D)}else C.key==="Escape"&&(C.preventDefault(),c())}function x(C){C.key==="Tab"&&(C.preventDefault(),t.value?.focus())}function k(){c()}return{isOpen:i,openMenu:r,closeMenu:c,query:u,filtered:d,flat:h,groups:_,activeIdx:g,onInputKeydown:w,trapTab:x,onBackdropClick:k,pick:b}}const Qk={class:"va-cmd"},e2=["aria-expanded"],t2={key:0,class:"va-cmd__kbd"},n2={class:"va-cmd__search"},s2=["aria-activedescendant","placeholder"],o2={id:"va-cmd-list",class:"va-cmd__list",role:"listbox","aria-label":"命令列表"},a2={key:0,class:"va-cmd__empty va-fade-in"},i2={key:0,class:"va-cmd__group","aria-hidden":"true"},l2=["id","aria-selected","aria-disabled","data-active","data-danger","disabled","onClick","onMousemove"],r2={class:"va-cmd__label"},c2={key:0,class:"va-cmd__kbd"},u2=we({__name:"VaCommandMenu",props:{commands:{},open:{type:Boolean},defaultOpen:{type:Boolean},placeholder:{},hotkey:{},triggerLabel:{},hideTrigger:{type:Boolean},emptyLabel:{},maxHeight:{}},emits:["update:open","select"],setup(e,{emit:t}){const n=e,s=t,o=Xe("input"),a=Xe("panel"),{isOpen:i,openMenu:l,query:r,flat:c,groups:u,activeIdx:d,onInputKeydown:_,trapTab:h,onBackdropClick:g,pick:m}=Yk(n,o,a,{"update:open":w=>s("update:open",w),select:w=>s("select",w)});function b(w){(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),l())}return(w,x)=>(v(),y("span",Qk,[n.hideTrigger?R("",!0):(v(),y("button",{key:0,class:"va-cmd__trigger",type:"button","aria-expanded":p(i),"aria-haspopup":"dialog",onClick:x[0]||(x[0]=(...k)=>p(l)&&p(l)(...k)),onKeydown:b},[x[5]||(x[5]=f("span",{class:"va-cmd__icon","aria-hidden":"true"},"⌘",-1)),de(" "+$(n.triggerLabel??"命令")+" ",1),n.hotkey?(v(),y("kbd",t2,$(n.hotkey),1)):R("",!0)],40,e2)),(v(),le(il,{to:"body"},[p(i)?(v(),y("div",{key:0,class:"va-cmd__backdrop",onClick:x[1]||(x[1]=(...k)=>p(g)&&p(g)(...k)),onKeydown:x[2]||(x[2]=(...k)=>p(h)&&p(h)(...k))},null,32)):R("",!0),p(i)?(v(),y("div",{key:1,ref:"panel",class:"va-cmd__panel",role:"dialog","aria-modal":"true","aria-label":"命令面板",style:Fe(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},[f("div",n2,[x[6]||(x[6]=f("span",{class:"va-cmd__mag","aria-hidden":"true"},"⌕",-1)),ze(f("input",{ref:"input","onUpdate:modelValue":x[3]||(x[3]=k=>et(r)?r.value=k:null),class:"va-cmd__input",type:"text",role:"combobox","aria-expanded":"true","aria-controls":"va-cmd-list","aria-activedescendant":p(c)[p(d)]?`va-cmd-opt-${p(c)[p(d)].id}`:void 0,placeholder:n.placeholder??"输入命令或搜索…","aria-label":"搜索命令",autocomplete:"off",onKeydown:x[4]||(x[4]=(...k)=>p(_)&&p(_)(...k))},null,40,s2),[[Ze,p(r)]]),x[7]||(x[7]=f("kbd",{class:"va-cmd__kbd va-cmd__kbd--fixed"},"esc",-1))]),f("div",o2,[p(c).length?R("",!0):(v(),y("p",a2,$(n.emptyLabel??"没有匹配的命令"),1)),(v(!0),y(J,null,ve(p(u),k=>(v(),y(J,{key:k.group??""},[k.group?(v(),y("div",i2,$(k.group),1)):R("",!0),(v(!0),y(J,null,ve(k.items,C=>(v(),y("button",{id:`va-cmd-opt-${C.id}`,key:C.id,class:"va-cmd__item",type:"button",role:"option","aria-selected":p(c)[p(d)]?.id===C.id,"aria-disabled":C.disabled,"data-active":p(c)[p(d)]?.id===C.id,"data-danger":C.danger,disabled:C.disabled,onClick:D=>p(m)(C),onMousemove:D=>d.value=p(c).findIndex(I=>I.id===C.id)},[f("span",r2,$(C.label),1),C.hint?(v(),y("kbd",c2,$(C.hint),1)):R("",!0)],40,l2))),128))],64))),128))])],4)):R("",!0)]))]))}}),d2=8,Td=6;function Hr(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function Md(e){const[t,n]=e.split("-");return{side:t,align:n??"center"}}function Kr(e,t){return t==="center"?e:`${e}-${t}`}function Jr(e,t,n){return e==="start"?t.left:e==="end"?t.right-n:t.left+t.width/2-n/2}function f2(e,t,n,s,o){switch(e){case"bottom":return{x:Jr(t,n,s.width),y:n.bottom+o};case"top":return{x:Jr(t,n,s.width),y:n.top-s.height-o};case"right":return{x:n.right+o,y:n.top+n.height/2-s.height/2};case"left":return{x:n.left-s.width-o,y:n.top+n.height/2-s.height/2}}}function p2(e,t,n,s,o,a){const{side:i,align:l}=Md(e);if(i!=="top"&&i!=="bottom")return e;const r=n.height+o,c=s.height-t.bottom-a,u=t.top-a;return i==="bottom"&&r>c&&r<=u?Kr("top",l):i==="top"&&r>u&&r<=c?Kr("bottom",l):e}function v2(e,t,n,s,o){return{x:Hr(e,o,s.width-n.width-o),y:Hr(t,o,s.height-n.height-o)}}function h2(e){const t=e.offset??Td,n=e.padding??d2,s=p2(e.placement,e.anchorRect,e.floatingSize,e.viewport,t,n),{side:o,align:a}=Md(s),i=f2(o,a,e.anchorRect,e.floatingSize,t),{x:l,y:r}=v2(i.x,i.y,e.floatingSize,e.viewport,n);return{x:l,y:r,placement:s,minWidth:e.matchAnchorWidth?e.anchorRect.width:void 0}}const ns=[];let m2=0;const Zr=()=>typeof window<"u"&&typeof document<"u";function Gr(e){return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function _2(e,t){return e?e instanceof Element&&e.contains(t):!1}function g2(e){const t=++m2,n=P({x:0,y:0}),s=P(e.placement.value),o=P(null),a=P(!1);let i=null,l=!1,r=null;function c(){if(!Zr()||!e.open.value)return;const w=e.anchor.value,x=e.floating.value;if(!w||!x)return;const k=h2({anchorRect:Gr(w.getBoundingClientRect()),floatingSize:Gr(x.getBoundingClientRect()),placement:e.placement.value,offset:e.offset.value,viewport:{width:window.innerWidth,height:window.innerHeight},matchAnchorWidth:e.matchAnchorWidth.value});n.value={x:k.x,y:k.y},s.value=k.placement,o.value=k.minWidth??null,a.value=!0}function u(){if(typeof requestAnimationFrame!="function"){c();return}i===null&&(i=requestAnimationFrame(()=>{i=null,c()}))}const d=()=>u(),_=w=>{if(!e.open.value||!e.closeOnOutsideClick.value)return;const x=w.target;if(!x)return;const k=e.floating.value;k&&k.contains(x)||_2(e.anchor.value,x)||e.onRequestClose()},h=w=>{w.key==="Escape"&&(!e.open.value||!e.closeOnEscape.value||ns[ns.length-1]===t&&e.onRequestClose())};function g(){if(!Zr()||l)return;l=!0,window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),document.addEventListener("mousedown",_),document.addEventListener("keydown",h),ns.includes(t)||ns.push(t);const w=e.floating.value;w&&typeof ResizeObserver=="function"&&(r=new ResizeObserver(()=>u()),r.observe(w))}function m(){if(!l)return;l=!1,window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),r?.disconnect(),r=null,document.removeEventListener("mousedown",_),document.removeEventListener("keydown",h);const w=ns.indexOf(t);w>=0&&ns.splice(w,1),i!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(i),i=null)}return $e(e.open,async w=>{w?(await Ge(),c(),g()):(m(),a.value=!1)},{flush:"post"}),$e([e.placement,e.offset,e.anchor,e.matchAnchorWidth],()=>{e.open.value&&u()}),it(()=>{e.open.value&&(c(),g())}),tt(m),{floatingStyle:E(()=>({position:"fixed",top:`${n.value.y}px`,left:`${n.value.x}px`,...o.value!=null?{minWidth:`${o.value}px`}:{},visibility:a.value?"visible":"hidden"})),actualPlacement:s,measured:a,update:c}}const y2=["data-open","data-disabled"],b2=["data-placement"],kn=we({__name:"VaPopover",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},anchor:{},placement:{},offset:{},matchAnchorWidth:{type:Boolean},closeOnOutsideClick:{type:Boolean,default:void 0},closeOnEscape:{type:Boolean,default:void 0},disabled:{type:Boolean},teleportTo:{}},emits:["update:open","open","close"],setup(e,{expose:t,emit:n}){const s=e,o=n,a=P(s.defaultOpen??!1),i=E(()=>s.open??a.value);function l(I){I!==i.value&&(a.value=I,o("update:open",I),o(I?"open":"close"))}function r(){s.disabled||l(!0)}function c(){l(!1)}function u(){i.value?c():r()}$e(()=>s.disabled,I=>{I&&c()});const d=E(()=>s.placement??"bottom-start"),_=E(()=>s.offset??Td),h=E(()=>s.matchAnchorWidth??!1),g=E(()=>s.closeOnOutsideClick??!0),m=E(()=>s.closeOnEscape??!0),b=Xe("trigger"),w=Xe("floating"),x=E(()=>s.anchor??b.value??null),{floatingStyle:k,actualPlacement:C,update:D}=g2({anchor:x,floating:w,open:i,placement:d,offset:_,matchAnchorWidth:h,closeOnOutsideClick:g,closeOnEscape:m,onRequestClose:c});return t({open:r,close:c,toggle:u,update:D}),(I,L)=>(v(),y(J,null,[I.$slots.trigger?(v(),y("span",{key:0,ref:"trigger",class:"va-pop__trigger","data-open":i.value,"data-disabled":s.disabled||void 0,onClick:u},[je(I.$slots,"trigger",{open:i.value,toggle:u})],8,y2)):R("",!0),(v(),le(il,{to:s.teleportTo??"body"},[O(Xn,{name:"va-pop"},{default:ye(()=>[i.value?(v(),y("div",{key:0,ref:"floating",class:"va-pop",style:Fe(p(k)),"data-placement":p(C)},[je(I.$slots,"default",{close:c})],12,b2)):R("",!0)]),_:3})],8,["to"]))],64))}});function k2(e,t,n){const o=`va-sel-${uo()}-list`,a=P(e.defaultOpen??!1),i=P(""),l=P(-1),r=P(e.defaultValue??(e.multiple?[]:void 0)),c=E(()=>e.modelValue??r.value??(e.multiple?[]:"")),u=E(()=>Array.isArray(c.value)?c.value:c.value?[c.value]:[]),d=E(()=>e.options.filter(B=>u.value.includes(B.value))),_=E(()=>u.value.length>0);function h(B){return u.value.includes(B.value)}const g=E(()=>{const B=i.value.trim().toLowerCase();return B?e.options.filter(H=>H.label.toLowerCase().includes(B)||H.value.toLowerCase().includes(B)):e.options}),m=E(()=>{const B=g.value.filter(G=>!G.group),H=[];for(const G of g.value)G.group&&!H.includes(G.group)&&H.push(G.group);return[...B,...H.flatMap(G=>g.value.filter(xe=>xe.group===G))].map((G,xe)=>({option:G,index:xe,domId:`${o}-opt-${xe}`}))}),b=E(()=>{const B=[];for(const H of m.value){const W=H.option.group;if(W){let G=B[B.length-1];(!G||G.type!=="group"||G.label!==W)&&(G={type:"group",label:W,titleId:`${o}-group-${B.length}`,items:[]},B.push(G)),G.items.push(H)}else{let G=B[B.length-1];(!G||G.type!=="plain")&&(G={type:"plain",items:[]},B.push(G)),G.items.push(H)}}return B});function w(B){a.value!==B&&(a.value=B,n.visibleChange(B))}function x(){e.disabled||a.value||w(!0)}function k(){w(!1)}function C(){a.value?k():x()}function D(){t.trigger.value?.focus()}$e(a,B=>{if(B){i.value="";const H=m.value,W=H.findIndex(xe=>h(xe.option)&&!xe.option.disabled),G=H.findIndex(xe=>!xe.option.disabled);l.value=W>=0?W:G,Ge(()=>{e.searchable&&t.search.value?.focus(),oe()})}else i.value="",l.value=-1});function I(B,H){r.value=B,n["update:modelValue"](B),n.change(B,H)}function L(B){if(!B.disabled)if(e.multiple){const H=[...u.value],W=H.indexOf(B.value);W>=0?H.splice(W,1):H.push(B.value),I(H,B),i.value=""}else I(B.value,B),k(),D()}const K=E(()=>!!(e.clearable&&_.value&&!e.disabled&&!e.loading));function X(B){B.stopPropagation();const H=e.multiple?[]:"";r.value=H,n["update:modelValue"](H),n.clear(),D()}function oe(){if(typeof document>"u")return;const B=m.value[l.value];B&&document.getElementById(B.domId)?.scrollIntoView?.({block:"nearest"})}function Y(B){const H=m.value,W=H.length;if(!W)return;let G=l.value;for(let xe=0;xe<W;xe++)if(G=(G+B+W)%W,!H[G].option.disabled){l.value=G,oe();return}}function N(B){const H=m.value,G=(B==="first"?H:[...H].reverse()).find(xe=>!xe.option.disabled);G&&(l.value=G.index,oe())}function U(B){const H=m.value,W=H.length;if(!W)return;const G=B.toLowerCase();for(let xe=1;xe<=W;xe++){const Be=(l.value+xe)%W,Ne=H[Be];if(!Ne.option.disabled&&Ne.option.label.toLowerCase().startsWith(G)){l.value=Be,oe();return}}}function ne(){const B=m.value[l.value];B&&L(B.option)}const ie=E(()=>a.value&&l.value>=0?m.value[l.value]?.domId:void 0);function ae(B){if(!e.disabled){if(!a.value){(B.key==="ArrowDown"||B.key==="ArrowUp"||B.key==="Enter"||B.key===" ")&&(B.preventDefault(),x());return}switch(B.key){case"ArrowDown":B.preventDefault(),Y(1);break;case"ArrowUp":B.preventDefault(),Y(-1);break;case"Home":B.preventDefault(),N("first");break;case"End":B.preventDefault(),N("last");break;case"Enter":case" ":B.preventDefault(),ne();break;case"Escape":B.preventDefault(),B.stopPropagation(),k(),D();break;case"Tab":k();break;default:B.key.length===1&&!B.ctrlKey&&!B.metaKey&&!B.altKey&&U(B.key)}}}function pe(B){B.key===" "&&B.preventDefault()}function ue(B){switch(B.key){case"ArrowDown":B.preventDefault(),Y(1);break;case"ArrowUp":B.preventDefault(),Y(-1);break;case"Home":B.preventDefault(),N("first");break;case"End":B.preventDefault(),N("last");break;case"Enter":B.preventDefault(),ne();break;case"Escape":B.preventDefault(),B.stopPropagation(),k(),D();break}}return $e(m,B=>{if(a.value){if(!B.length){l.value=-1;return}(l.value<0||l.value>=B.length)&&(l.value=B.findIndex(H=>!H.option.disabled))}}),{listId:o,open:a,query:i,activeIdx:l,value:c,values:u,selectedOptions:d,hasValue:_,isSelected:h,filtered:g,flatItems:m,renderEntries:b,showClear:K,activeDomId:ie,setOpen:w,openMenu:x,closeMenu:k,toggleMenu:C,focusTrigger:D,pick:L,onClear:X,move:Y,onTriggerKeydown:ae,onTriggerKeyup:pe,onSearchKeydown:ue}}const w2=["data-disabled","data-loading","data-clearable"],x2=["aria-expanded","aria-controls","aria-invalid","aria-label","aria-activedescendant","disabled"],C2=["data-placeholder"],$2={class:"va-sel__indicators","aria-hidden":"true"},A2={key:0,class:"va-sel__spinner"},D2={key:1,class:"va-sel__chev",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},R2={class:"va-sel__panel"},S2={key:0,class:"va-sel__search"},E2=["aria-controls","aria-activedescendant"],T2=["id","aria-multiselectable","aria-label"],M2=["aria-labelledby"],F2=["id"],I2=["id","aria-selected","aria-disabled","data-active","onClick","onMousemove"],P2=["data-checked"],B2={class:"va-sel__opt-main"},L2={class:"va-sel__opt-label"},O2={key:0,class:"va-sel__opt-desc"},z2={key:1,class:"va-sel__opt-tick","aria-hidden":"true"},j2=["id","aria-selected","aria-disabled","data-active","onClick","onMousemove"],N2=["data-checked"],U2={class:"va-sel__opt-main"},W2={class:"va-sel__opt-label"},V2={key:0,class:"va-sel__opt-desc"},q2={key:1,class:"va-sel__opt-tick","aria-hidden":"true"},H2={key:2,class:"va-sel__empty va-fade-in"},sa=we({__name:"VaSelect",props:{options:{},modelValue:{},defaultValue:{},multiple:{type:Boolean},searchable:{type:Boolean},clearable:{type:Boolean},size:{default:"md"},disabled:{type:Boolean},invalid:{type:Boolean},loading:{type:Boolean},placeholder:{default:"请选择"},emptyLabel:{default:"无匹配项"},label:{},defaultOpen:{type:Boolean}},emits:["update:modelValue","change","clear","visibleChange"],setup(e,{emit:t}){const n=e,s=t,o=Xe("trigger"),a=Xe("search"),{listId:i,open:l,query:r,activeIdx:c,values:u,selectedOptions:d,hasValue:_,isSelected:h,flatItems:g,renderEntries:m,showClear:b,activeDomId:w,setOpen:x,pick:k,onClear:C,onTriggerKeydown:D,onTriggerKeyup:I,onSearchKeydown:L}=k2(n,{trigger:o,search:a},{"update:modelValue":oe=>s("update:modelValue",oe),change:(oe,Y)=>s("change",oe,Y),clear:()=>s("clear"),visibleChange:oe=>s("visibleChange",oe)}),K=E(()=>{const oe=Y=>n.options.find(N=>N.value===Y)?.label??Y;return u.value.map(oe).join("、")}),X=E(()=>["va-sel",`va-sel--${n.size}`,{"va-sel--open":l.value,"va-sel--disabled":n.disabled,"va-sel--invalid":n.invalid,"va-sel--multiple":n.multiple}]);return(oe,Y)=>(v(),le(p(kn),{open:p(l),disabled:n.disabled,"match-anchor-width":"",placement:"bottom-start","onUpdate:open":p(x)},{trigger:ye(()=>[f("span",{class:_e(X.value),"data-disabled":n.disabled||void 0,"data-loading":n.loading||void 0,"data-clearable":p(b)||void 0},[f("button",{ref:"trigger",type:"button",class:"va-sel__trigger",role:"combobox","aria-expanded":p(l),"aria-haspopup":"listbox","aria-controls":p(i),"aria-invalid":n.invalid||void 0,"aria-label":n.label??"选择","aria-activedescendant":n.searchable?void 0:p(w),disabled:n.disabled,onKeydown:Y[0]||(Y[0]=(...N)=>p(D)&&p(D)(...N)),onKeyup:Y[1]||(Y[1]=(...N)=>p(I)&&p(I)(...N))},[f("span",{class:"va-sel__value","data-placeholder":!p(_)||void 0},[je(oe.$slots,"value",{options:p(d),values:p(u)},()=>[de($(p(_)?K.value:n.placeholder),1)])],8,C2),f("span",$2,[n.loading?(v(),y("span",A2)):(v(),y("svg",D2,[...Y[7]||(Y[7]=[f("polyline",{points:"6 9 12 15 18 9"},null,-1)])]))])],40,x2),p(b)?(v(),y("button",{key:0,type:"button",class:"va-sel__clear","aria-label":"清除选择",title:"清除",onClick:Y[2]||(Y[2]=(...N)=>p(C)&&p(C)(...N)),onMousedown:Y[3]||(Y[3]=Se(()=>{},["stop"]))}," × ",32)):R("",!0)],10,w2)]),default:ye(()=>[f("div",R2,[n.searchable?(v(),y("div",S2,[ze(f("input",{ref:"search","onUpdate:modelValue":Y[4]||(Y[4]=N=>et(r)?r.value=N:null),type:"text",class:"va-sel__search-input",placeholder:"搜索…","aria-label":"搜索选项","aria-controls":p(i),"aria-activedescendant":n.searchable?p(w):void 0,autocomplete:"off",onKeydown:Y[5]||(Y[5]=(...N)=>p(L)&&p(L)(...N))},null,40,E2),[[Ze,p(r)]])])):R("",!0),p(g).length?(v(),y("div",{key:1,id:p(i),class:"va-sel__list",role:"listbox","aria-multiselectable":n.multiple||void 0,"aria-label":n.label??"选项列表",onMousedown:Y[6]||(Y[6]=Se(()=>{},["prevent"]))},[(v(!0),y(J,null,ve(p(m),N=>(v(),y(J,{key:N.type==="group"?N.titleId:`plain-${N.items[0]?.index??0}`},[N.type==="group"?(v(),y("div",{key:0,class:"va-sel__group",role:"group","aria-labelledby":N.titleId},[f("div",{id:N.titleId,class:"va-sel__group-title"},$(N.label),9,F2),(v(!0),y(J,null,ve(N.items,U=>(v(),y("div",{id:U.domId,key:U.domId,class:"va-sel__opt",role:"option","aria-selected":p(h)(U.option),"aria-disabled":U.option.disabled||void 0,"data-active":U.index===p(c)||void 0,onClick:ne=>p(k)(U.option),onMousemove:ne=>!U.option.disabled&&(c.value=U.index)},[n.multiple?(v(),y("span",{key:0,class:"va-sel__check","data-checked":p(h)(U.option)||void 0,"aria-hidden":"true"},null,8,P2)):R("",!0),f("span",B2,[je(oe.$slots,"option",{option:U.option,selected:p(h)(U.option),active:U.index===p(c)},()=>[f("span",L2,$(U.option.label),1),U.option.description?(v(),y("span",O2,$(U.option.description),1)):R("",!0)])]),!n.multiple&&p(h)(U.option)?(v(),y("span",z2,"✓")):R("",!0)],40,I2))),128))],8,M2)):R("",!0),(v(!0),y(J,null,ve(N.type==="plain"?N.items:[],U=>(v(),y("div",{id:U.domId,key:U.domId,class:"va-sel__opt",role:"option","aria-selected":p(h)(U.option),"aria-disabled":U.option.disabled||void 0,"data-active":U.index===p(c)||void 0,onClick:ne=>p(k)(U.option),onMousemove:ne=>!U.option.disabled&&(c.value=U.index)},[n.multiple?(v(),y("span",{key:0,class:"va-sel__check","data-checked":p(h)(U.option)||void 0,"aria-hidden":"true"},null,8,N2)):R("",!0),f("span",U2,[je(oe.$slots,"option",{option:U.option,selected:p(h)(U.option),active:U.index===p(c)},()=>[f("span",W2,$(U.option.label),1),U.option.description?(v(),y("span",V2,$(U.option.description),1)):R("",!0)])]),!n.multiple&&p(h)(U.option)?(v(),y("span",q2,"✓")):R("",!0)],40,j2))),128))],64))),128))],40,T2)):(v(),y("div",H2,[je(oe.$slots,"empty",{},()=>[de($(n.emptyLabel),1)])]))])]),_:3},8,["open","disabled","onUpdate:open"]))}}),Mo=()=>typeof window<"u"&&typeof document<"u";function Xr(e){const t=[];let n;return e.forEach((s,o)=>{if(s.divider){t.push({type:"divider",key:`divider-${o}`}),n=void 0;return}s.group&&s.group!==n&&t.push({type:"group",key:`group-${o}`,label:s.group}),n=s.group,t.push({type:"item",key:`item-${s.id}-${o}`,item:s})}),t}function K2(e,t){return{getBoundingClientRect:()=>({x:e,y:t,top:t,left:e,right:e,bottom:t,width:0,height:0})}}function J2(e,t,n){const s=uo(),o=`va-dd-${s}-menu`,a=`va-dd-${s}-submenu`,i=P(e.defaultOpen??!1),l=E(()=>e.open??i.value),r=P(l.value?oe(e.items.filter(M=>!M.divider)):null),c=P(null),u=P(null),d=P(null),_=P(null);let h=!1;const g=E(()=>e.trigger==="contextmenu"?_.value??void 0:void 0),m=E(()=>e.items.filter(M=>!M.divider)),b=E(()=>Xr(e.items)),w=E(()=>c.value?e.items.find(M=>M.id===c.value)?.children??[]:[]),x=E(()=>w.value.filter(M=>!M.divider)),k=E(()=>Xr(w.value)),C=E(()=>c.value!==null),D=E(()=>e.items.find(M=>M.id===c.value)?.label??"子菜单"),I=E(()=>m.value.find(M=>M.id===r.value)??null),L=M=>String(M).replace(/[^\w-]+/g,"-"),K=M=>`${o}-i-${L(M)}`,X=(M,j)=>`${a}-${L(M)}-${L(j)}`;function oe(M){return M.find(j=>!j.disabled)?.id??M[0]?.id??null}function Y(M){!Mo()||!M||document.getElementById(M)?.focus()}function N(){if(t.trigger.value){t.trigger.value.focus();return}t.triggerWrap.value?.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")?.focus()}function U(M){l.value!==M&&(i.value=M,n["update:open"](M),M?n.open():n.close())}function ne(){e.disabled||l.value||U(!0)}function ie(M={}){l.value&&(h=!!M.restoreFocus,U(!1))}function ae(){l.value?ie():ne()}$e(l,async M=>{if(M)c.value=null,u.value=null,d.value=null,r.value=oe(m.value),await Ge(),Y(r.value?K(r.value):null);else{c.value=null,u.value=null,d.value=null,_.value=null,r.value=null;const j=h;h=!1,await Ge(),j&&N()}});function pe(M,j,he){const S=M.length;if(!S)return null;let V=j?M.findIndex(te=>te.id===j):-1;V<0&&(V=he>0?-1:0);for(let te=0;te<S;te++)if(V=(V+he+S)%S,!M[V].disabled)return M[V].id;return j}function ue(M,j){return(j==="first"?M:[...M].reverse()).find(S=>!S.disabled)?.id??null}function B(M){r.value=M}function H(M){u.value=M}function W(M){const j=pe(m.value,r.value,M);j&&(r.value=j,Y(K(j)))}function G(M){const j=ue(m.value,M);j&&(r.value=j,Y(K(j)))}function xe(M){const j=c.value;if(!j)return;const he=pe(x.value,u.value,M);he&&(u.value=he,Y(X(j,he)))}function Be(M){const j=c.value;if(!j)return;const he=ue(x.value,M);he&&(u.value=he,Y(X(j,he)))}function Ne(M){const j=e.items.find(he=>he.id===M);!j?.children?.length||c.value===M||(d.value=Mo()?document.getElementById(K(M)):null,c.value=M,u.value=oe(j.children.filter(he=>!he.divider)),Ge(()=>{c.value&&u.value&&Y(X(c.value,u.value))}))}function Re(M={}){const j=c.value;c.value=null,u.value=null,d.value=null,M.focusParent&&j&&(r.value=j,Ge(()=>Y(K(j))))}function fe(M,j=!0){if(!(M.disabled||M.divider)){if(j&&M.children?.length){Ne(M.id);return}n.select(M),e.keepOpenOnSelect||ie({restoreFocus:!0})}}function lt(M){M.disabled||(r.value=M.id,fe(M))}function wt(M){M.disabled||(u.value=M.id,fe(M,!1))}function Ee(M){e.trigger!=="click"&&M.stopPropagation()}function A(M){e.trigger!=="contextmenu"||e.disabled||(M.preventDefault(),M.stopPropagation(),_.value=K2(M.clientX,M.clientY),l.value||ne())}function F(M){if(!(e.disabled||e.trigger==="manual")){if(!l.value){(M.key==="ArrowDown"||M.key==="ArrowUp"||M.key==="Enter"||M.key===" ")&&(M.preventDefault(),ne());return}(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),W(M.key==="ArrowDown"?1:-1))}}function Z(M){M.key===" "&&M.preventDefault()}function se(M){if(!l.value)return;const j=I.value;switch(M.key){case"ArrowDown":M.preventDefault(),W(1);break;case"ArrowUp":M.preventDefault(),W(-1);break;case"Home":M.preventDefault(),G("first");break;case"End":M.preventDefault(),G("last");break;case"Enter":case" ":if(!j)return;M.preventDefault(),fe(j);break;case"ArrowRight":j?.children?.length&&(M.preventDefault(),Ne(j.id));break;case"ArrowLeft":c.value&&(M.preventDefault(),Re({focusParent:!0}));break;case"Tab":ie();break}}function Q(M){if(!c.value)return;const j=x.value.find(he=>he.id===u.value)??null;switch(M.key){case"ArrowDown":M.preventDefault(),xe(1);break;case"ArrowUp":M.preventDefault(),xe(-1);break;case"Home":M.preventDefault(),Be("first");break;case"End":M.preventDefault(),Be("last");break;case"Enter":case" ":if(!j)return;M.preventDefault(),fe(j,!1);break;case"ArrowLeft":M.preventDefault(),Re({focusParent:!0});break;case"ArrowRight":M.preventDefault();break;case"Tab":ie();break}}function ee(M){return[t.trigger.value,t.triggerWrap.value,t.menu.value,t.submenu.value].some(j=>!!j&&j.contains(M))}function ce(M){if(!l.value)return;const j=M.target;!j||ee(j)||ie()}function re(M){M.key!=="Escape"||!l.value||(M.preventDefault(),ie({restoreFocus:!0}))}return it(()=>{Mo()&&(document.addEventListener("mousedown",ce),document.addEventListener("keydown",re),l.value&&Y(r.value?K(r.value):null))}),tt(()=>{Mo()&&(document.removeEventListener("mousedown",ce),document.removeEventListener("keydown",re))}),{menuId:o,submenuId:a,isOpen:l,activeId:r,openSubId:c,subActiveId:u,submenuAnchor:d,submenuOpen:C,submenuLabel:D,popoverAnchor:g,entries:b,subEntries:k,navItems:m,subNavItems:x,activeItem:I,itemDomId:K,subItemDomId:X,setActive:B,setSubActive:H,openMenu:ne,closeMenu:ie,toggleMenu:ae,setOpen:U,onTriggerClick:Ee,onTriggerKeydown:F,onTriggerKeyup:Z,onTriggerContextmenu:A,onMenuKeydown:se,onSubKeydown:Q,onItemClick:lt,onSubItemClick:wt,openSub:Ne,closeSub:Re}}const Z2=["aria-expanded","aria-controls","aria-label","disabled"],G2={key:0,class:"va-dd__icon","aria-hidden":"true"},X2={key:1,class:"va-dd__label"},Y2={key:2,class:"va-dd__chev","aria-hidden":"true"},Q2=["id","aria-label"],ew={key:0,class:"va-dd__group",role:"presentation"},tw={key:1,class:"va-dd__divider",role:"separator"},nw=["id","aria-haspopup","aria-expanded","aria-disabled","data-active","data-checked","data-danger","disabled","onClick","onMouseenter","onFocus"],sw={class:"va-dd__check","aria-hidden":"true"},ow={key:0,class:"va-dd__item-icon","aria-hidden":"true"},aw={class:"va-dd__item-label"},iw={key:1,class:"va-dd__shortcut"},lw={key:2,class:"va-dd__sub-arrow","aria-hidden":"true"},rw=["id","aria-label"],cw={key:0,class:"va-dd__group",role:"presentation"},uw={key:1,class:"va-dd__divider",role:"separator"},dw=["id","aria-disabled","data-active","data-checked","data-danger","disabled","onClick","onMouseenter","onFocus"],fw={class:"va-dd__check","aria-hidden":"true"},pw={key:0,class:"va-dd__item-icon","aria-hidden":"true"},vw={class:"va-dd__item-label"},hw={key:1,class:"va-dd__shortcut"},mw=we({__name:"VaDropdown",props:{items:{},trigger:{default:"click"},placement:{default:"bottom-end"},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},triggerLabel:{},triggerIcon:{},hideChevron:{type:Boolean,default:!1},keepOpenOnSelect:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ariaLabel:{}},emits:["update:open","select","open","close"],setup(e,{expose:t,emit:n}){const s=e,o=n,a=Xe("trigger"),i=Xe("triggerWrap"),l=Xe("menu"),r=Xe("submenu"),{menuId:c,submenuId:u,isOpen:d,activeId:_,openSubId:h,subActiveId:g,submenuAnchor:m,submenuOpen:b,submenuLabel:w,popoverAnchor:x,entries:k,subEntries:C,itemDomId:D,subItemDomId:I,setActive:L,setSubActive:K,openMenu:X,closeMenu:oe,toggleMenu:Y,setOpen:N,onTriggerClick:U,onTriggerKeydown:ne,onTriggerKeyup:ie,onTriggerContextmenu:ae,onMenuKeydown:pe,onSubKeydown:ue,onItemClick:B,onSubItemClick:H}=J2(s,{trigger:a,triggerWrap:i,menu:l,submenu:r},{"update:open":Ne=>o("update:open",Ne),open:()=>o("open"),close:()=>o("close"),select:Ne=>o("select",Ne)}),W=E(()=>s.triggerIcon!==void 0?s.triggerIcon!=="":!s.triggerLabel),G=E(()=>!!s.triggerLabel&&!W.value),xe=E(()=>s.triggerIcon??"⋮"),Be=E(()=>s.ariaLabel??s.triggerLabel??"更多操作");return t({open:X,close:oe,toggle:Y,setOpen:N}),(Ne,Re)=>(v(),le(p(kn),{open:p(d),anchor:p(x),placement:s.placement,disabled:s.disabled,"close-on-outside-click":!1,"close-on-escape":!1,"onUpdate:open":p(N)},{trigger:ye(()=>[f("span",{ref_key:"triggerWrap",ref:i,class:"va-dd",onClick:Re[0]||(Re[0]=(...fe)=>p(U)&&p(U)(...fe)),onKeydown:Re[1]||(Re[1]=(...fe)=>p(ne)&&p(ne)(...fe)),onKeyup:Re[2]||(Re[2]=(...fe)=>p(ie)&&p(ie)(...fe)),onContextmenu:Re[3]||(Re[3]=(...fe)=>p(ae)&&p(ae)(...fe))},[je(Ne.$slots,"trigger",{open:p(d),toggle:p(Y)},()=>[f("button",{ref:"trigger",type:"button",class:"va-dd__trigger","aria-haspopup":"menu","aria-expanded":p(d),"aria-controls":p(d)?p(c):void 0,"aria-label":G.value?void 0:Be.value,disabled:s.disabled},[W.value?(v(),y("span",G2,$(xe.value),1)):R("",!0),G.value?(v(),y("span",X2,$(s.triggerLabel),1)):R("",!0),s.hideChevron?R("",!0):(v(),y("span",Y2,"▾"))],8,Z2)])],544)]),default:ye(()=>[f("div",{id:p(c),ref:"menu",class:"va-dd__menu",role:"menu","aria-label":s.ariaLabel??"动作菜单",onKeydown:Re[5]||(Re[5]=(...fe)=>p(pe)&&p(pe)(...fe)),onMousedown:Re[6]||(Re[6]=Se(()=>{},["prevent"]))},[(v(!0),y(J,null,ve(p(k),fe=>(v(),y(J,{key:fe.key},[fe.type==="group"?(v(),y("div",ew,$(fe.label),1)):fe.type==="divider"?(v(),y("div",tw)):fe.type==="item"?(v(),y("button",{key:2,id:p(D)(fe.item.id),type:"button",class:"va-dd__item",role:"menuitem",tabindex:"-1","aria-haspopup":fe.item.children?.length?"menu":void 0,"aria-expanded":fe.item.children?.length?p(h)===fe.item.id:void 0,"aria-disabled":fe.item.disabled||void 0,"data-active":p(_)===fe.item.id||void 0,"data-checked":fe.item.checked||void 0,"data-danger":fe.item.danger||void 0,disabled:fe.item.disabled,onClick:lt=>p(B)(fe.item),onKeyup:Re[4]||(Re[4]=at(Se(()=>{},["prevent"]),["space"])),onMouseenter:lt=>p(L)(fe.item.id),onFocus:lt=>p(L)(fe.item.id)},[je(Ne.$slots,"item",{item:fe.item,active:p(_)===fe.item.id,checked:!!fe.item.checked,disabled:!!fe.item.disabled},()=>[f("span",sw,$(fe.item.checked?"✓":""),1),fe.item.icon?(v(),y("span",ow,$(fe.item.icon),1)):R("",!0),f("span",aw,$(fe.item.label),1),fe.item.shortcut?(v(),y("span",iw,$(fe.item.shortcut),1)):R("",!0),fe.item.children?.length?(v(),y("span",lw,"›")):R("",!0)])],40,nw)):R("",!0)],64))),128))],40,Q2),O(p(kn),{open:p(b),anchor:p(m),placement:"right",offset:2,"close-on-outside-click":!1,"close-on-escape":!1},{default:ye(()=>[f("div",{id:p(u),ref:"submenu",class:"va-dd__menu va-dd__submenu",role:"menu","aria-label":p(w),onKeydown:Re[8]||(Re[8]=(...fe)=>p(ue)&&p(ue)(...fe)),onMousedown:Re[9]||(Re[9]=Se(()=>{},["prevent"]))},[(v(!0),y(J,null,ve(p(C),fe=>(v(),y(J,{key:fe.key},[fe.type==="group"?(v(),y("div",cw,$(fe.label),1)):fe.type==="divider"?(v(),y("div",uw)):fe.type==="item"?(v(),y("button",{key:2,id:p(I)(p(h),fe.item.id),type:"button",class:"va-dd__item",role:"menuitem",tabindex:"-1","aria-disabled":fe.item.disabled||void 0,"data-active":p(g)===fe.item.id||void 0,"data-checked":fe.item.checked||void 0,"data-danger":fe.item.danger||void 0,disabled:fe.item.disabled,onClick:lt=>p(H)(fe.item),onKeyup:Re[7]||(Re[7]=at(Se(()=>{},["prevent"]),["space"])),onMouseenter:lt=>p(K)(fe.item.id),onFocus:lt=>p(K)(fe.item.id)},[je(Ne.$slots,"item",{item:fe.item,active:p(g)===fe.item.id,checked:!!fe.item.checked,disabled:!!fe.item.disabled},()=>[f("span",fw,$(fe.item.checked?"✓":""),1),fe.item.icon?(v(),y("span",pw,$(fe.item.icon),1)):R("",!0),f("span",vw,$(fe.item.label),1),fe.item.shortcut?(v(),y("span",hw,$(fe.item.shortcut),1)):R("",!0)])],40,dw)):R("",!0)],64))),128))],40,rw)]),_:3},8,["open","anchor"])]),_:3},8,["open","anchor","placement","disabled","onUpdate:open"]))}}),_w=["data-disabled"],gw=["data-variant"],yw="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",Fd=we({__name:"VaTooltip",props:{content:{},placement:{default:"top"},delay:{default:300},hideDelay:{default:80},disabled:{type:Boolean,default:!1},maxWidth:{default:280},variant:{default:"inverse"}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const s=e,o=n,a=Wu(),i=`va-tip-${uo()}`,l=P(!1),r=Xe("trigger");let c=null,u=null;function d(){c!=null&&(clearTimeout(c),c=null)}function _(){u!=null&&(clearTimeout(u),u=null)}function h(){return!!s.content||!!a.content}function g(){d(),_(),!(s.disabled||l.value||!h())&&(l.value=!0,o("show"))}function m(){d(),_(),l.value&&(l.value=!1,o("hide"))}function b(){s.disabled||(_(),!(l.value||c!=null)&&(c=setTimeout(()=>{c=null,g()},s.delay)))}function w(){d(),!(!l.value||u!=null)&&(u=setTimeout(()=>{u=null,m()},s.hideDelay))}function x(L){L||m()}$e(()=>s.disabled,L=>{L&&m()});function k(){const L=r.value;return L?L.querySelector(yw)??L.firstElementChild??L:null}let C=null;function D(){const L=k();if(!L||L.hasAttribute("aria-label"))return;const K=(L.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);K.includes(i)||(L.setAttribute("aria-describedby",[...K,i].join(" ")),C=L)}function I(){const L=C;if(C=null,!L)return;const X=(L.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean).filter(oe=>oe!==i);X.length?L.setAttribute("aria-describedby",X.join(" ")):L.removeAttribute("aria-describedby")}return $e(l,L=>{L?D():I()}),tt(()=>{d(),_(),I()}),t({show:g,hide:m}),(L,K)=>(v(),y(J,null,[f("span",{ref:"trigger",class:"va-tip__trigger","data-disabled":s.disabled||void 0,onMouseenter:b,onMouseleave:w,onFocusin:b,onFocusout:w},[je(L.$slots,"default")],40,_w),O(p(kn),{open:l.value,anchor:r.value,placement:s.placement,disabled:s.disabled,"close-on-outside-click":!0,"close-on-escape":!0,"onUpdate:open":x},{default:ye(()=>[f("div",{id:i,class:"va-tip",role:"tooltip","data-variant":s.variant,style:Fe({maxWidth:`${s.maxWidth}px`})},[je(L.$slots,"content",{},()=>[de($(s.content),1)])],12,gw)]),_:3},8,["open","anchor","placement","disabled"])],64))}}),bw=["a[href]","area[href]","button","input:not([type='hidden'])","select","textarea","iframe","object","embed","[contenteditable]","[tabindex]"].join(",");function kw(e){if(e.hasAttribute("disabled")||e.tabIndex<0||e.getAttribute("aria-hidden")==="true")return!1;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Yr(e){return Array.from(e.querySelectorAll(bw)).filter(kw)}function ww(e){let t=null;async function n(){if(typeof document>"u")return;t=document.activeElement,await Ge();const a=e.container.value;if(!a)return;(e.initialFocus?.()??Yr(a)[0]??a).focus({preventScroll:!0})}function s(a){const i=e.container.value;if(!i||typeof document>"u")return;const l=Yr(i);if(l.length===0){a.preventDefault(),i.focus();return}const r=l[0],c=l[l.length-1],u=document.activeElement;if(!i.contains(u)){a.preventDefault(),(a.shiftKey?c:r).focus();return}a.shiftKey&&u===r?(a.preventDefault(),c.focus()):!a.shiftKey&&u===c&&(a.preventDefault(),r.focus())}function o(){const a=t;if(t=null,!(!a||typeof document>"u"))try{document.contains(a)&&a.focus({preventScroll:!0})}catch{}}return tt(()=>{t=null}),{activate:n,handleTab:s,deactivate:o}}const xw=["data-state","aria-hidden"],Cw=["role","aria-labelledby","aria-describedby","aria-label"],$w={key:0,class:"va-dlg__header"},Aw={class:"va-dlg__body"},Dw={key:1,class:"va-dlg__footer"},ss=[];let Rw=0,Ns=0,Ts=null;function Sw(){if(!(typeof document>"u")){if(Ns===0){const e=document.body,t=window.innerWidth-document.documentElement.clientWidth;if(Ts={overflow:e.style.overflow,paddingRight:e.style.paddingRight},e.style.overflow="hidden",t>0){const n=Number.parseFloat(window.getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${n+t}px`}}Ns++}}function Qr(){typeof document>"u"||(Ns=Math.max(0,Ns-1),Ns===0&&Ts&&(document.body.style.overflow=Ts.overflow,document.body.style.paddingRight=Ts.paddingRight,Ts=null))}const gl=we({__name:"VaDialog",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean},title:{},description:{},ariaLabel:{},role:{},size:{},closable:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},closeOnEscape:{type:Boolean,default:void 0},lockScroll:{type:Boolean,default:void 0},teleportTo:{},initialFocus:{},destroyOnClose:{type:Boolean}},emits:["update:open","close","opened","closed"],setup(e,{expose:t,emit:n}){const s=e,o=n,a=Wu(),i=P(s.defaultOpen??!1),l=E(()=>s.open??i.value);function r(Ee){Ee!==l.value&&(i.value=Ee,o("update:open",Ee))}function c(){o("close"),r(!1)}function u(){r(!0)}const d=E(()=>s.closable??!0),_=E(()=>s.maskClosable??!0),h=E(()=>s.closeOnEscape??!0),g=E(()=>s.lockScroll??!0),m=E(()=>s.destroyOnClose??!1),b=E(()=>s.size??"md"),w=E(()=>s.role??"dialog"),x=P(l.value),k=P(l.value?"open":"closed"),C=++Rw,D=()=>ss[ss.length-1]===C;let I=!1,L=!1;const K=200;function X(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}let oe=0;function Y(Ee){const A=++oe;if(X()){Ee();return}setTimeout(()=>{A===oe&&Ee()},K)}const N=Xe("panel");function U(){const Ee=s.initialFocus;if(Ee!=null)return typeof Ee=="string"?N.value?.querySelector(Ee)??void 0:Ee}const ne=ww({container:N,initialFocus:U}),ie=Ee=>{if(D()){if(Ee.key==="Escape"&&h.value){c();return}Ee.key==="Tab"&&ne.handleTab(Ee)}};function ae(Ee){Ee.target===Ee.currentTarget&&(!D()||!_.value||c())}function pe(){typeof document>"u"||I||(I=!0,document.addEventListener("keydown",ie),ss.includes(C)||ss.push(C),g.value&&!L&&(Sw(),L=!0))}function ue(){if(!I)return;I=!1,document.removeEventListener("keydown",ie);const Ee=ss.indexOf(C);Ee>=0&&ss.splice(Ee,1)}const B=uo(),H=`va-dlg-title-${B}`,W=`va-dlg-desc-${B}`,G=E(()=>!!s.title||!!a.title),xe=E(()=>G.value?H:void 0),Be=E(()=>s.description?W:void 0),Ne=E(()=>G.value?void 0:s.ariaLabel);let Re=!1;function fe(){Re||typeof console>"u"||!G.value&&!s.ariaLabel&&(Re=!0,console.warn("[VaDialog] 缺少可访问名称:未提供 title / title 插槽时,请通过 aria-label 传入弹窗名称。"))}async function lt(){x.value=!0,fe(),pe(),await Ge(),k.value="open",await ne.activate(),Y(()=>o("opened"))}function wt(){k.value="closed",ue(),Y(()=>{ne.deactivate(),L&&(Qr(),L=!1),m.value&&(x.value=!1),o("closed")})}return $e(l,(Ee,A)=>{Ee!==A&&(Ee?lt():wt())},{flush:"post"}),it(()=>{l.value&&lt()}),tt(()=>{oe++,ue(),L&&(Qr(),L=!1),l.value&&ne.deactivate()}),t({open:u,close:c}),(Ee,A)=>(v(),le(il,{to:s.teleportTo??"body"},[x.value?(v(),y("div",{key:0,class:"va-dlg__overlay","data-state":k.value,"aria-hidden":k.value==="closed"?"true":void 0,onMousedown:ae},[f("div",{ref:"panel",class:_e(["va-dlg",`va-dlg--${b.value}`]),role:w.value,"aria-modal":"true","aria-labelledby":xe.value,"aria-describedby":Be.value,"aria-label":Ne.value,tabindex:"-1"},[Ee.$slots.header||G.value||s.description?(v(),y("div",$w,[je(Ee.$slots,"header",{close:c},()=>[G.value?(v(),y("h2",{key:0,id:H,class:"va-dlg__title"},[je(Ee.$slots,"title",{},()=>[de($(s.title),1)])])):R("",!0),s.description?(v(),y("p",{key:1,id:W,class:"va-dlg__desc"},$(s.description),1)):R("",!0)])])):R("",!0),f("div",Aw,[je(Ee.$slots,"default",{close:c})]),Ee.$slots.footer?(v(),y("div",Dw,[je(Ee.$slots,"footer",{close:c})])):R("",!0),d.value?(v(),y("button",{key:2,type:"button",class:"va-dlg__close","aria-label":"关闭",onClick:c},[O(p(Mn),{size:16})])):R("",!0)],10,Cw)],40,xw)):R("",!0)],8,["to"]))}}),Ew={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Fn=Ft({queue:[],details:null}),Ni=new Map;let Tw=0,oa=0,Ui=!1;const Mw="确认",Fw="取消";function Iw(){try{return Ew?.DEV??!0}catch{return!0}}function Pw(e){const t=e.tone??"default";return{id:++Tw,title:e.title,description:e.description,tone:t,confirmText:e.confirmText??Mw,cancelText:e.cancelText??Fw,icon:e.icon??!1,requireText:e.requireText,checkboxLabel:e.checkboxLabel}}function Bw(e){if(oa===0)return Iw()&&!Ui&&(Ui=!0,console.warn("[VaConfirm] 未找到已挂载的 <VaConfirmHost />:vaConfirm() 将直接 resolve(false)。请在应用根节点挂载宿主组件。")),Fn.details={ok:!1,checked:!1},Promise.resolve(!1);const t=Pw(e),n=new Promise(s=>{Ni.set(t.id,{resolve:s})});return Fn.queue.push(t),n}function Id(e,t,n=!1){const s=Ni.get(e);if(!s)return;Ni.delete(e),Fn.details={ok:t,checked:n};const o=Fn.queue.findIndex(a=>a.id===e);o>=0&&Fn.queue.splice(o,1),s.resolve(t)}function Lw(){for(const e of[...Fn.queue])Id(e.id,!1,!1)}function Ow(){oa+=1,Ui=!1}function zw(){oa=Math.max(0,oa-1)}const Pd=Object.assign(Bw,{state:Fn,closeAll:Lw});Object.defineProperty(Pd,"details",{get:()=>Fn.details,enumerable:!0});const gn=Pd,jw=["data-tone"],Nw={key:0,class:"va-confirm__icon","aria-hidden":"true"},Uw={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Ww={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},Vw={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},qw={class:"va-confirm__title"},Hw={class:"va-confirm__body"},Kw={key:0,class:"va-confirm__field"},Jw={class:"va-confirm__hint"},Zw={class:"va-confirm__need"},Gw=["placeholder"],Xw={key:1,class:"va-confirm__check"},Yw=["disabled"],Qw=we({__name:"VaConfirmHost",setup(e){const t=P(null),n=P(!1),s=P(!1),o=P(""),a=E(()=>{const h=t.value?.requireText;return!!h&&o.value!==h}),i=E(()=>!a.value),l=E(()=>{const h=t.value;if(h)return h.requireText?".va-confirm__input":h.tone==="danger"||h.tone==="warning"?".va-confirm__btn--cancel":".va-confirm__btn--confirm"});function r(){s.value=!1,o.value=""}function c(){const h=gn.state.queue[0];!h||t.value||(r(),t.value=h,Ge(()=>{n.value=!0}))}$e(()=>[gn.state.queue[0]?.id??null,t.value?.id??null],([h,g])=>{g===null&&h!==null&&c()},{flush:"post"}),$e(()=>t.value?gn.state.queue.some(h=>h.id===t.value.id):!0,h=>{!h&&t.value&&n.value&&(n.value=!1)},{flush:"post"});function u(h){const g=t.value;g&&(Id(g.id,h,s.value),n.value=!1)}function d(){t.value&&(t.value=null)}function _(){i.value&&u(!0)}return it(Ow),tt(()=>{zw(),gn.closeAll()}),(h,g)=>t.value?(v(),le(gl,{key:0,open:n.value,title:t.value.title,description:t.value.description,"initial-focus":l.value,closable:!1,role:"alertdialog",size:"sm",onClose:g[4]||(g[4]=m=>u(!1)),onClosed:d},{title:ye(()=>[f("span",{class:"va-confirm__heading","data-tone":t.value.tone},[t.value.icon?(v(),y("span",Nw,[t.value.tone==="danger"?(v(),y("svg",Uw,[...g[5]||(g[5]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M12 8v4.5M12 16h.01"},null,-1)])])):t.value.tone==="warning"?(v(),y("svg",Ww,[...g[6]||(g[6]=[f("path",{d:"M12 9v4M12 16.5h.01M10.3 3.9 2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"},null,-1)])])):(v(),y("svg",Vw,[...g[7]||(g[7]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{d:"M9.6 9.3a2.4 2.4 0 0 1 4.7.5c0 1.6-2.3 2-2.3 3.4"},null,-1),f("path",{d:"M12 16.5h.01"},null,-1)])]))])):R("",!0),f("span",qw,$(t.value.title),1)],8,jw)]),footer:ye(()=>[f("button",{type:"button",class:"va-act va-confirm__btn va-confirm__btn--cancel",onClick:g[2]||(g[2]=m=>u(!1))},$(t.value.cancelText),1),f("button",{type:"button",class:_e(["va-act va-confirm__btn va-confirm__btn--confirm",{"va-act--primary":t.value.tone==="default","va-confirm__btn--danger":t.value.tone==="danger","va-confirm__btn--warning":t.value.tone==="warning"}]),disabled:!i.value,onClick:g[3]||(g[3]=m=>u(!0))},$(t.value.confirmText),11,Yw)]),default:ye(()=>[f("div",Hw,[t.value.requireText?(v(),y("label",Kw,[f("span",Jw,[g[8]||(g[8]=de(" 请输入 ",-1)),f("code",Zw,$(t.value.requireText),1),g[9]||(g[9]=de(" 以确认 ",-1))]),ze(f("input",{"onUpdate:modelValue":g[0]||(g[0]=m=>o.value=m),class:"va-confirm__input",type:"text",autocomplete:"off",spellcheck:"false",placeholder:t.value.requireText,onKeydown:at(_,["enter"])},null,40,Gw),[[Ze,o.value]])])):R("",!0),t.value.checkboxLabel?(v(),y("label",Xw,[ze(f("input",{"onUpdate:modelValue":g[1]||(g[1]=m=>s.value=m),type:"checkbox"},null,512),[[hl,s.value]]),f("span",null,$(t.value.checkboxLabel),1)])):R("",!0)])]),_:1},8,["open","title","description","initial-focus"])):R("",!0)}});function ex(e={}){const t=e.stepMs??40,n=e.maxItems??8,s=e.disabled??!1,o=typeof window<"u"&&(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1);function a(i){return o||s?{"animation-delay":"0ms"}:{"animation-delay":`${Math.min(Math.max(i,0),n)*t}ms`}}return{delayStyle:a}}function Bd(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function aa(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),Bd(n.getTime())}function ec(e){const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function tc(e,t){const n=new Date(e,t,1),s=(n.getDay()+6)%7,o=aa(n.getTime(),-s);return Array.from({length:42},(a,i)=>{const l=aa(o,i),r=new Date(l);return{ts:l,day:r.getDate(),inMonth:r.getMonth()===t}})}const tx=[{id:"today",label:"今天",from:0,to:0},{id:"7d",label:"近 7 天",from:-6,to:0},{id:"30d",label:"近 30 天",from:-29,to:0}];function nx(e,t){const n=P(!1),s=P((()=>{const b=e.end??e.start??Date.now(),w=new Date(b);return[w.getFullYear(),w.getMonth()]})()),o=E(()=>[...tx,...e.presets??[]]),a=E(()=>tc(s.value[0],s.value[1])),i=E(()=>{const[b,w]=s.value;return tc(w===11?b+1:b,w===11?0:w+1)}),l=b=>{const[w,x]=s.value,k=x+b;return`${k<0?w-1:k>11?w+1:w} 年 ${(k%12+12)%12+1} 月`};function r(b){const[w,x]=s.value,k=x+b;s.value=[k<0?w-1:k>11?w+1:w,(k%12+12)%12]}const c=E(()=>e.start!==void 0&&e.end!==void 0?`${ec(e.start)} → ${ec(e.end)}`:e.placeholder??"选择日期范围"),u=P(null),d=P(null);function _(b,w){if(u.value===null)u.value=b,w.start(b),w.end(b),w.change({start:b,end:b});else{const[x,k]=u.value<=b?[u.value,b]:[b,u.value];u.value=null,w.start(x),w.end(k),w.change({start:x,end:k}),n.value=!1}}function h(b,w){const x=Bd(Date.now()),k=aa(x,b.from),C=aa(x,b.to);u.value=null,w.start(k),w.end(C),w.change({start:k,end:C}),n.value=!1}function g(b){const w=u.value??e.start,x=u.value!==null?d.value:e.end;return w!==void 0&&b===w?"start":x!=null&&b===x?"end":w!==void 0&&x!==null&&x!==void 0&&b>w&&b<x?"in":""}const m=b=>{n.value&&t.value&&!t.value.contains(b.target)&&(n.value=!1)};return it(()=>{typeof document<"u"&&document.addEventListener("mousedown",m)}),tt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",m)}),$e(()=>[e.start,e.end],()=>{(e.start===void 0||e.end===void 0)&&(u.value=e.start??null)},{immediate:!0}),{open:n,anchor:s,presets:o,leftGrid:a,rightGrid:i,monthLabel:l,summary:c,shiftMonth:r,onPick:_,applyPreset:h,hoverTs:d,cellState:g}}const sx={ref:"root",class:"va-drp"},ox=["aria-expanded"],ax={key:0,class:"va-drp__panel",role:"dialog","aria-label":"选择日期范围"},ix={class:"va-drp__presets"},lx=["onClick"],rx={class:"va-drp__calendars"},cx={class:"va-drp__cal"},ux={class:"va-drp__month"},dx=["aria-label"],fx=["data-state","data-out","data-today","aria-label","onClick","onMouseenter"],px={key:0,class:"va-drp__cal"},vx={class:"va-drp__month"},hx=["aria-label"],mx=["data-state","data-out","data-today","aria-label","onClick","onMouseenter"],_x={class:"va-drp__foot"},gx=we({__name:"VaDateRangePicker",props:{start:{},end:{},presets:{},placeholder:{},months:{}},emits:["update:start","update:end","change"],setup(e,{emit:t}){const n=e,s=t,o=Xe("root"),a={start:C=>s("update:start",C),end:C=>s("update:end",C),change:C=>s("change",C)},{open:i,presets:l,leftGrid:r,rightGrid:c,monthLabel:u,summary:d,shiftMonth:_,onPick:h,applyPreset:g,hoverTs:m,cellState:b}=nx(n,o),w=["一","二","三","四","五","六","日"],x=new Date,k=new Date(x.getFullYear(),x.getMonth(),x.getDate()).getTime();return(C,D)=>(v(),y("div",sx,[f("button",{class:"va-drp__trigger",type:"button","aria-expanded":p(i),"aria-haspopup":"dialog",onClick:D[0]||(D[0]=I=>i.value=!p(i))},[D[6]||(D[6]=f("span",{"aria-hidden":"true"},"▤",-1)),de(" "+$(p(d)),1)],8,ox),p(i)?(v(),y("div",ax,[f("div",ix,[(v(!0),y(J,null,ve(p(l),I=>(v(),y("button",{key:I.id,class:"va-act va-act--sm va-drp__preset",type:"button",onClick:L=>p(g)(I,a)},$(I.label),9,lx))),128))]),f("div",rx,[f("div",cx,[f("header",ux,[f("button",{class:"va-drp__nav",type:"button","aria-label":"上一个月",onClick:D[1]||(D[1]=I=>p(_)(-1))},"‹"),f("span",null,$(p(u)(0)),1)]),f("div",{class:"va-drp__grid",role:"grid","aria-label":p(u)(0)},[(v(),y(J,null,ve(w,I=>f("span",{key:I,class:"va-drp__wd","aria-hidden":"true"},$(I),1)),64)),(v(!0),y(J,null,ve(p(r),I=>(v(),y("button",{key:I.ts,class:"va-drp__day",type:"button","data-state":p(b)(I.ts),"data-out":!I.inMonth,"data-today":I.ts===p(k),"aria-label":new Date(I.ts).toLocaleDateString(),onClick:L=>p(h)(I.ts,a),onMouseenter:L=>m.value=I.ts,onMouseleave:D[2]||(D[2]=L=>m.value=null)},$(I.day),41,fx))),128))],8,dx)]),n.months!==1?(v(),y("div",px,[f("header",vx,[f("span",null,$(p(u)(1)),1),f("button",{class:"va-drp__nav",type:"button","aria-label":"下一个月",onClick:D[3]||(D[3]=I=>p(_)(1))},"›")]),f("div",{class:"va-drp__grid",role:"grid","aria-label":p(u)(1)},[(v(),y(J,null,ve(w,I=>f("span",{key:I,class:"va-drp__wd","aria-hidden":"true"},$(I),1)),64)),(v(!0),y(J,null,ve(p(c),I=>(v(),y("button",{key:I.ts,class:"va-drp__day",type:"button","data-state":p(b)(I.ts),"data-out":!I.inMonth,"data-today":I.ts===p(k),"aria-label":new Date(I.ts).toLocaleDateString(),onClick:L=>p(h)(I.ts,a),onMouseenter:L=>m.value=I.ts,onMouseleave:D[4]||(D[4]=L=>m.value=null)},$(I.day),41,mx))),128))],8,hx)])):R("",!0)]),f("footer",_x,[D[7]||(D[7]=f("span",{class:"va-drp__hint"},"点击两个日期确定范围",-1)),f("button",{class:"va-drp__clear",type:"button",onClick:D[5]||(D[5]=I=>{a.start(Date.now()),a.end(Date.now()),i.value=!1})},"跳到今天")])])):R("",!0)],512))}}),yx=["aria-label"],bx={class:"va-ns__head"},kx={class:"va-ns__title"},wx={key:0,class:"va-ns__count"},xx={key:0,class:"va-ns__empty va-fade-in"},Cx=["data-kind","data-unread"],$x=["onClick"],Ax={class:"va-ns__icon","aria-hidden":"true"},Dx={class:"va-ns__text"},Rx={class:"va-ns__t"},Sx={key:0,class:"va-ns__b"},Ex={key:1,class:"va-ns__time"},Tx={key:0,class:"va-ns__dot","aria-label":"未读"},Mx=we({__name:"VaNotificationStack",props:{notifications:{},title:{},relativeTime:{type:Boolean,default:!0},emptyLabel:{},maxHeight:{}},emits:["open","read","allRead"],setup(e,{emit:t}){const n=e,s=t,o=E(()=>n.notifications.length>0),a=Da(3e4,o),i=E(()=>n.notifications.filter(c=>c.unread).length),l={info:"i",success:"✓",warning:"!",danger:"✕",agent:"✦"};function r(c){const u=n.notifications.find(d=>d.id===c);u&&(u.unread&&s("read",c),s("open",u))}return(c,u)=>(v(),y("section",{class:"va-ns","aria-label":n.title??"通知"},[f("header",bx,[f("h3",kx,[de($(n.title??"通知")+" ",1),i.value?(v(),y("span",wx,$(i.value),1)):R("",!0)]),i.value?(v(),y("button",{key:0,class:"va-ns__allread",type:"button",onClick:u[0]||(u[0]=d=>s("allRead"))},"全部已读")):R("",!0)]),n.notifications.length?(v(),le(vs,{key:1,tag:"ul",name:"va-ns",class:"va-ns__list",style:Fe(n.maxHeight?{maxHeight:`${n.maxHeight}px`}:void 0)},{default:ye(()=>[(v(!0),y(J,null,ve(n.notifications,d=>(v(),y("li",{key:d.id,class:"va-ns__item","data-kind":d.kind??"info","data-unread":d.unread??!1},[f("button",{class:"va-ns__main",type:"button",onClick:_=>r(d.id)},[f("span",Ax,$(l[d.kind??"info"]),1),f("span",Dx,[f("span",Rx,$(d.title),1),d.body?(v(),y("span",Sx,$(d.body),1)):R("",!0),d.createdAt&&n.relativeTime?(v(),y("span",Ex,$(p(Ed)(d.createdAt,p(a))),1)):R("",!0)])],8,$x),d.unread?(v(),y("span",Tx)):R("",!0)],8,Cx))),128))]),_:1},8,["style"])):(v(),y("p",xx,$(n.emptyLabel??"没有新通知"),1))],8,yx))}}),Fx={class:"va-cs va-enter-up","aria-label":"变更摘要"},Ix={class:"va-cs__head"},Px={class:"va-cs__title"},Bx={class:"va-cs__stats",role:"status"},Lx={class:"va-cs__add"},Ox={class:"va-cs__del"},zx={class:"va-cs__files"},jx=["onClick"],Nx=["data-status"],Ux={class:"va-cs__path"},Wx={key:1,class:"va-cs__diff"},Vx={class:"va-cs__add"},qx={class:"va-cs__del"},Hx=we({__name:"VaChangeSummary",props:{title:{},files:{},duration:{},toolCalls:{},finishedAt:{},maxFiles:{}},emits:["openFile","toggleAll"],setup(e,{emit:t}){const n=e,s=t,o=E(()=>n.files.reduce((c,u)=>({additions:c.additions+(u.additions??0),deletions:c.deletions+(u.deletions??0)}),{additions:0,deletions:0})),a=P(!0),i=E(()=>n.maxFiles!==void 0?Math.max(0,n.files.length-n.maxFiles):0),l=E(()=>i.value&&a.value?n.files.slice(0,n.maxFiles):n.files),{delayStyle:r}=ex();return(c,u)=>(v(),y("section",Fx,[f("header",Ix,[f("span",Px,$(n.title??"本轮变更"),1),f("span",Bx,[de($(e.files.length)+" 个文件 ",1),o.value.additions||o.value.deletions?(v(),y(J,{key:0},[u[1]||(u[1]=de(" · ",-1)),f("b",Lx,"+"+$(o.value.additions),1),u[2]||(u[2]=de()),f("b",Ox,"−"+$(o.value.deletions),1)],64)):R("",!0),n.duration?(v(),y(J,{key:1},[de(" · "+$(p(ml)(n.duration)),1)],64)):R("",!0),n.toolCalls?(v(),y(J,{key:2},[de(" · "+$(n.toolCalls)+" 次工具调用",1)],64)):R("",!0)])]),f("ul",zx,[(v(!0),y(J,null,ve(l.value,(d,_)=>(v(),y("li",{key:d.path,class:"va-enter-up",style:Fe(p(r)(_))},[f("button",{class:"va-cs__file",type:"button",onClick:h=>s("openFile",d)},[d.status?(v(),y("span",{key:0,class:"va-cs__status","data-status":d.status},$(p(Oi)[d.status]),9,Nx)):R("",!0),f("span",Ux,$(d.path),1),d.additions||d.deletions?(v(),y("span",Wx,[f("b",Vx,"+"+$(d.additions??0),1),f("b",qx,"−"+$(d.deletions??0),1)])):R("",!0)],8,jx)],4))),128))]),i.value?(v(),y("button",{key:0,class:"va-cs__more",type:"button",onClick:u[0]||(u[0]=d=>{a.value=!a.value,s("toggleAll")})},$(a.value?`展开其余 ${i.value} 个文件`:`收起,只看前 ${n.maxFiles} 个`),1)):R("",!0)]))}}),Kx=["aria-label"],Jx=["onClick"],Zx={class:"va-bdc__label"},Gx={class:"va-bdc__track","aria-hidden":"true"},Xx={class:"va-bdc__value"},Yx={class:"va-bdc__pct"},Qx=we({__name:"VaBreakdownChart",props:{items:{},total:{},unit:{},barScale:{},maxRows:{}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,o=["var(--va-info)","var(--va-accent)","var(--va-success)","var(--va-warning)","var(--va-muted)"],a=(c,u)=>u?.color??o[c%o.length],i=E(()=>{const c=[...n.items].sort((_,h)=>h.value-_.value);let u=c;if(n.maxRows!==void 0&&c.length>n.maxRows){const _=c.slice(0,n.maxRows-1),h=c.slice(n.maxRows-1);u=[..._,{label:"其他",value:h.reduce((g,m)=>g+m.value,0)}]}const d=n.total??c.reduce((_,h)=>_+h.value,0);return u.map(_=>({..._,pct:d>0?_.value/d:0}))}),l=E(()=>Math.max(1,...i.value.map(c=>c.value))),r=c=>c.toLocaleString("en-US");return(c,u)=>(v(),y("div",{class:"va-bdc",role:"img","aria-label":`分布:${i.value.map(d=>`${d.label} ${Math.round(d.pct*100)}%`).join(",")}`},[(v(!0),y(J,null,ve(i.value,(d,_)=>(v(),y("button",{key:d.label,class:"va-bdc__row",type:"button",onClick:h=>s("select",d)},[f("span",{class:"va-bdc__swatch",style:Fe({background:a(_,d.label==="其他"?void 0:d)}),"aria-hidden":"true"},null,4),f("span",Zx,$(d.label),1),f("span",Gx,[f("span",{class:"va-bdc__bar",style:Fe({width:`${(n.barScale==="total"?d.pct:d.value/l.value)*100}%`,background:a(_,d.label==="其他"?void 0:d)})},null,4)]),f("span",Xx,$(r(d.value))+$(n.unit?` ${n.unit}`:""),1),f("span",Yx,$(Math.round(d.pct*100))+"%",1)],8,Jx))),128))],8,Kx))}});function eC(e,t,n){return{nodes:E(()=>{const o=e(),a=t(),i=[],l=/\[(\d+)\]/g;let r=0,c;for(;(c=l.exec(o))!==null;){c.index>r&&i.push(c[0]?Tt("span",o.slice(r,c.index)):Tt("span"));const u=Number(c[1])-1;a[u]?i.push(Tt("button",{class:"va-ans__cite",type:"button","aria-label":`查看来源 ${c[1]}`,onClick:()=>n(u)},c[1])):i.push(Tt("span",c[0])),r=c.index+c[0].length}return r<o.length&&i.push(Tt("span",o.slice(r))),i})}}const tC=["data-streaming"],nC={key:0,class:"va-ans__q"},sC={class:"va-ans__body"},oC={key:0,class:"va-ans__cursor","aria-hidden":"true"},aC={key:1,class:"va-ans__sr"},iC={key:1,class:"va-ans__sources"},lC={class:"va-ans__list"},rC=["onClick"],cC={class:"va-ans__no","aria-hidden":"true"},uC={class:"va-ans__src-main"},dC={class:"va-ans__src-title-text"},fC={key:0,class:"va-ans__origin"},pC=we({__name:"VaAiAnswer",props:{question:{},answer:{},sources:{},streaming:{type:Boolean},streamingLabel:{}},emits:["source"],setup(e,{emit:t}){const n=e,s=t;function o(i){const l=n.sources[i];l&&s("source",l)}const{nodes:a}=eC(()=>n.answer,()=>n.sources,o);return(i,l)=>(v(),y("article",{class:"va-ans","data-streaming":n.streaming??!1},[n.question?(v(),y("p",nC,$(n.question),1)):R("",!0),f("div",sC,[(v(!0),y(J,null,ve(p(a),(r,c)=>(v(),le(cl(r),{key:c}))),128)),n.streaming?(v(),y("span",oC)):R("",!0),n.streaming?(v(),y("span",aC,$(n.streamingLabel??"正在生成回答"),1)):R("",!0)]),n.sources.length?(v(),y("footer",iC,[l[0]||(l[0]=f("h4",{class:"va-ans__src-title"},"来源",-1)),f("ol",lC,[(v(!0),y(J,null,ve(n.sources,(r,c)=>(v(),y("li",{key:r.id},[f("button",{class:"va-ans__src",type:"button",onClick:u=>s("source",r)},[f("span",cC,$(c+1),1),f("span",uC,[f("span",dC,$(r.title),1),r.origin?(v(),y("span",fC,$(r.origin),1)):R("",!0)])],8,rC)]))),128))])])):R("",!0)],8,tC))}}),vC={key:0,class:"va-form__head"},hC={key:0,class:"va-form__title"},mC={key:1,class:"va-form__desc"},_C={class:"va-form__fields"},gC=["for"],yC={key:0,class:"va-form__req","aria-hidden":"true"},bC={key:1,class:"va-form__badge"},kC=["id"],wC={key:0,class:"va-form__req","aria-hidden":"true"},xC={key:1,class:"va-form__badge"},CC={class:"va-form__control-row"},$C=["id","onUpdate:modelValue","placeholder","disabled","aria-invalid","aria-describedby","onInput"],AC={key:2,class:"va-form__switch"},DC=["id","checked","disabled","onChange"],RC=["id","onUpdate:modelValue","type","placeholder","disabled","step","aria-invalid","aria-describedby","onInput"],SC={key:1,class:"va-form__unit"},EC=["id"],TC={key:3,class:"va-form__hint"},MC={class:"va-form__actions"},FC=we({__name:"VaForm",props:{title:{default:void 0},description:{default:void 0},fields:{},submitLabel:{default:"提交"},cancelLabel:{default:"取消"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fieldErrors:{default:void 0}},emits:["submit","cancel"],setup(e,{emit:t}){const n=e,s=t;function o(x){const k=x.default;switch(x.type){case"number":return typeof k=="number"&&Number.isFinite(k)?k:void 0;case"boolean":return typeof k=="boolean"?k:!1;case"select":return typeof k=="string"?k:"";default:return typeof k=="string"?k:""}}const a=P({}),i=P({}),l=P({}),r=P({});$e(()=>n.fields.map(x=>`${x.key}:${x.type}`).join("|"),()=>{const x={},k=n.fields.filter(C=>!/^(?:__proto__|constructor|prototype)$/.test(C.key));for(const C of k)x[C.key]=o(C);a.value=x,i.value={},l.value={},r.value={}},{immediate:!0});const d=x=>{if(i.value[x]=!0,r.value[x]=!0,l.value[x]){const{[x]:k,...C}=l.value;l.value=C}},_=x=>{if(l.value[x])return l.value[x];if(!r.value[x])return n.fieldErrors?.[x]},h=P({}),g=x=>x.type==="number"?"number":x.type==="date"?"date":x.secret?h.value[x.key]?"text":"password":"text",m=x=>x==null||typeof x=="string"&&x.trim()==="",b=()=>{const x={},k={};for(const C of n.fields){if(/^(?:__proto__|constructor|prototype)$/.test(C.key))continue;const D=a.value[C.key];if(C.type==="boolean"){x[C.key]=D===!0;continue}if(m(D)){C.required&&(k[C.key]="必填项"),x[C.key]=C.type==="number"?void 0:"";continue}if(C.type==="number"){const I=typeof D=="number"?D:Number(String(D).trim());if(!Number.isFinite(I)){k[C.key]="必须是数字",x[C.key]=void 0;continue}x[C.key]=I;continue}x[C.key]=String(D).trim()}return{values:x,errors:k}},w=()=>{if(n.disabled||n.loading)return;const{values:x,errors:k}=b();if(Object.keys(k).length>0){l.value=k;return}l.value={},r.value={},s("submit",x,Object.keys(i.value))};return(x,k)=>(v(),y("section",{class:_e(["va-form",{"va-form--disabled":e.disabled}])},[e.title||e.description?(v(),y("header",vC,[e.title?(v(),y("h4",hC,$(e.title),1)):R("",!0),e.description?(v(),y("p",mC,$(e.description),1)):R("",!0)])):R("",!0),f("div",_C,[(v(!0),y(J,null,ve(e.fields,C=>(v(),y("div",{key:C.key,class:"va-form__field"},[C.type!=="select"?(v(),y("label",{key:0,for:`va-form-${C.key}`,class:"va-form__label"},[de($(C.label)+" ",1),C.required?(v(),y("span",yC,"*")):R("",!0),C.secret?(v(),y("span",bC,"敏感")):R("",!0)],8,gC)):(v(),y("span",{key:1,id:`va-form-lbl-${C.key}`,class:"va-form__label"},[de($(C.label)+" ",1),C.required?(v(),y("span",wC,"*")):R("",!0),C.secret?(v(),y("span",xC,"敏感")):R("",!0)],8,kC)),f("div",CC,[C.type==="textarea"?ze((v(),y("textarea",{key:0,id:`va-form-${C.key}`,"onUpdate:modelValue":D=>a.value[C.key]=D,class:_e(["va-form__control va-form__control--area",{"va-form__control--error":_(C.key)}]),placeholder:C.placeholder,disabled:e.disabled,rows:"3",maxlength:"2000","aria-invalid":_(C.key)?"true":void 0,"aria-describedby":_(C.key)?`va-form-err-${C.key}`:void 0,onInput:D=>d(C.key)},null,42,$C)),[[Ze,a.value[C.key]]]):C.type==="select"?(v(),le(p(sa),{key:1,class:"va-form__select","model-value":a.value[C.key]||"",options:C.options||[],disabled:e.disabled,invalid:!!_(C.key),placeholder:C.placeholder||"请选择",label:C.label,"onUpdate:modelValue":D=>{a.value[C.key]=D,d(C.key)}},null,8,["model-value","options","disabled","invalid","placeholder","label","onUpdate:modelValue"])):C.type==="boolean"?(v(),y("label",AC,[f("input",{id:`va-form-${C.key}`,type:"checkbox",checked:a.value[C.key]===!0,disabled:e.disabled,onChange:D=>{a.value[C.key]=D.target.checked,d(C.key)}},null,40,DC),f("span",null,$(a.value[C.key]===!0?"是":"否"),1)])):(v(),y(J,{key:3},[ze(f("input",{id:`va-form-${C.key}`,"onUpdate:modelValue":D=>a.value[C.key]=D,class:_e(["va-form__control",{"va-form__control--error":_(C.key)}]),type:g(C),placeholder:C.placeholder,disabled:e.disabled,step:C.type==="number"?"any":void 0,maxlength:"2000","aria-invalid":_(C.key)?"true":void 0,"aria-describedby":_(C.key)?`va-form-err-${C.key}`:void 0,onInput:D=>d(C.key)},null,42,RC),[[xd,a.value[C.key]]]),C.secret?(v(),le(p(cs),{key:0,variant:"ghost",size:"sm",disabled:e.disabled,onClick:D=>h.value[C.key]=!h.value[C.key]},{default:ye(()=>[de($(h.value[C.key]?"隐藏":"显示"),1)]),_:2},1032,["disabled","onClick"])):R("",!0),C.unit?(v(),y("span",SC,$(C.unit),1)):R("",!0)],64))]),_(C.key)?(v(),y("p",{key:2,id:`va-form-err-${C.key}`,class:"va-form__error"},$(_(C.key)),9,EC)):C.description?(v(),y("p",TC,$(C.description),1)):R("",!0)]))),128))]),f("footer",MC,[O(p(cs),{variant:"primary",disabled:e.disabled||e.loading,onClick:w},{default:ye(()=>[de($(e.submitLabel),1)]),_:1},8,["disabled"]),O(p(cs),{variant:"secondary",disabled:e.disabled,onClick:k[0]||(k[0]=C=>s("cancel"))},{default:ye(()=>[de($(e.cancelLabel),1)]),_:1},8,["disabled"])]),je(x.$slots,"after-actions")],2))}}),IC=64;function PC(e,t){const n=IC,s=P(!0);let o=null,a=!1;function i(){const u=e.value;u&&(s.value=u.scrollHeight-u.scrollTop-u.clientHeight<n)}function l(){i()}function r(u){u?.force&&(a=!0),o===null&&(o=requestAnimationFrame(()=>{o=null;const d=a;if(a=!1,!d&&!s.value)return;const _=e.value;_&&(_.scrollTop=_.scrollHeight)}))}function c(){o!==null&&(cancelAnimationFrame(o),o=null,a=!1)}return On()&&tt(c),{isPinned:s,onScroll:l,updatePinned:i,scrollToBottom:r,dispose:c}}const BC={class:"va-board",role:"list","aria-label":"任务看板"},LC=["aria-label"],OC={class:"va-board__col-head"},zC={class:"va-board__col-title"},jC={class:"va-board__count"},NC={class:"va-board__cards"},UC={key:0,class:"va-board__none"},WC=["data-selected","onClick"],VC={class:"va-board__card-title"},qC={class:"va-board__card-foot"},HC=["data-priority","aria-label"],KC={key:1,class:"va-board__meta"},JC=["aria-label"],ZC=we({__name:"VaTaskBoard",props:{columns:{},tasks:{},selected:{},defaultSelected:{}},emits:["update:selected","open"],setup(e,{emit:t}){const n=e,s=t,o=P(!1),a=P(n.defaultSelected),i=E(()=>n.selected!==void 0||o.value?n.selected:a.value),l=c=>n.tasks.filter(u=>u.columnId===c);function r(c){o.value=!0,a.value=c.id,s("update:selected",c.id),s("open",c)}return(c,u)=>(v(),y("div",BC,[(v(!0),y(J,null,ve(n.columns,d=>(v(),y("section",{key:d.id,class:"va-board__col","aria-label":d.title},[f("header",OC,[f("span",zC,$(d.title),1),f("span",jC,$(d.hint??l(d.id).length),1)]),f("div",NC,[l(d.id).length?R("",!0):(v(),y("p",UC,"空")),(v(!0),y(J,null,ve(l(d.id),_=>(v(),y("button",{key:_.id,class:"va-board__card",type:"button","data-selected":_.id===i.value,onClick:h=>r(_)},[f("span",VC,$(_.title),1),f("span",qC,[_.priority?(v(),y("span",{key:0,class:"va-board__prio","data-priority":_.priority,"aria-label":`优先级:${_.priority}`},null,8,HC)):R("",!0),_.meta?(v(),y("span",KC,$(_.meta),1)):R("",!0),_.assignee?(v(),y("span",{key:2,class:"va-board__assignee","aria-label":`负责人 ${_.assignee}`},$(_.assignee.slice(0,1)),9,JC)):R("",!0)])],8,WC))),128))])],8,LC))),128))]))}}),GC=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n};function XC(e,t){const s=(t+e).replace(/\r\n|\r/g,`
6
+ `).split(`
7
+
8
+ `),o=s.pop()??"",a=[];for(const i of s){const l=[];for(const r of i.split(`
9
+ `))r.startsWith("data:")&&l.push(r.replace(/^data:\s*/,""));l.length!==0&&a.push(l.join(`
10
+ `))}return{payloads:a,buffer:o}}async function YC(e){const n=(await e.open()).body?.getReader();if(!n)throw new Error("ReadableStream not supported or empty response");const s=new TextDecoder("utf-8");let o="",a=!1;try{for(;;){const{done:i,value:l}=await n.read();if(i)break;const{payloads:r,buffer:c}=XC(s.decode(l,{stream:!0}),o);o=c;for(const u of r){if(u==="[DONE]"){e.onDone?.();continue}try{e.onEvent(JSON.parse(u))}catch(d){e.onParseError?e.onParseError(u,d):console.warn("[vuagent-ui] 解析 SSE 块失败:",u,d)}}}}catch(i){if(i?.name==="AbortError"||e.signal?.aborted)a=!0;else throw i}return{aborted:a}}const nc={schedule(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):(e(),null)},cancel(e){typeof e=="number"&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)}};function QC(e){const t=e.scheduler??nc;let n="",s=null;const o=()=>{s=null;const a=n;n="",a&&e.commit(a)};return{push(a){if(n+=a,s!==null)return;if(t===nc&&typeof requestAnimationFrame!="function"){o();return}const i=t.schedule(()=>{s===i&&o()});s=i},flush(){s!==null&&(t.cancel(s),s=null),o()},drop(){s!==null&&(t.cancel(s),s=null),n=""},get pendingText(){return n}}}const Wi=xu(new Map);function e$(e,t){const n=new Map(Wi.value);n.set(e,t),Wi.value=n}function Ld(e){return Wi.value.get(e)}const sc={};function t$(e){let t=sc[e];if(t)return t;t=sc[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function ms(e,t){typeof t!="string"&&(t=ms.defaultChars);const n=t$(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let a=0,i=s.length;a<i;a+=3){const l=parseInt(s.slice(a+1,a+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&a+3<i){const r=parseInt(s.slice(a+4,a+6),16);if((r&192)===128){const c=l<<6&1984|r&63;c<128?o+="��":o+=String.fromCharCode(c),a+=3;continue}}if((l&240)===224&&a+6<i){const r=parseInt(s.slice(a+4,a+6),16),c=parseInt(s.slice(a+7,a+9),16);if((r&192)===128&&(c&192)===128){const u=l<<12&61440|r<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),a+=6;continue}}if((l&248)===240&&a+9<i){const r=parseInt(s.slice(a+4,a+6),16),c=parseInt(s.slice(a+7,a+9),16),u=parseInt(s.slice(a+10,a+12),16);if((r&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|r<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),a+=9;continue}}o+="�"}return o})}ms.defaultChars=";/?:@&=+$,#";ms.componentChars="";const oc={};function n$(e){let t=oc[e];if(t)return t;t=oc[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function mn(e,t,n){typeof t!="string"&&(n=t,t=mn.defaultChars),typeof n>"u"&&(n=!0);const s=n$(t);let o="";for(let a=0,i=e.length;a<i;a++){const l=e.charCodeAt(a);if(n&&l===37&&a+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){o+=e.slice(a,a+3),a+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&a+1<i){const r=e.charCodeAt(a+1);if(r>=56320&&r<=57343){o+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[a])}return o}mn.defaultChars=";/?:@&=+$,-_.!~*'()#";mn.componentChars="-_.!~*'()";function Vi(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function ia(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const s$=/^([a-z0-9.+-]+:)/i,o$=/:[0-9]*$/,a$=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i$=["<",">",'"',"`"," ","\r",`
11
+ `," "],l$=["{","}","|","\\","^","`"].concat(i$),r$=["'"].concat(l$),ac=["%","/","?",";","#"].concat(r$),ic=["/","?","#"],c$=255,lc=/^[+a-z0-9A-Z_-]{0,63}$/,u$=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,rc={javascript:!0,"javascript:":!0},cc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function qi(e,t){if(e&&e instanceof ia)return e;const n=new ia;return n.parse(e,t),n}ia.prototype.parse=function(e,t){let n,s,o,a=e;if(a=a.trim(),!t&&e.split("#").length===1){const c=a$.exec(a);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let i=s$.exec(a);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,a=a.substr(i.length)),(t||i||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=a.substr(0,2)==="//",o&&!(i&&rc[i])&&(a=a.substr(2),this.slashes=!0)),!rc[i]&&(o||i&&!cc[i])){let c=-1;for(let g=0;g<ic.length;g++)s=a.indexOf(ic[g]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=a.lastIndexOf("@"):d=a.lastIndexOf("@",c),d!==-1&&(u=a.slice(0,d),a=a.slice(d+1),this.auth=u),c=-1;for(let g=0;g<ac.length;g++)s=a.indexOf(ac[g]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=a.length),a[c-1]===":"&&c--;const _=a.slice(0,c);a=a.slice(c),this.parseHost(_),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const g=this.hostname.split(/\./);for(let m=0,b=g.length;m<b;m++){const w=g[m];if(w&&!w.match(lc)){let x="";for(let k=0,C=w.length;k<C;k++)w.charCodeAt(k)>127?x+="x":x+=w[k];if(!x.match(lc)){const k=g.slice(0,m),C=g.slice(m+1),D=w.match(u$);D&&(k.push(D[1]),C.unshift(D[2])),C.length&&(a=C.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>c$&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=a.indexOf("#");l!==-1&&(this.hash=a.substr(l),a=a.slice(0,l));const r=a.indexOf("?");return r!==-1&&(this.search=a.substr(r),a=a.slice(0,r)),a&&(this.pathname=a),cc[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ia.prototype.parseHost=function(e){let t=o$.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const d$=Object.freeze(Object.defineProperty({__proto__:null,decode:ms,encode:mn,format:Vi,parse:qi},Symbol.toStringTag,{value:"Module"})),Od=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zd=/[\0-\x1F\x7F-\x9F]/,f$=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,yl=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,jd=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,Nd=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,p$=Object.freeze(Object.defineProperty({__proto__:null,Any:Od,Cc:zd,Cf:f$,P:yl,S:jd,Z:Nd},Symbol.toStringTag,{value:"Module"})),v$=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function h$(e){return e===0||e>=55296&&e<=57343||e>1114111}function m$(e){return h$(e)?65533:e>=128&&e<=159&&v$[e-128]||e}function _$(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(m$(e))}const zt=(()=>{const e=new Uint8Array(127);let t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function g$(e,t,n,s,o,a){const l=e.length,r=a*90;let c=0;const u=()=>{const X=zt[e.charCodeAt(c++)];return X<a?X:X*91-r+zt[e.charCodeAt(c++)]},d=n-s,_=n+o,h=new Int32Array(_);h.fill(-1,s,a),h.fill(-1,a+d,_);const g=new Int32Array(_),m=new Int32Array(_);function b(X,oe){let Y=0,N=oe;const U=oe+X;for(;N<U;){const ne=zt[e.charCodeAt(c++)];if(ne<89)Y+=ne,h[N++]=Y;else if(ne===89){let ie=zt[e.charCodeAt(c++)]+2;for(;ie--;)h[N++]=++Y}else{const ie=zt[e.charCodeAt(c++)];Y+=89+(ie<90?ie*91+zt[e.charCodeAt(c++)]:zt[e.charCodeAt(c++)]*8281+zt[e.charCodeAt(c++)]*91+zt[e.charCodeAt(c++)]),h[N++]=Y}}}b(s,0),b(d,a);const w=new Int32Array(o*2);let x=0,k=0;function C(X,oe){for(let Y=0;Y<X;Y++){const N=oe+Y,U=u(),ne=u();w[k*2]=U,w[k*2+1]=ne,k+=1,g[N]=x;const ie=(h[U]<0?m[U]:1)+(h[ne]<0?m[ne]:1);m[N]=ie,x+=ie}}C(o-a+s,a+d),C(a-s,s);const D=new Uint16Array(x);let I=0;for(let X=0;X<k;X++)for(let oe=0;oe<2;oe++){const Y=w[X*2+oe],N=h[Y];if(N<0){let U=g[Y];const ne=U+m[Y];for(;U<ne;)D[I++]=D[U++]}else D[I++]=N}const L=new Uint16Array(t);let K=0;for(;c<l;){let X=zt[e.charCodeAt(c++)];X>=a&&(X=X*91-r+zt[e.charCodeAt(c++)]);const oe=h[X];if(oe<0){let Y=g[X];const N=Y+m[X];for(;Y<N;)L[K++]=D[Y++]}else L[K++]=oe}return L}const y$=g$("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61);var ot;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE",e[e.VALUE_MASK=8191]="VALUE_MASK"})(ot||(ot={}));var kt;(function(e){e[e.AMP=38]="AMP",e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_X=120]="LOWER_X"})(kt||(kt={}));const la=32,Ud=21,b$=2097151,Hi=2047;let Wd=0;function k$(e){const t=e>>>Ud;return t===Hi?Wd:t}function w$(e){return e-kt.ZERO>>>0<=9}function x$(e){return(e|la)-kt.LOWER_A>>>0<=5}function C$(e){return(e|la)-kt.LOWER_A>>>0<=25}var uc;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(uc||(uc={}));var dc;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(dc||(dc={}));function $$(e,t,n,s){const o=(t&ot.BRANCH_LENGTH)>>7,a=t&ot.JUMP_TABLE;if(a){if(o===0)return s===a?n:-1;const r=s-a;if(r>>>0>=o)return-1;const c=e[n+r];return c===0?-1:n+o+c-1&65535}if(o===0)return-1;const i=o+1>>1,l=n+i+o;for(let r=0;r<o;r++){const u=e[n+(r>>1)]>>((r&1)<<3)&255;if(u===s){const d=n+i+r;return l+e[d]&65535}if(u>s)return-1}return-1}function fc(e,t,n){return n===1?String.fromCharCode(e[t]&ot.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function A$(e,t,n){let s=t+1,o=0,a=s;if(s<n&&(e.charCodeAt(s)|la)===kt.LOWER_X)for(s+=1,a=s;s<n;){const l=e.charCodeAt(s);if(w$(l))o=o*16+(l-kt.ZERO);else if(x$(l))o=o*16+((l|la)-kt.LOWER_A+10);else break;s+=1}else for(;s<n;){const l=e.charCodeAt(s)-kt.ZERO;if(l>>>0>9)break;o=o*10+l,s+=1}if(s===a)return 0;s<n&&e.charCodeAt(s)===kt.SEMI&&(s+=1),o>1114111&&(o=1114112);let i=s-t;return i>=Hi&&(Wd=i,i=Hi),i<<Ud|o}function D$(e,t,n){const s=y$;let o=e.indexOf("&");if(o<0)return e;const a=e.length;let i=0,l="";const r=s[0],c=r&ot.JUMP_TABLE,u=(r&ot.BRANCH_LENGTH)>>7;do{const d=o+1,_=e.charCodeAt(d);let h,g;if(_===kt.NUM){const m=A$(e,d,a);h=k$(m),h>0&&e.charCodeAt(d+h-1)!==kt.SEMI&&(h=0),g=h===0?"":_$(m&b$)}else if(C$(_)){h=0,g="";const m=_-c;let b;if(m>>>0<u){const D=s[1+m];b=D===0?-1:u+D&65535}else b=-1;let w=0,x=0,k=b<0?0:s[b],C=d+1;e:for(;C<a;){for(;(k&(ot.VALUE_LENGTH|ot.FLAG13))===0&&(k&ot.JUMP_TABLE)!==0;){const K=k&ot.JUMP_TABLE,X=(k&ot.BRANCH_LENGTH)>>7;if(X===0){if(e.charCodeAt(C)!==K)break e;b+=1}else{const oe=e.charCodeAt(C)-K;if(oe>>>0>=X)break e;const Y=s[b+1+oe];if(Y===0)break e;b=b+X+Y&65535}if(k=s[b],C+=1,C>=a)break e}if((k&(ot.VALUE_LENGTH|ot.FLAG13))===ot.FLAG13){const K=(k&ot.BRANCH_LENGTH)>>7;if(e.charCodeAt(C)!==(k&ot.JUMP_TABLE))break;C+=1;const X=K-1;let oe=b+1,Y=0;for(;Y+1<X;Y+=2){const N=s[oe];if(e.charCodeAt(C)!==(N&255)||(C+=1,e.charCodeAt(C)!==(N>>8&255)))break e;C+=1,oe+=1}if(Y<X){if(e.charCodeAt(C)!==(s[oe]&255))break;C+=1}b+=1+(K>>1),k=s[b];continue}const D=k>>>14,I=e.charCodeAt(C);if(D!==0){if(I===kt.SEMI){h=C-d+1,g=D===1?String.fromCharCode(k&ot.VALUE_MASK):fc(s,b,D);break}if(D===1)break}const L=$$(s,k,b+(D||1),I);if(L<0)break;b=L,k=s[b],C+=1}g===""&&h>0&&(g=fc(s,w,x))}else h=0,g="";h===0||n?o=d:(i<o&&(l+=e.slice(i,o)),l+=g,o=i=d+h),e.charCodeAt(o)!==kt.AMP&&(o=e.indexOf("&",o))}while(o>=0);return l+e.slice(i)}function Vd(e){return D$(e,!0,!1)}var R$=class{src_Any=Od.source;src_Cc=zd.source;src_Z=Nd.source;src_P=yl.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const s=this.escapeRE(e),o=this.escapeRE(t),a=`(?:(?!${this.src_ZCc}|${s}|${o}).)`;let i=`${s}${a}{0,1000}${o}`;for(let l=2;l<=n;l++)i=`${s}(?:${a}|${i}){0,1000}${o}`;return i}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},ri={validate:(e,t,n)=>{const s=n.re.get_http_validator();s.lastIndex=t;const o=s.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},S$={"http:":ri,"https:":ri,"ftp:":ri,"//":{validate:function(e,t,n){const s=n.re.get_relative_proto_validator();s.lastIndex=t;const o=s.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const s=n.re.get_mailto_validator();s.lastIndex=t;const o=s.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},E$="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",T$="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function M$(){const e=T$.split("|");return E$.split("|").forEach(t=>{const n=t.indexOf(":"),s=t.slice(0,n);for(const o of t.slice(n+1))e.push(s+o)}),e}var F$={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:M$(),urlAuth:!1,maxLength:1e4},pc=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,s){const o=e.slice(n,s);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=s,this.raw=o,this.text=o,this.url=o}},I$=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...F$,...n},this.__schemas__={...S$},this.re=t||new R$,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(s,o)=>o.normalize(s),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const s=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(s.lastIndex=0;(t=s.exec(e))!==null;){const a=e.slice(Math.max(0,t.index-65),t.index);if(o.test(a))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let s,o,a,i,l,r,c=!1,u=!1,d=!1,_=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(s=this.re.get_fuzzy_link_search(),s.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,a=this.re.get_mail_name_validator());;){const h=Math.max(_-1,0);if(o&&a&&!d&&(!l||l.index<_))for(o.lastIndex<h&&(o.lastIndex=h);;){const x=o.exec(e);if(!x){d=!0,l=void 0;break}const k=a.exec(e.slice(Math.max(0,x.index-65),x.index));if(k){if(l={schema:"mailto:",index:x.index-k[1].length,lastIndex:x.index+x[0].length},l.index>=_)break;o.lastIndex<h&&(o.lastIndex=h)}}if(s&&!u&&(!i||i.index<_))for(s.lastIndex<h&&(s.lastIndex=h);;){const x=s.exec(e);if(!x){u=!0,i=void 0;break}if(i={schema:"",index:x.index+x[1].length,lastIndex:x.index+x[0].length},i.index>=_)break;s.lastIndex<h&&(s.lastIndex=h)}let g=l;(!g||i&&(i.index<g.index||i.index===g.index&&i.lastIndex>g.lastIndex))&&(g=i);let m;if(!c)for(;;){if(!r){n.lastIndex<h&&(n.lastIndex=h);const C=n.exec(e);if(!C){c=!0;break}r={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(r.index<_){r=void 0;continue}if(g&&r.index>g.index)break;const x=r;r=void 0;const k=this.testSchemaAt(e,x.schema,x.lastIndex);if(k){m={schema:x.schema,index:x.index,lastIndex:x.lastIndex+k};break}}let b=m;if((!b||l&&(l.index<b.index||l.index===b.index&&l.lastIndex>b.lastIndex))&&(b=l),(!b||i&&(i.index<b.index||i.index===b.index&&i.lastIndex>b.lastIndex))&&(b=i),!b)break;b===l?l=void 0:b===i&&(i=void 0);const w=new pc(e,b.schema,b.index,b.lastIndex);w.schema?this.__schemas__[w.schema].normalize(w,this):this.normalize(w),t.push(w),_=b.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const s=new pc(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[s.schema].normalize(s,this),s}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const us=2147483647,Yt=36,bl=1,Qs=26,P$=38,B$=700,qd=72,Hd=128,Kd="-",L$=/^xn--/,O$=/[^\0-\x7F]/,z$=/[\x2E\u3002\uFF0E\uFF61]/g,j$={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ci=Yt-bl,Qt=Math.floor,ui=String.fromCharCode;function Sn(e){throw new RangeError(j$[e])}function N$(e,t){const n=[];let s=e.length;for(;s--;)n[s]=t(e[s]);return n}function Jd(e,t){const n=e.split("@");let s="";n.length>1&&(s=n[0]+"@",e=n[1]),e=e.replace(z$,".");const o=e.split("."),a=N$(o,t).join(".");return s+a}function Zd(e){const t=[];let n=0;const s=e.length;for(;n<s;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<s){const a=e.charCodeAt(n++);(a&64512)==56320?t.push(((o&1023)<<10)+(a&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const U$=e=>String.fromCodePoint(...e),W$=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Yt},vc=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Gd=function(e,t,n){let s=0;for(e=n?Qt(e/B$):e>>1,e+=Qt(e/t);e>ci*Qs>>1;s+=Yt)e=Qt(e/ci);return Qt(s+(ci+1)*e/(e+P$))},Xd=function(e){const t=[],n=e.length;let s=0,o=Hd,a=qd,i=e.lastIndexOf(Kd);i<0&&(i=0);for(let l=0;l<i;++l)e.charCodeAt(l)>=128&&Sn("not-basic"),t.push(e.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){const r=s;for(let u=1,d=Yt;;d+=Yt){l>=n&&Sn("invalid-input");const _=W$(e.charCodeAt(l++));_>=Yt&&Sn("invalid-input"),_>Qt((us-s)/u)&&Sn("overflow"),s+=_*u;const h=d<=a?bl:d>=a+Qs?Qs:d-a;if(_<h)break;const g=Yt-h;u>Qt(us/g)&&Sn("overflow"),u*=g}const c=t.length+1;a=Gd(s-r,c,r==0),Qt(s/c)>us-o&&Sn("overflow"),o+=Qt(s/c),s%=c,t.splice(s++,0,o)}return String.fromCodePoint(...t)},Yd=function(e){const t=[];e=Zd(e);const n=e.length;let s=Hd,o=0,a=qd;for(const r of e)r<128&&t.push(ui(r));const i=t.length;let l=i;for(i&&t.push(Kd);l<n;){let r=us;for(const u of e)u>=s&&u<r&&(r=u);const c=l+1;r-s>Qt((us-o)/c)&&Sn("overflow"),o+=(r-s)*c,s=r;for(const u of e)if(u<s&&++o>us&&Sn("overflow"),u===s){let d=o;for(let _=Yt;;_+=Yt){const h=_<=a?bl:_>=a+Qs?Qs:_-a;if(d<h)break;const g=d-h,m=Yt-h;t.push(ui(vc(h+g%m,0))),d=Qt(g/m)}t.push(ui(vc(d,0))),a=Gd(o,c,l===i),o=0,++l}++o,++s}return t.join("")},V$=function(e){return Jd(e,function(t){return L$.test(t)?Xd(t.slice(4).toLowerCase()):t})},q$=function(e){return Jd(e,function(t){return O$.test(t)?"xn--"+Yd(t):t})},hc={version:"2.3.1",ucs2:{decode:Zd,encode:U$},decode:Xd,encode:Yd,toASCII:q$,toUnicode:V$};var mc=Object.defineProperty,Qd=(e,t)=>{let n={};for(var s in e)mc(n,s,{get:e[s],enumerable:!0});return mc(n,Symbol.toStringTag,{value:"Module"}),n},H$=Qd({arrayReplaceAt:()=>K$,asciiTrim:()=>Sa,callable:()=>ef,escapeHtml:()=>Ln,escapeRE:()=>s3,fromCodePoint:()=>eo,isMdAsciiPunct:()=>so,isPunctChar:()=>nf,isPunctCharCode:()=>no,isSpace:()=>Ve,isValidEntityCode:()=>kl,isWhiteSpace:()=>to,lib:()=>o3,normalizeReference:()=>Ra,unescapeAll:()=>_s,unescapeMd:()=>X$});function ef(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function K$(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function kl(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function eo(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var tf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,J$=new RegExp(`${tf.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Z$=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function G$(e,t){if(t.charCodeAt(0)===35&&Z$.test(t)){const s=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return kl(s)?eo(s):e}const n=Vd(e);return n!==e?n:e}function X$(e){return e.indexOf("\\")<0?e:e.replace(tf,"$1")}function _s(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(J$,function(t,n,s){return n||G$(t,s)})}var Y$=/[&<>"]/,Q$=/[&<>"]/g,e3={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function t3(e){return e3[e]}function Ln(e){return Y$.test(e)?e.replace(Q$,t3):e}var n3=/[.?*+^$[\]\\(){}|-]/g;function s3(e){return e.replace(n3,"\\$&")}function Ve(e){switch(e){case 9:case 32:return!0}return!1}function to(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function nf(e){return yl.test(e)||jd.test(e)}function no(e){return nf(eo(e))}function so(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ra(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function _c(e){return e===32||e===9||e===10||e===13}function Sa(e){let t=0;for(;t<e.length&&_c(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&_c(e.charCodeAt(n));n--);return e.slice(t,n+1)}var o3={mdurl:d$,ucmicro:p$};function a3(e,t,n){let s,o,a,i;const l=e.posMax,r=e.pos;for(e.pos=t+1,s=1;e.pos<l;){if(a=e.src.charCodeAt(e.pos),a===93&&(s--,s===0)){o=!0;break}if(i=e.pos,e.md.inline.skipToken(e),a===91){if(i===e.pos-1)s++;else if(n)return e.pos=r,-1}}let c=-1;return o&&(c=e.pos),e.pos=r,c}function i3(e,t,n){let s,o=t;const a={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return a;if(s===62)return a.pos=o+1,a.str=_s(e.slice(t+1,o)),a.ok=!0,a;if(s===92&&o+1<n){o+=2;continue}o++}return a}let i=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32){o++;continue}o+=2;continue}if(s===40&&(i++,i>32))return a;if(s===41){if(i===0)break;i--}o++}return t===o||i!==0||(a.str=_s(e.slice(t,o)),a.pos=o,a.ok=!0),a}function l3(e,t,n,s){let o,a=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)i.str=s.str,i.marker=s.marker;else{if(a>=n)return i;let l=e.charCodeAt(a);if(l!==34&&l!==39&&l!==40)return i;t++,a++,l===40&&(l=41),i.marker=l}for(;a<n;){if(o=e.charCodeAt(a),o===i.marker)return i.pos=a+1,i.str+=_s(e.slice(t,a)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&a+1<n&&a++,a++}return i.can_continue=!0,i.str+=_s(e.slice(t,a)),i}var r3=Qd({parseLinkDestination:()=>i3,parseLinkLabel:()=>a3,parseLinkTitle:()=>l3});function oo(e){"@babel/helpers - typeof";return oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oo(e)}function c3(e,t){if(oo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(oo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function u3(e){var t=c3(e,"string");return oo(t)=="symbol"?t:t+""}function ge(e,t,n){return(t=u3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yn=class{constructor(e,t,n){ge(this,"map",null),ge(this,"level",0),ge(this,"children",null),ge(this,"content",""),ge(this,"markup",""),ge(this,"info",""),ge(this,"block",!1),ge(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ao=class{constructor(){ge(this,"__rules__",[]),ge(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const s=this.__find__(e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[s].fn=t,this.__rules__[s].alt=n.alt||[],this.__cache__=null}before(e,t,n,s={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null}after(e,t,n,s={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(s=>{const o=this.__find__(s);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}this.__rules__[o].enabled=!0,n.push(s)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(s=>{const o=this.__find__(s);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}this.__rules__[o].enabled=!1,n.push(s)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},on={};on.code_inline=function(e,t,n,s,o){const a=e[t];return`<code${o.renderAttrs(a)}>${Ln(a.content)}</code>`};on.code_block=function(e,t,n,s,o){const a=e[t];return`<pre${o.renderAttrs(a)}><code>${Ln(e[t].content)}</code></pre>
12
+ `};on.fence=function(e,t,n,s,o){const a=e[t],i=a.info?_s(a.info).trim():"";let l="",r="";if(i){const u=i.split(/(\s+)/g);l=u[0],r=u.slice(2).join("")}let c;if(n.highlight?c=n.highlight(a.content,l,r)||Ln(a.content):c=Ln(a.content),c.indexOf("<pre")===0)return c+`
13
+ `;if(i){const u=a.attrIndex("class"),d=a.attrs?a.attrs.slice():[];u<0?d.push(["class",`${n.langPrefix}${l}`]):(d[u]=[d[u][0],d[u][1]],d[u][1]+=` ${n.langPrefix}${l}`);const _={attrs:d};return`<pre><code${o.renderAttrs(_)}>${c}</code></pre>
14
+ `}return`<pre><code${o.renderAttrs(a)}>${c}</code></pre>
15
+ `};on.image=function(e,t,n,s,o){const a=e[t];return a.attrs[a.attrIndex("alt")][1]=o.renderInlineAsText(a.children,n,s),o.renderToken(e,t,n)};on.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
16
+ `:`<br>
17
+ `};on.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
18
+ `:`<br>
19
+ `:`
20
+ `};on.text=function(e,t){return Ln(e[t].content)};on.html_block=function(e,t){return e[t].content};on.html_inline=function(e,t){return e[t].content};var sf=class{constructor(){ge(this,"rules",Object.assign({},on))}renderAttrs(e){let t,n,s;if(!e.attrs)return"";for(s="",t=0,n=e.attrs.length;t<n;t++)s+=` ${Ln(e.attrs[t][0])}="${Ln(String(e.attrs[t][1]))}"`;return s}renderToken(e,t,n){const s=e[t];let o="";if(s.hidden)return"";let a=t-1;for(;a>=0&&e[a].hidden&&e[a].nesting===0;)a--;s.block&&s.nesting!==-1&&a>=0&&e[a].hidden&&e[a].nesting===-1&&(o+=`
21
+ `),o+=(s.nesting===-1?"</":"<")+s.tag,o+=this.renderAttrs(s),s.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(s.block&&(i=!0,s.nesting===1)){let l=t+1;for(;l<e.length&&e[l].hidden&&e[l].nesting===0;)l++;if(l<e.length){const r=e[l];(r.type==="inline"||r.hidden||r.nesting===-1&&r.tag===s.tag)&&(i=!1)}}return o+=i?`>
22
+ `:">",o}renderInline(e,t,n){let s="";const o=this.rules;for(let a=0,i=e.length;a<i;a++){const l=e[a].type;typeof o[l]<"u"?s+=o[l](e,a,t,n,this):s+=this.renderToken(e,a,t)}return s}renderInlineAsText(e,t,n){let s="";for(let o=0,a=e.length;o<a;o++)switch(e[o].type){case"text":case"code_inline":s+=e[o].content;break;case"image":s+=this.renderInlineAsText(e[o].children,t,n);break;case"html_inline":case"html_block":s+=e[o].content;break;case"softbreak":case"hardbreak":s+=`
23
+ `}return s}render(e,t,n){let s="";const o=this.rules;for(let a=0,i=e.length;a<i;a++){const l=e[a].type;l==="inline"?s+=this.renderInline(e[a].children,t,n):typeof o[l]<"u"?s+=o[l](e,a,t,n,this):s+=this.renderToken(e,a,t)}return s}},of=class{constructor(e,t,n){ge(this,"tokens",[]),ge(this,"inlineMode",!1),ge(this,"Token",Yn),this.src=e,this.env=n,this.md=t}},d3=/\r\n?/g,f3=/\0/g;function p3(e){let t;t=e.src.replace(d3,`
24
+ `),t=t.replace(f3,"�"),e.src=t}function v3(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function h3(e){const t=e.tokens;let n=0;for(let s=0;s<t.length;s++)t[s].type!=="reference_definition"&&(s!==n&&(t[n]=t[s]),n++);t.length!==n&&(t.length=n)}function m3(e){const t=e.tokens;for(let n=0,s=t.length;n<s;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function _3(e){return/^<a[>\s]/i.test(e)}function g3(e){return/^<\/a\s*>/i.test(e)}function y3(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,s=t.length;n<s;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;const o=t[n].children,a=[];let i=0;for(let l=o.length-1;l>=0;l--){const r=o[l];if(r.type==="link_close"){for(l--;o[l].level!==r.level&&o[l].type!=="link_open";)l--;continue}if(r.type==="html_inline"&&(_3(r.content)&&i>0&&i--,g3(r.content)&&i++),!(i>0)&&r.type==="text"&&e.md.linkify.test(r.content)){const c=r.content;let u=e.md.linkify.match(c);const d=[];let _=r.level,h=0;u.length>0&&u[0].index===0&&l>0&&o[l-1].type==="text_special"&&(u=u.slice(1));for(let g=0;g<u.length;g++){const m=u[g].url,b=e.md.normalizeLink(m);if(!e.md.validateLink(b))continue;let w=u[g].text;u[g].schema?u[g].schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText(`mailto:${w}`).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText(`http://${w}`).replace(/^http:\/\//,"");const x=u[g].index;if(x>h){const I=new e.Token("text","",0);I.content=c.slice(h,x),I.level=_,d.push(I)}const k=new e.Token("link_open","a",1);k.attrs=[["href",b]],k.level=_++,k.markup="linkify",k.info="auto",d.push(k);const C=new e.Token("text","",0);C.content=w,C.level=_,d.push(C);const D=new e.Token("link_close","a",-1);D.level=--_,D.markup="linkify",D.info="auto",d.push(D),h=u[g].lastIndex}if(h<c.length){const g=new e.Token("text","",0);g.content=c.slice(h),g.level=_,d.push(g)}a.push({index:l,nodes:d})}}if(a.length>0){let l=o.length;for(const d of a)l+=d.nodes.length-1;const r=new Array(l);let c=0,u=0;a.reverse();for(let d=0;d<o.length;d++){const _=a[c];if(_?.index===d){for(const h of _.nodes)r[u++]=h;c++}else r[u++]=o[d]}t[n].children=r}}}var af=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,b3=/\((c|tm|r)\)/i,k3=/\((c|tm|r)\)/gi,w3={c:"©",r:"®",tm:"™"};function x3(e,t){return w3[t.toLowerCase()]}function C3(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(k3,x3)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function $3(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&af.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function A3(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(b3.test(e.tokens[t].content)&&C3(e.tokens[t].children),af.test(e.tokens[t].content)&&$3(e.tokens[t].children))}var D3=/['"]/,gc=/['"]/g,yc="’",R3=1e3;function bc(e,t,n){for(;e.length>n;){const s=e.pop();s.isSingleQuote?t.single=s.prevSameQuoteIdx:t.double=s.prevSameQuoteIdx}}function Fo(e,t,n,s){e[t]||(e[t]=[]),e[t].push({pos:n,ch:s})}function S3(e,t){let n="",s=0;t.sort((o,a)=>o.pos-a.pos);for(let o=0;o<t.length;o++){const a=t[o];n+=e.slice(s,a.pos)+a.ch,s=a.pos+1}return n+e.slice(s)}function E3(e,t){let n;const s=[],o={single:-1,double:-1},a={};for(let i=0;i<e.length;i++){const l=e[i],r=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=r);n--);if(bc(s,o,n+1),l.type!=="text")continue;const c=l.content;let u=0;const d=c.length;e:for(;u<d;){gc.lastIndex=u;const _=gc.exec(c);if(!_)break;let h=!0,g=!0;u=_.index+1;const m=_[0]==="'";let b=32;if(_.index-1>=0)b=c.charCodeAt(_.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){b=e[n].content.charCodeAt(e[n].content.length-1);break}let w=32;if(u<d)w=c.charCodeAt(u);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){w=e[n].content.charCodeAt(0);break}const x=so(b)||no(b),k=so(w)||no(w),C=to(b),D=to(w);if(D?h=!1:k&&(C||x||(h=!1)),C?g=!1:x&&(D||k||(g=!1)),w===34&&_[0]==='"'&&b>=48&&b<=57&&(g=h=!1),h&&g&&(h=x,g=k),!h&&!g){m&&Fo(a,i,_.index,yc);continue}if(g&&(n=m?o.single:o.double,n>=0&&s[n].level===r)){const I=s[n];let L,K;m?(L=t.md.options.quotes[2],K=t.md.options.quotes[3]):(L=t.md.options.quotes[0],K=t.md.options.quotes[1]),Fo(a,i,_.index,K),Fo(a,I.tokenIdx,I.contentPos,L),bc(s,o,n);continue e}if(h){if(s.length>=R3)return;s.push({tokenIdx:i,contentPos:_.index,isSingleQuote:m,level:r,prevSameQuoteIdx:m?o.single:o.double}),m?o.single=s.length-1:o.double=s.length-1}else g&&m&&Fo(a,i,_.index,yc)}}Object.keys(a).forEach(function(i){const l=Number(i);e[l].content=S3(e[l].content,a[i])})}function T3(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!D3.test(e.tokens[t].content)||E3(e.tokens[t].children,e)}function M3(e){let t,n;const s=e.length;for(t=0;t<s;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<s;t++)e[t].type==="text"&&t+1<s&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function F3(e){let t,n;const s=e.tokens,o=s.length;for(let a=0;a<o;a++){if(s[a].type!=="inline")continue;const i=s[a].children,l=i.length;for(t=0;t<l;t++)i[t].type==="text_special"&&(i[t].type="text"),i[t].children&&M3(i[t].children);for(t=n=0;t<l;t++)i[t].type==="text"&&t+1<l&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var di=[["normalize",p3],["block",v3],["strip_references",h3],["inline",m3],["linkify",y3],["replacements",A3],["smartquotes",T3],["text_join",F3]],lf=class{constructor(){ge(this,"ruler",new ao),ge(this,"State",of);for(let e=0;e<di.length;e++)this.ruler.push(di[e][0],di[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,s=t.length;n<s;n++)t[n](e)}},rf=class{constructor(e,t,n,s){ge(this,"bMarks",[]),ge(this,"eMarks",[]),ge(this,"tShift",[]),ge(this,"sCount",[]),ge(this,"bsCount",[]),ge(this,"blkIndent",0),ge(this,"line",0),ge(this,"lineMax",0),ge(this,"tight",!1),ge(this,"listIndent",-1),ge(this,"parentType","root"),ge(this,"level",0),ge(this,"Token",Yn),this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;for(let a=0,i=0,l=0,r=0,c=o.length,u=!1;i<c;i++){const d=o.charCodeAt(i);if(!u)if(Ve(d)){l++,d===9?r+=4-r%4:r++;continue}else u=!0;(d===10||i===c-1)&&(d!==10&&i++,this.bMarks.push(a),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(r),this.bsCount.push(0),u=!1,l=0,r=0,a=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const s=new Yn(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Ve(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Ve(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";const o=new Array(t-e);for(let a=0,i=e;i<t;i++,a++){let l=0;const r=this.bMarks[i];let c=r,u;for(i+1<t||s?u=this.eMarks[i]+1:u=this.eMarks[i];c<u&&l<n;){const d=this.src.charCodeAt(c);if(Ve(d))d===9?l+=4-(l+this.bsCount[i])%4:l++;else if(c-r<this.tShift[i])l++;else break;c++}l>n?o[a]=new Array(l-n+1).join(" ")+this.src.slice(c,u):o[a]=this.src.slice(c,u)}return o.join("")}},I3=65536;function fi(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function kc(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),a=!1,i=0,l="";for(;s<n;)o===124&&(a?(l+=e.substring(i,s-1),i=s):(t.push(l+e.substring(i,s)),l="",i=s+1)),a=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(i)),t}function P3(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let a=e.bMarks[o]+e.tShift[o];if(a>=e.eMarks[o])return!1;const i=e.src.charCodeAt(a++);if(i!==124&&i!==45&&i!==58||a>=e.eMarks[o])return!1;const l=e.src.charCodeAt(a++);if(l!==124&&l!==45&&l!==58&&!Ve(l)||i===45&&Ve(l))return!1;for(;a<e.eMarks[o];){const C=e.src.charCodeAt(a);if(C!==124&&C!==45&&C!==58&&!Ve(C))return!1;a++}let r=fi(e,t+1),c=r.split("|");const u=[];for(let C=0;C<c.length;C++){const D=c[C].trim();if(!D){if(C===0||C===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(D))return!1;D.charCodeAt(D.length-1)===58?u.push(D.charCodeAt(0)===58?"center":"right"):D.charCodeAt(0)===58?u.push("left"):u.push("")}if(r=fi(e,t).trim(),r.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;c=kc(r),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const _=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),m=[t,0];g.map=m;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const w=e.push("tr_open","tr",1);w.map=[t,t+1];for(let C=0;C<c.length;C++){const D=e.push("th_open","th",1);u[C]&&(D.attrs=[["style",`text-align:${u[C]}`]]);const I=e.push("inline","",0);I.content=c[C].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,k=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let C=!1;for(let I=0,L=h.length;I<L;I++)if(h[I](e,o,n,!0)){C=!0;break}if(C||(r=fi(e,o).trim(),!r)||e.sCount[o]-e.blkIndent>=4||(c=kc(r),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),k+=d-c.length,k>I3))break;if(o===t+2){const I=e.push("tbody_open","tbody",1);I.map=x=[t+2,0]}const D=e.push("tr_open","tr",1);D.map=[o,o+1];for(let I=0;I<d;I++){const L=e.push("td_open","td",1);u[I]&&(L.attrs=[["style",`text-align:${u[I]}`]]);const K=e.push("inline","",0);K.content=c[I]?c[I].trim():"",K.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=_,e.line=o,!0}function B3(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const a=e.push("code_block","code",0);return a.content=e.getLines(t,o,4+e.blkIndent,!1)+`
25
+ `,a.map=[t,e.line],!0}function L3(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>a)return!1;const i=e.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let l=o;o=e.skipChars(o,i);let r=o-l;if(r<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,a);if(i===96&&u.indexOf(String.fromCharCode(i))>=0)return!1;if(s)return!0;let d=t,_=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],o<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===i&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,i),!(o-l<r)&&(o=e.skipSpaces(o),!(o<a)))){_=!0;break}r=e.sCount[t],e.line=d+(_?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,r,!0),h.markup=c,h.map=[t,e.line],!0}function O3(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(s)return!0;const l=[],r=[],c=[],u=[],d=e.md.block.ruler.getRules("blockquote"),_=e.parentType;e.parentType="blockquote";let h=!1,g;for(g=t;g<n;g++){const k=e.sCount[g]<e.blkIndent;if(o=e.bMarks[g]+e.tShift[g],a=e.eMarks[g],o>=a)break;if(e.src.charCodeAt(o++)===62&&!k){let D=e.sCount[g]+1,I,L;e.src.charCodeAt(o)===32?(o++,D++,L=!1,I=!0):e.src.charCodeAt(o)===9?(I=!0,(e.bsCount[g]+D)%4===3?(o++,D++,L=!1):L=!0):I=!1;let K=D;for(l.push(e.bMarks[g]),e.bMarks[g]=o;o<a;){const X=e.src.charCodeAt(o);if(Ve(X))X===9?K+=4-(K+e.bsCount[g]+(L?1:0))%4:K++;else break;o++}h=o>=a,r.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(I?1:0),c.push(e.sCount[g]),e.sCount[g]=K-D,u.push(e.tShift[g]),e.tShift[g]=o-e.bMarks[g];continue}if(h)break;let C=!1;for(let D=0,I=d.length;D<I;D++)if(d[D](e,g,n,!0)){C=!0;break}if(C){e.lineMax=g,e.blkIndent!==0&&(l.push(e.bMarks[g]),r.push(e.bsCount[g]),u.push(e.tShift[g]),c.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}l.push(e.bMarks[g]),r.push(e.bsCount[g]),u.push(e.tShift[g]),c.push(e.sCount[g]),e.sCount[g]=-1}const m=e.blkIndent;e.blkIndent=0;const b=e.push("blockquote_open","blockquote",1);b.markup=">";const w=[t,0];b.map=w,e.md.block.tokenize(e,t,g);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=i,e.parentType=_,w[1]=e.line;for(let k=0;k<u.length;k++)e.bMarks[k+t]=l[k],e.tShift[k+t]=u[k],e.sCount[k+t]=c[k],e.bsCount[k+t]=r[k];return e.blkIndent=m,!0}function z3(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(a++);if(i!==42&&i!==45&&i!==95)return!1;let l=1;for(;a<o;){const c=e.src.charCodeAt(a++);if(c!==i&&!Ve(c))return!1;c===i&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const r=e.push("hr","hr",0);return r.map=[t,e.line],r.markup=Array(l+1).join(String.fromCharCode(i)),!0}function wc(e,t){const n=e.eMarks[t];let s=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(s++);return o!==42&&o!==45&&o!==43||s<n&&!Ve(e.src.charCodeAt(s))?-1:s}function xc(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];let o=n;if(o+1>=s)return-1;let a=e.src.charCodeAt(o++);if(a<48||a>57)return-1;for(;;){if(o>=s)return-1;if(a=e.src.charCodeAt(o++),a>=48&&a<=57){if(o-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return o<s&&(a=e.src.charCodeAt(o),!Ve(a))?-1:o}function j3(e,t){const n=e.level+2;for(let s=t+2,o=e.tokens.length-2;s<o;s++)e.tokens[s].level===n&&e.tokens[s].type==="paragraph_open"&&(e.tokens[s+2].hidden=!0,e.tokens[s].hidden=!0,s+=2)}function N3(e,t,n,s){let o,a,i,l,r=t,c=!0;if(e.sCount[r]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[r]-e.listIndent>=4&&e.sCount[r]<e.blkIndent)return!1;let u=!1;s&&e.parentType==="paragraph"&&e.sCount[r]>=e.blkIndent&&(u=!0);let d,_,h;if((h=xc(e,r))>=0){if(d=!0,i=e.bMarks[r]+e.tShift[r],_=Number(e.src.slice(i,h-1)),u&&_!==1)return!1}else if((h=wc(e,r))>=0)d=!1;else return!1;if(u&&e.skipSpaces(h)>=e.eMarks[r])return!1;if(s)return!0;const g=e.src.charCodeAt(h-1),m=e.tokens.length;d?(l=e.push("ordered_list_open","ol",1),_!==1&&(l.attrs=[["start",_]])):l=e.push("bullet_list_open","ul",1);const b=[r,0];l.map=b,l.markup=String.fromCharCode(g);let w=!1;const x=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";r<n;){a=h,o=e.eMarks[r];const C=e.sCount[r]+h-(e.bMarks[r]+e.tShift[r]);let D=C;for(;a<o;){const ie=e.src.charCodeAt(a);if(ie===9)D+=4-(D+e.bsCount[r])%4;else if(ie===32)D++;else break;a++}const I=a;let L;I>=o?L=1:L=D-C,L>4&&(L=1);const K=C+L;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(g);const X=[r,0];l.map=X,d&&(l.info=e.src.slice(i,h-1));const oe=e.tight,Y=e.tShift[r],N=e.sCount[r],U=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=K,e.tight=!0,e.tShift[r]=I-e.bMarks[r],e.sCount[r]=D,I>=o&&e.isEmpty(r+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,r,n),(!e.tight||w)&&(c=!1),w=e.line-r>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=U,e.tShift[r]=Y,e.sCount[r]=N,e.tight=oe,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(g),r=e.line,X[1]=r,r>=n||e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)break;let ne=!1;for(let ie=0,ae=x.length;ie<ae;ie++)if(x[ie](e,r,n,!0)){ne=!0;break}if(ne)break;if(d){if(h=xc(e,r),h<0)break;i=e.bMarks[r]+e.tShift[r]}else if(h=wc(e,r),h<0)break;if(g!==e.src.charCodeAt(h-1))break}return d?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(g),b[1]=r,e.line=r,e.parentType=k,c&&j3(e,m),!0}var pi=999;function U3(e){let t=e.length;for(let n=0;n<e.length-1;n++){const s=e.charCodeAt(n);if(s<55296||s>56319)continue;const o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t--,n++)}return t}function Ds(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function Io(e,t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let s=!1;if(e.sCount[t]-e.blkIndent>3&&(s=!0),e.sCount[t]<0&&(s=!0),!s){const o=e.md.block.ruler.getRules("reference"),a=e.parentType;e.parentType="reference";let i=!1;for(let l=0,r=o.length;l<r;l++)if(o[l](e,t,n,!0)){i=!0;break}if(e.parentType=a,i)return-1}return e.bMarks[t]+e.tShift[t]}function W3(e,t,n,s){const o=e.src;let a=e.bMarks[t]+e.tShift[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||o.charCodeAt(a)!==91)return!1;let l=Ds(e,t),r="",c=-1,u=++a;for(;a<l;){if(r.length+a-u>pi*2)return!1;let I=o.charCodeAt(a);if(I===91)return!1;if(I===93){c=a;break}if(I===92&&(I=o.charCodeAt(++a)),I===10&&a<l){const L=Io(e,i);if(L<0)return!1;r+=o.slice(u,l),a=u=L,l=Ds(e,i++);continue}a++}if(c<0||o.charCodeAt(c+1)!==58||(r+=o.slice(u,c),r.length>pi&&U3(r)>pi))return!1;for(a=c+2;a<l;){const I=o.charCodeAt(a);if(I===10){const L=Io(e,i);if(L<0)break;a=L,l=Ds(e,i++)}else if(Ve(I))a++;else break}const d=e.md.helpers.parseLinkDestination(o,a,l);if(!d.ok)return!1;const _=e.md.normalizeLink(d.str);if(!e.md.validateLink(_))return!1;a=d.pos;const h=a,g=l,m=i;for(;a<l;){const I=o.charCodeAt(a);if(I===10){const L=Io(e,i);if(L<0)break;a=L,l=Ds(e,i++)}else if(Ve(I))a++;else break}const b=a;let w=e.md.helpers.parseLinkTitle(o,a,l);for(;w.can_continue;){const I=Io(e,i);if(I<0)break;a=I,l=Ds(e,i++),w=e.md.helpers.parseLinkTitle(o,a,l,w)}let x;for(b!==h&&w.ok?(x=w.str,a=w.pos):(x="",a=h,l=g,i=m);a<l&&Ve(o.charCodeAt(a));)a++;if(a<l&&o.charCodeAt(a)!==10&&x)for(x="",a=h,l=g,i=m;a<l&&Ve(o.charCodeAt(a));)a++;if(a<l&&o.charCodeAt(a)!==10)return!1;const k=Ra(r);if(!k)return!1;if(s)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:x,href:_});const C=e.push("reference_definition","",0);C.map=[t,i],C.hidden=!0;const D=Object.create(null);return D.label=k,C.meta=D,e.line=i,!0}var V3=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],q3=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,H3="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",cf=new RegExp(`^(?:${q3}|${H3})`),qn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${V3.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${cf.source}\\s*$`),/^$/,!1]];function K3(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let i=e.src.slice(o,a),l=0;for(;l<qn.length&&!qn[l][0].test(i);l++);if(l===qn.length)return!1;if(s)return qn[l][2];let r=t+1;const c=qn[l][1].test("");if(!qn[l][1].test(i)){for(;r<n&&!(e.sCount[r]<e.blkIndent&&(c||!e.isEmpty(r)));r++)if(o=e.bMarks[r]+e.tShift[r],a=e.eMarks[r],i=e.src.slice(o,a),qn[l][1].test(i)){i.length!==0&&r++;break}}e.line=r;const u=e.push("html_block","",0);return u.map=[t,r],u.content=e.getLines(t,r,e.blkIndent,!0),!0}function J3(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(o);if(i!==35||o>=a)return!1;let l=1;for(i=e.src.charCodeAt(++o);i===35&&o<a&&l<=6;)l++,i=e.src.charCodeAt(++o);if(l>6||o<a&&!Ve(i))return!1;if(s)return!0;a=e.skipSpacesBack(a,o);const r=e.skipCharsBack(a,35,o);r>o&&Ve(e.src.charCodeAt(r-1))&&(a=r),e.line=t+1;const c=e.push("heading_open",`h${l}`,1);c.markup="########".slice(0,l),c.map=[t,e.line];const u=e.push("inline","",0);u.content=Sa(e.src.slice(o,a)),u.map=[t,e.line],u.children=[];const d=e.push("heading_close",`h${l}`,-1);return d.markup="########".slice(0,l),!0}function Z3(e,t,n){const s=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let a=0,i,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let h=e.bMarks[l]+e.tShift[l];const g=e.eMarks[l];if(h<g&&(i=e.src.charCodeAt(h),(i===45||i===61)&&(h=e.skipChars(h,i),h=e.skipSpaces(h),h>=g))){a=i===61?1:2;break}}if(e.sCount[l]<0)continue;let _=!1;for(let h=0,g=s.length;h<g;h++)if(s[h](e,l,n,!0)){_=!0;break}if(_)break}if(!a)return e.parentType=o,!1;const r=Sa(e.getLines(t,l,e.blkIndent,!1));e.line=l+1;const c=e.push("heading_open",`h${a}`,1);c.markup=String.fromCharCode(i),c.map=[t,e.line];const u=e.push("inline","",0);u.content=r,u.map=[t,e.line-1],u.children=[];const d=e.push("heading_close",`h${a}`,-1);return d.markup=String.fromCharCode(i),e.parentType=o,!0}function G3(e,t,n){const s=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let a=t+1;for(e.parentType="paragraph";a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let c=!1;for(let u=0,d=s.length;u<d;u++)if(s[u](e,a,n,!0)){c=!0;break}if(c)break}const i=Sa(e.getLines(t,a,e.blkIndent,!1));e.line=a;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const r=e.push("inline","",0);return r.content=i,r.map=[t,e.line],r.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}var Po=[["table",P3,["paragraph","reference"]],["code",B3],["fence",L3,["paragraph","reference","blockquote","list"]],["blockquote",O3,["paragraph","reference","blockquote","list"]],["hr",z3,["paragraph","reference","blockquote","list"]],["list",N3,["paragraph","reference","blockquote"]],["reference",W3],["html_block",K3,["paragraph","reference","blockquote"]],["heading",J3,["paragraph","reference","blockquote"]],["lheading",Z3],["paragraph",G3]],uf=class{constructor(){ge(this,"ruler",new ao),ge(this,"State",rf);for(let e=0;e<Po.length;e++)this.ruler.push(Po[e][0],Po[e][1],{alt:(Po[e][2]||[]).slice()})}tokenize(e,t,n){const s=this.ruler.getRules(""),o=s.length,a=e.md.options.maxNesting;let i=t,l=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n||e.sCount[i]<e.blkIndent));){if(e.level>=a){e.line=n;break}const r=e.line;let c=!1;for(let u=0;u<o;u++)if(c=s[u](e,i,n,!1),c){if(r>=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),i=e.line,i<n&&e.isEmpty(i)&&(l=!0,i++,e.line=i)}}parse(e,t,n,s){if(!e)return;const o=new this.State(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}},df=class{constructor(e,t,n,s){ge(this,"pos",0),ge(this,"level",0),ge(this,"pending",""),ge(this,"pendingLevel",0),ge(this,"cache",{}),ge(this,"backticks",{}),ge(this,"backticksScanned",!1),ge(this,"skipHtmlSpecial",!1),ge(this,"linkLevel",0),ge(this,"delimiters",[]),ge(this,"_prev_delimiters",[]),ge(this,"Token",Yn),this.src=e,this.env=n,this.md=t,this.tokens=s,this.tokens_meta=Array(s.length),this.posMax=this.src.length}pushPending(){const e=new Yn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const s=new Yn(e,t,n);let o;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const n=this.posMax,s=this.src.charCodeAt(e);let o;if(e===0)o=32;else if(e===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(e-1),(o&64512)===56320){const g=this.src.charCodeAt(e-2);o=(g&64512)===55296?65536+(g-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===s;)a++;const i=a-e;let l=a<n?this.src.charCodeAt(a):32;if((l&64512)===55296){const g=this.src.charCodeAt(a+1);l=(g&64512)===56320?65536+(l-55296<<10)+(g-56320):65533}else(l&64512)===56320&&(l=65533);const r=so(o)||no(o),c=so(l)||no(l),u=to(o),d=to(l),_=!d&&(!c||u||r),h=!u&&(!r||d||c);return{can_open:_&&(t||!h||r),can_close:h&&(t||!_||c),length:i}}};function X3(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Y3(e,t){let n=e.pos;for(;n<e.posMax&&!X3(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}function Q3(e){return e>=65&&e<=90||e>=97&&e<=122}function e4(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function t4(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=n-Math.min(10,e.pending.length,n);let a=n;for(;a>o&&e4(e.src.charCodeAt(a-1));)a--;if(a===n||!Q3(e.src.charCodeAt(a)))return!1;const i=n-a,l=e.md.linkify.matchAtStart(e.src.slice(a));if(!l)return!1;let r=l.url;if(r.length<=i)return!1;let c=r.length;for(;c>0&&r.charCodeAt(c-1)===42;)c--;c!==r.length&&(r=r.slice(0,c));const u=e.md.normalizeLink(r);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-i);const d=e.push("link_open","a",1);d.attrs=[["href",u]],d.markup="linkify",d.info="auto";const _=e.push("text","",0);_.content=e.md.normalizeLinkText(r);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=r.length-i,!0}function n4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let a=s-1;for(;a>=1&&e.pending.charCodeAt(a-1)===32;)a--;e.pending=e.pending.slice(0,a),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&Ve(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var wl=[];for(let e=0;e<256;e++)wl.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){wl[e.charCodeAt(0)]=1});function s4(e,t){let n=e.pos;const s=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=s))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(o=e.src.charCodeAt(n),!!Ve(o));)n++;return e.pos=n,!0}if(o===32){if(!t){const l=e.push("text_special","",0);l.content="\\",l.markup="\\",l.info="escape"}return e.pos=n,!0}let a=e.src[n];if(o>=55296&&o<=56319&&n+1<s){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(a+=e.src[n+1],n++)}const i="\\"+a;if(!t){const l=e.push("text_special","",0);o<256&&wl[o]!==0?l.content=a:l.content=i,l.markup=i,l.info="escape"}return e.pos=n+1,!0}function o4(e){const t={};let n=0;for(;(n=e.indexOf("`",n))!==-1;){const s=n;for(;e.charCodeAt(++n)===96;);t[n-s]=s}return t}function a4(e,t){var n;const s=e.pos;if(e.src.charCodeAt(s)!==96)return!1;const o=e.posMax;let a=s+1;for(;a<o&&e.src.charCodeAt(a)===96;)a++;const i=e.src.slice(s,a),l=i.length;if(e.backticksScanned||(e.backticks=o4(e.src),e.backticksScanned=!0),((n=e.backticks[l])!==null&&n!==void 0?n:-1)>=a){let r=a,c;for(;(c=e.src.indexOf("`",r))!==-1&&c<o;){for(r=c+1;e.src.charCodeAt(r)===96;)r++;if(r>o)break;if(r-c===l){if(!t){const u=e.push("code_inline","code",0);u.markup=i;let d=e.src.slice(a,c).replace(/\n/g," ");d.startsWith(" ")&&d.endsWith(" ")&&/[^ ]/.test(d)&&(d=d.slice(1,-1)),u.content=d}return e.pos=r,!0}}}return t||(e.pending+=i),e.pos=a,!0}function i4(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);let a=o.length;const i=String.fromCharCode(s);if(a<2)return!1;let l;a%2&&(l=e.push("text","",0),l.content=i,a--);for(let r=0;r<a;r+=2)l=e.push("text","",0),l.content=i+i,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function Cc(e,t){let n;const s=[],o=t.length;for(let a=0;a<o;a++){const i=t[a];if(i.marker!==126||i.end===-1)continue;const l=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const a=s.pop();let i=a+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,a!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[a],e.tokens[a]=n)}}function l4(e){const t=e.tokens_meta,n=e.tokens_meta.length;Cc(e,e.delimiters);for(let o=0;o<n;o++){var s;const a=(s=t[o])===null||s===void 0?void 0:s.delimiters;a&&Cc(e,a)}}var ff={tokenize:i4,postProcess:l4};function r4(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);for(let a=0;a<o.length;a++){const i=e.push("text","",0);i.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function $c(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const a=t[o.end],i=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===a.token+1,l=String.fromCharCode(o.marker),r=e.tokens[o.token];r.type=i?"strong_open":"em_open",r.tag=i?"strong":"em",r.nesting=1,r.markup=i?l+l:l,r.content="";const c=e.tokens[a.token];c.type=i?"strong_close":"em_close",c.tag=i?"strong":"em",c.nesting=-1,c.markup=i?l+l:l,c.content="",i&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function c4(e){const t=e.tokens_meta,n=e.tokens_meta.length;$c(e,e.delimiters);for(let o=0;o<n;o++){var s;const a=(s=t[o])===null||s===void 0?void 0:s.delimiters;a&&$c(e,a)}}var pf={tokenize:r4,postProcess:c4};function u4(e,t){let n,s,o,a,i="",l="",r=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,_=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let g=h+1;if(g<d&&e.src.charCodeAt(g)===40){for(c=!1,g++;g<d&&(n=e.src.charCodeAt(g),!(!Ve(n)&&n!==10));g++);if(g>=d)return!1;if(r=g,o=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),o.ok){for(i=e.md.normalizeLink(o.str),e.md.validateLink(i)?g=o.pos:i="",r=g;g<d&&(n=e.src.charCodeAt(g),!(!Ve(n)&&n!==10));g++);if(o=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<d&&r!==g&&o.ok)for(l=o.str,g=o.pos;g<d&&(n=e.src.charCodeAt(g),!(!Ve(n)&&n!==10));g++);}(g>=d||e.src.charCodeAt(g)!==41)&&(c=!0),g++}if(c){if(typeof e.env.references>"u")return!1;if(g<d&&e.src.charCodeAt(g)===91?(r=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?s=e.src.slice(r,g++):g=h+1):g=h+1,s||(s=e.src.slice(_,h)),s=Ra(s),a=e.env.references[s],!a)return e.pos=u,!1;i=a.href,l=a.title}if(!t){e.pos=_,e.posMax=h;const m=e.push("link_open","a",1),b=[["href",i]];if(m.attrs=b,l&&b.push(["title",l]),s){const w=Object.create(null);w.label=s,m.meta=w}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=d,!0}function d4(e,t){let n,s,o,a,i,l,r,c,u="";const d=e.pos,_=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(a=g+1,a<_&&e.src.charCodeAt(a)===40){for(a++;a<_&&(n=e.src.charCodeAt(a),!(!Ve(n)&&n!==10));a++);if(a>=_)return!1;for(c=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok&&(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?a=l.pos:u=""),c=a;a<_&&(n=e.src.charCodeAt(a),!(!Ve(n)&&n!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<_&&c!==a&&l.ok)for(r=l.str,a=l.pos;a<_&&(n=e.src.charCodeAt(a),!(!Ve(n)&&n!==10));a++);else r="";if(a>=_||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(typeof e.env.references>"u")return!1;if(a<_&&e.src.charCodeAt(a)===91?(c=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?o=e.src.slice(c,a++):a=g+1):a=g+1,o||(o=e.src.slice(h,g)),o=Ra(o),i=e.env.references[o],!i)return e.pos=d,!1;u=i.href,r=i.title}if(!t){s=e.src.slice(h,g);const m=[];e.md.inline.parse(s,e.md,e.env,m);const b=e.push("image","img",0),w=[["src",u],["alt",""]];if(b.attrs=w,b.children=m,b.content=s,r&&w.push(["title",r]),o){const x=Object.create(null);x.label=o,b.meta=x}}return e.pos=a,e.posMax=_,!0}var f4=/^([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])?)*)$/,p4=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function v4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const s=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const i=e.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const a=e.src.slice(s+1,n);if(p4.test(a)){const i=e.md.normalizeLink(a);if(!e.md.validateLink(i))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.info="auto";const r=e.push("text","",0);r.content=e.md.normalizeLinkText(a);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=a.length+2,!0}if(f4.test(a)){const i=e.md.normalizeLink(`mailto:${a}`);if(!e.md.validateLink(i))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.info="auto";const r=e.push("text","",0);r.content=e.md.normalizeLinkText(a);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=a.length+2,!0}return!1}function h4(e){return/^<a[>\s]/i.test(e)}function m4(e){return/^<\/a\s*>/i.test(e)}function vf(e){const t=e|32;return t>=97&&t<=122}function _4(e,t){const n=e.src;let s,o;if(n.startsWith("<!--",t)){if(n.startsWith(">",t+4))return t+5;if(n.startsWith("->",t+4))return t+6;s=t+4,o="-->"}else if(n.startsWith("<![CDATA[",t))s=t+9,o="]]>";else if(n.charCodeAt(t+1)===63)s=t+2,o="?>";else if(vf(n.charCodeAt(t+2)))s=t+3,o=">";else return-1;if(e.skipHtmlSpecial)return-1;const a=n.indexOf(o,s);return a<0?(e.skipHtmlSpecial=!0,-1):a+o.length}function g4(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==60||s+2>=n)return!1;let o;const a=e.src.charCodeAt(s+1);if(a===33||a===63)o=_4(e,s);else if(a===47||vf(a)){const i=e.src.slice(s).match(cf);o=i?s+i[0].length:-1}else return!1;if(o<0)return!1;if(!t){const i=e.push("html_inline","",0);i.content=e.src.slice(s,o),h4(i.content)&&e.linkLevel++,m4(i.content)&&e.linkLevel--}return e.pos=o,!0}var y4=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,b4=/^&([a-z][a-z0-9]{1,31});/i;function k4(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(y4);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=kl(a)?eo(a):eo(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(b4);if(o){const a=Vd(o[0]);if(a!==o[0]){if(!t){const i=e.push("text_special","",0);i.content=a,i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Ac(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const a=[];for(let i=0;i<n;i++){const l=e[i];if(a.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=i),o=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const r=t[l.marker][(l.open?3:0)+l.length%3];let c=s-a[s]-1,u=c;for(;c>r;c-=a[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let _=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(_=!0),!_){const h=c>0&&!e[c-1].open?a[c-1]+1:0;a[i]=i-c+h,a[c]=h,l.open=!1,d.end=i,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function w4(e){const t=e.tokens_meta,n=e.tokens_meta.length;Ac(e.delimiters);for(let o=0;o<n;o++){var s;const a=(s=t[o])===null||s===void 0?void 0:s.delimiters;a&&Ac(a)}}function x4(e){let t,n,s=0;const o=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)o[t].nesting<0&&s--,o[t].level=s,o[t].nesting>0&&s++,o[t].type==="text"&&t+1<a&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}var vi=[["text",Y3],["linkify",t4],["newline",n4],["escape",s4],["backticks",a4],["strikethrough",ff.tokenize],["emphasis",pf.tokenize],["link",u4],["image",d4],["autolink",v4],["html_inline",g4],["entity",k4]],hi=[["balance_pairs",w4],["strikethrough",ff.postProcess],["emphasis",pf.postProcess],["fragments_join",x4]],hf=class{constructor(){ge(this,"ruler",new ao),ge(this,"ruler2",new ao),ge(this,"State",df);for(let e=0;e<vi.length;e++)this.ruler.push(vi[e][0],vi[e][1]);for(let e=0;e<hi.length;e++)this.ruler2.push(hi[e][0],hi[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),s=n.length,o=e.md.options.maxNesting,a=e.cache;if(typeof a[t]<"u"){e.pos=a[t];return}let i=!1;if(e.level<o){for(let l=0;l<s;l++)if(e.level++,i=n[l](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,a[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,s=e.posMax,o=e.md.options.maxNesting;for(;e.pos<s;){const a=e.pos;let i=!1;if(e.level<o){for(let l=0;l<n;l++)if(i=t[l](e,!1),i){if(a>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=s)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,s){const o=new this.State(e,t,n,s);this.tokenize(o);const a=this.ruler2.getRules(""),i=a.length;for(let l=0;l<i;l++)a[l](o)}},C4={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},$4=/^(vbscript|javascript|file|data):/,A4=/^data:image\/(gif|png|jpeg|webp);/,Dc=["http:","https:","mailto:"],an=class{validateLink(e){const t=e.trim().toLowerCase();return $4.test(t)?A4.test(t):!0}normalizeLink(e){const t=qi(e,!0);if(t.hostname&&(!t.protocol||Dc.indexOf(t.protocol)>=0))try{t.hostname=hc.toASCII(t.hostname)}catch{}return t.auth&&(t.auth=mn(t.auth)),t.hostname&&(t.hostname=mn(t.hostname)),t.pathname&&(t.pathname=mn(t.pathname)),t.search&&(t.search=mn(t.search)),t.hash&&(t.hash=mn(t.hash)),Vi(t)}normalizeLinkText(e){const t=qi(e,!0);if(t.hostname&&(!t.protocol||Dc.indexOf(t.protocol)>=0))try{t.hostname=hc.toUnicode(t.hostname)}catch{}return ms(Vi(t),ms.defaultChars+"%")}constructor(...e){ge(this,"inline",new hf),ge(this,"block",new uf),ge(this,"core",new lf),ge(this,"renderer",new sf),ge(this,"linkify",new I$),ge(this,"utils",H$),ge(this,"helpers",Object.assign({},r3));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const o=e;if(t=C4[o],!t)throw new Error(`Wrong 'markdown-it' preset "${o}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var s;["core","block","inline"].forEach(a=>{var i;const l=(i=n[a])===null||i===void 0?void 0:i.rules;l&&this[a].ruler.enableOnly(l)});const o=(s=n.inline)===null||s===void 0?void 0:s.rules2;o&&this.inline.ruler2.enableOnly(o)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const s=e.filter(o=>n.indexOf(o)<0);if(s.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${s}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const s=e.filter(o=>n.indexOf(o)<0);if(s.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${s}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};ge(an,"Token",Yn);ge(an,"Ruler",ao);ge(an,"Renderer",sf);ge(an,"ParserCore",lf);ge(an,"StateCore",of);ge(an,"ParserBlock",uf);ge(an,"StateBlock",rf);ge(an,"ParserInline",hf);ge(an,"StateInline",df);var D4=ef(an);const R4=["data-streaming"],S4=["innerHTML"],E4={key:0,class:"va-md__caret","aria-hidden":"true"},T4=we({__name:"VaMarkdown",props:{content:{default:""},streaming:{type:Boolean,default:!1},linkify:{type:Boolean,default:!0},breaks:{type:Boolean,default:!0}},setup(e){const t=e,n=new D4({html:!1,linkify:t.linkify,breaks:t.breaks,typographer:!1}),s=E(()=>t.content?n.render(t.content):"");return(o,a)=>(v(),y("div",{class:"va-md","data-streaming":e.streaming||void 0},[f("div",{class:"va-md__body",innerHTML:s.value},null,8,S4),e.streaming?(v(),y("span",E4)):R("",!0)],8,R4))}}),M4={key:1,class:"va-thought-box"},F4={class:"va-thought-box__title"},I4={key:0,class:"va-thought-box__duration"},P4={key:1,class:"va-thought-box__duration"},B4={key:0,class:"va-thought-box__content"},L4=we({__name:"VaThoughtBox",props:{thought:{default:""},expanded:{type:Boolean,default:!0},duration:{default:void 0},streaming:{type:Boolean,default:!1},summaryMode:{type:Boolean,default:!1},toolCount:{default:0}},emits:["update:expanded","update:summaryMode","toggle"],setup(e,{emit:t}){const n=e,s=t,o=E({get:()=>n.expanded,set:l=>{s("update:expanded",l),s("toggle",l)}});function a(){o.value=!o.value}function i(){s("update:summaryMode",!1),s("update:expanded",!0),s("toggle",!0)}return(l,r)=>n.summaryMode?(v(),y("button",{key:0,class:"va-thought-box__summary",type:"button",title:"展开过程详情",onClick:i},[O(p(zg),{size:14,class:"va-thought-box__summary-icon"}),f("span",null,[r[0]||(r[0]=de(" 已完成",-1)),n.duration!=null?(v(),y(J,{key:0},[de(" · 耗时 "+$(n.duration)+"s",1)],64)):R("",!0),n.toolCount?(v(),y(J,{key:1},[de(" · "+$(n.toolCount)+" 次工具调用",1)],64)):R("",!0)]),O(p(Qn),{size:13,class:"va-thought-box__summary-chevron"})])):(v(),y("div",M4,[f("div",{class:"va-thought-box__header",onClick:a},[f("div",F4,[O(p(Lg),{size:15,class:_e({"va-thought-box__pulse-icon":n.streaming})},null,8,["class"]),r[1]||(r[1]=f("span",null,"思考过程",-1)),n.duration!=null?(v(),y("span",I4,"· 耗时 "+$(n.duration)+"s",1)):n.streaming?(v(),y("span",P4,"· 正在深度思考…")):R("",!0)]),f("button",{class:"va-thought-box__btn",type:"button",onClick:Se(a,["stop"])},[de($(o.value?"收起":"展开")+" ",1),o.value?(v(),le(p(Og),{key:0,size:13})):(v(),le(p(Qn),{key:1,size:13}))])]),o.value?(v(),y("div",B4,[je(l.$slots,"default",{},()=>[de($(n.thought||(n.streaming?"正在拆解任务意图,规划工具调用序列与沙箱执行路径…":"暂无思考内容")),1)])])):R("",!0)]))}}),O4=["aria-label"],z4={class:"va-turn-rail__track","aria-hidden":"true"},j4=["aria-current","aria-label","onClick","onMouseenter","onFocus"],N4={class:"va-turn-rail__preview-index"},U4={class:"va-turn-rail__preview-text"},W4=96,Rc=1,V4=we({__name:"VaTurnRail",props:{items:{default:()=>[]},container:{default:null},anchorAttr:{default:"data-turn-id"},offset:{default:16},minItems:{default:1},preview:{type:Boolean,default:!0},floating:{type:Boolean,default:!0},activeId:{default:""},ariaLabel:{default:"对话轮次快速跳转"}},emits:["select","update:activeId"],setup(e,{expose:t,emit:n}){const s=e,o=n,a=P(null),i=P([]),l=P(""),r=E(()=>s.activeId||l.value),c=E(()=>Math.max(0,s.items.findIndex(H=>H.id===r.value))),u=E(()=>s.items.length>s.minItems),d=E(()=>{const H=s.items.length;return H<=1?0:Math.min(1,Math.max(0,c.value/(H-1)))});function _(H,W){return(H.label??"").replace(/\s+/g," ").trim()||`第 ${W+1} 轮`}function h(H){return H.replace(/["\\]/g,"\\$&")}function g(H){const W=s.container;return W?W.querySelector(`[${s.anchorAttr}="${h(H)}"]`):null}let m=null,b=null,w=null;function x(){const H=s.container;if(!H||s.items.length===0)return;const W=H.getBoundingClientRect().top;let G=s.items[0].id;if(H.scrollHeight-H.clientHeight>Rc&&H.scrollHeight-H.scrollTop-H.clientHeight<=Rc)G=s.items[s.items.length-1].id;else for(const Be of s.items){const Ne=g(Be.id);if(Ne){if(Ne.getBoundingClientRect().top-W>W4)break;G=Be.id}}G!==l.value&&(l.value=G,o("update:activeId",G))}function k(){if(m===null){if(typeof requestAnimationFrame!="function"){x();return}m=requestAnimationFrame(()=>{m=null,x()})}}function C(){k()}function D(){b&&b.removeEventListener("scroll",C),b=null,w?.disconnect(),w=null,m!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(m),m=null)}function I(){D();const H=s.container;if(H){if(b=H,H.addEventListener("scroll",C,{passive:!0}),typeof ResizeObserver<"u"){w=new ResizeObserver(()=>k()),w.observe(H);const W=H.firstElementChild;W instanceof HTMLElement&&w.observe(W)}k()}}$e(()=>s.container,I,{immediate:!0}),$e(()=>s.items.map(H=>H.id).join("|"),()=>k()),tt(D);function L(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function K(H){const W=s.container,G=g(H);if(!W||!G)return;const xe=W.scrollTop+(G.getBoundingClientRect().top-W.getBoundingClientRect().top)-s.offset,Be=Math.max(0,xe);if(typeof W.scrollTo=="function"){W.scrollTo({top:Be,behavior:L()?"auto":"smooth"});return}W.scrollTop=Be}function X(H,W){l.value=H.id,o("update:activeId",H.id),o("select",H.id,W),K(H.id)}function oe(H,W){i.value[W]=H??null}function Y(H){const W=s.items.length;if(W===0)return;let G=-1;if(H.key==="Home"?G=0:H.key==="End"?G=W-1:H.key==="ArrowUp"?G=Math.max(0,c.value-1):H.key==="ArrowDown"&&(G=Math.min(W-1,c.value+1)),G<0)return;H.preventDefault();const xe=s.items[G];xe&&(X(xe,G),i.value[G]?.focus())}const N=P(""),U=P(""),ne=E(()=>s.preview?N.value||U.value:""),ie=E(()=>s.items.find(H=>H.id===ne.value)??null),ae=E(()=>s.items.findIndex(H=>H.id===ne.value)),pe=P(0);function ue(){const H=ne.value,W=a.value,G=i.value[ae.value];if(!H||!W||!G)return;const xe=G.getBoundingClientRect(),Be=W.getBoundingClientRect();pe.value=xe.top+xe.height/2-Be.top}$e(ne,async()=>{await Ge(),ue()});function B(){ne.value&&ue()}return t({measure:x,scrollTo:K,activeId:r}),(H,W)=>u.value?(v(),y("nav",{key:0,ref_key:"rootRef",ref:a,class:_e(["va-turn-rail",{"va-turn-rail--floating":s.floating}]),"aria-label":s.ariaLabel,onKeydown:Y},[f("div",z4,[f("span",{class:"va-turn-rail__track-fill",style:Fe({transform:`scaleY(${d.value})`})},null,4)]),f("ol",{class:"va-turn-rail__list",onScrollPassive:B},[(v(!0),y(J,null,ve(s.items,(G,xe)=>(v(),y("li",{key:G.id,class:"va-turn-rail__item"},[f("button",{ref_for:!0,ref:Be=>oe(Be,xe),type:"button",class:_e(["va-turn-rail__dot",[`va-turn-rail__dot--${G.role==="assistant"?"assistant":"user"}`,{"va-turn-rail__dot--active":G.id===r.value,"va-turn-rail__dot--streaming":G.status==="streaming","va-turn-rail__dot--error":G.status==="error"}]]),"aria-current":G.id===r.value?"true":void 0,"aria-label":`跳到${_(G,xe)}`,onClick:Be=>X(G,xe),onMouseenter:Be=>N.value=G.id,onMouseleave:W[0]||(W[0]=Be=>N.value=""),onFocus:Be=>U.value=G.id,onBlur:W[1]||(W[1]=Be=>U.value="")},[...W[2]||(W[2]=[f("span",{class:"va-turn-rail__pip","aria-hidden":"true"},null,-1)])],42,j4)]))),128))],32),ie.value?(v(),y("div",{key:0,class:"va-turn-rail__preview",role:"tooltip",style:Fe({top:`${pe.value}px`})},[f("span",N4,"#"+$(ae.value+1),1),f("span",U4,$(_(ie.value,ae.value)),1)],4)):R("",!0)],42,O4)):R("",!0)}});const q4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Bo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const H4=({size:e,strokeWidth:t=2,absoluteStrokeWidth:n,color:s,iconNode:o,name:a,class:i,...l},{slots:r})=>Tt("svg",{...Bo,width:e||Bo.width,height:e||Bo.height,stroke:s||Bo.stroke,"stroke-width":n?Number(t)*24/Number(e):t,class:["lucide",`lucide-${q4(a??"icon")}`],...l},[...o.map(c=>Tt(...c)),...r.default?[r.default()]:[]]);const Te=(e,t)=>(n,{slots:s})=>Tt(H4,{...n,iconNode:t,name:e},s);const K4=Te("ArrowDownIcon",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const J4=Te("BellIcon",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);const Z4=Te("BotIcon",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const Sc=Te("BriefcaseIcon",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);const ra=Te("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const io=Te("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const mf=Te("ChevronUpIcon",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const G4=Te("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Ec=Te("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const X4=Te("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Y4=Te("CpuIcon",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const Q4=Te("EllipsisIcon",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const eA=Te("EyeOffIcon",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const tA=Te("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const nA=Te("GaugeIcon",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);const sA=Te("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Tc=Te("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const Mc=Te("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const oA=Te("KeyIcon",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);const Fc=Te("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const aA=Te("ListTodoIcon",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);const Ms=Te("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const iA=Te("LockIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const lA=Te("MessageSquareTextIcon",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);const rA=Te("MousePointerClickIcon",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);const Wo=Te("PanelRightIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Ic=Te("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const _f=Te("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const cA=Te("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const uA=Te("RouteIcon",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const dA=Te("ServerIcon",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const gf=Te("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const fA=Te("ShieldAlertIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const pA=Te("ShieldCheckIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const vA=Te("SlidersVerticalIcon",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);const Ki=Te("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const Pc=Te("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const hA=Te("UserIcon",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const ca=Te("WrenchIcon",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Bc=Te("ZapIcon",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),mA={class:"va-console__sidebar"},_A={key:0,class:"va-console__stree-skeleton","aria-label":"加载会话列表"},gA={class:"va-sidebar__foot"},yA={class:"va-console__bell",type:"button","aria-label":"通知"},bA={key:0,class:"va-console__bell-badge"},kA={class:"va-console__notif-panel"},wA=we({__name:"ConsoleSidebar",props:{workspaces:{},sessions:{},loading:{type:Boolean},activeWorkspaceId:{},activeSessionId:{},isNewChat:{type:Boolean},sessionRunningMap:{},notifications:{},notifOpen:{type:Boolean}},emits:["start-new-chat","select-session","pick-workspace","delete-workspace","rename-session","toggle-archive","toggle-pin","delete-session","open-settings","update:notifOpen","open-notification","read-notification","all-read"],setup(e,{emit:t}){const n=e,s=t,o=E(()=>(n.notifications??[]).filter(d=>d.unread).length),a=E(()=>[...n.sessions.filter(_=>!_.archived&&_.status!=="archived")].sort((_,h)=>Number(h.pinned??!1)-Number(_.pinned??!1))),i=E(()=>n.sessions.filter(d=>d.archived||d.status==="archived")),l=E(()=>a.value.map(d=>({id:d.id,title:d.title,createdAt:d.createdAt,updatedAt:d.updatedAt,archived:!1,workspaceId:d.workspaceId,running:n.sessionRunningMap.get(d.id)||d.isRunning,pinned:d.pinned}))),r=E(()=>i.value.map(d=>({id:d.id,title:d.title,createdAt:d.createdAt,updatedAt:d.updatedAt,archived:!0,workspaceId:d.workspaceId,pinned:d.pinned}))),c=E(()=>n.workspaces.map(d=>({id:d.id,name:d.name,description:d.rootPath})));function u(d){return n.sessions.find(_=>_.id===d)}return(d,_)=>(v(),y("aside",mA,[e.loading?(v(),y("div",_A,[(v(),y(J,null,ve(6,h=>O(p(_n),{key:h,height:26,radius:"6px",width:h%2?"92%":"78%"},null,8,["width"])),64))])):(v(),le(p(Ny),{key:1,class:"va-console__stree",workspaces:c.value,sessions:l.value,archived:r.value,"current-workspace-id":e.activeWorkspaceId,"current-session-id":e.isNewChat?"":e.activeSessionId,"new-session":"",searchable:"",collapsible:"","hover-ops":"","workspace-create-mode":"picker","confirm-mode":"none",onCreateWorkspacePick:_[5]||(_[5]=h=>s("pick-workspace")),onCreateSession:_[6]||(_[6]=h=>s("start-new-chat",h)),onSelectSession:_[7]||(_[7]=h=>{const g=u(h);g&&s("select-session",g)}),onRemoveWorkspace:_[8]||(_[8]=h=>s("delete-workspace",h)),onRename:_[9]||(_[9]=(h,g)=>s("rename-session",h,g)),onArchive:_[10]||(_[10]=(h,g)=>s("toggle-archive",h,g)),onTogglePin:_[11]||(_[11]=h=>s("toggle-pin",h)),onRemove:_[12]||(_[12]=h=>s("delete-session",h))},{footer:ye(()=>[f("div",gA,[O(p(kn),{open:n.notifOpen??!1,placement:"top-start",offset:8,"onUpdate:open":_[3]||(_[3]=h=>s("update:notifOpen",h))},{trigger:ye(()=>[f("button",yA,[O(p(J4),{size:15}),o.value>0?(v(),y("span",bA,$(o.value>9?"9+":o.value),1)):R("",!0)])]),default:ye(()=>[f("div",kA,[O(p(Mx),{notifications:n.notifications??[],title:"通知","relative-time":"","empty-label":"暂无通知;审批到达与后台任务结束会出现在这里",onOpen:_[0]||(_[0]=h=>s("open-notification",h)),onRead:_[1]||(_[1]=h=>s("read-notification",h)),onAllRead:_[2]||(_[2]=h=>s("all-read"))},null,8,["notifications"])])]),_:1},8,["open"]),O(p(cs),{variant:"ghost",size:"sm",block:"",onClick:_[4]||(_[4]=h=>s("open-settings"))},{icon:ye(()=>[O(p(gf),{size:15})]),default:ye(()=>[_[13]||(_[13]=de(" 设置 ",-1))]),_:1})])]),_:1},8,["workspaces","sessions","archived","current-workspace-id","current-session-id"]))]))}}),xA={class:"va-console__seat-btn",type:"button","aria-label":"输入辅助菜单"},Lc=48*1024,Oc=we({__name:"ComposerMenu",emits:["clear","refFile","insert","openCommandMenu"],setup(e,{emit:t}){const n=t,s=[{id:"clear",label:"清空输入",icon:"✕"},{id:"ref-file",label:"引用工作区文件…",icon:"@",shortcut:"@"},{id:"import-text",label:"导入文本文件…",icon:"📄"},{id:"d1",label:"",divider:!0},{id:"cmdk",label:"命令面板",icon:"⌘",shortcut:"⌘K"}];function o(l){switch(l.id){case"clear":n("clear");break;case"ref-file":n("refFile");break;case"import-text":a.value?.click();break;case"cmdk":n("openCommandMenu");break}}const a=P(null);function i(l){const r=l.target,c=r.files?.[0];if(r.value="",!c)return;const u=new FileReader;u.onload=()=>{let d=String(u.result??"");d.length>Lc&&(d=`${d.slice(0,Lc)}
26
+ …(超出 48KB 已截断)`),n("insert",`
27
+
28
+ ---
29
+ [${c.name}]
30
+ ${d}
31
+ ---
32
+ `)},u.readAsText(c)}return(l,r)=>(v(),y(J,null,[O(p(mw),{items:s,trigger:"click",placement:"top-end",offset:6,onSelect:o},{trigger:ye(()=>[f("button",xA,[O(p(Q4),{size:13})])]),_:1}),f("input",{ref_key:"fileInput",ref:a,type:"file",hidden:"",accept:".txt,.md,.markdown,.json,.csv,.log,.yml,.yaml,.ts,.js,.vue,text/*",onChange:i},null,544)],64))}}),CA={class:"va-usage"},$A={class:"va-usage__window"},AA={class:"va-usage__hint"},DA={key:0,class:"va-usage__loading","aria-label":"加载用量数据"},RA=["title"],SA={class:"va-usage__kpis"},EA={class:"va-usage__kpi"},TA={class:"va-usage__kpi-sub"},MA={class:"va-usage__kpi"},FA={key:1,class:"va-usage__quota"},IA={key:2,class:"va-usage__quota"},PA={key:3,class:"va-usage__hint"},BA={key:4,class:"va-usage__breakdown"},LA={key:5,class:"va-console__rtab-empty"},OA=we({__name:"UsagePanel",props:{usage:{}},setup(e){const t=e,n=[{value:"24h",label:"24 小时"},{value:"7d",label:"7 天"},{value:"30d",label:"30 天"}],s=E(()=>t.usage.isCustom.value?"":t.usage.preset.value);function o(m){t.usage.setPreset(String(m))}function a(m){t.usage.setCustomRange(m.start,m.end)}const i=E(()=>{const m=t.usage.currentSessionCost.value;return m&&m.costUsd>0?m:null}),l=E(()=>t.usage.summary.value?.tokens??0),r=E(()=>t.usage.summary.value?.costUsd??0),c=E(()=>t.usage.summary.value?.recordCount??0),u=E(()=>Object.entries(t.usage.summary.value?.byModel??{}).map(([m,b])=>({label:m,value:Number(b.costUsd.toFixed(4))})).sort((m,b)=>b.value-m.value));function d(m){return m<36e5?`${Math.round(m/6e4)} 分钟`:m<864e5?`${Math.round(m/36e5)} 小时`:`${Math.round(m/864e5)} 天`}const _=E(()=>`准入窗口 · ${d(t.usage.limits.value.windowMs)} · 超限新请求 429`),h=E(()=>{const m=t.usage.limits.value.windowTokenLimit;return m>0?{limit:m,used:t.usage.quotaUsage.value?.tokens??0}:null}),g=E(()=>{const m=t.usage.limits.value.windowUsdLimit;return m>0?{limit:m,used:t.usage.quotaUsage.value?.costUsd??0}:null});return(m,b)=>(v(),y("div",CA,[f("div",$A,[O(p(Dd),{size:"sm","full-width":"","aria-label":"统计窗口",options:n,"model-value":s.value,"onUpdate:modelValue":o},null,8,["model-value"]),O(p(gx),{months:1,onChange:a})]),f("p",AA,[de($(e.usage.isCustom.value?"自定义日期区间":"滚动窗口 · 截止此刻")+" ",1),c.value>0?(v(),y(J,{key:0},[de("· "+$(c.value)+" 轮",1)],64)):R("",!0)]),e.usage.loading.value&&!e.usage.summary.value?(v(),y("div",DA,[O(p(_n),{height:44,radius:"8px"}),O(p(_n),{height:44,radius:"8px"}),O(p(_n),{height:72,radius:"8px"})])):(v(),y(J,{key:1},[i.value?(v(),y("p",{key:0,class:"va-usage__session-cost",title:`近 30 天 · ${i.value.recordCount} 轮`}," 当前会话 · "+$(p(gt)(i.value.tokens))+" tokens · $"+$(i.value.costUsd.toFixed(4)),9,RA)):R("",!0),f("div",SA,[f("div",EA,[b[0]||(b[0]=f("span",{class:"va-usage__kpi-label"},"Tokens",-1)),O(p(Er),{class:"va-usage__kpi-value",value:l.value,format:{notation:"compact",maximumFractionDigits:1}},null,8,["value"]),f("span",TA,$(p(gt)(l.value)),1)]),f("div",MA,[b[1]||(b[1]=f("span",{class:"va-usage__kpi-label"},"Cost",-1)),O(p(Er),{class:"va-usage__kpi-value",value:r.value,format:{style:"currency",currency:"USD"}},null,8,["value"]),b[2]||(b[2]=f("span",{class:"va-usage__kpi-sub"},"USD · 计价表命中才记钱",-1))])]),h.value?(v(),y("div",FA,[O(p(qr),{segments:[{label:"Tokens",used:h.value.used}],limit:h.value.limit,unit:"tokens",period:_.value},null,8,["segments","limit","period"])])):R("",!0),g.value?(v(),y("div",IA,[O(p(qr),{segments:[{label:"Cost",used:g.value.used}],limit:g.value.limit,unit:"USD",period:_.value},null,8,["segments","limit","period"])])):R("",!0),!h.value&&!g.value?(v(),y("p",PA," 未设配额(设置 → 执行 → 成本配额:设窗口 Token/费用上限,达到后新请求 429 拒绝) ")):R("",!0),u.value.length>0?(v(),y("div",BA,[O(p(Qx),{items:u.value,unit:"USD","bar-scale":"max","max-rows":5},null,8,["items"])])):(v(),y("div",LA,[...b[3]||(b[3]=[f("p",null,"所选窗口内暂无用量记录",-1)])]))],64))]))}}),zA={},po={"Content-Type":"application/json"};function jA(){let e="";try{e=localStorage.getItem("vuagent_token")||""}catch{}return e||zA?.VITE_VUAGENT_TOKEN||""}function ln(){const e=jA();return e?{Authorization:`Bearer ${e}`}:{}}async function Vt(e){const t=await fetch(e,{headers:ln()});return t.ok?await t.json():null}async function bt(e,t,n){const s=await fetch(e,{method:t,headers:{...ln(),...n===void 0?{}:po},body:n===void 0?void 0:JSON.stringify(n)});return s.ok?await s.json():null}function NA(){return Vt("/api/workspaces")}function UA(e){return bt("/api/workspaces","POST",e)}function yf(e){return Vt(`/api/workspaces/${e}/files`)}function WA(e){return bt(`/api/workspaces/${e}`,"DELETE")}function VA(){return bt("/api/workspaces/pick-directory","POST")}function qA(){return Vt("/api/sessions")}function HA(e){return Vt(`/api/sessions/${e}`)}function KA(e){return bt("/api/sessions","POST",e)}function Us(e,t){return bt(`/api/sessions/${e}`,"PATCH",t)}function JA(e){return bt(`/api/sessions/${e}`,"DELETE")}async function ZA(e){const t=await fetch(`/api/sessions/${e}/compact`,{method:"POST",headers:ln()}),n=await t.json().catch(()=>({}));if(!t.ok)throw new Error(n?.error||`压缩请求失败 [${t.status}] ${t.statusText}`);return n}function GA(e,t){return bt(`/api/settings/models/${e}`,"PATCH",t)}function XA(e){return bt(`/api/settings/models/${e}`,"DELETE")}function YA(){return Vt("/api/settings/providers")}function QA(e){return bt("/api/settings/providers","POST",e)}function e5(e,t){return bt(`/api/settings/providers/${e}`,"PATCH",t)}async function t5(e,t=!1){const n=await fetch(`/api/settings/providers/${e}${t?"?cascade=true":""}`,{method:"DELETE",headers:ln()});if(n.status===409){const s=await n.json().catch(()=>({}));return{success:!1,error:s.error,boundModels:s.boundModels,reason:s.reason}}return n.ok?await n.json():null}function n5(e,t){return bt(`/api/settings/providers/${e}/models`,"POST",t)}function s5(e){return bt(`/api/settings/models/${e}/verify-capabilities`,"POST",{})}function o5(e){return Vt(`/api/settings/providers/${e}/models/discover`)}async function zc(e){const t=await fetch("/api/settings/models/test",{method:"POST",headers:{...ln(),...po},body:JSON.stringify(e)});if(!t.ok)throw new Error(`探测请求失败 [${t.status}] ${t.statusText}`);return await t.json()}function bf(){return Vt("/api/config")}function a5(e,t){return bt(`/api/config/${encodeURIComponent(e)}`,"PATCH",t)}function i5(e){return bt(`/api/config/${encodeURIComponent(e)}/reset`,"POST")}function l5(){return Vt("/api/tools")}function r5(e,t){return bt(`/api/tools/${encodeURIComponent(e)}`,"PATCH",{enabled:t})}async function c5(){return Vt("/api/action/suspended")}async function u5(e,t){return(await fetch(`/api/action/${e}`,{method:"POST",headers:{...ln(),...po},body:JSON.stringify(t)})).ok}async function jc(e,t){const n=await fetch(`/api/action/${e}`,{method:"POST",headers:{...ln(),...po},body:JSON.stringify(t)});if(n.status===422){const s=await n.json().catch(()=>null);if(s?.fieldErrors&&Object.keys(s.fieldErrors).length>0)return{ok:!1,status:422,fieldErrors:s.fieldErrors}}return{ok:n.ok,status:n.status}}async function d5(e){try{await fetch(`/api/sessions/${e}/abort`,{method:"POST",headers:ln()})}catch{}}async function f5(e){const t=await fetch("/api/chat",{method:"POST",headers:{...ln(),...po},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>null);throw new Error(n?.error||`服务器返回错误 [${t.status}] ${t.statusText}`)}return t}async function p5(e){const t=await fetch(`/api/sessions/${e}/stream`,{headers:ln()});if(!t.ok)throw new Error(`服务器返回错误 [${t.status}] ${t.statusText}`);return t}function mi(e={}){const t=new URLSearchParams;e.since&&e.until?(t.set("since",String(e.since)),t.set("until",String(e.until))):e.windowMs&&t.set("windowMs",String(e.windowMs));const n=t.toString()?`?${t.toString()}`:"";return Vt(`/api/finops/summary${n}`)}async function v5(e=720*36e5){return Vt(`/api/finops/by-session?windowMs=${e}`)}async function h5(){const t=(await bf())?.namespaces.find(s=>s.id==="finops"),n=s=>typeof s=="number"&&Number.isFinite(s)&&s>0?s:0;return{windowTokenLimit:n(t?.values.windowTokenLimit),windowUsdLimit:n(t?.values.windowUsdLimit),windowMs:n(t?.values.windowMs)||864e5}}const kf="vuagent:interaction-settings",m5=1;function as(){return{autoCollapseThought:!0,autoCollapseToolCards:!0,showApprovals:!0,showFileTree:!0,showUsage:!0}}function _5(e){const t=as();if(e===null||typeof e!="object")return t;const n=e,s={...t};for(const o of Object.keys(t)){const a=n[o];typeof a==typeof t[o]&&(s[o]=a)}return s}function g5(e){if(!e)return as();try{const t=e.getItem(kf);if(!t)return as();const n=JSON.parse(t);return n===null||typeof n!="object"?as():_5(n.settings)}catch{return as()}}function y5(e,t){if(t)try{const n={version:m5,settings:{...e}};t.setItem(kf,JSON.stringify(n))}catch{}}function b5(){try{return typeof localStorage<"u"?localStorage:void 0}catch{return}}function k5(e){const t=P(g5(e));$e(t,o=>{y5(o,e)},{deep:!0});function n(o,a){t.value={...t.value,[o]:a}}function s(){t.value=as()}return{settings:t,updateSetting:n,resetToDefaults:s}}let _i=null;function Ea(){return _i||(_i=k5(b5())),_i}const w5={class:"va-console__right-sidebar"},x5={class:"va-console__rtabs"},C5=["aria-selected","onClick"],$5={key:0,class:"va-console__rtab-badge"},A5={class:"va-console__rtab-body"},D5={key:1,class:"va-console__rtab-empty"},R5={key:0,class:"va-console__rtab-empty"},S5={key:1,class:"va-rsb__skeleton","aria-label":"加载目录"},E5={key:2,class:"va-console__rtab-empty"},T5={key:0,class:"va-rsb__truncate-note"},M5={key:3,class:"va-console__rtab-empty"},F5=we({__name:"ConsoleRightSidebar",props:{decisions:{},workspaceId:{},usage:{}},emits:["collapse","decide"],setup(e,{emit:t}){const n=e,s=t,{settings:o}=Ea(),a=E(()=>{const _=[];return o.value.showApprovals&&_.push({key:"approvals",label:"审批"}),o.value.showFileTree&&_.push({key:"files",label:"文件"}),o.value.showUsage&&_.push({key:"usage",label:"用量"}),_}),i=P("approvals");$e(a,_=>{_.some(h=>h.key===i.value)||(i.value=_[0]?.key??"approvals")});const l=P([]),r=P(!1),c=P(!1),u=P("");async function d(_){if(l.value=[],c.value=!1,u.value="",!_)return;r.value=!0;const h=await yf(_);if(r.value=!1,!h){u.value="目录读取失败";return}l.value=h.tree,c.value=h.truncated}return $e(()=>n.workspaceId,_=>d(_),{immediate:!0}),(_,h)=>(v(),y("aside",w5,[f("div",x5,[(v(!0),y(J,null,ve(a.value,g=>(v(),y("button",{key:g.key,class:_e(["va-console__rtab",{"va-console__rtab--active":i.value===g.key}]),type:"button","aria-selected":i.value===g.key,onClick:m=>i.value=g.key},[de($(g.label)+" ",1),g.key==="approvals"&&e.decisions.length>0?(v(),y("span",$5,$(e.decisions.length),1)):R("",!0)],10,C5))),128)),O(p(Fd),{content:"收起侧栏",placement:"bottom"},{default:ye(()=>[f("button",{class:"va-console__rtab-collapse",type:"button","aria-label":"收起侧栏",onClick:h[0]||(h[0]=g=>s("collapse"))},[O(p(Wo),{size:14})])]),_:1})]),f("div",A5,[i.value==="approvals"?(v(),y(J,{key:0},[e.decisions.length>0?(v(),le(p(Qm),{key:0,decisions:e.decisions,onDecide:h[1]||(h[1]=(g,m)=>s("decide",g,m))},null,8,["decisions"])):(v(),y("div",D5,[O(p(Wo),{size:20}),h[2]||(h[2]=f("p",null,"暂无待审批事项",-1))]))],64)):i.value==="files"?(v(),y(J,{key:1},[e.workspaceId?r.value?(v(),y("div",S5,[O(p(_n),{height:14,radius:"4px"}),O(p(_n),{height:14,radius:"4px",width:"86%"}),O(p(_n),{height:14,radius:"4px",width:"72%"}),O(p(_n),{height:14,radius:"4px",width:"80%"})])):u.value?(v(),y("div",E5,[f("p",null,$(u.value),1)])):(v(),y(J,{key:3},[c.value?(v(),y("p",T5,"目录过大,仅展示前 2000 项")):R("",!0),O(p(ji),{tree:l.value,"default-expand-depth":1,"aria-label":"当前工作区文件目录"},null,8,["tree"])],64)):(v(),y("div",R5,[...h[3]||(h[3]=[f("p",null,"先选择或创建工作区",-1)])]))],64)):i.value==="usage"?(v(),le(OA,{key:2,usage:e.usage},null,8,["usage"])):R("",!0),a.value.length===0?(v(),y("div",M5,[O(p(Wo),{size:20}),h[4]||(h[4]=f("p",null,"侧栏内容已在「设置 → 交互」中全部隐藏",-1))])):R("",!0)])]))}}),I5={class:"va-console__docked-plan"},P5={class:"va-console__plan-bar-left"},B5={class:"va-console__plan-title"},L5={key:0,class:"va-console__plan-active-chip"},O5={class:"va-console__plan-bar-right"},z5={class:"va-console__plan-toggle-label"},j5={key:0,class:"va-console__plan-drawer"},N5={class:"va-console__plan-drawer-clip"},U5=we({__name:"DockedPlanBar",props:{steps:{},completed:{},running:{},expanded:{type:Boolean}},emits:["toggle"],setup(e){return(t,n)=>(v(),y("div",I5,[f("div",{class:"va-console__plan-bar",onClick:n[0]||(n[0]=s=>t.$emit("toggle"))},[f("div",P5,[O(p(aA),{size:15,class:"va-console__plan-icon"}),f("span",B5," 任务执行计划 ("+$(e.completed)+"/"+$(e.steps.length)+" 完成) ",1),e.running?(v(),y("span",L5,[O(p(Ms),{size:11,class:"va-console__spin"}),de(" 正在执行: "+$(e.running.title),1)])):R("",!0)]),f("div",O5,[f("span",z5,$(e.expanded?"折叠":"展开详情"),1),e.expanded?(v(),le(p(io),{key:0,size:14})):(v(),le(p(mf),{key:1,size:14}))])]),O(Xn,{name:"va-drawer-fold"},{default:ye(()=>[e.expanded?(v(),y("div",j5,[f("div",N5,[O(p(hg),{steps:e.steps},null,8,["steps"])])])):R("",!0)]),_:1})]))}}),W5={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Et=Ft({open:!1,title:"",description:"",placeholder:"",value:"",confirmText:"确认",cancelText:"取消"});let Ws=null,Ji=0,Nc=!1;function V5(){try{return W5?.DEV??!0}catch{return!0}}function q5(){return Ji+=1,()=>{Ji-=1}}function H5(){return Et}function K5(e){return Ji===0?(V5()&&!Nc&&(Nc=!0,console.warn("[askText] 未找到已挂载的 <TextPromptHost />:askText() 将直接 resolve(null)。请在应用根节点挂载宿主组件。")),Promise.resolve(null)):(Et.title=e.title,Et.description=e.description??"",Et.placeholder=e.placeholder??"",Et.value=e.initialValue??"",Et.confirmText=e.confirmText??"确认",Et.cancelText=e.cancelText??"取消",Et.open=!0,Ws&&Ws(null),new Promise(t=>{Ws=t}))}function Uc(){if(!Et.open)return;const e=Et.value.trim();wf(e||null)}function Wc(){Et.open&&wf(null)}function wf(e){Et.open=!1;const t=Ws;Ws=null,t?.(e)}const J5=["placeholder","aria-label","onKeydown"],Z5=we({__name:"TextPromptHost",setup(e){const t=H5();let n=null;it(()=>{n=q5()}),rl(()=>n?.());const s=P(null);$e(()=>t.open,async a=>{a&&(await Ge(),s.value?.focus(),s.value?.select())});function o(a){a.isComposing||a.keyCode===229||Uc()}return(a,i)=>(v(),le(p(gl),{open:p(t).open,size:"sm",title:p(t).title,description:p(t).description||void 0,"onUpdate:open":i[1]||(i[1]=l=>{l||p(Wc)()})},{footer:ye(()=>[O(p(cs),{variant:"secondary",size:"sm",onClick:p(Wc)},{default:ye(()=>[de($(p(t).cancelText),1)]),_:1},8,["onClick"]),O(p(cs),{variant:"primary",size:"sm",onClick:p(Uc)},{default:ye(()=>[de($(p(t).confirmText),1)]),_:1},8,["onClick"])]),default:ye(()=>[ze(f("input",{ref_key:"inputRef",ref:s,"onUpdate:modelValue":i[0]||(i[0]=l=>p(t).value=l),class:"va-console__input",type:"text",placeholder:p(t).placeholder,"aria-label":p(t).title,onKeydown:at(Se(o,["prevent"]),["enter"])},null,40,J5),[[Ze,p(t).value]])]),_:1},8,["open","title","description"]))}}),G5=[{id:"models",title:"模型与 API",description:"供应商、模型与 API Key 配置"},{id:"interaction",title:"交互",description:"自动折叠等交互偏好"},{id:"tools",title:"工具",description:"内置工具的启用与停用"},{id:"execution",title:"执行",description:"步数上限、审批超时、上下文预算与成本配额"},{id:"security",title:"安全",description:"默认权限模式与网络边界"},{id:"prompt",title:"提示词",description:"系统提示组装块与全局自定义指令"}],X5=[{key:"autoCollapseThought",title:"自动折叠思考过程",description:"本轮输出结束后折叠思考过程;与下一项同时开启时收进「已完成」摘要条,点击可展开"},{key:"autoCollapseToolCards",title:"自动折叠工具执行卡片",description:"本轮输出结束后折叠工具调用;与上一项同时开启时收进「已完成」摘要条,只留文本结果;失败卡片始终展开"},{key:"showApprovals",title:"右侧边栏显示审批收件箱",description:"跨会话的人机协同 (HITL) 待审批决策;关闭后右侧边栏不再展示该分区"},{key:"showFileTree",title:"右侧边栏显示工作区文件树",description:"当前工作区的目录结构(只读预览,深度 4 层);关闭后右侧边栏不再展示该分区"},{key:"showUsage",title:"右侧边栏显示成本用量面板",description:"滚动窗口/自定义区间的 token 与费用、按模型分解与配额水位(TASK-075);关闭后右侧边栏不再展示该分区"}],Vc={high:{label:"高风险",className:"va-settings__tool-badge--high"},medium:{label:"中风险",className:"va-settings__tool-badge--medium"},low:{label:"低风险",className:"va-settings__tool-badge--low"}};function is(e){return Vc[e]??Vc.medium}const Y5={class:"va-settings__title"},Q5={class:"va-settings__dlg-body"},eD={class:"va-settings__nav","aria-label":"设置导航"},tD=["aria-current","onClick"],nD={class:"va-settings__nav-text"},sD={class:"va-settings__nav-title"},oD={class:"va-settings__nav-desc"},aD={class:"va-settings__panel-area"},iD=we({__name:"SettingsModal",props:{open:{type:Boolean},activeTab:{default:"models"}},emits:["close","update:activeTab"],setup(e,{emit:t}){const n=e,s=t,o={models:Y4,interaction:rA,tools:ca,execution:nA,security:pA,prompt:lA};function a(i){i||s("close")}return(i,l)=>(v(),le(p(gl),{open:n.open,size:"lg","aria-label":"设置",description:"管理模型供应商与交互偏好,后续可持续增加设置页","onUpdate:open":a},{title:ye(()=>[f("span",Y5,[O(p(gf),{size:16,"aria-hidden":"true"}),l[0]||(l[0]=de(" 设置 ",-1))])]),default:ye(()=>[f("div",Q5,[f("nav",eD,[(v(!0),y(J,null,ve(p(G5),r=>(v(),y("button",{key:r.id,class:_e(["va-settings__nav-item",{"va-settings__nav-item--active":r.id===e.activeTab}]),type:"button","aria-current":r.id===e.activeTab?"true":void 0,onClick:c=>i.$emit("update:activeTab",r.id)},[(v(),le(cl(o[r.id]),{size:15,class:"va-settings__nav-icon"})),f("span",nD,[f("span",sD,$(r.title),1),f("span",oD,$(r.description),1)])],10,tD))),128))]),f("div",aD,[je(i.$slots,e.activeTab)])])]),_:3},8,["open"]))}}),lD={text:"文本",image:"图片",audio:"音频",video:"视频",pdf:"PDF"};function rD(e){return e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function cD(e,t={}){if(!e)return[];const n="capabilities"in e||"contextWindow"in e?e.capabilities??{}:e,s="contextWindow"in e&&typeof e.contextWindow=="number"?e.contextWindow:void 0,o=[],a=n.contextWindow||s;a&&o.push(rD(a));for(const i of n.inputModalities||[])i==="text"&&!t.includeText||o.push(lD[i]??i);return n.reasoning?.supported&&o.push("推理"),n.supportedParameters?.includes("tools")&&o.push("工具"),o}const Lo=[{id:"deepseek-v3",label:"DeepSeek V3",meta:"deepseek-chat",provider:"DeepSeek",model:"deepseek-chat"},{id:"qwen-2.5-72b",label:"Qwen 2.5 72B",meta:"qwen-2.5-72b",provider:"通义千问",model:"qwen-2.5-72b-instruct"},{id:"claude-3-7-sonnet",label:"Claude 3.7 Sonnet",meta:"claude-3-7-sonnet",provider:"Anthropic",model:"claude-3-7-sonnet-20250219"},{id:"ollama-local",label:"Ollama (Local)",meta:"llama3:8b",provider:"Ollama 本地",model:"llama3:8b"}],uD=[{id:"review",label:"严格审批 (Review)",desc:"写文件、命令执行等需人工确认"},{id:"auto",label:"自动执行 (Auto)",desc:"工具沙箱全自动运行"},{id:"readonly",label:"只读沙箱 (Read-Only)",desc:"禁止一切写入与执行操作"}],qc={deepseek:{name:"DeepSeek V3",model:"deepseek-chat",baseUrl:"https://api.deepseek.com/v1",contextWindow:128e3},anthropic:{name:"Claude 3.7 Sonnet",model:"claude-3-7-sonnet-20250219",baseUrl:"https://api.anthropic.com/v1",contextWindow:2e5},openai:{name:"OpenAI GPT-4o",model:"gpt-4o",baseUrl:"https://api.openai.com/v1",contextWindow:128e3},ollama:{name:"Ollama 本地模型",model:"qwen2.5-coder:7b",baseUrl:"http://localhost:11434/v1",contextWindow:32e3},custom:{name:"兼容模型 (Custom)",model:"custom-model",baseUrl:"http://localhost:8000/v1",contextWindow:32e3},qwen:{name:"Qwen 通义千问",model:"qwen-max",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",contextWindow:128e3}},dD=[{value:"deepseek",label:"DeepSeek (官方 API)"},{value:"qwen",label:"Qwen / 阿里云通义千问"},{value:"anthropic",label:"Anthropic (Claude)"},{value:"openai",label:"OpenAI (GPT-4o/o3)"},{value:"ollama",label:"Ollama (本地运行)"},{value:"custom",label:"Custom (OpenAI 兼容接口)"}],fD={id:"",name:"",provider:"deepseek",model:"deepseek-chat",baseUrl:"https://api.deepseek.com/v1",apiKey:"",contextWindow:128e3,temperature:.2,isDefault:!1},pD={class:"va-settings__panel va-settings__panel--models"},vD={class:"va-console__modal-body"},hD={class:"va-console__modal-left"},mD={class:"va-console__modal-list-head"},_D={class:"va-console__modal-profile-list"},gD={key:0,class:"va-console__profile-card va-console__profile-card--active"},yD={class:"va-console__profile-card-top"},bD={class:"va-console__profile-name"},kD={class:"va-console__profile-card-sub"},wD={class:"va-console__provider-pill"},xD=["onClick"],CD={class:"va-console__profile-card-top"},$D={class:"va-console__profile-name"},AD={key:0,class:"va-prov-count-chip"},DD={class:"va-console__profile-card-sub"},RD={class:"va-console__provider-pill"},SD={key:0,class:"va-console__model-id"},ED={key:1,class:"va-console__empty-tip"},TD={class:"va-console__modal-right"},MD={class:"va-console__form-row"},FD={class:"va-console__form-group flex-1"},ID={class:"va-console__form-group flex-1"},PD={class:"va-console__form-group"},BD={class:"va-console__label"},LD={class:"va-console__form-group"},OD={class:"va-console__label"},zD={key:0,class:"va-console__profile-card-sub",style:{"margin-left":"6px"}},jD={class:"va-console__input-with-action"},ND=["type","placeholder"],UD={class:"va-prov-actions"},WD={class:"va-model-section"},VD={class:"va-model-section__head"},qD={class:"va-model-section__title"},HD={class:"va-model-section__count"},KD=["disabled"],JD={key:0,class:"va-model-list"},ZD=["onClick"],GD={class:"va-model-row__info"},XD={class:"va-model-row__name"},YD={key:0,class:"va-console__default-chip"},QD={class:"va-model-row__id"},eR={class:"va-model-row__badges"},tR=["title","disabled","onClick"],nR={class:"va-model-row__edit",type:"button"},sR=["onClick"],oR={key:1,class:"va-console__empty-tip"},aR={key:2,class:"va-model-editor"},iR={class:"va-model-editor__head"},lR={class:"va-model-editor__title"},rR={class:"va-console__form-row"},cR={class:"va-console__form-group flex-1"},uR={class:"va-console__form-group flex-1"},dR={class:"va-console__input-with-action"},fR=["disabled"],pR={id:"va-discovered-models"},vR=["value"],hR={class:"va-cap-block"},mR={class:"va-cap-block__title"},_R=["disabled"],gR={key:0,class:"va-cap-verdicts"},yR=["data-ok","data-fail","title"],bR={class:"va-cap-verdict__mark"},kR={class:"va-cap-verdict__name"},wR={class:"va-cap-verdict__detail"},xR={class:"va-console__form-row"},CR={class:"va-console__form-group flex-1"},$R={class:"va-console__form-group flex-1"},AR={class:"va-console__form-group"},DR={class:"va-cap-chips"},RR=["onClick"],SR={class:"va-cap-toggles"},ER={class:"va-console__form-row"},TR={class:"va-console__form-group flex-1"},MR={class:"va-console__label"},FR={class:"va-console__form-group flex-1"},IR={class:"va-console__checkbox-row",style:{"margin-top":"22px"}},PR={class:"va-console__checkbox-label"},BR={class:"va-model-editor__foot"},LR={class:"va-console__modal-foot"},OR={class:"va-console__foot-left"},zR={class:"va-console__foot-right"},jR=["disabled","title"],NR=we({__name:"ModelProfilesPanel",props:{providers:{},selectedProviderId:{},isCreatingProvider:{type:Boolean},currentProvider:{},currentProviderModels:{},providerForm:{},modelDraft:{},isCreatingModel:{type:Boolean},showApiKey:{type:Boolean},isTestingConnection:{type:Boolean},testingProfileId:{},isDiscovering:{type:Boolean},testStatus:{},discoveredModels:{},discoveredItems:{},isVerifyingCapabilities:{type:Boolean},capabilityVerdicts:{}},emits:["close","select-provider","create-provider","delete-provider","create-model","edit-model","delete-model","cancel-model-edit","save-provider","save-model","test","discover","select-model","test-model","provider-kind-change","update:showApiKey","toggle-modality","toggle-reasoning","toggle-tool-use","verify-capabilities"],setup(e,{emit:t}){const n=e,s=t,o=P(!1),a=P(null);function i(){o.value=!o.value,a.value=o.value}const l=E(()=>n.discoveredItems.map(g=>({value:g.id,label:g.displayName?`${g.displayName} · ${g.id}`:g.id})));$e(()=>[n.discoveredModels.length,n.isDiscovering],([g,m])=>{m||(g===0?o.value=!0:a.value!==!0&&(o.value=!1))});const r=[{id:"image",label:"图片",icon:Mc},{id:"pdf",label:"PDF",icon:null},{id:"audio",label:"音频",icon:null},{id:"video",label:"视频",icon:null}];function c(g){return cD({capabilities:g.capabilities,contextWindow:g.contextWindow})}function u(g){return(n.modelDraft?.capabilities?.inputModalities||["text"]).includes(g)}function d(){return!!n.modelDraft?.capabilities?.reasoning?.supported}function _(){return!!n.modelDraft?.capabilities?.supportedParameters?.includes("tools")}const h=E(()=>n.modelDraft?.id||"");return(g,m)=>(v(),y("div",pD,[f("div",vD,[f("div",hD,[f("div",mD,[f("span",null,"供应商 ("+$(e.providers.length)+")",1),f("button",{class:"va-console__btn-add-profile",type:"button",onClick:m[0]||(m[0]=b=>s("create-provider"))},[O(p(Ic),{size:13}),m[25]||(m[25]=de(" 添加 ",-1))])]),f("div",_D,[e.isCreatingProvider?(v(),y("div",gD,[f("div",yD,[f("span",bD,$(e.providerForm.name||"新供应商"),1),m[26]||(m[26]=f("span",{class:"va-console__new-chip"},"新建中",-1))]),f("div",kD,[f("span",wD,$(e.providerForm.provider),1)])])):R("",!0),(v(!0),y(J,null,ve(e.providers,b=>(v(),y("div",{key:b.id,class:_e(["va-console__profile-card",{"va-console__profile-card--active":b.id===e.selectedProviderId&&!e.isCreatingProvider}]),onClick:w=>s("select-provider",b.id)},[f("div",CD,[f("span",$D,$(b.name),1),(b.models||[]).length?(v(),y("span",AD,$((b.models||[]).length),1)):R("",!0)]),f("div",DD,[f("span",RD,$(b.provider),1),b.maskedApiKey?(v(),y("span",SD,$(b.maskedApiKey),1)):R("",!0)])],10,xD))),128)),e.providers.length===0&&!e.isCreatingProvider?(v(),y("p",ED," 还没有供应商,先添加一个端点与密钥。 ")):R("",!0)])]),f("div",TD,[m[45]||(m[45]=f("div",{class:"va-settings__panel-heading"},[f("p",{class:"va-console__modal-sub"}," 端点与密钥在此配置一次,其下所有模型共用;修改后立即对全部模型生效。 ")],-1)),f("div",MD,[f("div",FD,[m[27]||(m[27]=f("label",{class:"va-console__label"},"供应商名称",-1)),ze(f("input",{"onUpdate:modelValue":m[1]||(m[1]=b=>e.providerForm.name=b),class:"va-console__input",type:"text",placeholder:"如 DeepSeek 官方"},null,512),[[Ze,e.providerForm.name]])]),f("div",ID,[m[28]||(m[28]=f("label",{class:"va-console__label"},"类型",-1)),O(p(sa),{"model-value":e.providerForm.provider,options:p(dD),label:"供应商类型","onUpdate:modelValue":m[2]||(m[2]=b=>s("provider-kind-change",Array.isArray(b)?String(b[0]??""):String(b)))},null,8,["model-value","options"])])]),f("div",PD,[f("label",BD,[O(p(sA),{size:12}),m[29]||(m[29]=de(" API 基础地址",-1))]),ze(f("input",{"onUpdate:modelValue":m[3]||(m[3]=b=>e.providerForm.baseUrl=b),class:"va-console__input font-mono",type:"text",placeholder:"如 https://api.deepseek.com/v1"},null,512),[[Ze,e.providerForm.baseUrl]])]),f("div",LD,[f("label",OD,[O(p(oA),{size:12}),m[30]||(m[30]=de(" API 密钥 ",-1)),e.providerForm.maskedApiKey?(v(),y("span",zD," 已配置 "+$(e.providerForm.maskedApiKey),1)):R("",!0)]),f("div",jD,[ze(f("input",{"onUpdate:modelValue":m[4]||(m[4]=b=>e.providerForm.apiKey=b),class:"va-console__input font-mono",type:e.showApiKey?"text":"password",placeholder:e.providerForm.maskedApiKey?"留空保持原密钥":"sk-..."},null,8,ND),[[xd,e.providerForm.apiKey]]),f("button",{class:"va-console__input-addon-btn",type:"button",onClick:m[5]||(m[5]=b=>s("update:showApiKey",!e.showApiKey))},[e.showApiKey?(v(),le(p(eA),{key:0,size:14})):(v(),le(p(tA),{key:1,size:14}))])])]),f("div",UD,[f("button",{class:"va-console__btn-ghost",type:"button",onClick:m[6]||(m[6]=b=>s("save-provider"))},$(e.isCreatingProvider?"创建供应商":"保存供应商设置"),1)]),f("div",WD,[f("div",VD,[f("span",qD,[m[31]||(m[31]=de(" 此供应商下的模型 ",-1)),f("span",HD,$(e.currentProviderModels.length),1)]),f("button",{class:"va-console__btn-add-profile",type:"button",disabled:!e.currentProvider,onClick:m[7]||(m[7]=b=>s("create-model"))},[O(p(Ic),{size:12}),m[32]||(m[32]=de(" 添加模型 ",-1))],8,KD)]),e.currentProviderModels.length?(v(),y("div",JD,[(v(!0),y(J,null,ve(e.currentProviderModels,b=>(v(),y("div",{key:b.id,class:_e(["va-model-row",{"va-model-row--editing":b.id===h.value}])},[f("div",{class:"va-model-row__main",onClick:w=>s("edit-model",b)},[f("div",GD,[f("span",XD,[de($(b.name)+" ",1),b.isDefault?(v(),y("span",YD,"默认")):R("",!0)]),f("span",QD,$(b.model),1)]),f("div",eR,[(v(!0),y(J,null,ve(c(b),w=>(v(),y("span",{key:w,class:"va-prov-badge"},$(w),1))),128))]),f("button",{class:"va-model-row__edit",type:"button",title:e.testingProfileId===b.id?"探测中…":e.testingProfileId?"另有模型探测进行中":"不进编辑直接测试该模型连通性",disabled:!!e.testingProfileId,onClick:Se(w=>s("test-model",b),["stop"])},[e.testingProfileId===b.id?(v(),le(p(Ms),{key:0,size:13,class:"va-console__spin"})):(v(),le(p(Bc),{key:1,size:13}))],8,tR),f("button",nR,[b.id===h.value?(v(),le(p(mf),{key:0,size:13})):(v(),le(p(io),{key:1,size:13}))]),f("button",{class:"va-model-row__del",type:"button",title:"删除该模型",onClick:Se(w=>s("delete-model",b.id),["stop"])},[O(p(Pc),{size:12})],8,sR)],8,ZD)],2))),128))])):e.modelDraft?R("",!0):(v(),y("p",oR," 该供应商下还没有模型。点「添加模型」即可复用上面的端点与密钥。 ")),e.modelDraft?(v(),y("div",aR,[f("div",iR,[f("span",lR,$(e.isCreatingModel?"添加模型":`编辑「${e.modelDraft.name||"未命名"}」`),1),f("button",{class:"va-model-editor__cancel",type:"button",onClick:m[8]||(m[8]=b=>s("cancel-model-edit"))}," 收起 ")]),f("div",rR,[f("div",cR,[m[33]||(m[33]=f("label",{class:"va-console__label"},"显示名称",-1)),ze(f("input",{"onUpdate:modelValue":m[9]||(m[9]=b=>e.modelDraft.name=b),class:"va-console__input",type:"text",placeholder:"如 DeepSeek V3 生产"},null,512),[[Ze,e.modelDraft.name]])]),f("div",uR,[m[34]||(m[34]=f("label",{class:"va-console__label"},"模型标识 (Model ID)",-1)),f("div",dR,[o.value?ze((v(),y("input",{key:1,"onUpdate:modelValue":m[11]||(m[11]=b=>e.modelDraft.model=b),class:"va-console__input font-mono",type:"text",placeholder:"如 deepseek-chat",list:"va-discovered-models"},null,512)),[[Ze,e.modelDraft.model]]):(v(),le(p(sa),{key:0,class:"va-console__model-select","model-value":e.modelDraft.model||"",options:l.value,searchable:"",disabled:e.isDiscovering,placeholder:e.isDiscovering?"正在拉取模型列表…":l.value.length?"选择模型标识(可搜索)":"暂无候选:刷新或手动输入",label:"模型标识",invalid:!e.modelDraft.model?.trim(),"onUpdate:modelValue":m[10]||(m[10]=b=>b&&s("select-model",String(b)))},null,8,["model-value","options","disabled","placeholder","invalid"])),f("button",{class:"va-console__input-addon-btn",type:"button",disabled:e.isDiscovering,title:"从供应商拉取可用模型列表",onClick:m[12]||(m[12]=b=>s("discover"))},[e.isDiscovering?(v(),le(p(Ms),{key:0,size:14,class:"va-console__spin"})):(v(),le(p(_f),{key:1,size:14}))],8,fR)]),f("button",{type:"button",class:"va-console__model-manual-toggle",onClick:i},$(o.value?"改为列表选择":"列表里没有?手动输入标识"),1),f("datalist",pR,[(v(!0),y(J,null,ve(e.discoveredModels,b=>(v(),y("option",{key:b,value:b},null,8,vR))),128))])])]),f("div",hR,[f("div",mR,[O(p(Ki),{size:12}),m[36]||(m[36]=de(" 能力标记 ",-1)),m[37]||(m[37]=f("span",{class:"va-cap-block__hint"},"决定附件入口、上下文仪表等行为",-1)),e.modelDraft.id?(v(),y("button",{key:0,class:"va-console__btn-ghost va-cap-block__verify",type:"button",disabled:e.isVerifyingCapabilities,title:"按勾选能力逐项实测端点行为(产生少量真实 API 费用)",onClick:m[13]||(m[13]=b=>s("verify-capabilities"))},[e.isVerifyingCapabilities?(v(),le(p(Ms),{key:0,size:12,class:"va-console__spin"})):(v(),le(p(Ec),{key:1,size:12})),m[35]||(m[35]=de(" 验证能力 ",-1))],8,_R)):R("",!0)]),e.capabilityVerdicts.length?(v(),y("ul",gR,[(v(!0),y(J,null,ve(e.capabilityVerdicts,b=>(v(),y("li",{key:b.capability,class:"va-cap-verdict","data-ok":b.ok===!0||void 0,"data-fail":b.ok===!1||void 0,title:b.detail},[f("span",bR,$(b.ok===!0?"✓":b.ok===!1?"✗":"?"),1),f("span",kR,$(b.capability==="image"?"图片输入":b.capability==="reasoning"?"推理档位":b.capability),1),f("span",wR,$(b.ok===!1?"端点拒绝,建议取消勾选":b.ok===null?"无法判定(鉴权/网络)":"通过"),1)],8,yR))),128))])):R("",!0),f("div",xR,[f("div",CR,[m[38]||(m[38]=f("label",{class:"va-console__label"},"上下文窗口 (tokens)",-1)),ze(f("input",{"onUpdate:modelValue":m[14]||(m[14]=b=>e.modelDraft.contextWindow=b),class:"va-console__input font-mono",type:"number",step:"1000",placeholder:"128000"},null,512),[[Ze,e.modelDraft.contextWindow,void 0,{number:!0}]])]),f("div",$R,[m[39]||(m[39]=f("label",{class:"va-console__label"},"最大输出 (tokens)",-1)),ze(f("input",{"onUpdate:modelValue":m[15]||(m[15]=b=>e.modelDraft.capabilities.maxOutputTokens=b),class:"va-console__input font-mono",type:"number",step:"1000",placeholder:"可选"},null,512),[[Ze,e.modelDraft.capabilities.maxOutputTokens,void 0,{number:!0}]])])]),f("div",AR,[m[41]||(m[41]=f("label",{class:"va-console__label"},"输入模态",-1)),f("div",DR,[m[40]||(m[40]=f("span",{class:"va-cap-chip va-cap-chip--locked"},"文本",-1)),(v(),y(J,null,ve(r,b=>f("button",{key:b.id,class:_e(["va-cap-chip",{"va-cap-chip--on":u(b.id)}]),type:"button",onClick:w=>s("toggle-modality",b.id)},[b.id==="image"?(v(),le(p(Mc),{key:0,size:11})):R("",!0),de(" "+$(b.label),1)],10,RR)),64))])]),f("div",SR,[f("button",{class:_e(["va-cap-toggle",{"va-cap-toggle--on":d()}]),type:"button",onClick:m[16]||(m[16]=b=>s("toggle-reasoning"))},[O(p(Ki),{size:12}),m[42]||(m[42]=f("span",null,"支持推理",-1)),d()?(v(),le(p(ra),{key:0,size:12,class:"va-cap-toggle__check"})):R("",!0)],2),f("button",{class:_e(["va-cap-toggle",{"va-cap-toggle--on":_()}]),type:"button",onClick:m[17]||(m[17]=b=>s("toggle-tool-use"))},[O(p(ca),{size:12}),m[43]||(m[43]=f("span",null,"支持工具调用",-1)),_()?(v(),le(p(ra),{key:0,size:12,class:"va-cap-toggle__check"})):R("",!0)],2)])]),f("div",ER,[f("div",TR,[f("label",MR,[O(p(vA),{size:12}),de(" 默认温度 ("+$(e.modelDraft.temperature)+") ",1)]),ze(f("input",{"onUpdate:modelValue":m[18]||(m[18]=b=>e.modelDraft.temperature=b),class:"va-console__range",type:"range",min:"0",max:"1",step:"0.05"},null,512),[[Ze,e.modelDraft.temperature,void 0,{number:!0}]])]),f("div",FR,[f("div",IR,[f("label",PR,[ze(f("input",{"onUpdate:modelValue":m[19]||(m[19]=b=>e.modelDraft.isDefault=b),type:"checkbox"},null,512),[[hl,e.modelDraft.isDefault]]),m[44]||(m[44]=f("span",null,"设为全局默认模型",-1))])])])]),f("div",BR,[f("button",{class:"va-console__btn-ghost",type:"button",onClick:m[20]||(m[20]=b=>s("cancel-model-edit"))}," 取消 "),f("button",{class:"va-console__btn-primary",type:"button",onClick:m[21]||(m[21]=b=>s("save-model"))},$(e.isCreatingModel?"添加":"保存"),1)])])):R("",!0)]),e.testStatus?(v(),y("div",{key:0,class:_e(["va-console__test-status-box",{"va-console__test-status-box--ok":e.testStatus.ok,"va-console__test-status-box--err":!e.testStatus.ok}])},[e.testStatus.ok?(v(),le(p(Ec),{key:0,size:14})):(v(),le(p(G4),{key:1,size:14})),f("span",null,$(e.testStatus.message),1)],2)):R("",!0)])]),f("div",LR,[f("div",OR,[!e.isCreatingProvider&&e.currentProvider?(v(),y("button",{key:0,class:"va-console__btn-delete-profile",type:"button",onClick:m[22]||(m[22]=b=>s("delete-provider",e.currentProvider.id))},[O(p(Pc),{size:13}),m[46]||(m[46]=de(" 删除供应商 ",-1))])):R("",!0)]),f("div",zR,[f("button",{class:"va-console__btn-ghost",disabled:e.isTestingConnection||!e.modelDraft?.model?.trim(),title:e.modelDraft?.model?.trim()?"向该模型发起最小探测(产生 1 token 费用)":"先选择或填写模型标识再测试",type:"button",onClick:m[23]||(m[23]=b=>s("test"))},[e.isTestingConnection?(v(),le(p(Ms),{key:0,size:13,class:"va-console__spin"})):(v(),le(p(Bc),{key:1,size:13})),m[47]||(m[47]=f("span",null,"测试连通性",-1))],8,jR),f("button",{class:"va-console__btn-ghost",type:"button",onClick:m[24]||(m[24]=b=>s("close"))},"关闭")])])]))}}),UR={class:"va-settings__panel va-settings__panel--interaction"},WR={class:"va-settings__section"},VR={class:"va-settings__toggle-list"},qR={class:"va-settings__toggle-text"},HR={class:"va-settings__toggle-title"},KR={class:"va-settings__toggle-desc"},JR=["aria-checked","aria-label","onClick"],ZR=we({__name:"InteractionPanel",setup(e){const{settings:t,updateSetting:n}=Ea();function s(o){n(o,!t.value[o])}return(o,a)=>(v(),y("div",UR,[f("div",WR,[a[1]||(a[1]=f("div",null,[f("div",{class:"va-settings__section-title"},"会话交互与侧栏内容"),f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 对话折叠行为与右侧边栏的内容显隐,修改即时生效并本地记忆 ")],-1)),f("div",VR,[(v(!0),y(J,null,ve(p(X5),i=>(v(),y("div",{key:i.key,class:"va-settings__toggle-row"},[f("div",qR,[f("span",HR,$(i.title),1),f("span",KR,$(i.description),1)]),f("button",{class:_e(["va-settings__switch",{"va-settings__switch--on":p(t)[i.key]}]),type:"button",role:"switch","aria-checked":p(t)[i.key],"aria-label":i.title,onClick:l=>s(i.key)},[...a[0]||(a[0]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,JR)]))),128))])])]))}}),GR={class:"va-settings__panel va-settings__panel--tools"},XR={key:0,class:"va-settings__tools-error"},YR={key:1,class:"va-settings__tools-loading"},QR={key:2,class:"va-settings__tools-loading"},e8={key:3,class:"va-settings__section"},t8={class:"va-settings__tool-filter-tabs"},n8={key:0,class:"va-settings__group-block"},s8={class:"va-settings__section-title"},o8={class:"va-settings__toggle-list",style:{"margin-top":"8px"}},a8={class:"va-settings__toggle-text"},i8={class:"va-settings__tool-headline"},l8={class:"va-settings__toggle-title"},r8={key:0,class:"va-settings__tool-write"},c8=["title"],u8=["aria-checked","aria-label","onClick"],d8={key:1,class:"va-settings__group-block",style:{"margin-top":"14px"}},f8={class:"va-settings__section-title"},p8={class:"va-settings__toggle-list",style:{"margin-top":"8px"}},v8={class:"va-settings__toggle-text"},h8={class:"va-settings__tool-headline"},m8={class:"va-settings__toggle-title",style:{"font-family":"var(--va-font-mono, monospace)"}},_8={key:0,class:"va-settings__approval-badge",title:"调用此工具前将强制弹出 HITL 人工审批卡"},g8=["title"],y8=["aria-checked","aria-label","onClick"],b8={key:2,class:"va-settings__group-block",style:{"margin-top":"14px"}},k8={class:"va-settings__section-title"},w8={class:"va-settings__toggle-list",style:{"margin-top":"8px"}},x8={class:"va-settings__toggle-text"},C8={class:"va-settings__tool-headline"},$8={class:"va-settings__toggle-title",style:{"font-family":"var(--va-font-mono, monospace)"}},A8={key:0,class:"va-settings__scene-ready",title:"前端 CardRegistry 已注册对应渲染器"},D8={key:1,class:"va-settings__scene-unbound",title:"前端未注册对应组件,将使用优雅降级容器渲染"},R8=["title"],S8=["aria-checked","aria-label","onClick"],E8=we({__name:"ToolsPanel",props:{tools:{},loading:{type:Boolean},loadError:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,s=t,o=P("all"),a=E(()=>n.tools.filter(c=>c.source==="builtin"||!c.source)),i=E(()=>n.tools.filter(c=>c.source==="custom")),l=E(()=>n.tools.filter(c=>c.source==="ui_component"));function r(c){return!!Ld(c)}return(c,u)=>(v(),y("div",GR,[e.loadError?(v(),y("p",XR,$(e.loadError),1)):e.loading?(v(),y("p",YR,"正在加载工具清单…")):e.tools.length===0?(v(),y("p",QR," 服务端暂无已注册工具 ")):(v(),y("div",e8,[f("div",t8,[f("button",{type:"button",class:_e(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":o.value==="all"}]),onClick:u[0]||(u[0]=d=>o.value="all")}," 全部 ("+$(e.tools.length)+") ",3),f("button",{type:"button",class:_e(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":o.value==="builtin"}]),onClick:u[1]||(u[1]=d=>o.value="builtin")},[O(p(ca),{size:12,style:{"vertical-align":"-1px","margin-right":"3px"}}),de(" 系统基础 ("+$(a.value.length)+") ",1)],2),i.value.length>0?(v(),y("button",{key:0,type:"button",class:_e(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":o.value==="custom"}]),onClick:u[2]||(u[2]=d=>o.value="custom")},[O(p(Sc),{size:12,style:{"vertical-align":"-1px","margin-right":"3px",color:"#0284c7"}}),de(" 业务动作 ("+$(i.value.length)+") ",1)],2)):R("",!0),l.value.length>0?(v(),y("button",{key:1,type:"button",class:_e(["va-settings__tool-tab-btn",{"va-settings__tool-tab-btn--active":o.value==="scene"}]),onClick:u[3]||(u[3]=d=>o.value="scene")},[O(p(Fc),{size:12,style:{"vertical-align":"-1px","margin-right":"3px",color:"#7e22ce"}}),de(" 场景组件 ("+$(l.value.length)+") ",1)],2)):R("",!0)]),o.value==="all"||o.value==="builtin"?(v(),y("div",n8,[f("div",null,[f("div",s8,[O(p(ca),{size:14,style:{"vertical-align":"-2px","margin-right":"4px"}}),u[4]||(u[4]=de(" 内置系统基础工具 ",-1))]),u[5]||(u[5]=f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 底层文件读写、沙箱命令执行与文件检索工具。停用后 Agent 本轮起不再调用。 ",-1))]),f("div",o8,[(v(!0),y(J,null,ve(a.value,d=>(v(),y("div",{key:d.name,class:"va-settings__toggle-row"},[f("div",a8,[f("div",i8,[f("span",l8,$(d.name),1),f("span",{class:_e(["va-settings__tool-badge",p(is)(d.riskLevel).className])},$(p(is)(d.riskLevel).label),3),d.writesWorkspace?(v(),y("span",r8,"写")):R("",!0)]),f("span",{class:"va-settings__toggle-desc",title:d.description},$(d.description),9,c8)]),f("button",{class:_e(["va-settings__switch",{"va-settings__switch--on":d.enabled}]),type:"button",role:"switch","aria-checked":d.enabled,"aria-label":`启用 ${d.name}`,onClick:_=>s("toggle",d)},[...u[6]||(u[6]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,u8)]))),128))])])):R("",!0),(o.value==="all"||o.value==="custom")&&i.value.length>0?(v(),y("div",d8,[f("div",null,[f("div",f8,[O(p(Sc),{size:14,style:{"vertical-align":"-2px","margin-right":"4px",color:"#0284c7"}}),u[7]||(u[7]=de(" 业务扩展工具 (Custom Action Tools) ",-1))]),u[8]||(u[8]=f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 纯数据、逻辑与动作型业务扩展(数据库查询、Git 探针、CI 触发等)。执行结果直接作为上下文喂回大模型继续思考,高危操作可触发人工审批。 ",-1))]),f("div",p8,[(v(!0),y(J,null,ve(i.value,d=>(v(),y("div",{key:d.name,class:"va-settings__toggle-row"},[f("div",v8,[f("div",h8,[f("span",m8,$(d.name),1),u[10]||(u[10]=f("span",{class:"va-settings__custom-badge"},"业务工具",-1)),f("span",{class:_e(["va-settings__tool-badge",p(is)(d.riskLevel).className])},$(p(is)(d.riskLevel).label),3),d.requiresApproval?(v(),y("span",_8,[O(p(fA),{size:10,style:{"vertical-align":"-1px","margin-right":"2px"}}),u[9]||(u[9]=de(" 人工审批 ",-1))])):R("",!0)]),f("span",{class:"va-settings__toggle-desc",title:d.description},$(d.description),9,g8)]),f("button",{class:_e(["va-settings__switch",{"va-settings__switch--on":d.enabled}]),type:"button",role:"switch","aria-checked":d.enabled,"aria-label":`启用 ${d.name}`,onClick:_=>s("toggle",d)},[...u[11]||(u[11]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,y8)]))),128))])])):R("",!0),(o.value==="all"||o.value==="scene")&&l.value.length>0?(v(),y("div",b8,[f("div",null,[f("div",k8,[O(p(Fc),{size:14,style:{"vertical-align":"-2px","margin-right":"4px",color:"#7e22ce"}}),u[12]||(u[12]=de(" 场景组件工具 (Generative UI) ",-1))]),u[13]||(u[13]=f("p",{class:"va-console__modal-sub",style:{"margin-top":"2px"}}," 由 UIComponentRegistry 开放注册的特定业务场景可视化卡片。模型按需输出参数,前端同名组件动态挂载渲染。 ",-1))]),f("div",w8,[(v(!0),y(J,null,ve(l.value,d=>(v(),y("div",{key:d.name,class:"va-settings__toggle-row"},[f("div",x8,[f("div",C8,[f("span",$8,$(d.name),1),u[14]||(u[14]=f("span",{class:"va-settings__scene-badge"},"场景组件",-1)),r(d.name)?(v(),y("span",A8," ✨ 前端已就绪 ")):(v(),y("span",D8," 未绑定组件 "))]),f("span",{class:"va-settings__toggle-desc",title:d.description},$(d.description),9,R8)]),f("button",{class:_e(["va-settings__switch",{"va-settings__switch--on":d.enabled}]),type:"button",role:"switch","aria-checked":d.enabled,"aria-label":`启用 ${d.name}`,onClick:_=>s("toggle",d)},[...u[15]||(u[15]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,S8)]))),128))])])):R("",!0)]))]))}}),T8={class:"va-settings__panel va-settings__panel--config"},M8={class:"va-settings__section"},F8={class:"va-settings__section-title"},I8={class:"va-console__modal-sub",style:{"margin-top":"2px"}},P8={key:0,class:"va-settings__tools-error"},B8={key:1,class:"va-settings__tools-loading"},L8={key:2,class:"va-settings__tools-loading"},O8={key:3,class:"va-settings__toggle-list"},z8={class:"va-settings__toggle-text"},j8={class:"va-settings__tool-headline"},N8={class:"va-settings__toggle-title"},U8=["title"],W8={class:"va-settings__toggle-desc"},V8={key:0,class:"va-settings__toggle-desc va-settings__config-lock-note"},q8=["aria-checked","aria-label","disabled","onClick"],H8=["value","min","max","disabled","aria-label","onInput","onChange"],K8=["value","maxlength","disabled","aria-label","onInput","onChange"],J8=["value","maxlength","disabled","aria-label","onInput","onChange"],Z8={key:4,class:"va-settings__config-footer"},Oo=we({__name:"ConfigPanel",props:{namespace:{},loading:{type:Boolean},loadError:{}},emits:["patch","reset"],setup(e,{emit:t}){const n=e,s=t;function o(h){return n.namespace?.values?.[h.key]??h.default}const a=Ft({});function i(h){return a[h.key]??String(o(h)??"")}function l(h,g){a[h.key]=g.target.value}const r=Ft({});$e(()=>n.namespace?.values,h=>{if(h){for(const[g,m]of Object.entries(a)){const b=String(h[g]??"");(b===m||b!==(r[g]??""))&&delete a[g]}for(const g of Object.keys(r))delete r[g];for(const[g,m]of Object.entries(h))r[g]=String(m??"")}},{deep:!0,immediate:!0}),$e(()=>n.namespace?.isDefault,h=>{if(h)for(const g of Object.keys(a))delete a[g]});function c(h,g){const m=g.target;if(m.value.trim()===""){delete a[h.key],m.value=String(o(h));return}const b=Number(m.value);if(!Number.isFinite(b)){delete a[h.key],m.value=String(o(h));return}let w=b;h.min!==void 0&&(w=Math.max(h.min,w)),h.max!==void 0&&(w=Math.min(h.max,w)),w!==b&&(Ae.add({title:"已按取值范围钳制",description:`${h.title} 允许范围 ${h.min??"-∞"} ~ ${h.max??"+∞"},已调整为 ${w}`,kind:"warning"}),m.value=String(w)),a[h.key]=String(w),w!==o(h)&&s("patch",h.key,w)}function u(h,g){const b=g.target.value;b!==o(h)?s("patch",h.key,b):delete a[h.key]}function d(h,g){const m=Array.isArray(g)?String(g[0]??""):String(g);m!==o(h)&&s("patch",h.key,m)}function _(h){h.locked||s("patch",h.key,!o(h))}return(h,g)=>(v(),y("div",T8,[f("div",M8,[f("div",null,[f("div",F8,$(e.namespace?.title??""),1),f("p",I8,$(e.namespace?.description??"")+";修改即时生效并由服务端持久化 ",1)]),e.loadError?(v(),y("p",P8,$(e.loadError),1)):e.loading?(v(),y("p",B8,"正在加载配置…")):e.namespace?(v(),y("div",O8,[(v(!0),y(J,null,ve(e.namespace.fields,m=>(v(),y("div",{key:m.key,class:"va-settings__toggle-row"},[f("div",z8,[f("div",j8,[f("span",N8,$(m.title),1),m.risk?(v(),y("span",{key:0,class:_e(["va-settings__tool-badge",p(is)(m.risk).className])},$(p(is)(m.risk).label),3)):R("",!0),m.locked?(v(),y("span",{key:1,class:"va-settings__config-lock",title:`由环境变量 ${m.envLock} 锁定`},[O(p(iA),{size:12}),g[1]||(g[1]=de(" env 锁定 ",-1))],8,U8)):R("",!0)]),f("span",W8,$(m.description),1),m.locked?(v(),y("span",V8," 由环境变量 "+$(m.envLock)+" 显式设置锁定(部署级),不可在此修改 ",1)):R("",!0)]),m.type==="boolean"?(v(),y("button",{key:0,class:_e(["va-settings__switch",{"va-settings__switch--on":o(m)===!0}]),type:"button",role:"switch","aria-checked":o(m)===!0,"aria-label":m.title,disabled:m.locked,onClick:b=>_(m)},[...g[2]||(g[2]=[f("span",{class:"va-settings__switch-knob"},null,-1)])],10,q8)):m.type==="number"?(v(),y("input",{key:1,class:"va-console__input va-settings__config-input",type:"number",value:i(m),min:m.min,max:m.max,disabled:m.locked,"aria-label":m.title,onInput:b=>l(m,b),onChange:b=>c(m,b)},null,40,H8)):m.type==="text"?(v(),y("textarea",{key:2,class:"va-console__input va-settings__config-textarea",value:i(m),maxlength:m.maxLength,disabled:m.locked,"aria-label":m.title,rows:"4",onInput:b=>l(m,b),onChange:b=>u(m,b)},null,40,K8)):m.type==="select"?(v(),le(p(sa),{key:3,size:"sm","model-value":String(o(m)??""),options:m.options??[],disabled:m.locked,label:m.title,"onUpdate:modelValue":b=>d(m,b)},null,8,["model-value","options","disabled","label","onUpdate:modelValue"])):(v(),y("input",{key:4,class:"va-console__input va-settings__config-input",type:"text",value:i(m),maxlength:m.maxLength,disabled:m.locked,"aria-label":m.title,onInput:b=>l(m,b),onChange:b=>u(m,b)},null,40,J8))]))),128))])):(v(),y("p",L8,"配置不可用")),e.namespace&&!e.namespace.isDefault?(v(),y("div",Z8,[f("button",{class:"va-console__btn-add-profile va-settings__config-reset",type:"button",onClick:g[0]||(g[0]=m=>s("reset"))},[O(p(cA),{size:13,style:{"vertical-align":"-2px","margin-right":"4px"}}),g[3]||(g[3]=de(" 恢复默认 ",-1))])])):R("",!0)])]))}});function G8(e){return e.autoCollapseThought===!0}function Hc(e){return e.autoCollapseThought===!0&&e.autoCollapseToolCards===!0}function X8(e,t){return e.autoCollapseToolCards?t.status==="error"?!1:t.turnStreaming:t.status==="streaming"}const Y8={class:"va-console__card-item"},Q8={key:9,class:"va-custom-card-fallback",style:{padding:"10px 14px",border:"1px dashed var(--va-color-border, #cbd5e1)","border-radius":"8px","font-size":"13px",margin:"4px 0"}},eS={style:{"font-weight":"600","margin-bottom":"4px",color:"var(--va-color-text-subtle, #64748b)"}},tS={style:{margin:"0","font-size":"11px","overflow-x":"auto","max-height":"160px",background:"var(--va-color-bg-subtle, #f8fafc)",padding:"8px","border-radius":"4px"}},nS=we({__name:"CardRenderer",props:{card:{},turnStreaming:{type:Boolean}},emits:["approve","deny"],setup(e){const t=e,n=E(()=>{const w=t.card.data?.status;return w==="error"?"error":w==="done"?"success":"running"}),s=E(()=>{const w=t.card.data?.status;return w==="streaming"?"生成调用参数中…":w==="executing"?"沙箱执行中…":w==="error"?"执行失败":"执行完成"}),{settings:o}=Ea(),a=E(()=>X8(o.value,{turnStreaming:t.turnStreaming,status:t.card.data?.status})),i=E(()=>{const w=t.card.data?.status;if(w==="approved"||w==="denied")return;const x=t.card.data?.expiresAt;return typeof x=="number"&&x>0?Math.max(1,Math.ceil((x-Date.now())/1e3)):t.card.data?.expiresInSec}),l=new Set(["ui_code_diff","ui_metric_chart","ui_file_tree","ui_trajectory","ui_task_board","ui_change_summary","ui_comment_thread","ui_ai_answer"]),r=E(()=>t.card.data?.props||{}),c=E(()=>String(t.card.data?.component||"")),u=E(()=>l.has(c.value)),d=E(()=>Ld(c.value)),_=P({}),h=E(()=>{const w=t.card.data?.formArgs?.fields;return Array.isArray(w)?w:[]}),g=P(!1),m=async(w,x)=>{if(!g.value){_.value={},g.value=!0;try{const k=await jc(t.card.data.actionId,{kind:"submit",values:w,meta:{editedFields:x}});k.ok?t.card.data.status="done":k.fieldErrors?_.value=k.fieldErrors:Ae.add({title:`表单提交失败(HTTP ${k.status})`,description:"请稍后重试;若持续失败请查看服务端日志",kind:"warning"})}catch(k){Ae.add({title:"表单提交网络异常",description:k instanceof Error?k.message:String(k),kind:"warning"})}finally{g.value=!1}}},b=async()=>{if(!g.value){_.value={},g.value=!0;try{const w=await jc(t.card.data.actionId,{kind:"cancel"});w.ok?t.card.data.status="done":Ae.add({title:`取消失败(HTTP ${w.status})`,description:"请稍后重试",kind:"warning"})}catch(w){Ae.add({title:"取消请求网络异常",description:w instanceof Error?w.message:String(w),kind:"warning"})}finally{g.value=!1}}};return(w,x)=>(v(),y("div",Y8,[e.card.type==="ui"?(v(),y(J,{key:0},[d.value?(v(),le(cl(d.value),Mp(cd({key:0},r.value)),null,16)):u.value&&c.value==="ui_code_diff"?(v(),le(p(Ur),{key:1,"file-name":r.value.fileName,"old-text":r.value.oldText,"new-text":r.value.newText,layout:r.value.layout||"unified","max-height":r.value.maxHeight},null,8,["file-name","old-text","new-text","layout","max-height"])):u.value&&c.value==="ui_metric_chart"?(v(),le(p(Mr),{key:2,title:r.value.title,series:r.value.series},null,8,["title","series"])):u.value&&c.value==="ui_file_tree"?(v(),le(p(ji),{key:3,title:r.value.title,tree:r.value.tree,"default-expand-depth":r.value.defaultExpandDepth},null,8,["title","tree","default-expand-depth"])):u.value&&c.value==="ui_trajectory"?(v(),le(p(Li),{key:4,events:r.value.events,"ledger-max-height":r.value.ledgerMaxHeight},null,8,["events","ledger-max-height"])):u.value&&c.value==="ui_task_board"?(v(),le(p(ZC),{key:5,columns:r.value.columns,tasks:r.value.tasks},null,8,["columns","tasks"])):u.value&&c.value==="ui_change_summary"?(v(),le(p(Hx),{key:6,title:r.value.title,files:r.value.files,duration:r.value.duration,"tool-calls":r.value.toolCalls,"finished-at":r.value.finishedAt},null,8,["title","files","duration","tool-calls","finished-at"])):u.value&&c.value==="ui_comment_thread"?(v(),le(p(jk),{key:7,comments:r.value.comments,"max-height":r.value.maxHeight,composer:!1},null,8,["comments","max-height"])):u.value&&c.value==="ui_ai_answer"?(v(),le(p(pC),{key:8,question:r.value.question,answer:r.value.answer,sources:r.value.sources},null,8,["question","answer","sources"])):(v(),y("div",Q8,[f("div",eS,"[场景组件: "+$(c.value)+"]",1),f("pre",tS,$(JSON.stringify(r.value,null,2)),1)]))],64)):e.card.type==="toolcall"?(v(),le(p(jm),{key:1,name:e.card.data.toolName,summary:s.value,status:n.value,args:e.card.data.args,result:e.card.data.result,error:e.card.data.error,"started-at":e.card.data.startedAt,duration:e.card.data.duration,"default-open":a.value,"open-on-error":!0},null,8,["name","summary","status","args","result","error","started-at","duration","default-open"])):R("",!0),e.card.type==="approval"?(v(),le(p(y_),{key:2,title:e.card.data.title||`申请执行: ${e.card.data.toolName||"工具"}`,risk:e.card.data.risk,preview:e.card.data.command,detail:e.card.data.detail,status:e.card.data.status||"pending",reason:e.card.data.reason,countdown:i.value,collapsible:!0,"default-collapsed":e.card.data.status==="approved"||e.card.data.status==="denied",onApprove:x[0]||(x[0]=k=>w.$emit("approve")),onDeny:x[1]||(x[1]=k=>w.$emit("deny",k))},null,8,["title","risk","preview","detail","status","reason","countdown","default-collapsed"])):e.card.type==="form"?(v(),le(p(FC),{key:3,title:e.card.data.formArgs?.title,description:e.card.data.formArgs?.description,fields:h.value,"submit-label":e.card.data.formArgs?.submitLabel,disabled:e.card.data.status!=="pending",loading:g.value,"field-errors":_.value,onSubmit:m,onCancel:b},Lv({_:2},[e.card.data.status==="timeout"?{name:"after-actions",fn:ye(()=>[x[2]||(x[2]=f("p",{class:"va-console__form-note"},"⏱ 表单已超时关闭(按用户放弃处理,可在对话中重新发起)",-1))]),key:"0"}:e.card.data.status==="done"?{name:"after-actions",fn:ye(()=>[x[3]||(x[3]=f("p",{class:"va-console__form-note"},"✅ 表单已提交,agent 正在继续执行",-1))]),key:"1"}:void 0]),1032,["title","description","fields","submit-label","disabled","loading","field-errors"])):e.card.type==="diff"?(v(),le(p(Ur),{key:4,"file-name":e.card.data.file,"old-text":e.card.data.oldCode,"new-text":e.card.data.newCode,layout:e.card.data.view||"unified"},null,8,["file-name","old-text","new-text","layout"])):e.card.type==="terminal"?(v(),le(p(Ck),{key:5,title:e.card.data.title,lines:e.card.data.lines},null,8,["title","lines"])):e.card.type==="metric"?(v(),le(p(Mr),{key:6,title:e.card.data.title,series:e.card.data.series},null,8,["title","series"])):e.card.type==="tree"?(v(),le(p(ji),{key:7,title:e.card.data.title,tree:e.card.data.tree,"default-expand-depth":e.card.data.defaultExpandDepth},null,8,["title","tree","default-expand-depth"])):e.card.type==="trajectory"?(v(),le(p(Li),{key:8,events:e.card.data.events,"ledger-max-height":e.card.data.ledgerMaxHeight},null,8,["events","ledger-max-height"])):R("",!0)]))}}),sS={class:"va-console__assistant-turn"},oS={class:"va-console__agent-avatar"},aS={class:"va-console__turn-body"},iS={key:0,class:"va-console__markdown-content"},lS={key:1,class:"va-console__action-cards"},rS={key:2,class:"va-console__streaming-indicator"},cS=["title"],uS=we({__name:"AssistantTurn",props:{turn:{}},emits:["approve","deny","regenerate","feedback"],setup(e){const t=e,n=E(()=>{switch(t.turn.abortedReason){case"user":return"手动停止";case"timeout":return"看门狗超时";case"preempt":return"被新请求顶替";case"process_restart":return"服务重启中断";case"token_budget":return"token 预算熔断";default:return""}}),{settings:s}=Ea(),o=P(!1),a=P(null),i=E(()=>!!t.turn.thought||(t.turn.cards||[]).some(u=>u.type==="toolcall")),l=E(()=>(t.turn.cards||[]).filter(u=>u.type==="toolcall").length);$e(()=>t.turn.isStreaming,(u,d)=>{d!==!0||u!==!1||(G8(s.value)&&(t.turn.thoughtExpanded=!1),Hc(s.value)&&i.value&&(a.value=Math.round((Date.now()-t.turn.timestamp)/100)/10,o.value=!0))}),it(()=>{!t.turn.isStreaming&&i.value&&Hc(s.value)&&(o.value=!0)});const r=E(()=>{const u={};for(const d of t.turn.cards||[])u[d.id]=d;return u}),c=E(()=>{const u=t.turn;if(u.blocks&&u.blocks.length)return u.blocks;const d=[];u.content&&d.push({kind:"text",content:u.content});for(const _ of u.cards||[])d.push({kind:"card",cardId:_.id});return d});return(u,d)=>(v(),y("div",sS,[f("div",oS,[O(p(Z4),{size:18})]),f("div",aS,[i.value||e.turn.isStreaming&&!e.turn.content?(v(),le(p(L4),{key:0,thought:e.turn.thought,expanded:e.turn.thoughtExpanded,duration:a.value??e.turn.thoughtDuration,streaming:e.turn.isStreaming&&!e.turn.content,"summary-mode":o.value,"tool-count":l.value,"onUpdate:expanded":d[0]||(d[0]=_=>e.turn.thoughtExpanded=_),"onUpdate:summaryMode":d[1]||(d[1]=_=>o.value=_)},null,8,["thought","expanded","duration","streaming","summary-mode","tool-count"])):R("",!0),(v(!0),y(J,null,ve(c.value,(_,h)=>(v(),y(J,{key:`${_.kind}-${h}`},[_.kind==="text"&&_.content?(v(),y("div",iS,[O(p(T4),{content:_.content,streaming:e.turn.isStreaming&&h===c.value.length-1},null,8,["content","streaming"])])):!o.value&&_.kind==="card"&&r.value[_.cardId]?(v(),y("div",lS,[O(nS,{card:r.value[_.cardId],"turn-streaming":e.turn.isStreaming,onApprove:g=>u.$emit("approve",r.value[_.cardId].data.actionId),onDeny:g=>u.$emit("deny",r.value[_.cardId].data.actionId,g)},null,8,["card","turn-streaming","onApprove","onDeny"])])):R("",!0)],64))),128)),!e.turn.isStreaming&&e.turn.content?(v(),le(p(ab),{key:1,text:e.turn.content,quiet:"",class:"va-console__message-actions",onRegenerate:d[2]||(d[2]=_=>u.$emit("regenerate",e.turn.id)),onFeedback:d[3]||(d[3]=(_,h)=>u.$emit("feedback",_,h))},null,8,["text"])):R("",!0),e.turn.isStreaming?(v(),y("div",rS,[...d[4]||(d[4]=[f("span",{class:"va-console__cursor-dot"},null,-1),f("span",null,"Agent 正在分析中…",-1)])])):R("",!0),e.turn.abortedReason?(v(),y("div",{key:3,class:"va-console__abort-badge",title:`中止成因:${n.value}`},[d[5]||(d[5]=de(" ⏹ 任务已中止",-1)),n.value?(v(),y(J,{key:0},[de("("+$(n.value)+")",1)],64)):R("",!0)],8,cS)):R("",!0)])]))}}),dS=["data-turn-id"],fS={class:"va-console__user-bubble-container"},pS={class:"va-console__user-bubble"},vS={key:0,class:"va-console__user-atts"},hS=["href","title"],mS=["src","alt"],_S=["title"],gS={class:"va-console__user-text"},yS={class:"va-console__user-avatar"},bS=["data-turn-id"],kS=we({__name:"TurnList",props:{turns:{}},emits:["approve","deny","regenerate","feedback"],setup(e){return(t,n)=>(v(!0),y(J,null,ve(e.turns,s=>(v(),y(J,{key:s.id},[s.role==="user"?(v(),y("div",{key:0,class:"va-console__turn-row","data-turn-id":s.id},[f("div",fS,[f("div",pS,[s.attachments?.length?(v(),y("div",vS,[(v(!0),y(J,null,ve(s.attachments,(o,a)=>(v(),y(J,{key:`${o.name}:${o.size}:${a}`},[o.kind==="image"&&o.dataUrl?(v(),y("a",{key:0,href:o.dataUrl,target:"_blank",rel:"noopener",class:"va-console__user-att-img-link",title:`${o.name}(点击新窗口查看原图)`},[f("img",{src:o.dataUrl,alt:o.name,class:"va-console__user-att-img"},null,8,mS)],8,hS)):(v(),y("span",{key:1,class:"va-console__user-att-chip",title:o.size?`${o.name} · ${o.size} B`:o.name},$(o.kind==="image"?`[图] ${o.name}`:`[附件] ${o.name}`),9,_S))],64))),128))])):R("",!0),f("p",gS,$(s.content),1)]),f("div",yS,[O(p(hA),{size:16})])])],8,dS)):(v(),y("div",{key:1,class:"va-console__turn-row","data-turn-id":s.id},[O(uS,{turn:s,onApprove:n[0]||(n[0]=o=>t.$emit("approve",o)),onDeny:n[1]||(n[1]=(o,a)=>t.$emit("deny",o,a)),onRegenerate:n[2]||(n[2]=o=>t.$emit("regenerate",o)),onFeedback:n[3]||(n[3]=(o,a)=>t.$emit("feedback",o,a))},null,8,["turn"])],8,bS))],64))),128))}}),wS=["aria-label"],xS={class:"va-console__seat-text"},CS={class:"va-console__effort-menu",role:"menu","aria-label":"推理档位"},$S=["data-active","onClick"],AS={key:1,class:"va-console__effort-gap","aria-hidden":"true"},Kc=we({__name:"ReasoningEffortMenu",props:{options:{},modelValue:{}},emits:["select"],setup(e,{emit:t}){const n=t;return(s,o)=>(v(),le(p(kn),{placement:"top-start",offset:8},{trigger:ye(()=>[f("button",{class:"va-console__seat-btn",type:"button","aria-label":`推理档位(当前 ${e.modelValue})`},[O(p(Ki),{size:12,"aria-hidden":"true"}),f("span",xS,"思考: "+$(e.modelValue),1),O(p(io),{size:11,"aria-hidden":"true"})],8,wS)]),default:ye(({close:a})=>[f("div",CS,[(v(!0),y(J,null,ve(e.options,i=>(v(),y("button",{key:i,class:"va-console__effort-item",type:"button",role:"menuitem","data-active":i===e.modelValue||void 0,onClick:l=>{n("select",i),a()}},[i===e.modelValue?(v(),le(p(ra),{key:0,size:13,"aria-hidden":"true"})):(v(),y("span",AS)),f("span",null,$(i),1)],8,$S))),128))])]),_:1}))}});function xf(e,t,n,s){return new Promise(o=>{const a=new FileReader;a.onload=()=>{if(s.has(e)){const i=/^data:([^;]+);base64,(.+)$/.exec(String(a.result??""));i&&n.set(e,{name:t.name,mediaType:i[1],data:i[2]}),s.delete(e)}o()},a.onerror=()=>{s.delete(e),o()},a.readAsDataURL(t)})}function DS(e){if(e.atts.length===0)return;const t={atts:[...e.atts],texts:new Map,images:new Map,files:new Map};for(const n of e.atts){const s=e.texts.get(n.id);s!==void 0&&(t.texts.set(n.id,s),e.texts.delete(n.id));const o=e.images.get(n.id);o&&(t.images.set(n.id,o),e.images.delete(n.id));const a=e.files.get(n.id);a&&(t.files.set(n.id,a),e.files.delete(n.id))}return t}function Jc(e){const t=e.atts.filter(s=>s.kind!=="image");if(t.length===0)return"";const n=[];for(const s of t){const o=e.texts.get(s.id);n.push(o?`---
33
+ [${s.name}]
34
+ ${o}
35
+ ---`:`[附件] ${s.name}(文件)`)}return n.join(`
36
+
37
+ `)+`
38
+
39
+ `}function RS(e){return e.atts.map(t=>{const n=t.size??0;if(t.kind!=="image")return{name:t.name,kind:"file",size:n};const s=e.images.get(t.id);return{name:t.name,kind:"image",size:n,...s?{dataUrl:`data:${s.mediaType};base64,${s.data}`}:{}}})}async function SS(e){const t=e.atts.filter(s=>s.kind==="image");if(t.length===0)return;await Promise.all(t.filter(s=>!e.images.has(s.id)&&e.files.has(s.id)).map(s=>xf(s.id,e.files.get(s.id),e.images,e.files)));const n=t.map(s=>e.images.get(s.id)).filter(s=>!!s);return n.length>0?n:void 0}function gi(e){for(const t of e.atts)t.previewUrl&&URL.revokeObjectURL(t.previewUrl),e.texts.delete(t.id),e.images.delete(t.id),e.files.delete(t.id)}function ES(e){function t(s,o,a,i){for(const l of s){if(!l.cards)continue;const r=l.cards.find(c=>c.data?.actionId===o||c.id===o||c.id===`approval-${o}`);r&&(r.data.status=a?"approved":"denied",r.data.reason=i)}}async function n(s,o,a){let i=!1;try{i=await u5(s,{approved:o,note:a})}catch(l){console.error("提交审批失败:",l);return}if(i){t(e.chatTurns.value,s,o,a);for(const[,l]of e.sessionTurnsCache.entries())t(l,s,o,a)}}return{submitApproval:n}}function TS(e){const t=P([]),n=P(!1),s=P("");async function o(){n.value=!0,s.value="";try{const h=await l5();if(h===null){s.value="工具清单加载失败,请检查服务端连接后重试";return}t.value=h}catch(h){console.error("拉取工具清单失败:",h),s.value="工具清单加载失败,请检查服务端连接后重试"}finally{n.value=!1}}async function a(h){const g=!h.enabled,m=h.enabled;h.enabled=g;try{const b=await r5(h.name,g);if(!b){h.enabled=m,Ae.add({title:"工具启停保存失败",description:`${h.name} 的状态未能持久化,已恢复原状态`,kind:"danger"});return}h.enabled=b.enabled,Ae.add({title:b.enabled?`已启用 ${h.name}`:`已停用 ${h.name}`,kind:"success"})}catch(b){h.enabled=m,console.error("工具启停提交失败:",b),Ae.add({title:"工具启停保存失败",description:b instanceof Error?b.message:String(b),kind:"danger"})}}const i=P([]),l=P(!1),r=P("");function c(h){return i.value.find(g=>g.id===h)??null}async function u(){l.value=!0,r.value="";try{const h=await bf();if(h===null){r.value="配置加载失败,请检查服务端连接后重试";return}i.value=h.namespaces;const g=c("security")?.values?.defaultPermissionMode;typeof g=="string"&&g&&(e.defaultPermission.value=g,e.isNewChat.value&&(e.activePermission.value=g))}catch(h){console.error("拉取配置中心失败:",h),r.value="配置加载失败,请检查服务端连接后重试"}finally{l.value=!1}}async function d(h,g,m){const b=c(h);if(!b)return;const w=b.values[g];b.values[g]=m;try{const x=await a5(h,{[g]:m});if(!x){b.values[g]=w,Ae.add({title:"配置保存失败",description:"服务端拒绝了本次修改(字段可能被 env 锁定),已恢复原值",kind:"danger"});return}b.values=x.values,b.isDefault=!1,h==="security"&&typeof x.values.defaultPermissionMode=="string"&&(e.defaultPermission.value=x.values.defaultPermissionMode)}catch(x){b.values[g]=w,console.error("配置提交失败:",x),Ae.add({title:"配置保存失败",description:x instanceof Error?x.message:String(x),kind:"danger"})}}async function _(h){const g=c(h);if(g)try{const m=await i5(h);if(!m){Ae.add({title:"恢复默认失败",description:"请检查服务端连接后重试",kind:"danger"});return}g.values=m.values,g.isDefault=!0,h==="security"&&typeof m.values.defaultPermissionMode=="string"&&(e.defaultPermission.value=m.values.defaultPermissionMode),Ae.add({title:`已恢复「${g.title}」默认配置`,kind:"success"})}catch(m){console.error("配置 reset 失败:",m),Ae.add({title:"恢复默认失败",description:m instanceof Error?m.message:String(m),kind:"danger"})}}return{tools:t,toolsLoading:n,toolsError:s,fetchTools:o,onToggleTool:a,configNamespaces:i,configLoading:l,configError:r,configNs:c,fetchConfig:u,onConfigPatch:d,onConfigReset:_}}function Cf(e){return e.cards=e.cards||[],e.cards}function MS(e,t){const n=Cf(e),s=n.find(o=>o.id===t.id);return s||(n.push(t),t)}function Zc(e,t){if(!t)return;e.blocks||(e.blocks=[]);const n=e.blocks[e.blocks.length-1];n&&n.kind==="text"?n.content+=t:e.blocks.push({kind:"text",content:t})}function Zi(e,t){e.blocks||(e.blocks=[]),!e.blocks.some(n=>n.kind==="card"&&n.cardId===t)&&e.blocks.push({kind:"card",cardId:t})}function Xt(e,t){const n=MS(e,t);return Zi(e,n.id),n}function FS(e,t,n,s){const o=t;if(!o||typeof o!="object"||!o.component)return;const a=o.props||{};switch(o.component){case"ui_code_diff":Xt(e,{id:`diff-${n}`,type:"diff",data:{file:a.fileName||"untitled.ts",oldCode:a.oldText||"",newCode:a.newText||"",view:a.layout||"unified"}});break;case"ui_metric_chart":Xt(e,{id:`metric-${n}`,type:"metric",data:{title:a.title||"指标图表",series:Array.isArray(a.series)?a.series:[]}});break;case"ui_agent_plan":Array.isArray(a.steps)&&s.setPlanSteps(a.steps);break;case"ui_file_tree":Xt(e,{id:`tree-${n}`,type:"tree",data:{title:a.title,tree:Array.isArray(a.tree)?a.tree:[],defaultExpandDepth:a.defaultExpandDepth}});break;case"ui_trajectory":Xt(e,{id:`traj-${n}`,type:"trajectory",data:{events:Array.isArray(a.events)?a.events:[],ledgerMaxHeight:a.ledgerMaxHeight}});break;case"ui_approval_card":break;default:Xt(e,{id:`ui-${n}`,type:"ui",data:{component:o.component,props:a}});break}}function IS(e,t){const n=t.seq;typeof n=="number"&&(e.lastSeq=n)}function Gc(e,t,n,s){switch(t.type){case"turn_start":e.isStreaming=!0;break;case"aborted":e.abortedReason=t.reason,e.isStreaming=!1;break;case"text_delta":e.content+=t.delta||"",Zc(e,t.delta||"");break;case"thought_delta":e.thought=(e.thought||"")+(t.delta||"");break;case"error":{const o=`
40
+
41
+ ⚠️ **执行提示**:${t.message||"请求执行遇到错误"}`;e.content+=(e.content?`
42
+
43
+ `:"")+o.trimStart(),Zc(e,o)}break;case"ui_agent_plan":t.steps&&Array.isArray(t.steps)&&n.isActiveSession&&s.setPlanSteps(t.steps);break;case"ui_code_diff":Xt(e,{id:`diff-${Date.now()}`,type:"diff",data:{file:t.file||"untitled.ts",additions:t.additions||0,deletions:t.deletions||0,oldCode:t.oldCode||"",newCode:t.newCode||"",view:"side-by-side"}});break;case"ui_terminal_log":Xt(e,{id:`term-${Date.now()}`,type:"terminal",data:{title:t.title||"沙箱命令执行",lines:t.lines||[{text:"$ npm run build",kind:"cmd"},{text:"Build finished successfully in 410ms.",kind:"stdout"}]}});break;case"ui_metric_chart":Xt(e,{id:`metric-${Date.now()}`,type:"metric",data:{title:t.title||"指标图表",series:Array.isArray(t.points)?t.points.map(o=>({label:o.time,value:o.value})):[]}});break;case"suspended":{const o=Cf(e);if(!o.some(a=>a.data?.actionId===t.actionId)){if(t.toolName==="ui_form"){const i={id:t.actionId,type:"form",data:{actionId:t.actionId,toolName:t.toolName,formArgs:t.args||{},status:"pending",timeoutMs:t.timeoutMs,expiresAt:Date.now()+(t.timeoutMs||0)}};o.push(i),Zi(e,i.id);break}const a={id:t.actionId,type:"approval",data:{actionId:t.actionId,risk:"high",title:t.toolName?`工具 [${t.toolName}] 申请权限`:"高风险操作介入确认",command:JSON.stringify(t.args||{},null,2),status:"pending",expiresInSec:Math.round((t.timeoutMs||6e4)/1e3),expiresAt:Date.now()+(t.timeoutMs||6e4)}};o.push(a),Zi(e,a.id)}break}case"resumed":{if(e.cards&&t.actionId){const o=e.cards.find(a=>a.data?.actionId===t.actionId||a.id===t.actionId||a.id===`approval-${t.actionId}`);if(o){if(o.type==="form"){const i=(t.payload||{}).reason;o.data.status=i==="timeout"?"timeout":"done";break}const a=t.payload||{};o.data.status=a.approved?"approved":"denied",o.data.reason=a.note||a.reason}}break}case"tool_call_start":Xt(e,{id:`call-${t.toolCallId}`,type:"toolcall",data:{toolName:t.toolName,status:"streaming",args:{},startedAt:Date.now()}});break;case"tool_call_args_delta":{const o=e.cards?.find(a=>a.id===`call-${t.toolCallId}`);o&&o.type==="toolcall"&&(o.data.args=t.partialArgs||{});break}case"tool_call_executing":{const o=e.cards?.find(a=>a.id===`call-${t.toolCallId}`);o&&o.type==="toolcall"&&(o.data.status="executing",o.data.args=t.args||{});break}case"tool_call_result":{const o=e.cards?.find(a=>a.id===`call-${t.toolCallId}`);if(o&&o.type==="toolcall"&&(o.data.status=t.status==="error"?"error":"done",o.data.result=t.data,o.data.error=t.error,o.data.duration=o.data.startedAt?Date.now()-o.data.startedAt:void 0),t.toolName==="bash_run"){Xt(e,{id:`term-${t.toolCallId}`,type:"terminal",data:{title:`终端执行: ${t.toolName}`,lines:[{text:`$ [状态: ${t.status}]`,kind:"cmd"},{text:typeof t.data=="string"?t.data:JSON.stringify(t.data||t.error||""),kind:t.status==="error"?"err":"stdout"}]}});break}FS(e,t.data,t.toolCallId,s);break}}}function PS(e){const t=Ft(new Map),n=new Map,s=new Map;function o(c){return!c||c===e()}function a(c,u){t.set(c,!0),n.set(c,u)}function i(c){t.set(c,!1),n.delete(c)}function l(c,u){s.set(c,u)}function r(c){return n.get(c)}return{sessionRunningMap:t,sessionAbortControllers:n,sessionTurnsCache:s,isActiveSession:o,markRunning:a,markStopped:i,cacheTurns:l,getAbortController:r}}function BS(e,t){return e.value.push(t),e.value[e.value.length-1]}function LS(e){const t=P(0),n=P(128e3),s=P(0),o=Ft(new Map),a=P([]);function i(r,c){t.value=r.promptTokens+r.completionTokens;const u=c||e();o.set(u,(o.get(u)??0)+r.promptTokens+r.completionTokens),(!c||c===e())&&(s.value+=r.promptTokens+r.completionTokens),r.contextWindow&&(n.value=r.contextWindow),a.value=r.parts?.length?r.parts:[{id:"history",label:"对话历史",tokens:t.value,kind:"history"}]}function l(){t.value=0,a.value=[],s.value=0}return{contextUsed:t,contextLimit:n,sessionTokensUsed:s,sessionTokensUsedMap:o,ctxParts:a,applyUsageEvent:i,reset:l}}function OS(){const e=P([]),t=P(!0),n=E(()=>e.value.length>0),s=E(()=>e.value.filter(l=>l.status==="done").length),o=E(()=>e.value.find(l=>l.status==="running"));function a(l){e.value=l,t.value=!0}function i(){e.value=[],t.value=!0}return{planSteps:e,isPlanExpanded:t,isPlanVisible:n,completedStepsCount:s,currentRunningStep:o,setPlanSteps:a,reset:i}}function zS(e){async function t(){const n=e.getActiveSessionId();if(n){await d5(n);const s=e.registry.getAbortController(n);e.registry.markStopped(n),s?.abort()}e.onStopped()}return{stopExecution:t}}function jS(e){const t=P([]),n=PS(e.getActiveSessionId),s=LS(e.getActiveSessionId),o=OS(),a=P(!1),i=P(null);function l(b){return n.isActiveSession(b)}const r=new WeakMap;function c(b){r.get(b)?.flush()}function u(b){r.delete(b)}function d(){t.value=[],o.reset(),s.reset()}function _(b,w,x){if(IS(w,b),b.type==="usage"){s.applyUsageEvent(b,x);return}if(b.type==="traj"){w.trajEvents||(w.trajEvents=[]),w.trajEvents.push(b.event);return}if(b.type==="text_delta"){let k=r.get(w);k||(k=QC({commit:C=>{Gc(w,{type:"text_delta",delta:C},{isActiveSession:l(x)},{setPlanSteps:o.setPlanSteps}),e.scrollToBottom()}}),r.set(w,k)),k.push(b.delta);return}c(w),Gc(w,b,{isActiveSession:l(x)},{setPlanSteps:o.setPlanSteps}),e.scrollToBottom()}async function h(b,w,x,k){const C=new AbortController;n.markRunning(b,C),e.getActiveSessionId()===b&&(a.value=!0,i.value=C);const D=Date.now();u(w);try{const{aborted:I}=await YC({open:()=>x?f5(k):p5(b),signal:C.signal,onEvent:L=>_(L,w,b),onDone:()=>{c(w),w.isStreaming=!1}});I&&(c(w),w.abortedReason??="user")}catch(I){c(w);const L=I?.message||String(I);w.content+=`
44
+
45
+ *(调用出错: ${L})*`}finally{c(w),u(w),w.isStreaming=!1,w.thoughtDuration=Math.round((Date.now()-D)/100)/10,n.markStopped(b),e.getActiveSessionId()===b&&(a.value=!1,i.value=null,e.scrollToBottom()),await e.refreshSessions()}}async function g(b,w){const x={id:`turn-user-${Date.now()}`,role:"user",content:b,...w.attachments?.length?{attachments:w.attachments}:{},timestamp:Date.now()};t.value.push(x);const k={id:`turn-asst-${Date.now()}`,role:"assistant",content:"",thought:"",thoughtExpanded:!0,thoughtDuration:0,isStreaming:!0,cards:[],blocks:[],trajEvents:[],timestamp:Date.now()};n.cacheTurns(w.sessionId,t.value);const C=BS(t,k);e.scrollToBottom({force:!0}),h(w.sessionId,C,!0,{sessionId:w.sessionId,workspaceId:w.workspaceId,prompt:b,modelProfileId:w.modelProfileId,permission:w.permission,reasoningEffort:w.reasoningEffort,images:w.images,attachments:w.attachments?.length?w.attachments.map(({name:D,kind:I,size:L})=>({name:D,kind:I,size:L})):void 0})}const{stopExecution:m}=zS({getActiveSessionId:e.getActiveSessionId,registry:n,onStopped:()=>{a.value=!1,i.value=null}});return{chatTurns:t,planSteps:o.planSteps,isPlanVisible:o.isPlanVisible,isPlanExpanded:o.isPlanExpanded,completedStepsCount:o.completedStepsCount,currentRunningStep:o.currentRunningStep,isRunning:a,activeAbortController:i,contextUsed:s.contextUsed,contextLimit:s.contextLimit,sessionTokensUsed:s.sessionTokensUsed,sessionTokensUsedMap:s.sessionTokensUsedMap,ctxParts:s.ctxParts,sessionTurnsCache:n.sessionTurnsCache,sessionRunningMap:n.sessionRunningMap,sessionAbortControllers:n.sessionAbortControllers,resetTurns:d,sendPrompt:g,connectToSessionStream:h,stopExecution:m}}const Xc=()=>({name:"",provider:"deepseek",baseUrl:"",apiKey:"",parameters:{temperature:.2}});function NS(e={}){const t=P([...Lo]),n=P("deepseek-v3"),s=P(""),o=P(!1),a=P([]),i=P([]),l=P(""),r=P(!1),c=P(Xc()),u=P(null),d=P(!1),_=P(!1),h=P(!1),g=P(null),m=P(!1),b=P([]),w=P(""),x=P([]),k=E(()=>t.value.find(S=>S.id===n.value)||t.value[0]),C=E(()=>i.value.find(S=>S.id===n.value)?.capabilities),D=E(()=>{const S=C.value?.inputModalities;return Array.isArray(S)&&S.includes("image")}),I=E(()=>C.value?.reasoning),L=E(()=>{const S=I.value;return S?.supported&&Array.isArray(S.supportedEfforts)&&S.supportedEfforts.length?S.supportedEfforts:[]}),K=Ft(new Map),X=E(()=>{const S=L.value;if(S.length===0)return"";const V=K.get(e.getSessionId?.()??"");if(V&&S.includes(V))return V;const te=I.value?.defaultEffort;return te&&S.includes(te)?te:S[0]});function oe(S){K.set(e.getSessionId?.()??"",S)}function Y(S,V){if(!V||S===V)return;const te=K.get(S);te!==void 0&&(K.has(V)||K.set(V,te),K.delete(S))}const N=E(()=>a.value.find(S=>S.id===l.value)),U=E(()=>N.value?.models||[]);async function ne(){try{const S=await YA();if(!S)return;a.value=S;const V=S.find(te=>te.id===l.value);V?c.value={...c.value,id:V.id,name:V.name,provider:V.provider,baseUrl:V.baseUrl||"",maskedApiKey:V.maskedApiKey}:S.length>0?H(S[0].id):l.value="",ae(S)}catch(S){console.error("加载供应商失败:",S)}}async function ie(){try{await ne()}catch(S){console.error("加载模型列表失败:",S)}}function ae(S){const V=new Map;for(const Ce of S)V.set(Ce.id,Ce);const te=[],me=[];for(const Ce of S){const Ke=Ce.name?.trim()||Ce.provider||"默认供应商",Qe=Ce.models??[];for(const Je of Qe)te.push(Je),me.push({id:Je.id,label:Je.name,meta:Je.model,provider:Ke,model:Je.model,contextWindow:Je.contextWindow||Je.capabilities?.contextWindow||128e3})}if(i.value=te,te.length===0){t.value=[...Lo],s.value="",Lo.some(Ce=>Ce.id===n.value)||(n.value=Lo[0]?.id??"");return}t.value=me;const Me=te.find(Ce=>Ce.isDefault)||te[0];s.value=Me.id,(!n.value||!te.some(Ce=>Ce.id===n.value))&&(n.value=Me.id)}function pe(){s.value&&(n.value=s.value)}async function ue(){e.closeMenus?.(),o.value=!0,g.value=null,u.value=null,d.value=!1,await ne(),a.value.length===0&&W()}function B(){o.value=!1,g.value=null,u.value=null,d.value=!1}function H(S){const V=a.value.find(te=>te.id===S);V&&(r.value=!1,l.value=S,u.value=null,d.value=!1,g.value=null,b.value=[],x.value=[],c.value={id:V.id,name:V.name,provider:V.provider,baseUrl:V.baseUrl||"",apiKey:"",maskedApiKey:V.maskedApiKey,parameters:{...V.parameters||{}}})}function W(){r.value=!0,l.value="",u.value=null,d.value=!1,g.value=null,b.value=[],x.value=[],c.value={...Xc(),name:"新供应商"}}function G(S){if(c.value.provider=S,!r.value)return;const V=qc[S];V&&(c.value.name=V.name,c.value.baseUrl=V.baseUrl)}async function xe(){const S=c.value;if(!S.name.trim()){Ae.add({title:"请填写供应商名称",kind:"warning"});return}const V={name:S.name.trim(),provider:S.provider,baseUrl:S.baseUrl?.trim()||void 0,apiKey:S.apiKey?.trim()||void 0,parameters:S.parameters};try{if(r.value){const te=await QA(V);te&&(await ne(),H(te.id),g.value={ok:!0,message:"供应商已创建,可在下方添加模型"})}else S.id&&await e5(S.id,V)&&(await ne(),H(S.id),g.value={ok:!0,message:"供应商已更新,其下所有模型立即生效"})}catch(te){g.value={ok:!1,message:`保存失败: ${te.message||String(te)}`}}}async function Be(S){const V=a.value.find(Ce=>Ce.id===S),te=V?.models?.length??0;if(!await gn({title:te>0?`删除「${V?.name}」及其 ${te} 个模型?`:"删除这个供应商?",description:te>0?"该供应商下的模型配置会一并移除,此操作不可撤销。":`「${V?.name||"未命名供应商"}」将被移除,此操作不可撤销。`,confirmText:te>0?"全部删除":"删除",tone:"danger",icon:!0}))return;const Me=await t5(S,te>0);Me?.success?(await ne(),a.value.length>0?H(a.value[0].id):W()):Ae.add({title:Me?.error||"删除失败",kind:"danger"})}function Ne(){const S=N.value;if(!S){Ae.add({title:"请先保存供应商",kind:"warning"});return}d.value=!0,b.value=[],x.value=[],g.value=null;const V=qc[S.provider];u.value={...fD,id:"",providerId:S.id,provider:S.provider,name:"",model:"",contextWindow:V?.contextWindow||128e3,capabilities:{source:"declared"},isDefault:!1},Ee({silent:!0})}function Re(S){d.value=!1,se.value=[],b.value=[],x.value=[],g.value=null,u.value={id:S.id,providerId:S.providerId,name:S.name,provider:S.provider,model:S.model,baseUrl:S.baseUrl||"",apiKey:"",maskedApiKey:S.maskedApiKey,contextWindow:S.contextWindow||S.capabilities?.contextWindow||128e3,capabilities:S.capabilities?{...S.capabilities}:{source:"declared"},temperature:S.temperature??.2,isDefault:!!S.isDefault},Ee({silent:!0})}function fe(){u.value=null,d.value=!1,se.value=[],b.value=[],x.value=[],g.value=null}async function lt(){const S=u.value;if(!S)return;if(!S.name.trim()||!S.model.trim()){Ae.add({title:"请填写模型名称与模型标识",kind:"warning"});return}const V={...S.capabilities||{},contextWindow:S.contextWindow||void 0,source:S.capabilities?.source||"declared"},te={name:S.name.trim(),model:S.model.trim(),contextWindow:S.contextWindow||void 0,capabilities:V,temperature:S.temperature,isDefault:S.isDefault};try{const me=d.value;(me?await n5(S.providerId||l.value,te):await GA(S.id,te))&&(await ne(),fe(),g.value={ok:!0,message:me?"模型已添加":"模型已更新"})}catch(me){g.value={ok:!1,message:`保存失败: ${me.message||String(me)}`}}}async function wt(S){const V=i.value.find(me=>me.id===S);if(await gn({title:"删除这个模型?",description:`「${V?.name||"未命名模型"}」将被移除,此操作不可撤销。`,confirmText:"删除",tone:"danger",icon:!0}))try{await XA(S)&&(u.value?.id===S&&fe(),await ne())}catch(me){console.error("删除模型失败:",me)}}async function Ee(S){const V=S?.silent===!0,te=N.value?.id;if(!te){V||Ae.add({title:"请先保存供应商,再拉取模型列表",kind:"warning"});return}if(!(V&&w.value===te&&b.value.length>0)){m.value=!0;try{const me=await o5(te);if(me?.ok&&me.models){b.value=me.models,x.value=me.items??[],w.value=te;const Me=x.value.filter(Ce=>Ce.capabilities).length;V||Ae.add({title:`已拉取 ${me.models.length} 个可用模型`,description:Me>0?`其中 ${Me} 个可自动填充能力信息`:"该供应商未提供能力信息,需手动填写",kind:"success"})}else V||Ae.add({title:`拉取失败:${me?.error||"端点无响应"}`,kind:"warning"})}catch(me){V||Ae.add({title:`拉取失败: ${me.message||String(me)}`,kind:"warning"})}finally{m.value=!1}}}function A(S){const V=u.value;if(!V)return;const te=S.capabilities,me={...V.capabilities||{},...te||{},source:te?"detected":V.capabilities?.source||"declared"};u.value={...V,model:S.id,name:S.displayName||S.id,contextWindow:te?.contextWindow||V.contextWindow,capabilities:me}}function F(S){const V=x.value.find(me=>me.id===S);if(V){A(V);return}const te=u.value;te&&(u.value={...te,model:S,name:S})}const Z=P(!1),se=P([]);async function Q(){const S=u.value;if(!S?.id||Z.value)return;const V=(S.capabilities?.inputModalities?.includes("image")?1:0)+(S.capabilities?.reasoning?.supported?1:0);if(V===0){Ae.add({title:"未勾选可探测能力",kind:"info"});return}if(await gn({title:`发起 ${V} 次最小探测请求?`,description:"将按勾选能力逐项实测端点行为(max_tokens=1 压成本),产生少量真实 API 费用。",confirmText:"开始验证",tone:"default",icon:!0})){Z.value=!0,se.value=[];try{const me=await s5(S.id);me&&(se.value=me.results??[],se.value.length===0&&Ae.add({title:me.note||"未勾选可探测能力",kind:"info"}))}catch(me){Ae.add({title:`验证失败: ${me instanceof Error?me.message:String(me)}`,kind:"danger"})}finally{Z.value=!1}}}const ee=P("");async function ce(S){if(!ee.value){ee.value=S.id;try{const V=await zc({profileId:S.id,model:S.model});V.ok?Ae.add({title:`「${S.name||S.model}」连通正常`,description:`首响应 ${V.latencyMs}ms · ${V.model}`,kind:"success"}):Ae.add({title:`「${S.name||S.model}」探测失败`,description:V.error||"端点无响应",kind:"warning"})}catch(V){Ae.add({title:"探测请求失败",description:V.message||String(V),kind:"warning"})}finally{ee.value=""}}}async function re(){if(!u.value?.model?.trim()){g.value={ok:!1,message:"请先选择或填写模型标识(点输入框右侧按钮可从供应商拉取列表)"};return}h.value=!0,g.value=null;try{const S=u.value,V=await zc({profileId:S?.id||void 0,providerId:S&&S.providerId||N.value?.id,model:S?.model?.trim()});g.value=V.ok?{ok:!0,message:`连通性正常:${V.model} @ ${V.endpoint}(首响应 ${V.latencyMs}ms)`}:{ok:!1,message:`探测失败(${V.latencyMs}ms):${V.error||"端点无响应"}`}}catch(S){g.value={ok:!1,message:`探测失败: ${S.message||String(S)}`}}finally{h.value=!1}}function M(S){const V=u.value;if(!V)return;const te=V.capabilities||{},me=new Set(te.inputModalities||["text"]);me.has(S)?me.delete(S):me.add(S),me.add("text"),u.value={...V,capabilities:{...te,inputModalities:[...me]}}}function j(){const S=u.value;if(!S)return;const V=S.capabilities||{},te=!V.reasoning?.supported;u.value={...S,capabilities:{...V,reasoning:te?{supported:!0,supportedEfforts:["low","medium","high"],defaultEffort:"medium"}:{supported:!1}}}}function he(){const S=u.value;if(!S)return;const V=S.capabilities||{},te=new Set(V.supportedParameters||["temperature"]);te.has("tools")?te.delete("tools"):te.add("tools"),u.value={...S,capabilities:{...V,supportedParameters:[...te]}}}return{availableModels:t,activeModel:n,activeModelObj:k,activeModelCapabilities:C,supportsImageInput:D,reasoningEffort:X,setReasoningEffort:oe,migrateSessionEffort:Y,reasoningEffortOptions:L,defaultModelId:s,resetModelToDefault:pe,isModelSettingsOpen:o,providers:a,modelProfiles:i,selectedProviderId:l,isCreatingProvider:r,currentProvider:N,currentProviderModels:U,providerForm:c,modelDraft:u,isCreatingModel:d,showApiKey:_,isTestingConnection:h,isDiscovering:m,testStatus:g,discoveredModels:b,discoveredItems:x,loadProviders:ne,fetchModelProfiles:ie,openModelSettings:ue,closeModelSettings:B,selectProvider:H,startCreateProvider:W,onProviderKindChange:G,saveProvider:xe,deleteProvider:Be,startCreateModel:Ne,editModel:Re,cancelModelEdit:fe,saveModel:lt,deleteModel:wt,isVerifyingCapabilities:Z,capabilityVerdicts:se,verifyCapabilities:Q,discoverModels:Ee,applyDetected:A,selectDiscoveredModel:F,discoveredForProvider:w,testProfileConnection:ce,testingProfileId:ee,testModelConnection:re,toggleModality:M,toggleReasoning:j,toggleToolUse:he}}function US(e,t){const n=[];let s=0;const o=t.filter(a=>typeof a.data?.contentOffset=="number").sort((a,i)=>a.data.contentOffset-i.data.contentOffset);for(const a of o){const i=Math.min(Math.max(a.data.contentOffset,0),e.length);i>s&&n.push({kind:"text",content:e.slice(s,i)}),n.push({kind:"card",cardId:a.id}),s=Math.max(s,i)}(e.length>s||n.length===0)&&n.push({kind:"text",content:e.slice(s)});for(const a of t)typeof a.data?.contentOffset!="number"&&n.push({kind:"card",cardId:a.id});return n}function WS(e){const{chat:t}=e,n=P([]),s=P(""),o=E(()=>n.value.filter(m=>!m.archived&&m.status!=="archived")),a=E(()=>n.value.filter(m=>m.archived||m.status==="archived")),i=P(!1);async function l(m){const b=m?.silent??n.value.length>0;b||(i.value=!0);try{const w=await qA();w&&(n.value=w)}catch(w){console.error("加载会话失败:",w)}finally{b||(i.value=!1)}}async function r(m){try{const b=await KA(m);return b&&(n.value.unshift(b),s.value=b.id),b}catch(b){return console.error("创建会话记录失败:",b),null}}async function c(m){s.value&&t.chatTurns.value.length>0&&t.sessionTurnsCache.set(s.value,[...t.chatTurns.value]),s.value=m.id,e.activeWorkspaceId.value=m.workspaceId,e.isNewChat.value=!1,e.activePermission.value=m.permission||"review",t.planSteps.value=[],t.contextUsed.value=0,t.sessionTokensUsed.value=t.sessionTokensUsedMap.get(m.id)??0;const b=!!t.sessionRunningMap.get(m.id);if(t.sessionTurnsCache.has(m.id)&&b){t.chatTurns.value=t.sessionTurnsCache.get(m.id),t.isRunning.value=!0,t.activeAbortController.value=t.sessionAbortControllers.get(m.id)||null,e.scrollToBottom({force:!0});return}try{const w=await HA(m.id);if(w){const x=[];if(w.turns&&w.turns.length>0){t.sessionTokensUsed.value=0;for(const k of w.turns){const C=k.telemetry?.totalTokens;if(typeof C=="number"&&C>0&&(t.sessionTokensUsed.value+=C),k.role)x.push({id:k.id||`turn-${Date.now()}`,role:k.role,content:k.content||"",thought:k.thought||"",thoughtExpanded:!1,thoughtDuration:k.thoughtDuration||0,cards:k.cards||[],timestamp:k.timestamp||Date.now()});else{const D=k.telemetry?.contextTokens;typeof D=="number"&&D>0&&(t.contextUsed.value=D),k.prompt&&x.push({id:`turn-user-${k.id}`,role:"user",content:k.prompt,...Array.isArray(k.attachments)&&k.attachments.length?{attachments:k.attachments}:{},timestamp:k.createdAt||Date.now()});let I=k.content;if(!I&&k.checkpoints&&k.checkpoints.length>0){const K=k.checkpoints[k.checkpoints.length-1];if(K&&Array.isArray(K.messagesSnapshot)){const X=[...K.messagesSnapshot].reverse().find(oe=>oe.role==="assistant"&&oe.content);X&&(I=X.content)}}I||(k.status==="error"?I="⚠️ *(此轮执行遇到错误或被中止)*":I=`*(本轮任务已执行完毕${k.telemetry?.durationMs?`,耗时 ${Math.round(k.telemetry.durationMs/100)/10}s`:""})*`);const L=(k.cards||[]).map(K=>K.type==="ui"&&K.data?.component==="ui_form"?{id:K.data.actionId||K.id,type:"form",data:{actionId:K.data.actionId,toolName:"ui_form",formArgs:K.data.props||{},status:K.data.status||"done"}}:K.type==="toolcall"&&(K.data?.status==="streaming"||K.data?.status==="executing")?{...K,data:{...K.data,status:"error",error:"执行被中止"}}:K);x.push({id:`turn-asst-${k.id}`,role:"assistant",content:I,thought:k.thought||"",thoughtExpanded:!1,thoughtDuration:k.telemetry?.durationMs?Math.round(k.telemetry.durationMs/100)/10:0,cards:L,blocks:US(I,L),abortedReason:k.abortedReason??(k.errorMessage==="process_restart"?"process_restart":void 0),trajEvents:k.telemetry?.events||[],timestamp:k.completedAt||k.createdAt||Date.now()}),k.plan?.steps&&(t.planSteps.value=k.plan.steps)}}}if(w.isRunning){t.sessionRunningMap.set(m.id,!0),t.isRunning.value=!0;const k=w.activeRun?.prompt||"正在后台执行的任务…";x.push({id:`turn-user-live-${Date.now()}`,role:"user",content:k,timestamp:w.activeRun?.startedAt||Date.now()});const C={id:`turn-asst-live-${Date.now()}`,role:"assistant",content:"",thought:"",thoughtExpanded:!0,thoughtDuration:0,isStreaming:!0,cards:[],blocks:[],timestamp:Date.now()};x.push(C),t.chatTurns.value=x,t.sessionTurnsCache.set(m.id,t.chatTurns.value);const D=t.chatTurns.value[t.chatTurns.value.length-1];t.connectToSessionStream(m.id,D,!1)}else t.sessionRunningMap.set(m.id,!1),t.isRunning.value=!1,x.length===0&&x.push({id:`turn-seed-${m.id}`,role:"assistant",content:`已加载会话「${m.title}」。工作区绑定至 \`${e.getWorkspaceRootPath()}\`。随时可以输入任务指令或向 Agent 提问。`,timestamp:m.updatedAt}),t.chatTurns.value=x,t.sessionTurnsCache.set(m.id,t.chatTurns.value)}}catch(w){console.error("加载会话详情失败:",w)}e.scrollToBottom({force:!0})}async function u(m,b){try{await Us(m,{archived:b,status:b?"archived":"active"});const w=n.value.find(x=>x.id===m);w&&(w.archived=b,w.status=b?"archived":"active")}catch(w){console.error("归档操作失败:",w)}}async function d(m){const b=n.value.find(x=>x.id===m);if(!b)return;const w=!b.pinned;try{await Us(m,{pinned:w}),b.pinned=w}catch(x){console.error("置顶操作失败:",x)}}async function _(m,b){const w=b.trim();if(w)try{if(await Us(m,{title:w})){const k=n.value.find(C=>C.id===m);k&&(k.title=w)}}catch(x){console.error("重命名会话失败:",x)}}async function h(m){const b=n.value.find(x=>x.id===m);await gn({title:"删除这个会话?",description:`「${b?.title||"未命名会话"}」的全部消息与工具调用记录将被清除,此操作不可撤销。`,confirmText:"删除",tone:"danger",icon:!0})&&await g(m)}async function g(m){try{await JA(m),n.value=n.value.filter(b=>b.id!==m),s.value===m&&e.onActiveDeleted()}catch(b){console.error("删除会话失败:",b)}}return{sessions:n,activeSessionId:s,activeSessions:o,archivedSessions:a,fetchSessions:l,sessionsLoading:i,createSessionForPrompt:r,selectSession:c,renameSession:_,toggleArchiveSession:u,togglePinSession:d,askDeleteSession:h,deleteSession:g}}function VS(e={}){const t=P([]),n=P(""),s=E(()=>t.value.find(d=>d.id===n.value)||t.value[0]||null);async function o(){try{const d=await NA();d&&(t.value=d,t.value.length>0&&!n.value&&(n.value=t.value[0].id))}catch(d){console.error("加载工作区失败:",d)}}function a(d){n.value=d,e.onWorkspaceActivated?.()}async function i(){e.closeMenus?.();try{const d=await VA();if(!d)throw new Error("系统选择框调用失败");if(d.cancelled)return;await o(),d.id&&a(d.id)}catch(d){console.warn("系统文件夹选择降级:",d);const _=await K5({title:"手动输入工作区路径",description:"系统文件夹选择框不可用,请输入本地项目文件夹的绝对路径。",placeholder:"/Users/username/project",confirmText:"创建"});if(_&&_.trim())try{const h=await UA({name:_.split("/").filter(Boolean).pop()||"workspace",rootPath:_.trim(),permission:"read-write"});h&&(await o(),a(h.id))}catch(h){Ae.add({title:"创建工作区失败",description:String(h),kind:"danger"})}}}function l(d){n.value=d,e.closeWorkspaceMenu?.()}async function r(d){const _=t.value.find(g=>g.id===d);await gn({title:"删除这个工作区?",description:`「${_?.name||"未命名工作区"}」及其下的全部会话将被删除,此操作不可撤销。`,confirmText:"删除",tone:"danger",icon:!0})&&await c(d)}async function c(d){try{await WA(d)&&(t.value=t.value.filter(h=>h.id!==d),n.value===d&&(n.value=t.value[0]?.id||""),await e.refreshSessions?.())}catch(_){console.error("删除工作区失败:",_)}}async function u(){if(!n.value){if(t.value.length>0)n.value=t.value[0].id;else if(await i(),!n.value)return!1}return!0}return{workspaces:t,activeWorkspaceId:n,currentWorkspace:s,fetchWorkspaces:o,pickAndCreateWorkspace:i,activateWorkspace:a,selectWorkspace:l,askDeleteWorkspace:r,deleteWorkspace:c,ensureActiveWorkspace:u}}const $f="vuagent:theme",qS=["light","dark","system"];function HS(){try{return typeof localStorage<"u"?localStorage:void 0}catch{return}}function KS(e){try{const t=e?.getItem($f);return qS.includes(t)?t:"system"}catch{return"system"}}function JS(e=HS()){const t=P(KS(e)),n=P("light"),s=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;function o(){const i=t.value==="dark"||t.value==="system"&&!!s?.matches;n.value=i?"dark":"light",typeof document<"u"&&(document.documentElement.dataset.theme=n.value,document.documentElement.style.colorScheme=n.value)}s&&s.addEventListener("change",()=>{t.value==="system"&&o()});function a(){try{e?.setItem($f,t.value)}catch{}}return gv(()=>{a(),o()}),{preference:t,resolved:n,setPreference(i){t.value=i,a(),o()}}}let yi=null;function ZS(){return yi||(yi=JS()),yi}const GS={"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function XS(e){return e+864e5}function YS(e={}){const t=P("24h"),n=P(null),s=E(()=>{const x=e.getSessionId?.()??"";return x?n.value?.bySession[x]??null:null}),o=P(null),a=P(null),i=P(null),l=P({windowTokenLimit:0,windowUsdLimit:0,windowMs:864e5}),r=P(!1),c=P(null),u=E(()=>o.value!=null&&a.value!=null),d=E(()=>Object.entries(i.value?.byModel??{}).map(([x,k])=>({label:x,value:k.tokens})).sort((x,k)=>k.value-x.value));async function _(){r.value=!0;try{i.value=u.value?await mi({since:o.value,until:XS(a.value)}):await mi({windowMs:GS[t.value]}),g(),h()}finally{r.value=!1}}async function h(){n.value=await v5().catch(()=>null)}async function g(){const x=l.value.windowTokenLimit>0||l.value.windowUsdLimit>0;c.value=x?await mi({windowMs:l.value.windowMs}):null}function m(x){t.value=x,o.value=null,a.value=null,_()}function b(x,k){o.value=x,a.value=k,_()}async function w(){l.value=await h5(),await g()}return{preset:t,customStart:o,customEnd:a,isCustom:u,summary:i,limits:l,quotaUsage:c,loading:r,byModelTokens:d,sessionCosts:n,currentSessionCost:s,refresh:_,setPreset:m,setCustomRange:b,refreshLimits:w}}const QS={class:"va-console"},eE={class:"va-console__main"},tE={class:"va-console__mention",role:"listbox","aria-label":"引用工作区文件"},nE={key:0,class:"va-console__mention-loading"},sE=["aria-selected","onMouseenter","onClick"],oE={class:"va-console__mention-path"},aE={key:2,class:"va-console__mention-empty"},iE={key:0,class:"va-console__welcome-view"},lE={class:"va-console__welcome-hero"},rE={class:"va-console__welcome-composer-box"},cE={class:"va-console__seat-btn",type:"button"},uE={class:"va-console__seat-text"},dE={class:"va-console__seat-text",title:"会话累计消耗(计费口径:Σ各步 prompt+completion,含压缩前所有轮次)"},fE={class:"va-console__ctx-panel"},pE={class:"va-console__suggestions"},vE={key:1,class:"va-console__chat-layout"},hE={class:"va-console__chat-view"},mE={class:"va-console__stream-wrap"},_E={class:"va-console__traj-view"},gE={key:1,class:"va-console__traj-empty"},yE={class:"va-console__bottom-composer"},bE={class:"va-console__seat-btn",type:"button"},kE={class:"va-console__seat-text"},wE={class:"va-console__seat-text",title:"会话累计消耗(计费口径:Σ各步 prompt+completion,含压缩前所有轮次)"},xE={class:"va-console__ctx-panel"},CE={key:0,class:"va-console__rsb-badge","aria-label":"待审批数"},Yc=48*1024,$E=5*1024*1024,Qc=4,AE=we({__name:"Console",setup(e){const t=P(!0),n=P("chat"),s=P(!0),o=P(""),a=P("review"),i=P(a.value),l=uD,{tools:r,toolsLoading:c,toolsError:u,fetchTools:d,onToggleTool:_,configLoading:h,configError:g,configNs:m,fetchConfig:b,onConfigPatch:w,onConfigReset:x}=TS({defaultPermission:a,activePermission:i,isNewChat:t}),k=Xe("chatScrollRef"),C=Xe("composerRef"),{isPinned:D,onScroll:I,scrollToBottom:L}=PC(k),K=VS({refreshSessions:()=>X.fetchSessions(),onWorkspaceActivated:()=>bs()});let X;const oe=NS({getSessionId:()=>X?.activeSessionId?.value??""}),Y=jS({getActiveSessionId:()=>X.activeSessionId.value,refreshSessions:()=>X.fetchSessions({silent:!0}),scrollToBottom:L});X=WS({chat:Y,isNewChat:t,activeWorkspaceId:K.activeWorkspaceId,activePermission:i,getWorkspaceRootPath:()=>K.currentWorkspace.value?.rootPath||"",scrollToBottom:L,onActiveDeleted:()=>bs()});const N=P([]);let U;function ne(z){const q=Object.entries(z).map(([ke,Ue])=>`${ke}: ${typeof Ue=="string"?Ue:JSON.stringify(Ue)}`).join(", ");return q.length>120?`${q.slice(0,120)}…`:q||"(无参数)"}async function ie(){try{const z=await c5();N.value=(z||[]).map((T,q)=>{if(T.toolName==="ui_form"){const ke=typeof T.args?.title=="string"?T.args.title:"";return{id:T.actionId,title:ke?`表单待填写:${ke}`:"表单待填写",detail:"请在对应会话中填写并提交表单(取消/超时按用户放弃处理)",collapsed:q!==0}}return{id:T.actionId,title:`${T.toolName} 请求执行`,detail:ne(T.args),primary:"批准执行",secondary:"驳回",collapsed:q!==0}})}catch(z){console.error("拉取待审批列表失败:",z)}}async function ae(z,T){await pe(z.id,T==="primary"),Ae.add({title:T==="primary"?"已批准执行":"已驳回操作",description:z.title,kind:T==="primary"?"success":"warning"}),await ie()}const{submitApproval:pe}=ES({chatTurns:Y.chatTurns,sessionTurnsCache:Y.sessionTurnsCache}),{workspaces:ue,activeWorkspaceId:B,activateWorkspace:H,fetchWorkspaces:W,pickAndCreateWorkspace:G,askDeleteWorkspace:xe,ensureActiveWorkspace:Be}=K,{availableModels:Ne,activeModel:Re,isModelSettingsOpen:fe,providers:lt,selectedProviderId:wt,isCreatingProvider:Ee,currentProvider:A,currentProviderModels:F,providerForm:Z,modelDraft:se,isCreatingModel:Q,showApiKey:ee,isTestingConnection:ce,isDiscovering:re,isVerifyingCapabilities:M,capabilityVerdicts:j,verifyCapabilities:he,testStatus:S,discoveredModels:V,discoveredItems:te,activeModelObj:me,supportsImageInput:Me,reasoningEffort:Ce,setReasoningEffort:Ke,migrateSessionEffort:Qe,reasoningEffortOptions:Je,fetchModelProfiles:$t,resetModelToDefault:Bt,openModelSettings:vo,closeModelSettings:ft,selectProvider:At,startCreateProvider:ho,onProviderKindChange:mo,saveProvider:Af,deleteProvider:Df,startCreateModel:Rf,editModel:Sf,cancelModelEdit:Ef,saveModel:Tf,deleteModel:Mf,discoverModels:Ff,selectDiscoveredModel:If,testModelConnection:Pf,testProfileConnection:Bf,testingProfileId:Lf,toggleModality:Of,toggleReasoning:zf,toggleToolUse:jf}=oe,Ta=P("models");function Nf(z="models"){Ta.value=z,vo()}const{sessions:Lt,sessionsLoading:Uf,activeSessionId:rn,fetchSessions:Wf,createSessionForPrompt:Vf,selectSession:Ma,renameSession:qf,toggleArchiveSession:Hf,togglePinSession:Kf,askDeleteSession:Jf}=X,Fa=YS({getSessionId:()=>X?.activeSessionId?.value??""}),Zf=ZS(),zn=P(!1);function xl(z){(z.metaKey||z.ctrlKey)&&(z.key==="k"||z.key==="K")&&(z.preventDefault(),zn.value=!zn.value)}const Gf=E(()=>{const z=[];z.push({id:"new-chat",label:"新建会话",group:"会话"});for(const q of Lt.value.filter(ke=>!ke.archived&&ke.status!=="archived").slice(0,8))z.push({id:`session:${q.id}`,label:`打开会话:${q.title}`,group:"会话",keywords:q.title});for(const q of ue.value)z.push({id:`ws:${q.id}`,label:`切换工作区:${q.name}`,group:"工作区",keywords:q.name});for(const q of l)z.push({id:`perm:${q.id}`,label:`权限档:${q.label}`,group:"权限",keywords:q.id});const T=[["light","亮色"],["dark","暗色"],["system","跟随系统"]];for(const[q,ke]of T)z.push({id:`theme:${q}`,label:`主题:${ke}`,group:"外观"});return z.push({id:"open-settings",label:"打开设置",group:"操作"}),z.push({id:"usage-panel",label:"展开右侧用量面板",group:"操作"}),z.push({id:"compact",label:"压缩当前会话上下文",group:"操作",disabled:t.value||cn.value}),z.push({id:"stop",label:"中止当前运行",group:"操作",danger:!0,disabled:!cn.value}),z});function Xf(z){const T=z.id;if(T==="new-chat")bs();else if(T.startsWith("session:")){const q=Lt.value.find(ke=>ke.id===T.slice(8));q&&Ma(q)}else T.startsWith("ws:")?bs(T.slice(3)):T.startsWith("perm:")?Ha(T.slice(5)):T.startsWith("theme:")?Zf.setPreference(T.slice(6)):T==="open-settings"?fe.value=!0:T==="usage-panel"?s.value=!1:T==="compact"?qa():T==="stop"&&Sl();zn.value=!1}const es=P([]),Ia=P(!1);function Cl(z){es.value.unshift(z),es.value.length>20&&(es.value.length=20)}const $l=new Set;$e(N,z=>{for(const T of z){const q=String(T.id);!q||$l.has(q)||($l.add(q),Cl({id:`approval-${q}`,title:"待审批决策",body:T.detail||T.title||"有操作等待你的批准",kind:"warning",createdAt:Date.now(),unread:!0}),Ia.value=!0)}},{deep:!0});const Al=new Map;$e(()=>[...Y.sessionRunningMap.entries()],z=>{for(const[T,q]of z){const ke=Al.get(T);if(Al.set(T,q),ke===!0&&q===!1&&T!==rn.value){const Ue=Lt.value.find(nt=>nt.id===T);Cl({id:`done-${T}`,title:"任务已结束",body:`会话「${Ue?.title??T}」运行完成,点击查看`,kind:"success",createdAt:Date.now(),unread:!0})}}});function Yf(z){if(z.unread=!1,z.id.startsWith("approval-"))s.value=!1;else if(z.id.startsWith("done-")){const T=Lt.value.find(q=>q.id===z.id.slice(5));T&&Ma(T)}}function Qf(z){const T=es.value.find(q=>q.id===z);T&&(T.unread=!1)}function ep(){for(const z of es.value)z.unread=!1}const{chatTurns:jn,planSteps:tp,isPlanVisible:np,isPlanExpanded:Pa,completedStepsCount:sp,currentRunningStep:op,isRunning:cn,sessionRunningMap:ap,contextUsed:_o,contextLimit:go,sessionTokensUsed:Dl,ctxParts:Ba,resetTurns:ip,sendPrompt:Rl,stopExecution:Sl}=Y,El=E(()=>Ne.value.map(z=>({id:z.id,label:z.label,meta:z.meta,provider:z.provider,model:z.model}))),Tl=E(()=>l.map(z=>({id:z.id,label:z.label,desc:z.desc}))),Ml=E(()=>Ba.value.length>0?Ba.value:[{id:"history",label:"对话历史",tokens:_o.value,kind:"history"}]),gs=P(!1),qt=P([]),La=new Map;function lp(z){const T={id:`q-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,text:z};return qt.value.push(T),Ae.add({title:"已加入队列",description:"当前会话运行中,结束后自动发送",kind:"info"}),T}function Oa(z){const T=La.get(z);return T&&La.delete(z),T}function rp(z){const[T]=qt.value.splice(z,1),q=T?Oa(T.id):void 0;q&&gi(q)}function cp(z){const[T]=qt.value.splice(z,1);if(T){if(!cn.value){ks(T.text,T.id);return}qt.value.unshift(T)}}function up(z,T){qt.value[z]&&(qt.value[z].text=T)}$e(cn,(z,T)=>{if(T===!0&&z===!1&&qt.value.length>0&&!t.value){const q=qt.value.shift();q&&setTimeout(()=>{ks(q.text,q.id)},400)}});const Ot=P(!1),za=P(""),ys=P([]),ja=P(!1),Nn=P(0),Na=new Set;let Fl="";const yo=E(()=>{const z=za.value.toLowerCase();return(z?ys.value.filter(q=>q.toLowerCase().includes(z)):ys.value).slice(0,50)}),dp=E(()=>Ot.value?fp():null);function fp(){for(const z of Array.from(document.querySelectorAll(".va-console__main .va-cmp")))if(z.offsetParent!==null)return z;return null}async function Il(z){if(!(!z||Fl===z)){ja.value=!0;try{const T=await yf(z),q=[],ke=Ue=>{for(const nt of Ue??[])nt.type==="dir"&&Array.isArray(nt.children)?ke(nt.children):q.push(nt.path)};ke(T?.tree??[]),ys.value=q,Fl=z}finally{ja.value=!1}}}$e(o,z=>{const T=/(?:^|\s)@([^\s@]*)$/.exec(z);T&&B.value?(za.value=T[1]??"",Ot.value||(Ot.value=!0,Nn.value=0,Il(B.value))):Ot.value&&(Ot.value=!1)});function Pl(z){o.value=o.value.replace(/(?:^|\s)@([^\s@]*)$/,T=>T.startsWith("@")?`@${z} `:` @${z} `),Na.add(z),Ot.value=!1,C.value?.focus()}function Bl(){const z=o.value;/@([^\s@]*)$/.test(z)?(za.value="",Ot.value=!0):o.value=z&&!z.endsWith(" ")&&!z.endsWith(`
46
+ `)?`${z} @`:`${z}@`,Il(B.value),Ge(()=>C.value?.focus())}function Ll(z){if(!Ot.value)return;const T=yo.value.length;if(z.key==="ArrowDown"||z.key==="ArrowUp"){z.preventDefault(),z.stopImmediatePropagation();const q=z.key==="ArrowDown"?1:-1;Nn.value=T>0?(Nn.value+q+T)%T:0}else if(z.key==="Enter"||z.key==="Tab"){const q=yo.value[Nn.value];q&&(z.preventDefault(),z.stopImmediatePropagation(),Pl(q))}else z.key==="Escape"&&(z.preventDefault(),z.stopImmediatePropagation(),Ot.value=!1)}const Dt=P([]),Ua=new Map,Wa=new Map,bo=new Map;function Va(){return{atts:Dt.value,texts:Ua,images:Wa,files:bo}}const pp=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function Ol(z){for(const T of z.slice(0,6)){const q=`att-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,ke=T.type.startsWith("image/");if(ke&&!Me.value){Ae.add({title:"当前模型未声明支持图片输入",description:"在「模型设置 → 能力标记」中勾选图片后即可上传",kind:"warning"});continue}if(ke){if(!pp.has(T.type)){Ae.add({title:`不支持的图片类型 ${T.type||"(未知)"}`,description:"支持 png / jpeg / webp / gif",kind:"warning"});continue}if(T.size>$E){Ae.add({title:`图片「${T.name}」超过 5MB 上限`,kind:"warning"});continue}if(Dt.value.filter(nt=>nt.kind==="image").length>=Qc){Ae.add({title:`单轮最多 ${Qc} 张图片`,kind:"warning"});continue}}if(Dt.value.push({id:q,name:T.name,size:T.size,kind:ke?"image":"file",previewUrl:ke?URL.createObjectURL(T):void 0}),ke){bo.set(q,T),xf(q,T,Wa,bo);continue}const Ue=new FileReader;Ue.onload=()=>{if(!Dt.value.some(wo=>wo.id===q))return;let nt=String(Ue.result??"");nt.length>Yc&&(nt=`${nt.slice(0,Yc)}
47
+ …(超出 48KB 已截断)`),Ua.set(q,nt)},Ue.readAsText(T)}}function vp(){gi(Va()),Dt.value=[]}function zl(z){const T=Dt.value.find(q=>q.id===z);T?.previewUrl&&URL.revokeObjectURL(T.previewUrl),Ua.delete(z),Wa.delete(z),bo.delete(z),Dt.value=Dt.value.filter(q=>q.id!==z)}async function qa(){if(gs.value)return;const z=rn.value;if(!z||t.value){Ae.add({title:"新会话暂无历史可压缩",kind:"info"});return}if(cn.value){Ae.add({title:"会话执行中,请等待本轮结束后再压缩",kind:"warning"});return}gs.value=!0;try{const T=await ZA(z);if(!T.compacted){Ae.add({title:"历史较少,暂无需压缩",description:`当前占用 ${gt(T.totalTokens)} tokens`,kind:"info"});return}_o.value=T.totalTokens,Ba.value=T.parts?.length?T.parts:[{id:"history",label:"对话历史",tokens:T.totalTokens,kind:"history"}],Ae.add({title:`已压缩,释放 ${gt(T.freed)} tokens`,description:`${T.compactedTurnCount} 轮早期历史已折叠为摘要`,kind:"success"})}catch(T){Ae.add({title:"压缩失败",description:T instanceof Error?T.message:String(T),kind:"danger"})}finally{gs.value=!1}}const hp=E(()=>ue.value.map(z=>({id:z.id,name:z.name,path:z.rootPath})));function mp(z){H(z)}const jl=E(()=>jn.value.flatMap(z=>z.trajEvents||[])),_p=E(()=>jn.value.flatMap((z,T)=>{if(z.role!=="user")return[];const q=jn.value[T+1],ke=(z.content||"").replace(/\s+/g," ").trim(),Ue=z.attachments?.length??0,nt=ke?ke.length>48?`${ke.slice(0,48)}…`:ke:Ue?`[附件 ×${Ue}]`:"(空消息)";return[{id:z.id,label:nt,role:"user",status:q?.role==="assistant"&&q.isStreaming?"streaming":void 0}]}));$e(()=>me.value?.contextWindow,z=>{z&&(Y.contextLimit.value=z)},{immediate:!0}),it(async()=>{Ae.state.toasts=[],window.addEventListener("keydown",xl),window.addEventListener("keydown",Ll,!0),await ie(),U=setInterval(()=>{ie()},1e4),await b(),await W(),await Wf(),await $t(),d(),Fa.refresh(),Fa.refreshLimits();const z=Lt.value.find(T=>T.isRunning);z&&await Nl(z)}),rl(()=>{window.removeEventListener("keydown",xl),window.removeEventListener("keydown",Ll,!0),U!==void 0&&clearInterval(U)});function gp(z,T){z!==null&&Ae.add({title:z==="up"?"感谢认可!":"已记录反馈",description:T,kind:"success"})}function yp(z){if(cn.value)return;const T=jn.value.findIndex(ke=>ke.id===z);if(T<0)return;let q="";for(let ke=T-1;ke>=0;ke--)if(jn.value[ke].role==="user"){q=jn.value[ke].content;break}!q||!rn.value||Rl(q,{sessionId:rn.value,workspaceId:B.value,modelProfileId:Re.value,permission:i.value,reasoningEffort:Ce.value||void 0})}function bs(z){z&&(B.value=z),rn.value="",t.value=!0,n.value="chat",i.value=a.value,Bt(),ip(),o.value="",Ge(()=>C.value?.focus())}async function Nl(z){n.value="chat",await Ma(z);const T=z.activeModelProfileId;T&&Ne.value.some(q=>q.id===T)&&(Re.value=T)}async function Ha(z){i.value=z;const T=rn.value;if(!(!T||t.value))try{const q=await Us(T,{permission:z});if(q){const ke=Lt.value.findIndex(Ue=>Ue.id===T);ke>=0&&(Lt.value[ke]=q)}}catch(q){console.error("持久化权限模式失败:",q)}}async function Ul(z){Re.value=z;const T=rn.value;if(!(!T||t.value))try{const q=await Us(T,{activeModelProfileId:z});if(q){const ke=Lt.value.findIndex(Ue=>Ue.id===T);ke>=0&&(Lt.value[ke]=q)}}catch(q){console.error("持久化模型档失败:",q)}}async function ks(z,T){if(cn.value){const st=(z??o.value).trim();if(!st)return;const Wl=T?Oa(T):z?void 0:DS(Va()),wp=lp(st);Wl&&(La.set(wp.id,Wl),!T&&!z&&(Dt.value=[]));return}let q=(z??o.value).trim();const ke=[...Na].filter(st=>q.includes(`@${st}`));if(ke.length>0){q+=ke.map(st=>`
48
+
49
+ [@引用文件] ${st}`).join("");for(const st of ke)Na.delete(st)}const Ue=T?Oa(T):void 0,nt=Ue??Va(),wo=!!z&&!Ue,bp=wo?void 0:await SS(nt),kp=wo?void 0:RS(nt);if(!z&&Dt.value.length>0){const st=Jc(nt);q=q?`${st}${q}`:st.trim(),vp()}else if(Ue){const st=Jc(Ue);st&&(q=q?`${st}${q}`:st.trim()),gi(Ue)}if(!q||!await Be())return;let Ka=rn.value;if(t.value||!Ka){const st=await Vf({workspaceId:B.value,title:q.slice(0,24),activeModelProfileId:Re.value,permission:i.value});st&&(Ka=st.id,t.value=!1,Qe("",st.id))}o.value="",n.value="chat",await Rl(q,{sessionId:Ka,workspaceId:B.value,modelProfileId:Re.value,permission:i.value,reasoningEffort:Ce.value||void 0,images:bp,attachments:kp})}function ko(z){o.value=z,ks()}return(z,T)=>(v(),y("div",QS,[O(wA,{workspaces:p(ue),sessions:p(Lt),loading:p(Uf)&&p(Lt).length===0,"active-workspace-id":p(B),"active-session-id":p(rn),"is-new-chat":t.value,"session-running-map":p(ap),onStartNewChat:bs,onSelectSession:Nl,onPickWorkspace:p(G),onDeleteWorkspace:p(xe),onRenameSession:p(qf),onToggleArchive:p(Hf),onTogglePin:p(Kf),onDeleteSession:p(Jf),onOpenSettings:Nf,notifications:es.value,"notif-open":Ia.value,"onUpdate:notifOpen":T[0]||(T[0]=q=>Ia.value=q),onOpenNotification:Yf,onReadNotification:Qf,onAllRead:ep},null,8,["workspaces","sessions","loading","active-workspace-id","active-session-id","is-new-chat","session-running-map","onPickWorkspace","onDeleteWorkspace","onRenameSession","onToggleArchive","onTogglePin","onDeleteSession","notifications","notif-open"]),f("main",eE,[O(p(kn),{open:Ot.value,"onUpdate:open":T[1]||(T[1]=q=>Ot.value=q),anchor:dp.value,placement:"top-start",offset:6,"close-on-outside-click":!0,"close-on-escape":!1},{default:ye(()=>[f("div",tE,[ja.value?(v(),y("div",nE,[(v(),y(J,null,ve(3,q=>O(p(_n),{key:q,height:22,radius:"6px",width:q===2?"84%":"100%"},null,8,["width"])),64))])):yo.value.length>0?(v(!0),y(J,{key:1},ve(yo.value,(q,ke)=>(v(),y("button",{key:q,class:_e(["va-console__mention-item",{"va-console__mention-item--active":ke===Nn.value}]),type:"button",role:"option","aria-selected":ke===Nn.value,onMouseenter:Ue=>Nn.value=ke,onClick:Ue=>Pl(q)},[f("span",oE,$(q),1)],42,sE))),128)):(v(),y("p",aE," 无匹配文件(输入 @路径关键词 过滤工作区文件) "))])]),_:1},8,["open","anchor"]),O(p(u2),{open:zn.value,"onUpdate:open":T[2]||(T[2]=q=>zn.value=q),commands:Gf.value,"trigger-label":"命令",hotkey:"⌘K","hide-trigger":"",onSelect:Xf},null,8,["open","commands"]),t.value?(v(),y("section",iE,[f("div",lE,[O(p(T0),{workspaces:hp.value,title:"准备好开启新任务了吗?",description:"面向工程任务的自主 Agent 工作台:支持代码修改、工具执行与丰富场景卡片",onCreateSession:mp,onCreateWorkspace:p(G)},null,8,["workspaces","onCreateWorkspace"]),f("div",rE,[O(p(jr),{ref_key:"composerRef",ref:C,text:o.value,"onUpdate:text":T[6]||(T[6]=q=>o.value=q),placeholder:"给 Agent 一个任务(如:重构认证模块并编写单元测试)…",disabled:p(cn),"max-height":180,models:El.value,model:p(Re),permissions:Tl.value,permission:i.value,attachable:"",attachments:Dt.value,"mention-paths":ys.value,onSend:T[7]||(T[7]=()=>ks()),"onUpdate:model":Ul,"onUpdate:permission":Ha,onFilesSelected:Ol,onRemoveAttachment:zl},{actions:ye(()=>[O(p(kn),{placement:"top-start",offset:8},{trigger:ye(()=>[f("button",cE,[O(p(Tc),{size:12}),f("span",uE,"Context: "+$(p(gt)(p(_o)))+" / "+$(p(gt)(p(go))),1),f("span",dE,"· Session: "+$(p(gt)(p(Dl))),1),O(p(io),{size:11})])]),default:ye(()=>[f("div",fE,[O(p(Fr),{parts:Ml.value,capacity:p(go),removable:!1,compacting:gs.value,onCompact:qa},null,8,["parts","capacity","compacting"])])]),_:1}),p(Je).length?(v(),le(Kc,{key:0,options:p(Je),"model-value":p(Ce),onSelect:p(Ke)},null,8,["options","model-value","onSelect"])):R("",!0)]),trailing:ye(()=>[O(Oc,{"workspace-id":p(B),onRefFile:Bl,onClear:T[3]||(T[3]=q=>o.value=""),onInsert:T[4]||(T[4]=q=>o.value+=q),onOpenCommandMenu:T[5]||(T[5]=q=>zn.value=!0)},null,8,["workspace-id"])]),_:1},8,["text","disabled","models","model","permissions","permission","attachments","mention-paths"]),f("div",pE,[T[35]||(T[35]=f("span",{class:"va-console__sug-label"},"试着运行:",-1)),f("button",{class:"va-console__chip",type:"button",onClick:T[8]||(T[8]=q=>ko("重构 auth 认证模块,抽取 JWT 校验并编写单元测试"))}," 重构认证模块并补全测试 "),f("button",{class:"va-console__chip",type:"button",onClick:T[9]||(T[9]=q=>ko("分析项目中所有涉及文件修改的代码,做一次安全合规检查"))}," 代码安全与依赖审计 "),f("button",{class:"va-console__chip",type:"button",onClick:T[10]||(T[10]=q=>ko("创建端到端自动化测试脚本并生成报告"))}," 生成自动化测试用例 "),f("button",{class:"va-console__chip",type:"button",onClick:T[11]||(T[11]=q=>ko("请分析当前项目的架构设计、核心模块划分与潜在代码风险"))}," 分析项目架构与潜在风险 ")])])])])):(v(),y("div",vE,[f("section",hE,[O(p(Dd),{modelValue:n.value,"onUpdate:modelValue":T[12]||(T[12]=q=>n.value=q),options:[{value:"chat",label:"对话"},{value:"traj",label:"轨迹"}],"aria-label":"主区视图"},null,8,["modelValue"]),ze(f("div",mE,[f("div",{ref_key:"chatScrollRef",ref:k,class:"va-console__messages-stream",onScrollPassive:T[15]||(T[15]=(...q)=>p(I)&&p(I)(...q))},[O(kS,{turns:p(jn),onApprove:T[13]||(T[13]=q=>p(pe)(q,!0)),onDeny:T[14]||(T[14]=(q,ke)=>p(pe)(q,!1,ke)),onRegenerate:yp,onFeedback:gp},null,8,["turns"])],544),O(p(V4),{items:_p.value,container:k.value,class:"va-console__turn-rail"},null,8,["items","container"]),p(D)?R("",!0):(v(),y("button",{key:0,class:"va-console__scroll-bottom",type:"button",onClick:T[16]||(T[16]=q=>p(L)({force:!0}))},[O(p(K4),{size:13}),T[36]||(T[36]=f("span",null,"回到底部",-1))]))],512),[[Fi,n.value==="chat"]]),ze(f("div",_E,[jl.value.length>0?(v(),le(p(Li),{key:0,events:jl.value,"ledger-max-height":void 0,bordered:!1,"split-detail":""},null,8,["events"])):(v(),y("div",gE,[O(p(uA),{size:20}),T[37]||(T[37]=f("p",null,"本轮会话还没有轨迹",-1)),T[38]||(T[38]=f("small",null,"发送任务后,执行步骤将实时显示在这里",-1))]))],512),[[Fi,n.value==="traj"]]),p(np)?(v(),le(U5,{key:0,steps:p(tp),completed:p(sp),running:p(op),expanded:p(Pa),onToggle:T[17]||(T[17]=q=>Pa.value=!p(Pa))},null,8,["steps","completed","running","expanded"])):R("",!0),f("div",yE,[qt.value.length>0?(v(),le(p(n1),{key:0,class:"va-console__queuedock",items:qt.value,onRemove:rp,onSendNow:cp,onEdit:up},null,8,["items"])):R("",!0),O(p(jr),{ref_key:"composerRef",ref:C,text:o.value,"onUpdate:text":T[21]||(T[21]=q=>o.value=q),placeholder:"继续指令或追问…",busy:p(cn),models:El.value,model:p(Re),permissions:Tl.value,permission:i.value,attachable:"",attachments:Dt.value,"mention-paths":ys.value,onSend:T[22]||(T[22]=()=>ks()),onStop:p(Sl),"onUpdate:model":Ul,"onUpdate:permission":Ha,onFilesSelected:Ol,onRemoveAttachment:zl},{actions:ye(()=>[O(p(kn),{placement:"top-start",offset:8},{trigger:ye(()=>[f("button",bE,[O(p(Tc),{size:12}),f("span",kE,"Context: "+$(p(gt)(p(_o)))+" / "+$(p(gt)(p(go))),1),f("span",wE,"· Session: "+$(p(gt)(p(Dl))),1),O(p(io),{size:11})])]),default:ye(()=>[f("div",xE,[O(p(Fr),{parts:Ml.value,capacity:p(go),removable:!1,compacting:gs.value,onCompact:qa},null,8,["parts","capacity","compacting"])])]),_:1}),p(Je).length?(v(),le(Kc,{key:0,options:p(Je),"model-value":p(Ce),onSelect:p(Ke)},null,8,["options","model-value","onSelect"])):R("",!0)]),trailing:ye(()=>[O(Oc,{"workspace-id":p(B),onRefFile:Bl,onClear:T[18]||(T[18]=q=>o.value=""),onInsert:T[19]||(T[19]=q=>o.value+=q),onOpenCommandMenu:T[20]||(T[20]=q=>zn.value=!0)},null,8,["workspace-id"])]),_:1},8,["text","busy","models","model","permissions","permission","attachments","mention-paths","onStop"])])]),s.value?(v(),le(p(Fd),{key:1,content:"展开侧栏",placement:"left"},{default:ye(()=>[f("button",{class:"va-console__rsb-reopen",type:"button","aria-label":"展开侧栏",onClick:T[24]||(T[24]=q=>s.value=!1)},[O(p(Wo),{size:15}),N.value.length>0?(v(),y("span",CE,$(N.value.length),1)):R("",!0)])]),_:1})):(v(),le(F5,{key:0,decisions:N.value,"workspace-id":p(B),usage:p(Fa),onDecide:ae,onCollapse:T[23]||(T[23]=q=>s.value=!0)},null,8,["decisions","workspace-id","usage"]))]))]),O(iD,{open:p(fe),"active-tab":Ta.value,"onUpdate:activeTab":T[34]||(T[34]=q=>Ta.value=q),onClose:p(ft)},{models:ye(()=>[O(NR,{providers:p(lt),"selected-provider-id":p(wt),"is-creating-provider":p(Ee),"current-provider":p(A),"current-provider-models":p(F),"provider-form":p(Z),"model-draft":p(se),"is-creating-model":p(Q),"show-api-key":p(ee),"is-testing-connection":p(ce),"testing-profile-id":p(Lf),onTestModel:p(Bf),"is-discovering":p(re),"test-status":p(S),"discovered-models":p(V),"discovered-items":p(te),"is-verifying-capabilities":p(M),"capability-verdicts":p(j),onClose:p(ft),onSelectProvider:p(At),onCreateProvider:p(ho),onDeleteProvider:p(Df),onCreateModel:p(Rf),onEditModel:p(Sf),onDeleteModel:p(Mf),onCancelModelEdit:p(Ef),onSaveProvider:p(Af),onSaveModel:p(Tf),onTest:p(Pf),onDiscover:p(Ff),onSelectModel:p(If),onProviderKindChange:p(mo),"onUpdate:showApiKey":T[25]||(T[25]=q=>ee.value=q),onToggleModality:p(Of),onToggleReasoning:p(zf),onToggleToolUse:p(jf),onVerifyCapabilities:p(he)},null,8,["providers","selected-provider-id","is-creating-provider","current-provider","current-provider-models","provider-form","model-draft","is-creating-model","show-api-key","is-testing-connection","testing-profile-id","onTestModel","is-discovering","test-status","discovered-models","discovered-items","is-verifying-capabilities","capability-verdicts","onClose","onSelectProvider","onCreateProvider","onDeleteProvider","onCreateModel","onEditModel","onDeleteModel","onCancelModelEdit","onSaveProvider","onSaveModel","onTest","onDiscover","onSelectModel","onProviderKindChange","onToggleModality","onToggleReasoning","onToggleToolUse","onVerifyCapabilities"])]),interaction:ye(()=>[O(ZR)]),tools:ye(()=>[O(E8,{tools:p(r),loading:p(c),"load-error":p(u),onToggle:p(_)},null,8,["tools","loading","load-error","onToggle"])]),execution:ye(()=>[O(Oo,{namespace:p(m)("execution"),loading:p(h),"load-error":p(g),onPatch:T[26]||(T[26]=(q,ke)=>p(w)("execution",q,ke)),onReset:T[27]||(T[27]=q=>p(x)("execution"))},null,8,["namespace","loading","load-error"]),O(Oo,{namespace:p(m)("finops"),loading:p(h),"load-error":p(g),onPatch:T[28]||(T[28]=(q,ke)=>p(w)("finops",q,ke)),onReset:T[29]||(T[29]=q=>p(x)("finops"))},null,8,["namespace","loading","load-error"])]),security:ye(()=>[O(Oo,{namespace:p(m)("security"),loading:p(h),"load-error":p(g),onPatch:T[30]||(T[30]=(q,ke)=>p(w)("security",q,ke)),onReset:T[31]||(T[31]=q=>p(x)("security"))},null,8,["namespace","loading","load-error"])]),prompt:ye(()=>[O(Oo,{namespace:p(m)("prompt"),loading:p(h),"load-error":p(g),onPatch:T[32]||(T[32]=(q,ke)=>p(w)("prompt",q,ke)),onReset:T[33]||(T[33]=q=>p(x)("prompt"))},null,8,["namespace","loading","load-error"])]),_:1},8,["open","active-tab","onClose"]),O(p(kb)),O(p(Qw)),O(Z5)]))}}),DE={class:"va-deploy-card"},RE={class:"va-deploy-card__header"},SE={class:"va-deploy-card__title-row"},EE={class:"va-deploy-card__icon-wrap"},TE={class:"va-deploy-card__name-block"},ME={class:"va-deploy-card__name"},FE={class:"va-deploy-card__version"},IE={class:"va-deploy-card__status-row"},PE={class:"va-deploy-card__metrics"},BE={class:"va-deploy-card__metric-item"},LE={class:"va-deploy-card__metric-val"},OE={class:"va-deploy-card__metric-item"},zE={class:"va-deploy-card__metric-val"},jE={class:"va-deploy-card__metric-item"},NE={class:"va-deploy-card__metric-val"},UE={key:0,class:"va-deploy-card__section"},WE={class:"va-deploy-card__endpoints"},VE=["title"],qE=["title","onClick"],HE={key:1,class:"va-deploy-card__commit"},KE={class:"va-deploy-card__commit-hash"},JE={class:"va-deploy-card__commit-msg"},ZE={key:0,class:"va-deploy-card__commit-author"},GE={class:"va-deploy-card__footer"},XE=["disabled"],YE=we({__name:"DeployStatusCard",props:{serviceName:{},environment:{},version:{},status:{},endpoints:{default:()=>[]},metrics:{default:()=>({cpu:"12%",memory:"256 MB",replicas:"2/2 Ready"})},commit:{}},setup(e){const t=e,n=P(null),s=P(!1),o=E(()=>{switch(t.status){case"healthy":return{label:"健康运行",color:"#16a34a",bg:"#f0fdf4",border:"#bbf7d0",pulse:!0};case"deploying":return{label:"部署更新中",color:"#2563eb",bg:"#eff6ff",border:"#bfdbfe",spin:!0};case"degraded":return{label:"性能降级",color:"#d97706",bg:"#fffbeb",border:"#fde68a"};case"failed":return{label:"服务异常",color:"#dc2626",bg:"#fef2f2",border:"#fecaca"};default:return{label:t.status,color:"#64748b",bg:"#f8fafc",border:"#e2e8f0"}}}),a=E(()=>{switch(t.environment){case"production":return{label:"PROD 生产",bg:"#fee2e2",color:"#991b1b"};case"staging":return{label:"STAGE 预发",bg:"#e0e7ff",color:"#3730a3"};case"preview":return{label:"PREVIEW 预览",bg:"#f3e8ff",color:"#6b21a8"};default:return{label:t.environment.toUpperCase(),bg:"#f1f5f9",color:"#334155"}}});async function i(r){try{await navigator.clipboard.writeText(r),n.value=r,setTimeout(()=>{n.value===r&&(n.value=null)},2e3)}catch{}}function l(){s.value=!0,setTimeout(()=>{s.value=!1},800)}return(r,c)=>(v(),y("div",DE,[f("div",RE,[f("div",SE,[f("div",EE,[O(p(dA),{size:16})]),f("div",TE,[f("span",ME,$(e.serviceName),1),f("span",FE,$(e.version),1)]),c[0]||(c[0]=f("span",{class:"va-deploy-card__badge-scene"},"场景组件 UI",-1))]),f("div",IE,[f("span",{class:"va-deploy-card__env",style:Fe({backgroundColor:a.value.bg,color:a.value.color})},$(a.value.label),5),f("span",{class:"va-deploy-card__status",style:Fe({backgroundColor:o.value.bg,color:o.value.color,borderColor:o.value.border})},[f("span",{class:_e(["va-deploy-card__status-dot",{"va-deploy-card__status-dot--pulse":o.value.pulse}]),style:Fe({backgroundColor:o.value.color})},null,6),de(" "+$(o.value.label),1)],4)])]),f("div",PE,[f("div",BE,[c[1]||(c[1]=f("span",{class:"va-deploy-card__metric-label"},"实例副本",-1)),f("span",LE,$(e.metrics?.replicas||"1/1"),1)]),f("div",OE,[c[2]||(c[2]=f("span",{class:"va-deploy-card__metric-label"},"CPU 负载",-1)),f("span",zE,$(e.metrics?.cpu||"8%"),1)]),f("div",jE,[c[3]||(c[3]=f("span",{class:"va-deploy-card__metric-label"},"内存占用",-1)),f("span",NE,$(e.metrics?.memory||"180 MB"),1)])]),e.endpoints&&e.endpoints.length>0?(v(),y("div",UE,[c[4]||(c[4]=f("span",{class:"va-deploy-card__sec-title"},"服务访问入口",-1)),f("div",WE,[(v(!0),y(J,null,ve(e.endpoints,u=>(v(),y("div",{key:u,class:"va-deploy-card__endpoint-row"},[f("span",{class:"va-deploy-card__endpoint-url",title:u},$(u),9,VE),f("button",{type:"button",class:"va-deploy-card__btn-copy",title:n.value===u?"已复制":"复制端点",onClick:d=>i(u)},[n.value===u?(v(),le(p(ra),{key:0,size:12,style:{color:"#16a34a"}})):(v(),le(p(X4),{key:1,size:12}))],8,qE)]))),128))])])):R("",!0),e.commit?(v(),y("div",HE,[f("span",KE,"#"+$(e.commit.hash),1),f("span",JE,$(e.commit.message),1),e.commit.author?(v(),y("span",ZE,"by "+$(e.commit.author),1)):R("",!0)])):R("",!0),f("div",GE,[f("button",{type:"button",class:"va-deploy-card__action-btn",disabled:s.value,onClick:l},[O(p(_f),{size:12,class:_e({"va-spin":s.value})},null,8,["class"]),f("span",null,$(s.value?"正在探针巡检…":"探针巡检"),1)],8,XE),c[5]||(c[5]=f("span",{class:"va-deploy-card__footer-hint"},"由 @vuagent/ui CardRegistry 动态挂载",-1))])]))}}),QE=GC(YE,[["__scopeId","data-v-15bb3b4f"]]);function e6(){e$("ui_deploy_status",QE)}function t6(e,t={}){t.registerBuiltins!==!1&&e6();const n=um(AE);return n.mount(e),n}t6("#app");