scream-code 0.14.9 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-2Dd57a5d.mjs → app-CPu6R7nd.mjs} +1138 -50
- package/dist/{dispatch-CJPpI4gm.mjs → dispatch-BPcn43Vw.mjs} +1 -1
- package/dist/{dispatch-1ojfKMwf.mjs → dispatch-D8ovLbmr.mjs} +259 -142
- package/dist/main.mjs +1 -1
- package/dist/public/assets/index-BfVIY6UW.css +1 -0
- package/dist/public/assets/index-CYmwuyd8.js +93 -0
- package/dist/public/assets/index-CYmwuyd8.js.map +1 -0
- package/dist/public/assets/logo-v2-ChmPAIbI.svg +1 -0
- package/dist/public/gateway.html +156 -0
- package/dist/public/index.html +2 -2
- package/package.json +8 -2
- package/dist/public/assets/index-CopRDlgZ.js +0 -90
- package/dist/public/assets/index-CopRDlgZ.js.map +0 -1
- package/dist/public/assets/index-CyGAkekh.css +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var ud=Object.defineProperty;var dd=(e,t,n)=>t in e?ud(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t,n)=>dd(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();/**
|
|
2
|
+
* @vue/shared v3.5.40
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function hl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Oe={},qn=[],Dt=()=>{},Ca=()=>!1,Uo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fo=e=>e.startsWith("onUpdate:"),Ze=Object.assign,pl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},fd=Object.prototype.hasOwnProperty,Re=(e,t)=>fd.call(e,t),fe=Array.isArray,Vn=e=>Ps(e)==="[object Map]",zo=e=>Ps(e)==="[object Set]",ri=e=>Ps(e)==="[object Date]",ge=e=>typeof e=="function",Fe=e=>typeof e=="string",Gt=e=>typeof e=="symbol",Me=e=>e!==null&&typeof e=="object",$a=e=>(Me(e)||ge(e))&&ge(e.then)&&ge(e.catch),Ta=Object.prototype.toString,Ps=e=>Ta.call(e),hd=e=>Ps(e).slice(8,-1),Aa=e=>Ps(e)==="[object Object]",gl=e=>Fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ps=hl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ho=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},pd=/-\w/g,gt=Ho(e=>e.replace(pd,t=>t.slice(1).toUpperCase())),gd=/\B([A-Z])/g,Sn=Ho(e=>e.replace(gd,"-$1").toLowerCase()),qo=Ho(e=>e.charAt(0).toUpperCase()+e.slice(1)),pr=Ho(e=>e?`on${qo(e)}`:""),Qt=(e,t)=>!Object.is(e,t),lo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ra=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Vo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},md=e=>{const t=Fe(e)?Number(e):NaN;return isNaN(t)?e:t};let li;const Wo=()=>li||(li=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function cn(e){if(fe(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Fe(s)?kd(s):cn(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(Fe(e)||Me(e))return e}const vd=/;(?![^(]*\))/g,yd=/:([^]+)/,bd=/\/\*[^]*?\*\//g;function kd(e){const t={};return e.replace(bd,"").split(vd).forEach(n=>{if(n){const s=n.split(yd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function de(e){let t="";if(Fe(e))t=e;else if(fe(e))for(let n=0;n<e.length;n++){const s=de(e[n]);s&&(t+=s+" ")}else if(Me(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const wd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_d=hl(wd);function Ea(e){return!!e||e===""}function Sd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ns(e[s],t[s]);return n}function Ns(e,t){if(e===t)return!0;let n=ri(e),s=ri(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Gt(e),s=Gt(t),n||s)return e===t;if(n=fe(e),s=fe(t),n||s)return n&&s?Sd(e,t):!1;if(n=Me(e),s=Me(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const l in e){const i=e.hasOwnProperty(l),a=t.hasOwnProperty(l);if(i&&!a||!i&&a||!Ns(e[l],t[l]))return!1}}return String(e)===String(t)}function xd(e,t){return e.findIndex(n=>Ns(n,t))}const Ia=e=>!!(e&&e.__v_isRef===!0),I=e=>Fe(e)?e:e==null?"":fe(e)||Me(e)&&(e.toString===Ta||!ge(e.toString))?Ia(e)?I(e.value):JSON.stringify(e,La,2):String(e),La=(e,t)=>Ia(t)?La(e,t.value):Vn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[gr(s,r)+" =>"]=o,n),{})}:zo(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>gr(n))}:Gt(t)?gr(t):Me(t)&&!fe(t)&&!Aa(t)?String(t):t,gr=(e,t="")=>{var n;return Gt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function Cd(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
6
|
+
* @vue/reactivity v3.5.40
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let nt;class $d{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&nt&&(nt.active?(this.parent=nt,this.index=(nt.scopes||(nt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){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=nt;try{return nt=this,t()}finally{nt=n}}}on(){++this._on===1&&(this.prevScope=nt,nt=this)}off(){if(this._on>0&&--this._on===0){if(nt===this)nt=this.prevScope;else{let t=nt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,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 Td(){return nt}let Ge;const mr=new WeakSet;class Ma{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,nt&&(nt.active?nt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,mr.has(this)&&(mr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Na(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ii(this),Oa(this);const t=Ge,n=Bt;Ge=this,Bt=!0;try{return this.fn()}finally{Da(this),Ge=t,Bt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)yl(t);this.deps=this.depsTail=void 0,ii(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?mr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Dr(this)&&this.run()}get dirty(){return Dr(this)}}let Pa=0,gs,ms;function Na(e,t=!1){if(e.flags|=8,t){e.next=ms,ms=e;return}e.next=gs,gs=e}function ml(){Pa++}function vl(){if(--Pa>0)return;if(ms){let t=ms;for(ms=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;gs;){let t=gs;for(gs=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 Oa(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Da(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),yl(s),Ad(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Dr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ba(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ba(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ws)||(e.globalVersion=ws,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Dr(e))))return;e.flags|=2;const t=e.dep,n=Ge,s=Bt;Ge=e,Bt=!0;try{Oa(e);const o=e.fn(e._value);(t.version===0||Qt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Ge=n,Bt=s,Da(e),e.flags&=-3}}function yl(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 r=n.computed.deps;r;r=r.nextDep)yl(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ad(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Bt=!0;const Ga=[];function fn(){Ga.push(Bt),Bt=!1}function hn(){const e=Ga.pop();Bt=e===void 0?!0:e}function ii(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ge;Ge=void 0;try{t()}finally{Ge=n}}}let ws=0;class Rd{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 bl{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(!Ge||!Bt||Ge===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ge)n=this.activeLink=new Rd(Ge,this),Ge.deps?(n.prevDep=Ge.depsTail,Ge.depsTail.nextDep=n,Ge.depsTail=n):Ge.deps=Ge.depsTail=n,ja(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=Ge.depsTail,n.nextDep=void 0,Ge.depsTail.nextDep=n,Ge.depsTail=n,Ge.deps===n&&(Ge.deps=s)}return n}trigger(t){this.version++,ws++,this.notify(t)}notify(t){ml();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{vl()}}}function ja(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)ja(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Br=new WeakMap,Mn=Symbol(""),Gr=Symbol(""),_s=Symbol("");function lt(e,t,n){if(Bt&&Ge){let s=Br.get(e);s||Br.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new bl),o.map=s,o.key=n),o.track()}}function nn(e,t,n,s,o,r){const l=Br.get(e);if(!l){ws++;return}const i=a=>{a&&a.trigger()};if(ml(),t==="clear")l.forEach(i);else{const a=fe(e),c=a&&gl(n);if(a&&n==="length"){const u=Number(s);l.forEach((f,h)=>{(h==="length"||h===_s||!Gt(h)&&h>=u)&&i(f)})}else switch((n!==void 0||l.has(void 0))&&i(l.get(n)),c&&i(l.get(_s)),t){case"add":a?c&&i(l.get("length")):(i(l.get(Mn)),Vn(e)&&i(l.get(Gr)));break;case"delete":a||(i(l.get(Mn)),Vn(e)&&i(l.get(Gr)));break;case"set":Vn(e)&&i(l.get(Mn));break}}vl()}function Un(e){const t=Te(e);return t===e?t:(lt(t,"iterate",_s),Mt(e)?t:t.map(jt))}function Ko(e){return lt(e=Te(e),"iterate",_s),e}function Yt(e,t){return pn(e)?Qn(Pn(e)?jt(t):t):jt(t)}const Ed={__proto__:null,[Symbol.iterator](){return vr(this,Symbol.iterator,e=>Yt(this,e))},concat(...e){return Un(this).concat(...e.map(t=>fe(t)?Un(t):t))},entries(){return vr(this,"entries",e=>(e[1]=Yt(this,e[1]),e))},every(e,t){return Xt(this,"every",e,t,void 0,arguments)},filter(e,t){return Xt(this,"filter",e,t,n=>n.map(s=>Yt(this,s)),arguments)},find(e,t){return Xt(this,"find",e,t,n=>Yt(this,n),arguments)},findIndex(e,t){return Xt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Xt(this,"findLast",e,t,n=>Yt(this,n),arguments)},findLastIndex(e,t){return Xt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Xt(this,"forEach",e,t,void 0,arguments)},includes(...e){return yr(this,"includes",e)},indexOf(...e){return yr(this,"indexOf",e)},join(e){return Un(this).join(e)},lastIndexOf(...e){return yr(this,"lastIndexOf",e)},map(e,t){return Xt(this,"map",e,t,void 0,arguments)},pop(){return ss(this,"pop")},push(...e){return ss(this,"push",e)},reduce(e,...t){return ai(this,"reduce",e,t)},reduceRight(e,...t){return ai(this,"reduceRight",e,t)},shift(){return ss(this,"shift")},some(e,t){return Xt(this,"some",e,t,void 0,arguments)},splice(...e){return ss(this,"splice",e)},toReversed(){return Un(this).toReversed()},toSorted(e){return Un(this).toSorted(e)},toSpliced(...e){return Un(this).toSpliced(...e)},unshift(...e){return ss(this,"unshift",e)},values(){return vr(this,"values",e=>Yt(this,e))}};function vr(e,t,n){const s=Ko(e),o=s[t]();return s!==e&&!Mt(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const Id=Array.prototype;function Xt(e,t,n,s,o,r){const l=Ko(e),i=l!==e&&!Mt(e),a=l[t];if(a!==Id[t]){const f=a.apply(e,r);return i?jt(f):f}let c=n;l!==e&&(i?c=function(f,h){return n.call(this,Yt(e,f),h,e)}:n.length>2&&(c=function(f,h){return n.call(this,f,h,e)}));const u=a.call(l,c,s);return i&&o?o(u):u}function ai(e,t,n,s){const o=Ko(e),r=o!==e&&!Mt(e);let l=n,i=!1;o!==e&&(r?(i=s.length===0,l=function(c,u,f){return i&&(i=!1,c=Yt(e,c)),n.call(this,c,Yt(e,u),f,e)}):n.length>3&&(l=function(c,u,f){return n.call(this,c,u,f,e)}));const a=o[t](l,...s);return i?Yt(e,a):a}function yr(e,t,n){const s=Te(e);lt(s,"iterate",_s);const o=s[t](...n);return(o===-1||o===!1)&&Sl(n[0])?(n[0]=Te(n[0]),s[t](...n)):o}function ss(e,t,n=[]){fn(),ml();const s=Te(e)[t].apply(e,n);return vl(),hn(),s}const Ld=hl("__proto__,__v_isRef,__isVue"),Ua=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Gt));function Md(e){Gt(e)||(e=String(e));const t=Te(this);return lt(t,"has",e),t.hasOwnProperty(e)}class Fa{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,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?zd:Va:r?qa:Ha).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const l=fe(t);if(!o){let a;if(l&&(a=Ed[n]))return a;if(n==="hasOwnProperty")return Md}const i=Reflect.get(t,n,ut(t)?t:s);if((Gt(n)?Ua.has(n):Ld(n))||(o||lt(t,"get",n),r))return i;if(ut(i)){const a=l&&gl(n)?i:i.value;return o&&Me(a)?Ur(a):a}return Me(i)?o?Ur(i):wl(i):i}}class za extends Fa{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const l=fe(t)&&gl(n);if(!this._isShallow){const c=pn(r);if(!Mt(s)&&!pn(s)&&(r=Te(r),s=Te(s)),!l&&ut(r)&&!ut(s))return c||(r.value=s),!0}const i=l?Number(n)<t.length:Re(t,n),a=Reflect.set(t,n,s,ut(t)?t:o);return t===Te(o)&&a&&(i?Qt(s,r)&&nn(t,"set",n,s):nn(t,"add",n,s)),a}deleteProperty(t,n){const s=Re(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&nn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Gt(n)||!Ua.has(n))&<(t,"has",n),s}ownKeys(t){return lt(t,"iterate",fe(t)?"length":Mn),Reflect.ownKeys(t)}}class Pd extends Fa{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Nd=new za,Od=new Pd,Dd=new za(!0);const jr=e=>e,Ks=e=>Reflect.getPrototypeOf(e);function Bd(e,t,n){return function(...s){const o=this.__v_raw,r=Te(o),l=Vn(r),i=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,c=o[e](...s),u=n?jr:t?Qn:jt;return!t&<(r,"iterate",a?Gr:Mn),Ze(Object.create(c),{next(){const{value:f,done:h}=c.next();return h?{value:f,done:h}:{value:i?[u(f[0]),u(f[1])]:u(f),done:h}}})}}function Zs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Gd(e,t){const n={get(o){const r=this.__v_raw,l=Te(r),i=Te(o);e||(Qt(o,i)&<(l,"get",o),lt(l,"get",i));const{has:a}=Ks(l),c=t?jr:e?Qn:jt;if(a.call(l,o))return c(r.get(o));if(a.call(l,i))return c(r.get(i));r!==l&&r.get(o)},get size(){const o=this.__v_raw;return!e&<(Te(o),"iterate",Mn),o.size},has(o){const r=this.__v_raw,l=Te(r),i=Te(o);return e||(Qt(o,i)&<(l,"has",o),lt(l,"has",i)),o===i?r.has(o):r.has(o)||r.has(i)},forEach(o,r){const l=this,i=l.__v_raw,a=Te(i),c=t?jr:e?Qn:jt;return!e&<(a,"iterate",Mn),i.forEach((u,f)=>o.call(r,c(u),c(f),l))}};return Ze(n,e?{add:Zs("add"),set:Zs("set"),delete:Zs("delete"),clear:Zs("clear")}:{add(o){const r=Te(this),l=Ks(r),i=Te(o),a=!t&&!Mt(o)&&!pn(o)?i:o;return l.has.call(r,a)||Qt(o,a)&&l.has.call(r,o)||Qt(i,a)&&l.has.call(r,i)||(r.add(a),nn(r,"add",a,a)),this},set(o,r){!t&&!Mt(r)&&!pn(r)&&(r=Te(r));const l=Te(this),{has:i,get:a}=Ks(l);let c=i.call(l,o);c||(o=Te(o),c=i.call(l,o));const u=a.call(l,o);return l.set(o,r),c?Qt(r,u)&&nn(l,"set",o,r):nn(l,"add",o,r),this},delete(o){const r=Te(this),{has:l,get:i}=Ks(r);let a=l.call(r,o);a||(o=Te(o),a=l.call(r,o)),i&&i.call(r,o);const c=r.delete(o);return a&&nn(r,"delete",o,void 0),c},clear(){const o=Te(this),r=o.size!==0,l=o.clear();return r&&nn(o,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Bd(o,e,t)}),n}function kl(e,t){const n=Gd(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Re(n,o)&&o in s?n:s,o,r)}const jd={get:kl(!1,!1)},Ud={get:kl(!1,!0)},Fd={get:kl(!0,!1)};const Ha=new WeakMap,qa=new WeakMap,Va=new WeakMap,zd=new WeakMap;function Hd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wl(e){return pn(e)?e:_l(e,!1,Nd,jd,Ha)}function qd(e){return _l(e,!1,Dd,Ud,qa)}function Ur(e){return _l(e,!0,Od,Fd,Va)}function _l(e,t,n,s,o){if(!Me(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=o.get(e);if(r)return r;const l=Hd(hd(e));if(l===0)return e;const i=new Proxy(e,l===2?s:n);return o.set(e,i),i}function Pn(e){return pn(e)?Pn(e.__v_raw):!!(e&&e.__v_isReactive)}function pn(e){return!!(e&&e.__v_isReadonly)}function Mt(e){return!!(e&&e.__v_isShallow)}function Sl(e){return e?!!e.__v_raw:!1}function Te(e){const t=e&&e.__v_raw;return t?Te(t):e}function Vd(e){return!Re(e,"__v_skip")&&Object.isExtensible(e)&&Ra(e,"__v_skip",!0),e}const jt=e=>Me(e)?wl(e):e,Qn=e=>Me(e)?Ur(e):e;function ut(e){return e?e.__v_isRef===!0:!1}function G(e){return Wd(e,!1)}function Wd(e,t){return ut(e)?e:new Kd(e,t)}class Kd{constructor(t,n){this.dep=new bl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Te(t),this._value=n?t:jt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Mt(t)||pn(t);t=s?t:Te(t),Qt(t,n)&&(this._rawValue=t,this._value=s?t:jt(t),this.dep.trigger())}}function ne(e){return ut(e)?e.value:e}const Zd={get:(e,t,n)=>t==="__v_raw"?e:ne(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return ut(o)&&!ut(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Wa(e){return Pn(e)?e:new Proxy(e,Zd)}class Yd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new bl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Ge!==this)return Na(this,!0),!0}get value(){const t=this.dep.track();return Ba(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Jd(e,t,n=!1){let s,o;return ge(e)?s=e:(s=e.get,o=e.set),new Yd(s,o,n)}const Ys={},go=new WeakMap;let An;function Qd(e,t=!1,n=An){if(n){let s=go.get(n);s||go.set(n,s=[]),s.push(e)}}function Xd(e,t,n=Oe){const{immediate:s,deep:o,once:r,scheduler:l,augmentJob:i,call:a}=n,c=T=>o?T:Mt(T)||o===!1||o===0?sn(T,1):sn(T);let u,f,h,p,g=!1,w=!1;if(ut(e)?(f=()=>e.value,g=Mt(e)):Pn(e)?(f=()=>c(e),g=!0):fe(e)?(w=!0,g=e.some(T=>Pn(T)||Mt(T)),f=()=>e.map(T=>{if(ut(T))return T.value;if(Pn(T))return c(T);if(ge(T))return a?a(T,2):T()})):ge(e)?t?f=a?()=>a(e,2):e:f=()=>{if(h){fn();try{h()}finally{hn()}}const T=An;An=u;try{return a?a(e,3,[p]):e(p)}finally{An=T}}:f=Dt,t&&o){const T=f,F=o===!0?1/0:o;f=()=>sn(T(),F)}const b=Td(),k=()=>{u.stop(),b&&b.active&&pl(b.effects,u)};if(r&&t){const T=t;t=(...F)=>{const O=T(...F);return k(),O}}let S=w?new Array(e.length).fill(Ys):Ys;const $=T=>{if(!(!(u.flags&1)||!u.dirty&&!T))if(t){const F=u.run();if(T||o||g||(w?F.some((O,C)=>Qt(O,S[C])):Qt(F,S))){h&&h();const O=An;An=u;try{const C=[F,S===Ys?void 0:w&&S[0]===Ys?[]:S,p];S=F,a?a(t,3,C):t(...C)}finally{An=O}}}else u.run()};return i&&i($),u=new Ma(f),u.scheduler=l?()=>l($,!1):$,p=T=>Qd(T,!1,u),h=u.onStop=()=>{const T=go.get(u);if(T){if(a)a(T,4);else for(const F of T)F();go.delete(u)}},t?s?$(!0):S=u.run():l?l($.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function sn(e,t=1/0,n){if(t<=0||!Me(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ut(e))sn(e.value,t,n);else if(fe(e))for(let s=0;s<e.length;s++)sn(e[s],t,n);else if(zo(e)||Vn(e))e.forEach(s=>{sn(s,t,n)});else if(Aa(e)){for(const s in e)sn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&sn(e[s],t,n)}return e}/**
|
|
10
|
+
* @vue/runtime-core v3.5.40
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function Os(e,t,n,s){try{return s?e(...s):e()}catch(o){Zo(o,t,n)}}function Pt(e,t,n,s){if(ge(e)){const o=Os(e,t,n,s);return o&&$a(o)&&o.catch(r=>{Zo(r,t,n)}),o}if(fe(e)){const o=[];for(let r=0;r<e.length;r++)o.push(Pt(e[r],t,n,s));return o}}function Zo(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||Oe;if(t){let i=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const u=i.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,a,c)===!1)return}i=i.parent}if(r){fn(),Os(r,null,10,[e,a,c]),hn();return}}ef(e,n,o,s,l)}function ef(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const ht=[];let Zt=-1;const Wn=[];let kn=null,Fn=0;const Ka=Promise.resolve();let mo=null;function It(e){const t=mo||Ka;return e?t.then(this?e.bind(this):e):t}function tf(e){let t=Zt+1,n=ht.length;for(;t<n;){const s=t+n>>>1,o=ht[s],r=Ss(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function xl(e){if(!(e.flags&1)){const t=Ss(e),n=ht[ht.length-1];!n||!(e.flags&2)&&t>=Ss(n)?ht.push(e):ht.splice(tf(t),0,e),e.flags|=1,Za()}}function Za(){mo||(mo=Ka.then(Qa))}function Ya(e){fe(e)?Wn.push(...e):kn&&e.id===-1?kn.splice(Fn+1,0,e):e.flags&1||(Wn.push(e),e.flags|=1),Za()}function ci(e,t,n=Zt+1){for(;n<ht.length;n++){const s=ht[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ht.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Ja(e){if(Wn.length){const t=[...new Set(Wn)].sort((n,s)=>Ss(n)-Ss(s));if(Wn.length=0,kn){kn.push(...t);return}for(kn=t,Fn=0;Fn<kn.length;Fn++){const n=kn[Fn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}kn=null,Fn=0}}const Ss=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Qa(e){try{for(Zt=0;Zt<ht.length;Zt++){const t=ht[Zt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Os(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Zt<ht.length;Zt++){const t=ht[Zt];t&&(t.flags&=-2)}Zt=-1,ht.length=0,Ja(),mo=null,(ht.length||Wn.length)&&Qa()}}let st=null,Xa=null;function vo(e){const t=st;return st=e,Xa=e&&e.type.__scopeId||null,t}function kt(e,t=st,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&ko(-1);const r=vo(t),l=dn.length;let i;try{i=e(...o)}finally{for(let a=dn.length;a>l;a--)El();vo(r),s._d&&ko(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function Ke(e,t){if(st===null)return e;const n=nr(st),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,l,i,a=Oe]=t[o];r&&(ge(r)&&(r={mounted:r,updated:r}),r.deep&&sn(l),s.push({dir:r,instance:n,value:l,oldValue:void 0,arg:i,modifiers:a}))}return e}function Cn(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let l=0;l<o.length;l++){const i=o[l];r&&(i.oldValue=r[l].value);let a=i.dir[s];a&&(fn(),Pt(a,n,8,[e.el,i,e,t]),hn())}}function io(e,t){if(at){let n=at.provides;const s=at.parent&&at.parent.provides;s===n&&(n=at.provides=Object.create(s)),n[e]=t}}function un(e,t,n=!1){const s=tr();if(s||Zn){let o=Zn?Zn._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&&ge(t)?t.call(s&&s.proxy):t}}const nf=Symbol.for("v-scx"),sf=()=>un(nf);function Ie(e,t,n){return ec(e,t,n)}function ec(e,t,n=Oe){const{immediate:s,deep:o,flush:r,once:l}=n,i=Ze({},n),a=t&&s||!t&&r!=="post";let c;if(Ts){if(r==="sync"){const p=sf();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=Dt,p.resume=Dt,p.pause=Dt,p}}const u=at;i.call=(p,g,w)=>Pt(p,u,g,w);let f=!1;r==="post"?i.scheduler=p=>{ft(p,u&&u.suspense)}:r!=="sync"&&(f=!0,i.scheduler=(p,g)=>{g?p():xl(p)}),i.augmentJob=p=>{t&&(p.flags|=4),f&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const h=Xd(e,t,i);return Ts&&(c?c.push(h):a&&h()),h}function of(e,t,n){const s=this.proxy,o=Fe(e)?e.includes(".")?tc(s,e):()=>s[e]:e.bind(s,s);let r;ge(t)?r=t:(r=t.handler,n=t);const l=Ds(this),i=ec(o,r.bind(s),n);return l(),i}function tc(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 yn=new WeakMap,nc=Symbol("_vte"),sc=e=>e.__isTeleport,Rn=e=>e&&(e.disabled||e.disabled===""),rf=e=>e&&(e.defer||e.defer===""),ui=e=>typeof SVGElement<"u"&&e instanceof SVGElement,di=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Fr=(e,t)=>{const n=e&&e.to;return Fe(n)?t?t(n):null:n},lf={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,r,l,i,a,c){const{mc:u,pc:f,pbc:h,o:{insert:p,querySelector:g,createText:w,createComment:b,parentNode:k}}=c,S=Rn(t.props);let{dynamicChildren:$}=t;const T=(C,A,R)=>{C.shapeFlag&16&&u(C.children,A,R,o,r,l,i,a)},F=(C=t)=>{const A=Rn(C.props),R=C.target=Fr(C.props,g),J=zr(R,C,w,p);R&&(l!=="svg"&&ui(R)?l="svg":l!=="mathml"&&di(R)&&(l="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(R),A||(T(C,R,J),us(C,!1)))},O=C=>{const A=()=>{if(yn.get(C)===A){if(yn.delete(C),Rn(C.props)){const R=k(C.el)||n;T(C,R,C.anchor),us(C,!0)}F(C)}};yn.set(C,A),ft(A,r)};if(e==null){const C=t.el=w(""),A=t.anchor=w("");if(p(C,n,s),p(A,n,s),rf(t.props)||r&&r.pendingBranch){O(t);return}S&&(T(t,n,A),us(t,!0)),F()}else{t.el=e.el;const C=t.anchor=e.anchor,A=yn.get(e);if(A){A.flags|=8,yn.delete(e),O(t);return}t.targetStart=e.targetStart;const R=t.target=e.target,J=t.targetAnchor=e.targetAnchor,oe=Rn(e.props),H=oe?n:R,pe=oe?C:J;if(l==="svg"||ui(R)?l="svg":(l==="mathml"||di(R))&&(l="mathml"),$?(h(e.dynamicChildren,$,H,o,r,l,i),Rl(e,t,!0)):a||f(e,t,H,pe,o,r,l,i,!1),S)oe?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Js(t,n,C,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=Fr(t.props,g);P&&(t.target=P,Js(t,P,null,c,0))}else oe&&Js(t,R,J,c,1);us(t,S)}},remove(e,t,n,{um:s,o:{remove:o}},r){const{shapeFlag:l,children:i,anchor:a,targetStart:c,targetAnchor:u,target:f,props:h}=e,p=Rn(h),g=r||!p,w=yn.get(e);if(w&&(w.flags|=8,yn.delete(e)),f&&(o(c),o(u)),r&&o(a),!w&&(p||f)&&l&16)for(let b=0;b<i.length;b++){const k=i[b];s(k,t,n,g,!!k.dynamicChildren)}},move:Js,hydrate:af};function Js(e,t,n,{o:{insert:s},m:o},r=2){r===0&&s(e.targetAnchor,t,n);const{el:l,anchor:i,shapeFlag:a,children:c,props:u}=e,f=r===2;if(f&&s(l,t,n),!yn.has(e)&&(!f||Rn(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);f&&s(i,t,n)}function af(e,t,n,s,o,r,{o:{nextSibling:l,parentNode:i,querySelector:a,insert:c,createText:u}},f){function h(b,k){let S=k;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")t.targetStart=S;else if(S.data==="teleport anchor"){t.targetAnchor=S,b._lpa=t.targetAnchor&&l(t.targetAnchor);break}}S=l(S)}}function p(b,k){k.anchor=f(l(b),k,i(b),n,s,o,r)}const g=t.target=Fr(t.props,a),w=Rn(t.props);if(g){const b=g._lpa||g.firstChild;t.shapeFlag&16&&(w?(p(e,t),h(g,b),t.targetAnchor||zr(g,t,u,c,i(e)===g?e:null)):(t.anchor=l(e),h(g,b),t.targetAnchor||zr(g,t,u,c),f(b&&l(b),t,g,n,s,o,r))),us(t,w)}else w&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=l(e));return t.anchor&&l(t.anchor)}const Cl=lf;function us(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 zr(e,t,n,s,o=null){const r=t.targetStart=n(""),l=t.targetAnchor=n("");return r[nc]=l,e&&(s(r,e,o),s(l,e,o)),l}const Et=Symbol("_leaveCb"),os=Symbol("_enterCb");function oc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Nt(()=>{e.isMounted=!0}),Ut(()=>{e.isUnmounting=!0}),e}const At=[Function,Array],rc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:At,onEnter:At,onAfterEnter:At,onEnterCancelled:At,onBeforeLeave:At,onLeave:At,onAfterLeave:At,onLeaveCancelled:At,onBeforeAppear:At,onAppear:At,onAfterAppear:At,onAppearCancelled:At},lc=e=>{const t=e.subTree;return t.component?lc(t.component):t},cf={name:"BaseTransition",props:rc,setup(e,{slots:t}){const n=tr(),s=oc();return()=>{const o=t.default&&$l(t.default(),!0),r=o&&o.length?ic(o):n.subTree?N():void 0;if(!r)return;const l=Te(e),{mode:i}=l;if(s.isLeaving)return br(r);const a=fi(r);if(!a)return br(r);let c=xs(a,l,s,n,f=>c=f);a.type!==it&&On(a,c);let u=n.subTree&&fi(n.subTree);if(u&&u.type!==it&&!En(u,a)&&lc(n).type!==it){let f=xs(u,l,s,n);if(On(u,f),i==="out-in"&&a.type!==it)return s.isLeaving=!0,f.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},br(r);i==="in-out"&&a.type!==it?f.delayLeave=(h,p,g)=>{const w=ac(s,u);w[String(u.key)]=u,h[Et]=()=>{p(),h[Et]=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 r}}};function ic(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==it){t=n;break}}return t}const uf=cf;function ac(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 xs(e,t,n,s,o){const{appear:r,mode:l,persisted:i=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:h,onLeave:p,onAfterLeave:g,onLeaveCancelled:w,onBeforeAppear:b,onAppear:k,onAfterAppear:S,onAppearCancelled:$}=t,T=String(e.key),F=ac(n,e),O=(R,J)=>{R&&Pt(R,s,9,J)},C=(R,J)=>{const oe=J[1];O(R,J),fe(R)?R.every(H=>H.length<=1)&&oe():R.length<=1&&oe()},A={mode:l,persisted:i,beforeEnter(R){let J=a;if(!n.isMounted)if(r)J=b||a;else return;R[Et]&&R[Et](!0);const oe=F[T];oe&&En(e,oe)&&oe.el[Et]&&oe.el[Et](),O(J,[R])},enter(R){if(F[T]===e)return;let J=c,oe=u,H=f;if(!n.isMounted)if(r)J=k||c,oe=S||u,H=$||f;else return;let pe=!1;R[os]=M=>{pe||(pe=!0,M?O(H,[R]):O(oe,[R]),A.delayedLeave&&A.delayedLeave(),R[os]=void 0)};const P=R[os].bind(null,!1);J?C(J,[R,P]):P()},leave(R,J){const oe=String(e.key);if(R[os]&&R[os](!0),n.isUnmounting)return J();O(h,[R]);let H=!1;R[Et]=P=>{H||(H=!0,J(),P?O(w,[R]):O(g,[R]),R[Et]=void 0,F[oe]===e&&delete F[oe])};const pe=R[Et].bind(null,!1);F[oe]=e,p?C(p,[R,pe]):pe()},clone(R){const J=xs(R,t,n,s,o);return o&&o(J),J}};return A}function br(e){if(Yo(e))return e=_n(e),e.children=null,e}function fi(e){if(!Yo(e))return sc(e.type)&&e.children?ic(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&&ge(n.default))return n.default()}}function On(e,t){e.shapeFlag&6&&e.component?(e.transition=t,On(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function $l(e,t=!1,n){let s=[],o=0;for(let r=0;r<e.length;r++){let l=e[r];const i=n==null?l.key:String(n)+String(l.key!=null?l.key:r);l.type===Q?(l.patchFlag&128&&o++,s=s.concat($l(l.children,t,i))):(t||l.type!==it)&&s.push(i!=null?_n(l,{key:i}):l)}if(o>1)for(let r=0;r<s.length;r++)s[r].patchFlag=-2;return s}function _e(e,t){return ge(e)?Ze({name:e.name},t,{setup:e}):e}function cc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function hi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const yo=new WeakMap;function vs(e,t,n,s,o=!1){if(fe(e)){e.forEach((w,b)=>vs(w,t&&(fe(t)?t[b]:t),n,s,o));return}if(Kn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&vs(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?nr(s.component):s.el,l=o?null:r,{i,r:a}=e,c=t&&t.r,u=i.refs===Oe?i.refs={}:i.refs,f=i.setupState,h=Te(f),p=f===Oe?Ca:w=>hi(u,w)?!1:Re(h,w),g=(w,b)=>!(b&&hi(u,b));if(c!=null&&c!==a){if(pi(t),Fe(c))u[c]=null,p(c)&&(f[c]=null);else if(ut(c)){const w=t;g(c,w.k)&&(c.value=null),w.k&&(u[w.k]=null)}}if(ge(a))Os(a,i,12,[l,u]);else{const w=Fe(a),b=ut(a);if(w||b){const k=()=>{if(e.f){const S=w?p(a)?f[a]:u[a]:g()||!e.k?a.value:u[e.k];if(o)fe(S)&&pl(S,r);else if(fe(S))S.includes(r)||S.push(r);else if(w)u[a]=[r],p(a)&&(f[a]=u[a]);else{const $=[r];g(a,e.k)&&(a.value=$),e.k&&(u[e.k]=$)}}else w?(u[a]=l,p(a)&&(f[a]=l)):b&&(g(a,e.k)&&(a.value=l),e.k&&(u[e.k]=l))};if(l){const S=()=>{k(),yo.delete(e)};S.id=-1,yo.set(e,S),ft(S,n)}else pi(e),k()}}}function pi(e){const t=yo.get(e);t&&(t.flags|=8,yo.delete(e))}Wo().requestIdleCallback;Wo().cancelIdleCallback;const Kn=e=>!!e.type.__asyncLoader,Yo=e=>e.type.__isKeepAlive;function df(e,t){uc(e,"a",t)}function ff(e,t){uc(e,"da",t)}function uc(e,t,n=at){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Jo(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Yo(o.parent.vnode)&&hf(s,t,n,o),o=o.parent}}function hf(e,t,n,s){const o=Jo(t,e,s,!0);Qo(()=>{pl(s[t],o)},n)}function Jo(e,t,n=at,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{fn();const i=Ds(n),a=Pt(t,n,e,l);return i(),hn(),a});return s?o.unshift(r):o.push(r),r}}const gn=e=>(t,n=at)=>{(!Ts||e==="sp")&&Jo(e,(...s)=>t(...s),n)},pf=gn("bm"),Nt=gn("m"),dc=gn("bu"),fc=gn("u"),Ut=gn("bum"),Qo=gn("um"),gf=gn("sp"),mf=gn("rtg"),vf=gn("rtc");function yf(e,t=at){Jo("ec",e,t)}const hc="components";function bf(e,t){return gc(hc,e,!0,t)||e}const pc=Symbol.for("v-ndc");function kf(e){return Fe(e)?gc(hc,e,!1)||e:e||pc}function gc(e,t,n=!0,s=!1){const o=st||at;if(o){const r=o.type;{const i=sh(r,!1);if(i&&(i===t||i===gt(t)||i===qo(gt(t))))return r}const l=gi(o[e]||r[e],t)||gi(o.appContext[e],t);return!l&&s?r:l}}function gi(e,t){return e&&(e[t]||e[gt(t)]||e[qo(gt(t))])}function ze(e,t,n,s){let o;const r=n,l=fe(e);if(l||Fe(e)){const i=l&&Pn(e);let a=!1,c=!1;i&&(a=!Mt(e),c=pn(e),e=Ko(e)),o=new Array(e.length);for(let u=0,f=e.length;u<f;u++)o[u]=t(a?c?Qn(jt(e[u])):jt(e[u]):e[u],u,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let i=0;i<e;i++)o[i]=t(i+1,i,void 0,r)}else if(Me(e))if(e[Symbol.iterator])o=Array.from(e,(i,a)=>t(i,a,void 0,r));else{const i=Object.keys(e);o=new Array(i.length);for(let a=0,c=i.length;a<c;a++){const u=i[a];o[a]=t(e[u],u,a,r)}}else o=[];return o}function ao(e,t,n={},s,o,r){if(st.ce||st.parent&&Kn(st.parent)&&st.parent.ce){const c=n,u=Object.keys(c).length>0;return t!=="default"&&(c.name=t),v(),Ue(Q,null,[K("slot",c,s&&s())],u?-2:64)}let l=e[t];l&&l._c&&(l._d=!1);const i=dn.length;v();let a;try{const c=l&&mc(l(n)),u=n.key||r||c&&c.key;a=Ue(Q,{key:(u&&!Gt(u)?u:`_${t}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&e._===1?64:-2)}catch(c){for(let u=dn.length;u>i;u--)El();throw c}finally{l&&l._c&&(l._d=!0)}return a}function mc(e){return e.some(t=>$s(t)?!(t.type===it||t.type===Q&&!mc(t.children)):!0)?e:null}const Hr=e=>e?Nc(e)?nr(e):Hr(e.parent):null,ys=Ze(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=>Hr(e.parent),$root:e=>Hr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>yc(e),$forceUpdate:e=>e.f||(e.f=()=>{xl(e.update)}),$nextTick:e=>e.n||(e.n=It.bind(e.proxy)),$watch:e=>of.bind(e)}),kr=(e,t)=>e!==Oe&&!e.__isScriptSetup&&Re(e,t),wf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:l,type:i,appContext:a}=e;if(t[0]!=="$"){const h=l[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(kr(s,t))return l[t]=1,s[t];if(o!==Oe&&Re(o,t))return l[t]=2,o[t];if(Re(r,t))return l[t]=3,r[t];if(n!==Oe&&Re(n,t))return l[t]=4,n[t];qr&&(l[t]=0)}}const c=ys[t];let u,f;if(c)return t==="$attrs"&<(e.attrs,"get",""),c(e);if((u=i.__cssModules)&&(u=u[t]))return u;if(n!==Oe&&Re(n,t))return l[t]=4,n[t];if(f=a.config.globalProperties,Re(f,t))return f[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return kr(o,t)?(o[t]=n,!0):s!==Oe&&Re(s,t)?(s[t]=n,!0):Re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:l}},i){let a;return!!(n[i]||e!==Oe&&i[0]!=="$"&&Re(e,i)||kr(t,i)||Re(r,i)||Re(s,i)||Re(ys,i)||Re(o.config.globalProperties,i)||(a=l.__cssModules)&&a[i])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Re(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function mi(e){return fe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let qr=!0;function _f(e){const t=yc(e),n=e.proxy,s=e.ctx;qr=!1,t.beforeCreate&&vi(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:l,watch:i,provide:a,inject:c,created:u,beforeMount:f,mounted:h,beforeUpdate:p,updated:g,activated:w,deactivated:b,beforeDestroy:k,beforeUnmount:S,destroyed:$,unmounted:T,render:F,renderTracked:O,renderTriggered:C,errorCaptured:A,serverPrefetch:R,expose:J,inheritAttrs:oe,components:H,directives:pe,filters:P}=t;if(c&&Sf(c,s,null),l)for(const le in l){const ve=l[le];ge(ve)&&(s[le]=ve.bind(n))}if(o){const le=o.call(n,n);Me(le)&&(e.data=wl(le))}if(qr=!0,r)for(const le in r){const ve=r[le],De=ge(ve)?ve.bind(n,n):ge(ve.get)?ve.get.bind(n,n):Dt,W=!ge(ve)&&ge(ve.set)?ve.set.bind(n):Dt,te=Y({get:De,set:W});Object.defineProperty(s,le,{enumerable:!0,configurable:!0,get:()=>te.value,set:ke=>te.value=ke})}if(i)for(const le in i)vc(i[le],s,n,le);if(a){const le=ge(a)?a.call(n):a;Reflect.ownKeys(le).forEach(ve=>{io(ve,le[ve])})}u&&vi(u,e,"c");function X(le,ve){fe(ve)?ve.forEach(De=>le(De.bind(n))):ve&&le(ve.bind(n))}if(X(pf,f),X(Nt,h),X(dc,p),X(fc,g),X(df,w),X(ff,b),X(yf,A),X(vf,O),X(mf,C),X(Ut,S),X(Qo,T),X(gf,R),fe(J))if(J.length){const le=e.exposed||(e.exposed={});J.forEach(ve=>{Object.defineProperty(le,ve,{get:()=>n[ve],set:De=>n[ve]=De,enumerable:!0})})}else e.exposed||(e.exposed={});F&&e.render===Dt&&(e.render=F),oe!=null&&(e.inheritAttrs=oe),H&&(e.components=H),pe&&(e.directives=pe),R&&cc(e)}function Sf(e,t,n=Dt){fe(e)&&(e=Vr(e));for(const s in e){const o=e[s];let r;Me(o)?"default"in o?r=un(o.from||s,o.default,!0):r=un(o.from||s):r=un(o),ut(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:l=>r.value=l}):t[s]=r}}function vi(e,t,n){Pt(fe(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function vc(e,t,n,s){let o=s.includes(".")?tc(n,s):()=>n[s];if(Fe(e)){const r=t[e];ge(r)&&Ie(o,r)}else if(ge(e))Ie(o,e.bind(n));else if(Me(e))if(fe(e))e.forEach(r=>vc(r,t,n,s));else{const r=ge(e.handler)?e.handler.bind(n):t[e.handler];ge(r)&&Ie(o,r,e)}}function yc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:l}}=e.appContext,i=r.get(t);let a;return i?a=i:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>bo(a,c,l,!0)),bo(a,t,l)),Me(t)&&r.set(t,a),a}function bo(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&bo(e,r,n,!0),o&&o.forEach(l=>bo(e,l,n,!0));for(const l in t)if(!(s&&l==="expose")){const i=xf[l]||n&&n[l];e[l]=i?i(e[l],t[l]):t[l]}return e}const xf={data:yi,props:bi,emits:bi,methods:ds,computed:ds,beforeCreate:dt,created:dt,beforeMount:dt,mounted:dt,beforeUpdate:dt,updated:dt,beforeDestroy:dt,beforeUnmount:dt,destroyed:dt,unmounted:dt,activated:dt,deactivated:dt,errorCaptured:dt,serverPrefetch:dt,components:ds,directives:ds,watch:$f,provide:yi,inject:Cf};function yi(e,t){return t?e?function(){return Ze(ge(e)?e.call(this,this):e,ge(t)?t.call(this,this):t)}:t:e}function Cf(e,t){return ds(Vr(e),Vr(t))}function Vr(e){if(fe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function dt(e,t){return e?[...new Set([].concat(e,t))]:t}function ds(e,t){return e?Ze(Object.create(null),e,t):t}function bi(e,t){return e?fe(e)&&fe(t)?[...new Set([...e,...t])]:Ze(Object.create(null),mi(e),mi(t??{})):t}function $f(e,t){if(!e)return t;if(!t)return e;const n=Ze(Object.create(null),e);for(const s in t)n[s]=dt(e[s],t[s]);return n}function bc(){return{app:null,config:{isNativeTag:Ca,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 Tf=0;function Af(e,t){return function(s,o=null){ge(s)||(s=Ze({},s)),o!=null&&!Me(o)&&(o=null);const r=bc(),l=new WeakSet,i=[];let a=!1;const c=r.app={_uid:Tf++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:rh,get config(){return r.config},set config(u){},use(u,...f){return l.has(u)||(u&&ge(u.install)?(l.add(u),u.install(c,...f)):ge(u)&&(l.add(u),u(c,...f))),c},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),c},component(u,f){return f?(r.components[u]=f,c):r.components[u]},directive(u,f){return f?(r.directives[u]=f,c):r.directives[u]},mount(u,f,h){if(!a){const p=c._ceVNode||K(s,o);return p.appContext=r,h===!0?h="svg":h===!1&&(h=void 0),e(p,u,h),a=!0,c._container=u,u.__vue_app__=c,nr(p.component)}},onUnmount(u){i.push(u)},unmount(){a&&(Pt(i,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,f){return r.provides[u]=f,c},runWithContext(u){const f=Zn;Zn=c;try{return u()}finally{Zn=f}}};return c}}let Zn=null;const Rf=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${gt(t)}Modifiers`]||e[`${Sn(t)}Modifiers`];function Ef(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Oe;let o=n;const r=t.startsWith("update:"),l=r&&Rf(s,t.slice(7));l&&(l.trim&&(o=n.map(u=>Fe(u)?u.trim():u)),l.number&&(o=n.map(Vo)));let i,a=s[i=pr(t)]||s[i=pr(gt(t))];!a&&r&&(a=s[i=pr(Sn(t))]),a&&Pt(a,e,6,o);const c=s[i+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,Pt(c,e,6,o)}}const If=new WeakMap;function kc(e,t,n=!1){const s=n?If:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let l={},i=!1;if(!ge(e)){const a=c=>{const u=kc(c,t,!0);u&&(i=!0,Ze(l,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!i?(Me(e)&&s.set(e,null),null):(fe(r)?r.forEach(a=>l[a]=null):Ze(l,r),Me(e)&&s.set(e,l),l)}function Xo(e,t){return!e||!Uo(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Re(e,t[0].toLowerCase()+t.slice(1))||Re(e,Sn(t))||Re(e,t))}function ki(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:l,attrs:i,emit:a,render:c,renderCache:u,props:f,data:h,setupState:p,ctx:g,inheritAttrs:w}=e,b=vo(e);let k,S;try{if(n.shapeFlag&4){const T=o||s,F=T;k=Jt(c.call(F,T,u,f,p,h,g)),S=i}else{const T=t;k=Jt(T.length>1?T(f,{attrs:i,slots:l,emit:a}):T(f,null)),S=t.props?i:Lf(i)}}catch(T){dn.length=0,Zo(T,e,1),k=K(it)}let $=k;if(S&&w!==!1){const T=Object.keys(S),{shapeFlag:F}=$;T.length&&F&7&&(r&&T.some(Fo)&&(S=Mf(S,r)),$=_n($,S,!1,!0))}return n.dirs&&($=_n($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&On($,n.transition),k=$,vo(b),k}const Lf=e=>{let t;for(const n in e)(n==="class"||n==="style"||Uo(n))&&((t||(t={}))[n]=e[n]);return t},Mf=(e,t)=>{const n={};for(const s in e)(!Fo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Pf(e,t,n){const{props:s,children:o,component:r}=e,{props:l,children:i,patchFlag:a}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?wi(s,l,c):!!l;if(a&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const h=u[f];if(wc(l,s,h)&&!Xo(c,h))return!0}}}else return(o||i)&&(!i||!i.$stable)?!0:s===l?!1:s?l?wi(s,l,c):!0:!!l;return!1}function wi(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 r=s[o];if(wc(t,e,r)&&!Xo(n,r))return!0}return!1}function wc(e,t,n){const s=e[n],o=t[n];return n==="style"&&Me(s)&&Me(o)?!Ns(s,o):s!==o}function Nf({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 _c={},Sc=()=>Object.create(_c),xc=e=>Object.getPrototypeOf(e)===_c;function Of(e,t,n,s=!1){const o={},r=Sc();e.propsDefaults=Object.create(null),Cc(e,t,o,r);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);n?e.props=s?o:qd(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function Df(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:l}}=e,i=Te(o),[a]=e.propsOptions;let c=!1;if((s||l>0)&&!(l&16)){if(l&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let h=u[f];if(Xo(e.emitsOptions,h))continue;const p=t[h];if(a)if(Re(r,h))p!==r[h]&&(r[h]=p,c=!0);else{const g=gt(h);o[g]=Wr(a,i,g,p,e,!1)}else p!==r[h]&&(r[h]=p,c=!0)}}}else{Cc(e,t,o,r)&&(c=!0);let u;for(const f in i)(!t||!Re(t,f)&&((u=Sn(f))===f||!Re(t,u)))&&(a?n&&(n[f]!==void 0||n[u]!==void 0)&&(o[f]=Wr(a,i,f,void 0,e,!0)):delete o[f]);if(r!==i)for(const f in r)(!t||!Re(t,f))&&(delete r[f],c=!0)}c&&nn(e.attrs,"set","")}function Cc(e,t,n,s){const[o,r]=e.propsOptions;let l=!1,i;if(t)for(let a in t){if(ps(a))continue;const c=t[a];let u;o&&Re(o,u=gt(a))?!r||!r.includes(u)?n[u]=c:(i||(i={}))[u]=c:Xo(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,l=!0)}if(r){const a=Te(n),c=i||Oe;for(let u=0;u<r.length;u++){const f=r[u];n[f]=Wr(o,a,f,c[f],e,!Re(c,f))}}return l}function Wr(e,t,n,s,o,r){const l=e[n];if(l!=null){const i=Re(l,"default");if(i&&s===void 0){const a=l.default;if(l.type!==Function&&!l.skipFactory&&ge(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Ds(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}l[0]&&(r&&!i?s=!1:l[1]&&(s===""||s===Sn(n))&&(s=!0))}return s}const Bf=new WeakMap;function $c(e,t,n=!1){const s=n?Bf:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,l={},i=[];let a=!1;if(!ge(e)){const u=f=>{a=!0;const[h,p]=$c(f,t,!0);Ze(l,h),p&&i.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!r&&!a)return Me(e)&&s.set(e,qn),qn;if(fe(r))for(let u=0;u<r.length;u++){const f=gt(r[u]);_i(f)&&(l[f]=Oe)}else if(r)for(const u in r){const f=gt(u);if(_i(f)){const h=r[u],p=l[f]=fe(h)||ge(h)?{type:h}:Ze({},h),g=p.type;let w=!1,b=!0;if(fe(g))for(let k=0;k<g.length;++k){const S=g[k],$=ge(S)&&S.name;if($==="Boolean"){w=!0;break}else $==="String"&&(b=!1)}else w=ge(g)&&g.name==="Boolean";p[0]=w,p[1]=b,(w||Re(p,"default"))&&i.push(f)}}const c=[l,i];return Me(e)&&s.set(e,c),c}function _i(e){return e[0]!=="$"&&!ps(e)}const Tl=e=>e==="_"||e==="_ctx"||e==="$stable",Al=e=>fe(e)?e.map(Jt):[Jt(e)],Gf=(e,t,n)=>{if(t._n)return t;const s=kt((...o)=>Al(t(...o)),n);return s._c=!1,s},Tc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Tl(o))continue;const r=e[o];if(ge(r))t[o]=Gf(o,r,s);else if(r!=null){const l=Al(r);t[o]=()=>l}}},Ac=(e,t)=>{const n=Al(t);e.slots.default=()=>n},Rc=(e,t,n)=>{for(const s in t)(n||!Tl(s))&&(e[s]=t[s])},jf=(e,t,n)=>{const s=e.slots=Sc();if(e.vnode.shapeFlag&32){const o=t._;o?(Rc(s,t,n),n&&Ra(s,"_",o,!0)):Tc(t,s)}else t&&Ac(e,t)},Uf=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,l=Oe;if(s.shapeFlag&32){const i=t._;i?n&&i===1?r=!1:Rc(o,t,n):(r=!t.$stable,Tc(t,o)),l=t}else t&&(Ac(e,t),l={default:1});if(r)for(const i in o)!Tl(i)&&l[i]==null&&delete o[i]},ft=Vf;function Ff(e){return zf(e)}function zf(e,t){const n=Wo();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:l,createText:i,createComment:a,setText:c,setElementText:u,parentNode:f,nextSibling:h,setScopeId:p=Dt,insertStaticContent:g}=e,w=(m,_,E,j=null,D=null,B=null,Z=void 0,ee=null,V=!!_.dynamicChildren)=>{if(m===_)return;m&&!En(m,_)&&(j=zt(m),ke(m,D,B,!0),m=null),_.patchFlag===-2&&(V=!1,_.dynamicChildren=null);const{type:U,ref:ie,shapeFlag:se}=_;switch(U){case er:b(m,_,E,j);break;case it:k(m,_,E,j);break;case co:m==null&&S(_,E,j,Z);break;case Q:H(m,_,E,j,D,B,Z,ee,V);break;default:se&1?F(m,_,E,j,D,B,Z,ee,V):se&6?pe(m,_,E,j,D,B,Z,ee,V):(se&64||se&128)&&U.process(m,_,E,j,D,B,Z,ee,V,St)}ie!=null&&D?vs(ie,m&&m.ref,B,_||m,!_):ie==null&&m&&m.ref!=null&&vs(m.ref,null,B,m,!0)},b=(m,_,E,j)=>{if(m==null)s(_.el=i(_.children),E,j);else{const D=_.el=m.el;_.children!==m.children&&c(D,_.children)}},k=(m,_,E,j)=>{m==null?s(_.el=a(_.children||""),E,j):_.el=m.el},S=(m,_,E,j)=>{[m.el,m.anchor]=g(m.children,_,E,j,m.el,m.anchor)},$=({el:m,anchor:_},E,j)=>{let D;for(;m&&m!==_;)D=h(m),s(m,E,j),m=D;s(_,E,j)},T=({el:m,anchor:_})=>{let E;for(;m&&m!==_;)E=h(m),o(m),m=E;o(_)},F=(m,_,E,j,D,B,Z,ee,V)=>{if(_.type==="svg"?Z="svg":_.type==="math"&&(Z="mathml"),m==null)O(_,E,j,D,B,Z,ee,V);else{const U=m.el&&m.el._isVueCE?m.el:null;try{U&&U._beginPatch(),R(m,_,D,B,Z,ee,V)}finally{U&&U._endPatch()}}},O=(m,_,E,j,D,B,Z,ee)=>{let V,U;const{props:ie,shapeFlag:se,transition:ae,dirs:ce}=m;if(V=m.el=l(m.type,B,ie&&ie.is,ie),se&8?u(V,m.children):se&16&&A(m.children,V,null,j,D,wr(m,B),Z,ee),ce&&Cn(m,null,j,"created"),C(V,m,m.scopeId,Z,j),ie){for(const Ce in ie)Ce!=="value"&&!ps(Ce)&&r(V,Ce,null,ie[Ce],B,j);"value"in ie&&r(V,"value",null,ie.value,B),(U=ie.onVnodeBeforeMount)&&Ht(U,j,m)}ce&&Cn(m,null,j,"beforeMount");const be=Hf(D,ae);be&&ae.beforeEnter(V),s(V,_,E),((U=ie&&ie.onVnodeMounted)||be||ce)&&ft(()=>{try{U&&Ht(U,j,m),be&&ae.enter(V),ce&&Cn(m,null,j,"mounted")}finally{}},D)},C=(m,_,E,j,D)=>{if(E&&p(m,E),j)for(let B=0;B<j.length;B++)p(m,j[B]);if(D){let B=D.subTree;if(_===B||Lc(B.type)&&(B.ssContent===_||B.ssFallback===_)){const Z=D.vnode;C(m,Z,Z.scopeId,Z.slotScopeIds,D.parent)}}},A=(m,_,E,j,D,B,Z,ee,V=0)=>{for(let U=V;U<m.length;U++){const ie=m[U]=ee?tn(m[U]):Jt(m[U]);w(null,ie,_,E,j,D,B,Z,ee)}},R=(m,_,E,j,D,B,Z)=>{const ee=_.el=m.el;let{patchFlag:V,dynamicChildren:U,dirs:ie}=_;V|=m.patchFlag&16;const se=m.props||Oe,ae=_.props||Oe;let ce;if(E&&$n(E,!1),(ce=ae.onVnodeBeforeUpdate)&&Ht(ce,E,_,m),ie&&Cn(_,m,E,"beforeUpdate"),E&&$n(E,!0),U&&(!m.dynamicChildren||m.dynamicChildren.length!==U.length)&&(V=0,Z=!1,U=null),(se.innerHTML&&ae.innerHTML==null||se.textContent&&ae.textContent==null)&&u(ee,""),U?J(m.dynamicChildren,U,ee,E,j,wr(_,D),B):Z||ve(m,_,ee,null,E,j,wr(_,D),B,!1),V>0){if(V&16)oe(ee,se,ae,E,D);else if(V&2&&se.class!==ae.class&&r(ee,"class",null,ae.class,D),V&4&&r(ee,"style",se.style,ae.style,D),V&8){const be=_.dynamicProps;for(let Ce=0;Ce<be.length;Ce++){const Ae=be[Ce],Ve=se[Ae],He=ae[Ae];(He!==Ve||Ae==="value")&&r(ee,Ae,Ve,He,D,E)}}V&1&&m.children!==_.children&&u(ee,_.children)}else!Z&&U==null&&oe(ee,se,ae,E,D);((ce=ae.onVnodeUpdated)||ie)&&ft(()=>{ce&&Ht(ce,E,_,m),ie&&Cn(_,m,E,"updated")},j)},J=(m,_,E,j,D,B,Z)=>{for(let ee=0;ee<_.length;ee++){const V=m[ee],U=_[ee],ie=V.el&&(V.type===Q||!En(V,U)||V.shapeFlag&198)?f(V.el):E;w(V,U,ie,null,j,D,B,Z,!0)}},oe=(m,_,E,j,D)=>{if(_!==E){if(_!==Oe)for(const B in _)!ps(B)&&!(B in E)&&r(m,B,_[B],null,D,j);for(const B in E){if(ps(B))continue;const Z=E[B],ee=_[B];Z!==ee&&B!=="value"&&r(m,B,ee,Z,D,j)}"value"in E&&r(m,"value",_.value,E.value,D)}},H=(m,_,E,j,D,B,Z,ee,V)=>{const U=_.el=m?m.el:i(""),ie=_.anchor=m?m.anchor:i("");let{patchFlag:se,dynamicChildren:ae,slotScopeIds:ce}=_;ce&&(ee=ee?ee.concat(ce):ce),m==null?(s(U,E,j),s(ie,E,j),A(_.children||[],E,ie,D,B,Z,ee,V)):se>0&&se&64&&ae&&m.dynamicChildren&&m.dynamicChildren.length===ae.length?(J(m.dynamicChildren,ae,E,D,B,Z,ee),(_.key!=null||D&&_===D.subTree)&&Rl(m,_,!0)):ve(m,_,E,ie,D,B,Z,ee,V)},pe=(m,_,E,j,D,B,Z,ee,V)=>{_.slotScopeIds=ee,m==null?_.shapeFlag&512?D.ctx.activate(_,E,j,Z,V):P(_,E,j,D,B,Z,V):M(m,_,V)},P=(m,_,E,j,D,B,Z)=>{const ee=m.component=Qf(m,j,D);if(Yo(m)&&(ee.ctx.renderer=St),Xf(ee,!1,Z),ee.asyncDep){if(D&&D.registerDep(ee,X,Z),!m.el){const V=ee.subTree=K(it);k(null,V,_,E),m.placeholder=V.el}}else X(ee,m,_,E,D,B,Z)},M=(m,_,E)=>{const j=_.component=m.component;if(Pf(m,_,E))if(j.asyncDep&&!j.asyncResolved){le(j,_,E);return}else j.next=_,j.update();else _.el=m.el,j.vnode=_},X=(m,_,E,j,D,B,Z)=>{const ee=()=>{if(m.isMounted){let{next:se,bu:ae,u:ce,parent:be,vnode:Ce}=m;{const tt=Ec(m);if(tt){se&&(se.el=Ce.el,le(m,se,Z)),tt.asyncDep.then(()=>{ft(()=>{m.isUnmounted||U()},D)});return}}let Ae=se,Ve;$n(m,!1),se?(se.el=Ce.el,le(m,se,Z)):se=Ce,ae&&lo(ae),(Ve=se.props&&se.props.onVnodeBeforeUpdate)&&Ht(Ve,be,se,Ce),$n(m,!0);const He=ki(m),xt=m.subTree;m.subTree=He,w(xt,He,f(xt.el),zt(xt),m,D,B),se.el=He.el,Ae===null&&Nf(m,He.el),ce&&ft(ce,D),(Ve=se.props&&se.props.onVnodeUpdated)&&ft(()=>Ht(Ve,be,se,Ce),D)}else{let se;const{el:ae,props:ce}=_,{bm:be,m:Ce,parent:Ae,root:Ve,type:He}=m,xt=Kn(_);$n(m,!1),be&&lo(be),!xt&&(se=ce&&ce.onVnodeBeforeMount)&&Ht(se,Ae,_),$n(m,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(He,m.parent?m.parent.type:void 0);const tt=m.subTree=ki(m);w(null,tt,E,j,m,D,B),_.el=tt.el}if(Ce&&ft(Ce,D),!xt&&(se=ce&&ce.onVnodeMounted)){const tt=_;ft(()=>Ht(se,Ae,tt),D)}(_.shapeFlag&256||Ae&&Kn(Ae.vnode)&&Ae.vnode.shapeFlag&256)&&m.a&&ft(m.a,D),m.isMounted=!0,_=E=j=null}};m.scope.on();const V=m.effect=new Ma(ee);m.scope.off();const U=m.update=V.run.bind(V),ie=m.job=V.runIfDirty.bind(V);ie.i=m,ie.id=m.uid,V.scheduler=()=>xl(ie),$n(m,!0),U()},le=(m,_,E)=>{_.component=m;const j=m.vnode.props;m.vnode=_,m.next=null,Df(m,_.props,j,E),Uf(m,_.children,E),fn(),ci(m),hn()},ve=(m,_,E,j,D,B,Z,ee,V=!1)=>{const U=m&&m.children,ie=m?m.shapeFlag:0,se=_.children,{patchFlag:ae,shapeFlag:ce}=_;if(ae>0){if(ae&128){W(U,se,E,j,D,B,Z,ee,V);return}else if(ae&256){De(U,se,E,j,D,B,Z,ee,V);return}}ce&8?(ie&16&&Ot(U,D,B),se!==U&&u(E,se)):ie&16?ce&16?W(U,se,E,j,D,B,Z,ee,V):Ot(U,D,B,!0):(ie&8&&u(E,""),ce&16&&A(se,E,j,D,B,Z,ee,V))},De=(m,_,E,j,D,B,Z,ee,V)=>{m=m||qn,_=_||qn;const U=m.length,ie=_.length,se=Math.min(U,ie);let ae;for(ae=0;ae<se;ae++){const ce=_[ae]=V?tn(_[ae]):Jt(_[ae]);w(m[ae],ce,E,null,D,B,Z,ee,V)}U>ie?Ot(m,D,B,!0,!1,se):A(_,E,j,D,B,Z,ee,V,se)},W=(m,_,E,j,D,B,Z,ee,V)=>{let U=0;const ie=_.length;let se=m.length-1,ae=ie-1;for(;U<=se&&U<=ae;){const ce=m[U],be=_[U]=V?tn(_[U]):Jt(_[U]);if(En(ce,be))w(ce,be,E,null,D,B,Z,ee,V);else break;U++}for(;U<=se&&U<=ae;){const ce=m[se],be=_[ae]=V?tn(_[ae]):Jt(_[ae]);if(En(ce,be))w(ce,be,E,null,D,B,Z,ee,V);else break;se--,ae--}if(U>se){if(U<=ae){const ce=ae+1,be=ce<ie?_[ce].el:j;for(;U<=ae;)w(null,_[U]=V?tn(_[U]):Jt(_[U]),E,be,D,B,Z,ee,V),U++}}else if(U>ae)for(;U<=se;)ke(m[U],D,B,!0),U++;else{const ce=U,be=U,Ce=new Map;for(U=be;U<=ae;U++){const qe=_[U]=V?tn(_[U]):Jt(_[U]);qe.key!=null&&Ce.set(qe.key,U)}let Ae,Ve=0;const He=ae-be+1;let xt=!1,tt=0;const xn=new Array(He);for(U=0;U<He;U++)xn[U]=0;for(U=ce;U<=se;U++){const qe=m[U];if(Ve>=He){ke(qe,D,B,!0);continue}let Ct;if(qe.key!=null)Ct=Ce.get(qe.key);else for(Ae=be;Ae<=ae;Ae++)if(xn[Ae-be]===0&&En(qe,_[Ae])){Ct=Ae;break}Ct===void 0?ke(qe,D,B,!0):(xn[Ct-be]=U+1,Ct>=tt?tt=Ct:xt=!0,w(qe,_[Ct],E,null,D,B,Z,ee,V),Ve++)}const Fs=xt?qf(xn):qn;for(Ae=Fs.length-1,U=He-1;U>=0;U--){const qe=be+U,Ct=_[qe],zs=_[qe+1],Hs=qe+1<ie?zs.el||Ic(zs):j;xn[U]===0?w(null,Ct,E,Hs,D,B,Z,ee,V):xt&&(Ae<0||U!==Fs[Ae]?te(Ct,E,Hs,2):Ae--)}}},te=(m,_,E,j,D=null)=>{const{el:B,type:Z,transition:ee,children:V,shapeFlag:U}=m;if(U&6){te(m.component.subTree,_,E,j);return}if(U&128){m.suspense.move(_,E,j);return}if(U&64){Z.move(m,_,E,St);return}if(Z===Q){s(B,_,E);for(let se=0;se<V.length;se++)te(V[se],_,E,j);s(m.anchor,_,E);return}if(Z===co){$(m,_,E);return}if(j!==2&&U&1&&ee)if(j===0)ee.persisted&&!B[Et]?s(B,_,E):(ee.beforeEnter(B),s(B,_,E),ft(()=>ee.enter(B),D));else{const{leave:se,delayLeave:ae,afterLeave:ce}=ee,be=()=>{m.ctx.isUnmounted?o(B):s(B,_,E)},Ce=()=>{const Ae=B._isLeaving||!!B[Et];B._isLeaving&&B[Et](!0),ee.persisted&&!Ae?be():se(B,()=>{be(),ce&&ce()})};ae?ae(B,be,Ce):Ce()}else s(B,_,E)},ke=(m,_,E,j=!1,D=!1)=>{const{type:B,props:Z,ref:ee,children:V,dynamicChildren:U,shapeFlag:ie,patchFlag:se,dirs:ae,cacheIndex:ce,memo:be}=m;if(se===-2&&(D=!1),ee!=null&&(fn(),vs(ee,null,E,m,!0),hn()),ce!=null&&(_.renderCache[ce]=void 0),ie&256){_.ctx.deactivate(m);return}const Ce=ie&1&&ae,Ae=!Kn(m);let Ve;if(Ae&&(Ve=Z&&Z.onVnodeBeforeUnmount)&&Ht(Ve,_,m),ie&6)Qe(m.component,E,j);else{if(ie&128){m.suspense.unmount(E,j);return}Ce&&Cn(m,null,_,"beforeUnmount"),ie&64?m.type.remove(m,_,E,St,j):U&&!U.hasOnce&&(B!==Q||se>0&&se&64)?Ot(U,_,E,!1,!0):(B===Q&&se&384||!D&&ie&16)&&Ot(V,_,E),j&&xe(m)}const He=be!=null&&ce==null;(Ae&&(Ve=Z&&Z.onVnodeUnmounted)||Ce||He)&&ft(()=>{Ve&&Ht(Ve,_,m),Ce&&Cn(m,null,_,"unmounted"),He&&(m.el=null)},E)},xe=m=>{const{type:_,el:E,anchor:j,transition:D}=m;if(_===Q){Ft(E,j);return}if(_===co){T(m);return}const B=()=>{o(E),D&&!D.persisted&&D.afterLeave&&D.afterLeave()};if(m.shapeFlag&1&&D&&!D.persisted){const{leave:Z,delayLeave:ee}=D,V=()=>Z(E,B);ee?ee(m.el,B,V):V()}else B()},Ft=(m,_)=>{let E;for(;m!==_;)E=h(m),o(m),m=E;o(_)},Qe=(m,_,E)=>{const{bum:j,scope:D,job:B,subTree:Z,um:ee,m:V,a:U}=m;Si(V),Si(U),j&&lo(j),D.stop(),B&&(B.flags|=8,ke(Z,m,_,E)),ee&&ft(ee,_),ft(()=>{m.isUnmounted=!0},_)},Ot=(m,_,E,j=!1,D=!1,B=0)=>{for(let Z=B;Z<m.length;Z++)ke(m[Z],_,E,j,D)},zt=m=>{if(m.shapeFlag&6)return zt(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const _=h(m.anchor||m.el),E=_&&_[nc];return E?h(E):_};let vt=!1;const mn=(m,_,E)=>{let j;m==null?_._vnode&&(ke(_._vnode,null,null,!0),j=_._vnode.component):w(_._vnode||null,m,_,null,null,null,E),_._vnode=m,vt||(vt=!0,ci(j),Ja(),vt=!1)},St={p:w,um:ke,m:te,r:xe,mt:P,mc:A,pc:ve,pbc:J,n:zt,o:e};return{render:mn,hydrate:void 0,createApp:Af(mn)}}function wr({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 $n({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hf(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Rl(e,t,n=!1){const s=e.children,o=t.children;if(fe(s)&&fe(o))for(let r=0;r<s.length;r++){const l=s[r];let i=o[r];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=o[r]=tn(o[r]),i.el=l.el),!n&&i.patchFlag!==-2&&Rl(l,i)),i.type===er&&(i.patchFlag===-1&&(i=o[r]=tn(i)),i.el=l.el),i.type===it&&!i.el&&(i.el=l.el)}}function qf(e){const t=e.slice(),n=[0];let s,o,r,l,i;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(r=0,l=n.length-1;r<l;)i=r+l>>1,e[n[i]]<c?r=i+1:l=i;c<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,l=n[r-1];r-- >0;)n[r]=l,l=t[l];return n}function Ec(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ec(t)}function Si(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ic(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ic(t.subTree):null}const Lc=e=>e.__isSuspense;function Vf(e,t){t&&t.pendingBranch?fe(e)?t.effects.push(...e):t.effects.push(e):Ya(e)}const Q=Symbol.for("v-fgt"),er=Symbol.for("v-txt"),it=Symbol.for("v-cmt"),co=Symbol.for("v-stc"),dn=[];let wt=null;function v(e=!1){dn.push(wt=e?null:[])}function El(){dn.pop(),wt=dn[dn.length-1]||null}let Cs=1;function ko(e,t=!1){Cs+=e,e<0&&wt&&t&&(wt.hasOnce=!0)}function Mc(e){return e.dynamicChildren=Cs>0?wt||qn:null,El(),Cs>0&&wt&&wt.push(e),e}function y(e,t,n,s,o,r){return Mc(d(e,t,n,s,o,r,!0))}function Ue(e,t,n,s,o){return Mc(K(e,t,n,s,o,!0))}function $s(e){return e?e.__v_isVNode===!0:!1}function En(e,t){return e.type===t.type&&e.key===t.key}const Pc=({key:e})=>e??null,uo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Fe(e)||ut(e)||ge(e)?{i:st,r:e,k:t,f:!!n}:e:null);function d(e,t=null,n=null,s=0,o=null,r=e===Q?0:1,l=!1,i=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pc(t),ref:t&&uo(t),scopeId:Xa,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:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:st};return i?(wo(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=Fe(n)?8:16),Cs>0&&!l&&wt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&wt.push(a),a}const K=Wf;function Wf(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===pc)&&(e=it),$s(e)){const i=_n(e,t,!0);return n&&wo(i,n),Cs>0&&!r&&wt&&(i.shapeFlag&6?wt[wt.indexOf(e)]=i:wt.push(i)),i.patchFlag=-2,i}if(oh(e)&&(e=e.__vccOpts),t){t=Kf(t);let{class:i,style:a}=t;i&&!Fe(i)&&(t.class=de(i)),Me(a)&&(Sl(a)&&!fe(a)&&(a=Ze({},a)),t.style=cn(a))}const l=Fe(e)?1:Lc(e)?128:sc(e)?64:Me(e)?4:ge(e)?2:0;return d(e,t,n,s,o,l,r,!0)}function Kf(e){return e?Sl(e)||xc(e)?Ze({},e):e:null}function _n(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:l,children:i,transition:a}=e,c=t?Zf(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Pc(c),ref:t&&t.ref?n&&r?fe(r)?r.concat(uo(t)):[r,uo(t)]:uo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Q?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&_n(e.ssContent),ssFallback:e.ssFallback&&_n(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&On(u,a.clone(u)),u}function $e(e=" ",t=0){return K(er,null,e,t)}function N(e="",t=!1){return t?(v(),Ue(it,null,e)):K(it,null,e)}function Jt(e){return e==null||typeof e=="boolean"?K(it):fe(e)?K(Q,null,e.slice()):$s(e)?tn(e):K(er,null,String(e))}function tn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:_n(e)}function wo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(fe(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),wo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!xc(t)?t._ctx=st:o===3&&st&&(st.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ge(t)){if(s&65){wo(e,{default:t});return}t={default:t,_ctx:st},n=32}else t=String(t),s&64?(n=16,t=[$e(t)]):n=8;e.children=t,e.shapeFlag|=n}function Zf(...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=de([t.class,s.class]));else if(o==="style")t.style=cn([t.style,s.style]);else if(Uo(o)){const r=t[o],l=s[o];l&&r!==l&&!(fe(r)&&r.includes(l))?t[o]=r?[].concat(r,l):l:l==null&&r==null&&!Fo(o)&&(t[o]=l)}else o!==""&&(t[o]=s[o])}return t}function Ht(e,t,n,s=null){Pt(e,t,7,[n,s])}const Yf=bc();let Jf=0;function Qf(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Yf,r={uid:Jf++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $d(!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:$c(s,o),emitsOptions:kc(s,o),emit:null,emitted:null,propsDefaults:Oe,inheritAttrs:s.inheritAttrs,ctx:Oe,data:Oe,props:Oe,attrs:Oe,slots:Oe,refs:Oe,setupState:Oe,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 r.ctx={_:r},r.root=t?t.root:r,r.emit=Ef.bind(null,r),e.ce&&e.ce(r),r}let at=null;const tr=()=>at||st;let _o,Kr;{const e=Wo(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(l=>l(r)):o[0](r)}};_o=t("__VUE_INSTANCE_SETTERS__",n=>at=n),Kr=t("__VUE_SSR_SETTERS__",n=>Ts=n)}const Ds=e=>{const t=at;return _o(e),e.scope.on(),()=>{e.scope.off(),_o(t)}},xi=()=>{at&&at.scope.off(),_o(null)};function Nc(e){return e.vnode.shapeFlag&4}let Ts=!1;function Xf(e,t=!1,n=!1){t&&Kr(t);const{props:s,children:o}=e.vnode,r=Nc(e);Of(e,s,r,t),jf(e,o,n||t);const l=r?eh(e,t):void 0;return t&&Kr(!1),l}function eh(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wf);const{setup:s}=n;if(s){fn();const o=e.setupContext=s.length>1?nh(e):null,r=Ds(e),l=Os(s,e,0,[e.props,o]),i=$a(l);if(hn(),r(),(i||e.sp)&&!Kn(e)&&cc(e),i){if(l.then(xi,xi),t)return l.then(a=>{Ci(e,a)}).catch(a=>{Zo(a,e,0)});e.asyncDep=l}else Ci(e,l)}else Oc(e)}function Ci(e,t,n){ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Me(t)&&(e.setupState=Wa(t)),Oc(e)}function Oc(e,t,n){const s=e.type;e.render||(e.render=s.render||Dt);{const o=Ds(e);fn();try{_f(e)}finally{hn(),o()}}}const th={get(e,t){return lt(e,"get",""),e[t]}};function nh(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,th),slots:e.slots,emit:e.emit,expose:t}}function nr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Wa(Vd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ys)return ys[n](e)},has(t,n){return n in t||n in ys}})):e.proxy}function sh(e,t=!0){return ge(e)?e.displayName||e.name:e.name||t&&e.__name}function oh(e){return ge(e)&&"__vccOpts"in e}const Y=(e,t)=>Jd(e,t,Ts);function Ee(e,t,n){try{ko(-1);const s=arguments.length;return s===2?Me(t)&&!fe(t)?$s(t)?K(e,null,[t]):K(e,t):K(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&$s(n)&&(n=[n]),K(e,t,n))}finally{ko(1)}}const rh="3.5.40";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.40
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let Zr;const $i=typeof window<"u"&&window.trustedTypes;if($i)try{Zr=$i.createPolicy("vue",{createHTML:e=>e})}catch{}const Dc=Zr?e=>Zr.createHTML(e):e=>e,lh="http://www.w3.org/2000/svg",ih="http://www.w3.org/1998/Math/MathML",en=typeof document<"u"?document:null,Ti=en&&en.createElement("template"),ah={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"?en.createElementNS(lh,e):t==="mathml"?en.createElementNS(ih,e):n?en.createElement(e,{is:n}):en.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>en.createTextNode(e),createComment:e=>en.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>en.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const l=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Ti.innerHTML=Dc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const i=Ti.content;if(s==="svg"||s==="mathml"){const a=i.firstChild;for(;a.firstChild;)i.appendChild(a.firstChild);i.removeChild(a)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},vn="transition",rs="animation",Xn=Symbol("_vtc"),Bc={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},Gc=Ze({},rc,Bc),ch=e=>(e.displayName="Transition",e.props=Gc,e),sr=ch((e,{slots:t})=>Ee(uf,jc(e),t)),Tn=(e,t=[])=>{fe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ai=e=>e?fe(e)?e.some(t=>t.length>1):e.length>1:!1;function jc(e){const t={};for(const H in e)H in Bc||(t[H]=e[H]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:r=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:i=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:c=l,appearToClass:u=i,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,g=uh(o),w=g&&g[0],b=g&&g[1],{onBeforeEnter:k,onEnter:S,onEnterCancelled:$,onLeave:T,onLeaveCancelled:F,onBeforeAppear:O=k,onAppear:C=S,onAppearCancelled:A=$}=t,R=(H,pe,P,M)=>{H._enterCancelled=M,bn(H,pe?u:i),bn(H,pe?c:l),P&&P()},J=(H,pe)=>{H._isLeaving=!1,bn(H,f),bn(H,p),bn(H,h),pe&&pe()},oe=H=>(pe,P)=>{const M=H?C:S,X=()=>R(pe,H,P);Tn(M,[pe,X]),Ri(()=>{bn(pe,H?a:r),qt(pe,H?u:i),Ai(M)||Ei(pe,s,w,X)})};return Ze(t,{onBeforeEnter(H){Tn(k,[H]),qt(H,r),qt(H,l)},onBeforeAppear(H){Tn(O,[H]),qt(H,a),qt(H,c)},onEnter:oe(!1),onAppear:oe(!0),onLeave(H,pe){H._isLeaving=!0;const P=()=>J(H,pe);qt(H,f),H._enterCancelled?(qt(H,h),Yr(H)):(Yr(H),qt(H,h)),Ri(()=>{H._isLeaving&&(bn(H,f),qt(H,p),Ai(T)||Ei(H,s,b,P))}),Tn(T,[H,P])},onEnterCancelled(H){R(H,!1,void 0,!0),Tn($,[H])},onAppearCancelled(H){R(H,!0,void 0,!0),Tn(A,[H])},onLeaveCancelled(H){J(H),Tn(F,[H])}})}function uh(e){if(e==null)return null;if(Me(e))return[_r(e.enter),_r(e.leave)];{const t=_r(e);return[t,t]}}function _r(e){return md(e)}function qt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Xn]||(e[Xn]=new Set)).add(t)}function bn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Xn];n&&(n.delete(t),n.size||(e[Xn]=void 0))}function Ri(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let dh=0;function Ei(e,t,n,s){const o=e._endId=++dh,r=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:l,timeout:i,propCount:a}=Uc(e,t);if(!l)return s();const c=l+"end";let u=0;const f=()=>{e.removeEventListener(c,h),r()},h=p=>{p.target===e&&++u>=a&&f()};setTimeout(()=>{u<a&&f()},i+1),e.addEventListener(c,h)}function Uc(e,t){const n=window.getComputedStyle(e),s=g=>(n[g]||"").split(", "),o=s(`${vn}Delay`),r=s(`${vn}Duration`),l=Ii(o,r),i=s(`${rs}Delay`),a=s(`${rs}Duration`),c=Ii(i,a);let u=null,f=0,h=0;t===vn?l>0&&(u=vn,f=l,h=r.length):t===rs?c>0&&(u=rs,f=c,h=a.length):(f=Math.max(l,c),u=f>0?l>c?vn:rs:null,h=u?u===vn?r.length:a.length:0);const p=u===vn&&/\b(?:transform|all)(?:,|$)/.test(s(`${vn}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:p}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Li(n)+Li(e[s])))}function Li(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Yr(e){return(e?e.ownerDocument:document).body.offsetHeight}function fh(e,t,n){const s=e[Xn];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const So=Symbol("_vod"),Il=Symbol("_vsh"),Fc={name:"show",beforeMount(e,{value:t},{transition:n}){e[So]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ls(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),ls(e,!0),s.enter(e)):s.leave(e,()=>{ls(e,!1)}):ls(e,t))},beforeUnmount(e,{value:t}){ls(e,t)}};function ls(e,t){e.style.display=t?e[So]:"none",e[Il]=!t}const zc=Symbol("");function hh(e){const t=tr();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(r=>xo(r,o))},s=()=>{const o=e(t.proxy);t.ce?xo(t.ce,o):Jr(t.subTree,o),n(o)};dc(()=>{Ya(s)}),Nt(()=>{Ie(s,Dt,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Qo(()=>o.disconnect())})}function Jr(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Jr(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)xo(e.el,t);else if(e.type===Q)e.children.forEach(n=>Jr(n,t));else if(e.type===co){let{el:n,anchor:s}=e;for(;n&&(xo(n,t),n!==s);)n=n.nextSibling}}function xo(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const r=Cd(t[o]);n.setProperty(`--${o}`,r),s+=`--${o}: ${r};`}n[zc]=s}}const ph=/(?:^|;)\s*display\s*:/;function gh(e,t,n){const s=e.style,o=Fe(n);let r=!1;if(n&&!o){if(t)if(Fe(t))for(const l of t.split(";")){const i=l.slice(0,l.indexOf(":")).trim();n[i]==null&&fs(s,i,"")}else for(const l in t)n[l]==null&&fs(s,l,"");for(const l in n){l==="display"&&(r=!0);const i=n[l];i!=null?vh(e,l,!Fe(t)&&t?t[l]:void 0,i)||fs(s,l,i):fs(s,l,"")}}else if(o){if(t!==n){const l=s[zc];l&&(n+=";"+l),s.cssText=n,r=ph.test(n)}}else t&&e.removeAttribute("style");So in e&&(e[So]=r?s.display:"",e[Il]&&(s.display="none"))}const Mi=/\s*!important$/;function fs(e,t,n){if(fe(n))n.forEach(s=>fs(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=mh(e,t);Mi.test(n)?e.setProperty(Sn(s),n.replace(Mi,""),"important"):e[s]=n}}const Pi=["Webkit","Moz","ms"],Sr={};function mh(e,t){const n=Sr[t];if(n)return n;let s=gt(t);if(s!=="filter"&&s in e)return Sr[t]=s;s=qo(s);for(let o=0;o<Pi.length;o++){const r=Pi[o]+s;if(r in e)return Sr[t]=r}return t}function vh(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Fe(s)&&n===s}const Ni="http://www.w3.org/1999/xlink";function Oi(e,t,n,s,o,r=_d(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ni,t.slice(6,t.length)):e.setAttributeNS(Ni,t,n):n==null||r&&!Ea(n)?e.removeAttribute(t):e.setAttribute(t,r?"":Gt(n)?String(n):n)}function Di(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Dc(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const i=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(i!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let l=!1;if(n===""||n==null){const i=typeof e[t];i==="boolean"?n=Ea(n):n==null&&i==="string"?(n="",l=!0):i==="number"&&(n=0,l=!0)}try{e[t]=n}catch{}l&&e.removeAttribute(o||t)}function In(e,t,n,s){e.addEventListener(t,n,s)}function yh(e,t,n,s){e.removeEventListener(t,n,s)}const Bi=Symbol("_vei");function bh(e,t,n,s,o=null){const r=e[Bi]||(e[Bi]={}),l=r[t];if(s&&l)l.value=s;else{const[i,a]=_h(t);if(s){const c=r[t]=Ch(s,o);In(e,i,c,a)}else l&&(yh(e,i,l,a),r[t]=void 0)}}const kh=/(Once|Passive|Capture)$/,wh=/^on:?(?:Once|Passive|Capture)$/;function _h(e){let t,n;for(;(n=e.match(kh))&&!wh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Sn(e.slice(2)),t]}let xr=0;const Sh=Promise.resolve(),xh=()=>xr||(Sh.then(()=>xr=0),xr=Date.now());function Ch(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(fe(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const l=o.slice(),i=[s];for(let a=0;a<l.length&&!s._stopped;a++){const c=l[a];c&&Pt(c,t,5,i)}}else Pt(o,t,5,[s])};return n.value=e,n.attached=xh(),n}const Gi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$h=(e,t,n,s,o,r)=>{const l=o==="svg";t==="class"?fh(e,s,l):t==="style"?gh(e,n,s):Uo(t)?Fo(t)||bh(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Th(e,t,s,l))?(Di(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Oi(e,t,s,l,r,t!=="value")):e._isVueCE&&(Ah(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Fe(s)))?Di(e,gt(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Oi(e,t,s,l))};function Th(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Gi(t)&&ge(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 Gi(t)&&Fe(n)?!1:t in e}function Ah(e,t){const n=e._def.props;if(!n)return!1;const s=gt(t);return Array.isArray(n)?n.some(o=>gt(o)===s):Object.keys(n).some(o=>gt(o)===s)}const Hc=new WeakMap,qc=new WeakMap,Co=Symbol("_moveCb"),ji=Symbol("_enterCb"),Rh=e=>(delete e.props.mode,e),Eh=Rh({name:"TransitionGroup",props:Ze({},Gc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=tr(),s=oc();let o,r;return fc(()=>{if(!o.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!Nh(o[0].el,n.vnode.el,l)){o=[];return}o.forEach(Lh),o.forEach(Mh);const i=o.filter(Ph);Yr(n.vnode.el),i.forEach(a=>{const c=a.el,u=c.style;qt(c,l),u.transform=u.webkitTransform=u.transitionDuration="";const f=c[Co]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",f),c[Co]=null,bn(c,l))};c.addEventListener("transitionend",f)}),o=[]}),()=>{const l=Te(e),i=jc(l);let a=l.tag||Q;if(o=[],r)for(let c=0;c<r.length;c++){const u=r[c];u.el&&u.el instanceof Element&&!u.el[Il]&&(o.push(u),On(u,xs(u,i,s,n)),Hc.set(u,Vc(u.el)))}r=t.default?$l(t.default()):[];for(let c=0;c<r.length;c++){const u=r[c];u.key!=null&&On(u,xs(u,i,s,n))}return K(a,null,r)}}}),Ih=Eh;function Lh(e){const t=e.el;t[Co]&&t[Co](),t[ji]&&t[ji]()}function Mh(e){qc.set(e,Vc(e.el))}function Ph(e){const t=Hc.get(e),n=qc.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const r=e.el,l=r.style,i=r.getBoundingClientRect();let a=1,c=1;return r.offsetWidth&&(a=i.width/r.offsetWidth),r.offsetHeight&&(c=i.height/r.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),l.transform=l.webkitTransform=`translate(${s/a}px,${o/c}px)`,l.transitionDuration="0s",e}}function Vc(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Nh(e,t,n){const s=e.cloneNode(),o=e[Xn];o&&o.forEach(i=>{i.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(i=>i&&s.classList.add(i)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:l}=Uc(s);return r.removeChild(s),l}const $o=e=>{const t=e.props["onUpdate:modelValue"]||!1;return fe(t)?n=>lo(t,n):t};function Oh(e){e.target.composing=!0}function Ui(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Yn=Symbol("_assign");function Fi(e,t,n){return t&&(e=e.trim()),n&&(e=Vo(e)),e}const rt={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Yn]=$o(o);const r=s||o.props&&o.props.type==="number";In(e,t?"change":"input",l=>{l.target.composing||e[Yn](Fi(e.value,n,r))}),(n||r)&&In(e,"change",()=>{e.value=Fi(e.value,n,r)}),t||(In(e,"compositionstart",Oh),In(e,"compositionend",Ui),In(e,"change",Ui))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},l){if(e[Yn]=$o(l),e.composing)return;const i=(r||e.type==="number")&&!/^0\d/.test(e.value)?Vo(e.value):e.value,a=t??"";if(i===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},zi={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,In(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Vo(To(r)):To(r));e[Yn](e.multiple?zo(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,It(()=>{e._assigning=!1})}),e[Yn]=$o(s)},mounted(e,{value:t}){Hi(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Yn]=$o(n)},updated(e,{value:t}){e._assigning||Hi(e,t)}};function Hi(e,t){const n=e.multiple,s=fe(t);if(!(n&&!s&&!zo(t))){for(let o=0,r=e.options.length;o<r;o++){const l=e.options[o],i=To(l);if(n)if(s){const a=typeof i;a==="string"||a==="number"?l.selected=t.some(c=>String(c)===String(i)):l.selected=xd(t,i)>-1}else l.selected=t.has(i);else if(Ns(To(l),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function To(e){return"_value"in e?e._value:e.value}const Dh=["ctrl","shift","alt","meta"],Bh={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)=>Dh.some(n=>e[`${n}Key`]&&!t.includes(n))},_t=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let l=0;l<t.length;l++){const i=Bh[t[l]];if(i&&i(o,t))return}return e(o,...r)}))},Gh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},As=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const r=Sn(o.key);if(t.some(l=>l===r||Gh[l]===r))return e(o)}))},jh=Ze({patchProp:$h},ah);let qi;function Uh(){return qi||(qi=Ff(jh))}const Fh=((...e)=>{const t=Uh().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Hh(s);if(!o)return;const r=t._component;!ge(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const l=n(o,!1,zh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t});function zh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hh(e){return Fe(e)?document.querySelector(e):e}function Qs(e,t,n,s){return e===n&&t===s}function qh(e){return e.currentSessionId===e.targetSessionId&&e.snapshot.sessionId===e.targetSessionId&&e.currentSessionGeneration===e.targetSessionGeneration&&e.currentConnectionGeneration===e.targetConnectionGeneration&&e.currentPromptGeneration===e.targetPromptGeneration&&e.currentLiveGeneration===e.targetLiveGeneration&&(e.currentEpoch===0||e.snapshot.epoch===e.currentEpoch)&&(e.snapshot.epoch!==e.currentEpoch||e.snapshot.seq>=e.currentSeq)}function Vh(e){return{objective:e.objective,completionCriterion:e.completionCriterion,replace:e.replace,budgets:e.budgets}}function Wh(e){return{objective:e.objective,budgets:e.budgets}}function Kh(e,t,n){return e!==0&&n.epoch!==e?"resync":n.seq<=t?"duplicate":"apply"}function Zh(e,t){return t.type==="goal.updated"?{...e,goal:t.snapshot}:t.type==="todo.updated"?{...e,todos:t.todos}:e}function Yh(e){const t=[],n=new Map;for(const s of e){const o=s.phase??null;let r=n.get(o);r===void 0&&(r=t.length,n.set(o,r),t.push({phase:o,items:[]})),t[r].items.push(s)}return t}const Rs=G([]);let Jh=0;function Qh(e,t="info",n=3500){const s=`toast_${++Jh}`;Rs.value=[...Rs.value,{id:s,type:t,message:e}],n>0&&window.setTimeout(()=>Wc(s),n)}function Wc(e){Rs.value=Rs.value.filter(t=>t.id!==e)}function Kc(){return{toasts:Rs,showToast:Qh,removeToast:Wc}}function Xh(e){let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},flushNow:()=>{t!==null&&(cancelAnimationFrame(t),t=null),e()},dispose:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}}const yt="/api/v1",ep=2*3e4;function tp(){const{showToast:e}=Kc(),t=G("connecting"),n=G([]),s=G(!1),o=G(void 0),r=G([]),l=G({busy:!1}),i=G(null),a=G([]),c=G(!1),u=G(null),f=G(!1),h=G(null),p=G(null),g=G(null),w=Y(()=>l.value.busy||f.value),b=G([]),k=G(null),S=G(!1),$=Y(()=>p.value!==null&&!S.value),T=G(null),F=G([]);let O=null,C=null,A=null,R=null,J=Date.now(),oe=0,H=0,pe=0,P=0,M=0,X=0,le=0,ve=0,De=0,W=null,te=!1,ke=null,xe=!1,Ft=!1;const Qe=new Map;let Ot=0,zt=0,vt=null,mn=0;const St=new Map;function Us(){const z=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws`;return k.value?`${z}?sessionId=${encodeURIComponent(k.value)}`:z}function m(x){t.value=x}function _(x){(O==null?void 0:O.readyState)===WebSocket.OPEN&&O.send(JSON.stringify(x))}function E(){c.value=te||W!==null}function j(){De++,W=null,te=!1,ke=null,c.value=!1,u.value=null}function D(x,z){if(x!==null&&typeof x=="object"){const ue=x.message;if(typeof ue=="string")return ue}return z}function B(){Ft||R!==null||(R=window.setTimeout(()=>{R=null;const x=ke;ke=null,Z(x??void 0)},250))}async function Z(x){const z=p.value;if(!z)return;const ue=n.value.length===0?100:void 0,re=P,ye=M,we=X,Be=le;try{const je=await fetch(`${yt}/sessions/${z}/snapshot${ue?`?tail=${ue}`:""}`);if(!je.ok){x!==void 0&&(W==null?void 0:W.generation)===x&&(ke=x,B());return}const $t=await je.json();if(!qh({snapshot:$t,targetSessionId:z,currentSessionId:p.value,targetSessionGeneration:re,currentSessionGeneration:P,targetConnectionGeneration:ye,currentConnectionGeneration:M,targetPromptGeneration:we,currentPromptGeneration:X,targetLiveGeneration:Be,currentLiveGeneration:le,currentEpoch:H,currentSeq:oe})){x!==void 0&&(ke=x),B();return}ee($t,x)}catch{x!==void 0&&(W==null?void 0:W.generation)===x&&(ke=x,B())}}function ee(x,z){var oi;ce="",be="",Ce.clear();const ue=n.value.filter(Tt=>Tt.local),re=Qe.keys().next().value,ye=re?Qe.get(re):void 0,we=ye?n.value.find(Tt=>Tt.id===ye.messageId):void 0,Be=!!(re&&x.messages.some(Tt=>Tt.clientMessageId===re)),je=!!(ye&&!Be&&ye.connectionGeneration<M);je&&we&&(we.isError=!0);const $t=we&&!Be?[we]:[];n.value=[...x.messages.map(Tt=>({...Tt,id:Tt.id??V()})),...ue,...$t];for(let Tt=n.value.length-1;Tt>=0;Tt--){const Ws=(oi=n.value[Tt])==null?void 0:oi.turnStats;if(Ws&&typeof Ws.turn=="number"&&Ws.turn>0){Ot=Ws.turn;break}}r.value=x.pendingApprovals,l.value={...x.status,busy:x.busy},s.value=!!x.olderAvailable,o.value=x.oldestSeq,i.value=x.goal,a.value=x.todos,z!==void 0&&W!==null&&W.generation===z&&De===z&&(W=null,E()),(Be||je)&&(f.value=!1,xe=!1,Qe.clear(),je&&e("消息未送达,已恢复连接。","error")),oe=x.seq,H=x.epoch,g.value=x.workDir}function V(){return`msg_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function U(x){ie(),J=Date.now(),C=window.setInterval(()=>{if(Date.now()-J>ep){O==null||O.close();return}_({type:"ping"})},x)}function ie(){C!==null&&(clearInterval(C),C=null)}function se(){if(Ft||A!==null)return;m("reconnecting"),pe++;const x=Math.min(1e3*2**pe,3e4);A=window.setTimeout(()=>{A=null,qe()},x)}function ae(x){switch(x.type){case"server_hello":{const z=x;p.value=z.sessionId,g.value=z.workDir,k.value=z.sessionId,S.value=z.active;const ue=H;H=z.epoch,U(z.heartbeat_ms),_({type:"client_hello",lastSeq:oe,epoch:ue}),ue!==0&&ue!==z.epoch&&(oe=0),m("connected"),pe=0,z.active?(Z(),jn(),qs()):Yu(z.sessionId).then(re=>{re&&p.value===z.sessionId&&(S.value=!0),Z(),jn(),qs()});break}case"event":{const z=Kh(H,oe,x);if(z==="resync"){H=x.epoch,oe=0,Z();break}if(z==="duplicate")break;oe=x.seq,H=x.epoch,le++,xt(x.payload);break}case"user_message":{if(le++,x.clientMessageId&&Qe.has(x.clientMessageId)){xe=!0;break}n.value.push({id:V(),role:"user",content:x.text,clientMessageId:x.clientMessageId,tools:[],ts:Date.now()});break}case"approval_request":{le++,r.value=[...r.value,{id:x.id,toolName:x.toolName,action:x.action,display:x.display}];break}case"approval_resolved":{le++,r.value=r.value.filter(z=>z.id!==x.id);break}case"command_result":{const z=x.pendingMsgId?n.value.findIndex(ue=>ue.id===x.pendingMsgId):-1;if(z>=0){const ue=n.value[z];n.value[z]={...ue,content:x.message,isError:!x.ok,pending:!1}}else n.value.push({id:V(),role:"system",content:x.message,tools:[],isError:!x.ok,ts:Date.now(),local:!0});(x.command==="fork"||x.command==="title")&&jn(),x.ok&&x.command==="compact"&&Z();break}case"resync_required":{oe=0,Z();break}case"status":{le++,l.value={...l.value,...x.status};break}case"error":{if(h.value=x.message,x.clientMessageId){const z=Qe.get(x.clientMessageId);if(z){Qe.delete(x.clientMessageId),f.value=!1,xe=!1;const ue=n.value.find(re=>re.id===z.messageId);ue&&(ue.isError=!0),e(`消息未发送:${x.message}`,"error")}}break}case"server_empty":{m("idle");break}}}let ce="",be="";const Ce=new Map;let Ae=!1;function Ve(){if(Ae)return;const x=tt();if(!x){ce="",be="",Ce.clear();return}if(ce&&(x.content+=ce,ce=""),be){const z=x.tools.find(ue=>ue.name==="thinking");z?z.output=(z.output??"")+be:x.tools.push({toolCallId:"thinking",name:"thinking",output:be}),be=""}if(Ce.size>0){for(const[z,ue]of Ce){const re=x.tools.find(ye=>ye.toolCallId===z);re&&(re.output=ue)}Ce.clear()}}const He=Xh(Ve);function xt(x){var ue;const z=Zh({goal:i.value,todos:a.value},x);switch(i.value=z.goal,a.value=z.todos,x.type==="goal.updated"&&W!==null&&W.generation===De&&(W=null,ke=null,E()),x.type){case"turn.started":{xe&&(f.value=!1,xe=!1,Qe.clear()),He.flushNow(),l.value={...l.value,busy:!0},Ot+=1,zt=Date.now(),vt=null,mn=0,St.clear(),n.value.push({id:V(),role:"assistant",content:"",tools:[],ts:Date.now(),model:l.value.model,turnStats:{turn:Ot,step:0,status:"running",firstTokenMs:null,llmMs:0,toolMs:0,tokens:null,tokensPerSec:null}});break}case"assistant.delta":{vt===null&&(vt=Date.now()),ce+=String(x.delta),He.schedule();break}case"thinking.delta":{vt===null&&(vt=Date.now()),be+=String(x.delta),He.schedule();break}case"tool.call.started":{const re=tt();re&&(re.tools.push({toolCallId:String(x.toolCallId),name:String(x.name),args:x.args}),re.turnStats&&(re.turnStats.step+=1)),St.set(String(x.toolCallId),Date.now());break}case"tool.result":{Ce.delete(String(x.toolCallId));const re=St.get(String(x.toolCallId));re!==void 0&&(mn+=Date.now()-re,St.delete(String(x.toolCallId)));const ye=tt();if(ye){const we=ye.tools.find(Be=>Be.toolCallId===x.toolCallId);we&&(we.output=String(x.output),we.isError=!!x.isError)}break}case"tool.progress":{Ce.set(String(x.toolCallId),String(x.message??x.output)),He.schedule();break}case"turn.ended":{if(He.flushNow(),l.value={...l.value,busy:!1},x.reason==="failed"){const je=tt();je&&(je.isError=!0),h.value=D(x.error,"Turn failed")}const re=tt(),ye=Date.now()-zt,we=(ue=l.value.usage)==null?void 0:ue.currentTurn,Be=we?we.inputOther+we.output+we.inputCacheRead+we.inputCacheCreation:null;re&&re.turnStats&&(re.turnStats.status="done",re.turnStats.llmMs=ye,re.turnStats.toolMs=mn,re.turnStats.firstTokenMs=vt!==null?vt-zt:null,re.turnStats.tokens=Be,re.turnStats.tokensPerSec=Be!==null&&ye>0?Math.round(Be/ye*1e3):null),jn(),qs();break}case"session.meta.updated":{const re={};x.model!==void 0&&(re.model=x.model),x.contextTokens!==void 0&&(re.contextTokens=x.contextTokens),x.maxContextTokens!==void 0&&(re.maxContextTokens=x.maxContextTokens),x.contextUsage!==void 0&&(re.contextUsage=x.contextUsage),l.value={...l.value,...re};break}case"agent.status.updated":{const re={};if(x.model!==void 0&&(re.model=x.model),x.thinkingLevel!==void 0&&(re.thinkingLevel=x.thinkingLevel),x.contextTokens!==void 0&&(re.contextTokens=x.contextTokens),x.maxContextTokens!==void 0&&(re.maxContextTokens=x.maxContextTokens),x.contextUsage!==void 0&&(re.contextUsage=x.contextUsage),x.usage!==void 0){re.usage=x.usage;const ye=x.usage;if(ye!=null&&ye.currentTurn){const we=tt(),Be=ye.currentTurn.inputOther+ye.currentTurn.output+ye.currentTurn.inputCacheRead+ye.currentTurn.inputCacheCreation;we!=null&&we.turnStats&&we.turnStats.status==="done"&&we.turnStats.tokens===null&&(we.turnStats.tokens=Be,we.turnStats.tokensPerSec=we.turnStats.llmMs?Math.round(Be/we.turnStats.llmMs*1e3):null)}}l.value={...l.value,...re};break}case"error":{h.value=D(x.error,"Unknown error");break}}}function tt(){for(let x=n.value.length-1;x>=0;x--)if(n.value[x].role==="assistant")return n.value[x];return null}function xn(){if(!Ft){if(A!==null&&(clearTimeout(A),A=null),O!==null){try{O.close()}catch{}O=null}pe=0,qe()}}async function Fs(){var ue;const x=p.value,z=o.value;if(!x||z===void 0)return 0;try{const re=await fetch(`${yt}/sessions/${x}/messages?before=${z}&tail=50`);if(!re.ok)return 0;const ye=await re.json();if(ye.messages.length===0)return 0;const we=ye.messages.map(Be=>({...Be,id:Be.id??V()}));return n.value=[...we,...n.value],o.value=((ue=we[0])==null?void 0:ue.seq)??z,s.value=ye.hasMore,we.length}catch{return 0}}function qe(){if(Ft||O&&(O.readyState===WebSocket.CONNECTING||O.readyState===WebSocket.OPEN))return;m("connecting"),h.value=null,j(),M++;const x=new WebSocket(Us());O=x,x.onclose=z=>{if(O===x&&(O=null,ie(),t.value!=="idle")){if(z.code===1008){P++,j(),p.value=null,k.value=null,S.value=!1,i.value=null,a.value=[],m("idle");return}m("disconnected"),se()}},x.onerror=()=>{O===x&&m("reconnecting")},x.onmessage=z=>{if(O!==x)return;J=Date.now();let ue;try{ue=JSON.parse(z.data)}catch{return}ae(ue)}}function Ct(x){if(!x||w.value)return;if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,正在尝试重连...","error"),qe();return}const z=`client_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,ue=V();Qe.set(z,{messageId:ue,connectionGeneration:M}),X++,xe=!1,f.value=!0,n.value.push({id:ue,role:"user",content:x,clientMessageId:z,tools:[],ts:Date.now()}),_({type:"prompt",text:x,clientMessageId:z})}function zs(){_({type:"abort"})}function Hs(x,z){if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,命令未发送。","error"),qe();return}if(w.value&&x!=="btw"){e(`会话忙碌中,无法执行 /${x},请稍后再试。`,"warning");return}const ue=["compact","plan","auto","yes","fork","title"];let re=null;ue.includes(x)&&(re=V(),n.value.push({id:re,role:"system",content:`正在执行 /${x}${z?` ${z}`:""}...`,tools:[],pending:!0,ts:Date.now(),local:!0})),_({type:"command",command:x,...z?{args:z}:{},...re?{pendingMsgId:re}:{}})}function Ku(){n.value=[],r.value=[]}function Xl(x){n.value.push({id:V(),role:"system",content:x,tools:[],ts:Date.now(),local:!0})}function Zu(x,z,ue,re){if(t.value!=="connected"){e("连接已断开,审批结果未发送。","error"),qe();return}r.value=r.value.filter(ye=>ye.id!==x),_({type:"approval_response",id:x,decision:z,...ue?{feedback:ue}:{},...re?{scope:re}:{}})}async function jn(){try{const x=await fetch(`${yt}/sessions`);if(!x.ok)return;b.value=await x.json()}catch{}}async function Yu(x){const z=P,ue=M;try{return(await fetch(`${yt}/sessions/${x}/activate`,{method:"POST"})).ok&&M===ue&&Qs(p.value,P,x,z)}catch{return!1}}async function qs(){try{const x=await fetch(`${yt}/git/status`);if(!x.ok)return;const z=await x.json();T.value=z.isRepo?z:null}catch{}}async function ei(){try{const x=await fetch(`${yt}/models`);if(!x.ok)return;const z=await x.json();F.value=z.models}catch{}}const dr=G({});async function Ju(){try{const x=await fetch(`${yt}/like`);if(!x.ok)return;dr.value=await x.json()}catch{}}async function Qu(x){try{return(await fetch(`${yt}/like`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)})).ok?(dr.value=x,!0):!1}catch{return!1}}async function ti(x,z,ue){const re=p.value;if(!re)return;const ye=P,we=M,Be=++ve;try{const je=await fetch(`${yt}/sessions/${re}/${x}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)}),$t=await je.json();if(p.value!==re||P!==ye||M!==we||ve!==Be)return;if(!je.ok){e($t.message??`请求失败(HTTP ${je.status})`,"error");return}$t.status&&(l.value={...l.value,...$t.status}),Xl(ue)}catch(je){if(p.value!==re||P!==ye||M!==we||ve!==Be)return;e(`请求失败:${je instanceof Error?je.message:String(je)}`,"error")}}async function Xu(x){x!==l.value.model&&await ti("model",{model:x},`已切换模型:${x}`)}async function ed(x){x!==l.value.thinkingLevel&&await ti("thinking",{level:x},`思考强度已切换为 ${x}`)}async function Vs(x,z,ue,re){const ye=p.value;if(!ye)return u.value="暂无可操作的会话。",null;if(t.value!=="connected")return u.value="连接已断开,请等待重连后再试。",null;if($.value)return u.value="当前会话已归档,无法修改 Goal。",null;if(te)return u.value="正在处理上一个请求,请稍候。",null;W!==null&&(W=null,E());const we=P,Be=++De;te=!0,E(),u.value=null;try{const je=await fetch(`${yt}/sessions/${ye}/goal${x}`,{method:z,headers:{"Content-Type":"application/json"},body:JSON.stringify(ue)}),$t=await je.json().catch(()=>({}));return!Qs(p.value,P,ye,we)||De!==Be?null:je.ok?(re&&(W={generation:Be},ke=Be),$t):(u.value=typeof $t.message=="string"?$t.message:`请求失败(HTTP ${je.status})`,null)}catch(je){return Qs(p.value,P,ye,we)&&De===Be&&(u.value=`请求失败:${je instanceof Error?je.message:String(je)}`),null}finally{Qs(p.value,P,ye,we)&&De===Be&&(te=!1,E())}}async function td(x){const z=await Vs("/refine","POST",{description:x},!1);return typeof(z==null?void 0:z.objective)=="string"?z.objective:null}async function nd(x){return await Vs("","POST",Vh(x),!0)===null?!1:(W!==null&&Z(W.generation),!0)}async function sd(x){return await Vs("","PATCH",Wh(x),!0)===null?!1:(W!==null&&Z(W.generation),!0)}async function fr(x){return await Vs(x,"POST",{},!0)===null?!1:(W!==null&&Z(W.generation),!0)}function od(){return fr("/pause")}function rd(){return fr("/resume")}function ld(){return fr("/cancel")}async function id(){try{const x=await fetch(`${yt}/sessions`,{method:"POST"});if(!x.ok){e(`新建会话失败(HTTP ${x.status})`,"error");return}const z=await x.json();b.value=[z,...b.value],await hr(z.sessionId)}catch(x){e(`新建会话失败:${x instanceof Error?x.message:String(x)}`,"error")}}async function hr(x){k.value===x&&t.value==="connected"||(k.value=x,p.value=x,P++,j(),oe=0,H=0,n.value=[],r.value=[],l.value={busy:!1},i.value=null,a.value=[],S.value=!1,f.value=!1,xe=!1,Qe.clear(),A!==null&&(clearTimeout(A),A=null),R!==null&&(clearTimeout(R),R=null),O&&(O.onclose=null,O.close(),O=null),ie(),qe())}async function ad(x){try{const z=await fetch(`${yt}/sessions/${x}`,{method:"DELETE"});if(!z.ok){e(`删除会话失败(HTTP ${z.status})`,"error");return}if(b.value=b.value.filter(ue=>ue.sessionId!==x),k.value===x){const ue=b.value[0];ue?await hr(ue.sessionId):(P++,j(),p.value=null,k.value=null,S.value=!1,oe=0,H=0,n.value=[],r.value=[],l.value={busy:!1},i.value=null,a.value=[],f.value=!1,xe=!1,Qe.clear(),O&&(O.onclose=null,O.close(),O=null),ie(),m("idle"))}}catch(z){e(`删除会话失败:${z instanceof Error?z.message:String(z)}`,"error")}}async function cd(x){try{const z=await fetch(`${yt}/sessions/${x}/export`);if(!z.ok){e(`导出会话失败(HTTP ${z.status})`,"error");return}const ue=await z.blob(),re=URL.createObjectURL(ue),ye=document.createElement("a");ye.href=re,ye.download=`${x}.md`,ye.click(),URL.revokeObjectURL(re)}catch(z){e(`导出会话失败:${z instanceof Error?z.message:String(z)}`,"error")}}qe(),jn(),ei();const ni=()=>{qe()},si=()=>{!document.hidden&&t.value!=="connected"&&qe()};return window.addEventListener("online",ni),document.addEventListener("visibilitychange",si),Ut(()=>{Ft=!0,Ae=!0,He.dispose(),window.removeEventListener("online",ni),document.removeEventListener("visibilitychange",si),ie(),A!==null&&(clearTimeout(A),A=null),R!==null&&(clearTimeout(R),R=null),O&&(O.onclose=null,O.close(),O=null)}),{connectionStatus:t,messages:n,pendingApprovals:r,status:l,goal:i,todos:a,goalRequestPending:c,goalRequestError:u,error:h,sessionId:p,workDir:g,isBusy:w,isArchived:$,sessions:b,currentSessionId:k,gitStatus:T,models:F,like:dr,fetchLike:Ju,updateLike:Qu,sendPrompt:Ct,sendCommand:Hs,clearMessages:Ku,appendSystemMessage:Xl,abort:zs,resolveApproval:Zu,fetchSessions:jn,fetchGitStatus:qs,fetchModels:ei,reconnectNow:xn,olderAvailable:s,oldestSeq:o,loadOlderMessages:Fs,switchModel:Xu,switchThinking:ed,refineGoal:td,createGoal:nd,updateGoal:sd,pauseGoal:od,resumeGoal:rd,cancelGoal:ld,createSession:id,switchSession:hr,deleteSession:ad,exportSession:cd,fetchSnapshot:Z}}const or=[{name:"compact",description:"压缩会话上下文",target:"backend"},{name:"model",description:"切换模型 / 思考强度",target:"local"},{name:"clear",description:"清空本地消息列表",target:"local"},{name:"new",description:"新建会话",target:"local"},{name:"help",description:"显示可用命令",target:"local"},{name:"auto",description:"切换为 auto 权限模式",target:"backend"},{name:"yes",description:"切换为 yolo 权限模式",target:"backend",aliases:["yolo"]},{name:"plan",description:"切换计划模式",target:"backend"},{name:"fork",description:"复制当前会话为新分支",target:"backend"},{name:"title",description:"重命名当前会话",target:"backend",aliases:["rename"],acceptsInput:!0},{name:"status",description:"查看会话状态",target:"local"},{name:"usage",description:"查看 Token 用量",target:"local"},{name:"btw",description:"快速侧问(不打断当前回合)",target:"backend",acceptsInput:!0}];function np(e){const t=e.toLowerCase();return or.filter(n=>{var s;return n.name.startsWith(t)||((s=n.aliases)==null?void 0:s.some(o=>o.startsWith(t)))})}function sp(e){const t=e.toLowerCase(),n=or.find(s=>{var o;return s.name===t||((o=s.aliases)==null?void 0:o.includes(t))});return(n==null?void 0:n.name)??t}function Zc(){return["可用命令:",...or.map(t=>{var s;return`${(s=t.aliases)!=null&&s.length?[t.name,...t.aliases].map(o=>`/${o}`).join(", "):`/${t.name}`} - ${t.description}`})].join(`
|
|
18
|
+
`)}const op=["type","disabled"],rp=_e({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(v(),y("button",{class:de(["ui-btn",[`ui-btn--${e.variant}`,`ui-btn--${e.size}`]]),type:e.type,disabled:e.disabled},[ao(t.$slots,"default",{},void 0)],10,op))}}),Se=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},zn=Se(rp,[["__scopeId","data-v-746fbd2d"]]),lp={key:0,class:"approval-card"},ip={class:"approval-header"},ap={class:"approval-title"},cp={class:"tool-name"},up={class:"action-summary"},dp={key:0,class:"approval-count"},fp={class:"approval-action"},hp={key:0,class:"feedback-area"},pp={class:"approval-buttons"},gp={key:0,class:"busy-indicator","aria-label":"处理中"},mp=_e({__name:"ApprovalCard",props:{approvals:{}},emits:["resolve"],setup(e,{emit:t}){const n=e,s=t,o=G(!1),r=G(!1),l=G(""),i=G(new Set),a=Y(()=>n.approvals[0]);Ie(()=>n.approvals.map(g=>g.id).join(","),()=>{r.value=!1,l.value="";const g=new Set(n.approvals.map(w=>w.id));i.value=new Set([...i.value].filter(w=>g.has(w)))});function c(g){return typeof g.display=="string"?g.display:g.display&&typeof g.display=="object"&&"description"in g.display?String(g.display.description??""):g.action??"执行该操作"}function u(g){return i.value.has(g)}function f(g,w,b){const k=a.value;!k||u(k.id)||(i.value=new Set([...i.value,k.id]),s("resolve",k.id,g,w,b))}function h(){const g=l.value.trim();g&&f("rejected",g)}function p(g){if(!a.value||o.value)return;const b=g.target;if(b&&(b.tagName==="TEXTAREA"||b.tagName==="INPUT")){r.value&&g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),h());return}switch(g.key){case"1":g.preventDefault(),f("approved",void 0,"once");break;case"2":g.preventDefault(),f("approved",void 0,"session");break;case"3":g.preventDefault(),f("rejected");break;case"4":g.preventDefault(),r.value=!r.value;break}}return Nt(()=>window.addEventListener("keydown",p)),Ut(()=>window.removeEventListener("keydown",p)),(g,w)=>e.approvals.length?(v(),y("div",lp,[o.value?(v(),y("button",{key:0,class:"approval-minibar",onClick:w[0]||(w[0]=b=>o.value=!1)}," ⚠ "+I(e.approvals.length)+" 个待审批请求 — 点击展开 ",1)):a.value?(v(),y(Q,{key:1},[d("div",ip,[w[7]||(w[7]=d("span",{class:"approval-icon"},"⚠",-1)),d("span",ap,[d("span",cp,I(a.value.toolName),1),d("span",up,I(c(a.value)),1)]),e.approvals.length>1?(v(),y("span",dp,"+"+I(e.approvals.length-1),1)):N("",!0),d("button",{class:"icon-btn",title:"最小化","aria-label":"最小化",onClick:w[1]||(w[1]=b=>o.value=!0)},"—")]),d("pre",fp,I(c(a.value)),1),r.value?(v(),y("div",hp,[Ke(d("textarea",{"onUpdate:modelValue":w[2]||(w[2]=b=>l.value=b),class:"feedback-input",rows:"2",name:"approval-feedback","aria-label":"拒绝反馈",placeholder:"输入反馈,Enter 提交(将作为拒绝原因反馈给 Agent)"},null,512),[[rt,l.value]])])):N("",!0),d("div",pp,[K(zn,{variant:"primary",disabled:u(a.value.id),onClick:w[3]||(w[3]=b=>f("approved",void 0,"once"))},{default:kt(()=>[...w[8]||(w[8]=[d("kbd",null,"1",-1),$e(" 批准 ",-1)])]),_:1},8,["disabled"]),K(zn,{variant:"secondary",disabled:u(a.value.id),onClick:w[4]||(w[4]=b=>f("approved",void 0,"session"))},{default:kt(()=>[...w[9]||(w[9]=[d("kbd",null,"2",-1),$e(" 会话批准 ",-1)])]),_:1},8,["disabled"]),K(zn,{variant:"danger",disabled:u(a.value.id),onClick:w[5]||(w[5]=b=>f("rejected"))},{default:kt(()=>[...w[10]||(w[10]=[d("kbd",null,"3",-1),$e(" 拒绝 ",-1)])]),_:1},8,["disabled"]),K(zn,{variant:"secondary",class:de({"feedback-active":r.value}),disabled:u(a.value.id),onClick:w[6]||(w[6]=b=>r.value=!r.value)},{default:kt(()=>[...w[11]||(w[11]=[d("kbd",null,"4",-1),$e(" 反馈 ",-1)])]),_:1},8,["class","disabled"]),u(a.value.id)?(v(),y("span",gp,[...w[12]||(w[12]=[d("span",{class:"spinner"},null,-1),$e(" 处理中… ",-1)])])):N("",!0)])],64)):N("",!0)])):N("",!0)}}),vp=Se(mp,[["__scopeId","data-v-fa5dc764"]]),yp=["title","aria-label"],bp=["width","height","viewBox"],kp=["cx","cy","r"],wp=["cx","cy","r","stroke-dasharray","stroke-dashoffset","transform"],Cr=2,_p=_e({__name:"ContextRing",props:{usage:{default:void 0},size:{default:16}},setup(e){hh(a=>({v1d95ffa8:i.value}));const t=e,n=Y(()=>{if(t.usage===void 0||Number.isNaN(t.usage))return 0;const a=t.usage>1?t.usage/100:t.usage;return Math.min(1,Math.max(0,a))}),s=Y(()=>Math.round(n.value*100)),o=Y(()=>(t.size-Cr)/2),r=Y(()=>2*Math.PI*o.value),l=Y(()=>r.value*(1-n.value)),i=Y(()=>n.value>=.9?"var(--color-danger)":n.value>=.7?"var(--color-warning)":"var(--color-accent)");return(a,c)=>(v(),y("span",{class:"context-ring",role:"img",title:`上下文占用 ${s.value}%`,"aria-label":`上下文占用 ${s.value}%`},[(v(),y("svg",{width:e.size,height:e.size,viewBox:`0 0 ${e.size} ${e.size}`},[d("circle",{class:"ring-track",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Cr,fill:"none"},null,8,kp),d("circle",{class:"ring-value",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Cr,fill:"none","stroke-linecap":"round","stroke-dasharray":r.value,"stroke-dashoffset":l.value,transform:`rotate(-90 ${e.size/2} ${e.size/2})`},null,8,wp)],8,bp))],8,yp))}}),Yc=Se(_p,[["__scopeId","data-v-3ffc343b"]]),Sp=["onKeydown"],xp={key:0,class:"picker-empty"},Cp={class:"picker-group-title"},$p=["onClick"],Tp={class:"row-main"},Ap={class:"row-name"},Rp={class:"row-alias"},Ep={class:"row-meta"},Ip={key:0,class:"row-check"},Lp={class:"picker-thinking"},Mp={class:"thinking-options"},Pp=["onClick"],Np=_e({__name:"ModelPicker",props:{models:{},currentModel:{},currentThinking:{}},emits:["apply-model","apply-thinking","close"],setup(e,{emit:t}){const n=e,s=t,o=["off","low","medium","high"],r={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},l=G(""),i=G(null);Nt(()=>{var C;(C=i.value)==null||C.focus()});const a=Y(()=>{const C=l.value.trim().toLowerCase();return C?n.models.filter(A=>A.alias.toLowerCase().includes(C)||A.provider.toLowerCase().includes(C)||(A.displayName??"").toLowerCase().includes(C)):n.models}),c=Y(()=>{const C=new Map;for(const A of a.value){const R=C.get(A.provider)??[];R.push(A),C.set(A.provider,R)}return[...C.entries()].map(([A,R])=>({provider:A,models:R}))}),u=Y(()=>n.models.find(C=>C.alias===n.currentModel)),f=Y(()=>{var C;return((C=u.value)==null?void 0:C.thinkingLevels)??o});function h(C){return r[C]??C}function p(C){return C>=1e3?`${Math.round(C/1e3)}k`:String(C)}function g(C){return C.displayName??C.model}const w=G(null);function b(C){w.value&&!w.value.contains(C.target)&&s("close")}Nt(()=>document.addEventListener("mousedown",b,!0)),Ut(()=>document.removeEventListener("mousedown",b,!0));function k(C){C!==n.currentModel&&s("apply-model",C),s("close")}const S=G(null);function $(){const C=S.value;return C?Array.from(C.querySelectorAll(".picker-row")):[]}function T(){var C;(C=$()[0])==null||C.focus()}function F(C){var J,oe,H;if(C.key!=="ArrowDown"&&C.key!=="ArrowUp")return;const A=$();if(A.length===0)return;const R=A.indexOf(document.activeElement);C.preventDefault(),R===-1?(J=A[0])==null||J.focus():C.key==="ArrowDown"?(oe=A[(R+1)%A.length])==null||oe.focus():(H=A[(R-1+A.length)%A.length])==null||H.focus()}function O(C){C!==n.currentThinking&&s("apply-thinking",C)}return(C,A)=>(v(),y("div",{ref_key:"rootRef",ref:w,class:"model-picker",role:"dialog","aria-label":"模型选择",onKeydown:A[1]||(A[1]=As(_t(R=>s("close"),["stop"]),["esc"]))},[Ke(d("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":A[0]||(A[0]=R=>l.value=R),class:"picker-search",type:"text",placeholder:"搜索模型…",id:"model-search-input",name:"model-search",autocomplete:"off",spellcheck:"false",onKeydown:As(_t(T,["prevent"]),["arrow-down"])},null,40,Sp),[[rt,l.value]]),d("div",{ref_key:"listRef",ref:S,class:"picker-list",onKeydown:F},[c.value.length===0?(v(),y("div",xp,"无匹配模型")):N("",!0),(v(!0),y(Q,null,ze(c.value,R=>(v(),y("div",{key:R.provider,class:"picker-group"},[d("div",Cp,I(R.provider),1),(v(!0),y(Q,null,ze(R.models,J=>(v(),y("button",{key:J.alias,class:de(["picker-row",{active:J.alias===e.currentModel}]),onClick:oe=>k(J.alias)},[d("span",Tp,[d("span",Ap,I(g(J)),1),d("span",Rp,I(J.alias),1)]),d("span",Ep,I(p(J.maxContextSize)),1),J.alias===e.currentModel?(v(),y("span",Ip,"✓")):N("",!0)],10,$p))),128))]))),128))],544),d("div",Lp,[A[2]||(A[2]=d("span",{class:"thinking-label"},"思考强度",-1)),d("div",Mp,[(v(!0),y(Q,null,ze(f.value,R=>(v(),y("button",{key:R,class:de(["thinking-btn",{active:R===e.currentThinking}]),onClick:J=>O(R)},I(h(R)),11,Pp))),128))])])],544))}}),Op=Se(Np,[["__scopeId","data-v-438275ef"]]),Dp={class:"slash-menu",role:"listbox","aria-label":"斜杠命令"},Bp=["aria-selected","onMousedown","onMouseenter"],Gp={class:"slash-name"},jp={key:0,class:"slash-aliases"},Up={class:"slash-desc"},Fp={key:0,class:"slash-badge slash-badge-input"},zp={key:1,class:"slash-badge"},Hp=_e({__name:"SlashMenu",props:{commands:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const n=t;return(s,o)=>(v(),y("div",Dp,[(v(!0),y(Q,null,ze(e.commands,(r,l)=>{var i;return v(),y("button",{key:r.name,class:de(["slash-item",{active:l===e.activeIndex}]),role:"option","aria-selected":l===e.activeIndex,onMousedown:_t(a=>n("select",r),["prevent"]),onMouseenter:a=>n("hover",l)},[d("span",Gp,[$e("/"+I(r.name),1),(i=r.aliases)!=null&&i.length?(v(),y("span",jp,I(r.aliases.map(a=>`/${a}`).join(" ")),1)):N("",!0)]),d("span",Up,I(r.description),1),r.acceptsInput?(v(),y("span",Fp,"输入参数")):N("",!0),r.target==="backend"?(v(),y("span",zp,"服务端")):N("",!0)],42,Bp)}),128)),o[0]||(o[0]=d("div",{class:"slash-hint"},"↑↓ 选择 · Enter/Tab 执行 · Esc 关闭",-1))]))}}),qp=Se(Hp,[["__scopeId","data-v-6983799d"]]),Vp=["width","height"],Wp={key:0,d:"M4 7h16M4 12h16M4 17h16"},Kp={key:1,d:"M12 5v14M5 12h14"},Zp={key:5,d:"M4 6h16M7 12h10M10 18h4"},Yp={key:6,d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"},Jp={key:7,d:"M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5"},Qp={key:8,d:"M3 12h4l2-7 4 14 2-7h6"},Xp={key:10,d:"m15 18-6-6 6-6"},eg={key:11,d:"m9 18 6-6-6-6"},tg={key:12,d:"m6 9 6 6 6-6"},ng={key:16,d:"M20 15.5A8.5 8.5 0 0 1 8.5 4 8.5 8.5 0 1 0 20 15.5Z"},sg={key:18,d:"M5 9a11 11 0 0 1 14 0M8.5 12.5a6 6 0 0 1 7 0M12 17h.01"},og={key:19,d:"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4Z"},rg={key:20,d:"M12 16V4m0 0-4 4m4-4 4 4M5 20h14"},lg={key:21,d:"m15 4 5 5M17.5 6.5 10 14m-2-2 4 4-3 4H3l1-6Z"},ig={key:22,d:"M9 6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3Z"},ag={key:24,d:"m22 2-7 20-4-9-9-4ZM22 2 11 13"},cg={key:25,x:"6",y:"6",width:"12",height:"12",rx:"2"},ug={key:26,d:"m8 3 4 4 4-4M8 21l4-4 4 4M12 7v10"},dg={key:27,d:"M9.5 4.5A3 3 0 0 0 5 7a3 3 0 0 0 .5 5.5A3 3 0 0 0 9 17v2a2 2 0 0 0 4 0V5a2.5 2.5 0 0 0-3.5-.5ZM13 6a3 3 0 0 1 5 2 3 3 0 0 1 .5 5.5A3 3 0 0 1 15 18"},fg={key:30,d:"M21 12a8 8 0 0 1-9 8 9 9 0 0 1-4-.9L3 21l1.7-4A9 9 0 1 1 21 12Z"},hg={key:31,d:"M20 13 13 20l-9-9V4h7ZM8.5 8.5h.01"},pg={key:32,d:"m12 3 1.3 3.7L17 8l-3.7 1.3L12 13l-1.3-3.7L7 8l3.7-1.3ZM5 15l.8 2.2L8 18l-2.2.8L5 21l-.8-2.2L2 18l2.2-.8ZM19 14l.7 1.8 1.8.7-1.8.7L19 19l-.7-1.8-1.8-.7 1.8-.7Z"},gg={key:34,d:"M3 6h7l2 2h9v11H3Z"},mg={key:35,d:"m5 12 4 4L19 6"},vg={key:39,d:"M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6"},yg={key:46,d:"M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-3-3Z"},bg={key:47,d:"M12 19V5m0 0-6 6m6-6 6 6"},kg={key:48,d:"M18 6 6 18M6 6l12 12"},wg=_e({__name:"SvgIcon",props:{name:{},size:{default:20}},setup(e){return(t,n)=>(v(),y("svg",{class:"svg-icon",width:e.size,height:e.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="menu"?(v(),y("path",Wp)):e.name==="plus"?(v(),y("path",Kp)):e.name==="panel-left"?(v(),y(Q,{key:2},[n[0]||(n[0]=d("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[1]||(n[1]=d("path",{d:"M9 4v16"},null,-1))],64)):e.name==="panel-right"?(v(),y(Q,{key:3},[n[2]||(n[2]=d("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[3]||(n[3]=d("path",{d:"M15 4v16"},null,-1))],64)):e.name==="search"?(v(),y(Q,{key:4},[n[4]||(n[4]=d("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[5]||(n[5]=d("path",{d:"m20 20-4-4"},null,-1))],64)):e.name==="filter"?(v(),y("path",Zp)):e.name==="download"?(v(),y("path",Yp)):e.name==="trash"?(v(),y("path",Jp)):e.name==="activity"?(v(),y("path",Qp)):e.name==="help"?(v(),y(Q,{key:9},[n[6]||(n[6]=d("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[7]||(n[7]=d("path",{d:"M9.7 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1.2 1-1.2 1.7M12 17h.01"},null,-1))],64)):e.name==="chevron-left"?(v(),y("path",Xp)):e.name==="chevron-right"?(v(),y("path",eg)):e.name==="chevron-down"?(v(),y("path",tg)):e.name==="bot"?(v(),y(Q,{key:13},[n[8]||(n[8]=d("rect",{x:"4",y:"7",width:"16",height:"12",rx:"3"},null,-1)),n[9]||(n[9]=d("path",{d:"M12 3v4M8 12h.01M16 12h.01M9 16h6"},null,-1))],64)):e.name==="git-branch"?(v(),y(Q,{key:14},[n[10]||(n[10]=d("circle",{cx:"6",cy:"5",r:"2"},null,-1)),n[11]||(n[11]=d("circle",{cx:"18",cy:"7",r:"2"},null,-1)),n[12]||(n[12]=d("circle",{cx:"6",cy:"19",r:"2"},null,-1)),n[13]||(n[13]=d("path",{d:"M6 7v10M8 10c5 0 3-3 8-3"},null,-1))],64)):e.name==="sun"?(v(),y(Q,{key:15},[n[14]||(n[14]=d("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[15]||(n[15]=d("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42"},null,-1))],64)):e.name==="moon"?(v(),y("path",ng)):e.name==="monitor"?(v(),y(Q,{key:17},[n[16]||(n[16]=d("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"},null,-1)),n[17]||(n[17]=d("path",{d:"M8 21h8M12 17v4"},null,-1))],64)):e.name==="wifi"?(v(),y("path",sg)):e.name==="edit"?(v(),y("path",og)):e.name==="upload"?(v(),y("path",rg)):e.name==="broom"?(v(),y("path",lg)):e.name==="command"?(v(),y("path",ig)):e.name==="at"?(v(),y(Q,{key:23},[n[18]||(n[18]=d("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[19]||(n[19]=d("path",{d:"M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.5 7"},null,-1))],64)):e.name==="send"?(v(),y("path",ag)):e.name==="stop"?(v(),y("rect",cg)):e.name==="compact"?(v(),y("path",ug)):e.name==="brain"?(v(),y("path",dg)):e.name==="clipboard"?(v(),y(Q,{key:28},[n[20]||(n[20]=d("rect",{x:"5",y:"4",width:"14",height:"17",rx:"2"},null,-1)),n[21]||(n[21]=d("path",{d:"M9 4V2h6v2M9 10h6M9 14h6"},null,-1))],64)):e.name==="fork"?(v(),y(Q,{key:29},[n[22]||(n[22]=d("circle",{cx:"6",cy:"4",r:"2"},null,-1)),n[23]||(n[23]=d("circle",{cx:"18",cy:"6",r:"2"},null,-1)),n[24]||(n[24]=d("circle",{cx:"6",cy:"20",r:"2"},null,-1)),n[25]||(n[25]=d("path",{d:"M6 6v12M8 10c6 0 4-4 8-4"},null,-1))],64)):e.name==="message-circle"?(v(),y("path",fg)):e.name==="tag"?(v(),y("path",hg)):e.name==="sparkles"?(v(),y("path",pg)):e.name==="terminal"?(v(),y(Q,{key:33},[n[26]||(n[26]=d("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[27]||(n[27]=d("path",{d:"m7 9 3 3-3 3m5 0h5"},null,-1))],64)):e.name==="folder"?(v(),y("path",gg)):e.name==="check"?(v(),y("path",mg)):e.name==="speaker"?(v(),y(Q,{key:36},[n[28]||(n[28]=d("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[29]||(n[29]=d("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"},null,-1)),n[30]||(n[30]=d("path",{d:"M18 6a8.5 8.5 0 0 1 0 12"},null,-1))],64)):e.name==="speaker-off"?(v(),y(Q,{key:37},[n[31]||(n[31]=d("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[32]||(n[32]=d("path",{d:"m16 9 5 6M21 9l-5 6"},null,-1))],64)):e.name==="copy"?(v(),y(Q,{key:38},[n[33]||(n[33]=d("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1)),n[34]||(n[34]=d("path",{d:"M16 8V4H4v12h4"},null,-1))],64)):e.name==="refresh"?(v(),y("path",vg)):e.name==="target"?(v(),y(Q,{key:40},[n[35]||(n[35]=d("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[36]||(n[36]=d("circle",{cx:"12",cy:"12",r:"5"},null,-1)),n[37]||(n[37]=d("circle",{cx:"12",cy:"12",r:"1"},null,-1))],64)):e.name==="settings"?(v(),y(Q,{key:41},[n[38]||(n[38]=d("circle",{cx:"12",cy:"12",r:"3"},null,-1)),n[39]||(n[39]=d("path",{d:"M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1 1.55V21a2 2 0 1 1-4 0v-.09a1.7 1.7 0 0 0-1-1.55 1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.7 1.7 0 0 0 .34-1.87 1.7 1.7 0 0 0-1.55-1H3a2 2 0 1 1 0-4h.09a1.7 1.7 0 0 0 1.55-1 1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.7 1.7 0 0 0 1.87.34h.09a1.7 1.7 0 0 0 1-1.55V3a2 2 0 1 1 4 0v.09a1.7 1.7 0 0 0 1 1.55 1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.7 1.7 0 0 0-.34 1.87v.09a1.7 1.7 0 0 0 1.55 1H21a2 2 0 1 1 0 4h-.09a1.7 1.7 0 0 0-1.55 1Z"},null,-1))],64)):e.name==="home"?(v(),y(Q,{key:42},[n[40]||(n[40]=d("path",{d:"M3 10.5 12 3l9 7.5"},null,-1)),n[41]||(n[41]=d("path",{d:"M5 9.5V21h14V9.5"},null,-1))],64)):e.name==="bell"?(v(),y(Q,{key:43},[n[42]||(n[42]=d("path",{d:"M6 9a6 6 0 1 1 12 0c0 5 2 6 2 6H4s2-1 2-6"},null,-1)),n[43]||(n[43]=d("path",{d:"M10 19a2 2 0 0 0 4 0"},null,-1))],64)):e.name==="book"?(v(),y(Q,{key:44},[n[44]||(n[44]=d("path",{d:"M4 5a2 2 0 0 1 2-2h13v18H6a2 2 0 0 0-2 2Z"},null,-1)),n[45]||(n[45]=d("path",{d:"M6 3v18"},null,-1))],64)):e.name==="layers"?(v(),y(Q,{key:45},[n[46]||(n[46]=d("path",{d:"m12 3 9 5-9 5-9-5Z"},null,-1)),n[47]||(n[47]=d("path",{d:"m3 13 9 5 9-5"},null,-1))],64)):e.name==="wrench"?(v(),y("path",yg)):e.name==="arrow-up"?(v(),y("path",bg)):e.name==="x"?(v(),y("path",kg)):e.name==="file"?(v(),y(Q,{key:49},[n[48]||(n[48]=d("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"},null,-1)),n[49]||(n[49]=d("path",{d:"M14 2v6h6"},null,-1))],64)):N("",!0)],8,Vp))}}),me=Se(wg,[["__scopeId","data-v-86a0768c"]]),_g=["placeholder"],Sg={class:"composer-footer"},xg={class:"composer-quick-actions"},Cg=["title"],$g={key:3,class:"queue-label",title:"运行结束后自动发送"},Tg={class:"composer-actions"},Ag=["disabled","title"],Rg={key:1,class:"context-label",title:"上下文使用率"},Eg=["disabled"],Ig=_e({__name:"Composer",props:{busy:{type:Boolean},status:{default:void 0},sessionId:{default:null},models:{default:()=>[]},variant:{default:"chat"},placeholder:{default:void 0}},emits:["send","abort","command","switch-model","switch-thinking"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=G(""),l=G(null),i=G(0),a=G(!1),c=Y(()=>{const m=r.value;return!m.startsWith("/")||m.includes(`
|
|
19
|
+
`)||/\s/.test(m.slice(1))?null:m.slice(1)}),u=Y(()=>c.value===null?[]:np(c.value)),f=Y(()=>c.value!==null&&u.value.length>0&&!a.value);Ie(c,()=>{i.value=0,a.value=!1});function h(m){const _=m??u.value[i.value];if(_){if(_.acceptsInput){r.value=`/${_.name} `,a.value=!0,It(()=>{var E;(E=l.value)==null||E.focus(),C()});return}$(`/${_.name}`),J(),o("command",_.name)}}const p=G([]);Ie(()=>s.sessionId,()=>{p.value=[]}),Ie(()=>s.busy,m=>{if(!m&&p.value.length>0){const[_,...E]=p.value;p.value=E,_&&o("send",_)}});const g=G([]),w=G(-1),b=G("");function k(){return`scream-history:${s.sessionId??"default"}`}function S(){try{const m=localStorage.getItem(k());g.value=m?JSON.parse(m):[]}catch{g.value=[]}w.value=-1}function $(m){if(g.value.at(-1)!==m){g.value=[...g.value,m].slice(-50);try{localStorage.setItem(k(),JSON.stringify(g.value))}catch{}}w.value=-1,b.value=""}function T(m,_){const E=l.value;if(!E)return;const j=E.value.slice(0,E.selectionStart??0),D=E.value.slice(E.selectionEnd??0);if(!(m===-1&&j.includes(`
|
|
20
|
+
`))&&!(m===1&&D.includes(`
|
|
21
|
+
`))){if(m===-1){if(g.value.length===0)return;_.preventDefault(),w.value===-1?(b.value=r.value,w.value=g.value.length-1):w.value>0&&w.value--,r.value=g.value[w.value]??""}else{if(w.value===-1)return;_.preventDefault(),w.value<g.value.length-1?(w.value++,r.value=g.value[w.value]??""):(w.value=-1,r.value=b.value)}It(()=>{E.selectionStart=E.selectionEnd=E.value.length})}}function F(){return`scream-draft:${s.sessionId??"default"}`}let O;Ie(r,()=>{C(),clearTimeout(O),O=setTimeout(()=>{try{r.value?localStorage.setItem(F(),r.value):localStorage.removeItem(F())}catch{}},300)}),Ie(()=>s.sessionId,()=>{clearTimeout(O),S();let m="";try{m=localStorage.getItem(F())??""}catch{m=""}r.value=m,It(C)},{immediate:!0});function C(){const m=l.value;if(!m)return;m.style.height="auto";const _=Math.round(window.innerHeight*.25);m.style.height=`${Math.min(Math.max(m.scrollHeight,36),_)}px`}const A=G(0);function R(){const m=window.visualViewport;if(!m)return;const _=Math.round(window.innerHeight-m.height-m.offsetTop);A.value=_>120?_:0}"visualViewport"in window&&(Nt(()=>{var m;(m=window.visualViewport)==null||m.addEventListener("resize",R),R()}),Ut(()=>{var m;(m=window.visualViewport)==null||m.removeEventListener("resize",R),A.value=0}));function J(){r.value="",It(()=>{l.value&&(l.value.style.height="auto")})}function oe(){const m=r.value.trim();if(m){if(m.startsWith("/")){const _=m.indexOf(" "),E=(_===-1?m.slice(1):m.slice(1,_)).toLowerCase(),j=sp(E),D=_===-1?"":m.slice(_+1).trim();$(m),o("command",j,D),J();return}if(s.busy){H();return}$(m),o("send",m),J()}}function H(){const m=r.value.trim();m&&(p.value=[...p.value,m],J())}function pe(m){if(f.value){if(m.key==="ArrowUp"){m.preventDefault(),i.value=(i.value-1+u.value.length)%u.value.length;return}if(m.key==="ArrowDown"){m.preventDefault(),i.value=(i.value+1)%u.value.length;return}if(m.key==="Tab"||m.key==="Enter"&&!m.shiftKey){if(m.key==="Enter"&&m.isComposing)return;m.preventDefault(),h();return}if(m.key==="Escape"){m.preventDefault(),a.value=!0;return}}if((m.ctrlKey||m.metaKey)&&m.key.toLowerCase()==="s"){m.preventDefault(),H();return}if(m.key==="Enter"&&!m.shiftKey){if(m.isComposing)return;m.preventDefault(),oe();return}m.key==="ArrowUp"?T(-1,m):m.key==="ArrowDown"&&T(1,m)}function P(){p.value=[],o("abort")}function M(m){r.value=m,It(()=>{var _;C(),(_=l.value)==null||_.focus()})}function X(m){r.value+=m,It(()=>{var _;C(),(_=l.value)==null||_.focus()})}t({insertText:M,openModelPicker:Ot});const le=Y(()=>{var m;return(m=s.status)==null?void 0:m.model}),ve=Y(()=>{var m;return(m=s.status)==null?void 0:m.permission}),De=Y(()=>{var m;return(m=s.status)==null?void 0:m.contextUsage}),W=Y(()=>s.placeholder??(s.busy?"回合进行中:Enter/Ctrl+S 排队消息,随下一轮注入":"输入消息,@ 提及,/ 触发指令")),te=G(!1),ke={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},xe=Y(()=>{var m;return(m=s.status)==null?void 0:m.thinkingLevel}),Ft=Y(()=>{const m=xe.value;return!m||m==="none"?"":ke[m]??m}),Qe=Y(()=>s.models.length>0);function Ot(){return Qe.value?(te.value=!0,!0):!1}function zt(){Qe.value&&(te.value=!te.value)}function vt(m){o("switch-model",m)}function mn(m){o("switch-thinking",m)}const St=Y(()=>{switch(ve.value){case"auto":return"perm-auto";case"yolo":return"perm-yolo";default:return"perm-manual"}}),Us=Y(()=>{switch(ve.value){case"auto":return"自动";case"yolo":return"YOLO";default:return"手动"}});return(m,_)=>(v(),y("div",{class:"composer",style:cn(A.value?{paddingBottom:A.value+"px"}:void 0)},[f.value?(v(),Ue(qp,{key:0,commands:u.value,"active-index":i.value,onSelect:h,onHover:_[0]||(_[0]=E=>i.value=E)},null,8,["commands","active-index"])):N("",!0),Ke(d("textarea",{ref_key:"textareaRef",ref:l,"onUpdate:modelValue":_[1]||(_[1]=E=>r.value=E),id:"composer-input",name:"message",class:"composer-input",rows:"1",placeholder:W.value,onKeydown:pe},null,40,_g),[[rt,r.value]]),d("div",Sg,[d("div",xg,[e.variant==="home"?(v(),y("button",{key:0,class:"quick-action",title:"插入 / 触发指令",onClick:_[2]||(_[2]=E=>X("/"))},[K(me,{name:"command",size:15}),_[6]||(_[6]=d("span",null,"技能",-1))])):(v(),y(Q,{key:1},[d("button",{class:"quick-action",title:"插入 @ 提及",onClick:_[3]||(_[3]=E=>X("@"))},[K(me,{name:"at",size:15}),_[7]||(_[7]=d("span",null,"提及",-1))]),d("button",{class:"quick-action",title:"插入 / 触发指令",onClick:_[4]||(_[4]=E=>X("/"))},[K(me,{name:"command",size:15}),_[8]||(_[8]=d("span",null,"指令",-1))])],64)),ve.value?(v(),y("span",{key:2,class:de(["permission-label",St.value]),title:`权限模式:${ve.value}`},I(Us.value),11,Cg)):N("",!0),p.value.length?(v(),y("span",$g,"已排队 "+I(p.value.length)+" 条",1)):N("",!0)]),d("div",Tg,[le.value?(v(),y("button",{key:0,class:de(["model-select",{clickable:Qe.value}]),disabled:!Qe.value,title:e.variant==="home"?`当前模型:${le.value}`:`当前模型:${le.value}`,onClick:zt},[K(me,{name:"brain",size:15}),d("span",null,I(e.variant==="home"?"通用智能体":le.value),1),e.variant!=="home"&&Ft.value?(v(),y(Q,{key:0},[$e(" · "+I(Ft.value),1)],64)):N("",!0),Qe.value?(v(),Ue(me,{key:1,name:"chevron-down",size:12})):N("",!0)],10,Ag)):N("",!0),K(sr,{name:"picker"},{default:kt(()=>[te.value?(v(),Ue(Op,{key:0,models:e.models,"current-model":le.value,"current-thinking":xe.value,onApplyModel:vt,onApplyThinking:mn,onClose:_[5]||(_[5]=E=>te.value=!1)},null,8,["models","current-model","current-thinking"])):N("",!0)]),_:1}),De.value!==void 0?(v(),y("span",Rg,[K(Yc,{usage:De.value,size:15},null,8,["usage"])])):N("",!0),e.busy?(v(),y("button",{key:2,class:"stop-btn",title:"停止当前回合",onClick:P},[K(me,{name:"stop",size:14}),_[9]||(_[9]=d("span",null,"停止",-1))])):(v(),y("button",{key:3,class:"send-btn",disabled:!r.value.trim(),title:"发送 (Enter)","aria-label":"发送",onClick:oe},[K(me,{name:"arrow-up",size:16})],8,Eg))])])],4))}}),Jc=Se(Ig,[["__scopeId","data-v-655218be"]]),Lg={class:"conv-bar"},Mg={class:"conv-bar-left"},Pg=["title"],Ng=["title"],Og={key:1,class:"title-text"},Dg={class:"conv-bar-right"},Bg=["title","aria-label"],Gg=_e({__name:"ConversationHeader",props:{title:{default:null},busy:{type:Boolean,default:!1},drawerOpen:{type:Boolean,default:!1}},emits:["home","rename","export","clear","toggle-drawer"],setup(e,{emit:t}){const n=e,s=t,o=G(!1),r=G("");function l(){r.value=n.title??"",o.value=!0}function i(){const u=r.value.trim();o.value=!1,u&&u!==n.title&&s("rename",u)}function a(u){u.key==="Enter"?(u.preventDefault(),i()):u.key==="Escape"&&(u.preventDefault(),o.value=!1)}const c=Y(()=>n.busy?"运行中":"就绪");return(u,f)=>(v(),y("header",Lg,[d("div",Mg,[d("button",{class:"ghost-btn back-btn",title:"返回工作台","aria-label":"返回工作台",onClick:f[0]||(f[0]=h=>s("home"))},[K(me,{name:"chevron-left",size:20})]),d("span",{class:de(["status-dot",{busy:e.busy}]),title:c.value,"aria-hidden":"true"},null,10,Pg),d("button",{class:"title-btn",title:o.value?"":"点击重命名",onClick:l},[o.value?Ke((v(),y("input",{key:0,"onUpdate:modelValue":f[1]||(f[1]=h=>r.value=h),class:"title-input","aria-label":"会话标题",onKeydown:a,onBlur:i,onClick:f[2]||(f[2]=_t(()=>{},["stop"]))},null,544)),[[rt,r.value]]):(v(),y("span",Og,I(e.title||"新会话"),1))],8,Ng)]),d("div",Dg,[d("button",{class:"ghost-btn",title:"导出 Markdown","aria-label":"导出 Markdown",onClick:f[3]||(f[3]=h=>s("export"))},[K(me,{name:"download",size:18})]),d("button",{class:"ghost-btn",title:"清空本地消息","aria-label":"清空本地消息",onClick:f[4]||(f[4]=h=>s("clear"))},[K(me,{name:"broom",size:18})]),d("button",{class:de(["ghost-btn",{active:e.drawerOpen}]),title:e.drawerOpen?"收起详情":"会话详情","aria-label":e.drawerOpen?"收起详情":"会话详情",onClick:f[5]||(f[5]=h=>s("toggle-drawer"))},[K(me,{name:"panel-right",size:18})],10,Bg)])]))}}),jg=Se(Gg,[["__scopeId","data-v-eccc6b36"]]),Ug={key:0,class:"ui-dialog-header"},Fg={class:"ui-dialog-title"},zg={class:"ui-dialog-body"},Hg={key:1,class:"ui-dialog-footer"},qg='a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Vg=_e({__name:"Dialog",props:{open:{type:Boolean},title:{default:void 0},closable:{type:Boolean,default:!0},maxWidth:{default:void 0}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,o=G(null);let r=null;function l(){const a=o.value;return a?Array.from(a.querySelectorAll(qg)).filter(c=>c.offsetParent!==null||c===document.activeElement):[]}function i(a){var p,g,w;if(!n.open)return;if(a.key==="Escape"&&n.closable!==!1){a.stopPropagation(),s("close");return}if(a.key!=="Tab")return;const c=l();if(c.length===0){a.preventDefault(),(p=o.value)==null||p.focus();return}const u=c[0],f=c[c.length-1],h=document.activeElement;a.shiftKey?(h===u||!((g=o.value)!=null&&g.contains(h)))&&(a.preventDefault(),f.focus()):(h===f||!((w=o.value)!=null&&w.contains(h)))&&(a.preventDefault(),u.focus())}return Ie(()=>n.open,a=>{a?(r=document.activeElement instanceof HTMLElement?document.activeElement:null,It(()=>{const c=l()[0]??o.value;c==null||c.focus()})):r&&(r.focus(),r=null)},{immediate:!1}),Nt(()=>window.addEventListener("keydown",i,!0)),Ut(()=>window.removeEventListener("keydown",i,!0)),(a,c)=>(v(),Ue(Cl,{to:"body"},[K(sr,{name:"dialog"},{default:kt(()=>[e.open?(v(),y("div",{key:0,class:"ui-dialog-overlay",onClick:c[1]||(c[1]=_t(u=>e.closable!==!1&&s("close"),["self"]))},[d("div",{ref_key:"dialogRef",ref:o,class:"ui-dialog",style:cn(e.maxWidth?{maxWidth:e.maxWidth}:void 0),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||a.$slots.header?(v(),y("div",Ug,[ao(a.$slots,"header",{},()=>[d("span",Fg,I(e.title),1)],!0),e.closable!==!1?(v(),y("button",{key:0,class:"ui-dialog-close","aria-label":"关闭",onClick:c[0]||(c[0]=u=>s("close"))},"✕")):N("",!0)])):N("",!0),d("div",zg,[ao(a.$slots,"default",{},void 0,!0)]),a.$slots.footer?(v(),y("div",Hg,[ao(a.$slots,"footer",{},void 0,!0)])):N("",!0)],4)])):N("",!0)]),_:3})]))}}),Wg=Se(Vg,[["__scopeId","data-v-396acebf"]]),Kg={class:"info-row"},Zg={class:"info-val mono"},Yg={class:"info-row"},Jg={class:"info-val mono"},Qg={class:"info-row"},Xg={class:"info-val"},em={class:"info-row"},tm={class:"info-val"},nm={class:"info-row"},sm={class:"info-val"},om={class:"info-row"},rm={class:"info-val"},lm={class:"info-row"},im={class:"info-val"},am={class:"info-row"},cm={class:"info-val"},um={class:"info-row"},dm={class:"info-val"},fm={class:"info-row"},hm={class:"info-val"},pm={key:0,class:"info-row"},gm={class:"info-val"},mm={key:1,class:"info-row"},vm={class:"info-val"},ym={class:"info-val mono"},bm={class:"info-val"},km={key:3,class:"info-empty"},wm=_e({__name:"InfoPanel",props:{mode:{},status:{},sessionId:{},workDir:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,o=Y(()=>n.mode==="status"?"会话状态":"Token 用量");function r(p){switch(p){case"auto":return"自动 (auto)";case"yolo":return"YOLO";case"manual":return"手动 (manual)";default:return p??"-"}}function l(p){return p?"开启":"关闭"}function i(p){return p!=null}function a(p){return typeof p=="number"?p.toLocaleString():"-"}function c(p){return typeof p!="number"?"-":`${(p>1?p:p*100).toFixed(1)}%`}function u(p){return p?p.inputOther+p.output+p.inputCacheRead+p.inputCacheCreation:0}function f(p){return p!=null&&p.byModel?Object.entries(p.byModel).map(([g,w])=>({model:g,tokens:u(w),output:w.output,cacheRead:w.inputCacheRead})):[]}const h=Y(()=>i(n.status.usage)||i(n.status.contextTokens));return(p,g)=>(v(),Ue(Wg,{open:!0,title:o.value,onClose:g[0]||(g[0]=w=>s("close"))},{default:kt(()=>{var w,b;return[e.mode==="status"?(v(),y(Q,{key:0},[d("div",Kg,[g[1]||(g[1]=d("span",{class:"info-key"},"会话 ID",-1)),d("span",Zg,I(e.sessionId??"-"),1)]),d("div",Yg,[g[2]||(g[2]=d("span",{class:"info-key"},"工作目录",-1)),d("span",Jg,I(e.workDir??"-"),1)]),d("div",Qg,[g[3]||(g[3]=d("span",{class:"info-key"},"模型",-1)),d("span",Xg,I(e.status.model??"-"),1)]),d("div",em,[g[4]||(g[4]=d("span",{class:"info-key"},"权限模式",-1)),d("span",tm,I(r(e.status.permission)),1)]),d("div",nm,[g[5]||(g[5]=d("span",{class:"info-key"},"思考级别",-1)),d("span",sm,I(e.status.thinkingLevel??"-"),1)]),d("div",om,[g[6]||(g[6]=d("span",{class:"info-key"},"计划模式",-1)),d("span",rm,I(l(e.status.planMode)),1)]),d("div",lm,[g[7]||(g[7]=d("span",{class:"info-key"},"WolfPack 模式",-1)),d("span",im,I(l(e.status.wolfpackMode)),1)]),d("div",am,[g[8]||(g[8]=d("span",{class:"info-key"},"上下文",-1)),d("span",cm,I(a(e.status.contextTokens))+" / "+I(a(e.status.maxContextTokens))+" ("+I(c(e.status.contextUsage))+")",1)])],64)):(v(),y(Q,{key:1},[d("div",um,[g[9]||(g[9]=d("span",{class:"info-key"},"上下文 Token",-1)),d("span",dm,I(a(e.status.contextTokens))+" / "+I(a(e.status.maxContextTokens)),1)]),d("div",fm,[g[10]||(g[10]=d("span",{class:"info-key"},"上下文占比",-1)),d("span",hm,I(c(e.status.contextUsage)),1)]),(w=e.status.usage)!=null&&w.total?(v(),y("div",pm,[g[11]||(g[11]=d("span",{class:"info-key"},"累计 Token",-1)),d("span",gm,I(a(u(e.status.usage.total))),1)])):N("",!0),(b=e.status.usage)!=null&&b.currentTurn?(v(),y("div",mm,[g[12]||(g[12]=d("span",{class:"info-key"},"当前回合",-1)),d("span",vm,I(a(u(e.status.usage.currentTurn))),1)])):N("",!0),f(e.status.usage).length?(v(),y(Q,{key:2},[g[13]||(g[13]=d("div",{class:"info-subhead"},"按模型",-1)),(v(!0),y(Q,null,ze(f(e.status.usage),k=>(v(),y("div",{key:k.model,class:"info-row info-row-model"},[d("span",ym,I(k.model),1),d("span",bm,I(a(k.tokens))+"(输出 "+I(a(k.output))+" · 缓存读 "+I(a(k.cacheRead))+")",1)]))),128))],64)):N("",!0),h.value?N("",!0):(v(),y("div",km,"暂无用量数据"))],64))]}),_:1},8,["title"]))}}),_m=Se(wm,[["__scopeId","data-v-1555711d"]]);function Ll(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bn=Ll();function Qc(e){Bn=e}var bs={exec:()=>null};function Pe(e,t=""){let n=typeof e=="string"?e:e.source;const s={replace:(o,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(pt.caret,"$1"),n=n.replace(o,l),s},getRegex:()=>new RegExp(n,t)};return s}var pt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Sm=/^(?:[ \t]*(?:\n|$))+/,xm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Cm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$m=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ml=/(?:[*+-]|\d{1,9}[.)])/,Xc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,eu=Pe(Xc).replace(/bull/g,Ml).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Tm=Pe(Xc).replace(/bull/g,Ml).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Am=/^[^\n]+/,Nl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Rm=Pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Nl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Em=Pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ml).getRegex(),rr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ol=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Im=Pe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ol).replace("tag",rr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tu=Pe(Pl).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rr).getRegex(),Lm=Pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",tu).getRegex(),Dl={blockquote:Lm,code:xm,def:Rm,fences:Cm,heading:$m,hr:Bs,html:Im,lheading:eu,list:Em,newline:Sm,paragraph:tu,table:bs,text:Am},Vi=Pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rr).getRegex(),Mm={...Dl,lheading:Tm,table:Vi,paragraph:Pe(Pl).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rr).getRegex()},Pm={...Dl,html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ol).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:bs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pe(Pl).replace("hr",Bs).replace("heading",` *#{1,6} *[^
|
|
22
|
+
]`).replace("lheading",eu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Om=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,nu=/^( {2,}|\\)\n(?!\s*$)/,Dm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lr=/[\p{P}\p{S}]/u,Bl=/[\s\p{P}\p{S}]/u,su=/[^\s\p{P}\p{S}]/u,Bm=Pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bl).getRegex(),ou=/(?!~)[\p{P}\p{S}]/u,Gm=/(?!~)[\s\p{P}\p{S}]/u,jm=/(?:[^\s\p{P}\p{S}]|~)/u,Um=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ru=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Fm=Pe(ru,"u").replace(/punct/g,lr).getRegex(),zm=Pe(ru,"u").replace(/punct/g,ou).getRegex(),lu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Hm=Pe(lu,"gu").replace(/notPunctSpace/g,su).replace(/punctSpace/g,Bl).replace(/punct/g,lr).getRegex(),qm=Pe(lu,"gu").replace(/notPunctSpace/g,jm).replace(/punctSpace/g,Gm).replace(/punct/g,ou).getRegex(),Vm=Pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,su).replace(/punctSpace/g,Bl).replace(/punct/g,lr).getRegex(),Wm=Pe(/\\(punct)/,"gu").replace(/punct/g,lr).getRegex(),Km=Pe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Zm=Pe(Ol).replace("(?:-->|$)","-->").getRegex(),Ym=Pe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Zm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ao=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jm=Pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ao).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iu=Pe(/^!?\[(label)\]\[(ref)\]/).replace("label",Ao).replace("ref",Nl).getRegex(),au=Pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Nl).getRegex(),Qm=Pe("reflink|nolink(?!\\()","g").replace("reflink",iu).replace("nolink",au).getRegex(),Gl={_backpedal:bs,anyPunctuation:Wm,autolink:Km,blockSkip:Um,br:nu,code:Om,del:bs,emStrongLDelim:Fm,emStrongRDelimAst:Hm,emStrongRDelimUnd:Vm,escape:Nm,link:Jm,nolink:au,punctuation:Bm,reflink:iu,reflinkSearch:Qm,tag:Ym,text:Dm,url:bs},Xm={...Gl,link:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",Ao).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ao).getRegex()},Qr={...Gl,emStrongRDelimAst:qm,emStrongLDelim:zm,url:Pe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ev={...Qr,br:Pe(nu).replace("{2,}","*").getRegex(),text:Pe(Qr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xs={normal:Dl,gfm:Mm,pedantic:Pm},is={normal:Gl,gfm:Qr,breaks:ev,pedantic:Xm},tv={"&":"&","<":"<",">":">",'"':""","'":"'"},Wi=e=>tv[e];function Vt(e,t){if(t){if(pt.escapeTest.test(e))return e.replace(pt.escapeReplace,Wi)}else if(pt.escapeTestNoEncode.test(e))return e.replace(pt.escapeReplaceNoEncode,Wi);return e}function Ki(e){try{e=encodeURI(e).replace(pt.percentDecode,"%")}catch{return null}return e}function Zi(e,t){var r;const n=e.replace(pt.findPipe,(l,i,a)=>{let c=!1,u=i;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(pt.splitPipe);let o=0;if(s[0].trim()||s.shift(),s.length>0&&!((r=s.at(-1))!=null&&r.trim())&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(pt.slashPipe,"|");return s}function as(e,t,n){const s=e.length;if(s===0)return"";let o=0;for(;o<s&&e.charAt(s-o-1)===t;)o++;return e.slice(0,s-o)}function nv(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return n>0?-2:-1}function Yi(e,t,n,s,o){const r=t.href,l=t.title||null,i=e[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;const a={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:r,title:l,text:i,tokens:s.inlineTokens(i)};return s.state.inLink=!1,a}function sv(e,t,n){const s=e.match(n.other.indentCodeCompensation);if(s===null)return t;const o=s[1];return t.split(`
|
|
23
|
+
`).map(r=>{const l=r.match(n.other.beginningSpace);if(l===null)return r;const[i]=l;return i.length>=o.length?r.slice(o.length):r}).join(`
|
|
24
|
+
`)}var Ro=class{constructor(e){L(this,"options");L(this,"rules");L(this,"lexer");this.options=e||Bn}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:as(n,`
|
|
25
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=sv(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const s=as(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:as(t[0],`
|
|
26
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=as(t[0],`
|
|
27
|
+
`).split(`
|
|
28
|
+
`),s="",o="";const r=[];for(;n.length>0;){let l=!1;const i=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))i.push(n[a]),l=!0;else if(!l)i.push(n[a]);else break;n=n.slice(a);const c=i.join(`
|
|
29
|
+
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
30
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
31
|
+
${c}`:c,o=o?`${o}
|
|
32
|
+
${u}`:u;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=f,n.length===0)break;const h=r.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const p=h,g=p.raw+`
|
|
33
|
+
`+n.join(`
|
|
34
|
+
`),w=this.blockquote(g);r[r.length-1]=w,s=s.substring(0,s.length-p.raw.length)+w.raw,o=o.substring(0,o.length-p.text.length)+w.text;break}else if((h==null?void 0:h.type)==="list"){const p=h,g=p.raw+`
|
|
35
|
+
`+n.join(`
|
|
36
|
+
`),w=this.list(g);r[r.length-1]=w,s=s.substring(0,s.length-h.raw.length)+w.raw,o=o.substring(0,o.length-p.raw.length)+w.raw,n=g.substring(r.at(-1).raw.length).split(`
|
|
37
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,o={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const r=this.rules.other.listItemRegex(n);let l=!1;for(;e;){let a=!1,c="",u="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let f=t[2].split(`
|
|
38
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),h=e.split(`
|
|
39
|
+
`,1)[0],p=!f.trim(),g=0;if(this.options.pedantic?(g=2,u=f.trimStart()):p?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=f.slice(g),g+=t[1].length),p&&this.rules.other.blankLine.test(h)&&(c+=h+`
|
|
40
|
+
`,e=e.substring(h.length+1),a=!0),!a){const k=this.rules.other.nextBulletRegex(g),S=this.rules.other.hrRegex(g),$=this.rules.other.fencesBeginRegex(g),T=this.rules.other.headingBeginRegex(g),F=this.rules.other.htmlBeginRegex(g);for(;e;){const O=e.split(`
|
|
41
|
+
`,1)[0];let C;if(h=O,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),C=h):C=h.replace(this.rules.other.tabCharGlobal," "),$.test(h)||T.test(h)||F.test(h)||k.test(h)||S.test(h))break;if(C.search(this.rules.other.nonSpaceChar)>=g||!h.trim())u+=`
|
|
42
|
+
`+C.slice(g);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(f)||T.test(f)||S.test(f))break;u+=`
|
|
43
|
+
`+h}!p&&!h.trim()&&(p=!0),c+=O+`
|
|
44
|
+
`,e=e.substring(O.length+1),f=C.slice(g)}}o.loose||(l?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let w=null,b;this.options.gfm&&(w=this.rules.other.listIsTask.exec(u),w&&(b=w[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!w,checked:b,loose:!1,text:u,tokens:[]}),o.raw+=c}const i=o.items.at(-1);if(i)i.raw=i.raw.trimEnd(),i.text=i.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let a=0;a<o.items.length;a++)if(this.lexer.state.top=!1,o.items[a].tokens=this.lexer.blockTokens(o.items[a].text,[]),!o.loose){const c=o.items[a].tokens.filter(f=>f.type==="space"),u=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=u}if(o.loose)for(let a=0;a<o.items.length;a++)o.items[a].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:o}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Zi(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
45
|
+
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const i of s)this.rules.other.tableAlignRight.test(i)?r.align.push("right"):this.rules.other.tableAlignCenter.test(i)?r.align.push("center"):this.rules.other.tableAlignLeft.test(i)?r.align.push("left"):r.align.push(null);for(let i=0;i<n.length;i++)r.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:r.align[i]});for(const i of o)r.rows.push(Zi(i,r.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[c]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
46
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const r=as(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=nv(t[2],"()");if(r===-2)return;if(r>-1){const i=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let s=t[2],o="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Yi(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[s.toLowerCase()];if(!o){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return Yi(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const r=[...s[0]].length-1;let l,i,a=r,c=0;const u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(s=u.exec(t))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(i=[...l].length,s[3]||s[4]){a+=i;continue}else if((s[5]||s[6])&&r%3&&!((r+i)%3)){c+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+c);const f=[...s[0]][0].length,h=e.slice(0,r+s.index+f+i);if(Math.min(r,i)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let s,o;if(t[2]==="@")s=t[0],o="mailto:"+s;else{let r;do r=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(r!==t[0]);s=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},rn=class Xr{constructor(t){L(this,"tokens");L(this,"options");L(this,"state");L(this,"tokenizer");L(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Bn,this.options.tokenizer=this.options.tokenizer||new Ro,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:pt,block:Xs.normal,inline:is.normal};this.options.pedantic?(n.block=Xs.pedantic,n.inline=is.pedantic):this.options.gfm&&(n.block=Xs.gfm,this.options.breaks?n.inline=is.breaks:n.inline=is.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xs,inline:is}}static lex(t,n){return new Xr(n).lex(t)}static lexInline(t,n){return new Xr(n).inlineTokens(t)}lex(t){t=t.replace(pt.carriageReturn,`
|
|
47
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],s=!1){var o,r,l;for(this.options.pedantic&&(t=t.replace(pt.tabCharGlobal," ").replace(pt.spaceLine,""));t;){let i;if((r=(o=this.options.extensions)==null?void 0:o.block)!=null&&r.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);const c=n.at(-1);i.raw.length===1&&c!==void 0?c.raw+=`
|
|
48
|
+
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
49
|
+
`+i.raw,c.text+=`
|
|
50
|
+
`+i.text,this.inlineQueue.at(-1).src=c.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
51
|
+
`+i.raw,c.text+=`
|
|
52
|
+
`+i.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0;const u=t.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},u),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(a=t.substring(0,c+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){const c=n.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
|
|
53
|
+
`+i.raw,c.text+=`
|
|
54
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(i),s=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
55
|
+
`+i.raw,c.text+=`
|
|
56
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var i,a,c;let s=t,o=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,l="";for(;t;){r||(l=""),r=!1;let u;if((a=(i=this.options.extensions)==null?void 0:i.inline)!=null&&a.some(h=>(u=h.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);const h=n.at(-1);u.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=u.raw,h.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,s,l)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let f=t;if((c=this.options.extensions)!=null&&c.startInline){let h=1/0;const p=t.slice(1);let g;this.options.extensions.startInline.forEach(w=>{g=w.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(u=this.tokenizer.inlineText(f)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(l=u.raw.slice(-1)),r=!0;const h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=u.raw,h.text+=u.text):n.push(u);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},Eo=class{constructor(e){L(this,"options");L(this,"parser");this.options=e||Bn}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const s=(r=(t||"").match(pt.notSpaceStart))==null?void 0:r[0],o=e.replace(pt.endingNewline,"")+`
|
|
57
|
+
`;return s?'<pre><code class="language-'+Vt(s)+'">'+(n?o:Vt(o,!0))+`</code></pre>
|
|
58
|
+
`:"<pre><code>"+(n?o:Vt(o,!0))+`</code></pre>
|
|
59
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
60
|
+
${this.parser.parse(e)}</blockquote>
|
|
61
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
62
|
+
`}hr(e){return`<hr>
|
|
63
|
+
`}list(e){const t=e.ordered,n=e.start;let s="";for(let l=0;l<e.items.length;l++){const i=e.items[l];s+=this.listitem(i)}const o=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+o+r+`>
|
|
64
|
+
`+s+"</"+o+`>
|
|
65
|
+
`}listitem(e){var n;let t="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+Vt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):t+=s+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
66
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
67
|
+
`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let s="";for(let o=0;o<e.rows.length;o++){const r=e.rows[o];n="";for(let l=0;l<r.length;l++)n+=this.tablecell(r[l]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
68
|
+
<thead>
|
|
69
|
+
`+t+`</thead>
|
|
70
|
+
`+s+`</table>
|
|
71
|
+
`}tablerow({text:e}){return`<tr>
|
|
72
|
+
${e}</tr>
|
|
73
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
74
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Vt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),o=Ki(e);if(o===null)return s;e=o;let r='<a href="'+e+'"';return t&&(r+=' title="'+Vt(t)+'"'),r+=">"+s+"</a>",r}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const o=Ki(e);if(o===null)return Vt(n);e=o;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${Vt(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Vt(e.text)}},jl=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},ln=class el{constructor(t){L(this,"options");L(this,"renderer");L(this,"textRenderer");this.options=t||Bn,this.options.renderer=this.options.renderer||new Eo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jl}static parse(t,n){return new el(n).parse(t)}static parseInline(t,n){return new el(n).parseInline(t)}parse(t,n=!0){var o,r;let s="";for(let l=0;l<t.length;l++){const i=t[l];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[i.type]){const c=i,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=u||"";continue}}const a=i;switch(a.type){case"space":{s+=this.renderer.space(a);continue}case"hr":{s+=this.renderer.hr(a);continue}case"heading":{s+=this.renderer.heading(a);continue}case"code":{s+=this.renderer.code(a);continue}case"table":{s+=this.renderer.table(a);continue}case"blockquote":{s+=this.renderer.blockquote(a);continue}case"list":{s+=this.renderer.list(a);continue}case"html":{s+=this.renderer.html(a);continue}case"paragraph":{s+=this.renderer.paragraph(a);continue}case"text":{let c=a,u=this.renderer.text(c);for(;l+1<t.length&&t[l+1].type==="text";)c=t[++l],u+=`
|
|
75
|
+
`+this.renderer.text(c);n?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;continue}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(t,n=this.renderer){var o,r;let s="";for(let l=0;l<t.length;l++){const i=t[l];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[i.type]){const c=this.options.extensions.renderers[i.type].call({parser:this},i);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=c||"";continue}}const a=i;switch(a.type){case"escape":{s+=n.text(a);break}case"html":{s+=n.html(a);break}case"link":{s+=n.link(a);break}case"image":{s+=n.image(a);break}case"strong":{s+=n.strong(a);break}case"em":{s+=n.em(a);break}case"codespan":{s+=n.codespan(a);break}case"br":{s+=n.br(a);break}case"del":{s+=n.del(a);break}case"text":{s+=n.text(a);break}default:{const c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},Or,fo=(Or=class{constructor(e){L(this,"options");L(this,"block");this.options=e||Bn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?rn.lex:rn.lexInline}provideParser(){return this.block?ln.parse:ln.parseInline}},L(Or,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Or),ov=class{constructor(...e){L(this,"defaults",Ll());L(this,"options",this.setOptions);L(this,"parse",this.parseMarkdown(!0));L(this,"parseInline",this.parseMarkdown(!1));L(this,"Parser",ln);L(this,"Renderer",Eo);L(this,"TextRenderer",jl);L(this,"Lexer",rn);L(this,"Tokenizer",Ro);L(this,"Hooks",fo);this.use(...e)}walkTokens(e,t){var s,o;let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const l=r;for(const i of l.header)n=n.concat(this.walkTokens(i.tokens,t));for(const i of l.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const l=r;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=r;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(i=>{const a=l[i].flat(1/0);n=n.concat(this.walkTokens(a,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const r=t.renderers[o.name];r?t.renderers[o.name]=function(...l){let i=o.renderer.apply(this,l);return i===!1&&(i=r.apply(this,l)),i}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),s.extensions=t),n.renderer){const o=this.defaults.renderer||new Eo(this.defaults);for(const r in n.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const l=r,i=n.renderer[l],a=o[l];o[l]=(...c)=>{let u=i.apply(o,c);return u===!1&&(u=a.apply(o,c)),u||""}}s.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Ro(this.defaults);for(const r in n.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const l=r,i=n.tokenizer[l],a=o[l];o[l]=(...c)=>{let u=i.apply(o,c);return u===!1&&(u=a.apply(o,c)),u}}s.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new fo;for(const r in n.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const l=r,i=n.hooks[l],a=o[l];fo.passThroughHooks.has(r)?o[l]=c=>{if(this.defaults.async)return Promise.resolve(i.call(o,c)).then(f=>a.call(o,f));const u=i.call(o,c);return a.call(o,u)}:o[l]=(...c)=>{let u=i.apply(o,c);return u===!1&&(u=a.apply(o,c)),u}}s.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(l){let i=[];return i.push(r.call(this,l)),o&&(i=i.concat(o.call(this,l))),i}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rn.lex(e,t??this.defaults)}parser(e,t){return ln.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const o={...s},r={...this.defaults,...o},l=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);const i=r.hooks?r.hooks.provideLexer():e?rn.lex:rn.lexInline,a=r.hooks?r.hooks.provideParser():e?ln.parse:ln.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(c=>i(c,r)).then(c=>r.hooks?r.hooks.processAllTokens(c):c).then(c=>r.walkTokens?Promise.all(this.walkTokens(c,r.walkTokens)).then(()=>c):c).then(c=>a(c,r)).then(c=>r.hooks?r.hooks.postprocess(c):c).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));let c=i(n,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=a(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return l(c)}}}onError(e,t){return n=>{if(n.message+=`
|
|
76
|
+
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+Vt(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Dn=new ov;function Le(e,t){return Dn.parse(e,t)}Le.options=Le.setOptions=function(e){return Dn.setOptions(e),Le.defaults=Dn.defaults,Qc(Le.defaults),Le};Le.getDefaults=Ll;Le.defaults=Bn;Le.use=function(...e){return Dn.use(...e),Le.defaults=Dn.defaults,Qc(Le.defaults),Le};Le.walkTokens=function(e,t){return Dn.walkTokens(e,t)};Le.parseInline=Dn.parseInline;Le.Parser=ln;Le.parser=ln.parse;Le.Renderer=Eo;Le.TextRenderer=jl;Le.Lexer=rn;Le.lexer=rn.lex;Le.Tokenizer=Ro;Le.Hooks=fo;Le.parse=Le;Le.options;Le.setOptions;Le.use;Le.walkTokens;Le.parseInline;ln.parse;rn.lex;const rv="modulepreload",lv=function(e,t){return new URL(e,t).href},Ji={},eo=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const i=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=l(n.map(u=>{if(u=lv(u,s),u in Ji)return;Ji[u]=!0;const f=u.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(!!s)for(let w=i.length-1;w>=0;w--){const b=i[w];if(b.href===u&&(!f||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":rv,f||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((w,b)=>{g.addEventListener("load",w),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(l){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=l,window.dispatchEvent(i),!i.defaultPrevented)throw l}return o.then(l=>{for(const i of l||[])i.status==="rejected"&&r(i.reason);return t().catch(r)})};let et=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function iv(e){return Ul(e)}function Ul(e){return Array.isArray(e)?av(e):e instanceof RegExp?e:typeof e=="object"?cv(e):e}function av(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=Ul(e[n]);return t}function cv(e){let t={};for(let n in e)t[n]=Ul(e[n]);return t}function cu(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function uu(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?uu(e.substring(0,e.length-1)):e.substr(~t+1)}var $r=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,to=class{static hasCaptures(e){return e===null?!1:($r.lastIndex=0,$r.test(e))}static replaceCaptures(e,t,n){return e.replace($r,(s,o,r,l)=>{let i=n[parseInt(o||r,10)];if(i){let a=t.substring(i.start,i.end);for(;a[0]===".";)a=a.substring(1);switch(l){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function du(e,t){return e<t?-1:e>t?1:0}function fu(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,s=t.length;if(n===s){for(let o=0;o<n;o++){let r=du(e[o],t[o]);if(r!==0)return r}return 0}return n-s}function Qi(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function hu(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var pu=class{constructor(e){L(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Io=class{constructor(e,t,n){L(this,"_cachedMatchRoot",new pu(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(fv(e),t)}static createFromParsedTheme(e,t){return pv(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,s=this._cachedMatchRoot.get(t).find(o=>uv(e.parent,o.parentScopes));return s?new gu(s.fontStyle,s.foreground,s.background):null}},Tr=class ho{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new ho(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new ho(n,t[s]);return n}push(t){return new ho(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push(s.scopeName),s=s.parent;return s===t?n.reverse():void 0}};function uv(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let s=t[n],o=!1;if(s===">"){if(n===t.length-1)return!1;s=t[++n],o=!0}for(;e&&!dv(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function dv(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var gu=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function fv(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],s=0;for(let o=0,r=t.length;o<r;o++){let l=t[o];if(!l.settings)continue;let i;if(typeof l.scope=="string"){let f=l.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),i=f.split(",")}else Array.isArray(l.scope)?i=l.scope:i=[""];let a=-1;if(typeof l.settings.fontStyle=="string"){a=0;let f=l.settings.fontStyle.split(" ");for(let h=0,p=f.length;h<p;h++)switch(f[h]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let c=null;typeof l.settings.foreground=="string"&&Qi(l.settings.foreground)&&(c=l.settings.foreground);let u=null;typeof l.settings.background=="string"&&Qi(l.settings.background)&&(u=l.settings.background);for(let f=0,h=i.length;f<h;f++){let g=i[f].trim().split(" "),w=g[g.length-1],b=null;g.length>1&&(b=g.slice(0,g.length-1),b.reverse()),n[s++]=new hv(w,b,o,a,c,u)}}return n}var hv=class{constructor(e,t,n,s,o,r){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=s,this.foreground=o,this.background=r}},ct=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(ct||{});function pv(e,t){e.sort((a,c)=>{let u=du(a.scope,c.scope);return u!==0||(u=fu(a.parentScopes,c.parentScopes),u!==0)?u:a.index-c.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(s=a.foreground),a.background!==null&&(o=a.background)}let r=new gv(t),l=new gu(n,r.getId(s),r.getId(o)),i=new vv(new tl(0,null,-1,0,0),[]);for(let a=0,c=e.length;a<c;a++){let u=e[a];i.insert(0,u.scope,u.parentScopes,u.fontStyle,r.getId(u.foreground),r.getId(u.background))}return new Io(r,l,i)}var gv=class{constructor(e){L(this,"_isFrozen");L(this,"_lastColorId");L(this,"_id2color");L(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},mv=Object.freeze([]),tl=class mu{constructor(t,n,s,o,r){L(this,"scopeDepth");L(this,"parentScopes");L(this,"fontStyle");L(this,"foreground");L(this,"background");this.scopeDepth=t,this.parentScopes=n||mv,this.fontStyle=s,this.foreground=o,this.background=r}clone(){return new mu(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let s=0,o=t.length;s<o;s++)n[s]=t[s].clone();return n}acceptOverwrite(t,n,s,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},vv=class nl{constructor(t,n=[],s={}){L(this,"_rulesWithParentScopes");this._mainRule=t,this._children=s,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let s=0,o=0;for(;t.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=t.parentScopes.length||o>=n.parentScopes.length);){const r=n.parentScopes[o].length-t.parentScopes[s].length;if(r!==0)return r;s++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let s=t.indexOf("."),o,r;if(s===-1?(o=t,r=""):(o=t.substring(0,s),r=t.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(r)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(nl._cmpBySpecificity),n}insert(t,n,s,o,r,l){if(n===""){this._doInsertHere(t,s,o,r,l);return}let i=n.indexOf("."),a,c;i===-1?(a=n,c=""):(a=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new nl(this._mainRule.clone(),tl.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,c,s,o,r,l)}_doInsertHere(t,n,s,o,r){if(n===null){this._mainRule.acceptOverwrite(t,s,o,r);return}for(let l=0,i=this._rulesWithParentScopes.length;l<i;l++){let a=this._rulesWithParentScopes[l];if(fu(a.parentScopes,n)===0){a.acceptOverwrite(t,s,o,r);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),r===0&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new tl(t,n,s,o,r))}},es=class Rt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Rt.getLanguageId(t),s=Rt.getTokenType(t),o=Rt.getFontStyle(t),r=Rt.getForeground(t),l=Rt.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:r,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,s,o,r,l,i){let a=Rt.getLanguageId(t),c=Rt.getTokenType(t),u=Rt.containsBalancedBrackets(t)?1:0,f=Rt.getFontStyle(t),h=Rt.getForeground(t),p=Rt.getBackground(t);return n!==0&&(a=n),s!==8&&(c=s),o!==null&&(u=o?1:0),r!==-1&&(f=r),l!==0&&(h=l),i!==0&&(p=i),(a<<0|c<<8|u<<10|f<<11|h<<15|p<<24)>>>0}};function Lo(e,t){const n=[],s=yv(e);let o=s.next();for(;o!==null;){let a=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let c=l();if(n.push({matcher:c,priority:a}),o!==",")break;o=s.next()}return n;function r(){if(o==="-"){o=s.next();const a=r();return c=>!!a&&!a(c)}if(o==="("){o=s.next();const a=i();return o===")"&&(o=s.next()),a}if(Xi(o)){const a=[];do a.push(o),o=s.next();while(Xi(o));return c=>t(a,c)}return null}function l(){const a=[];let c=r();for(;c;)a.push(c),c=r();return u=>a.every(f=>f(u))}function i(){const a=[];let c=l();for(;c&&(a.push(c),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");c=l()}return u=>a.some(f=>f(u))}}function Xi(e){return!!e&&!!e.match(/[\w\.:]+/)}function yv(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=t.exec(e),s}}}function vu(e){typeof e.dispose=="function"&&e.dispose()}var Es=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},bv=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},kv=class{constructor(){L(this,"_references",[]);L(this,"_seenReferenceKeys",new Set);L(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},wv=class{constructor(e,t){L(this,"seenFullScopeRequests",new Set);L(this,"seenPartialScopeRequests",new Set);L(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Es(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new kv;for(const n of e)_v(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Es){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function _v(e,t,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const r=n.lookup(t);e instanceof Es?po({baseGrammar:r,selfGrammar:o},s):sl(e.ruleName,{baseGrammar:r,selfGrammar:o,repository:o.repository},s);const l=n.injections(e.scopeName);if(l)for(const i of l)s.add(new Es(i))}function sl(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];Mo([s],t,n)}}function po(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Mo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Mo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Mo(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?cu({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&Mo(s.patterns,{...t,repository:o},n);const r=s.include;if(!r)continue;const l=yu(r);switch(l.kind){case 0:po({...t,selfGrammar:t.baseGrammar},n);break;case 1:po(t,n);break;case 2:sl(l.ruleName,{...t,repository:o},n);break;case 3:case 4:const i=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const a={baseGrammar:t.baseGrammar,selfGrammar:i,repository:o};l.kind===4?sl(l.ruleName,a,n):po(a,n)}else l.kind===4?n.add(new bv(l.scopeName,l.ruleName)):n.add(new Es(l.scopeName));break}}}var Sv=class{constructor(){L(this,"kind",0)}},xv=class{constructor(){L(this,"kind",1)}},Cv=class{constructor(e){L(this,"kind",2);this.ruleName=e}},$v=class{constructor(e){L(this,"kind",3);this.scopeName=e}},Tv=class{constructor(e,t){L(this,"kind",4);this.scopeName=e,this.ruleName=t}};function yu(e){if(e==="$base")return new Sv;if(e==="$self")return new xv;const t=e.indexOf("#");if(t===-1)return new $v(e);if(t===0)return new Cv(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new Tv(n,s)}}var Av=/\\(\d+)/,ea=/\\(\d+)/g,Rv=-1,bu=-2;var Gs=class{constructor(e,t,n,s){L(this,"$location");L(this,"id");L(this,"_nameIsCapturing");L(this,"_name");L(this,"_contentNameIsCapturing");L(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=to.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=to.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${uu(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:to.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:to.replaceCaptures(this._contentName,e,t)}},Ev=class extends Gs{constructor(t,n,s,o,r){super(t,n,s,o);L(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,s,o){throw new Error("Not supported!")}},Iv=class extends Gs{constructor(t,n,s,o,r){super(t,n,s,null);L(this,"_match");L(this,"captures");L(this,"_cachedCompiledPatterns");this._match=new Is(o,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t).compileAG(t,s,o)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ls,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ta=class extends Gs{constructor(t,n,s,o,r){super(t,n,s,o);L(this,"hasMissingPatterns");L(this,"patterns");L(this,"_cachedCompiledPatterns");this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const s of this.patterns)t.getRule(s).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t).compileAG(t,s,o)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ls,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ol=class extends Gs{constructor(t,n,s,o,r,l,i,a,c,u){super(t,n,s,o);L(this,"_begin");L(this,"beginCaptures");L(this,"_end");L(this,"endHasBackReferences");L(this,"endCaptures");L(this,"applyEndPatternLast");L(this,"hasMissingPatterns");L(this,"patterns");L(this,"_cachedCompiledPatterns");this._begin=new Is(r,this.id),this.beginCaptures=l,this._end=new Is(i||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t,n).compileAG(t,s,o)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ls;for(const s of this.patterns)t.getRule(s).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},Po=class extends Gs{constructor(t,n,s,o,r,l,i,a,c){super(t,n,s,o);L(this,"_begin");L(this,"beginCaptures");L(this,"whileCaptures");L(this,"_while");L(this,"whileHasBackReferences");L(this,"hasMissingPatterns");L(this,"patterns");L(this,"_cachedCompiledPatterns");L(this,"_cachedCompiledWhilePatterns");this._begin=new Is(r,this.id),this.beginCaptures=l,this.whileCaptures=a,this._while=new Is(i,bu),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,s,o){return this._getCachedCompiledPatterns(t).compileAG(t,s,o)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ls;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,s,o){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,s,o)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ls,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},ku=class ot{static createCaptureRule(t,n,s,o,r){return t.registerRule(l=>new Ev(n,l,s,o,r))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Iv(t.$vscodeTextmateLocation,t.id,t.name,t.match,ot._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=cu({},s,t.repository));let r=t.patterns;return typeof r>"u"&&t.include&&(r=[{include:t.include}]),new ta(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ot._compilePatterns(r,n,s))}return t.while?new Po(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ot._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,ot._compileCaptures(t.whileCaptures||t.captures,n,s),ot._compilePatterns(t.patterns,n,s)):new ol(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ot._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,ot._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,ot._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let r=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const i=parseInt(l,10);i>r&&(r=i)}for(let l=0;l<=r;l++)o[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const i=parseInt(l,10);let a=0;t[l].patterns&&(a=ot.getCompiledRuleId(t[l],n,s)),o[i]=ot.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,a)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let r=0,l=t.length;r<l;r++){const i=t[r];let a=-1;if(i.include){const c=yu(i.include);switch(c.kind){case 0:case 1:a=ot.getCompiledRuleId(s[i.include],n,s);break;case 2:let u=s[c.ruleName];u&&(a=ot.getCompiledRuleId(u,n,s));break;case 3:case 4:const f=c.scopeName,h=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(f,s);if(p)if(h){let g=p.repository[h];g&&(a=ot.getCompiledRuleId(g,n,p.repository))}else a=ot.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=ot.getCompiledRuleId(i,n,s);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof ta||c instanceof ol||c instanceof Po)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(a)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Is=class wu{constructor(t,n){L(this,"source");L(this,"ruleId");L(this,"hasAnchor");L(this,"hasBackReferences");L(this,"_anchorCache");if(t&&typeof t=="string"){const s=t.length;let o=0,r=[],l=!1;for(let i=0;i<s;i++)if(t.charAt(i)==="\\"&&i+1<s){const c=t.charAt(i+1);c==="z"?(r.push(t.substring(o,i)),r.push("$(?!\\n)(?<!\\n)"),o=i+2):(c==="A"||c==="G")&&(l=!0),i++}this.hasAnchor=l,o===0?this.source=t:(r.push(t.substring(o,s)),this.source=r.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Av.test(this.source):this.hasBackReferences=!1}clone(){return new wu(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(o=>t.substring(o.start,o.end));return ea.lastIndex=0,this.source.replace(ea,(o,r)=>hu(s[parseInt(r,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],s=[],o=[],r,l,i,a;for(r=0,l=this.source.length;r<l;r++)i=this.source.charAt(r),t[r]=i,n[r]=i,s[r]=i,o[r]=i,i==="\\"&&r+1<l&&(a=this.source.charAt(r+1),a==="A"?(t[r+1]="",n[r+1]="",s[r+1]="A",o[r+1]="A"):a==="G"?(t[r+1]="",n[r+1]="G",s[r+1]="",o[r+1]="G"):(t[r+1]=a,n[r+1]=a,s[r+1]=a,o[r+1]=a),r++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ls=class{constructor(){L(this,"_items");L(this,"_hasAnchors");L(this,"_cached");L(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new na(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let s=this._items.map(o=>o.resolveAnchors(t,n));return new na(e,s,this._items.map(o=>o.ruleId))}},na=class{constructor(e,t,n){L(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
77
|
+
`)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Ar=class{constructor(e,t){this.languageId=e,this.tokenType=t}},on,Lv=(on=class{constructor(t,n){L(this,"_defaultAttributes");L(this,"_embeddedLanguagesMatcher");L(this,"_getBasicScopeAttributes",new pu(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Ar(n,s)}));this._defaultAttributes=new Ar(t,8),this._embeddedLanguagesMatcher=new Mv(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?on._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(on.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},L(on,"_NULL_SCOPE_METADATA",new Ar(0,0)),L(on,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),on),Mv=class{constructor(e){L(this,"values");L(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,s])=>hu(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},sa=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function _u(e,t,n,s,o,r,l,i){const a=t.content.length;let c=!1,u=-1;if(l){const p=Pv(e,t,n,s,o,r);o=p.stack,s=p.linePos,n=p.isFirstLine,u=p.anchorPosition}const f=Date.now();for(;!c;){if(i!==0&&Date.now()-f>i)return new sa(o,!0);h()}return new sa(o,!1);function h(){const p=Nv(e,t,n,s,o,u);if(!p){r.produce(o,a),c=!0;return}const g=p.captureIndices,w=p.matchedRuleId,b=g&&g.length>0?g[0].end>s:!1;if(w===Rv){const k=o.getRule(e);r.produce(o,g[0].start),o=o.withContentNameScopesList(o.nameScopesList),hs(e,t,n,o,r,k.endCaptures,g),r.produce(o,g[0].end);const S=o;if(o=o.parent,u=S.getAnchorPos(),!b&&S.getEnterPos()===s){o=S,r.produce(o,a),c=!0;return}}else{const k=e.getRule(w);r.produce(o,g[0].start);const S=o,$=k.getName(t.content,g),T=o.contentNameScopesList.pushAttributed($,e);if(o=o.push(w,s,u,g[0].end===a,null,T,T),k instanceof ol){const F=k;hs(e,t,n,o,r,F.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const O=F.getContentName(t.content,g),C=T.pushAttributed(O,e);if(o=o.withContentNameScopesList(C),F.endHasBackReferences&&(o=o.withEndRule(F.getEndWithResolvedBackReferences(t.content,g))),!b&&S.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(k instanceof Po){const F=k;hs(e,t,n,o,r,F.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const O=F.getContentName(t.content,g),C=T.pushAttributed(O,e);if(o=o.withContentNameScopesList(C),F.whileHasBackReferences&&(o=o.withEndRule(F.getWhileWithResolvedBackReferences(t.content,g))),!b&&S.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(hs(e,t,n,o,r,k.captures,g),r.produce(o,g[0].end),o=o.pop(),!b){o=o.safePop(),r.produce(o,a),c=!0;return}}g[0].end>s&&(s=g[0].end,n=!1)}}function Pv(e,t,n,s,o,r){let l=o.beginRuleCapturedEOL?0:-1;const i=[];for(let a=o;a;a=a.pop()){const c=a.getRule(e);c instanceof Po&&i.push({rule:c,stack:a})}for(let a=i.pop();a;a=i.pop()){const{ruleScanner:c,findOptions:u}=Bv(a.rule,e,a.stack.endRule,n,s===l),f=c.findNextMatchSync(t,s,u);if(f){if(f.ruleId!==bu){o=a.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(r.produce(a.stack,f.captureIndices[0].start),hs(e,t,n,a.stack,r,a.rule.whileCaptures,f.captureIndices),r.produce(a.stack,f.captureIndices[0].end),l=f.captureIndices[0].end,f.captureIndices[0].end>s&&(s=f.captureIndices[0].end,n=!1))}else{o=a.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:l,isFirstLine:n}}function Nv(e,t,n,s,o,r){const l=Ov(e,t,n,s,o,r),i=e.getInjections();if(i.length===0)return l;const a=Dv(i,e,t,n,s,o,r);if(!a)return l;if(!l)return a;const c=l.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:l}function Ov(e,t,n,s,o,r){const l=o.getRule(e),{ruleScanner:i,findOptions:a}=Su(l,e,o.endRule,n,s===r),c=i.findNextMatchSync(t,s,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Dv(e,t,n,s,o,r,l){let i=Number.MAX_VALUE,a=null,c,u=0;const f=r.contentNameScopesList.getScopeNames();for(let h=0,p=e.length;h<p;h++){const g=e[h];if(!g.matcher(f))continue;const w=t.getRule(g.ruleId),{ruleScanner:b,findOptions:k}=Su(w,t,null,s,o===l),S=b.findNextMatchSync(n,o,k);if(!S)continue;const $=S.captureIndices[0].start;if(!($>=i)&&(i=$,a=S.captureIndices,c=S.ruleId,u=g.priority,i===o))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function Su(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function Bv(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function hs(e,t,n,s,o,r,l){if(r.length===0)return;const i=t.content,a=Math.min(r.length,l.length),c=[],u=l[0].end;for(let f=0;f<a;f++){const h=r[f];if(h===null)continue;const p=l[f];if(p.length===0)continue;if(p.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=p.start;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?o.produceFromScopes(c[c.length-1].scopes,p.start):o.produce(s,p.start),h.retokenizeCapturedWithRuleId){const w=h.getName(i,l),b=s.contentNameScopesList.pushAttributed(w,e),k=h.getContentName(i,l),S=b.pushAttributed(k,e),$=s.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,b,S),T=e.createOnigString(i.substring(0,p.end));_u(e,T,n&&p.start===0,p.start,$,o,!1,0),vu(T);continue}const g=h.getName(i,l);if(g!==null){const b=(c.length>0?c[c.length-1].scopes:s.contentNameScopesList).pushAttributed(g,e);c.push(new Gv(b,p.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Gv=class{constructor(e,t){L(this,"scopes");L(this,"endPos");this.scopes=e,this.endPos=t}};function jv(e,t,n,s,o,r,l,i){return new Fv(e,t,n,s,o,r,l,i)}function oa(e,t,n,s,o){const r=Lo(t,No),l=ku.getCompiledRuleId(n,s,o.repository);for(const i of r)e.push({debugSelector:t,matcher:i.matcher,ruleId:l,grammar:o,priority:i.priority})}function No(e,t){if(t.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<t.length;o++)if(Uv(t[o],s))return n=o+1,!0;return!1})}function Uv(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Fv=class{constructor(e,t,n,s,o,r,l,i){L(this,"_rootId");L(this,"_lastRuleId");L(this,"_ruleId2desc");L(this,"_includedGrammars");L(this,"_grammarRepository");L(this,"_grammar");L(this,"_injections");L(this,"_basicScopeAttributesProvider");L(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=r,this._onigLib=i,this._basicScopeAttributesProvider=new Lv(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=ra(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const a of Object.keys(o)){const c=Lo(a,No);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let l in o)oa(t,l,o[l],this,s);const r=this._grammarRepository.injections(n);r&&r.forEach(l=>{const i=this.getExternalGrammar(l);if(i){const a=i.injectionSelector;a&&oa(t,a,i,this,i)}})}return t.sort((o,r)=>o.priority-r.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ra(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const s=this._tokenize(e,t,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,t,n=0){const s=this._tokenize(e,t,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,t,n,s){this._rootId===-1&&(this._rootId=ku.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===rl.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),f=es.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),h=this.getRule(this._rootId).getName(null,null);let p;h?p=ks.createRootAndLookUpScopeName(h,f,this):p=ks.createRoot("unknown",f),t=new rl(null,this._rootId,-1,-1,!1,null,p,p)}else o=!1,t.reset();e=e+`
|
|
78
|
+
`;const r=this.createOnigString(e),l=r.content.length,i=new Hv(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=_u(this,r,o,0,t,i,!0,s);return vu(r),{lineLength:l,lineTokens:i,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function ra(e,t){return e=iv(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ks=class Wt{constructor(t,n,s){this.parent=t,this.scopePath=n,this.tokenAttributes=s}static fromExtension(t,n){let s=t,o=(t==null?void 0:t.scopePath)??null;for(const r of n)o=Tr.push(o,r.scopeNames),s=new Wt(s,o,r.encodedTokenAttributes);return s}static createRoot(t,n){return new Wt(null,new Tr(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),r=new Tr(null,t),l=s.themeProvider.themeMatch(r),i=Wt.mergeAttributes(n,o,l);return new Wt(null,r,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Wt.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,s){let o=-1,r=0,l=0;return s!==null&&(o=s.fontStyle,r=s.foregroundId,l=s.backgroundId),es.set(t,n.languageId,n.tokenType,null,o,r,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Wt._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const r of s)o=Wt._pushAttributed(o,r,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),r=t.scopePath.push(n),l=s.themeProvider.themeMatch(r),i=Wt.mergeAttributes(t.tokenAttributes,o,l);return new Wt(t,r,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var o;const n=[];let s=this;for(;s&&s!==t;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(((o=s.parent)==null?void 0:o.scopePath)??null)}),s=s.parent;return s===t?n.reverse():void 0}},Lt,rl=(Lt=class{constructor(t,n,s,o,r,l,i,a){L(this,"_stackElementBrand");L(this,"_enterPos");L(this,"_anchorPos");L(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=r,this.endRule=l,this.nameScopesList=i,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(t){return t===null?!1:Lt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?ks.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Lt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,r,l,i){return new Lt(this,t,n,s,o,r,l,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var s,o;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(s=this.nameScopesList)==null?void 0:s.toString()}, ${(o=this.contentNameScopesList)==null?void 0:o.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Lt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,s;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((s=this.contentNameScopesList)==null?void 0:s.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const s=ks.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Lt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,ks.fromExtension(s,n.contentNameScopesList))}},L(Lt,"NULL",new Lt(null,0,0,0,!1,null,null,null)),Lt),zv=class{constructor(e,t){L(this,"balancedBracketScopes");L(this,"unbalancedBracketScopes");L(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Lo(n,No).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Lo(n,No).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Hv=class{constructor(e,t,n,s){L(this,"_emitBinaryTokens");L(this,"_lineText");L(this,"_tokens");L(this,"_binaryTokens");L(this,"_lastTokenEndIndex");L(this,"_tokenTypeOverrides");this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var s;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let o=(e==null?void 0:e.tokenAttributes)??0,r=!1;if((s=this.balancedBracketSelectors)!=null&&s.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const l=(e==null?void 0:e.getScopeNames())??[];for(const i of this._tokenTypeOverrides)i.matcher(l)&&(o=es.set(o,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(l))}if(r&&(o=es.set(o,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,o=this._binaryTokens.length;s<o;s++)n[s]=this._binaryTokens[s];return n}},qv=class{constructor(e,t){L(this,"_grammars",new Map);L(this,"_rawGrammars",new Map);L(this,"_injectionGrammars",new Map);L(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,s,o){if(!this._grammars.has(e)){let r=this._rawGrammars.get(e);if(!r)return null;this._grammars.set(e,jv(e,r,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},Vv=class{constructor(t){L(this,"_options");L(this,"_syncRegistry");L(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new qv(Io.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Io.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,s){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,n,s){return this._loadGrammar(t,n,s.embeddedLanguages,s.tokenTypes,new zv(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,r){const l=new wv(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(i=>this._loadSingleGrammar(i.scopeName)),l.processQueue();return this._grammarForScopeName(t,n,s,o,r)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(t,n=[],s=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,s,o)}_grammarForScopeName(t,n=0,s=null,o=null,r=null){return this._syncRegistry.grammarForScopeName(t,n,s,o,r)}},ll=rl.NULL;const Wv=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class js{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}js.prototype.normal={};js.prototype.property={};js.prototype.space=void 0;function xu(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new js(n,s,t)}function il(e){return e.toLowerCase()}class mt{constructor(t,n){this.attribute=n,this.property=t}}mt.prototype.attribute="";mt.prototype.booleanish=!1;mt.prototype.boolean=!1;mt.prototype.commaOrSpaceSeparated=!1;mt.prototype.commaSeparated=!1;mt.prototype.defined=!1;mt.prototype.mustUseProperty=!1;mt.prototype.number=!1;mt.prototype.overloadedBoolean=!1;mt.prototype.property="";mt.prototype.spaceSeparated=!1;mt.prototype.space=void 0;let Kv=0;const he=Gn(),We=Gn(),al=Gn(),q=Gn(),Ne=Gn(),Nn=Gn(),bt=Gn();function Gn(){return 2**++Kv}const cl=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:We,commaOrSpaceSeparated:bt,commaSeparated:Nn,number:q,overloadedBoolean:al,spaceSeparated:Ne},Symbol.toStringTag,{value:"Module"})),Rr=Object.keys(cl);class Fl extends mt{constructor(t,n,s,o){let r=-1;if(super(t,n),la(this,"space",o),typeof s=="number")for(;++r<Rr.length;){const l=Rr[r];la(this,Rr[r],(s&cl[l])===cl[l])}}}Fl.prototype.defined=!0;function la(e,t,n){n&&(e[t]=n)}function ts(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const r=new Fl(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(r.mustUseProperty=!0),t[s]=r,n[il(s)]=s,n[il(r.attribute)]=s}return new js(t,n,e.space)}const Cu=ts({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:Ne,ariaCurrent:null,ariaDescribedBy:Ne,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Ne,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Ne,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ne,ariaLevel:q,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Ne,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Ne,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:We,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $u(e,t){return t in e?e[t]:t}function Tu(e,t){return $u(e,t.toLowerCase())}const Zv=ts({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:Ne,accessKey:Ne,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alpha:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:Ne,autoFocus:he,autoPlay:he,blocking:Ne,capture:null,charSet:null,checked:he,cite:null,className:Ne,closedBy:null,colorSpace:null,cols:q,colSpan:q,command:null,commandFor:null,content:null,contentEditable:We,controls:he,controlsList:Ne,coords:q|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:al,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:Ne,height:q,hidden:al,high:q,href:null,hrefLang:null,htmlFor:Ne,httpEquiv:Ne,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:Ne,itemRef:Ne,itemScope:he,itemType:Ne,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:he,optimum:q,pattern:null,ping:Ne,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:Ne,required:he,reversed:he,rows:q,rowSpan:q,sandbox:Ne,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootCustomElementRegistry:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shadowRootSerializable:he,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:We,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ne,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:he,disablePictureInPicture:he,disableRemotePlayback:he,exportParts:Nn,part:Ne,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:Tu}),Yv=ts({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bt,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:Ne,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:bt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ne,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bt,rev:bt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bt,requiredFeatures:bt,requiredFonts:bt,requiredFormats:bt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:bt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bt,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$u}),Au=ts({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ru=ts({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Tu}),Eu=ts({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Jv=/[A-Z]/g,ia=/-[a-z]/g,Qv=/^data[-\w.:]+$/i;function Xv(e,t){const n=il(t);let s=t,o=mt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Qv.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(ia,ty);s="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!ia.test(r)){let l=r.replace(Jv,ey);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Fl}return new o(s,t)}function ey(e){return"-"+e.toLowerCase()}function ty(e){return e.charAt(1).toUpperCase()}const ny=xu([Cu,Zv,Au,Ru,Eu],"html"),Iu=xu([Cu,Yv,Au,Ru,Eu],"svg"),aa={}.hasOwnProperty;function sy(e,t){const n=t||{};function s(o,...r){let l=s.invalid;const i=s.handlers;if(o&&aa.call(o,e)){const a=String(o[e]);l=aa.call(i,a)?i[a]:s.unknown}if(l)return l.call(this,o,...r)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const oy=/["&'<>`]/g,ry=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ly=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,iy=/[|\\{}()[\]^$+*?.]/g,ca=new WeakMap;function ay(e,t){if(e=e.replace(t.subset?cy(t.subset):oy,s),t.subset||t.escapeOnly)return e;return e.replace(ry,n).replace(ly,s);function n(o,r,l){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,l.charCodeAt(r+2),t)}function s(o,r,l){return t.format(o.charCodeAt(0),l.charCodeAt(r+1),t)}}function cy(e){let t=ca.get(e);return t||(t=uy(e),ca.set(e,t)),t}function uy(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(iy,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const dy=/[\dA-Fa-f]/;function fy(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!dy.test(String.fromCharCode(t))?s:s+";"}const hy=/\d/;function py(e,t,n){const s="&#"+String(e);return n&&t&&!hy.test(String.fromCharCode(t))?s:s+";"}const gy=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Er={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},my=["cent","copy","divide","gt","lt","not","para","times"],Lu={}.hasOwnProperty,ul={};let no;for(no in Er)Lu.call(Er,no)&&(ul[Er[no]]=no);const vy=/[^\dA-Za-z]/;function yy(e,t,n,s){const o=String.fromCharCode(e);if(Lu.call(ul,o)){const r=ul[o],l="&"+r;return n&&gy.includes(r)&&!my.includes(r)&&(!s||t&&t!==61&&vy.test(String.fromCharCode(t)))?l:l+";"}return""}function by(e,t,n){let s=fy(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=yy(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const r=py(e,t,n.omitOptionalSemicolons);r.length<s.length&&(s=r)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Jn(e,t){return ay(e,Object.assign({format:by},t))}const ky=/^>|^->|<!--|-->|--!>|<!-$/g,wy=[">"],_y=["<",">"];function Sy(e,t,n,s){return s.settings.bogusComments?"<?"+Jn(e.value,Object.assign({},s.settings.characterReferences,{subset:wy}))+">":"<!--"+e.value.replace(ky,o)+"-->";function o(r){return Jn(r,Object.assign({},s.settings.characterReferences,{subset:_y}))}}function xy(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function ua(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(t);for(;o!==-1;)s++,o=n.indexOf(t,o+t.length);return s}function Cy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function $y(e){return e.join(" ").trim()}const Ty=/[ \t\n\f\r]/g;function zl(e){return typeof e=="object"?e.type==="text"?da(e.value):!1:da(e)}function da(e){return e.replace(Ty,"")===""}const Je=Pu(1),Mu=Pu(-1),Ay=[];function Pu(e){return t;function t(n,s,o){const r=n?n.children:Ay;let l=(s||0)+e,i=r[l];if(!o)for(;i&&zl(i);)l+=e,i=r[l];return i}}const Ry={}.hasOwnProperty;function Nu(e){return t;function t(n,s,o){return Ry.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const Hl=Nu({body:Iy,caption:Ir,colgroup:Ir,dd:Ny,dt:Py,head:Ir,html:Ey,li:My,optgroup:Oy,option:Dy,p:Ly,rp:fa,rt:fa,tbody:Gy,td:ha,tfoot:jy,th:ha,thead:By,tr:Uy});function Ir(e,t,n){const s=Je(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&zl(s.value.charAt(0)))}function Ey(e,t,n){const s=Je(n,t);return!s||s.type!=="comment"}function Iy(e,t,n){const s=Je(n,t);return!s||s.type!=="comment"}function Ly(e,t,n){const s=Je(n,t);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function My(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&s.tagName==="li"}function Py(e,t,n){const s=Je(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Ny(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function fa(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function Oy(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function Dy(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function By(e,t,n){const s=Je(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Gy(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function jy(e,t,n){return!Je(n,t)}function Uy(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function ha(e,t,n){const s=Je(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const Fy=Nu({body:qy,colgroup:Vy,head:Hy,html:zy,tbody:Wy});function zy(e){const t=Je(e,-1);return!t||t.type!=="comment"}function Hy(e){const t=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(t.has(s.tagName))return!1;t.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function qy(e){const t=Je(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&zl(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Vy(e,t,n){const s=Mu(n,t),o=Je(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Hl(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Wy(e,t,n){const s=Mu(n,t),o=Je(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Hl(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const so={name:[[`
|
|
79
|
+
\f\r &/=>`.split(""),`
|
|
80
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
81
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
82
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
83
|
+
\f\r &>`.split(""),`\0
|
|
84
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
85
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
86
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Ky(e,t,n,s){const o=s.schema,r=o.space==="svg"?!1:s.settings.omitOptionalTags;let l=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const i=[];let a;o.space==="html"&&e.tagName==="svg"&&(s.schema=Iu);const c=Zy(s,e.properties),u=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,u&&(l=!1),(c||!r||!Fy(e,t,n))&&(i.push("<",e.tagName,c?" "+c:""),l&&(o.space==="svg"||s.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!s.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(u),!l&&(!r||!Hl(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function Zy(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const r=Yy(e,o,t[o]);r&&n.push(r)}}for(;++s<n.length;){const r=e.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&r!=='"'&&r!=="'"&&(n[s]+=" ")}return n.join("")}function Yy(e,t,n){const s=Xv(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,r=e.settings.allowDangerousCharacters?0:1;let l=e.quote,i;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=Jn(s.attribute,Object.assign({},e.settings.characterReferences,{subset:so.name[o][r]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?Cy:$y)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(i=Jn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:so.unquoted[o][r]}))),i!==n&&(e.settings.quoteSmart&&ua(n,l)>ua(n,e.alternative)&&(l=e.alternative),i=l+Jn(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?so.single:so.double)[o][r],attribute:!0}))+l),a+(i&&"="+i))}const Jy=["<","&"];function Ou(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Jn(e.value,Object.assign({},s.settings.characterReferences,{subset:Jy}))}function Qy(e,t,n,s){return s.settings.allowDangerousHtml?e.value:Ou(e,t,n,s)}function Xy(e,t,n,s){return s.all(e)}const eb=sy("type",{invalid:tb,unknown:nb,handlers:{comment:Sy,doctype:xy,element:Ky,raw:Qy,root:Xy,text:Ou}});function tb(e){throw new Error("Expected node, not `"+e+"`")}function nb(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const sb={},ob={},rb=[];function lb(e,t){const n=t||sb,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:ib,all:ab,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Wv,characterReferences:n.characterReferences||ob,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Iu:ny,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ib(e,t,n){return eb(e,t,n,this)}function ab(e){const t=[],n=e&&e.children||rb;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function Oo(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,r]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof r=="string"?n[o]=r:o===s&&Object.assign(n,r);return n}function wn(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function cb(e){return Array.isArray(e)?e:[e]}async function Du(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ql(e){return!e||["plaintext","txt","text","plain"].includes(e)}function ub(e){return e==="ansi"||ql(e)}function Vl(e){return e==="none"}function db(e){return Vl(e)}function Bu(e,t){var s;if(!t)return e;e.properties||(e.properties={}),(s=e.properties).class||(s.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function ir(e,t=!1){var r;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let l=0;l<n.length;l+=2){const i=t?n[l]+(n[l+1]||""):n[l];o.push([i,s]),s+=n[l].length,s+=((r=n[l+1])==null?void 0:r.length)||0}return o}function fb(e){const t=ir(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=o,l=0;for(const i of t){if(r<i.length)break;r-=i.length,l++}return{line:l,character:r}}function s(o,r){let l=0;for(let i=0;i<o;i++)l+=t[i].length;return l+=r,l}return{lines:t,indexToPos:n,posToIndex:s}}const Wl="light-dark()",hb=["color","background-color"];function pb(e,t){let n=0;const s=[];for(const o of t)o>n&&s.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&s.push({...e,content:e.content.slice(n),offset:e.offset+n}),s}function gb(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const r=n.filter(l=>o.offset<l&&l<o.offset+o.content.length).map(l=>l-o.offset).sort((l,i)=>l-i);return r.length?pb(o,r):o})):e}function mb(e,t,n,s,o="css-vars"){const r={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(u=>Do(e.variants[u])),i=new Set(l.flatMap(u=>Object.keys(u))),a={},c=(u,f)=>{const h=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+t[u]+(f==="color"?"":h)};return l.forEach((u,f)=>{for(const h of i){const p=u[h]||"inherit";if(f===0&&s&&hb.includes(h))if(s===Wl&&l.length>1){const g=t.findIndex(S=>S==="light"),w=t.findIndex(S=>S==="dark");if(g===-1||w===-1)throw new et('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=l[g][h]||"inherit",k=l[w][h]||"inherit";a[h]=`light-dark(${b}, ${k})`,o==="css-vars"&&(a[c(f,h)]=p)}else a[h]=p;else o==="css-vars"&&(a[c(f,h)]=p)}}),r.htmlStyle=a,r}function Do(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ct.Italic&&(t["font-style"]="italic"),e.fontStyle&ct.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ct.Underline&&n.push("underline"),e.fontStyle&ct.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function dl(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Gu=new WeakMap;function ar(e,t){Gu.set(e,t)}function Ms(e){return Gu.get(e)}class ns{constructor(...t){L(this,"_stacks",{});L(this,"lang");if(t.length===2){const[n,s]=t;this.lang=s,this._stacks=n}else{const[n,s,o]=t;this.lang=s,this._stacks={[o]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new ns(Object.fromEntries(cb(n).map(s=>[s,ll])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return vb(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function vb(e){const t=[],n=new Set;function s(o){var l;if(n.has(o))return;n.add(o);const r=(l=o==null?void 0:o.nameScopesList)==null?void 0:l.scopeName;r&&t.push(r),o.parent&&s(o.parent)}return s(e),t}function yb(e,t){if(!(e instanceof ns))throw new et("Invalid grammar state");return e.getInternalStack(t)}function bb(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new et(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...o.indexToPos(l),offset:l}}else{const i=o.lines[l.line];if(i===void 0)throw new et(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${o.lines.length}`);let a=l.character;if(a<0&&(a=i.length+a),a<0||a>i.length)throw new et(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${i.length}`);return{...l,character:a,offset:o.posToIndex(l.line,a)}}};const o=fb(n.source),r=(n.options.decorations||[]).map(l=>({...l,start:s(l.start),end:s(l.end)}));kb(r),e.set(n.meta,{decorations:r,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var l;if(!((l=this.options.decorations)!=null&&l.length))return;const o=t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]);return gb(n,o)},code(n){var u;if(!((u=this.options.decorations)!=null&&u.length))return;const s=t(this),o=Array.from(n.children).filter(f=>f.type==="element"&&f.tagName==="span");if(o.length!==s.converter.lines.length)throw new et(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function r(f,h,p,g){const w=o[f];let b="",k=-1,S=-1;if(h===0&&(k=0),p===0&&(S=0),p===Number.POSITIVE_INFINITY&&(S=w.children.length),k===-1||S===-1)for(let T=0;T<w.children.length;T++)b+=ju(w.children[T]),k===-1&&b.length===h&&(k=T+1),S===-1&&b.length===p&&(S=T+1);if(k===-1)throw new et(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(S===-1)throw new et(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);const $=w.children.slice(k,S);if(!g.alwaysWrap&&$.length===w.children.length)i(w,g,"line");else if(!g.alwaysWrap&&$.length===1&&$[0].type==="element")i($[0],g,"token");else{const T={type:"element",tagName:"span",properties:{},children:$};i(T,g,"wrapper"),w.children.splice(k,$.length,T)}}function l(f,h){o[f]=i(o[f],h,"line")}function i(f,h,p){var b;const g=h.properties||{},w=h.transform||(k=>k);return f.tagName=h.tagName||"span",f.properties={...f.properties,...g,class:f.properties.class},(b=h.properties)!=null&&b.class&&Bu(f,h.properties.class),f=w(f,p)||f,f}const a=[],c=s.decorations.sort((f,h)=>h.start.offset-f.start.offset||f.end.offset-h.end.offset);for(const f of c){const{start:h,end:p}=f;if(h.line===p.line)r(h.line,h.character,p.character,f);else if(h.line<p.line){r(h.line,h.character,Number.POSITIVE_INFINITY,f);for(let g=h.line+1;g<p.line;g++)a.unshift(()=>l(g,f));r(p.line,0,p.character,f)}}a.forEach(f=>f())}}}function kb(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new et(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=t+1;s<e.length;s++){const o=e[s],r=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,l=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,i=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,a=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(r||l||i||a){if(r&&l||i&&a||i&&n.start.offset===n.end.offset||l&&o.start.offset===o.end.offset)continue;throw new et(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function ju(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ju).join(""):""}const wb=[bb()];function Bo(e){const t=_b(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...wb]}function _b(e){const t=[],n=[],s=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:s.push(o)}return{pre:t,post:n,normal:s}}var Ln=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Lr={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Sb(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const s=e.indexOf("m",n);if(s!==-1)return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function pa(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function xb(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)t.push({type:"resetAll"});else if(s<=9)Lr[s]&&t.push({type:"setDecoration",value:Lr[s]});else if(s<=29){const o=Lr[s-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ln[s-30]}});else if(s===38){const o=pa(e);o&&t.push({type:"setForegroundColor",value:o})}else if(s===39)t.push({type:"resetForegroundColor"});else if(s<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ln[s-40]}});else if(s===48){const o=pa(e);o&&t.push({type:"setBackgroundColor",value:o})}else s===49?t.push({type:"resetBackgroundColor"}):s===53?t.push({type:"setDecoration",value:"overline"}):s===55?t.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ln[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ln[s-100+8]}})}return t}function Cb(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let r=0;do{const l=Sb(s,r),i=l.sequence?s.substring(r,l.startPosition):s.substring(r);if(i.length>0&&o.push({value:i,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const a=xb(l.sequence);for(const c of a)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of a)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}r=l.position}while(r<s.length);return o}}}var $b={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Tb(e=$b){function t(i){return e[i]}function n(i){return`#${i.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let c=0;c<Ln.length;c++)s.push(t(Ln[c]));let i=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let f=0;f<6;f++)s.push(n([i[c],i[u],i[f]]));let a=8;for(let c=0;c<24;c++,a+=10)s.push(n([a,a,a]));return s}function r(i){return o()[i]}function l(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return r(i.index)}}return{value:l}}const Ab={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Rb(e,t,n){const s=Oo(e,n),o=ir(t),r=Object.fromEntries(Ln.map(a=>{var f;const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=(f=e.colors)==null?void 0:f[c];return[a,u||Ab[a]]})),l=Tb(r),i=Cb();return o.map(a=>i.parse(a[0]).map(c=>{let u,f;c.decorations.has("reverse")?(u=c.background?l.value(c.background):e.bg,f=c.foreground?l.value(c.foreground):e.fg):(u=c.foreground?l.value(c.foreground):e.fg,f=c.background?l.value(c.background):void 0),u=wn(u,s),f=wn(f,s),c.decorations.has("dim")&&(u=Eb(u));let h=ct.None;return c.decorations.has("bold")&&(h|=ct.Bold),c.decorations.has("italic")&&(h|=ct.Italic),c.decorations.has("underline")&&(h|=ct.Underline),c.decorations.has("strikethrough")&&(h|=ct.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:f,fontStyle:h}}))}function Eb(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const s=t[1];if(s.length===8){const o=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${o}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const o=s[0],r=s[1],l=s[2],i=s[3],a=Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${r}${r}${l}${l}${a}`}else if(s.length===3){const o=s[0],r=s[1],l=s[2];return`#${o}${o}${r}${r}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Kl(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(ql(o)||Vl(s))return ir(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:l}=e.setTheme(s);if(o==="ansi")return Rb(r,t,n);const i=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new et(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(r.name))throw new et(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return Lb(t,i,r,l,n)}function Ib(...e){if(e.length===2)return Ms(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:r=t.getLoadedThemes()[0]}=s;if(ql(o)||Vl(r))throw new et("Plain language does not have grammar state");if(o==="ansi")throw new et("ANSI language does not have grammar state");const{theme:l,colorMap:i}=t.setTheme(r),a=t.getLanguage(o);return new ns(Zl(n,a,l,i,s).stateStack,a.name,l.name)}function Lb(e,t,n,s,o){const r=Zl(e,t,n,s,o),l=new ns(r.stateStack,t.name,n.name);return ar(r.tokens,l),r.tokens}function Zl(e,t,n,s,o){const r=Oo(n,o),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:i=500}=o,a=ir(e);let c=o.grammarState?yb(o.grammarState,n.name)??ll:o.grammarContextCode!=null?Zl(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:ll,u=[];const f=[];for(let h=0,p=a.length;h<p;h++){const[g,w]=a[h];if(g===""){u=[],f.push([]);continue}if(l>0&&g.length>=l){u=[],f.push([{content:g,offset:w,color:"",fontStyle:0}]);continue}let b,k,S;o.includeExplanation&&(b=t.tokenizeLine(g,c,i),k=b.tokens,S=0);const $=t.tokenizeLine2(g,c,i),T=$.tokens.length/2;for(let F=0;F<T;F++){const O=$.tokens[2*F],C=F+1<T?$.tokens[2*F+2]:g.length;if(O===C)continue;const A=$.tokens[2*F+1],R=wn(s[es.getForeground(A)],r),J=es.getFontStyle(A),oe={content:g.substring(O,C),offset:w+O,color:R,fontStyle:J};if(o.includeExplanation){const H=[];if(o.includeExplanation!=="scopeName")for(const P of n.settings){let M;switch(typeof P.scope){case"string":M=P.scope.split(/,/).map(X=>X.trim());break;case"object":M=P.scope;break;default:continue}H.push({settings:P,selectors:M.map(X=>X.split(/ /))})}oe.explanation=[];let pe=0;for(;O+pe<C;){const P=k[S],M=g.substring(P.startIndex,P.endIndex);pe+=M.length,oe.explanation.push({content:M,scopes:o.includeExplanation==="scopeName"?Mb(P.scopes):Pb(H,P.scopes)}),S+=1}}u.push(oe)}f.push(u),u=[],c=$.ruleStack}return{tokens:f,stateStack:c}}function Mb(e){return e.map(t=>({scopeName:t}))}function Pb(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const r=t[s];n[s]={scopeName:r,themeMatches:Ob(e,r,t.slice(0,s))}}return n}function ga(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Nb(e,t,n){if(!ga(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)ga(e[s],n[o])&&(s-=1),o-=1;return s===-1}function Ob(e,t,n){const s=[];for(const{selectors:o,settings:r}of e)for(const l of o)if(Nb(l,t,n)){s.push(r);break}return s}function Uu(e,t,n){const s=Object.entries(n.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),o=s.map(a=>{const c=Kl(e,t,{...n,theme:a.theme}),u=Ms(c),f=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:f}}),r=Db(...o.map(a=>a.tokens)),l=r[0].map((a,c)=>a.map((u,f)=>{const h={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=u.explanation),r.forEach((p,g)=>{const{content:w,explanation:b,offset:k,...S}=p[c][f];h.variants[s[g].color]=S}),h})),i=o[0].state?new ns(Object.fromEntries(o.map(a=>{var c;return[a.theme,(c=a.state)==null?void 0:c.getInternalStack(a.theme)]})),o[0].state.lang):void 0;return i&&ar(l,i),l}function Db(...e){const t=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(a=>a[s]),r=t.map(()=>[]);t.forEach((a,c)=>a.push(r[c]));const l=o.map(()=>0),i=o.map(a=>a[0]);for(;i.every(a=>a);){const a=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){const u=i[c];u.content.length===a?(r[c].push(u),l[c]+=1,i[c]=o[c][l[c]]):(r[c].push({...u,content:u.content.slice(0,a)}),i[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return t}function Go(e,t,n){let s,o,r,l,i,a;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:f="css-vars"}=n,h=Object.entries(n.themes).filter(k=>k[1]).map(k=>({color:k[0],theme:k[1]})).sort((k,S)=>k.color===c?-1:S.color===c?1:0);if(h.length===0)throw new et("`themes` option must not be empty");const p=Uu(e,t,n);if(a=Ms(p),c&&Wl!==c&&!h.find(k=>k.color===c))throw new et(`\`themes\` option must contain the defaultColor key \`${c}\``);const g=h.map(k=>e.getTheme(k.theme)),w=h.map(k=>k.color);r=p.map(k=>k.map(S=>mb(S,w,u,c,f))),a&&ar(r,a);const b=h.map(k=>Oo(k.theme,n));o=ma(h,g,b,u,c,"fg",f),s=ma(h,g,b,u,c,"bg",f),l=`shiki-themes ${g.map(k=>k.name).join(" ")}`,i=c?void 0:[o,s].join(";")}else if("theme"in n){const c=Oo(n.theme,n);r=Kl(e,t,n);const u=e.getTheme(n.theme);s=wn(u.bg,c),o=wn(u.fg,c),l=u.name,a=Ms(r)}else throw new et("Invalid options, either `theme` or `themes` must be provided");return{tokens:r,fg:o,bg:s,themeName:l,rootStyle:i,grammarState:a}}function ma(e,t,n,s,o,r,l){return e.map((i,a)=>{const c=wn(t[a][r],n[a])||"inherit",u=`${s+i.color}${r==="bg"?"-bg":""}:${c}`;if(a===0&&o){if(o===Wl&&e.length>1){const f=e.findIndex(w=>w.color==="light"),h=e.findIndex(w=>w.color==="dark");if(f===-1||h===-1)throw new et('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const p=wn(t[f][r],n[f])||"inherit",g=wn(t[h][r],n[h])||"inherit";return`light-dark(${p}, ${g});${u}`}return c}return l==="css-vars"?u:null}).filter(i=>!!i).join(";")}function jo(e,t,n,s={meta:{},options:n,codeToHast:(o,r)=>jo(e,o,r),codeToTokens:(o,r)=>Go(e,o,r)}){var g,w;let o=t;for(const b of Bo(n))o=((g=b.preprocess)==null?void 0:g.call(s,o,n))||o;let{tokens:r,fg:l,bg:i,themeName:a,rootStyle:c,grammarState:u}=Go(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:h=!1}=n;f===!0?r=Gb(r):f==="never"&&(r=jb(r)),h&&(r=Ub(r));const p={...s,get source(){return o}};for(const b of Bo(n))r=((w=b.tokens)==null?void 0:w.call(p,r))||r;return Bb(r,{...n,fg:l,bg:i,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},p,u)}function Bb(e,t,n,s=Ms(e)){var w,b,k,S;const o=Bo(t),r=[],l={type:"root",children:[]},{structure:i="classic",tabindex:a="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),a!==!1&&a!=null&&(c.tabindex=a.toString());for(const[$,T]of Object.entries(t.meta||{}))$.startsWith("_")||(c[$]=T);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},f={type:"element",tagName:"code",properties:{},children:r};const h=[],p={...n,structure:i,addClassToHast:Bu,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return u},get code(){return f},get lines(){return h}};if(e.forEach(($,T)=>{var C,A;T&&(i==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&r.push({type:"text",value:`
|
|
87
|
+
`}));let F={type:"element",tagName:"span",properties:{class:"line"},children:[]},O=0;for(const R of $){let J={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]};const oe=dl(R.htmlStyle||Do(R));oe&&(J.properties.style=oe);for(const H of o)J=((C=H==null?void 0:H.span)==null?void 0:C.call(p,J,T+1,O,F,R))||J;i==="inline"?l.children.push(J):i==="classic"&&F.children.push(J),O+=R.content.length}if(i==="classic"){for(const R of o)F=((A=R==null?void 0:R.line)==null?void 0:A.call(p,F,T+1))||F;h.push(F),r.push(F)}else i==="inline"&&h.push(F)}),i==="classic"){for(const $ of o)f=((w=$==null?void 0:$.code)==null?void 0:w.call(p,f))||f;u.children.push(f);for(const $ of o)u=((b=$==null?void 0:$.pre)==null?void 0:b.call(p,u))||u;l.children.push(u)}else if(i==="inline"){const $=[];let T={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const C of l.children)C.type==="element"&&C.tagName==="br"?($.push(T),T={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(C.type==="element"||C.type==="text")&&T.children.push(C);$.push(T);let O={type:"element",tagName:"code",properties:{},children:$};for(const C of o)O=((k=C==null?void 0:C.code)==null?void 0:k.call(p,O))||O;l.children=[];for(let C=0;C<O.children.length;C++){C>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const A=O.children[C];A.type==="element"&&l.children.push(...A.children)}}let g=l;for(const $ of o)g=((S=$==null?void 0:$.root)==null?void 0:S.call(p,g))||g;return s&&ar(g,s),g}function Gb(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((r,l)=>{const a=!(r.fontStyle&&(r.fontStyle&ct.Underline||r.fontStyle&ct.Strikethrough));a&&r.content.match(/^\s+$/)&&t[l+1]?(o===void 0&&(o=r.offset),s+=r.content):s?(a?n.push({...r,offset:o,content:s+r.content}):n.push({content:s,offset:o},r),o=void 0,s=""):n.push(r)}),n})}function jb(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,r,l]=s;if(!o&&!l)return n;const i=[{...n,offset:n.offset+o.length,content:r}];return o&&i.unshift({content:o,offset:n.offset}),l&&i.push({content:l,offset:n.offset+o.length+r.length}),i}))}function Ub(e){return e.map(t=>{const n=[];for(const s of t){if(n.length===0){n.push({...s});continue}const o=n[n.length-1],r=dl(o.htmlStyle||Do(o)),l=dl(s.htmlStyle||Do(s)),i=o.fontStyle&&(o.fontStyle&ct.Underline||o.fontStyle&ct.Strikethrough),a=s.fontStyle&&(s.fontStyle&ct.Underline||s.fontStyle&ct.Strikethrough);!i&&!a&&r===l?o.content+=s.content:n.push({...s})}return n})}const Fb=lb;function zb(e,t,n){var r;const s={meta:{},options:n,codeToHast:(l,i)=>jo(e,l,i),codeToTokens:(l,i)=>Go(e,l,i)};let o=Fb(jo(e,t,n,s));for(const l of Bo(n))o=((r=l.postprocess)==null?void 0:r.call(s,o,n))||o;return o}const va={light:"#333333",dark:"#bbbbbb"},ya={light:"#fffffe",dark:"#1e1e1e"},ba="__shiki_resolved";function Yl(e){var i,a,c,u,f;if(e!=null&&e[ba])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:s}=t;if(!n||!s){const h=t.settings?t.settings.find(p=>!p.name&&!p.scope):void 0;(i=h==null?void 0:h.settings)!=null&&i.foreground&&(s=h.settings.foreground),(a=h==null?void 0:h.settings)!=null&&a.background&&(n=h.settings.background),!s&&((c=t==null?void 0:t.colors)!=null&&c["editor.foreground"])&&(s=t.colors["editor.foreground"]),!n&&((u=t==null?void 0:t.colors)!=null&&u["editor.background"])&&(n=t.colors["editor.background"]),s||(s=t.type==="light"?va.light:va.dark),n||(n=t.type==="light"?ya.light:ya.dark),t.fg=s,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const r=new Map;function l(h){var g;if(r.has(h))return r.get(h);o+=1;const p=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return(g=t.colorReplacements)!=null&&g[`#${p}`]?l(h):(r.set(h,p),p)}t.settings=t.settings.map(h=>{var b,k;const p=((b=h.settings)==null?void 0:b.foreground)&&!h.settings.foreground.startsWith("#"),g=((k=h.settings)==null?void 0:k.background)&&!h.settings.background.startsWith("#");if(!p&&!g)return h;const w={...h,settings:{...h.settings}};if(p){const S=l(h.settings.foreground);t.colorReplacements[S]=h.settings.foreground,w.settings.foreground=S}if(g){const S=l(h.settings.background);t.colorReplacements[S]=h.settings.background,w.settings.background=S}return w});for(const h of Object.keys(t.colors||{}))if((h==="editor.foreground"||h==="editor.background"||h.startsWith("terminal.ansi"))&&!((f=t.colors[h])!=null&&f.startsWith("#"))){const p=l(t.colors[h]);t.colorReplacements[p]=t.colors[h],t.colors[h]=p}return Object.defineProperty(t,ba,{enumerable:!1,writable:!1,value:!0}),t}async function Fu(e){return Array.from(new Set((await Promise.all(e.filter(t=>!ub(t)).map(async t=>await Du(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function zu(e){return(await Promise.all(e.map(async n=>db(n)?null:Yl(await Du(n))))).filter(n=>!!n)}let Hb=3;function qb(e,t=3){t>Hb||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Hn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Hu(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Hn(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class Vb extends Vv{constructor(n,s,o,r={}){super(n);L(this,"_resolvedThemes",new Map);L(this,"_resolvedGrammars",new Map);L(this,"_langMap",new Map);L(this,"_langGraph",new Map);L(this,"_textmateThemeCache",new WeakMap);L(this,"_loadedThemesCache",null);L(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=s,this._langs=o,this._alias=r,this._themes.map(l=>this.loadTheme(l)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=Yl(n);return s.name&&(this._resolvedThemes.set(s.name,s),this._loadedThemesCache=null),s}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let s=this._textmateThemeCache.get(n);s||(s=Io.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){return n=Hu(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var l,i,a,c;if(this.getGrammar(n.name))return;const s=new Set([...this._langMap.values()].filter(u=>{var f;return(f=u.embeddedLangsLazy)==null?void 0:f.includes(n.name)}));this._resolver.addLanguage(n);const o={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const r=this.loadGrammarWithConfiguration(n.scopeName,1,o);if(r.name=n.name,this._resolvedGrammars.set(n.name,r),n.aliases&&n.aliases.forEach(u=>{this._alias[u]=n.name}),this._loadedLanguagesCache=null,s.size)for(const u of s)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,(i=(l=this._syncRegistry)==null?void 0:l._injectionGrammars)==null||i.delete(u.scopeName),(c=(a=this._syncRegistry)==null?void 0:a._grammars)==null||c.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const r of n)this.resolveEmbeddedLanguages(r);const s=Array.from(this._langGraph.entries()),o=s.filter(([r,l])=>!l);if(o.length){const r=s.filter(([l,i])=>{if(!i)return!1;const a=i.embeddedLanguages||i.embeddedLangs;return a==null?void 0:a.some(c=>o.map(([u])=>u).includes(c))}).filter(l=>!o.includes(l));throw new Hn(`Missing languages ${o.map(([l])=>`\`${l}\``).join(", ")}, required by ${r.map(([l])=>`\`${l}\``).join(", ")}`)}for(const[r,l]of s)this._resolver.addLanguage(l);for(const[r,l]of s)this.loadLanguage(l)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const s=n.embeddedLanguages??n.embeddedLangs;if(s)for(const o of s)this._langGraph.set(o,this._langMap.get(o))}}class Wb{constructor(t,n){L(this,"_langs",new Map);L(this,"_scopeToLang",new Map);L(this,"_injections",new Map);L(this,"_onigLib");this._onigLib={createOnigScanner:s=>t.createScanner(s),createOnigString:s=>t.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let s=[];for(let o=1;o<=n.length;o++){const r=n.slice(0,o).join(".");s=[...s,...this._injections.get(r)||[]]}return s}}let cs=0;function Kb(e){cs+=1,e.warnings!==!1&&cs>=10&&cs%10===0&&console.warn(`[Shiki] ${cs} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Hn("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(Yl),o=new Wb(e.engine,n),r=new Vb(o,s,n,e.langAlias);let l;function i($){return Hu($,e.langAlias)}function a($){k();const T=r.getGrammar(typeof $=="string"?$:$.name);if(!T)throw new Hn(`Language \`${$}\` not found, you may need to load it first`);return T}function c($){if($==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();const T=r.getTheme($);if(!T)throw new Hn(`Theme \`${$}\` not found, you may need to load it first`);return T}function u($){k();const T=c($);l!==$&&(r.setTheme(T),l=$);const F=r.getColorMap();return{theme:T,colorMap:F}}function f(){return k(),r.getLoadedThemes()}function h(){return k(),r.getLoadedLanguages()}function p(...$){k(),r.loadLanguages($.flat(1))}async function g(...$){return p(await Fu($))}function w(...$){k();for(const T of $.flat(1))r.loadTheme(T)}async function b(...$){return k(),w(await zu($))}function k(){if(t)throw new Hn("Shiki instance has been disposed")}function S(){t||(t=!0,r.dispose(),cs-=1)}return{setTheme:u,getTheme:c,getLanguage:a,getLoadedThemes:f,getLoadedLanguages:h,resolveLangAlias:i,loadLanguage:g,loadLanguageSync:p,loadTheme:b,loadThemeSync:w,dispose:S,[Symbol.dispose]:S}}async function Zb(e){e.engine||qb("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([zu(e.themes||[]),Fu(e.langs||[]),e.engine]);return Kb({...e,themes:t,langs:n,engine:s})}async function Yb(e){const t=await Zb(e);return{getLastGrammarState:(...n)=>Ib(t,...n),codeToTokensBase:(n,s)=>Kl(t,n,s),codeToTokensWithThemes:(n,s)=>Uu(t,n,s),codeToTokens:(n,s)=>Go(t,n,s),codeToHast:(n,s)=>jo(t,n,s),codeToHtml:(n,s)=>zb(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}class Jl extends Error{constructor(t){super(t),this.name="ShikiError"}}function Jb(){return 2147483648}function Qb(){return typeof performance<"u"?performance.now():Date.now()}const Xb=(e,t)=>e+(t-e%t)%t;async function e1(e){let t,n;const s={};function o(p){n=p,s.HEAPU8=new Uint8Array(p),s.HEAPU32=new Uint32Array(p)}function r(p,g,w){s.HEAPU8.copyWithin(p,g,g+w)}function l(p){try{return t.grow(p-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function i(p){const g=s.HEAPU8.length;p=p>>>0;const w=Jb();if(p>w)return!1;for(let b=1;b<=4;b*=2){let k=g*(1+.2/b);k=Math.min(k,p+100663296);const S=Math.min(w,Xb(Math.max(p,k),65536));if(l(S))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(p,g,w=1024){const b=g+w;let k=g;for(;p[k]&&!(k>=b);)++k;if(k-g>16&&p.buffer&&a)return a.decode(p.subarray(g,k));let S="";for(;g<k;){let $=p[g++];if(!($&128)){S+=String.fromCharCode($);continue}const T=p[g++]&63;if(($&224)===192){S+=String.fromCharCode(($&31)<<6|T);continue}const F=p[g++]&63;if(($&240)===224?$=($&15)<<12|T<<6|F:$=($&7)<<18|T<<12|F<<6|p[g++]&63,$<65536)S+=String.fromCharCode($);else{const O=$-65536;S+=String.fromCharCode(55296|O>>10,56320|O&1023)}}return S}function u(p,g){return p?c(s.HEAPU8,p,g):""}const f={emscripten_get_now:Qb,emscripten_memcpy_big:r,emscripten_resize_heap:i,fd_write:()=>0};async function h(){const g=await e({env:f,wasi_snapshot_preview1:f});t=g.memory,o(t.buffer),Object.assign(s,g),s.UTF8ToString=u}return await h(),s}var t1=Object.defineProperty,n1=(e,t,n)=>t in e?t1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t,n)=>n1(e,typeof t!="symbol"?t+"":t,n);let Xe=null;function s1(e){throw new Jl(e.UTF8ToString(e.getLastOnigError()))}class cr{constructor(t){Ye(this,"utf16Length"),Ye(this,"utf8Length"),Ye(this,"utf16Value"),Ye(this,"utf8Value"),Ye(this,"utf16OffsetToUtf8"),Ye(this,"utf8OffsetToUtf16");const n=t.length,s=cr._utf8ByteLength(t),o=s!==n,r=o?new Uint32Array(n+1):null;o&&(r[n]=s);const l=o?new Uint32Array(s+1):null;o&&(l[s]=n);const i=new Uint8Array(s);let a=0;for(let c=0;c<n;c++){const u=t.charCodeAt(c);let f=u,h=!1;if(u>=55296&&u<=56319&&c+1<n){const p=t.charCodeAt(c+1);p>=56320&&p<=57343&&(f=(u-55296<<10)+65536|p-56320,h=!0)}o&&(r[c]=a,h&&(r[c+1]=a),f<=127?l[a+0]=c:f<=2047?(l[a+0]=c,l[a+1]=c):f<=65535?(l[a+0]=c,l[a+1]=c,l[a+2]=c):(l[a+0]=c,l[a+1]=c,l[a+2]=c,l[a+3]=c)),f<=127?i[a++]=f:f<=2047?(i[a++]=192|(f&1984)>>>6,i[a++]=128|(f&63)>>>0):f<=65535?(i[a++]=224|(f&61440)>>>12,i[a++]=128|(f&4032)>>>6,i[a++]=128|(f&63)>>>0):(i[a++]=240|(f&1835008)>>>18,i[a++]=128|(f&258048)>>>12,i[a++]=128|(f&4032)>>>6,i[a++]=128|(f&63)>>>0),h&&c++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=i,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=l}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const r=t.charCodeAt(s);let l=r,i=!1;if(r>=55296&&r<=56319&&s+1<o){const a=t.charCodeAt(s+1);a>=56320&&a<=57343&&(l=(r-55296<<10)+65536|a-56320,i=!0)}l<=127?n+=1:l<=2047?n+=2:l<=65535?n+=3:n+=4,i&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ur=class Kt{constructor(t){if(Ye(this,"id",++Kt.LAST_ID),Ye(this,"_onigBinding"),Ye(this,"content"),Ye(this,"utf16Length"),Ye(this,"utf8Length"),Ye(this,"utf16OffsetToUtf8"),Ye(this,"utf8OffsetToUtf16"),Ye(this,"ptr"),!Xe)throw new Jl("Must invoke loadWasm first.");this._onigBinding=Xe,this.content=t;const n=new cr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Kt._sharedPtrInUse?(Kt._sharedPtr||(Kt._sharedPtr=Xe.omalloc(1e4)),Kt._sharedPtrInUse=!0,Xe.HEAPU8.set(n.utf8Value,Kt._sharedPtr),this.ptr=Kt._sharedPtr):this.ptr=n.createString(Xe)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Kt._sharedPtr?Kt._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Ye(ur,"LAST_ID",0);Ye(ur,"_sharedPtr",0);Ye(ur,"_sharedPtrInUse",!1);let qu=ur;class o1{constructor(t){if(Ye(this,"_onigBinding"),Ye(this,"_ptr"),!Xe)throw new Jl("Must invoke loadWasm first.");const n=[],s=[];for(let i=0,a=t.length;i<a;i++){const c=new cr(t[i]);n[i]=c.createString(Xe),s[i]=c.utf8Length}const o=Xe.omalloc(4*t.length);Xe.HEAPU32.set(n,o/4);const r=Xe.omalloc(4*t.length);Xe.HEAPU32.set(s,r/4);const l=Xe.createOnigScanner(o,r,t.length);for(let i=0,a=t.length;i<a;i++)Xe.ofree(n[i]);Xe.ofree(r),Xe.ofree(o),l===0&&s1(Xe),this._onigBinding=Xe,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new qu(t);const r=this._findNextMatchSync(t,n,!1,o);return t.dispose(),r}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,s,o){const r=this._onigBinding,l=r.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(l===0)return null;const i=r.HEAPU32;let a=l/4;const c=i[a++],u=i[a++],f=[];for(let h=0;h<u;h++){const p=t.convertUtf8OffsetToUtf16(i[a++]),g=t.convertUtf8OffsetToUtf16(i[a++]);f[h]={start:p,end:g,length:g-p}}return{index:c,captureIndices:f}}}function r1(e){return typeof e.instantiator=="function"}function l1(e){return typeof e.default=="function"}function i1(e){return typeof e.data<"u"}function a1(e){return typeof Response<"u"&&e instanceof Response}function c1(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let oo;function u1(e){if(oo)return oo;async function t(){Xe=await e1(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),r1(s)?s=await s.instantiator(n):l1(s)?s=await s.default(n):(i1(s)&&(s=s.data),a1(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await d1(s)(n):s=await f1(s)(n):c1(s)?s=await Mr(s)(n):s instanceof WebAssembly.Module?s=await Mr(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Mr(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return oo=t(),oo}function Mr(e){return t=>WebAssembly.instantiate(e,t)}function d1(e){return t=>WebAssembly.instantiateStreaming(e,t)}function f1(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function h1(e){return e&&await u1(e),{createScanner(t){return new o1(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new qu(t)}}}const p1={class:"code-block"},g1={class:"code-header"},m1={class:"code-lang"},v1=["innerHTML"],y1=_e({__name:"CodeBlock",props:{code:{},lang:{},streaming:{type:Boolean}},setup(e){const t=e,n=un("effectiveTheme",G(typeof document<"u"&&document.documentElement.dataset.theme==="dark"?"dark":"light")),s=G(""),o=G(""),r=G(!1);let l=null;const i=new Set,a=new Map,c={js:"javascript",ts:"typescript",py:"python",sh:"bash",shell:"bash",shscript:"bash","shell-script":"bash",yml:"yaml",md:"markdown",rs:"rust",rb:"ruby",go:"go",java:"java",c:"c",cpp:"cpp","c++":"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",kts:"kotlin",scala:"scala",swift:"swift",dart:"dart",lua:"lua",r:"r",sql:"sql",toml:"toml",ini:"ini",xml:"xml",svelte:"svelte",astro:"astro",dockerfile:"docker",makefile:"make",graphql:"graphql",proto:"protobuf",pl:"perl",pm:"perl"};async function u(){if(l)return l;const[b,k]=await Promise.all([eo(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),eo(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return l=await Yb({themes:[b.default,k.default],langs:[],engine:h1(()=>eo(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),l}async function f(b){if(i.has(b))return!0;if(a.has(b))return await a.get(b),i.has(b);const k=(async()=>{try{const S=await u(),$=await eo(()=>import(`shiki/langs/${b}.mjs`),[],import.meta.url);await S.loadLanguage($.default),i.add(b)}catch{}})();return a.set(b,k),await k,a.delete(b),i.has(b)}function h(b){const k=b.toLowerCase();return c[k]??k}async function p(){var $;const b=(($=t.lang)==null?void 0:$.toLowerCase())??"text",k=h(b),S=n.value==="light"?"github-light":"github-dark";try{const T=await u();await f(k)?s.value=T.codeToHtml(t.code,{lang:k,theme:S}):s.value=`<pre class="shiki-fallback"><code>${g(t.code)}</code></pre>`}catch{s.value=`<pre class="shiki-fallback"><code>${g(t.code)}</code></pre>`}}function g(b){return b.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function w(){navigator.clipboard.writeText(t.code).then(()=>{r.value=!0,setTimeout(()=>r.value=!1,1500)})}return Ie(()=>[t.code,t.lang,n.value],([b])=>{t.streaming?o.value=`<pre class="shiki-fallback"><code>${g(b)}</code></pre>`:p()},{immediate:!0}),Ie(()=>t.streaming,(b,k)=>{k&&!b&&p()}),(b,k)=>(v(),y("div",p1,[d("div",g1,[d("span",m1,I(e.lang||"text"),1),d("button",{class:de(["code-copy",{copied:r.value}]),onClick:w},I(r.value?"已复制":"复制"),3)]),d("div",{class:"code-content",innerHTML:t.streaming?o.value:s.value||o.value},null,8,v1)]))}}),b1=Se(y1,[["__scopeId","data-v-f94a1d0a"]]);Le.setOptions({gfm:!0,breaks:!1});const k1=_e({props:{content:{type:String,required:!0},streaming:{type:Boolean,default:!1}},setup(e){const t=G(e.content);let n=null;Ie(()=>e.content,o=>{if(!e.streaming){t.value=o;return}n===null&&(n=requestAnimationFrame(()=>{n=null,t.value=e.content}))}),Ie(()=>e.streaming,(o,r)=>{r&&!o&&(n!==null&&(cancelAnimationFrame(n),n=null),t.value=e.content)});const s=Y(()=>{const o=w1(t.value);return Le.lexer(o).flatMap(l=>fl(l,e.streaming))});return()=>Ee("div",{class:"markdown-body"},s.value)}});function w1(e){const t=/^(`{3,})/gm;let n=null,s=-1,o=0,r;for(;(r=t.exec(e))!==null;){const l=r[1];n===null?(n=l,s=r.index,o=l.length):l.length>=o&&(n=null)}return n!==null?e.substring(0,s).trimEnd():e}function fl(e,t=!1){const n=e;switch(n.type){case"paragraph":return[Ee("p",{class:"md-p"},an(n.tokens??[]))];case"heading":return[Ee(`h${n.depth??2}`,{class:`md-h${n.depth??2}`},an(n.tokens??[]))];case"code":return[Ee(b1,{code:n.text??"",lang:n.lang??"text",streaming:t})];case"blockquote":return[Ee("blockquote",{class:"md-blockquote"},(n.tokens??[]).flatMap(s=>fl(s,t)))];case"list":{const s=(n.items??[]).map(o=>{const r=[];return o.task&&r.push(Ee("input",{type:"checkbox",checked:o.checked,disabled:!0,class:"md-checkbox"})),r.push(...o.tokens.flatMap(l=>fl(l,t))),Ee("li",{class:["md-li",o.task?"md-task":""]},r)});return[Ee(n.ordered?"ol":"ul",{class:n.ordered?"md-ol":"md-ul"},s)]}case"hr":return[Ee("hr",{class:"md-hr"})];case"space":return[];case"html":return[Ee("pre",{class:"md-raw-html"},n.text??"")];case"table":return[Ee("div",{class:"md-table-wrap",style:"overflow-x:auto"},[_1(n)])];case"br":return[Ee("br")];case"text":return[Ee("span",{class:"md-text"},n.tokens?an(n.tokens):n.text??"")];case"def":return[];default:return[Ee("p",{class:"md-p"},n.raw??"")]}}function _1(e){const t=(e.header??[]).map((s,o)=>{var i;const r=(i=e.align)==null?void 0:i[o],l=s;return Ee("th",{class:"md-th",style:r?`text-align:${r}`:""},l.tokens?an(l.tokens):String(l.text??""))}),n=(e.rows??[]).map(s=>Ee("tr",{},s.map((o,r)=>{var a;const l=(a=e.align)==null?void 0:a[r],i=o;return Ee("td",{class:"md-td",style:l?`text-align:${l}`:""},i.tokens?an(i.tokens):String(i.text??""))})));return Ee("table",{class:"md-table"},[Ee("thead",{},[Ee("tr",{},t)]),Ee("tbody",{},n)])}function an(e){return e.map(t=>{const n=t;switch(n.type){case"text":return n.text??"";case"codespan":return Ee("code",{class:"md-code"},n.text??"");case"strong":return Ee("strong",{class:"md-strong"},an(n.tokens??[]));case"em":return Ee("em",{class:"md-em"},an(n.tokens??[]));case"del":return Ee("del",{class:"md-del"},an(n.tokens??[]));case"link":{const s=n.href;return s&&!/^(https?:|mailto:|#|\/)/i.test(s)?n.raw??"":Ee("a",{class:"md-a",href:s,target:"_blank",rel:"noopener"},an(n.tokens??[]))}case"image":return Ee("img",{class:"md-img",src:n.href,alt:n.text??"",loading:"lazy"});case"br":return Ee("br");case"html":return Ee("code",{class:"md-raw-inline"},n.text??"");case"escape":return n.text??"";default:return n.raw??""}})}const S1=Se(k1,[["__scopeId","data-v-98ce0f33"]]),x1=new Set(["edit","str_replace","replace","write","multi_edit","create_file","edit_file","apply_patch"]);function C1(e){return x1.has(e.toLowerCase())}function Ql(e,t=!0){return e.suspended?"suspended":e.isError?"error":e.output===void 0?t?"running":"unknown":"ok"}function $1(e,t=!0){const n=new Set(e.map(s=>Ql(s,t)));return n.has("running")?"running":n.has("error")?"error":n.has("suspended")?"suspended":n.has("unknown")?"unknown":"ok"}const T1=["onKeydown"],A1={class:"tool-name"},R1=["title"],E1={class:"tool-collapse-inner"},I1={class:"tool-body"},L1={key:0,class:"tool-args"},M1={key:1,class:"tool-result"},P1={key:2,class:"tool-image-wrap"},N1=["src"],O1={key:3,class:"tool-output-actions"},D1={key:4,class:"tool-running-hint"},B1=_e({__name:"GenericToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=Y(()=>Ql(t.tool,t.live)),s=Y(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=G(!1);let r=!1;Ie(n,b=>{r||(o.value=b==="running")},{immediate:!0});function l(){r=!0,o.value=!o.value}const i=Y(()=>{const b=t.tool.args;if(!b||typeof b!="object")return b===void 0?"":String(b);const k=[];for(const[S,$]of Object.entries(b)){let T;if(typeof $=="string")T=$.length>40?`${$.slice(0,40)}…`:$;else{try{T=JSON.stringify($)}catch{T=String($)}T.length>40&&(T=`${T.slice(0,40)}…`)}if(k.push(`${S}=${T}`),k.length>=3)break}return k.join(" ")});function a(){if(!t.tool.args)return"";try{return JSON.stringify(t.tool.args,null,2)}catch{return String(t.tool.args)}}function c(b){return b??""}const u=Y(()=>c(t.tool.output)),f=Y(()=>u.value.length>8192),h=G(!1),p=Y(()=>f.value&&!h.value?u.value.slice(0,280):u.value);async function g(){var b;try{await((b=navigator.clipboard)==null?void 0:b.writeText(u.value))}catch{}}const w=Y(()=>{const b=u.value.trim();return!/^[\w@./-]+\.(png|jpe?g|gif|webp|avif)$/i.test(b)||b.includes("..")||b.startsWith("/")||f.value?null:`/api/v1/files/raw?path=${encodeURIComponent(b)}`});return(b,k)=>(v(),y("div",{class:de(["tool-card",`is-${n.value}`])},[d("div",{class:"tool-header",role:"button",tabindex:"0",onClick:l,onKeydown:As(_t(l,["prevent"]),["enter"])},[d("span",{class:de(["status-dot",n.value])},[s.value?(v(),y(Q,{key:0},[$e(I(s.value),1)],64)):N("",!0)],2),d("span",A1,I(e.tool.name),1),i.value?(v(),y("span",{key:0,class:"tool-params",title:i.value},I(i.value),9,R1)):N("",!0),d("span",{class:de(["tool-chevron",{open:o.value}])},"▸",2)],40,T1),d("div",{class:de(["tool-collapse",{open:o.value}])},[d("div",E1,[d("div",I1,[a()?(v(),y("pre",L1,[d("code",null,I(a()),1)])):N("",!0),e.tool.output!==void 0&&!w.value?(v(),y("pre",M1,[d("code",null,I(p.value||"(无输出)"),1)])):N("",!0),e.tool.output!==void 0&&w.value?(v(),y("div",P1,[d("img",{class:"tool-image",src:w.value,alt:"",loading:"lazy",onError:k[0]||(k[0]=S=>S.currentTarget.style.display="none")},null,40,N1)])):N("",!0),f.value?(v(),y("div",O1,[d("button",{class:"tool-output-btn",onClick:k[1]||(k[1]=S=>h.value=!h.value)},I(h.value?"收起":"展开全文"),1),d("button",{class:"tool-output-btn",onClick:g},"复制")])):(v(),y("div",D1,"执行中…"))])])],2)],2))}}),G1=Se(B1,[["__scopeId","data-v-f8845a39"]]),j1=500;function U1(e,t){const n=e.length,s=t.length,o=Array.from({length:n+1},()=>new Array(s+1).fill(0));for(let r=1;r<=n;r++)for(let l=1;l<=s;l++)o[r][l]=e[r-1]===t[l-1]?o[r-1][l-1]+1:Math.max(o[r-1][l],o[r][l-1]);return o}function F1(e,t,n,s,o){const r=[];for(;s>0||o>0;)s>0&&o>0&&t[s-1]===n[o-1]?(r.unshift({type:"context",text:t[s-1],oldNo:s,newNo:o}),s--,o--):o>0&&(s===0||e[s][o-1]>=e[s-1][o])?(r.unshift({type:"add",text:n[o-1],newNo:o}),o--):(r.unshift({type:"del",text:t[s-1],oldNo:s}),s--);return r}function z1(e){const t=[],n=e.replaceAll(`\r
|
|
88
|
+
`,`
|
|
89
|
+
`).split(`
|
|
90
|
+
`);let s=0,o=0;for(const r of n){if(r.startsWith("@@")){const l=/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(r);s=l?Number(l[1]):0,o=l?Number(l[2]):0;const i=r.startsWith("@@")?r.slice(r.indexOf("@@")+2,r.lastIndexOf("@@")||r.length):"";t.push({type:"context",text:i.trim()?`@@ hunk ${s},${o} @@`:r,oldNo:s,newNo:o});continue}if(r.startsWith("+++")||r.startsWith("---")){t.push({type:"context",text:r,oldNo:s,newNo:o});continue}r.startsWith("+")?(o+=1,t.push({type:"add",text:r.slice(1),newNo:o})):r.startsWith("-")?(s+=1,t.push({type:"del",text:r.slice(1),oldNo:s})):(s+=1,o+=1,t.push({type:"context",text:r,oldNo:s,newNo:o}))}return t}function H1(e,t){const n=e.split(`
|
|
91
|
+
`),s=t.split(`
|
|
92
|
+
`);if(n.length+s.length>j1){const r=[];return n.forEach((l,i)=>r.push({type:"del",text:l,oldNo:i+1})),s.forEach((l,i)=>r.push({type:"add",text:l,newNo:i+1})),r}const o=U1(n,s);return F1(o,n,s,n.length,s.length)}function q1(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}const V1=["old_string","oldString","old_str","old_text","oldText","old","search"],W1=["new_string","newString","new_str","new_text","newText","new","replace","content"],K1=["path","file_path","filePath","file","filename"];function Pr(e,t){for(const n of t){const s=e[n];if(typeof s=="string"&&s.length>0)return s}}function Z1(e){if(!e||typeof e!="object")return null;const t=e,n=Pr(t,K1),s=Pr(t,V1),o=Pr(t,W1);if(!o&&!s)return null;const r=H1(s??"",o??""),l=q1(r);return{path:n,diff:r,stats:l}}const Y1={class:"diff-lines"},J1={class:"dl-gutter old"},Q1={class:"dl-gutter new"},X1={class:"dl-sign"},ek={class:"dl-text"},tk=_e({__name:"DiffLines",props:{lines:{}},setup(e){return(t,n)=>(v(),y("div",Y1,[(v(!0),y(Q,null,ze(e.lines,(s,o)=>(v(),y("div",{key:o,class:de(["dl",`dl-${s.type}`])},[d("span",J1,I(s.oldNo??""),1),d("span",Q1,I(s.newNo??""),1),d("span",X1,I(s.type==="add"?"+":s.type==="del"?"−":" "),1),d("span",ek,I(s.text),1)],2))),128))]))}}),Vu=Se(tk,[["__scopeId","data-v-e2e145aa"]]),nk=["onKeydown"],sk={class:"tool-name"},ok=["title"],rk={key:1,class:"diff-chip"},lk={class:"tool-collapse-inner"},ik={class:"tool-body"},ak={key:1,class:"tool-result"},ck={key:2,class:"tool-running-hint"},uk=_e({__name:"EditToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=Y(()=>Ql(t.tool,t.live)),s=Y(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=Y(()=>Z1(t.tool.args)),r=Y(()=>{const h=o.value;if(!h||n.value==="error")return"";const{added:p,removed:g}=h.stats;return!p&&!g?"":`+${p} −${g}`}),l=Y(()=>{var h;return(h=o.value)==null?void 0:h.path}),i=G(!1);let a=!1;Ie(n,h=>{a||(i.value=h==="running")},{immediate:!0});function c(){a=!0,i.value=!i.value}const u=Y(()=>{var h;return((h=o.value)==null?void 0:h.diff)??[]}),f=Y(()=>u.value.length>0);return(h,p)=>(v(),y("div",{class:de(["tool-card",`is-${n.value}`,"edit-tool-card"])},[d("div",{class:"tool-header",role:"button",tabindex:"0",onClick:c,onKeydown:As(_t(c,["prevent"]),["enter"])},[d("span",{class:de(["status-dot",n.value])},[s.value?(v(),y(Q,{key:0},[$e(I(s.value),1)],64)):N("",!0)],2),d("span",sk,I(e.tool.name),1),l.value?(v(),y("span",{key:0,class:"tool-filepath",title:l.value},I(l.value),9,ok)):N("",!0),r.value?(v(),y("span",rk,I(r.value),1)):N("",!0),d("span",{class:de(["tool-chevron",{open:i.value}])},"▸",2)],40,nk),d("div",{class:de(["tool-collapse",{open:i.value}])},[d("div",lk,[d("div",ik,[f.value?(v(),Ue(Vu,{key:0,lines:u.value},null,8,["lines"])):N("",!0),e.tool.output!==void 0?(v(),y("pre",ak,[d("code",null,I(e.tool.output||"(无输出)"),1)])):(v(),y("div",ck,"执行中…"))])])],2)],2))}}),dk=Se(uk,[["__scopeId","data-v-00b9973b"]]),fk=["aria-expanded"],hk={class:"process-label"},pk={class:"process-meta"},gk=["title"],mk={class:"process-collapse"},vk={class:"process-inner"},yk=_e({__name:"ToolGroup",props:{name:{},tools:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=G(!1),s=Y(()=>$1(t.tools,t.live)),o=Y(()=>t.tools.filter(i=>i.output!==void 0&&!i.isError).length),r=Y(()=>s.value==="running"?"执行中":s.value==="error"?"含失败调用":s.value==="suspended"?"含挂起等待":s.value==="unknown"?"结果未持久化":`已完成 ${o.value} 项`);function l(){n.value=!n.value}return(i,a)=>(v(),y("section",{class:de(["tool-process",{open:n.value,running:s.value==="running",error:s.value==="error"}])},[d("button",{class:"process-head",type:"button","aria-expanded":n.value,onClick:l},[K(me,{name:"chevron-down",size:12,class:"chevron"}),d("span",{class:de(["process-dot",s.value]),"aria-hidden":"true"},null,2),d("span",hk,I(e.name),1),d("span",pk,I(r.value)+" · "+I(e.tools.length)+" 步",1),d("span",{class:"process-names",title:e.tools.map(c=>c.name).join("、")},I(e.tools.map(c=>c.name).join(" · ")),9,gk)],8,fk),d("div",mk,[d("div",vk,[(v(!0),y(Q,null,ze(t.tools,c=>(v(),Ue(kf(ne(C1)(c.name)?dk:G1),{key:c.toolCallId,tool:c,live:e.live},null,8,["tool","live"]))),128))])])],2))}}),bk=Se(yk,[["__scopeId","data-v-e8ad7860"]]),kk={class:"thinking-block"},wk=["title"],_k={class:"teaser-text"},Sk={class:"teaser-open"},xk={key:1,class:"thinking-stream"},Ck={class:"thinking-panel",role:"dialog","aria-label":"思考过程"},$k={class:"panel-body"},Tk=_e({__name:"ThinkingBlock",props:{tool:{},active:{type:Boolean,default:!1},sessionId:{default:""},msgSeq:{default:void 0}},setup(e){const t=e,n=G(!1),s=G(null),o=G(!1),r=G(!1),l=G(t.tool.output??"");Ie(()=>t.tool.output,h=>{h!==void 0&&!o.value&&!r.value&&(l.value=h)});const i=Y(()=>!!t.tool.truncated);async function a(){if(!(!i.value||r.value||o.value)&&!(!t.sessionId||t.msgSeq===void 0)){o.value=!0;try{const p=await(await fetch(`/api/v1/sessions/${t.sessionId}/messages?seq=${t.msgSeq}&tool=${encodeURIComponent(t.tool.toolCallId)}`)).json();typeof p.output=="string"&&p.output.length>0&&(l.value=p.output,r.value=!0)}catch{}finally{o.value=!1}}}const c=Y(()=>l.value.split(/\n+/).map(p=>p.trim()).filter(Boolean).at(-1)??"");Ie(l,()=>{t.active&&It(()=>{const h=s.value;h&&(h.scrollTop=h.scrollHeight)})});function u(){a(),n.value=!0}function f(){n.value=!1}return(h,p)=>(v(),y("div",kk,[e.active?(v(),y("div",xk,[p[1]||(p[1]=d("div",{class:"stream-header"},[d("span",{class:"stream-icon"},"💭"),d("span",{class:"stream-title"},"思考中…"),d("span",{class:"stream-dot"})],-1)),d("div",{ref_key:"streamRef",ref:s,class:"stream-body"},I(l.value),513)])):(v(),y("button",{key:0,class:"thinking-teaser",title:i.value?"思考较长,点击查看完整思考过程":"点击查看完整思考过程",onClick:u},[p[0]||(p[0]=d("span",{class:"teaser-icon"},"💭",-1)),d("span",_k,I(o.value?"加载完整思考…":c.value||"思考过程"),1),d("span",Sk,I(i.value?"查看全文":"展开"),1)],8,wk)),(v(),Ue(Cl,{to:"body"},[n.value?(v(),y("div",{key:0,class:"thinking-overlay",onClick:_t(f,["self"])},[d("aside",Ck,[d("header",{class:"panel-header"},[p[2]||(p[2]=d("span",null,"💭 思考过程",-1)),d("button",{class:"panel-close","aria-label":"关闭",onClick:f},"✕")]),d("div",$k,I(l.value||"(空)"),1)])])):N("",!0)]))]))}}),Ak=Se(Tk,[["__scopeId","data-v-436ab760"]]),Rk={key:0,class:"clock"},Ek={class:"stat"},Ik={class:"stat"},Lk={class:"stat"},Mk={class:"stat"},Pk={class:"stat"},Nk={class:"stat"},Ok=_e({__name:"TurnStats",props:{stats:{}},setup(e){const t=e,n=G(null);let s=null;function o(){s!==null&&(clearInterval(s),s=null)}function r(){o();const a=t.stats.llmMs??0,c=Date.now();n.value=a,s=setInterval(()=>{n.value=a+(Date.now()-c)},300)}Ie(()=>t.stats.status,a=>{a==="running"?r():o()},{immediate:!0}),Ut(o);function l(a){return a==null?"—":a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function i(a){return a==null?"—":a>=1e3?`${(a/1e3).toFixed(1)}k`:`${a}`}return(a,c)=>(v(),y("div",{class:de(["turn-stats",`is-${e.stats.status}`]),"aria-live":"polite"},[e.stats.status==="running"?(v(),y(Q,{key:0},[c[0]||(c[0]=d("span",{class:"badge-gradient"},"正在思考",-1)),n.value!==null?(v(),y("span",Rk,I(l(n.value)),1)):N("",!0)],64)):(v(),y(Q,{key:1},[d("span",Ek,I(e.stats.turn)+" 轮 · "+I(e.stats.step)+" 步",1),c[10]||(c[10]=d("span",{class:"dot"},"·",-1)),d("span",Ik,[c[1]||(c[1]=d("span",{class:"k"},"LLM",-1)),$e(" "+I(l(e.stats.llmMs)),1)]),e.stats.toolMs?(v(),y(Q,{key:0},[c[3]||(c[3]=d("span",{class:"dot"},"·",-1)),d("span",Lk,[c[2]||(c[2]=d("span",{class:"k"},"工具",-1)),$e(" "+I(l(e.stats.toolMs)),1)])],64)):N("",!0),e.stats.firstTokenMs!==null&&e.stats.firstTokenMs!==void 0?(v(),y(Q,{key:1},[c[5]||(c[5]=d("span",{class:"dot"},"·",-1)),d("span",Mk,[c[4]||(c[4]=d("span",{class:"k"},"首token",-1)),$e(" "+I(l(e.stats.firstTokenMs)),1)])],64)):N("",!0),e.stats.tokens!==null&&e.stats.tokens!==void 0?(v(),y(Q,{key:2},[c[7]||(c[7]=d("span",{class:"dot"},"·",-1)),d("span",Pk,[c[6]||(c[6]=d("span",{class:"k"},"tokens",-1)),$e(" "+I(i(e.stats.tokens)),1)])],64)):N("",!0),e.stats.tokensPerSec!==null&&e.stats.tokensPerSec!==void 0?(v(),y(Q,{key:3},[c[9]||(c[9]=d("span",{class:"dot"},"·",-1)),d("span",Nk,[c[8]||(c[8]=d("span",{class:"k"},"tok/s",-1)),$e(" "+I(e.stats.tokensPerSec),1)])],64)):N("",!0)],64))],2))}}),Dk=Se(Ok,[["__scopeId","data-v-95536a3e"]]),Bk={key:0,class:"user-wrap"},Gk={class:"user-bubble"},jk={key:0,class:"message-meta user-meta"},Uk={key:1,class:"meta-time"},Fk={key:1,class:"assistant-wrap"},zk={key:0,class:"assistant-brand"},Hk={key:0,class:"brand-model"},qk={key:1,class:"brand-streaming"},Vk={class:"assistant-body"},Wk={key:0,class:"degraded-note"},Kk={key:4,class:"streaming-cursor","aria-label":"正在生成"},Zk={key:6,class:"message-meta"},Yk=["title"],Jk=["title"],Qk={key:4,class:"meta-time"},Xk=_e({__name:"MessageItem",props:{message:{},isLatestUser:{type:Boolean,default:!1},idle:{type:Boolean,default:!0},streaming:{type:Boolean,default:!1},canFork:{type:Boolean,default:!1},showTimestamp:{type:Boolean,default:!0},sessionId:{default:""}},emits:["edit","retry","fork"],setup(e,{emit:t}){const n=e,s=t,o=G(!1);let r=null;const l=Y(()=>n.message.role==="user"),i=Y(()=>n.message.role==="assistant"),a=Y(()=>n.message.tools.filter(S=>S.name==="thinking")),c=Y(()=>n.message.tools.filter(S=>S.name!=="thinking")),u=Y(()=>n.message.ts!==void 0?new Date(n.message.ts).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):""),f=Y(()=>l.value&&n.isLatestUser&&n.idle),h=un("showThinking",G(!0)),p=un("showTools",G(!0)),g=G(!1);let w=null;function b(){if(typeof window>"u"||!("speechSynthesis"in window))return;if(g.value){window.speechSynthesis.cancel(),g.value=!1,w=null;return}const S=n.message.content;if(!S)return;const $=new SpeechSynthesisUtterance(S);$.lang="zh-CN";const T=()=>{w===T&&(g.value=!1,w=null)};w=T,$.addEventListener("end",T),$.addEventListener("error",T),window.speechSynthesis.cancel(),requestAnimationFrame(()=>{window.speechSynthesis.speak($)}),g.value=!0}Ut(()=>{g.value&&"speechSynthesis"in window&&window.speechSynthesis.cancel()});async function k(){try{await navigator.clipboard.writeText(n.message.content)}catch{const S=document.createElement("textarea");S.value=n.message.content,document.body.append(S),S.select(),document.execCommand("copy"),S.remove()}o.value=!0,r!==null&&clearTimeout(r),r=window.setTimeout(()=>{o.value=!1},1500)}return(S,$)=>(v(),y("article",{class:de(["message",e.message.role,{error:e.message.isError}])},[l.value?(v(),y("div",Bk,[d("div",Gk,I(e.message.content),1),u.value||f.value?(v(),y("div",jk,[f.value?(v(),y("button",{key:0,title:"编辑并重新发送",onClick:$[0]||($[0]=T=>s("edit",e.message.content))},[K(me,{name:"edit",size:12}),$[3]||($[3]=$e("编辑重发",-1))])):N("",!0),u.value?(v(),y("span",Uk,I(u.value),1)):N("",!0)])):N("",!0)])):(v(),y("div",Fk,[i.value&&(e.message.model||e.streaming)?(v(),y("div",zk,[e.message.model?(v(),y("span",Hk,I(e.message.model),1)):N("",!0),e.streaming?(v(),y("span",qk,[...$[4]||($[4]=[d("i",{"aria-hidden":"true"},null,-1),$e("生成中",-1)])])):N("",!0)])):N("",!0),d("div",Vk,[e.message.degraded?(v(),y("p",Wk,"该回合早于持久化快照:正文与思考在服务重启后无法恢复(工具记录与消息结构已保留)。")):N("",!0),ne(h)?(v(!0),y(Q,{key:1},ze(a.value,T=>(v(),Ue(Ak,{key:T.toolCallId,tool:T,active:e.streaming,"session-id":e.sessionId,"msg-seq":e.message.seq},null,8,["tool","active","session-id","msg-seq"]))),128)):N("",!0),c.value.length&&ne(p)?(v(),Ue(bk,{key:2,name:"工具调用过程",tools:c.value,live:e.streaming},null,8,["tools","live"])):N("",!0),e.message.content?(v(),Ue(S1,{key:3,class:"assistant-content",content:e.message.content,streaming:e.streaming},null,8,["content","streaming"])):e.streaming?(v(),y("span",Kk)):N("",!0),e.message.turnStats?(v(),Ue(Dk,{key:5,stats:e.message.turnStats},null,8,["stats"])):N("",!0),e.message.content||e.message.isError&&!e.streaming||e.canFork||e.showTimestamp&&u.value?(v(),y("div",Zk,[e.message.content?(v(),y("button",{key:0,title:o.value?"已复制":"复制内容",onClick:k},[K(me,{name:o.value?"check":"copy",size:12},null,8,["name"]),$e(I(o.value?"已复制":"复制"),1)],8,Yk)):N("",!0),e.message.content?(v(),y("button",{key:1,title:g.value?"停止朗读":"朗读",onClick:b},[K(me,{name:g.value?"speaker-off":"speaker",size:12},null,8,["name"]),$e(I(g.value?"停止":"朗读"),1)],8,Jk)):N("",!0),e.message.isError&&!e.streaming?(v(),y("button",{key:2,class:"retry-btn",title:"重发最后一条消息",onClick:$[1]||($[1]=T=>s("retry"))},[K(me,{name:"refresh",size:12}),$[5]||($[5]=$e("重试",-1))])):N("",!0),i.value&&e.canFork&&!e.streaming?(v(),y("button",{key:3,title:"以当前对话为起点创建一个新会话",onClick:$[2]||($[2]=T=>s("fork"))},[K(me,{name:"fork",size:12}),$[6]||($[6]=$e("Fork",-1))])):N("",!0),e.showTimestamp&&u.value?(v(),y("time",Qk,I(u.value),1)):N("",!0)])):N("",!0)])]))],2))}}),e0=Se(Xk,[["__scopeId","data-v-7209f2f7"]]),t0=""+new URL("../icon.ico",import.meta.url).href,n0={class:"empty-state"},s0={class:"suggestions"},o0=["onClick"],r0={class:"suggestion-icon"},l0={class:"suggestion-title"},i0=["title"],a0={class:"workdir-path"},c0={class:"empty-status","aria-label":"连接与模型状态"},u0={class:"status-item"},d0={class:"status-item"},f0={class:"status-item"},h0=_e({__name:"EmptyState",props:{workDir:{default:null},model:{default:null},contextUsage:{default:null},connected:{type:Boolean,default:!1}},emits:["pick"],setup(e,{emit:t}){const n=t,s=[{icon:"edit",title:"帮我写一个函数",prompt:"帮我写一个函数"},{icon:"clipboard",title:"解释这段代码",prompt:"解释这段代码"},{icon:"activity",title:"调试这个问题",prompt:"调试这个问题"}];function o(r){if(r==null)return"—";const l=r<=1?Math.round(r*100):Math.round(r);return`${Math.min(l,100)}%`}return(r,l)=>(v(),y("div",n0,[l[3]||(l[3]=d("div",{class:"empty-logo"},[d("img",{src:t0,alt:"Scream",class:"logo-img"})],-1)),l[4]||(l[4]=d("h1",{class:"empty-title"},"Scream Web UI",-1)),l[5]||(l[5]=d("p",{class:"empty-subtitle"},"给 Scream 发消息,开始处理你的任务",-1)),d("div",s0,[(v(),y(Q,null,ze(s,i=>d("button",{key:i.title,class:"suggestion-card",onClick:a=>n("pick",i.prompt)},[d("span",r0,[K(me,{name:i.icon,size:22},null,8,["name"])]),d("span",l0,I(i.title),1)],8,o0)),64))]),e.workDir?(v(),y("div",{key:0,class:"empty-workdir",title:e.workDir},[l[0]||(l[0]=d("span",{class:"workdir-label"},"工作目录",-1)),d("span",a0,I(e.workDir),1)],8,i0)):N("",!0),d("div",c0,[d("span",{class:de(["status-dot",e.connected?"on":"off"])},null,2),d("span",u0,I(e.connected?"已连接":"未连接"),1),e.model?(v(),y(Q,{key:0},[l[1]||(l[1]=d("span",{class:"status-sep"},"·",-1)),d("span",d0,"模型 "+I(e.model),1)],64)):N("",!0),e.contextUsage!==null&&e.contextUsage!==void 0?(v(),y(Q,{key:1},[l[2]||(l[2]=d("span",{class:"status-sep"},"·",-1)),d("span",f0,"上下文 "+I(o(e.contextUsage)),1)],64)):N("",!0)]),l[6]||(l[6]=d("div",{class:"empty-shortcuts","aria-hidden":"true"},[d("span",null,[d("kbd",null,"⌘K"),$e(" 搜索会话")]),d("span",null,[d("kbd",null,"⌘N"),$e(" 新建会话")])],-1))]))}}),p0=Se(h0,[["__scopeId","data-v-cc2342f3"]]),g0={class:"message-list-wrapper"},m0={key:0,class:"conn-banner",role:"status"},v0={key:0,class:"load-older-row"},y0=["disabled"],b0={key:2,class:"message-skeleton","aria-hidden":"true"},k0=_e({__name:"MessageList",props:{messages:{},busy:{type:Boolean,default:!1},workDir:{default:null},sessionId:{default:""},model:{default:null},contextUsage:{default:null},connected:{type:Boolean,default:!1},olderAvailable:{type:Boolean,default:!1},olderLoading:{type:Boolean,default:!1}},emits:["edit","pick","retry-connection","retry-message","load-older","fork"],setup(e,{emit:t}){const n=e,s=t,o=G(null),r=Y(()=>{for(let C=n.messages.length-1;C>=0;C--)if(n.messages[C].role==="user")return n.messages[C].id;return null}),l=Y(()=>{var C;return((C=n.messages.at(-1))==null?void 0:C.id)??null}),i=Y(()=>{var C;return((C=[...n.messages].reverse().find(A=>A.role==="assistant"))==null?void 0:C.id)??null});function a(C){const A=n.messages[C];if(!A)return!1;if(A.role!=="assistant")return!0;const R=n.messages[C+1];return!R||R.role!=="assistant"||A.ts!==void 0&&R.ts!==void 0&&R.ts-A.ts>300*1e3}const c=Y(()=>{var R;const C=n.messages.at(-1);if(!C)return 0;let A=C.content.length;for(const J of C.tools)A+=((R=J.output)==null?void 0:R.length)??0;return A});let u=!1;const f=G(!1);function h(){const C=o.value;return C?C.scrollHeight-C.scrollTop-C.clientHeight<80:!0}function p(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function g(C){requestAnimationFrame(()=>{const A=o.value;if(!A)return;const R=p()?"auto":C;A.scrollTo({top:A.scrollHeight,behavior:R})})}let w=null;function b(){const C=o.value,A=n.sessionId;!C||!A||w===null&&(w=requestAnimationFrame(()=>{w=null;try{localStorage.setItem(`scream-scroll:${A}`,String(C.scrollTop))}catch{}}))}function k(){const C=o.value,A=n.sessionId;if(!C||!A)return;let R=null;try{R=localStorage.getItem(`scream-scroll:${A}`)}catch{}R&&(C.scrollTop=Number(R))}let S=0;Ie(()=>n.olderLoading,C=>{const A=o.value;if(A){if(C)S=A.scrollHeight;else if(S>0){const R=A.scrollHeight-S;R>0&&(A.scrollTop=A.scrollTop+R),S=0}}});function $(){const C=o.value;if(!C)return;const A=C.scrollHeight-C.scrollTop-C.clientHeight>80;f.value=A,A&&u&&(u=!1),n.busy||b()}let T="";Ie(()=>n.sessionId,()=>{T=""}),Ie(()=>[n.messages.length,c.value],([C],[A])=>{if(C!==A){if(C>0&&T!==n.sessionId){T=n.sessionId,requestAnimationFrame(()=>requestAnimationFrame(k));return}u=!0,f.value=!1,g("smooth");return}!u&&!h()||g("auto")}),Ie(()=>n.busy,C=>{C||(u=!1)});function F(){u=!0,f.value=!1,g("smooth")}const O=Y(()=>!n.busy||n.messages.length===0?!1:n.messages.at(-1).role==="user");return Nt(()=>{var C;(C=o.value)==null||C.addEventListener("scroll",$,{passive:!0}),requestAnimationFrame(()=>requestAnimationFrame(k))}),Qo(()=>{var C;(C=o.value)==null||C.removeEventListener("scroll",$),w!==null&&(cancelAnimationFrame(w),w=null)}),(C,A)=>(v(),y("div",g0,[!e.connected&&e.messages.length>0?(v(),y("div",m0,[A[6]||(A[6]=d("span",{class:"conn-dot","aria-hidden":"true"},null,-1)),A[7]||(A[7]=d("span",null,"连接中断,自动恢复中…",-1)),d("button",{class:"conn-retry",onClick:A[0]||(A[0]=R=>s("retry-connection"))},"立即重试")])):N("",!0),d("div",{ref_key:"listRef",ref:o,class:"message-list"},[e.olderAvailable?(v(),y("div",v0,[d("button",{class:"load-older-btn",disabled:e.olderLoading,onClick:A[1]||(A[1]=R=>s("load-older"))},I(e.olderLoading?"加载中…":"加载更早消息"),9,y0)])):N("",!0),e.messages.length===0?(v(),Ue(p0,{key:1,"work-dir":e.workDir,model:e.model,"context-usage":e.contextUsage,connected:e.connected,onPick:A[2]||(A[2]=R=>s("pick",R))},null,8,["work-dir","model","context-usage","connected"])):N("",!0),(v(!0),y(Q,null,ze(e.messages,(R,J)=>(v(),Ue(e0,{key:R.id,message:R,"is-latest-user":R.id===r.value,idle:!e.busy,streaming:e.busy&&R.id===l.value&&R.role==="assistant","session-id":e.sessionId,"can-fork":!e.busy&&R.id===i.value,"show-timestamp":a(J),onEdit:A[3]||(A[3]=oe=>s("edit",oe)),onRetry:A[4]||(A[4]=oe=>s("retry-message")),onFork:A[5]||(A[5]=oe=>s("fork"))},null,8,["message","is-latest-user","idle","streaming","session-id","can-fork","show-timestamp"]))),128)),O.value?(v(),y("div",b0,[...A[8]||(A[8]=[d("div",{class:"sk-body"},[d("div",{class:"sk-line sk-w-60"}),d("div",{class:"sk-line sk-w-90"}),d("div",{class:"sk-line sk-w-40"})],-1)])])):N("",!0)],512),K(sr,{name:"scroll-btn"},{default:kt(()=>[f.value?(v(),y("button",{key:0,class:"scroll-to-bottom",title:"滚动到最新消息",onClick:F},[K(me,{name:"chevron-down",size:18})])):N("",!0)]),_:1})]))}}),w0=Se(k0,[["__scopeId","data-v-0705d80e"]]),_0={class:"files-pane"},S0={class:"files-path"},x0={class:"crumbs"},C0=["onClick"],$0={key:0,class:"crumb-sep"},T0={class:"crumb-name"},A0={key:0,class:"files-error"},R0={key:1,class:"files-loading"},E0={class:"files-preview-head"},I0=["title"],L0={key:0,class:"files-preview-note"},M0={class:"files-preview-body"},P0={key:0,class:"files-pre"},N0=["src"],O0=["src"],D0=["src"],B0={key:4,class:"files-binary"},G0={key:3,class:"files-list"},j0=["onClick"],U0={class:"files-name"},F0={class:"files-meta"},z0={key:0,class:"files-empty"},ro="/api/v1/files",H0=_e({__name:"FilesBrowser",props:{initialPath:{default:""}},setup(e){const t=e,n=G(""),s=G([]),o=G(!1),r=G(""),l=G(null),i=G("");function a(b){return`${ro}/raw?path=${encodeURIComponent(b)}`}const c=Y(()=>{if(!n.value)return[];const b=n.value.split("/"),k=[];for(let S=0;S<b.length;S++){if(b[S]==="")continue;let $=b[S];S>1&&$==="Users"&&b[S-1]===""&&($=$),k.push({label:$.slice(0,12),path:b.slice(0,S+1).join("/")||"/"})}return k.length>4?[{label:"…",path:"/"},...k.slice(k.length-3)]:k});async function u(b){o.value=!0,r.value="",l.value=null;try{const k=await fetch(`${ro}/list?path=${encodeURIComponent(b)}`);if(!k.ok)throw new Error(`HTTP ${k.status}`);const S=await k.json();n.value=S.path||await f(),s.value=S.entries,n.value||(r.value="没有可访问的目录(尚无会话)")}catch(k){r.value=k instanceof Error?k.message:String(k)}finally{o.value=!1}}async function f(){try{return(await(await fetch(`${ro}/root`)).json()).roots[0]??""}catch{return""}}async function h(b){if(b.type==="dir"){await u(b.path);return}if(p(b.name)==="binary"){l.value={path:b.path,content:"",truncated:!1},i.value="该文件类型暂不支持预览";return}i.value="";try{const S=await fetch(`${ro}/read?path=${encodeURIComponent(b.path)}`);if(!S.ok)throw new Error(`HTTP ${S.status}`);const $=await S.json();$.truncated&&(i.value="文件较大,仅显示前 256KB"),l.value=$}catch(S){i.value=S instanceof Error?S.message:String(S),l.value=null}}function p(b){var S;const k=((S=b.split(".").pop())==null?void 0:S.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","svg","ico","avif"].includes(k)?"image":["mp3","wav","ogg","m4a"].includes(k)?"audio":k==="pdf"?"pdf":["md","txt","json","yml","yaml","csv","log","toml","ts","tsx","js","jsx","py","rs","go","java","c","h","cpp","hpp","sh","css","html","vue","lock","env","patch","diff"].includes(k)?"text":"binary"}const g=Y(()=>l.value?{name:l.value.path.split(/[\\/]/).pop()??"",path:l.value.path}:null);function w(b){return b<1024?`${b} B`:b<1024*1024?`${(b/1024).toFixed(1)} KB`:`${(b/(1024*1024)).toFixed(1)} MB`}return Nt(()=>{u(t.initialPath)}),Ie(()=>t.initialPath,b=>{b&&u(b)}),(b,k)=>{var S,$,T,F,O,C;return v(),y("div",_0,[d("div",S0,[d("button",{class:"files-up",title:"上一级","aria-label":"上一级",onClick:k[0]||(k[0]=A=>u(n.value.split("/").slice(0,-1).join("/")||"/"))},[K(me,{name:"chevron-left",size:16})]),d("div",x0,[(v(!0),y(Q,null,ze(c.value,(A,R)=>(v(),y("span",{key:R,class:"crumb",onClick:J=>u(A.path)},[R>0?(v(),y("b",$0,"/")):N("",!0),d("span",T0,I(A.label),1)],8,C0))),128))])]),r.value?(v(),y("p",A0,I(r.value),1)):o.value?(v(),y("p",R0,"加载中…")):N("",!0),l.value?(v(),y(Q,{key:2},[d("div",E0,[d("span",{class:"files-preview-name",title:(S=l.value)==null?void 0:S.path},I(($=g.value)==null?void 0:$.name),9,I0),d("button",{class:"files-preview-close",title:"关闭预览","aria-label":"关闭预览",onClick:k[1]||(k[1]=A=>l.value=null)},[K(me,{name:"x",size:16})])]),i.value?(v(),y("p",L0,I(i.value),1)):N("",!0),d("div",M0,[p(((T=g.value)==null?void 0:T.name)??"")==="text"?(v(),y("pre",P0,I(l.value.content),1)):p(((F=g.value)==null?void 0:F.name)??"")==="image"?(v(),y("img",{key:1,src:a(l.value.path),alt:"",class:"files-img"},null,8,N0)):p(((O=g.value)==null?void 0:O.name)??"")==="audio"?(v(),y("audio",{key:2,src:a(l.value.path),controls:""},null,8,O0)):p(((C=g.value)==null?void 0:C.name)??"")==="pdf"?(v(),y("iframe",{key:3,src:a(l.value.path),class:"files-pdf",title:"PDF 预览"},null,8,D0)):(v(),y("p",B0,"该文件类型暂不支持预览(可下载)。"))])],64)):(v(),y("ul",G0,[(v(!0),y(Q,null,ze(s.value,A=>(v(),y("li",{key:A.path},[d("button",{class:de(["files-item",{dir:A.type==="dir"}]),onClick:R=>h(A)},[K(me,{name:A.type==="dir"?"folder":"file",size:16},null,8,["name"]),d("span",U0,I(A.name),1),d("span",F0,I(A.type==="dir"?"目录":w(A.size)),1)],10,j0)]))),128)),!o.value&&s.value.length===0?(v(),y("li",z0,"空目录")):N("",!0)]))])}}}),q0=Se(H0,[["__scopeId","data-v-fa6c15e9"]]),V0=34;function Nr(e){const t=e.split("/"),n=t.at(-1)??e;return t.length<=2?{dir:t.length===2?`${t[0]}/`:"",base:n}:e.length<=V0?{dir:`${t.slice(0,-1).join("/")}/`,base:n}:{dir:`…/${t.at(-2)}/`,base:n}}const W0={class:"panel-head-row"},K0=["aria-expanded"],Z0={class:"head-icon"},Y0=["title"],J0={key:1,class:"head-hint"},Q0={class:"head-tail"},X0={key:0,class:"head-count"},ew={class:"panel-body"},tw={key:0,class:"git-files"},nw=["title","onClick"],sw={class:"git-file-name"},ow={key:0,class:"git-file-dir"},rw={class:"git-file-base"},lw={key:0,class:"git-file-stat"},iw={key:0,class:"add"},aw={key:1,class:"del"},cw={key:2,class:"diff-body"},uw={key:3,class:"diff-empty"},dw={key:1,class:"diff-empty"},fw=8,ka="scream-panel-git-open",hw=_e({__name:"GitPanel",props:{gitStatus:{default:null}},emits:["refresh","diff"],setup(e,{emit:t}){const n=e,s=t,o={M:"M",A:"A",D:"D",R:"R",U:"U","??":"?","?":"?"},r={D:"danger",A:"success",R:"success",U:"danger","??":"warning","?":"warning"},l=G(!1),i=G(!0);try{i.value=localStorage.getItem(ka)!=="0"}catch{}function a(){i.value=!i.value;try{localStorage.setItem(ka,i.value?"1":"0")}catch{}}function c(){s("refresh")}const u=Y(()=>{var g;const p=((g=n.gitStatus)==null?void 0:g.files)??[];return l.value?p:p.slice(0,fw)}),f=Y(()=>{var p,g;return Math.max(0,(((g=(p=n.gitStatus)==null?void 0:p.files)==null?void 0:g.length)??0)-u.value.length)}),h=Y(()=>{var b,k;const p=((b=n.gitStatus)==null?void 0:b.ahead)??0,g=((k=n.gitStatus)==null?void 0:k.behind)??0;if(!p&&!g)return"";const w=[];return p&&w.push(`↑${p}`),g&&w.push(`↓${g}`),` · ${w.join(" ")}`});return(p,g)=>{var w;return v(),y("section",{class:de(["panel-section","git-panel",{"is-open":i.value}])},[d("div",W0,[d("button",{class:"panel-head","aria-expanded":i.value,onClick:a},[d("span",Z0,[K(me,{name:"git-branch",size:14})]),g[1]||(g[1]=d("span",{class:"head-title"},"Git 变更",-1)),e.gitStatus?(v(),y("span",{key:0,class:"head-hint",title:`${e.gitStatus.branch??"detached"}${h.value}`},I(e.gitStatus.branch??"detached")+I(h.value),9,Y0)):(v(),y("span",J0,"状态不可用")),d("span",Q0,[e.gitStatus?(v(),y("span",X0,I(e.gitStatus.changed),1)):N("",!0),K(me,{class:de(["chevron",{rotated:i.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,K0),d("button",{class:"icon-btn",title:"刷新","aria-label":"刷新 Git 状态",onClick:c},[K(me,{name:"refresh",size:14})])]),Ke(d("div",ew,[e.gitStatus?(v(),y(Q,{key:0},[u.value.length?(v(),y("ul",tw,[(v(!0),y(Q,null,ze(u.value,b=>(v(),y("li",{key:b.path},[d("button",{class:"git-file",title:`查看 ${b.displayPath??b.path} 的 diff`,onClick:k=>s("diff",{path:b.path,display:b.displayPath??b.path,adds:b.adds,dels:b.dels})},[d("span",{class:de(["git-file-status",r[b.status]??""])},I(o[b.status]??b.status),3),d("span",sw,[ne(Nr)(b.displayPath??b.path).dir?(v(),y("span",ow,I(ne(Nr)(b.displayPath??b.path).dir),1)):N("",!0),d("span",rw,I(ne(Nr)(b.displayPath??b.path).base),1)]),b.adds!==void 0||b.dels!==void 0?(v(),y("span",lw,[b.adds?(v(),y("span",iw,"+"+I(b.adds),1)):N("",!0),b.dels?(v(),y("span",aw,"−"+I(b.dels),1)):N("",!0)])):N("",!0)],8,nw)]))),128))])):N("",!0),f.value?(v(),y("button",{key:1,class:"git-more",onClick:g[0]||(g[0]=b=>l.value=!l.value)},I(l.value?"收起列表":`显示全部 ${((w=e.gitStatus.files)==null?void 0:w.length)??0} 个文件`),1)):N("",!0),e.gitStatus.diffStat?(v(),y("pre",cw,I(e.gitStatus.diffStat),1)):u.value.length?N("",!0):(v(),y("div",uw,"工作区干净,没有变更。"))],64)):(v(),y("div",dw,"读取 Git 状态失败,点右上角刷新重试。"))],512),[[Fc,i.value]])],2)}}}),pw=Se(hw,[["__scopeId","data-v-07e2afd4"]]),gw={class:"goal-panel panel-section"},mw={class:"section-heading"},vw={class:"head-icon"},yw=["title"],bw={key:0,class:"head-tail"},kw={class:"panel-body"},ww={key:0,class:"empty-state"},_w=["disabled"],Sw={class:"refine-row"},xw=["disabled"],Cw={key:0},$w=["disabled"],Tw={class:"budget-grid"},Aw=["disabled"],Rw=["disabled"],Ew={class:"time-budget"},Iw=["disabled"],Lw=["disabled"],Mw=["disabled"],Pw={key:0,class:"goal-summary"},Nw={class:"objective"},Ow={class:"criterion"},Dw={key:0,class:"reason"},Bw={class:"goal-metrics"},Gw={class:"goal-metric"},jw={key:0,class:"bar"},Uw={class:"goal-metric"},Fw={key:0,class:"bar"},zw={class:"goal-metric"},Hw={key:0,class:"bar"},qw={key:1,class:"budget-warning"},Vw={key:2,class:"notes"},Ww={class:"panel-actions"},Kw=["disabled"],Zw=["disabled"],Yw=["disabled"],Jw=["disabled"],Qw=["disabled"],Xw={class:"budget-grid"},e_=["disabled"],t_=["disabled"],n_={class:"time-budget"},s_=["disabled"],o_=["disabled"],r_={class:"edit-actions"},l_=["disabled"],i_=["disabled"],a_={key:3,class:"form-error"},c_={key:4,class:"pending-copy"},u_=_e({__name:"GoalPanel",props:{goal:{},sessionId:{default:null},connectionStatus:{},busy:{type:Boolean,default:!1},archived:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},error:{default:null},refineGoal:{},createGoal:{},updateGoal:{},pauseGoal:{},resumeGoal:{},cancelGoal:{}},setup(e){const t=e,n=G(""),s=G(""),o=G(""),r=G(""),l=G(""),i=G("minutes"),a=G(!1),c=G(null),u=G(!1),f=Y(()=>t.connectionStatus==="connected"),h=Y(()=>!t.sessionId||!f.value||t.archived||t.pending),p=Y(()=>h.value),g=Y(()=>{var P;return{active:"进行中",paused:"已暂停",blocked:"受阻",complete:"已完成"}[((P=t.goal)==null?void 0:P.status)??"active"]}),w=Y(()=>t.sessionId?t.archived?"归档会话为只读状态":f.value?t.pending?"正在提交请求…":t.goal?"状态由核心事件实时同步":"创建后 Agent 将自动开始执行":"连接恢复后可继续管理":"选择或新建会话后即可配置");Ie(()=>t.sessionId,()=>{a.value=!1,b()}),Ie(()=>{var P;return(P=t.goal)==null?void 0:P.goalId},(P,M)=>{a.value=!1,P!==M&&b()});function b(){n.value="",s.value="",o.value="",r.value="",l.value="",i.value="minutes",u.value=!1,c.value=null}function k(P,M){const X=P.trim();if(!X)return null;const le=Number(X);if(!Number.isSafeInteger(le)||le<=0){c.value=`${M}必须是正整数。`;return}return le}function S(){c.value=null;const P=k(o.value,"轮次预算");if(P===void 0)return null;const M=k(r.value,"Token 预算");if(M===void 0)return null;const X=k(l.value,"时间预算");if(X===void 0)return null;const le=[];return P!==null&&le.push({value:P,unit:"turns"}),M!==null&&le.push({value:M,unit:"tokens"}),X!==null&&le.push({value:X,unit:i.value}),le}async function $(){const P=n.value.trim();if(!P){c.value="请先输入需要优化的目标描述。";return}c.value=null,u.value=!1;const M=await t.refineGoal(P);M!==null&&(n.value=M,u.value=!0)}async function T(){const P=n.value.trim();if(!P){c.value="目标内容不能为空。";return}const M=S();if(M===null)return;await t.createGoal({objective:P,completionCriterion:s.value.trim()||void 0,replace:!1,budgets:M})&&(u.value=!1)}function F(P){P===null?(l.value="",i.value="minutes"):P%36e5===0?(l.value=String(P/36e5),i.value="hours"):P%6e4===0?(l.value=String(P/6e4),i.value="minutes"):P%1e3===0?(l.value=String(P/1e3),i.value="seconds"):(l.value=String(P),i.value="milliseconds")}function O(){const P=t.goal;P&&(n.value=P.objective,o.value=P.budget.turnBudget===null?"":String(P.budget.turnBudget),r.value=P.budget.tokenBudget===null?"":String(P.budget.tokenBudget),F(P.budget.wallClockBudgetMs),c.value=null,a.value=!0)}function C(P,M){return M==="hours"?P*36e5:M==="minutes"?P*6e4:M==="seconds"?P*1e3:P}async function A(){const P=t.goal;if(!P)return;const M=n.value.trim();if(!M){c.value="目标内容不能为空。";return}const X=S();if(X===null)return;const le=k(o.value,"轮次预算"),ve=k(r.value,"Token 预算"),De=k(l.value,"时间预算");if(le===void 0||ve===void 0||De===void 0)return;if(P.budget.turnBudget!==null&&le===null){c.value="当前协议不支持清除已有轮次预算,请填写新的正整数。";return}if(P.budget.tokenBudget!==null&&ve===null){c.value="当前协议不支持清除已有 Token 预算,请填写新的正整数。";return}if(P.budget.wallClockBudgetMs!==null&&De===null){c.value="当前协议不支持清除已有时间预算,请填写新的正整数。";return}const W=X.filter(xe=>xe.unit==="turns"?xe.value!==P.budget.turnBudget:xe.unit==="tokens"?xe.value!==P.budget.tokenBudget:C(xe.value,xe.unit)!==P.budget.wallClockBudgetMs),te=M===P.objective?void 0:M;if(te===void 0&&W.length===0){c.value="目标与预算没有变化。";return}await t.updateGoal({objective:te,budgets:W})&&(a.value=!1)}async function R(P){c.value=null,!(P==="cancel"&&!window.confirm("确定取消当前 Goal?当前 Goal 状态将被清除。"))&&(P==="pause"?await t.pauseGoal():P==="resume"?await t.resumeGoal():await t.cancelGoal())}function J(P){return P.toLocaleString("zh-CN")}function oe(P){if(P<1e3)return`${P} 毫秒`;const M=Math.floor(P/1e3);if(M<60)return`${M} 秒`;const X=Math.floor(M/3600),le=Math.floor(M%3600/60);return X>0?`${X} 小时 ${le} 分钟`:`${le} 分钟`}function H(P,M){return M===null||M<=0?0:Math.min(100,Math.round(P/M*100))}function pe(P){return new Date(P).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}return(P,M)=>(v(),y("section",gw,[d("div",mw,[d("span",vw,[K(me,{name:"target",size:14})]),M[15]||(M[15]=d("span",{class:"head-title"},"Goal 管理",-1)),d("span",{class:"head-hint",title:w.value},I(w.value),9,yw),e.goal?(v(),y("span",bw,[d("span",{class:de(["status-pill",`is-${e.goal.status}`])},I(g.value),3)])):N("",!0)]),d("div",kw,[e.sessionId?e.goal?(v(),y(Q,{key:2},[a.value?(v(),y("form",{key:1,class:"goal-form edit-form",onSubmit:_t(A,["prevent"])},[d("label",null,[M[31]||(M[31]=d("span",null,"目标内容",-1)),Ke(d("textarea",{"onUpdate:modelValue":M[9]||(M[9]=X=>n.value=X),rows:"3",maxlength:"4000",disabled:h.value||e.busy},null,8,Qw),[[rt,n.value]])]),M[36]||(M[36]=d("div",{class:"budget-title"},[$e("更新预算 "),d("small",null,"仅提交发生变化的预算")],-1)),d("div",Xw,[d("label",null,[M[32]||(M[32]=d("span",null,"轮次",-1)),Ke(d("input",{"onUpdate:modelValue":M[10]||(M[10]=X=>o.value=X),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,e_),[[rt,o.value]])]),d("label",null,[M[33]||(M[33]=d("span",null,"Token",-1)),Ke(d("input",{"onUpdate:modelValue":M[11]||(M[11]=X=>r.value=X),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,t_),[[rt,r.value]])])]),d("div",n_,[d("label",null,[M[34]||(M[34]=d("span",null,"时间",-1)),Ke(d("input",{"onUpdate:modelValue":M[12]||(M[12]=X=>l.value=X),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,s_),[[rt,l.value]])]),Ke(d("select",{"onUpdate:modelValue":M[13]||(M[13]=X=>i.value=X),"aria-label":"时间预算单位",disabled:h.value||e.busy},[...M[35]||(M[35]=[d("option",{value:"minutes"},"分钟",-1),d("option",{value:"hours"},"小时",-1),d("option",{value:"seconds"},"秒",-1),d("option",{value:"milliseconds"},"毫秒",-1)])],8,o_),[[zi,i.value]])]),d("div",r_,[d("button",{type:"button",class:"secondary",disabled:e.pending,onClick:M[14]||(M[14]=X=>a.value=!1)},"返回",8,l_),d("button",{class:"primary small",type:"submit",disabled:h.value||e.busy},"保存修改",8,i_)])],32)):(v(),y("div",Pw,[d("div",Nw,[M[24]||(M[24]=d("small",null,"目标",-1)),d("p",null,I(e.goal.objective),1)]),d("div",Ow,[M[25]||(M[25]=d("small",null,"完成标准",-1)),d("p",null,I(e.goal.completionCriterion??"未设置,由 Agent 根据目标判断完成。"),1)]),e.goal.terminalReason?(v(),y("div",Dw,[M[26]||(M[26]=d("strong",null,"状态原因",-1)),d("span",null,I(e.goal.terminalReason),1)])):N("",!0),d("dl",Bw,[d("div",Gw,[M[27]||(M[27]=d("dt",null,"轮次",-1)),d("dd",null,I(e.goal.turnsUsed)+" / "+I(e.goal.budget.turnBudget??"不限"),1),e.goal.budget.turnBudget!==null?(v(),y("i",jw,[d("i",{style:cn({width:`${H(e.goal.turnsUsed,e.goal.budget.turnBudget)}%`})},null,4)])):N("",!0)]),d("div",Uw,[M[28]||(M[28]=d("dt",null,"Token",-1)),d("dd",null,I(J(e.goal.tokensUsed))+" / "+I(e.goal.budget.tokenBudget===null?"不限":J(e.goal.budget.tokenBudget)),1),e.goal.budget.tokenBudget!==null?(v(),y("i",Fw,[d("i",{style:cn({width:`${H(e.goal.tokensUsed,e.goal.budget.tokenBudget)}%`})},null,4)])):N("",!0)]),d("div",zw,[M[29]||(M[29]=d("dt",null,"时间",-1)),d("dd",null,I(oe(e.goal.wallClockMs))+" / "+I(e.goal.budget.wallClockBudgetMs===null?"不限":oe(e.goal.budget.wallClockBudgetMs)),1),e.goal.budget.wallClockBudgetMs!==null?(v(),y("i",Hw,[d("i",{style:cn({width:`${H(e.goal.wallClockMs,e.goal.budget.wallClockBudgetMs)}%`})},null,4)])):N("",!0)])]),e.goal.budget.overBudget?(v(),y("div",qw,"已达到或超过执行预算。")):N("",!0),e.goal.notes.length?(v(),y("details",Vw,[d("summary",null,"工作记录("+I(e.goal.notes.length)+")",1),d("ol",null,[(v(!0),y(Q,null,ze(e.goal.notes,X=>(v(),y("li",{key:`${X.time}-${X.content}`},[d("time",null,I(pe(X.time)),1),d("span",null,I(X.content),1)]))),128))])])):N("",!0),d("div",Ww,[e.goal.status!=="complete"?(v(),y("button",{key:0,class:"secondary",disabled:h.value||e.busy,onClick:O},[K(me,{name:"edit",size:14}),M[30]||(M[30]=$e("编辑",-1))],8,Kw)):N("",!0),e.goal.status==="active"?(v(),y("button",{key:1,class:"secondary",disabled:h.value,onClick:M[6]||(M[6]=X=>R("pause"))},"暂停",8,Zw)):N("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(v(),y("button",{key:2,class:"primary small",disabled:h.value||e.busy,onClick:M[7]||(M[7]=X=>R("resume"))},"继续",8,Yw)):N("",!0),d("button",{class:"danger",disabled:h.value,onClick:M[8]||(M[8]=X=>R("cancel"))},"取消 Goal",8,Jw)])]))],64)):(v(),y("form",{key:1,class:"goal-form",onSubmit:_t(T,["prevent"])},[d("label",null,[M[16]||(M[16]=d("span",null,"目标内容",-1)),Ke(d("textarea",{"onUpdate:modelValue":M[0]||(M[0]=X=>n.value=X),rows:"3",maxlength:"4000",placeholder:"描述希望 Agent 持续完成的目标",disabled:p.value},null,8,_w),[[rt,n.value]])]),d("div",Sw,[d("button",{type:"button",class:"secondary",disabled:p.value||!n.value.trim(),onClick:$},[K(me,{name:"sparkles",size:15}),M[17]||(M[17]=$e(" AI 优化 ",-1))],8,xw),u.value?(v(),y("small",Cw,"已优化,请确认或继续编辑后再创建。")):N("",!0)]),d("label",null,[M[18]||(M[18]=d("span",null,[$e("完成标准 "),d("small",null,"可选")],-1)),Ke(d("textarea",{"onUpdate:modelValue":M[1]||(M[1]=X=>s.value=X),rows:"2",placeholder:"例如:聚焦测试、类型检查与 Web 构建全部通过",disabled:p.value},null,8,$w),[[rt,s.value]])]),M[23]||(M[23]=d("div",{class:"budget-title"},[$e("执行预算 "),d("small",null,"留空表示不限制")],-1)),d("div",Tw,[d("label",null,[M[19]||(M[19]=d("span",null,"轮次",-1)),Ke(d("input",{"onUpdate:modelValue":M[2]||(M[2]=X=>o.value=X),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,Aw),[[rt,o.value]])]),d("label",null,[M[20]||(M[20]=d("span",null,"Token",-1)),Ke(d("input",{"onUpdate:modelValue":M[3]||(M[3]=X=>r.value=X),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,Rw),[[rt,r.value]])])]),d("div",Ew,[d("label",null,[M[21]||(M[21]=d("span",null,"时间",-1)),Ke(d("input",{"onUpdate:modelValue":M[4]||(M[4]=X=>l.value=X),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,Iw),[[rt,l.value]])]),Ke(d("select",{"onUpdate:modelValue":M[5]||(M[5]=X=>i.value=X),"aria-label":"时间预算单位",disabled:p.value},[...M[22]||(M[22]=[d("option",{value:"minutes"},"分钟",-1),d("option",{value:"hours"},"小时",-1),d("option",{value:"seconds"},"秒",-1),d("option",{value:"milliseconds"},"毫秒",-1)])],8,Lw),[[zi,i.value]])]),d("button",{class:"primary",type:"submit",disabled:p.value||!n.value.trim()},I(e.pending?"正在创建…":"创建并开始执行"),9,Mw)],32)):(v(),y("div",ww,"暂无会话,Goal 管理暂不可用。")),c.value||e.error?(v(),y("p",a_,I(c.value??e.error),1)):e.pending?(v(),y("p",c_,"请求处理中,状态将在核心事件到达后同步。")):N("",!0)])]))}}),d_=Se(u_,[["__scopeId","data-v-2e8dbdc6"]]),f_={class:"panel-section like-section"},h_={class:"section-heading"},p_={class:"head-icon"},g_={class:"panel-body"},m_={class:"kv-rows"},v_={class:"dialog"},y_=["onUpdate:modelValue","placeholder"],b_={key:0,class:"dialog-error"},k_={class:"dialog-actions"},w_=["disabled"],__=_e({__name:"LikePanel",props:{like:{},updateLike:{type:Function}},setup(e){const t=e,n=G(!1),s=G(!1),o=G(""),r=G({}),l=[{key:"nickname",label:"昵称",placeholder:"用户称呼,如:老板"},{key:"tone",label:"语气",placeholder:"AI 风格,如:专业不拖沓"},{key:"other",label:"偏好",placeholder:"其他用户偏好"},{key:"doNot",label:"禁止",placeholder:"用户明确不让做的事"}];function i(){r.value={...t.like},o.value="",n.value=!0}async function a(){s.value=!0,o.value="";const c=await t.updateLike(r.value);s.value=!1,c?n.value=!1:o.value="保存失败"}return(c,u)=>(v(),y("section",f_,[d("div",h_,[d("span",p_,[K(me,{name:"settings",size:14})]),u[2]||(u[2]=d("span",{class:"head-title"},"偏好设置",-1)),u[3]||(u[3]=d("span",{class:"head-hint"},"/like 用户偏好",-1))]),d("div",g_,[d("dl",m_,[(v(),y(Q,null,ze(l,f=>d("div",{key:f.key,class:"kv-row"},[d("dt",null,I(f.label),1),d("dd",null,I((e.like[f.key]??"").trim()||"未设置"),1)])),64))]),d("div",{class:"panel-actions"},[d("button",{class:"like-edit",onClick:i},"编辑偏好")])]),n.value?(v(),y("div",{key:0,class:"dialog-overlay",onClick:u[1]||(u[1]=_t(f=>n.value=!1,["self"]))},[d("div",v_,[u[4]||(u[4]=d("div",{class:"dialog-title"},"编辑用户偏好",-1)),(v(),y(Q,null,ze(l,f=>d("label",{key:f.key,class:"dialog-field"},[d("span",null,I(f.label),1),Ke(d("input",{"onUpdate:modelValue":h=>r.value[f.key]=h,placeholder:f.placeholder},null,8,y_),[[rt,r.value[f.key]]])])),64)),o.value?(v(),y("div",b_,I(o.value),1)):N("",!0),d("div",k_,[d("button",{onClick:u[0]||(u[0]=f=>n.value=!1)},"取消"),d("button",{disabled:s.value,onClick:a},I(s.value?"保存中…":"确认"),9,w_)])])])):N("",!0)]))}}),S_=Se(__,[["__scopeId","data-v-a7906d58"]]),x_=["aria-expanded"],C_={class:"head-icon"},$_={class:"head-hint"},T_={class:"head-tail"},A_=["title"],R_={class:"panel-body"},E_={class:"stat-grid"},I_={class:"stat"},L_={class:"stat"},M_=["title"],P_={key:1,class:"faint"},N_={class:"stat wide"},O_={class:"mono"},wa="scream-panel-runstatus-open",D_=_e({__name:"RunStatusPanel",props:{status:{},busy:{type:Boolean,default:!1},connectionStatus:{}},setup(e){const t=e,n=G(!0);try{n.value=localStorage.getItem(wa)!=="0"}catch{}function s(){n.value=!n.value;try{localStorage.setItem(wa,n.value?"1":"0")}catch{}}const o=Y(()=>{const i=t.status.contextUsage;return i===void 0?null:Math.round((i>1?i/100:i)*100)}),r=Y(()=>{var i,a;return`Tokens: ${((i=t.status.contextTokens)==null?void 0:i.toLocaleString())??"-"} / ${((a=t.status.maxContextTokens)==null?void 0:a.toLocaleString())??"-"}`}),l=Y(()=>({connected:"已连接",connecting:"连接中",reconnecting:"重连中",disconnected:"已断开",idle:"空闲"})[t.connectionStatus]??"空闲");return Ie(()=>t.busy,()=>{t.busy&&!n.value&&(n.value=!0)}),(i,a)=>{var c,u;return v(),y("section",{class:de(["panel-section","run-status",{"is-open":n.value}])},[d("button",{class:"panel-head","aria-expanded":n.value,onClick:s},[d("span",C_,[K(me,{name:"activity",size:14})]),a[0]||(a[0]=d("span",{class:"head-title"},"运行状态",-1)),d("span",$_,I(e.busy?"正在处理会话":"已就绪,等待任务"),1),d("span",T_,[d("span",{class:de(["head-dot",{busy:e.busy}]),title:e.busy?"Agent 正在处理":"空闲"},null,10,A_),K(me,{class:de(["chevron",{rotated:n.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,x_),Ke(d("div",R_,[d("dl",E_,[d("div",I_,[a[1]||(a[1]=d("dt",null,"连接",-1)),d("dd",null,[d("span",{class:de(["conn-dot",e.connectionStatus]),"aria-hidden":"true"},null,2),d("span",{class:de(["conn",e.connectionStatus])},I(l.value),3)])]),d("div",L_,[a[2]||(a[2]=d("dt",null,"上下文占用",-1)),o.value!==null?(v(),y("dd",{key:0,title:r.value},[K(Yc,{usage:e.status.contextUsage,size:14},null,8,["usage"]),$e(I(o.value)+"% ",1)],8,M_)):(v(),y("dd",P_,"未知"))]),d("div",N_,[a[3]||(a[3]=d("dt",null,"Token(输入 / 上限)",-1)),d("dd",O_,I(((c=e.status.contextTokens)==null?void 0:c.toLocaleString())??"-")+" / "+I(((u=e.status.maxContextTokens)==null?void 0:u.toLocaleString())??"-"),1)])])],512),[[Fc,n.value]])],2)}}}),B_=Se(D_,[["__scopeId","data-v-59b0c4e7"]]),G_={class:"todo-panel panel-section"},j_={class:"section-heading"},U_={class:"head-icon"},F_={class:"head-hint"},z_={class:"head-tail"},H_={class:"head-count"},q_={key:0,class:"panel-body"},V_={class:"empty-state"},W_={key:1,class:"panel-body"},K_={class:"progress-row"},Z_={class:"bar","aria-hidden":"true"},Y_={class:"progress-value"},J_=["title"],Q_={class:"todo-title"},X_=_e({__name:"TodoPanel",props:{todos:{}},setup(e){const t=e,n=Y(()=>Yh(t.todos)),s=Y(()=>t.todos.filter(c=>c.status==="done").length),o=Y(()=>t.todos.filter(c=>c.status==="in_progress").length),r=Y(()=>t.todos.filter(c=>c.status==="pending").length),l=Y(()=>t.todos.length?Math.round(s.value/t.todos.length*100):0),i=Y(()=>{if(!t.todos.length)return"直接来自 Agent 核心状态";if(s.value===t.todos.length)return"全部完成";const c=[];return o.value&&c.push(`进行中 ${o.value}`),r.value&&c.push(`待处理 ${r.value}`),c.join(" · ")||"直接来自 Agent 核心状态"}),a={pending:{label:"待处理",symbol:"○"},in_progress:{label:"进行中",symbol:"●"},done:{label:"已完成",symbol:"✓"}};return(c,u)=>(v(),y("section",G_,[d("div",j_,[d("span",U_,[K(me,{name:"clipboard",size:14})]),u[0]||(u[0]=d("span",{class:"head-title"},"核心 Todo",-1)),d("span",F_,I(i.value),1),d("span",z_,[d("span",H_,I(s.value)+"/"+I(e.todos.length),1)])]),e.todos.length===0?(v(),y("div",q_,[d("div",V_,[K(me,{name:"check",size:18}),u[1]||(u[1]=d("span",null,"暂无 Todo",-1)),u[2]||(u[2]=d("small",null,"Agent 创建任务清单后会在这里实时显示。",-1))])])):(v(),y("div",W_,[d("div",K_,[d("i",Z_,[d("i",{style:cn({width:`${l.value}%`})},null,4)]),d("span",Y_,I(l.value)+"%",1)]),(v(!0),y(Q,null,ze(n.value,(f,h)=>(v(),y("section",{key:f.phase??`unphased-${h}`,class:"todo-group"},[d("h4",null,I(f.phase??"未分阶段"),1),d("ol",null,[(v(!0),y(Q,null,ze(f.items,(p,g)=>(v(),y("li",{key:`${h}-${g}-${p.title}`,class:de(`is-${p.status}`)},[d("span",{class:"status-symbol",title:a[p.status].label},I(a[p.status].symbol),9,J_),d("span",Q_,I(p.title),1),d("small",null,I(a[p.status].label),1)],2))),128))])]))),128))]))]))}}),eS=Se(X_,[["__scopeId","data-v-6a025f22"]]),tS={class:"drawer"},nS={class:"drawer-toolbar"},sS={class:"drawer-tabs",role:"tablist","aria-label":"抽屉面板"},oS=["aria-selected"],rS=["aria-selected"],lS={class:"drawer-body"},iS={class:"git-diff-head"},aS=["title"],cS={class:"git-diff-tools"},uS={key:0,class:"git-diff-stat"},dS={key:0,class:"add"},fS={key:1,class:"del"},hS={key:0,class:"git-diff-body"},pS={key:1,class:"git-diff-empty"},gS=_e({__name:"SessionDrawer",props:{client:{}},emits:["refresh-git","close","insert"],setup(e){const t=e,n=G("detail"),s=G(null),o=G(null);async function r(C){var R,J,oe;s.value={...C,lines:[],loading:!0};try{const pe=await(await fetch(`/api/v1/git/diff?path=${encodeURIComponent(C.path)}`)).json(),P=z1(pe.patch??""),M=C.adds??(C.dels===void 0?P.filter(X=>X.type==="add").length:void 0);s.value={...C,adds:M,lines:P,loading:!1}}catch{s.value={...C,lines:[],loading:!1}}await It();const A=((J=(R=globalThis.window)==null?void 0:R.matchMedia)==null?void 0:J.call(R,"(prefers-reduced-motion: reduce)").matches)===!0;(oe=o.value)==null||oe.scrollIntoView({block:"start",behavior:A?"auto":"smooth"})}const{connectionStatus:l,status:i,sessionId:a,isBusy:c,isArchived:u,goal:f,todos:h,goalRequestPending:p,goalRequestError:g,like:w,gitStatus:b,refineGoal:k,createGoal:S,updateGoal:$,pauseGoal:T,resumeGoal:F,cancelGoal:O}=t.client;return(C,A)=>{const R=bf("SvgIcon");return v(),y("aside",tS,[d("div",nS,[d("div",sS,[d("button",{role:"tab","aria-selected":n.value==="detail",class:de(["drawer-tab",{active:n.value==="detail"}]),onClick:A[0]||(A[0]=J=>n.value="detail")}," 详情 ",10,oS),d("button",{role:"tab","aria-selected":n.value==="files",class:de(["drawer-tab",{active:n.value==="files"}]),onClick:A[1]||(A[1]=J=>n.value="files")}," 文件 ",10,rS)]),d("button",{class:"drawer-close",title:"收起面板","aria-label":"收起详情",onClick:A[2]||(A[2]=J=>C.$emit("close"))},[K(R,{name:"panel-right",size:16})])]),d("div",lS,[n.value==="detail"?(v(),y(Q,{key:0},[K(B_,{status:ne(i),busy:ne(c),"connection-status":ne(l)},null,8,["status","busy","connection-status"]),K(pw,{"git-status":ne(b),onRefresh:A[3]||(A[3]=J=>C.$emit("refresh-git")),onDiff:r},null,8,["git-status"]),s.value?(v(),y("div",{key:0,ref_key:"diffRef",ref:o,class:"git-diff-view"},[d("div",iS,[d("span",{class:"git-diff-title",title:s.value.path},I(s.value.loading?"加载中…":s.value.display),9,aS),d("span",cS,[!s.value.loading&&(s.value.adds||s.value.dels)?(v(),y("span",uS,[s.value.adds?(v(),y("span",dS,"+"+I(s.value.adds),1)):N("",!0),s.value.dels?(v(),y("span",fS,"−"+I(s.value.dels),1)):N("",!0)])):N("",!0),d("button",{class:"git-diff-close",title:"关闭 diff","aria-label":"关闭 diff",onClick:A[4]||(A[4]=J=>s.value=null)},"✕")])]),s.value.lines.length?(v(),y("div",hS,[K(Vu,{lines:s.value.lines},null,8,["lines"])])):s.value.loading?N("",!0):(v(),y("p",pS,"该文件无差异内容(可能是二进制文件或已被忽略)。"))],512)):N("",!0),K(eS,{todos:ne(h)},null,8,["todos"]),K(S_,{like:ne(w),"update-like":t.client.updateLike},null,8,["like","update-like"]),K(d_,{goal:ne(f),"session-id":ne(a),"connection-status":ne(l),busy:ne(c),archived:ne(u),pending:ne(p),error:ne(g),"refine-goal":ne(k),"create-goal":ne(S),"update-goal":ne($),"pause-goal":ne(T),"resume-goal":ne(F),"cancel-goal":ne(O)},null,8,["goal","session-id","connection-status","busy","archived","pending","error","refine-goal","create-goal","update-goal","pause-goal","resume-goal","cancel-goal"])],64)):(v(),Ue(q0,{key:t.client.workDir.value||"none","initial-path":t.client.workDir.value||""},null,8,["initial-path"]))])])}}}),mS=Se(gS,[["__scopeId","data-v-2d1f803d"]]),vS={class:"conversation"},yS={class:"chat-stage"},bS={class:"chat-column"},kS={class:"composer-dock"},wS=_e({__name:"ConversationView",props:{client:{}},emits:["home"],setup(e,{emit:t}){const n=e,s=t,{connectionStatus:o,messages:r,pendingApprovals:l,status:i,sessionId:a,workDir:c,isBusy:u,models:f,sendPrompt:h,sendCommand:p,clearMessages:g,appendSystemMessage:w,abort:b,resolveApproval:k,exportSession:S,fetchSnapshot:$,switchModel:T,switchThinking:F}=n.client,O=G(null),C=G(!1),A=G(!1),R=G("status"),J=Y(()=>{const W=n.client.sessions.value.find(xe=>xe.sessionId===n.client.currentSessionId.value),te=W==null?void 0:W.title;if(te&&te!=="新会话"&&te!=="New Session")return te;const ke=r.value.find(xe=>xe.role==="user");if(ke){const xe=ke.content.replace(/\s+/g," ").trim();if(xe)return xe.length>24?`${xe.slice(0,24)}…`:xe}return te??null});function oe(W){var te;(te=O.value)==null||te.insertText(W)}function H(W){$(),R.value=W,A.value=!0}function pe(){var te;(((te=O.value)==null?void 0:te.openModelPicker())??!1)||w(`当前模型:${i.value.model??"unknown"}`)}function P(W,te){switch(W){case"compact":p("compact");break;case"model":pe();break;case"clear":g();break;case"new":s("home");break;case"help":w(Zc());break;case"auto":case"yes":case"plan":case"fork":case"title":case"btw":p(W,te);break;case"status":H("status");break;case"usage":H("usage");break;default:w(`未知命令:/${W}`)}}function M(W){p("title",W)}function X(){if(u.value||!o.value)return;const W=[...r.value].reverse().find(te=>te.role==="user");W&&h(W.content)}const le=G(!1);async function ve(){le.value=!0,await n.client.loadOlderMessages(),le.value=!1}function De(){u.value||(p("fork"),setTimeout(()=>{n.client.fetchSessions()},1200))}return(W,te)=>(v(),y("div",vS,[K(jg,{title:J.value,busy:ne(u),"drawer-open":C.value,onHome:te[0]||(te[0]=ke=>s("home")),onRename:M,onExport:te[1]||(te[1]=ke=>ne(a)&&ne(S)(ne(a))),onClear:ne(g),onToggleDrawer:te[2]||(te[2]=ke=>C.value=!C.value)},null,8,["title","busy","drawer-open","onClear"]),d("div",yS,[d("div",bS,[K(w0,{messages:ne(r),busy:ne(u),"work-dir":ne(c),"session-id":ne(a)??"",model:ne(i).model??null,"context-usage":ne(i).contextUsage??null,connected:ne(o)==="connected","older-available":n.client.olderAvailable.value,"older-loading":le.value,onEdit:oe,onPick:ne(h),onRetryConnection:te[3]||(te[3]=ke=>n.client.reconnectNow()),onRetryMessage:X,onLoadOlder:ve,onFork:De},null,8,["messages","busy","work-dir","session-id","model","context-usage","connected","older-available","older-loading","onPick"]),d("div",kS,[K(vp,{approvals:ne(l),onResolve:ne(k)},null,8,["approvals","onResolve"]),K(Jc,{ref_key:"composerRef",ref:O,busy:ne(u),status:ne(i),"session-id":ne(a),models:ne(f),onSend:ne(h),onAbort:ne(b),onCommand:P,onSwitchModel:ne(T),onSwitchThinking:ne(F)},null,8,["busy","status","session-id","models","onSend","onAbort","onSwitchModel","onSwitchThinking"])])]),K(sr,{name:"drawer"},{default:kt(()=>[C.value?(v(),Ue(mS,{key:0,client:n.client,onRefreshGit:te[4]||(te[4]=ke=>n.client.fetchGitStatus()),onClose:te[5]||(te[5]=ke=>C.value=!1)},null,8,["client"])):N("",!0)]),_:1})]),A.value?(v(),Ue(_m,{key:0,mode:R.value,status:ne(i),"session-id":ne(a),"work-dir":ne(c),onClose:te[6]||(te[6]=ke=>A.value=!1)},null,8,["mode","status","session-id","work-dir"])):N("",!0)]))}}),_S=Se(wS,[["__scopeId","data-v-fc80feee"]]),SS={class:"settings"},xS={class:"settings-inner"},CS={class:"settings-section"},$S={class:"theme-grid",role:"radiogroup","aria-label":"主题"},TS=["aria-checked","onClick"],AS={class:"settings-section"},RS={class:"like-fields"},ES={class:"like-label"},IS=["onUpdate:modelValue","placeholder","aria-label"],LS={class:"like-actions"},MS={key:0,class:"saved-hint"},PS=_e({__name:"SettingsView",props:{like:{default:()=>({})}},emits:["update-like"],setup(e,{emit:t}){const n=e,s=t,o=un("theme",G("system")),r=un("setTheme",()=>{}),l=[{id:"light",label:"浅色",icon:"sun"},{id:"dark",label:"深色",icon:"moon"},{id:"system",label:"跟随系统",icon:"monitor"}],i=G({...n.like}),a=G(!1);Ie(()=>n.like,h=>{i.value={...h}});const c=[{key:"nickname",label:"称呼",hint:"AI 如何称呼你"},{key:"tone",label:"语气",hint:"回复的语气风格"},{key:"other",label:"偏好",hint:"其他偏好说明"},{key:"doNot",label:"禁止事项",hint:"明确禁止的行为"}];function u(){s("update-like",f()),a.value=!0,setTimeout(()=>a.value=!1,1500)}function f(){const h={};for(const p of c){const g=i.value[p.key];typeof g=="string"&&g.trim()&&(h[p.key]=g.trim())}return h}return(h,p)=>(v(),y("div",SS,[d("div",xS,[p[3]||(p[3]=d("h1",{class:"settings-title"},"设置",-1)),d("section",CS,[p[0]||(p[0]=d("h2",{class:"section-title"},"外观",-1)),d("div",$S,[(v(),y(Q,null,ze(l,g=>d("button",{key:g.id,role:"radio","aria-checked":ne(o)===g.id,class:de(["theme-option",{active:ne(o)===g.id}]),onClick:w=>ne(r)(g.id)},[K(me,{name:g.icon,size:20},null,8,["name"]),d("span",null,I(g.label),1)],10,TS)),64))])]),d("section",AS,[p[2]||(p[2]=d("h2",{class:"section-title"},"偏好设置",-1)),d("div",RS,[(v(),y(Q,null,ze(c,g=>d("label",{key:g.key,class:"like-field"},[d("span",ES,I(g.label),1),Ke(d("input",{"onUpdate:modelValue":w=>i.value[g.key]=w,class:"like-input",placeholder:g.hint,"aria-label":g.label},null,8,IS),[[rt,i.value[g.key]]])])),64)),d("div",LS,[K(zn,{variant:"primary",onClick:u},{default:kt(()=>[...p[1]||(p[1]=[$e("保存偏好",-1)])]),_:1}),a.value?(v(),y("span",MS,"已保存")):N("",!0)])])])])]))}}),NS=Se(PS,[["__scopeId","data-v-701eb9cd"]]),Wu=""+new URL("logo-v2-ChmPAIbI.svg",import.meta.url).href,OS={class:"sidebar-head"},DS=["src"],BS=["title","aria-label","aria-expanded"],GS=["title"],jS={key:0},US={key:0,class:"side-search"},FS={class:"spaces"},zS=["title"],HS=["title","onClick"],qS={class:"space-name"},VS={class:"space-count"},WS={key:0,class:"space-sessions"},KS=["title","onClick"],ZS={class:"session-title"},YS={class:"session-meta"},JS=["title","onClick","onKeydown"],QS={key:0,class:"spaces-empty"},XS={class:"sidebar-foot","aria-label":"功能区"},ex=["title"],tx={key:0},nx=["title"],sx={key:0},ox={class:"sidebar-identity"},rx={key:0,class:"identity-text"},lx=_e({__name:"Sidebar",props:{view:{},sessions:{},currentSessionId:{default:null},collapsed:{type:Boolean,default:!1},showCollapseToggle:{type:Boolean,default:!0}},emits:["navigate","switch-session","delete-session","create-session","toggle-collapse"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=G(null),l=G("");function i(){var b,k;(b=r.value)==null||b.focus(),(k=r.value)==null||k.select()}t({focusSearch:i});const a=Y(()=>{const b=l.value.trim().toLowerCase();return b?s.sessions.filter(k=>w(k).toLowerCase().includes(b)||k.workDir.toLowerCase().includes(b)):s.sessions}),c=Y(()=>{var S;const b=new Map;for(const $ of a.value){const T=$.workDir||"默认空间",F=T.split(/[\\/]/).filter(Boolean),O=F.length>0?F[F.length-1]:T,C=b.get(O);C?C.items.push($):b.set(O,{name:O,workDir:T,items:[$]})}const k=(S=s.sessions.find($=>$.sessionId===s.currentSessionId))==null?void 0:S.workDir;return[...b.values()].sort(($,T)=>{var F,O;return $.workDir===k?-1:T.workDir===k?1:(((F=T.items[0])==null?void 0:F.createdAt)??0)-(((O=$.items[0])==null?void 0:O.createdAt)??0)})}),u=G(new Set);function f(b){const k=new Set(u.value);k.has(b)?k.delete(b):k.add(b),u.value=k}function h(b){o("switch-session",b)}function p(b,k){window.confirm(`删除会话「${k}」?此操作不可恢复。`)&&o("delete-session",b)}function g(b){if(!b)return"";const k=Date.now()-b;if(k<6e4)return"刚刚";if(k<36e5)return`${Math.floor(k/6e4)} 分钟前`;if(k<864e5)return`${Math.floor(k/36e5)} 小时前`;const S=new Date(b);return`${S.getMonth()+1}/${S.getDate()}`}function w(b){const k=(b.title||"").trim();return k&&k!=="新会话"&&k!=="New Session"?k:"未命名会话"}return(b,k)=>(v(),y("aside",{class:de(["sidebar",{"is-collapsed":e.collapsed}])},[d("div",OS,[d("button",{class:"sidebar-brand",title:"回到新对话",onClick:k[0]||(k[0]=S=>o("navigate","home"))},[d("img",{class:"brand-logo",src:ne(Wu),alt:"scream"},null,8,DS)]),e.showCollapseToggle?(v(),y("button",{key:0,class:de(["collapse-btn",{rotated:e.collapsed}]),title:e.collapsed?"展开侧栏":"折叠侧栏","aria-label":e.collapsed?"展开侧栏":"折叠侧栏","aria-expanded":!e.collapsed,onClick:k[1]||(k[1]=S=>o("toggle-collapse"))},[K(me,{name:"panel-left",size:15})],10,BS)):N("",!0)]),d("button",{class:"new-chat-btn",title:e.collapsed?"新建对话":void 0,onClick:k[2]||(k[2]=S=>o("create-session"))},[K(me,{name:"plus",size:16}),e.collapsed?N("",!0):(v(),y("span",jS,"新建对话"))],8,GS),e.collapsed?N("",!0):(v(),y("label",US,[K(me,{name:"search",size:15}),Ke(d("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":k[3]||(k[3]=S=>l.value=S),type:"text",placeholder:"搜索会话… (⌘K)","aria-label":"搜索会话",spellcheck:"false"},null,512),[[rt,l.value]])])),d("div",FS,[(v(!0),y(Q,null,ze(c.value,S=>(v(),y("div",{key:S.name,class:"space-group"},[e.collapsed?(v(),y("button",{key:0,class:de(["space-dot",{active:S.items.some($=>$.sessionId===e.currentSessionId)}]),title:S.name,onClick:k[4]||(k[4]=$=>o("toggle-collapse"))},I(S.name.slice(0,1).toUpperCase()),11,zS)):(v(),y(Q,{key:1},[d("button",{class:"space-head",title:S.workDir,onClick:$=>f(S.name)},[K(me,{name:u.value.has(S.name)?"chevron-right":"chevron-down",size:14},null,8,["name"]),d("span",qS,I(S.name),1),d("span",VS,I(S.items.length),1)],8,HS),u.value.has(S.name)?N("",!0):(v(),y("div",WS,[(v(!0),y(Q,null,ze(S.items,$=>(v(),y("button",{key:$.sessionId,class:de(["session-item",{active:$.sessionId===e.currentSessionId}]),title:w($),onClick:T=>h($.sessionId)},[d("span",ZS,I(w($)),1),d("span",YS,I(g($.createdAt)),1),d("span",{class:"session-delete",role:"button",tabindex:"0",title:`删除会话 ${w($)}`,"aria-label":"删除会话",onClick:_t(T=>p($.sessionId,w($)),["stop"]),onKeydown:As(_t(T=>p($.sessionId,w($)),["stop","prevent"]),["enter"])},[K(me,{name:"trash",size:14})],40,JS)],10,KS))),128))]))],64))]))),128)),!e.collapsed&&c.value.length===0?(v(),y("p",QS,I(l.value?"没有匹配的会话":"还没有会话,点击上方「新建对话」开始"),1)):N("",!0)]),d("nav",XS,[d("button",{class:de(["foot-item",{active:e.view==="skills"}]),title:e.collapsed?"技能中心":void 0,onClick:k[5]||(k[5]=S=>o("navigate","skills"))},[K(me,{name:"sparkles",size:17}),e.collapsed?N("",!0):(v(),y("span",tx,"技能中心"))],10,ex),d("button",{class:de(["foot-item",{active:e.view==="settings"}]),title:e.collapsed?"设置":void 0,onClick:k[6]||(k[6]=S=>o("navigate","settings"))},[K(me,{name:"settings",size:17}),e.collapsed?N("",!0):(v(),y("span",sx,"设置"))],10,nx),d("div",ox,[k[7]||(k[7]=d("span",{class:"identity-dot","aria-hidden":"true"},null,-1)),e.collapsed?N("",!0):(v(),y("span",rx,"scream web"))])])],2))}}),_a=Se(lx,[["__scopeId","data-v-07fe8803"]]),ix={class:"skills"},ax={class:"skills-head"},cx={class:"skills-grid"},ux={class:"skill-card-head"},dx={class:"skill-cmd"},fx={class:"skill-desc"},hx={key:0,class:"skill-aliases"},px=_e({__name:"SkillsView",emits:["create"],setup(e,{emit:t}){const n=t,s={backend:"服务端",local:"本地"};return(o,r)=>(v(),y("div",ix,[d("div",ax,[r[2]||(r[2]=d("div",null,[d("h1",{class:"skills-title"},"技能中心"),d("p",{class:"skills-sub"},[$e("在输入框中输入 "),d("code",null,"/"),$e(" 即可触发以下命令")])],-1)),K(zn,{variant:"primary",onClick:r[0]||(r[0]=l=>n("create"))},{default:kt(()=>[K(me,{name:"plus",size:16}),r[1]||(r[1]=$e(" 新建会话 ",-1))]),_:1})]),d("div",cx,[(v(!0),y(Q,null,ze(ne(or),l=>{var i;return v(),y("article",{key:l.name,class:"skill-card"},[d("div",ux,[d("span",dx,"/"+I(l.name),1),d("span",{class:de(["skill-target",`target-${l.target}`])},I(s[l.target]),3)]),d("p",fx,I(l.description),1),(i=l.aliases)!=null&&i.length?(v(),y("p",hx," 别名:"+I(l.aliases.map(a=>`/${a}`).join(" ")),1)):N("",!0)])}),128))])]))}}),gx=Se(px,[["__scopeId","data-v-35313e25"]]),mx={class:"mode-switch",role:"group","aria-label":"工作模式"},vx=["aria-pressed","onClick"],yx=_e({__name:"ModeSwitch",props:{modelValue:{default:"chat"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,s=[{id:"chat",label:"智能工作"},{id:"goal",label:"任务模式"}];return(o,r)=>(v(),y("div",mx,[(v(),y(Q,null,ze(s,l=>d("button",{key:l.id,class:de(["mode-pill",`is-${l.id}`,{active:e.modelValue===l.id}]),"aria-pressed":e.modelValue===l.id,onClick:i=>n("update:modelValue",l.id)},I(l.label),11,vx)),64))]))}}),bx=Se(yx,[["__scopeId","data-v-c4ac7862"]]),kx={class:"workspace"},wx={class:"workspace-hero"},_x={class:"workspace-brand"},Sx=["src"],xx={class:"mode-hint"},Cx={class:"workspace-composer"},$x=_e({__name:"WorkspaceHome",props:{models:{},status:{default:void 0},busy:{type:Boolean},mode:{default:"chat"}},emits:["send","command","switch-model","switch-thinking","update:mode"],setup(e,{emit:t}){const n=e,s=t,o=Y(()=>n.mode==="goal"),r=Y(()=>o.value?"任务模式:提交后将创建执行目标(Goal),Agent 持续执行到完成或预算耗尽;抽屉「Goal 管理」可查看与暂停。":"直接对话:提问后 Agent 按需调用工具完成你的请求。");return(l,i)=>(v(),y("div",kx,[d("section",wx,[d("h1",_x,[d("img",{class:"brand-logo",src:ne(Wu),alt:"scream"},null,8,Sx)]),i[5]||(i[5]=d("p",{class:"workspace-tagline"},"你的智能协作伙伴",-1)),K(bx,{class:"workspace-mode","model-value":n.mode,"onUpdate:modelValue":i[0]||(i[0]=a=>s("update:mode",a))},null,8,["model-value"]),d("p",xx,[(v(),y("span",{key:String(o.value),class:"hint-fade"},I(r.value),1))])]),d("section",Cx,[K(Jc,{busy:e.busy,status:e.status,models:e.models,variant:"home",placeholder:o.value?"描述你要完成的目标,Enter 创建并开始执行…":"输入 @ 引用知识库 / 使用技能 / 或者直接提问...",onSend:i[1]||(i[1]=a=>s("send",a,n.mode)),onCommand:i[2]||(i[2]=(a,c)=>s("command",a,c)),onSwitchModel:i[3]||(i[3]=a=>s("switch-model",a)),onSwitchThinking:i[4]||(i[4]=a=>s("switch-thinking",a))},null,8,["busy","status","models","placeholder"])])]))}}),Tx=Se($x,[["__scopeId","data-v-2f5f04ab"]]),Ax={key:1,class:"sidebar-mobile"},Rx={class:"canvas"},Ex={class:"topbar mobile-only"},Ix={class:"topbar-left"},Lx={key:0,class:"topbar-running",title:"Agent 运行中"},Mx={class:"canvas-body"},Sa="scream-sidebar-collapsed",xa="scream-workspace-mode",Px=_e({__name:"WebShell",setup(e){const t=tp(),{connectionStatus:n,status:s,isBusy:o,sessions:r,currentSessionId:l,models:i,like:a,sendPrompt:c,sendCommand:u,appendSystemMessage:f,createSession:h,switchSession:p,deleteSession:g,switchModel:w,switchThinking:b,fetchLike:k,fetchGitStatus:S,abort:$}=t,T=G("home"),F=G(!1),O=G(null);function C(W=8e3){return n.value==="connected"?Promise.resolve(!0):new Promise(te=>{const ke=Date.now(),xe=window.setInterval(()=>{n.value==="connected"?(window.clearInterval(xe),te(!0)):Date.now()-ke>W&&(window.clearInterval(xe),te(!1))},80)})}function A(W){W==="chat"?l.value?T.value="chat":R():T.value=W,F.value=!1}function R(){F.value=!1,T.value="chat",h()}async function J(W,te){if(F.value=!1,l.value||await h(),!!await C())if(T.value="chat",te==="goal")try{await t.createGoal({objective:W,budgets:[]})}catch(xe){f(`Goal 创建失败:${oe(xe)}。已保留对话模式,可重新发送。`),c(W);return}else c(W)}function oe(W){return W instanceof Error?W.message:String(W)}function H(W){F.value=!1,T.value="chat",p(W)}function pe(W,te){switch(W){case"compact":case"auto":case"yes":case"plan":case"fork":case"title":case"btw":if(!l.value){h().then(()=>u(W,te));return}u(W,te);break;case"clear":t.clearMessages();break;case"new":R();break;case"help":f(Zc());break;case"model":f(`当前模型:${s.value.model??"unknown"}`);break;case"status":case"usage":f("请在对话页查看会话详情");break;default:f(`未知命令:/${W}`)}}const P=G(!1);try{P.value=localStorage.getItem(Sa)==="1"}catch{}function M(){P.value=!P.value;try{localStorage.setItem(Sa,P.value?"1":"0")}catch{}}function X(){try{return localStorage.getItem(xa)==="goal"?"goal":"chat"}catch{return"chat"}}const le=G(X());function ve(W){le.value=W;try{localStorage.setItem(xa,W)}catch{}}function De(W){if((W.metaKey||W.ctrlKey)&&W.key==="k")W.preventDefault(),P.value&&M(),It(()=>{var te;return(te=O.value)==null?void 0:te.focusSearch()});else if((W.metaKey||W.ctrlKey)&&W.key==="n")W.preventDefault(),R();else if(W.key==="Escape"&&o.value){const te=W.target;te&&(te.tagName==="TEXTAREA"||te.tagName==="INPUT")||(W.preventDefault(),$())}}return Nt(()=>{window.addEventListener("keydown",De),k(),S()}),Ut(()=>window.removeEventListener("keydown",De)),(W,te)=>(v(),y("div",{class:de(["shell",{"sidebar-collapsed":P.value}])},[K(_a,{ref_key:"sidebarRef",ref:O,view:T.value,sessions:ne(r),"current-session-id":ne(l),collapsed:P.value,onNavigate:A,onSwitchSession:H,onDeleteSession:ne(g),onCreateSession:R,onToggleCollapse:M},null,8,["view","sessions","current-session-id","collapsed","onDeleteSession"]),F.value?(v(),y("div",{key:0,class:"sidebar-backdrop","aria-hidden":"true",onClick:te[0]||(te[0]=ke=>F.value=!1)})):N("",!0),F.value?(v(),y("div",Ax,[K(_a,{view:T.value,sessions:ne(r),"current-session-id":ne(l),"show-collapse-toggle":!1,onNavigate:A,onSwitchSession:H,onDeleteSession:ne(g),onCreateSession:R},null,8,["view","sessions","current-session-id","onDeleteSession"])])):N("",!0),d("main",Rx,[d("header",Ex,[d("div",Ix,[d("button",{class:"topbar-icon mobile-menu",title:"菜单","aria-label":"打开菜单",onClick:te[1]||(te[1]=ke=>F.value=!0)},[K(me,{name:"menu",size:20})]),ne(o)?(v(),y("span",Lx,[...te[3]||(te[3]=[d("span",{class:"running-dot","aria-hidden":"true"},null,-1),d("span",{class:"running-text"},"运行中",-1)])])):N("",!0)])]),d("div",Mx,[T.value==="home"?(v(),Ue(Tx,{key:0,models:ne(i),status:ne(s),busy:ne(o),mode:le.value,"onUpdate:mode":ve,onSend:J,onCommand:pe,onSwitchModel:ne(w),onSwitchThinking:ne(b)},null,8,["models","status","busy","mode","onSwitchModel","onSwitchThinking"])):T.value==="chat"?(v(),Ue(_S,{key:1,client:ne(t),onHome:te[2]||(te[2]=ke=>T.value="home")},null,8,["client"])):T.value==="skills"?(v(),Ue(gx,{key:2,onCreate:R})):T.value==="settings"?(v(),Ue(NS,{key:3,like:ne(a),onUpdateLike:ne(t).updateLike},null,8,["like","onUpdateLike"])):N("",!0)])])],2))}}),Nx=Se(Px,[["__scopeId","data-v-7e9d5760"]]),Ox={class:"toast-container"},Dx=["onClick"],Bx={class:"toast-icon"},Gx={class:"toast-msg"},jx=_e({__name:"Toast",setup(e){const{toasts:t,removeToast:n}=Kc(),s={info:"ℹ",success:"✓",error:"✗",warning:"⚠"};return(o,r)=>(v(),Ue(Cl,{to:"body"},[d("div",Ox,[K(Ih,{name:"toast"},{default:kt(()=>[(v(!0),y(Q,null,ze(ne(t),l=>(v(),y("div",{key:l.id,class:de(["toast",`toast--${l.type}`]),onClick:i=>ne(n)(l.id)},[d("span",Bx,I(s[l.type]),1),d("span",Gx,I(l.message),1)],10,Dx))),128))]),_:1})])]))}}),Ux=Se(jx,[["__scopeId","data-v-a432e638"]]),Fx={class:"app"},zx=_e({__name:"App",setup(e){const t=G("system"),n=G("dark");io("effectiveTheme",n),io("theme",t);const s={light:"#ffffff",dark:"#101113"};function o(){const a=document.documentElement,c=window.matchMedia("(prefers-color-scheme: dark)").matches,u=t.value==="system"?c?"dark":"light":t.value;n.value=u,a.dataset.theme=u;const f=document.querySelector('meta[name="theme-color"]');f&&f.setAttribute("content",s[u])}let r=null;function l(a){t.value=a;try{localStorage.setItem("scream-theme",a)}catch{}const c=document.documentElement;c.classList.add("theme-transition"),o(),r!==null&&clearTimeout(r),r=window.setTimeout(()=>c.classList.remove("theme-transition"),320)}io("setTheme",l),Nt(()=>{try{const a=localStorage.getItem("scream-theme");(a==="light"||a==="dark"||a==="system")&&(t.value=a)}catch{}o()}),Ie(t,o);const i=window.matchMedia("(prefers-color-scheme: dark)");return i.addEventListener("change",o),Ut(()=>{i.removeEventListener("change",o),r!==null&&clearTimeout(r),document.documentElement.classList.remove("theme-transition")}),(a,c)=>(v(),y("div",Fx,[K(Nx),K(Ux)]))}}),Hx=Se(zx,[["__scopeId","data-v-f4ac7b91"]]);Fh(Hx).mount("#app");
|
|
93
|
+
//# sourceMappingURL=index-CYmwuyd8.js.map
|