scream-code 0.15.2 → 0.15.3
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-6Hcxs2tP.mjs → app-Bqc3MVGh.mjs} +56 -28
- package/dist/{dispatch-Dur5jHVw.mjs → dispatch-CweYoXh3.mjs} +1 -1
- package/dist/{dispatch-B_ViYZer.mjs → dispatch-DGeogib-.mjs} +131 -38
- package/dist/main.mjs +1 -1
- package/dist/public/assets/{index-BfVIY6UW.css → index-BJaeSGtC.css} +1 -1
- package/dist/public/assets/index-DDVdau1l.js +93 -0
- package/dist/public/assets/index-DDVdau1l.js.map +1 -0
- package/dist/public/index.html +2 -2
- package/package.json +2 -2
- package/dist/public/assets/index-B9I4PIWR.js +0 -93
- package/dist/public/assets/index-B9I4PIWR.js.map +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var fd=Object.defineProperty;var dd=(e,t,n)=>t in e?fd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(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 i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).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 wi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ge={},Xn=[],zt=()=>{},Da=()=>!1,Ko=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Zo=e=>e.startsWith("onUpdate:"),Xe=Object.assign,_i=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hd=Object.prototype.hasOwnProperty,Le=(e,t)=>hd.call(e,t),pe=Array.isArray,Qn=e=>Fs(e)==="[object Map]",Jo=e=>Fs(e)==="[object Set]",gl=e=>Fs(e)==="[object Date]",ye=e=>typeof e=="function",We=e=>typeof e=="string",qt=e=>typeof e=="symbol",Be=e=>e!==null&&typeof e=="object",Ba=e=>(Be(e)||ye(e))&&ye(e.then)&&ye(e.catch),ja=Object.prototype.toString,Fs=e=>ja.call(e),pd=e=>Fs(e).slice(8,-1),Ua=e=>Fs(e)==="[object Object]",Si=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,_s=wi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},gd=/-\w/g,_t=Yo(e=>e.replace(gd,t=>t.slice(1).toUpperCase())),md=/\B([A-Z])/g,Rn=Yo(e=>e.replace(md,"-$1").toLowerCase()),Xo=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1)),_r=Yo(e=>e?`on${Xo(e)}`:""),rn=(e,t)=>!Object.is(e,t),po=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ga=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Qo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},vd=e=>{const t=We(e)?Number(e):NaN;return isNaN(t)?e:t};let ml;const er=()=>ml||(ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ln(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=We(s)?wd(s):ln(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(We(e)||Be(e))return e}const yd=/;(?![^(]*\))/g,bd=/:([^]+)/,kd=/\/\*[^]*?\*\//g;function wd(e){const t={};return e.replace(kd,"").split(yd).forEach(n=>{if(n){const s=n.split(bd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function de(e){let t="";if(We(e))t=e;else if(pe(e))for(let n=0;n<e.length;n++){const s=de(e[n]);s&&(t+=s+" ")}else if(Be(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const _d="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Sd=wi(_d);function Fa(e){return!!e||e===""}function xd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=zs(e[s],t[s]);return n}function zs(e,t){if(e===t)return!0;let n=gl(e),s=gl(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=qt(e),s=qt(t),n||s)return e===t;if(n=pe(e),s=pe(t),n||s)return n&&s?xd(e,t):!1;if(n=Be(e),s=Be(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 i in e){const l=e.hasOwnProperty(i),a=t.hasOwnProperty(i);if(l&&!a||!l&&a||!zs(e[i],t[i]))return!1}}return String(e)===String(t)}function Cd(e,t){return e.findIndex(n=>zs(n,t))}const za=e=>!!(e&&e.__v_isRef===!0),E=e=>We(e)?e:e==null?"":pe(e)||Be(e)&&(e.toString===ja||!ye(e.toString))?za(e)?E(e.value):JSON.stringify(e,Ha,2):String(e),Ha=(e,t)=>za(t)?Ha(e,t.value):Qn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[Sr(s,r)+" =>"]=o,n),{})}:Jo(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Sr(n))}:qt(t)?Sr(t):Be(t)&&!pe(t)&&!Ua(t)?String(t):t,Sr=(e,t="")=>{var n;return qt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function $d(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 it;class Td{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&&it&&(it.active?(this.parent=it,this.index=(it.scopes||(it.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=it;try{return it=this,t()}finally{it=n}}}on(){++this._on===1&&(this.prevScope=it,it=this)}off(){if(this._on>0&&--this._on===0){if(it===this)it=this.prevScope;else{let t=it;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 Ad(){return it}let ze;const xr=new WeakSet;class qa{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,it&&(it.active?it.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,xr.has(this)&&(xr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Va(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vl(this),Ka(this);const t=ze,n=Ht;ze=this,Ht=!0;try{return this.fn()}finally{Za(this),ze=t,Ht=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)$i(t);this.deps=this.depsTail=void 0,vl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?xr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qr(this)&&this.run()}get dirty(){return qr(this)}}let Wa=0,Ss,xs;function Va(e,t=!1){if(e.flags|=8,t){e.next=xs,xs=e;return}e.next=Ss,Ss=e}function xi(){Wa++}function Ci(){if(--Wa>0)return;if(xs){let t=xs;for(xs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ss;){let t=Ss;for(Ss=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 Ka(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Za(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),$i(s),Rd(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function qr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ja(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ja(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Rs)||(e.globalVersion=Rs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qr(e))))return;e.flags|=2;const t=e.dep,n=ze,s=Ht;ze=e,Ht=!0;try{Ka(e);const o=e.fn(e._value);(t.version===0||rn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ze=n,Ht=s,Za(e),e.flags&=-3}}function $i(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)$i(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Rd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ht=!0;const Ya=[];function bn(){Ya.push(Ht),Ht=!1}function kn(){const e=Ya.pop();Ht=e===void 0?!0:e}function vl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ze;ze=void 0;try{t()}finally{ze=n}}}let Rs=0;class Id{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 Ti{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(!ze||!Ht||ze===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ze)n=this.activeLink=new Id(ze,this),ze.deps?(n.prevDep=ze.depsTail,ze.depsTail.nextDep=n,ze.depsTail=n):ze.deps=ze.depsTail=n,Xa(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=ze.depsTail,n.nextDep=void 0,ze.depsTail.nextDep=n,ze.depsTail=n,ze.deps===n&&(ze.deps=s)}return n}trigger(t){this.version++,Rs++,this.notify(t)}notify(t){xi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ci()}}}function Xa(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)Xa(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Wr=new WeakMap,Bn=Symbol(""),Vr=Symbol(""),Is=Symbol("");function ft(e,t,n){if(Ht&&ze){let s=Wr.get(e);s||Wr.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Ti),o.map=s,o.key=n),o.track()}}function fn(e,t,n,s,o,r){const i=Wr.get(e);if(!i){Rs++;return}const l=a=>{a&&a.trigger()};if(xi(),t==="clear")i.forEach(l);else{const a=pe(e),c=a&&Si(n);if(a&&n==="length"){const u=Number(s);i.forEach((d,h)=>{(h==="length"||h===Is||!qt(h)&&h>=u)&&l(d)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),c&&l(i.get(Is)),t){case"add":a?c&&l(i.get("length")):(l(i.get(Bn)),Qn(e)&&l(i.get(Vr)));break;case"delete":a||(l(i.get(Bn)),Qn(e)&&l(i.get(Vr)));break;case"set":Qn(e)&&l(i.get(Bn));break}}Ci()}function Kn(e){const t=Ee(e);return t===e?t:(ft(t,"iterate",Is),Bt(e)?t:t.map(Wt))}function tr(e){return ft(e=Ee(e),"iterate",Is),e}function sn(e,t){return wn(e)?rs(jn(e)?Wt(t):t):Wt(t)}const Ed={__proto__:null,[Symbol.iterator](){return Cr(this,Symbol.iterator,e=>sn(this,e))},concat(...e){return Kn(this).concat(...e.map(t=>pe(t)?Kn(t):t))},entries(){return Cr(this,"entries",e=>(e[1]=sn(this,e[1]),e))},every(e,t){return an(this,"every",e,t,void 0,arguments)},filter(e,t){return an(this,"filter",e,t,n=>n.map(s=>sn(this,s)),arguments)},find(e,t){return an(this,"find",e,t,n=>sn(this,n),arguments)},findIndex(e,t){return an(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return an(this,"findLast",e,t,n=>sn(this,n),arguments)},findLastIndex(e,t){return an(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return an(this,"forEach",e,t,void 0,arguments)},includes(...e){return $r(this,"includes",e)},indexOf(...e){return $r(this,"indexOf",e)},join(e){return Kn(this).join(e)},lastIndexOf(...e){return $r(this,"lastIndexOf",e)},map(e,t){return an(this,"map",e,t,void 0,arguments)},pop(){return fs(this,"pop")},push(...e){return fs(this,"push",e)},reduce(e,...t){return yl(this,"reduce",e,t)},reduceRight(e,...t){return yl(this,"reduceRight",e,t)},shift(){return fs(this,"shift")},some(e,t){return an(this,"some",e,t,void 0,arguments)},splice(...e){return fs(this,"splice",e)},toReversed(){return Kn(this).toReversed()},toSorted(e){return Kn(this).toSorted(e)},toSpliced(...e){return Kn(this).toSpliced(...e)},unshift(...e){return fs(this,"unshift",e)},values(){return Cr(this,"values",e=>sn(this,e))}};function Cr(e,t,n){const s=tr(e),o=s[t]();return s!==e&&!Bt(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const Pd=Array.prototype;function an(e,t,n,s,o,r){const i=tr(e),l=i!==e&&!Bt(e),a=i[t];if(a!==Pd[t]){const d=a.apply(e,r);return l?Wt(d):d}let c=n;i!==e&&(l?c=function(d,h){return n.call(this,sn(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=a.call(i,c,s);return l&&o?o(u):u}function yl(e,t,n,s){const o=tr(e),r=o!==e&&!Bt(e);let i=n,l=!1;o!==e&&(r?(l=s.length===0,i=function(c,u,d){return l&&(l=!1,c=sn(e,c)),n.call(this,c,sn(e,u),d,e)}):n.length>3&&(i=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](i,...s);return l?sn(e,a):a}function $r(e,t,n){const s=Ee(e);ft(s,"iterate",Is);const o=s[t](...n);return(o===-1||o===!1)&&Ei(n[0])?(n[0]=Ee(n[0]),s[t](...n)):o}function fs(e,t,n=[]){bn(),xi();const s=Ee(e)[t].apply(e,n);return Ci(),kn(),s}const Md=wi("__proto__,__v_isRef,__isVue"),Qa=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qt));function Ld(e){qt(e)||(e=String(e));const t=Ee(this);return ft(t,"has",e),t.hasOwnProperty(e)}class ec{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?Hd:oc:r?sc:nc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=pe(t);if(!o){let a;if(i&&(a=Ed[n]))return a;if(n==="hasOwnProperty")return Ld}const l=Reflect.get(t,n,gt(t)?t:s);if((qt(n)?Qa.has(n):Md(n))||(o||ft(t,"get",n),r))return l;if(gt(l)){const a=i&&Si(n)?l:l.value;return o&&Be(a)?Zr(a):a}return Be(l)?o?Zr(l):Ri(l):l}}class tc extends ec{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=pe(t)&&Si(n);if(!this._isShallow){const c=wn(r);if(!Bt(s)&&!wn(s)&&(r=Ee(r),s=Ee(s)),!i&>(r)&&!gt(s))return c||(r.value=s),!0}const l=i?Number(n)<t.length:Le(t,n),a=Reflect.set(t,n,s,gt(t)?t:o);return t===Ee(o)&&a&&(l?rn(s,r)&&fn(t,"set",n,s):fn(t,"add",n,s)),a}deleteProperty(t,n){const s=Le(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&fn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!qt(n)||!Qa.has(n))&&ft(t,"has",n),s}ownKeys(t){return ft(t,"iterate",pe(t)?"length":Bn),Reflect.ownKeys(t)}}class Nd extends ec{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Od=new tc,Dd=new Nd,Bd=new tc(!0);const Kr=e=>e,Qs=e=>Reflect.getPrototypeOf(e);function jd(e,t,n){return function(...s){const o=this.__v_raw,r=Ee(o),i=Qn(r),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,c=o[e](...s),u=n?Kr:t?rs:Wt;return!t&&ft(r,"iterate",a?Vr:Bn),Xe(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:l?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function eo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ud(e,t){const n={get(o){const r=this.__v_raw,i=Ee(r),l=Ee(o);e||(rn(o,l)&&ft(i,"get",o),ft(i,"get",l));const{has:a}=Qs(i),c=t?Kr:e?rs:Wt;if(a.call(i,o))return c(r.get(o));if(a.call(i,l))return c(r.get(l));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&ft(Ee(o),"iterate",Bn),o.size},has(o){const r=this.__v_raw,i=Ee(r),l=Ee(o);return e||(rn(o,l)&&ft(i,"has",o),ft(i,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const i=this,l=i.__v_raw,a=Ee(l),c=t?Kr:e?rs:Wt;return!e&&ft(a,"iterate",Bn),l.forEach((u,d)=>o.call(r,c(u),c(d),i))}};return Xe(n,e?{add:eo("add"),set:eo("set"),delete:eo("delete"),clear:eo("clear")}:{add(o){const r=Ee(this),i=Qs(r),l=Ee(o),a=!t&&!Bt(o)&&!wn(o)?l:o;return i.has.call(r,a)||rn(o,a)&&i.has.call(r,o)||rn(l,a)&&i.has.call(r,l)||(r.add(a),fn(r,"add",a,a)),this},set(o,r){!t&&!Bt(r)&&!wn(r)&&(r=Ee(r));const i=Ee(this),{has:l,get:a}=Qs(i);let c=l.call(i,o);c||(o=Ee(o),c=l.call(i,o));const u=a.call(i,o);return i.set(o,r),c?rn(r,u)&&fn(i,"set",o,r):fn(i,"add",o,r),this},delete(o){const r=Ee(this),{has:i,get:l}=Qs(r);let a=i.call(r,o);a||(o=Ee(o),a=i.call(r,o)),l&&l.call(r,o);const c=r.delete(o);return a&&fn(r,"delete",o,void 0),c},clear(){const o=Ee(this),r=o.size!==0,i=o.clear();return r&&fn(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=jd(o,e,t)}),n}function Ai(e,t){const n=Ud(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Le(n,o)&&o in s?n:s,o,r)}const Gd={get:Ai(!1,!1)},Fd={get:Ai(!1,!0)},zd={get:Ai(!0,!1)};const nc=new WeakMap,sc=new WeakMap,oc=new WeakMap,Hd=new WeakMap;function qd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ri(e){return wn(e)?e:Ii(e,!1,Od,Gd,nc)}function Wd(e){return Ii(e,!1,Bd,Fd,sc)}function Zr(e){return Ii(e,!0,Dd,zd,oc)}function Ii(e,t,n,s,o){if(!Be(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 i=qd(pd(e));if(i===0)return e;const l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function jn(e){return wn(e)?jn(e.__v_raw):!!(e&&e.__v_isReactive)}function wn(e){return!!(e&&e.__v_isReadonly)}function Bt(e){return!!(e&&e.__v_isShallow)}function Ei(e){return e?!!e.__v_raw:!1}function Ee(e){const t=e&&e.__v_raw;return t?Ee(t):e}function Vd(e){return!Le(e,"__v_skip")&&Object.isExtensible(e)&&Ga(e,"__v_skip",!0),e}const Wt=e=>Be(e)?Ri(e):e,rs=e=>Be(e)?Zr(e):e;function gt(e){return e?e.__v_isRef===!0:!1}function N(e){return Kd(e,!1)}function Kd(e,t){return gt(e)?e:new Zd(e,t)}class Zd{constructor(t,n){this.dep=new Ti,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ee(t),this._value=n?t:Wt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Bt(t)||wn(t);t=s?t:Ee(t),rn(t,n)&&(this._rawValue=t,this._value=s?t:Wt(t),this.dep.trigger())}}function re(e){return gt(e)?e.value:e}const Jd={get:(e,t,n)=>t==="__v_raw"?e:re(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return gt(o)&&!gt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function rc(e){return jn(e)?e:new Proxy(e,Jd)}class Yd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ti(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Rs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ze!==this)return Va(this,!0),!0}get value(){const t=this.dep.track();return Ja(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Xd(e,t,n=!1){let s,o;return ye(e)?s=e:(s=e.get,o=e.set),new Yd(s,o,n)}const to={},_o=new WeakMap;let Mn;function Qd(e,t=!1,n=Mn){if(n){let s=_o.get(n);s||_o.set(n,s=[]),s.push(e)}}function eh(e,t,n=Ge){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:l,call:a}=n,c=A=>o?A:Bt(A)||o===!1||o===0?dn(A,1):dn(A);let u,d,h,p,g=!1,_=!1;if(gt(e)?(d=()=>e.value,g=Bt(e)):jn(e)?(d=()=>c(e),g=!0):pe(e)?(_=!0,g=e.some(A=>jn(A)||Bt(A)),d=()=>e.map(A=>{if(gt(A))return A.value;if(jn(A))return c(A);if(ye(A))return a?a(A,2):A()})):ye(e)?t?d=a?()=>a(e,2):e:d=()=>{if(h){bn();try{h()}finally{kn()}}const A=Mn;Mn=u;try{return a?a(e,3,[p]):e(p)}finally{Mn=A}}:d=zt,t&&o){const A=d,F=o===!0?1/0:o;d=()=>dn(A(),F)}const k=Ad(),w=()=>{u.stop(),k&&k.active&&_i(k.effects,u)};if(r&&t){const A=t;t=(...F)=>{const Q=A(...F);return w(),Q}}let x=_?new Array(e.length).fill(to):to;const $=A=>{if(!(!(u.flags&1)||!u.dirty&&!A))if(t){const F=u.run();if(A||o||g||(_?F.some((Q,C)=>rn(Q,x[C])):rn(F,x))){h&&h();const Q=Mn;Mn=u;try{const C=[F,x===to?void 0:_&&x[0]===to?[]:x,p];x=F,a?a(t,3,C):t(...C)}finally{Mn=Q}}}else u.run()};return l&&l($),u=new qa(d),u.scheduler=i?()=>i($,!1):$,p=A=>Qd(A,!1,u),h=u.onStop=()=>{const A=_o.get(u);if(A){if(a)a(A,4);else for(const F of A)F();_o.delete(u)}},t?s?$(!0):x=u.run():i?i($.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function dn(e,t=1/0,n){if(t<=0||!Be(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,gt(e))dn(e.value,t,n);else if(pe(e))for(let s=0;s<e.length;s++)dn(e[s],t,n);else if(Jo(e)||Qn(e))e.forEach(s=>{dn(s,t,n)});else if(Ua(e)){for(const s in e)dn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&dn(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 Hs(e,t,n,s){try{return s?e(...s):e()}catch(o){nr(o,t,n)}}function jt(e,t,n,s){if(ye(e)){const o=Hs(e,t,n,s);return o&&Ba(o)&&o.catch(r=>{nr(r,t,n)}),o}if(pe(e)){const o=[];for(let r=0;r<e.length;r++)o.push(jt(e[r],t,n,s));return o}}function nr(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ge;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(r){bn(),Hs(r,null,10,[e,a,c]),kn();return}}th(e,n,o,s,i)}function th(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const kt=[];let nn=-1;const es=[];let $n=null,Zn=0;const ic=Promise.resolve();let So=null;function Ot(e){const t=So||ic;return e?t.then(this?e.bind(this):e):t}function nh(e){let t=nn+1,n=kt.length;for(;t<n;){const s=t+n>>>1,o=kt[s],r=Es(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function Pi(e){if(!(e.flags&1)){const t=Es(e),n=kt[kt.length-1];!n||!(e.flags&2)&&t>=Es(n)?kt.push(e):kt.splice(nh(t),0,e),e.flags|=1,lc()}}function lc(){So||(So=ic.then(uc))}function ac(e){pe(e)?es.push(...e):$n&&e.id===-1?$n.splice(Zn+1,0,e):e.flags&1||(es.push(e),e.flags|=1),lc()}function bl(e,t,n=nn+1){for(;n<kt.length;n++){const s=kt[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;kt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function cc(e){if(es.length){const t=[...new Set(es)].sort((n,s)=>Es(n)-Es(s));if(es.length=0,$n){$n.push(...t);return}for($n=t,Zn=0;Zn<$n.length;Zn++){const n=$n[Zn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}$n=null,Zn=0}}const Es=e=>e.id==null?e.flags&2?-1:1/0:e.id;function uc(e){try{for(nn=0;nn<kt.length;nn++){const t=kt[nn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Hs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;nn<kt.length;nn++){const t=kt[nn];t&&(t.flags&=-2)}nn=-1,kt.length=0,cc(),So=null,(kt.length||es.length)&&uc()}}let lt=null,fc=null;function xo(e){const t=lt;return lt=e,fc=e&&e.type.__scopeId||null,t}function $t(e,t=lt,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&To(-1);const r=xo(t),i=yn.length;let l;try{l=e(...o)}finally{for(let a=yn.length;a>i;a--)Bi();xo(r),s._d&&To(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function Ye(e,t){if(lt===null)return e;const n=cr(lt),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,l,a=Ge]=t[o];r&&(ye(r)&&(r={mounted:r,updated:r}),r.deep&&dn(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:l,modifiers:a}))}return e}function In(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let i=0;i<o.length;i++){const l=o[i];r&&(l.oldValue=r[i].value);let a=l.dir[s];a&&(bn(),jt(a,n,8,[e.el,l,e,t]),kn())}}function go(e,t){if(ht){let n=ht.provides;const s=ht.parent&&ht.parent.provides;s===n&&(n=ht.provides=Object.create(s)),n[e]=t}}function vn(e,t,n=!1){const s=ar();if(s||ns){let o=ns?ns._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&&ye(t)?t.call(s&&s.proxy):t}}const sh=Symbol.for("v-scx"),oh=()=>vn(sh);function Oe(e,t,n){return dc(e,t,n)}function dc(e,t,n=Ge){const{immediate:s,deep:o,flush:r,once:i}=n,l=Xe({},n),a=t&&s||!t&&r!=="post";let c;if(Ns){if(r==="sync"){const p=oh();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=zt,p.resume=zt,p.pause=zt,p}}const u=ht;l.call=(p,g,_)=>jt(p,u,g,_);let d=!1;r==="post"?l.scheduler=p=>{bt(p,u&&u.suspense)}:r!=="sync"&&(d=!0,l.scheduler=(p,g)=>{g?p():Pi(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const h=eh(e,t,l);return Ns&&(c?c.push(h):a&&h()),h}function rh(e,t,n){const s=this.proxy,o=We(e)?e.includes(".")?hc(s,e):()=>s[e]:e.bind(s,s);let r;ye(t)?r=t:(r=t.handler,n=t);const i=qs(this),l=dc(o,r.bind(s),n);return i(),l}function hc(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 xn=new WeakMap,pc=Symbol("_vte"),gc=e=>e.__isTeleport,Ln=e=>e&&(e.disabled||e.disabled===""),ih=e=>e&&(e.defer||e.defer===""),kl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,wl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Jr=(e,t)=>{const n=e&&e.to;return We(n)?t?t(n):null:n},lh={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,r,i,l,a,c){const{mc:u,pc:d,pbc:h,o:{insert:p,querySelector:g,createText:_,createComment:k,parentNode:w}}=c,x=Ln(t.props);let{dynamicChildren:$}=t;const A=(C,R,P)=>{C.shapeFlag&16&&u(C.children,R,P,o,r,i,l,a)},F=(C=t)=>{const R=Ln(C.props),P=C.target=Jr(C.props,g),J=Yr(P,C,_,p);P&&(i!=="svg"&&kl(P)?i="svg":i!=="mathml"&&wl(P)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(P),R||(A(C,P,J),ys(C,!1)))},Q=C=>{const R=()=>{if(xn.get(C)===R){if(xn.delete(C),Ln(C.props)){const P=w(C.el)||n;A(C,P,C.anchor),ys(C,!0)}F(C)}};xn.set(C,R),bt(R,r)};if(e==null){const C=t.el=_(""),R=t.anchor=_("");if(p(C,n,s),p(R,n,s),ih(t.props)||r&&r.pendingBranch){Q(t);return}x&&(A(t,n,R),ys(t,!0)),F()}else{t.el=e.el;const C=t.anchor=e.anchor,R=xn.get(e);if(R){R.flags|=8,xn.delete(e),Q(t);return}t.targetStart=e.targetStart;const P=t.target=e.target,J=t.targetAnchor=e.targetAnchor,ie=Ln(e.props),z=ie?n:P,ve=ie?C:J;if(i==="svg"||kl(P)?i="svg":(i==="mathml"||wl(P))&&(i="mathml"),$?(h(e.dynamicChildren,$,z,o,r,i,l),Di(e,t,!0)):a||d(e,t,z,ve,o,r,i,l,!1),x)ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):no(t,n,C,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const O=Jr(t.props,g);O&&(t.target=O,no(t,O,null,c,0))}else ie&&no(t,P,J,c,1);ys(t,x)}},remove(e,t,n,{um:s,o:{remove:o}},r){const{shapeFlag:i,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:h}=e,p=Ln(h),g=r||!p,_=xn.get(e);if(_&&(_.flags|=8,xn.delete(e)),d&&(o(c),o(u)),r&&o(a),!_&&(p||d)&&i&16)for(let k=0;k<l.length;k++){const w=l[k];s(w,t,n,g,!!w.dynamicChildren)}},move:no,hydrate:ah};function no(e,t,n,{o:{insert:s},m:o},r=2){r===0&&s(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:a,children:c,props:u}=e,d=r===2;if(d&&s(i,t,n),!xn.has(e)&&(!d||Ln(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);d&&s(l,t,n)}function ah(e,t,n,s,o,r,{o:{nextSibling:i,parentNode:l,querySelector:a,insert:c,createText:u}},d){function h(k,w){let x=w;for(;x;){if(x&&x.nodeType===8){if(x.data==="teleport start anchor")t.targetStart=x;else if(x.data==="teleport anchor"){t.targetAnchor=x,k._lpa=t.targetAnchor&&i(t.targetAnchor);break}}x=i(x)}}function p(k,w){w.anchor=d(i(k),w,l(k),n,s,o,r)}const g=t.target=Jr(t.props,a),_=Ln(t.props);if(g){const k=g._lpa||g.firstChild;t.shapeFlag&16&&(_?(p(e,t),h(g,k),t.targetAnchor||Yr(g,t,u,c,l(e)===g?e:null)):(t.anchor=i(e),h(g,k),t.targetAnchor||Yr(g,t,u,c),d(k&&i(k),t,g,n,s,o,r))),ys(t,_)}else _&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Mi=lh;function ys(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 Yr(e,t,n,s,o=null){const r=t.targetStart=n(""),i=t.targetAnchor=n("");return r[pc]=i,e&&(s(r,e,o),s(i,e,o)),i}const Nt=Symbol("_leaveCb"),ds=Symbol("_enterCb");function mc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ut(()=>{e.isMounted=!0}),Vt(()=>{e.isUnmounting=!0}),e}const Mt=[Function,Array],vc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mt,onEnter:Mt,onAfterEnter:Mt,onEnterCancelled:Mt,onBeforeLeave:Mt,onLeave:Mt,onAfterLeave:Mt,onLeaveCancelled:Mt,onBeforeAppear:Mt,onAppear:Mt,onAfterAppear:Mt,onAppearCancelled:Mt},yc=e=>{const t=e.subTree;return t.component?yc(t.component):t},ch={name:"BaseTransition",props:vc,setup(e,{slots:t}){const n=ar(),s=mc();return()=>{const o=t.default&&Li(t.default(),!0),r=o&&o.length?bc(o):n.subTree?D():void 0;if(!r)return;const i=Ee(e),{mode:l}=i;if(s.isLeaving)return Tr(r);const a=_l(r);if(!a)return Tr(r);let c=Ps(a,i,s,n,d=>c=d);a.type!==dt&&Gn(a,c);let u=n.subTree&&_l(n.subTree);if(u&&u.type!==dt&&!Nn(u,a)&&yc(n).type!==dt){let d=Ps(u,i,s,n);if(Gn(u,d),l==="out-in"&&a.type!==dt)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Tr(r);l==="in-out"&&a.type!==dt?d.delayLeave=(h,p,g)=>{const _=kc(s,u);_[String(u.key)]=u,h[Nt]=()=>{p(),h[Nt]=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 bc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==dt){t=n;break}}return t}const uh=ch;function kc(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 Ps(e,t,n,s,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:g,onLeaveCancelled:_,onBeforeAppear:k,onAppear:w,onAfterAppear:x,onAppearCancelled:$}=t,A=String(e.key),F=kc(n,e),Q=(P,J)=>{P&&jt(P,s,9,J)},C=(P,J)=>{const ie=J[1];Q(P,J),pe(P)?P.every(z=>z.length<=1)&&ie():P.length<=1&&ie()},R={mode:i,persisted:l,beforeEnter(P){let J=a;if(!n.isMounted)if(r)J=k||a;else return;P[Nt]&&P[Nt](!0);const ie=F[A];ie&&Nn(e,ie)&&ie.el[Nt]&&ie.el[Nt](),Q(J,[P])},enter(P){if(F[A]===e)return;let J=c,ie=u,z=d;if(!n.isMounted)if(r)J=w||c,ie=x||u,z=$||d;else return;let ve=!1;P[ds]=L=>{ve||(ve=!0,L?Q(z,[P]):Q(ie,[P]),R.delayedLeave&&R.delayedLeave(),P[ds]=void 0)};const O=P[ds].bind(null,!1);J?C(J,[P,O]):O()},leave(P,J){const ie=String(e.key);if(P[ds]&&P[ds](!0),n.isUnmounting)return J();Q(h,[P]);let z=!1;P[Nt]=O=>{z||(z=!0,J(),O?Q(_,[P]):Q(g,[P]),P[Nt]=void 0,F[ie]===e&&delete F[ie])};const ve=P[Nt].bind(null,!1);F[ie]=e,p?C(p,[P,ve]):ve()},clone(P){const J=Ps(P,t,n,s,o);return o&&o(J),J}};return R}function Tr(e){if(sr(e))return e=An(e),e.children=null,e}function _l(e){if(!sr(e))return gc(e.type)&&e.children?bc(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&&ye(n.default))return n.default()}}function Gn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gn(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 Li(e,t=!1,n){let s=[],o=0;for(let r=0;r<e.length;r++){let i=e[r];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:r);i.type===ee?(i.patchFlag&128&&o++,s=s.concat(Li(i.children,t,l))):(t||i.type!==dt)&&s.push(l!=null?An(i,{key:l}):i)}if(o>1)for(let r=0;r<s.length;r++)s[r].patchFlag=-2;return s}function Se(e,t){return ye(e)?Xe({name:e.name},t,{setup:e}):e}function wc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Sl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Co=new WeakMap;function Cs(e,t,n,s,o=!1){if(pe(e)){e.forEach((_,k)=>Cs(_,t&&(pe(t)?t[k]:t),n,s,o));return}if(ts(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Cs(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?cr(s.component):s.el,i=o?null:r,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Ge?l.refs={}:l.refs,d=l.setupState,h=Ee(d),p=d===Ge?Da:_=>Sl(u,_)?!1:Le(h,_),g=(_,k)=>!(k&&Sl(u,k));if(c!=null&&c!==a){if(xl(t),We(c))u[c]=null,p(c)&&(d[c]=null);else if(gt(c)){const _=t;g(c,_.k)&&(c.value=null),_.k&&(u[_.k]=null)}}if(ye(a))Hs(a,l,12,[i,u]);else{const _=We(a),k=gt(a);if(_||k){const w=()=>{if(e.f){const x=_?p(a)?d[a]:u[a]:g()||!e.k?a.value:u[e.k];if(o)pe(x)&&_i(x,r);else if(pe(x))x.includes(r)||x.push(r);else if(_)u[a]=[r],p(a)&&(d[a]=u[a]);else{const $=[r];g(a,e.k)&&(a.value=$),e.k&&(u[e.k]=$)}}else _?(u[a]=i,p(a)&&(d[a]=i)):k&&(g(a,e.k)&&(a.value=i),e.k&&(u[e.k]=i))};if(i){const x=()=>{w(),Co.delete(e)};x.id=-1,Co.set(e,x),bt(x,n)}else xl(e),w()}}}function xl(e){const t=Co.get(e);t&&(t.flags|=8,Co.delete(e))}er().requestIdleCallback;er().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,sr=e=>e.type.__isKeepAlive;function fh(e,t){_c(e,"a",t)}function dh(e,t){_c(e,"da",t)}function _c(e,t,n=ht){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(or(t,s,n),n){let o=n.parent;for(;o&&o.parent;)sr(o.parent.vnode)&&hh(s,t,n,o),o=o.parent}}function hh(e,t,n,s){const o=or(t,e,s,!0);rr(()=>{_i(s[t],o)},n)}function or(e,t,n=ht,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{bn();const l=qs(n),a=jt(t,n,e,i);return l(),kn(),a});return s?o.unshift(r):o.push(r),r}}const _n=e=>(t,n=ht)=>{(!Ns||e==="sp")&&or(e,(...s)=>t(...s),n)},ph=_n("bm"),Ut=_n("m"),Sc=_n("bu"),xc=_n("u"),Vt=_n("bum"),rr=_n("um"),gh=_n("sp"),mh=_n("rtg"),vh=_n("rtc");function yh(e,t=ht){or("ec",e,t)}const Cc="components";function bh(e,t){return Tc(Cc,e,!0,t)||e}const $c=Symbol.for("v-ndc");function kh(e){return We(e)?Tc(Cc,e,!1)||e:e||$c}function Tc(e,t,n=!0,s=!1){const o=lt||ht;if(o){const r=o.type;{const l=sp(r,!1);if(l&&(l===t||l===_t(t)||l===Xo(_t(t))))return r}const i=Cl(o[e]||r[e],t)||Cl(o.appContext[e],t);return!i&&s?r:i}}function Cl(e,t){return e&&(e[t]||e[_t(t)]||e[Xo(_t(t))])}function Ve(e,t,n,s){let o;const r=n,i=pe(e);if(i||We(e)){const l=i&&jn(e);let a=!1,c=!1;l&&(a=!Bt(e),c=wn(e),e=tr(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?rs(Wt(e[u])):Wt(e[u]):e[u],u,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(Be(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,r)}}else o=[];return o}function mo(e,t,n={},s,o,r){if(lt.ce||lt.parent&&ts(lt.parent)&<.parent.ce){const c=n,u=Object.keys(c).length>0;return t!=="default"&&(c.name=t),y(),qe(ee,null,[Z("slot",c,s&&s())],u?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=yn.length;y();let a;try{const c=i&&Ac(i(n)),u=n.key||r||c&&c.key;a=qe(ee,{key:(u&&!qt(u)?u:`_${t}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&e._===1?64:-2)}catch(c){for(let u=yn.length;u>l;u--)Bi();throw c}finally{i&&i._c&&(i._d=!0)}return a}function Ac(e){return e.some(t=>Ls(t)?!(t.type===dt||t.type===ee&&!Ac(t.children)):!0)?e:null}const Xr=e=>e?Vc(e)?cr(e):Xr(e.parent):null,$s=Xe(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=>Xr(e.parent),$root:e=>Xr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ic(e),$forceUpdate:e=>e.f||(e.f=()=>{Pi(e.update)}),$nextTick:e=>e.n||(e.n=Ot.bind(e.proxy)),$watch:e=>rh.bind(e)}),Ar=(e,t)=>e!==Ge&&!e.__isScriptSetup&&Le(e,t),wh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const h=i[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(Ar(s,t))return i[t]=1,s[t];if(o!==Ge&&Le(o,t))return i[t]=2,o[t];if(Le(r,t))return i[t]=3,r[t];if(n!==Ge&&Le(n,t))return i[t]=4,n[t];Qr&&(i[t]=0)}}const c=$s[t];let u,d;if(c)return t==="$attrs"&&ft(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Ge&&Le(n,t))return i[t]=4,n[t];if(d=a.config.globalProperties,Le(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ar(o,t)?(o[t]=n,!0):s!==Ge&&Le(s,t)?(s[t]=n,!0):Le(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:i}},l){let a;return!!(n[l]||e!==Ge&&l[0]!=="$"&&Le(e,l)||Ar(t,l)||Le(r,l)||Le(s,l)||Le($s,l)||Le(o.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Le(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function $l(e){return pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Qr=!0;function _h(e){const t=Ic(e),n=e.proxy,s=e.ctx;Qr=!1,t.beforeCreate&&Tl(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:p,updated:g,activated:_,deactivated:k,beforeDestroy:w,beforeUnmount:x,destroyed:$,unmounted:A,render:F,renderTracked:Q,renderTriggered:C,errorCaptured:R,serverPrefetch:P,expose:J,inheritAttrs:ie,components:z,directives:ve,filters:O}=t;if(c&&Sh(c,s,null),i)for(const q in i){const ge=i[q];ye(ge)&&(s[q]=ge.bind(n))}if(o){const q=o.call(n,n);Be(q)&&(e.data=Ri(q))}if(Qr=!0,r)for(const q in r){const ge=r[q],Ae=ye(ge)?ge.bind(n,n):ye(ge.get)?ge.get.bind(n,n):zt,ke=!ye(ge)&&ye(ge.set)?ge.set.bind(n):zt,ae=X({get:Ae,set:ke});Object.defineProperty(s,q,{enumerable:!0,configurable:!0,get:()=>ae.value,set:Ce=>ae.value=Ce})}if(l)for(const q in l)Rc(l[q],s,n,q);if(a){const q=ye(a)?a.call(n):a;Reflect.ownKeys(q).forEach(ge=>{go(ge,q[ge])})}u&&Tl(u,e,"c");function te(q,ge){pe(ge)?ge.forEach(Ae=>q(Ae.bind(n))):ge&&q(ge.bind(n))}if(te(ph,d),te(Ut,h),te(Sc,p),te(xc,g),te(fh,_),te(dh,k),te(yh,R),te(vh,Q),te(mh,C),te(Vt,x),te(rr,A),te(gh,P),pe(J))if(J.length){const q=e.exposed||(e.exposed={});J.forEach(ge=>{Object.defineProperty(q,ge,{get:()=>n[ge],set:Ae=>n[ge]=Ae,enumerable:!0})})}else e.exposed||(e.exposed={});F&&e.render===zt&&(e.render=F),ie!=null&&(e.inheritAttrs=ie),z&&(e.components=z),ve&&(e.directives=ve),P&&wc(e)}function Sh(e,t,n=zt){pe(e)&&(e=ei(e));for(const s in e){const o=e[s];let r;Be(o)?"default"in o?r=vn(o.from||s,o.default,!0):r=vn(o.from||s):r=vn(o),gt(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function Tl(e,t,n){jt(pe(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Rc(e,t,n,s){let o=s.includes(".")?hc(n,s):()=>n[s];if(We(e)){const r=t[e];ye(r)&&Oe(o,r)}else if(ye(e))Oe(o,e.bind(n));else if(Be(e))if(pe(e))e.forEach(r=>Rc(r,t,n,s));else{const r=ye(e.handler)?e.handler.bind(n):t[e.handler];ye(r)&&Oe(o,r,e)}}function Ic(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>$o(a,c,i,!0)),$o(a,t,i)),Be(t)&&r.set(t,a),a}function $o(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&$o(e,r,n,!0),o&&o.forEach(i=>$o(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=xh[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const xh={data:Al,props:Rl,emits:Rl,methods:bs,computed:bs,beforeCreate:yt,created:yt,beforeMount:yt,mounted:yt,beforeUpdate:yt,updated:yt,beforeDestroy:yt,beforeUnmount:yt,destroyed:yt,unmounted:yt,activated:yt,deactivated:yt,errorCaptured:yt,serverPrefetch:yt,components:bs,directives:bs,watch:$h,provide:Al,inject:Ch};function Al(e,t){return t?e?function(){return Xe(ye(e)?e.call(this,this):e,ye(t)?t.call(this,this):t)}:t:e}function Ch(e,t){return bs(ei(e),ei(t))}function ei(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function yt(e,t){return e?[...new Set([].concat(e,t))]:t}function bs(e,t){return e?Xe(Object.create(null),e,t):t}function Rl(e,t){return e?pe(e)&&pe(t)?[...new Set([...e,...t])]:Xe(Object.create(null),$l(e),$l(t??{})):t}function $h(e,t){if(!e)return t;if(!t)return e;const n=Xe(Object.create(null),e);for(const s in t)n[s]=yt(e[s],t[s]);return n}function Ec(){return{app:null,config:{isNativeTag:Da,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 Th=0;function Ah(e,t){return function(s,o=null){ye(s)||(s=Xe({},s)),o!=null&&!Be(o)&&(o=null);const r=Ec(),i=new WeakSet,l=[];let a=!1;const c=r.app={_uid:Th++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:rp,get config(){return r.config},set config(u){},use(u,...d){return i.has(u)||(u&&ye(u.install)?(i.add(u),u.install(c,...d)):ye(u)&&(i.add(u),u(c,...d))),c},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),c},component(u,d){return d?(r.components[u]=d,c):r.components[u]},directive(u,d){return d?(r.directives[u]=d,c):r.directives[u]},mount(u,d,h){if(!a){const p=c._ceVNode||Z(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,cr(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(jt(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return r.provides[u]=d,c},runWithContext(u){const d=ns;ns=c;try{return u()}finally{ns=d}}};return c}}let ns=null;const Rh=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${_t(t)}Modifiers`]||e[`${Rn(t)}Modifiers`];function Ih(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Ge;let o=n;const r=t.startsWith("update:"),i=r&&Rh(s,t.slice(7));i&&(i.trim&&(o=n.map(u=>We(u)?u.trim():u)),i.number&&(o=n.map(Qo)));let l,a=s[l=_r(t)]||s[l=_r(_t(t))];!a&&r&&(a=s[l=_r(Rn(t))]),a&&jt(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,jt(c,e,6,o)}}const Eh=new WeakMap;function Pc(e,t,n=!1){const s=n?Eh:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},l=!1;if(!ye(e)){const a=c=>{const u=Pc(c,t,!0);u&&(l=!0,Xe(i,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(Be(e)&&s.set(e,null),null):(pe(r)?r.forEach(a=>i[a]=null):Xe(i,r),Be(e)&&s.set(e,i),i)}function ir(e,t){return!e||!Ko(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Le(e,t[0].toLowerCase()+t.slice(1))||Le(e,Rn(t))||Le(e,t))}function Il(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:l,emit:a,render:c,renderCache:u,props:d,data:h,setupState:p,ctx:g,inheritAttrs:_}=e,k=xo(e);let w,x;try{if(n.shapeFlag&4){const A=o||s,F=A;w=on(c.call(F,A,u,d,p,h,g)),x=l}else{const A=t;w=on(A.length>1?A(d,{attrs:l,slots:i,emit:a}):A(d,null)),x=t.props?l:Ph(l)}}catch(A){yn.length=0,nr(A,e,1),w=Z(dt)}let $=w;if(x&&_!==!1){const A=Object.keys(x),{shapeFlag:F}=$;A.length&&F&7&&(r&&A.some(Zo)&&(x=Mh(x,r)),$=An($,x,!1,!0))}return n.dirs&&($=An($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&Gn($,n.transition),w=$,xo(k),w}const Ph=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ko(n))&&((t||(t={}))[n]=e[n]);return t},Mh=(e,t)=>{const n={};for(const s in e)(!Zo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Lh(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:l,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?El(s,i,c):!!i;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(Mc(i,s,h)&&!ir(c,h))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===i?!1:s?i?El(s,i,c):!0:!!i;return!1}function El(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(Mc(t,e,r)&&!ir(n,r))return!0}return!1}function Mc(e,t,n){const s=e[n],o=t[n];return n==="style"&&Be(s)&&Be(o)?!zs(s,o):s!==o}function Nh({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 Lc={},Nc=()=>Object.create(Lc),Oc=e=>Object.getPrototypeOf(e)===Lc;function Oh(e,t,n,s=!1){const o={},r=Nc();e.propsDefaults=Object.create(null),Dc(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Wd(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function Dh(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,l=Ee(o),[a]=e.propsOptions;let c=!1;if((s||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(ir(e.emitsOptions,h))continue;const p=t[h];if(a)if(Le(r,h))p!==r[h]&&(r[h]=p,c=!0);else{const g=_t(h);o[g]=ti(a,l,g,p,e,!1)}else p!==r[h]&&(r[h]=p,c=!0)}}}else{Dc(e,t,o,r)&&(c=!0);let u;for(const d in l)(!t||!Le(t,d)&&((u=Rn(d))===d||!Le(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ti(a,l,d,void 0,e,!0)):delete o[d]);if(r!==l)for(const d in r)(!t||!Le(t,d))&&(delete r[d],c=!0)}c&&fn(e.attrs,"set","")}function Dc(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,l;if(t)for(let a in t){if(_s(a))continue;const c=t[a];let u;o&&Le(o,u=_t(a))?!r||!r.includes(u)?n[u]=c:(l||(l={}))[u]=c:ir(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,i=!0)}if(r){const a=Ee(n),c=l||Ge;for(let u=0;u<r.length;u++){const d=r[u];n[d]=ti(o,a,d,c[d],e,!Le(c,d))}}return i}function ti(e,t,n,s,o,r){const i=e[n];if(i!=null){const l=Le(i,"default");if(l&&s===void 0){const a=i.default;if(i.type!==Function&&!i.skipFactory&&ye(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=qs(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!l?s=!1:i[1]&&(s===""||s===Rn(n))&&(s=!0))}return s}const Bh=new WeakMap;function Bc(e,t,n=!1){const s=n?Bh:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,i={},l=[];let a=!1;if(!ye(e)){const u=d=>{a=!0;const[h,p]=Bc(d,t,!0);Xe(i,h),p&&l.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 Be(e)&&s.set(e,Xn),Xn;if(pe(r))for(let u=0;u<r.length;u++){const d=_t(r[u]);Pl(d)&&(i[d]=Ge)}else if(r)for(const u in r){const d=_t(u);if(Pl(d)){const h=r[u],p=i[d]=pe(h)||ye(h)?{type:h}:Xe({},h),g=p.type;let _=!1,k=!0;if(pe(g))for(let w=0;w<g.length;++w){const x=g[w],$=ye(x)&&x.name;if($==="Boolean"){_=!0;break}else $==="String"&&(k=!1)}else _=ye(g)&&g.name==="Boolean";p[0]=_,p[1]=k,(_||Le(p,"default"))&&l.push(d)}}const c=[i,l];return Be(e)&&s.set(e,c),c}function Pl(e){return e[0]!=="$"&&!_s(e)}const Ni=e=>e==="_"||e==="_ctx"||e==="$stable",Oi=e=>pe(e)?e.map(on):[on(e)],jh=(e,t,n)=>{if(t._n)return t;const s=$t((...o)=>Oi(t(...o)),n);return s._c=!1,s},jc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Ni(o))continue;const r=e[o];if(ye(r))t[o]=jh(o,r,s);else if(r!=null){const i=Oi(r);t[o]=()=>i}}},Uc=(e,t)=>{const n=Oi(t);e.slots.default=()=>n},Gc=(e,t,n)=>{for(const s in t)(n||!Ni(s))&&(e[s]=t[s])},Uh=(e,t,n)=>{const s=e.slots=Nc();if(e.vnode.shapeFlag&32){const o=t._;o?(Gc(s,t,n),n&&Ga(s,"_",o,!0)):jc(t,s)}else t&&Uc(e,t)},Gh=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=Ge;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:Gc(o,t,n):(r=!t.$stable,jc(t,o)),i=t}else t&&(Uc(e,t),i={default:1});if(r)for(const l in o)!Ni(l)&&i[l]==null&&delete o[l]},bt=Wh;function Fh(e){return zh(e)}function zh(e,t){const n=er();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:p=zt,insertStaticContent:g}=e,_=(m,S,I,G=null,B=null,j=null,se=void 0,V=null,Y=!!S.dynamicChildren)=>{if(m===S)return;m&&!Nn(m,S)&&(G=xt(m),Ce(m,B,j,!0),m=null),S.patchFlag===-2&&(Y=!1,S.dynamicChildren=null);const{type:U,ref:ue,shapeFlag:oe}=S;switch(U){case lr:k(m,S,I,G);break;case dt:w(m,S,I,G);break;case vo:m==null&&x(S,I,G,se);break;case ee:z(m,S,I,G,B,j,se,V,Y);break;default:oe&1?F(m,S,I,G,B,j,se,V,Y):oe&6?ve(m,S,I,G,B,j,se,V,Y):(oe&64||oe&128)&&U.process(m,S,I,G,B,j,se,V,Y,ne)}ue!=null&&B?Cs(ue,m&&m.ref,j,S||m,!S):ue==null&&m&&m.ref!=null&&Cs(m.ref,null,j,m,!0)},k=(m,S,I,G)=>{if(m==null)s(S.el=l(S.children),I,G);else{const B=S.el=m.el;S.children!==m.children&&c(B,S.children)}},w=(m,S,I,G)=>{m==null?s(S.el=a(S.children||""),I,G):S.el=m.el},x=(m,S,I,G)=>{[m.el,m.anchor]=g(m.children,S,I,G,m.el,m.anchor)},$=({el:m,anchor:S},I,G)=>{let B;for(;m&&m!==S;)B=h(m),s(m,I,G),m=B;s(S,I,G)},A=({el:m,anchor:S})=>{let I;for(;m&&m!==S;)I=h(m),o(m),m=I;o(S)},F=(m,S,I,G,B,j,se,V,Y)=>{if(S.type==="svg"?se="svg":S.type==="math"&&(se="mathml"),m==null)Q(S,I,G,B,j,se,V,Y);else{const U=m.el&&m.el._isVueCE?m.el:null;try{U&&U._beginPatch(),P(m,S,B,j,se,V,Y)}finally{U&&U._endPatch()}}},Q=(m,S,I,G,B,j,se,V)=>{let Y,U;const{props:ue,shapeFlag:oe,transition:le,dirs:fe}=m;if(Y=m.el=i(m.type,j,ue&&ue.is,ue),oe&8?u(Y,m.children):oe&16&&R(m.children,Y,null,G,B,Rr(m,j),se,V),fe&&In(m,null,G,"created"),C(Y,m,m.scopeId,se,G),ue){for(const Me in ue)Me!=="value"&&!_s(Me)&&r(Y,Me,null,ue[Me],j,G);"value"in ue&&r(Y,"value",null,ue.value,j),(U=ue.onVnodeBeforeMount)&&Yt(U,G,m)}fe&&In(m,null,G,"beforeMount");const _e=Hh(B,le);_e&&le.beforeEnter(Y),s(Y,S,I),((U=ue&&ue.onVnodeMounted)||_e||fe)&&bt(()=>{try{U&&Yt(U,G,m),_e&&le.enter(Y),fe&&In(m,null,G,"mounted")}finally{}},B)},C=(m,S,I,G,B)=>{if(I&&p(m,I),G)for(let j=0;j<G.length;j++)p(m,G[j]);if(B){let j=B.subTree;if(S===j||Hc(j.type)&&(j.ssContent===S||j.ssFallback===S)){const se=B.vnode;C(m,se,se.scopeId,se.slotScopeIds,B.parent)}}},R=(m,S,I,G,B,j,se,V,Y=0)=>{for(let U=Y;U<m.length;U++){const ue=m[U]=V?un(m[U]):on(m[U]);_(null,ue,S,I,G,B,j,se,V)}},P=(m,S,I,G,B,j,se)=>{const V=S.el=m.el;let{patchFlag:Y,dynamicChildren:U,dirs:ue}=S;Y|=m.patchFlag&16;const oe=m.props||Ge,le=S.props||Ge;let fe;if(I&&En(I,!1),(fe=le.onVnodeBeforeUpdate)&&Yt(fe,I,S,m),ue&&In(S,m,I,"beforeUpdate"),I&&En(I,!0),U&&(!m.dynamicChildren||m.dynamicChildren.length!==U.length)&&(Y=0,se=!1,U=null),(oe.innerHTML&&le.innerHTML==null||oe.textContent&&le.textContent==null)&&u(V,""),U?J(m.dynamicChildren,U,V,I,G,Rr(S,B),j):se||ge(m,S,V,null,I,G,Rr(S,B),j,!1),Y>0){if(Y&16)ie(V,oe,le,I,B);else if(Y&2&&oe.class!==le.class&&r(V,"class",null,le.class,B),Y&4&&r(V,"style",oe.style,le.style,B),Y&8){const _e=S.dynamicProps;for(let Me=0;Me<_e.length;Me++){const Ie=_e[Me],Pe=oe[Ie],Qe=le[Ie];(Qe!==Pe||Ie==="value")&&r(V,Ie,Pe,Qe,B,I)}}Y&1&&m.children!==S.children&&u(V,S.children)}else!se&&U==null&&ie(V,oe,le,I,B);((fe=le.onVnodeUpdated)||ue)&&bt(()=>{fe&&Yt(fe,I,S,m),ue&&In(S,m,I,"updated")},G)},J=(m,S,I,G,B,j,se)=>{for(let V=0;V<S.length;V++){const Y=m[V],U=S[V],ue=Y.el&&(Y.type===ee||!Nn(Y,U)||Y.shapeFlag&198)?d(Y.el):I;_(Y,U,ue,null,G,B,j,se,!0)}},ie=(m,S,I,G,B)=>{if(S!==I){if(S!==Ge)for(const j in S)!_s(j)&&!(j in I)&&r(m,j,S[j],null,B,G);for(const j in I){if(_s(j))continue;const se=I[j],V=S[j];se!==V&&j!=="value"&&r(m,j,V,se,B,G)}"value"in I&&r(m,"value",S.value,I.value,B)}},z=(m,S,I,G,B,j,se,V,Y)=>{const U=S.el=m?m.el:l(""),ue=S.anchor=m?m.anchor:l("");let{patchFlag:oe,dynamicChildren:le,slotScopeIds:fe}=S;fe&&(V=V?V.concat(fe):fe),m==null?(s(U,I,G),s(ue,I,G),R(S.children||[],I,ue,B,j,se,V,Y)):oe>0&&oe&64&&le&&m.dynamicChildren&&m.dynamicChildren.length===le.length?(J(m.dynamicChildren,le,I,B,j,se,V),(S.key!=null||B&&S===B.subTree)&&Di(m,S,!0)):ge(m,S,I,ue,B,j,se,V,Y)},ve=(m,S,I,G,B,j,se,V,Y)=>{S.slotScopeIds=V,m==null?S.shapeFlag&512?B.ctx.activate(S,I,G,se,Y):O(S,I,G,B,j,se,Y):L(m,S,Y)},O=(m,S,I,G,B,j,se)=>{const V=m.component=Xh(m,G,B);if(sr(m)&&(V.ctx.renderer=ne),Qh(V,!1,se),V.asyncDep){if(B&&B.registerDep(V,te,se),!m.el){const Y=V.subTree=Z(dt);w(null,Y,S,I),m.placeholder=Y.el}}else te(V,m,S,I,B,j,se)},L=(m,S,I)=>{const G=S.component=m.component;if(Lh(m,S,I))if(G.asyncDep&&!G.asyncResolved){q(G,S,I);return}else G.next=S,G.update();else S.el=m.el,G.vnode=S},te=(m,S,I,G,B,j,se)=>{const V=()=>{if(m.isMounted){let{next:oe,bu:le,u:fe,parent:_e,vnode:Me}=m;{const It=Fc(m);if(It){oe&&(oe.el=Me.el,q(m,oe,se)),It.asyncDep.then(()=>{bt(()=>{m.isUnmounted||U()},B)});return}}let Ie=oe,Pe;En(m,!1),oe?(oe.el=Me.el,q(m,oe,se)):oe=Me,le&&po(le),(Pe=oe.props&&oe.props.onVnodeBeforeUpdate)&&Yt(Pe,_e,oe,Me),En(m,!0);const Qe=Il(m),et=m.subTree;m.subTree=Qe,_(et,Qe,d(et.el),xt(et),m,B,j),oe.el=Qe.el,Ie===null&&Nh(m,Qe.el),fe&&bt(fe,B),(Pe=oe.props&&oe.props.onVnodeUpdated)&&bt(()=>Yt(Pe,_e,oe,Me),B)}else{let oe;const{el:le,props:fe}=S,{bm:_e,m:Me,parent:Ie,root:Pe,type:Qe}=m,et=ts(S);En(m,!1),_e&&po(_e),!et&&(oe=fe&&fe.onVnodeBeforeMount)&&Yt(oe,Ie,S),En(m,!0);{Pe.ce&&Pe.ce._hasShadowRoot()&&Pe.ce._injectChildStyle(Qe,m.parent?m.parent.type:void 0);const It=m.subTree=Il(m);_(null,It,I,G,m,B,j),S.el=It.el}if(Me&&bt(Me,B),!et&&(oe=fe&&fe.onVnodeMounted)){const It=S;bt(()=>Yt(oe,Ie,It),B)}(S.shapeFlag&256||Ie&&ts(Ie.vnode)&&Ie.vnode.shapeFlag&256)&&m.a&&bt(m.a,B),m.isMounted=!0,S=I=G=null}};m.scope.on();const Y=m.effect=new qa(V);m.scope.off();const U=m.update=Y.run.bind(Y),ue=m.job=Y.runIfDirty.bind(Y);ue.i=m,ue.id=m.uid,Y.scheduler=()=>Pi(ue),En(m,!0),U()},q=(m,S,I)=>{S.component=m;const G=m.vnode.props;m.vnode=S,m.next=null,Dh(m,S.props,G,I),Gh(m,S.children,I),bn(),bl(m),kn()},ge=(m,S,I,G,B,j,se,V,Y=!1)=>{const U=m&&m.children,ue=m?m.shapeFlag:0,oe=S.children,{patchFlag:le,shapeFlag:fe}=S;if(le>0){if(le&128){ke(U,oe,I,G,B,j,se,V,Y);return}else if(le&256){Ae(U,oe,I,G,B,j,se,V,Y);return}}fe&8?(ue&16&&Ze(U,B,j),oe!==U&&u(I,oe)):ue&16?fe&16?ke(U,oe,I,G,B,j,se,V,Y):Ze(U,B,j,!0):(ue&8&&u(I,""),fe&16&&R(oe,I,G,B,j,se,V,Y))},Ae=(m,S,I,G,B,j,se,V,Y)=>{m=m||Xn,S=S||Xn;const U=m.length,ue=S.length,oe=Math.min(U,ue);let le;for(le=0;le<oe;le++){const fe=S[le]=Y?un(S[le]):on(S[le]);_(m[le],fe,I,null,B,j,se,V,Y)}U>ue?Ze(m,B,j,!0,!1,oe):R(S,I,G,B,j,se,V,Y,oe)},ke=(m,S,I,G,B,j,se,V,Y)=>{let U=0;const ue=S.length;let oe=m.length-1,le=ue-1;for(;U<=oe&&U<=le;){const fe=m[U],_e=S[U]=Y?un(S[U]):on(S[U]);if(Nn(fe,_e))_(fe,_e,I,null,B,j,se,V,Y);else break;U++}for(;U<=oe&&U<=le;){const fe=m[oe],_e=S[le]=Y?un(S[le]):on(S[le]);if(Nn(fe,_e))_(fe,_e,I,null,B,j,se,V,Y);else break;oe--,le--}if(U>oe){if(U<=le){const fe=le+1,_e=fe<ue?S[fe].el:G;for(;U<=le;)_(null,S[U]=Y?un(S[U]):on(S[U]),I,_e,B,j,se,V,Y),U++}}else if(U>le)for(;U<=oe;)Ce(m[U],B,j,!0),U++;else{const fe=U,_e=U,Me=new Map;for(U=_e;U<=le;U++){const vt=S[U]=Y?un(S[U]):on(S[U]);vt.key!=null&&Me.set(vt.key,U)}let Ie,Pe=0;const Qe=le-_e+1;let et=!1,It=0;const Ft=new Array(Qe);for(U=0;U<Qe;U++)Ft[U]=0;for(U=fe;U<=oe;U++){const vt=m[U];if(Pe>=Qe){Ce(vt,B,j,!0);continue}let rt;if(vt.key!=null)rt=Me.get(vt.key);else for(Ie=_e;Ie<=le;Ie++)if(Ft[Ie-_e]===0&&Nn(vt,S[Ie])){rt=Ie;break}rt===void 0?Ce(vt,B,j,!0):(Ft[rt-_e]=U+1,rt>=It?It=rt:et=!0,_(vt,S[rt],I,null,B,j,se,V,Y),Pe++)}const Zs=et?qh(Ft):Xn;for(Ie=Zs.length-1,U=Qe-1;U>=0;U--){const vt=_e+U,rt=S[vt],Kt=S[vt+1],Zt=vt+1<ue?Kt.el||zc(Kt):G;Ft[U]===0?_(null,rt,I,Zt,B,j,se,V,Y):et&&(Ie<0||U!==Zs[Ie]?ae(rt,I,Zt,2):Ie--)}}},ae=(m,S,I,G,B=null)=>{const{el:j,type:se,transition:V,children:Y,shapeFlag:U}=m;if(U&6){ae(m.component.subTree,S,I,G);return}if(U&128){m.suspense.move(S,I,G);return}if(U&64){se.move(m,S,I,ne);return}if(se===ee){s(j,S,I);for(let oe=0;oe<Y.length;oe++)ae(Y[oe],S,I,G);s(m.anchor,S,I);return}if(se===vo){$(m,S,I);return}if(G!==2&&U&1&&V)if(G===0)V.persisted&&!j[Nt]?s(j,S,I):(V.beforeEnter(j),s(j,S,I),bt(()=>V.enter(j),B));else{const{leave:oe,delayLeave:le,afterLeave:fe}=V,_e=()=>{m.ctx.isUnmounted?o(j):s(j,S,I)},Me=()=>{const Ie=j._isLeaving||!!j[Nt];j._isLeaving&&j[Nt](!0),V.persisted&&!Ie?_e():oe(j,()=>{_e(),fe&&fe()})};le?le(j,_e,Me):Me()}else s(j,S,I)},Ce=(m,S,I,G=!1,B=!1)=>{const{type:j,props:se,ref:V,children:Y,dynamicChildren:U,shapeFlag:ue,patchFlag:oe,dirs:le,cacheIndex:fe,memo:_e}=m;if(oe===-2&&(B=!1),V!=null&&(bn(),Cs(V,null,I,m,!0),kn()),fe!=null&&(S.renderCache[fe]=void 0),ue&256){S.ctx.deactivate(m);return}const Me=ue&1&&le,Ie=!ts(m);let Pe;if(Ie&&(Pe=se&&se.onVnodeBeforeUnmount)&&Yt(Pe,S,m),ue&6)Ke(m.component,I,G);else{if(ue&128){m.suspense.unmount(I,G);return}Me&&In(m,null,S,"beforeUnmount"),ue&64?m.type.remove(m,S,I,ne,G):U&&!U.hasOnce&&(j!==ee||oe>0&&oe&64)?Ze(U,S,I,!1,!0):(j===ee&&oe&384||!B&&ue&16)&&Ze(Y,S,I),G&&Te(m)}const Qe=_e!=null&&fe==null;(Ie&&(Pe=se&&se.onVnodeUnmounted)||Me||Qe)&&bt(()=>{Pe&&Yt(Pe,S,m),Me&&In(m,null,S,"unmounted"),Qe&&(m.el=null)},I)},Te=m=>{const{type:S,el:I,anchor:G,transition:B}=m;if(S===ee){Rt(I,G);return}if(S===vo){A(m);return}const j=()=>{o(I),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(m.shapeFlag&1&&B&&!B.persisted){const{leave:se,delayLeave:V}=B,Y=()=>se(I,j);V?V(m.el,j,Y):Y()}else j()},Rt=(m,S)=>{let I;for(;m!==S;)I=h(m),o(m),m=I;o(S)},Ke=(m,S,I)=>{const{bum:G,scope:B,job:j,subTree:se,um:V,m:Y,a:U}=m;Ml(Y),Ml(U),G&&po(G),B.stop(),j&&(j.flags|=8,Ce(se,m,S,I)),V&&bt(V,S),bt(()=>{m.isUnmounted=!0},S)},Ze=(m,S,I,G=!1,B=!1,j=0)=>{for(let se=j;se<m.length;se++)Ce(m[se],S,I,G,B)},xt=m=>{if(m.shapeFlag&6)return xt(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const S=h(m.anchor||m.el),I=S&&S[pc];return I?h(I):S};let mt=!1;const Gt=(m,S,I)=>{let G;m==null?S._vnode&&(Ce(S._vnode,null,null,!0),G=S._vnode.component):_(S._vnode||null,m,S,null,null,null,I),S._vnode=m,mt||(mt=!0,bl(G),cc(),mt=!1)},ne={p:_,um:Ce,m:ae,r:Te,mt:O,mc:R,pc:ge,pbc:J,n:xt,o:e};return{render:Gt,hydrate:void 0,createApp:Ah(Gt)}}function Rr({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 En({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Di(e,t,n=!1){const s=e.children,o=t.children;if(pe(s)&&pe(o))for(let r=0;r<s.length;r++){const i=s[r];let l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=un(o[r]),l.el=i.el),!n&&l.patchFlag!==-2&&Di(i,l)),l.type===lr&&(l.patchFlag===-1&&(l=o[r]=un(l)),l.el=i.el),l.type===dt&&!l.el&&(l.el=i.el)}}function qh(e){const t=e.slice(),n=[0];let s,o,r,i,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(r=0,i=n.length-1;r<i;)l=r+i>>1,e[n[l]]<c?r=l+1:i=l;c<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function Fc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Fc(t)}function Ml(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?zc(t.subTree):null}const Hc=e=>e.__isSuspense;function Wh(e,t){t&&t.pendingBranch?pe(e)?t.effects.push(...e):t.effects.push(e):ac(e)}const ee=Symbol.for("v-fgt"),lr=Symbol.for("v-txt"),dt=Symbol.for("v-cmt"),vo=Symbol.for("v-stc"),yn=[];let Tt=null;function y(e=!1){yn.push(Tt=e?null:[])}function Bi(){yn.pop(),Tt=yn[yn.length-1]||null}let Ms=1;function To(e,t=!1){Ms+=e,e<0&&Tt&&t&&(Tt.hasOnce=!0)}function qc(e){return e.dynamicChildren=Ms>0?Tt||Xn:null,Bi(),Ms>0&&Tt&&Tt.push(e),e}function b(e,t,n,s,o,r){return qc(f(e,t,n,s,o,r,!0))}function qe(e,t,n,s,o){return qc(Z(e,t,n,s,o,!0))}function Ls(e){return e?e.__v_isVNode===!0:!1}function Nn(e,t){return e.type===t.type&&e.key===t.key}const Wc=({key:e})=>e??null,yo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||gt(e)||ye(e)?{i:lt,r:e,k:t,f:!!n}:e:null);function f(e,t=null,n=null,s=0,o=null,r=e===ee?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wc(t),ref:t&&yo(t),scopeId:fc,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:lt};return l?(Ao(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=We(n)?8:16),Ms>0&&!i&&Tt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Tt.push(a),a}const Z=Vh;function Vh(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===$c)&&(e=dt),Ls(e)){const l=An(e,t,!0);return n&&Ao(l,n),Ms>0&&!r&&Tt&&(l.shapeFlag&6?Tt[Tt.indexOf(e)]=l:Tt.push(l)),l.patchFlag=-2,l}if(op(e)&&(e=e.__vccOpts),t){t=Kh(t);let{class:l,style:a}=t;l&&!We(l)&&(t.class=de(l)),Be(a)&&(Ei(a)&&!pe(a)&&(a=Xe({},a)),t.style=ln(a))}const i=We(e)?1:Hc(e)?128:gc(e)?64:Be(e)?4:ye(e)?2:0;return f(e,t,n,s,o,i,r,!0)}function Kh(e){return e?Ei(e)||Oc(e)?Xe({},e):e:null}function An(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:l,transition:a}=e,c=t?Zh(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Wc(c),ref:t&&t.ref?n&&r?pe(r)?r.concat(yo(t)):[r,yo(t)]:yo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ee?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&An(e.ssContent),ssFallback:e.ssFallback&&An(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Gn(u,a.clone(u)),u}function Re(e=" ",t=0){return Z(lr,null,e,t)}function D(e="",t=!1){return t?(y(),qe(dt,null,e)):Z(dt,null,e)}function on(e){return e==null||typeof e=="boolean"?Z(dt):pe(e)?Z(ee,null,e.slice()):Ls(e)?un(e):Z(lr,null,String(e))}function un(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:An(e)}function Ao(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(pe(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Ao(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Oc(t)?t._ctx=lt:o===3&<&&(lt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ye(t)){if(s&65){Ao(e,{default:t});return}t={default:t,_ctx:lt},n=32}else t=String(t),s&64?(n=16,t=[Re(t)]):n=8;e.children=t,e.shapeFlag|=n}function Zh(...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=ln([t.style,s.style]);else if(Ko(o)){const r=t[o],i=s[o];i&&r!==i&&!(pe(r)&&r.includes(i))?t[o]=r?[].concat(r,i):i:i==null&&r==null&&!Zo(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function Yt(e,t,n,s=null){jt(e,t,7,[n,s])}const Jh=Ec();let Yh=0;function Xh(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Jh,r={uid:Yh++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Td(!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:Bc(s,o),emitsOptions:Pc(s,o),emit:null,emitted:null,propsDefaults:Ge,inheritAttrs:s.inheritAttrs,ctx:Ge,data:Ge,props:Ge,attrs:Ge,slots:Ge,refs:Ge,setupState:Ge,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=Ih.bind(null,r),e.ce&&e.ce(r),r}let ht=null;const ar=()=>ht||lt;let Ro,ni;{const e=er(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(i=>i(r)):o[0](r)}};Ro=t("__VUE_INSTANCE_SETTERS__",n=>ht=n),ni=t("__VUE_SSR_SETTERS__",n=>Ns=n)}const qs=e=>{const t=ht;return Ro(e),e.scope.on(),()=>{e.scope.off(),Ro(t)}},Ll=()=>{ht&&ht.scope.off(),Ro(null)};function Vc(e){return e.vnode.shapeFlag&4}let Ns=!1;function Qh(e,t=!1,n=!1){t&&ni(t);const{props:s,children:o}=e.vnode,r=Vc(e);Oh(e,s,r,t),Uh(e,o,n||t);const i=r?ep(e,t):void 0;return t&&ni(!1),i}function ep(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wh);const{setup:s}=n;if(s){bn();const o=e.setupContext=s.length>1?np(e):null,r=qs(e),i=Hs(s,e,0,[e.props,o]),l=Ba(i);if(kn(),r(),(l||e.sp)&&!ts(e)&&wc(e),l){if(i.then(Ll,Ll),t)return i.then(a=>{Nl(e,a)}).catch(a=>{nr(a,e,0)});e.asyncDep=i}else Nl(e,i)}else Kc(e)}function Nl(e,t,n){ye(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Be(t)&&(e.setupState=rc(t)),Kc(e)}function Kc(e,t,n){const s=e.type;e.render||(e.render=s.render||zt);{const o=qs(e);bn();try{_h(e)}finally{kn(),o()}}}const tp={get(e,t){return ft(e,"get",""),e[t]}};function np(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,tp),slots:e.slots,emit:e.emit,expose:t}}function cr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(rc(Vd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $s)return $s[n](e)},has(t,n){return n in t||n in $s}})):e.proxy}function sp(e,t=!0){return ye(e)?e.displayName||e.name:e.name||t&&e.__name}function op(e){return ye(e)&&"__vccOpts"in e}const X=(e,t)=>Xd(e,t,Ns);function Ne(e,t,n){try{To(-1);const s=arguments.length;return s===2?Be(t)&&!pe(t)?Ls(t)?Z(e,null,[t]):Z(e,t):Z(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ls(n)&&(n=[n]),Z(e,t,n))}finally{To(1)}}const rp="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 si;const Ol=typeof window<"u"&&window.trustedTypes;if(Ol)try{si=Ol.createPolicy("vue",{createHTML:e=>e})}catch{}const Zc=si?e=>si.createHTML(e):e=>e,ip="http://www.w3.org/2000/svg",lp="http://www.w3.org/1998/Math/MathML",cn=typeof document<"u"?document:null,Dl=cn&&cn.createElement("template"),ap={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"?cn.createElementNS(ip,e):t==="mathml"?cn.createElementNS(lp,e):n?cn.createElement(e,{is:n}):cn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>cn.createTextNode(e),createComment:e=>cn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>cn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const i=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Dl.innerHTML=Zc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Dl.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Sn="transition",hs="animation",is=Symbol("_vtc"),Jc={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},Yc=Xe({},vc,Jc),cp=e=>(e.displayName="Transition",e.props=Yc,e),ur=cp((e,{slots:t})=>Ne(uh,Xc(e),t)),Pn=(e,t=[])=>{pe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Bl=e=>e?pe(e)?e.some(t=>t.length>1):e.length>1:!1;function Xc(e){const t={};for(const z in e)z in Jc||(t[z]=e[z]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:r=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,g=up(o),_=g&&g[0],k=g&&g[1],{onBeforeEnter:w,onEnter:x,onEnterCancelled:$,onLeave:A,onLeaveCancelled:F,onBeforeAppear:Q=w,onAppear:C=x,onAppearCancelled:R=$}=t,P=(z,ve,O,L)=>{z._enterCancelled=L,Cn(z,ve?u:l),Cn(z,ve?c:i),O&&O()},J=(z,ve)=>{z._isLeaving=!1,Cn(z,d),Cn(z,p),Cn(z,h),ve&&ve()},ie=z=>(ve,O)=>{const L=z?C:x,te=()=>P(ve,z,O);Pn(L,[ve,te]),jl(()=>{Cn(ve,z?a:r),Xt(ve,z?u:l),Bl(L)||Ul(ve,s,_,te)})};return Xe(t,{onBeforeEnter(z){Pn(w,[z]),Xt(z,r),Xt(z,i)},onBeforeAppear(z){Pn(Q,[z]),Xt(z,a),Xt(z,c)},onEnter:ie(!1),onAppear:ie(!0),onLeave(z,ve){z._isLeaving=!0;const O=()=>J(z,ve);Xt(z,d),z._enterCancelled?(Xt(z,h),oi(z)):(oi(z),Xt(z,h)),jl(()=>{z._isLeaving&&(Cn(z,d),Xt(z,p),Bl(A)||Ul(z,s,k,O))}),Pn(A,[z,O])},onEnterCancelled(z){P(z,!1,void 0,!0),Pn($,[z])},onAppearCancelled(z){P(z,!0,void 0,!0),Pn(R,[z])},onLeaveCancelled(z){J(z),Pn(F,[z])}})}function up(e){if(e==null)return null;if(Be(e))return[Ir(e.enter),Ir(e.leave)];{const t=Ir(e);return[t,t]}}function Ir(e){return vd(e)}function Xt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[is]||(e[is]=new Set)).add(t)}function Cn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[is];n&&(n.delete(t),n.size||(e[is]=void 0))}function jl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let fp=0;function Ul(e,t,n,s){const o=e._endId=++fp,r=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:i,timeout:l,propCount:a}=Qc(e,t);if(!i)return s();const c=i+"end";let u=0;const d=()=>{e.removeEventListener(c,h),r()},h=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,h)}function Qc(e,t){const n=window.getComputedStyle(e),s=g=>(n[g]||"").split(", "),o=s(`${Sn}Delay`),r=s(`${Sn}Duration`),i=Gl(o,r),l=s(`${hs}Delay`),a=s(`${hs}Duration`),c=Gl(l,a);let u=null,d=0,h=0;t===Sn?i>0&&(u=Sn,d=i,h=r.length):t===hs?c>0&&(u=hs,d=c,h=a.length):(d=Math.max(i,c),u=d>0?i>c?Sn:hs:null,h=u?u===Sn?r.length:a.length:0);const p=u===Sn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Sn}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:p}}function Gl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Fl(n)+Fl(e[s])))}function Fl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function oi(e){return(e?e.ownerDocument:document).body.offsetHeight}function dp(e,t,n){const s=e[is];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Io=Symbol("_vod"),ji=Symbol("_vsh"),eu={name:"show",beforeMount(e,{value:t},{transition:n}){e[Io]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ps(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),ps(e,!0),s.enter(e)):s.leave(e,()=>{ps(e,!1)}):ps(e,t))},beforeUnmount(e,{value:t}){ps(e,t)}};function ps(e,t){e.style.display=t?e[Io]:"none",e[ji]=!t}const tu=Symbol("");function hp(e){const t=ar();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(r=>Eo(r,o))},s=()=>{const o=e(t.proxy);t.ce?Eo(t.ce,o):ri(t.subTree,o),n(o)};Sc(()=>{ac(s)}),Ut(()=>{Oe(s,zt,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),rr(()=>o.disconnect())})}function ri(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{ri(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Eo(e.el,t);else if(e.type===ee)e.children.forEach(n=>ri(n,t));else if(e.type===vo){let{el:n,anchor:s}=e;for(;n&&(Eo(n,t),n!==s);)n=n.nextSibling}}function Eo(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const r=$d(t[o]);n.setProperty(`--${o}`,r),s+=`--${o}: ${r};`}n[tu]=s}}const pp=/(?:^|;)\s*display\s*:/;function gp(e,t,n){const s=e.style,o=We(n);let r=!1;if(n&&!o){if(t)if(We(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&ks(s,l,"")}else for(const i in t)n[i]==null&&ks(s,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?vp(e,i,!We(t)&&t?t[i]:void 0,l)||ks(s,i,l):ks(s,i,"")}}else if(o){if(t!==n){const i=s[tu];i&&(n+=";"+i),s.cssText=n,r=pp.test(n)}}else t&&e.removeAttribute("style");Io in e&&(e[Io]=r?s.display:"",e[ji]&&(s.display="none"))}const zl=/\s*!important$/;function ks(e,t,n){if(pe(n))n.forEach(s=>ks(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=mp(e,t);zl.test(n)?e.setProperty(Rn(s),n.replace(zl,""),"important"):e[s]=n}}const Hl=["Webkit","Moz","ms"],Er={};function mp(e,t){const n=Er[t];if(n)return n;let s=_t(t);if(s!=="filter"&&s in e)return Er[t]=s;s=Xo(s);for(let o=0;o<Hl.length;o++){const r=Hl[o]+s;if(r in e)return Er[t]=r}return t}function vp(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&We(s)&&n===s}const ql="http://www.w3.org/1999/xlink";function Wl(e,t,n,s,o,r=Sd(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ql,t.slice(6,t.length)):e.setAttributeNS(ql,t,n):n==null||r&&!Fa(n)?e.removeAttribute(t):e.setAttribute(t,r?"":qt(n)?String(n):n)}function Vl(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Zc(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Fa(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function On(e,t,n,s){e.addEventListener(t,n,s)}function yp(e,t,n,s){e.removeEventListener(t,n,s)}const Kl=Symbol("_vei");function bp(e,t,n,s,o=null){const r=e[Kl]||(e[Kl]={}),i=r[t];if(s&&i)i.value=s;else{const[l,a]=_p(t);if(s){const c=r[t]=Cp(s,o);On(e,l,c,a)}else i&&(yp(e,l,i,a),r[t]=void 0)}}const kp=/(Once|Passive|Capture)$/,wp=/^on:?(?:Once|Passive|Capture)$/;function _p(e){let t,n;for(;(n=e.match(kp))&&!wp.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Rn(e.slice(2)),t]}let Pr=0;const Sp=Promise.resolve(),xp=()=>Pr||(Sp.then(()=>Pr=0),Pr=Date.now());function Cp(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(pe(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),l=[s];for(let a=0;a<i.length&&!s._stopped;a++){const c=i[a];c&&jt(c,t,5,l)}}else jt(o,t,5,[s])};return n.value=e,n.attached=xp(),n}const Zl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$p=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?dp(e,s,i):t==="style"?gp(e,n,s):Ko(t)?Zo(t)||bp(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tp(e,t,s,i))?(Vl(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Wl(e,t,s,i,r,t!=="value")):e._isVueCE&&(Ap(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!We(s)))?Vl(e,_t(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Wl(e,t,s,i))};function Tp(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Zl(t)&&ye(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 Zl(t)&&We(n)?!1:t in e}function Ap(e,t){const n=e._def.props;if(!n)return!1;const s=_t(t);return Array.isArray(n)?n.some(o=>_t(o)===s):Object.keys(n).some(o=>_t(o)===s)}const nu=new WeakMap,su=new WeakMap,Po=Symbol("_moveCb"),Jl=Symbol("_enterCb"),Rp=e=>(delete e.props.mode,e),Ip=Rp({name:"TransitionGroup",props:Xe({},Yc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ar(),s=mc();let o,r;return xc(()=>{if(!o.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!Np(o[0].el,n.vnode.el,i)){o=[];return}o.forEach(Pp),o.forEach(Mp);const l=o.filter(Lp);oi(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Xt(c,i),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Po]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Po]=null,Cn(c,i))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const i=Ee(e),l=Xc(i);let a=i.tag||ee;if(o=[],r)for(let c=0;c<r.length;c++){const u=r[c];u.el&&u.el instanceof Element&&!u.el[ji]&&(o.push(u),Gn(u,Ps(u,l,s,n)),nu.set(u,ou(u.el)))}r=t.default?Li(t.default()):[];for(let c=0;c<r.length;c++){const u=r[c];u.key!=null&&Gn(u,Ps(u,l,s,n))}return Z(a,null,r)}}}),Ep=Ip;function Pp(e){const t=e.el;t[Po]&&t[Po](),t[Jl]&&t[Jl]()}function Mp(e){su.set(e,ou(e.el))}function Lp(e){const t=nu.get(e),n=su.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const r=e.el,i=r.style,l=r.getBoundingClientRect();let a=1,c=1;return r.offsetWidth&&(a=l.width/r.offsetWidth),r.offsetHeight&&(c=l.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),i.transform=i.webkitTransform=`translate(${s/a}px,${o/c}px)`,i.transitionDuration="0s",e}}function ou(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Np(e,t,n){const s=e.cloneNode(),o=e[is];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:i}=Qc(s);return r.removeChild(s),i}const Mo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return pe(t)?n=>po(t,n):t};function Op(e){e.target.composing=!0}function Yl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ss=Symbol("_assign");function Xl(e,t,n){return t&&(e=e.trim()),n&&(e=Qo(e)),e}const ut={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[ss]=Mo(o);const r=s||o.props&&o.props.type==="number";On(e,t?"change":"input",i=>{i.target.composing||e[ss](Xl(e.value,n,r))}),(n||r)&&On(e,"change",()=>{e.value=Xl(e.value,n,r)}),t||(On(e,"compositionstart",Op),On(e,"compositionend",Yl),On(e,"change",Yl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[ss]=Mo(i),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?Qo(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},Ql={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,On(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Qo(Lo(r)):Lo(r));e[ss](e.multiple?Jo(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,Ot(()=>{e._assigning=!1})}),e[ss]=Mo(s)},mounted(e,{value:t}){ea(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ss]=Mo(n)},updated(e,{value:t}){e._assigning||ea(e,t)}};function ea(e,t){const n=e.multiple,s=pe(t);if(!(n&&!s&&!Jo(t))){for(let o=0,r=e.options.length;o<r;o++){const i=e.options[o],l=Lo(i);if(n)if(s){const a=typeof l;a==="string"||a==="number"?i.selected=t.some(c=>String(c)===String(l)):i.selected=Cd(t,l)>-1}else i.selected=t.has(l);else if(zs(Lo(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Lo(e){return"_value"in e?e._value:e.value}const Dp=["ctrl","shift","alt","meta"],Bp={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)=>Dp.some(n=>e[`${n}Key`]&&!t.includes(n))},At=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i<t.length;i++){const l=Bp[t[i]];if(l&&l(o,t))return}return e(o,...r)}))},jp={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Os=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const r=Rn(o.key);if(t.some(i=>i===r||jp[i]===r))return e(o)}))},Up=Xe({patchProp:$p},ap);let ta;function Gp(){return ta||(ta=Fh(Up))}const Fp=((...e)=>{const t=Gp().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Hp(s);if(!o)return;const r=t._component;!ye(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,zp(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function zp(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hp(e){return We(e)?document.querySelector(e):e}function so(e,t,n,s){return e===n&&t===s}function qp(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 Wp(e){return{objective:e.objective,completionCriterion:e.completionCriterion,replace:e.replace,budgets:e.budgets}}function Vp(e){return{objective:e.objective,budgets:e.budgets}}function Kp(e,t,n){return e!==0&&n.epoch!==e?"resync":n.seq<=t?"duplicate":"apply"}function Zp(e,t){return t.type==="goal.updated"?{...e,goal:t.snapshot}:t.type==="todo.updated"?{...e,todos:t.todos}:e}function Jp(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 Ds=N([]);let Yp=0;function Xp(e,t="info",n=3500){const s=`toast_${++Yp}`;Ds.value=[...Ds.value,{id:s,type:t,message:e}],n>0&&window.setTimeout(()=>ru(s),n)}function ru(e){Ds.value=Ds.value.filter(t=>t.id!==e)}function iu(){return{toasts:Ds,showToast:Xp,removeToast:ru}}function Qp(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 $e="/api/v1",eg=2*3e4;function tg(){const{showToast:e}=iu(),t=N("connecting"),n=N([]),s=N(!1),o=N(void 0),r=N([]),i=N({busy:!1}),l=N(null),a=N([]),c=N(!1),u=N(null),d=N(!1),h=N(null),p=N(null),g=N(null),_=X(()=>i.value.busy||d.value),k=N([]),w=N(null),x=N(!1),$=X(()=>p.value!==null&&!x.value),A=N(null),F=N([]),Q=N(null),C=N([]),R=N([]),P=N(null),J=N([]),ie=N(null),z=N([]),ve=N(""),O=N(null),L=N(null),te=N(!1);let q=null,ge=null,Ae=null,ke=null,ae=Date.now(),Ce=0,Te=0,Rt=0,Ke=0,Ze=0,xt=0,mt=0,Gt=0,ne=0,ce=null,m=!1,S=null,I=!1,G=!1;const B=new Map;let j=0,se=0,V=null,Y=0;const U=new Map;function ue(){const T=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws`;return w.value?`${T}?sessionId=${encodeURIComponent(w.value)}`:T}function oe(v){t.value=v}function le(v){(q==null?void 0:q.readyState)===WebSocket.OPEN&&q.send(JSON.stringify(v))}function fe(){c.value=m||ce!==null}function _e(){ne++,ce=null,m=!1,S=null,c.value=!1,u.value=null}function Me(v,T){if(v!==null&&typeof v=="object"){const K=v.message;if(typeof K=="string")return K}return T}function Ie(){G||ke!==null||(ke=window.setTimeout(()=>{ke=null;const v=S;S=null,Pe(v??void 0)},250))}async function Pe(v){const T=p.value;if(!T)return;const K=n.value.length===0?100:void 0,W=Ke,he=Ze,we=xt,Fe=mt;try{const He=await fetch(`${$e}/sessions/${T}/snapshot${K?`?tail=${K}`:""}`);if(!He.ok){v!==void 0&&(ce==null?void 0:ce.generation)===v&&(S=v,Ie());return}const Et=await He.json();if(!qp({snapshot:Et,targetSessionId:T,currentSessionId:p.value,targetSessionGeneration:W,currentSessionGeneration:Ke,targetConnectionGeneration:he,currentConnectionGeneration:Ze,targetPromptGeneration:we,currentPromptGeneration:xt,targetLiveGeneration:Fe,currentLiveGeneration:mt,currentEpoch:Te,currentSeq:Ce})){v!==void 0&&(S=v),Ie();return}Qe(Et,v)}catch{v!==void 0&&(ce==null?void 0:ce.generation)===v&&(S=v,Ie())}}function Qe(v,T){var pl;rt="",Kt="",Zt.clear();const K=n.value.filter(Pt=>Pt.local),W=B.keys().next().value,he=W?B.get(W):void 0,we=he?n.value.find(Pt=>Pt.id===he.messageId):void 0,Fe=!!(W&&v.messages.some(Pt=>Pt.clientMessageId===W)),He=!!(he&&!Fe&&he.connectionGeneration<Ze);He&&we&&(we.isError=!0);const Et=we&&!Fe?[we]:[];n.value=[...v.messages.map(Pt=>({...Pt,id:Pt.id??et()})),...K,...Et];for(let Pt=n.value.length-1;Pt>=0;Pt--){const Xs=(pl=n.value[Pt])==null?void 0:pl.turnStats;if(Xs&&typeof Xs.turn=="number"&&Xs.turn>0){j=Xs.turn;break}}r.value=v.pendingApprovals,i.value={...v.status,busy:v.busy},s.value=!!v.olderAvailable,o.value=v.oldestSeq,l.value=v.goal,a.value=v.todos,T!==void 0&&ce!==null&&ce.generation===T&&ne===T&&(ce=null,fe()),(Fe||He)&&(d.value=!1,I=!1,B.clear(),He&&e("消息未送达,已恢复连接。","error")),Ce=v.seq,Te=v.epoch,g.value=v.workDir}function et(){return`msg_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function It(v){Ft(),ae=Date.now(),ge=window.setInterval(()=>{if(Date.now()-ae>eg){q==null||q.close();return}le({type:"ping"})},v)}function Ft(){ge!==null&&(clearInterval(ge),ge=null)}function Zs(){if(G||Ae!==null)return;oe("reconnecting"),Rt++;const v=Math.min(1e3*2**Rt,3e4);Ae=window.setTimeout(()=>{Ae=null,Jt()},v)}function vt(v){switch(v.type){case"server_hello":{const T=v;p.value=T.sessionId,g.value=T.workDir,w.value=T.sessionId,x.value=T.active;const K=Te;Te=T.epoch,It(T.heartbeat_ms),le({type:"client_hello",lastSeq:Ce,epoch:K}),K!==0&&K!==T.epoch&&(Ce=0),oe("connected"),Rt=0,T.active?(Pe(),Vn(),Js()):mf(T.sessionId).then(W=>{W&&p.value===T.sessionId&&(x.value=!0),Pe(),Vn(),Js()});break}case"event":{const T=Kp(Te,Ce,v);if(T==="resync"){Te=v.epoch,Ce=0,Pe();break}if(T==="duplicate")break;Ce=v.seq,Te=v.epoch,mt++,af(v.payload);break}case"user_message":{if(mt++,v.clientMessageId&&B.has(v.clientMessageId)){I=!0;break}n.value.push({id:et(),role:"user",content:v.text,clientMessageId:v.clientMessageId,tools:[],ts:Date.now()});break}case"approval_request":{mt++,r.value=[...r.value,{id:v.id,toolName:v.toolName,action:v.action,display:v.display}];break}case"approval_resolved":{mt++,r.value=r.value.filter(T=>T.id!==v.id);break}case"command_result":{const T=v.pendingMsgId?n.value.findIndex(K=>K.id===v.pendingMsgId):-1;if(T>=0){const K=n.value[T];n.value[T]={...K,content:v.message,isError:!v.ok,pending:!1}}else n.value.push({id:et(),role:"system",content:v.message,tools:[],isError:!v.ok,ts:Date.now(),local:!0});(v.command==="fork"||v.command==="title")&&Vn(),v.ok&&v.command==="compact"&&Pe();break}case"resync_required":{Ce=0,Pe();break}case"status":{mt++,i.value={...i.value,...v.status};break}case"error":{if(h.value=v.message,v.clientMessageId){const T=B.get(v.clientMessageId);if(T){B.delete(v.clientMessageId),d.value=!1,I=!1;const K=n.value.find(W=>W.id===T.messageId);K&&(K.isError=!0),e(`消息未发送:${v.message}`,"error")}}break}case"server_empty":{oe("idle");break}}}let rt="",Kt="";const Zt=new Map;let ll=!1;function lf(){if(ll)return;const v=Wn();if(!v){rt="",Kt="",Zt.clear();return}if(rt&&(v.content+=rt,rt=""),Kt){const T=v.tools.find(K=>K.name==="thinking");T?T.output=(T.output??"")+Kt:v.tools.push({toolCallId:"thinking",name:"thinking",output:Kt}),Kt=""}if(Zt.size>0){for(const[T,K]of Zt){const W=v.tools.find(he=>he.toolCallId===T);W&&(W.output=K)}Zt.clear()}}const qn=Qp(lf);function af(v){var K;const T=Zp({goal:l.value,todos:a.value},v);switch(l.value=T.goal,a.value=T.todos,v.type==="goal.updated"&&ce!==null&&ce.generation===ne&&(ce=null,S=null,fe()),v.type){case"turn.started":{I&&(d.value=!1,I=!1,B.clear()),qn.flushNow(),i.value={...i.value,busy:!0},j+=1,se=Date.now(),V=null,Y=0,U.clear(),n.value.push({id:et(),role:"assistant",content:"",tools:[],ts:Date.now(),model:i.value.model,turnStats:{turn:j,step:0,status:"running",firstTokenMs:null,llmMs:0,toolMs:0,tokens:null,tokensPerSec:null}});break}case"assistant.delta":{V===null&&(V=Date.now()),rt+=String(v.delta),qn.schedule();break}case"thinking.delta":{V===null&&(V=Date.now()),Kt+=String(v.delta),qn.schedule();break}case"tool.call.started":{const W=Wn();W&&(W.tools.push({toolCallId:String(v.toolCallId),name:String(v.name),args:v.args}),W.turnStats&&(W.turnStats.step+=1)),U.set(String(v.toolCallId),Date.now());break}case"tool.result":{Zt.delete(String(v.toolCallId));const W=U.get(String(v.toolCallId));W!==void 0&&(Y+=Date.now()-W,U.delete(String(v.toolCallId)));const he=Wn();if(he){const we=he.tools.find(Fe=>Fe.toolCallId===v.toolCallId);we&&(we.output=String(v.output),we.isError=!!v.isError)}break}case"tool.progress":{Zt.set(String(v.toolCallId),String(v.message??v.output)),qn.schedule();break}case"turn.ended":{if(qn.flushNow(),i.value={...i.value,busy:!1},v.reason==="failed"){const He=Wn();He&&(He.isError=!0),h.value=Me(v.error,"Turn failed")}const W=Wn(),he=Date.now()-se,we=(K=i.value.usage)==null?void 0:K.currentTurn,Fe=we?we.inputOther+we.output+we.inputCacheRead+we.inputCacheCreation:null;W&&W.turnStats&&(W.turnStats.status="done",W.turnStats.llmMs=he,W.turnStats.toolMs=Y,W.turnStats.firstTokenMs=V!==null?V-se:null,W.turnStats.tokens=Fe,W.turnStats.tokensPerSec=Fe!==null&&he>0?Math.round(Fe/he*1e3):null),Vn(),Js();break}case"session.meta.updated":{const W={};v.model!==void 0&&(W.model=v.model),v.contextTokens!==void 0&&(W.contextTokens=v.contextTokens),v.maxContextTokens!==void 0&&(W.maxContextTokens=v.maxContextTokens),v.contextUsage!==void 0&&(W.contextUsage=v.contextUsage),i.value={...i.value,...W};break}case"agent.status.updated":{const W={};if(v.model!==void 0&&(W.model=v.model),v.thinkingLevel!==void 0&&(W.thinkingLevel=v.thinkingLevel),v.contextTokens!==void 0&&(W.contextTokens=v.contextTokens),v.maxContextTokens!==void 0&&(W.maxContextTokens=v.maxContextTokens),v.contextUsage!==void 0&&(W.contextUsage=v.contextUsage),v.usage!==void 0){W.usage=v.usage;const he=v.usage;if(he!=null&&he.currentTurn){const we=Wn(),Fe=he.currentTurn.inputOther+he.currentTurn.output+he.currentTurn.inputCacheRead+he.currentTurn.inputCacheCreation;we!=null&&we.turnStats&&we.turnStats.status==="done"&&we.turnStats.tokens===null&&(we.turnStats.tokens=Fe,we.turnStats.tokensPerSec=we.turnStats.llmMs?Math.round(Fe/we.turnStats.llmMs*1e3):null)}}i.value={...i.value,...W};break}case"error":{h.value=Me(v.error,"Unknown error");break}}}function Wn(){for(let v=n.value.length-1;v>=0;v--)if(n.value[v].role==="assistant")return n.value[v];return null}function cf(){if(!G){if(Ae!==null&&(clearTimeout(Ae),Ae=null),q!==null){try{q.close()}catch{}q=null}Rt=0,Jt()}}async function uf(){var K;const v=p.value,T=o.value;if(!v||T===void 0)return 0;try{const W=await fetch(`${$e}/sessions/${v}/messages?before=${T}&tail=50`);if(!W.ok)return 0;const he=await W.json();if(he.messages.length===0)return 0;const we=he.messages.map(Fe=>({...Fe,id:Fe.id??et()}));return n.value=[...we,...n.value],o.value=((K=we[0])==null?void 0:K.seq)??T,s.value=he.hasMore,we.length}catch{return 0}}function Jt(){if(G||q&&(q.readyState===WebSocket.CONNECTING||q.readyState===WebSocket.OPEN))return;oe("connecting"),h.value=null,_e(),Ze++;const v=new WebSocket(ue());q=v,v.onclose=T=>{if(q===v&&(q=null,Ft(),t.value!=="idle")){if(T.code===1008){Ke++,_e(),p.value=null,w.value=null,x.value=!1,l.value=null,a.value=[],oe("idle");return}oe("disconnected"),Zs()}},v.onerror=()=>{q===v&&oe("reconnecting")},v.onmessage=T=>{if(q!==v)return;ae=Date.now();let K;try{K=JSON.parse(T.data)}catch{return}vt(K)}}function ff(v){if(!v||_.value)return;if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,正在尝试重连...","error"),Jt();return}const T=`client_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,K=et();B.set(T,{messageId:K,connectionGeneration:Ze}),xt++,I=!1,d.value=!0,n.value.push({id:K,role:"user",content:v,clientMessageId:T,tools:[],ts:Date.now()}),le({type:"prompt",text:v,clientMessageId:T})}function df(){le({type:"abort"})}function hf(v,T){if(t.value==="idle"){e("暂无会话,请先新建会话。","warning");return}if(t.value!=="connected"){e("连接已断开,命令未发送。","error"),Jt();return}if(_.value&&v!=="btw"){e(`会话忙碌中,无法执行 /${v},请稍后再试。`,"warning");return}const K=["compact","plan","auto","yes","fork","title"];let W=null;K.includes(v)&&(W=et(),n.value.push({id:W,role:"system",content:`正在执行 /${v}${T?` ${T}`:""}...`,tools:[],pending:!0,ts:Date.now(),local:!0})),le({type:"command",command:v,...T?{args:T}:{},...W?{pendingMsgId:W}:{}})}function pf(){n.value=[],r.value=[]}function al(v){n.value.push({id:et(),role:"system",content:v,tools:[],ts:Date.now(),local:!0})}function gf(v,T,K,W){if(t.value!=="connected"){e("连接已断开,审批结果未发送。","error"),Jt();return}r.value=r.value.filter(he=>he.id!==v),le({type:"approval_response",id:v,decision:T,...K?{feedback:K}:{},...W?{scope:W}:{}})}async function Vn(){try{const v=await fetch(`${$e}/sessions`);if(!v.ok)return;k.value=await v.json()}catch{}}async function mf(v){const T=Ke,K=Ze;try{return(await fetch(`${$e}/sessions/${v}/activate`,{method:"POST"})).ok&&Ze===K&&so(p.value,Ke,v,T)}catch{return!1}}async function Js(){try{const v=await fetch(`${$e}/git/status`);if(!v.ok)return;const T=await v.json();A.value=T.isRepo?T:null}catch{}}async function cl(){try{const v=await fetch(`${$e}/models`);if(!v.ok)return;const T=await v.json();F.value=T.models}catch{}}const yr=N({});async function vf(){try{const v=await fetch(`${$e}/like`);if(!v.ok)return;yr.value=await v.json()}catch{}}async function yf(v){try{return(await fetch(`${$e}/like`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})).ok?(yr.value=v,!0):!1}catch{return!1}}async function ul(v,T,K){const W=p.value;if(!W)return;const he=Ke,we=Ze,Fe=++Gt;try{const He=await fetch(`${$e}/sessions/${W}/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),Et=await He.json();if(p.value!==W||Ke!==he||Ze!==we||Gt!==Fe)return;if(!He.ok){e(Et.message??`请求失败(HTTP ${He.status})`,"error");return}Et.status&&(i.value={...i.value,...Et.status}),al(K)}catch(He){if(p.value!==W||Ke!==he||Ze!==we||Gt!==Fe)return;e(`请求失败:${He instanceof Error?He.message:String(He)}`,"error")}}async function bf(v){v!==i.value.model&&await ul("model",{model:v},`已切换模型:${v}`)}async function kf(v){v!==i.value.thinkingLevel&&await ul("thinking",{level:v},`思考强度已切换为 ${v}`)}async function Ys(v,T,K,W){const he=p.value;if(!he)return u.value="暂无可操作的会话。",null;if(t.value!=="connected")return u.value="连接已断开,请等待重连后再试。",null;if($.value)return u.value="当前会话已归档,无法修改 Goal。",null;if(m)return u.value="正在处理上一个请求,请稍候。",null;ce!==null&&(ce=null,fe());const we=Ke,Fe=++ne;m=!0,fe(),u.value=null;try{const He=await fetch(`${$e}/sessions/${he}/goal${v}`,{method:T,headers:{"Content-Type":"application/json"},body:JSON.stringify(K)}),Et=await He.json().catch(()=>({}));return!so(p.value,Ke,he,we)||ne!==Fe?null:He.ok?(W&&(ce={generation:Fe},S=Fe),Et):(u.value=typeof Et.message=="string"?Et.message:`请求失败(HTTP ${He.status})`,null)}catch(He){return so(p.value,Ke,he,we)&&ne===Fe&&(u.value=`请求失败:${He instanceof Error?He.message:String(He)}`),null}finally{so(p.value,Ke,he,we)&&ne===Fe&&(m=!1,fe())}}async function wf(v){const T=await Ys("/refine","POST",{description:v},!1);return typeof(T==null?void 0:T.objective)=="string"?T.objective:null}async function _f(v){return await Ys("","POST",Wp(v),!0)===null?!1:(ce!==null&&Pe(ce.generation),!0)}async function Sf(v){return await Ys("","PATCH",Vp(v),!0)===null?!1:(ce!==null&&Pe(ce.generation),!0)}async function br(v){return await Ys(v,"POST",{},!0)===null?!1:(ce!==null&&Pe(ce.generation),!0)}function xf(){return br("/pause")}function Cf(){return br("/resume")}function $f(){return br("/cancel")}async function Tf(){try{const v=await fetch(`${$e}/sessions`,{method:"POST"});if(!v.ok){e(`新建会话失败(HTTP ${v.status})`,"error");return}const T=await v.json();k.value=[T,...k.value],await kr(T.sessionId)}catch(v){e(`新建会话失败:${v instanceof Error?v.message:String(v)}`,"error")}}async function kr(v){w.value===v&&t.value==="connected"||(w.value=v,p.value=v,Ke++,_e(),Ce=0,Te=0,n.value=[],r.value=[],i.value={busy:!1},l.value=null,a.value=[],Q.value=null,C.value=[],R.value=[],P.value=null,J.value=[],ie.value=null,z.value=[],ve.value="",x.value=!1,d.value=!1,I=!1,B.clear(),Ae!==null&&(clearTimeout(Ae),Ae=null),ke!==null&&(clearTimeout(ke),ke=null),q&&(q.onclose=null,q.close(),q=null),Ft(),Jt())}async function Af(v){try{const T=await fetch(`${$e}/sessions/${v}`,{method:"DELETE"});if(!T.ok){e(`删除会话失败(HTTP ${T.status})`,"error");return}if(k.value=k.value.filter(K=>K.sessionId!==v),w.value===v){const K=k.value[0];K?await kr(K.sessionId):(Ke++,_e(),p.value=null,w.value=null,x.value=!1,Ce=0,Te=0,n.value=[],r.value=[],i.value={busy:!1},l.value=null,a.value=[],Q.value=null,C.value=[],R.value=[],P.value=null,J.value=[],ie.value=null,z.value=[],ve.value="",d.value=!1,I=!1,B.clear(),q&&(q.onclose=null,q.close(),q=null),Ft(),oe("idle"))}}catch(T){e(`删除会话失败:${T instanceof Error?T.message:String(T)}`,"error")}}async function Rf(v){try{const T=await fetch(`${$e}/sessions/${v}/export`);if(!T.ok){e(`导出会话失败(HTTP ${T.status})`,"error");return}const K=await T.blob(),W=URL.createObjectURL(K),he=document.createElement("a");he.href=W,he.download=`${v}.md`,he.click(),URL.revokeObjectURL(W)}catch(T){e(`导出会话失败:${T instanceof Error?T.message:String(T)}`,"error")}}async function us(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/status`);if(!T.ok)return;const K=await T.json();i.value={...i.value,...K}}catch{}}async function If(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/usage`);if(!T.ok)return;const K=await T.json();i.value={...i.value,usage:K}}catch{}}async function Ef(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/context`);if(!T.ok)return;const K=await T.json();K.tokenCount!==void 0&&(i.value={...i.value,contextTokens:K.tokenCount})}catch{}}async function Pf(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/plan`);if(!T.ok)return;Q.value=await T.json()}catch{}}async function Mf(){const v=p.value;if(!v)return!1;try{return(await fetch(`${$e}/sessions/${v}/plan/clear`,{method:"POST"})).ok?(Q.value=null,!0):!1}catch{return!1}}async function at(v,T){const K=p.value;if(!K)return!1;if(t.value!=="connected")return e("连接已断开,操作未发送。","error"),Jt(),!1;try{const W=await fetch(`${$e}/sessions/${K}/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T??{})});if(!W.ok){const he=await W.json().catch(()=>({}));return e(he.message??`操作失败(HTTP ${W.status})`,"error"),!1}return!0}catch(W){return e(`操作失败:${W instanceof Error?W.message:String(W)}`,"error"),!1}}async function Lf(v){const T=await at("permission",{mode:v});return T&&await us(),T}async function Nf(v,T){const K=await at("plan",{enabled:v,...T?{strategy:T}:{}});return K&&await us(),K}async function Of(v){const T=await at("wolfpack",{enabled:v});return T&&await us(),T}async function Df(v,T){const K=await at("rlm",{enabled:v,...T!==void 0?{maxDepth:T}:{}});return K&&await us(),K}async function Bf(v=1){return at("undo",{count:v})}async function jf(v){return at("compact",v?{instruction:v}:{})}async function Uf(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/skills`);if(!T.ok)return;C.value=await T.json()}catch{}}async function Gf(v,T){return at(`skills/${encodeURIComponent(v)}/activate`,T?{args:T}:{})}async function Ff(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${$e}/sessions/${T}/skills/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(C.value=C.value.filter(W=>W.name!==v),!0):!1}catch{return!1}}async function wr(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/plugins`);if(!T.ok)return;R.value=await T.json()}catch{}}async function zf(v){const T=p.value;if(T)try{const K=await fetch(`${$e}/sessions/${T}/plugins/${encodeURIComponent(v)}`);if(!K.ok)return;P.value=await K.json()}catch{}}async function Hf(v){const T=p.value;if(!T)return null;try{const K=await fetch(`${$e}/sessions/${T}/plugins/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:v})});if(!K.ok)return null;const W=await K.json();return await wr(),W}catch{return null}}async function qf(v,T){return at(`plugins/${encodeURIComponent(v)}/enable`,{enabled:T})}async function Wf(v,T,K){return at(`plugins/${encodeURIComponent(v)}/mcp/${encodeURIComponent(T)}/enable`,{enabled:K})}async function Vf(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${$e}/sessions/${T}/plugins/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(R.value=R.value.filter(W=>W.id!==v),!0):!1}catch{return!1}}async function Kf(){const v=p.value;if(!v)return null;try{const T=await fetch(`${$e}/sessions/${v}/plugins/reload`,{method:"POST"});if(!T.ok)return null;const K=await T.json();return await wr(),K}catch{return null}}async function Zf(v){return at(`plugins/${encodeURIComponent(v)}/activate`)}async function Jf(v){return at(`plugins/${encodeURIComponent(v)}/deactivate`)}async function Yf(v){return at(`plugins/${encodeURIComponent(v)}/inject`)}async function Xf(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/mcp`);if(!T.ok)return;J.value=await T.json()}catch{}}async function Qf(){const v=p.value;if(v)try{const T=await fetch(`${$e}/sessions/${v}/mcp/startup-metrics`);if(!T.ok)return;ie.value=await T.json()}catch{}}async function ed(v,T){return at("mcp/add",{name:v,config:T})}async function td(v){return at(`mcp/${encodeURIComponent(v)}/reconnect`)}async function nd(v){return at(`mcp/${encodeURIComponent(v)}/stop`)}async function sd(v){const T=p.value;if(!T)return!1;try{return(await fetch(`${$e}/sessions/${T}/mcp/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(J.value=J.value.filter(W=>W.name!==v),!0):!1}catch{return!1}}async function od(v,T){const K=p.value;if(K)try{const W=new URLSearchParams;v!==void 0&&W.set("activeOnly",String(v)),T!==void 0&&W.set("limit",String(T));const he=W.toString(),we=await fetch(`${$e}/sessions/${K}/tasks${he?`?${he}`:""}`);if(!we.ok)return;z.value=await we.json()}catch{}}async function rd(v,T){const K=p.value;if(K)try{const W=T!==void 0?`?tail=${T}`:"",he=await fetch(`${$e}/sessions/${K}/tasks/${encodeURIComponent(v)}/output${W}`);if(!he.ok)return;const we=await he.json();ve.value=we.output}catch{}}async function id(v,T){return at(`tasks/${encodeURIComponent(v)}/stop`,T?{reason:T}:{})}async function fl(){try{const v=await fetch(`${$e}/config`);if(!v.ok)return;O.value=await v.json()}catch{}}async function ld(v){try{const T=await fetch(`${$e}/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patch:v})});return T.ok?(O.value=await T.json(),!0):!1}catch{return!1}}async function ad(v){try{return(await fetch(`${$e}/config/providers/${encodeURIComponent(v)}`,{method:"DELETE"})).ok?(await fl(),!0):!1}catch{return!1}}async function cd(){try{const v=await fetch(`${$e}/experimental-flags`);if(!v.ok)return;L.value=await v.json()}catch{}}async function ud(){try{if(!(await fetch(`${$e}/preflight`)).ok)return;te.value=!0}catch{}}Jt(),Vn(),cl();const dl=()=>{Jt()},hl=()=>{!document.hidden&&t.value!=="connected"&&Jt()};return window.addEventListener("online",dl),document.addEventListener("visibilitychange",hl),Vt(()=>{G=!0,ll=!0,qn.dispose(),window.removeEventListener("online",dl),document.removeEventListener("visibilitychange",hl),Ft(),Ae!==null&&(clearTimeout(Ae),Ae=null),ke!==null&&(clearTimeout(ke),ke=null),q&&(q.onclose=null,q.close(),q=null)}),{connectionStatus:t,messages:n,pendingApprovals:r,status:i,goal:l,todos:a,goalRequestPending:c,goalRequestError:u,error:h,sessionId:p,workDir:g,isBusy:_,isArchived:$,sessions:k,currentSessionId:w,gitStatus:A,models:F,like:yr,fetchLike:vf,updateLike:yf,sendPrompt:ff,sendCommand:hf,clearMessages:pf,appendSystemMessage:al,abort:df,resolveApproval:gf,fetchSessions:Vn,fetchGitStatus:Js,fetchModels:cl,reconnectNow:cf,olderAvailable:s,oldestSeq:o,loadOlderMessages:uf,switchModel:bf,switchThinking:kf,refineGoal:wf,createGoal:_f,updateGoal:Sf,pauseGoal:xf,resumeGoal:Cf,cancelGoal:$f,createSession:Tf,switchSession:kr,deleteSession:Af,exportSession:Rf,fetchSnapshot:Pe,fetchSessionStatus:us,fetchSessionUsage:If,fetchSessionContext:Ef,fetchSessionPlan:Pf,sessionPlan:Q,clearPlan:Mf,switchPermission:Lf,switchPlanMode:Nf,switchWolfpack:Of,switchRlm:Df,undoHistory:Bf,compact:jf,skills:C,fetchSkills:Uf,activateSkill:Gf,removeSkill:Ff,plugins:R,pluginInfo:P,fetchPlugins:wr,fetchPluginInfo:zf,installPlugin:Hf,setPluginEnabled:qf,setPluginMcpServerEnabled:Wf,removePlugin:Vf,reloadPlugins:Kf,activatePlugin:Zf,deactivatePlugin:Jf,injectPlugin:Yf,mcpServers:J,mcpStartupMetrics:ie,fetchMcpServers:Xf,fetchMcpStartupMetrics:Qf,addMcpServer:ed,reconnectMcpServer:td,stopMcpServer:nd,removeMcpServer:sd,backgroundTasks:z,backgroundTaskOutput:ve,fetchBackgroundTasks:od,fetchBackgroundTaskOutput:rd,stopBackgroundTask:id,config:O,fetchConfig:fl,setConfig:ld,removeProvider:ad,experimentalFlags:L,fetchExperimentalFlags:cd,preflightOk:te,preflight:ud}}const fr=[{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 ng(e){const t=e.toLowerCase();return fr.filter(n=>{var s;return n.name.startsWith(t)||((s=n.aliases)==null?void 0:s.some(o=>o.startsWith(t)))})}function sg(e){const t=e.toLowerCase(),n=fr.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 lu(){return["可用命令:",...fr.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 og=["type","disabled"],rg=Se({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(y(),b("button",{class:de(["ui-btn",[`ui-btn--${e.variant}`,`ui-btn--${e.size}`]]),type:e.type,disabled:e.disabled},[mo(t.$slots,"default",{},void 0)],10,og))}}),xe=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Jn=xe(rg,[["__scopeId","data-v-746fbd2d"]]),ig={key:0,class:"approval-card"},lg={class:"approval-header"},ag={class:"approval-title"},cg={class:"tool-name"},ug={class:"action-summary"},fg={key:0,class:"approval-count"},dg={class:"approval-action"},hg={key:0,class:"feedback-area"},pg={class:"approval-buttons"},gg={key:0,class:"busy-indicator","aria-label":"处理中"},mg=Se({__name:"ApprovalCard",props:{approvals:{}},emits:["resolve"],setup(e,{emit:t}){const n=e,s=t,o=N(!1),r=N(!1),i=N(""),l=N(new Set),a=X(()=>n.approvals[0]);Oe(()=>n.approvals.map(g=>g.id).join(","),()=>{r.value=!1,i.value="";const g=new Set(n.approvals.map(_=>_.id));l.value=new Set([...l.value].filter(_=>g.has(_)))});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 l.value.has(g)}function d(g,_,k){const w=a.value;!w||u(w.id)||(l.value=new Set([...l.value,w.id]),s("resolve",w.id,g,_,k))}function h(){const g=i.value.trim();g&&d("rejected",g)}function p(g){if(!a.value||o.value)return;const k=g.target;if(k&&(k.tagName==="TEXTAREA"||k.tagName==="INPUT")){r.value&&g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),h());return}switch(g.key){case"1":g.preventDefault(),d("approved",void 0,"once");break;case"2":g.preventDefault(),d("approved",void 0,"session");break;case"3":g.preventDefault(),d("rejected");break;case"4":g.preventDefault(),r.value=!r.value;break}}return Ut(()=>window.addEventListener("keydown",p)),Vt(()=>window.removeEventListener("keydown",p)),(g,_)=>e.approvals.length?(y(),b("div",ig,[o.value?(y(),b("button",{key:0,class:"approval-minibar",onClick:_[0]||(_[0]=k=>o.value=!1)}," ⚠ "+E(e.approvals.length)+" 个待审批请求 — 点击展开 ",1)):a.value?(y(),b(ee,{key:1},[f("div",lg,[_[7]||(_[7]=f("span",{class:"approval-icon"},"⚠",-1)),f("span",ag,[f("span",cg,E(a.value.toolName),1),f("span",ug,E(c(a.value)),1)]),e.approvals.length>1?(y(),b("span",fg,"+"+E(e.approvals.length-1),1)):D("",!0),f("button",{class:"icon-btn",title:"最小化","aria-label":"最小化",onClick:_[1]||(_[1]=k=>o.value=!0)},"—")]),f("pre",dg,E(c(a.value)),1),r.value?(y(),b("div",hg,[Ye(f("textarea",{"onUpdate:modelValue":_[2]||(_[2]=k=>i.value=k),class:"feedback-input",rows:"2",name:"approval-feedback","aria-label":"拒绝反馈",placeholder:"输入反馈,Enter 提交(将作为拒绝原因反馈给 Agent)"},null,512),[[ut,i.value]])])):D("",!0),f("div",pg,[Z(Jn,{variant:"primary",disabled:u(a.value.id),onClick:_[3]||(_[3]=k=>d("approved",void 0,"once"))},{default:$t(()=>[..._[8]||(_[8]=[f("kbd",null,"1",-1),Re(" 批准 ",-1)])]),_:1},8,["disabled"]),Z(Jn,{variant:"secondary",disabled:u(a.value.id),onClick:_[4]||(_[4]=k=>d("approved",void 0,"session"))},{default:$t(()=>[..._[9]||(_[9]=[f("kbd",null,"2",-1),Re(" 会话批准 ",-1)])]),_:1},8,["disabled"]),Z(Jn,{variant:"danger",disabled:u(a.value.id),onClick:_[5]||(_[5]=k=>d("rejected"))},{default:$t(()=>[..._[10]||(_[10]=[f("kbd",null,"3",-1),Re(" 拒绝 ",-1)])]),_:1},8,["disabled"]),Z(Jn,{variant:"secondary",class:de({"feedback-active":r.value}),disabled:u(a.value.id),onClick:_[6]||(_[6]=k=>r.value=!r.value)},{default:$t(()=>[..._[11]||(_[11]=[f("kbd",null,"4",-1),Re(" 反馈 ",-1)])]),_:1},8,["class","disabled"]),u(a.value.id)?(y(),b("span",gg,[..._[12]||(_[12]=[f("span",{class:"spinner"},null,-1),Re(" 处理中… ",-1)])])):D("",!0)])],64)):D("",!0)])):D("",!0)}}),vg=xe(mg,[["__scopeId","data-v-fa5dc764"]]),yg=["title","aria-label"],bg=["width","height","viewBox"],kg=["cx","cy","r"],wg=["cx","cy","r","stroke-dasharray","stroke-dashoffset","transform"],Mr=2,_g=Se({__name:"ContextRing",props:{usage:{default:void 0},size:{default:16}},setup(e){hp(a=>({v1d95ffa8:l.value}));const t=e,n=X(()=>{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=X(()=>Math.round(n.value*100)),o=X(()=>(t.size-Mr)/2),r=X(()=>2*Math.PI*o.value),i=X(()=>r.value*(1-n.value)),l=X(()=>n.value>=.9?"var(--color-danger)":n.value>=.7?"var(--color-warning)":"var(--color-accent)");return(a,c)=>(y(),b("span",{class:"context-ring",role:"img",title:`上下文占用 ${s.value}%`,"aria-label":`上下文占用 ${s.value}%`},[(y(),b("svg",{width:e.size,height:e.size,viewBox:`0 0 ${e.size} ${e.size}`},[f("circle",{class:"ring-track",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Mr,fill:"none"},null,8,kg),f("circle",{class:"ring-value",cx:e.size/2,cy:e.size/2,r:o.value,"stroke-width":Mr,fill:"none","stroke-linecap":"round","stroke-dasharray":r.value,"stroke-dashoffset":i.value,transform:`rotate(-90 ${e.size/2} ${e.size/2})`},null,8,wg)],8,bg))],8,yg))}}),au=xe(_g,[["__scopeId","data-v-3ffc343b"]]),Sg=["onKeydown"],xg={key:0,class:"picker-empty"},Cg={class:"picker-group-title"},$g=["onClick"],Tg={class:"row-main"},Ag={class:"row-name"},Rg={class:"row-alias"},Ig={class:"row-meta"},Eg={key:0,class:"row-check"},Pg={class:"picker-thinking"},Mg={class:"thinking-options"},Lg=["onClick"],Ng=Se({__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:"最大"},i=N(""),l=N(null);Ut(()=>{var C;(C=l.value)==null||C.focus()});const a=X(()=>{const C=i.value.trim().toLowerCase();return C?n.models.filter(R=>R.alias.toLowerCase().includes(C)||R.provider.toLowerCase().includes(C)||(R.displayName??"").toLowerCase().includes(C)):n.models}),c=X(()=>{const C=new Map;for(const R of a.value){const P=C.get(R.provider)??[];P.push(R),C.set(R.provider,P)}return[...C.entries()].map(([R,P])=>({provider:R,models:P}))}),u=X(()=>n.models.find(C=>C.alias===n.currentModel)),d=X(()=>{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 _=N(null);function k(C){_.value&&!_.value.contains(C.target)&&s("close")}Ut(()=>document.addEventListener("mousedown",k,!0)),Vt(()=>document.removeEventListener("mousedown",k,!0));function w(C){C!==n.currentModel&&s("apply-model",C),s("close")}const x=N(null);function $(){const C=x.value;return C?Array.from(C.querySelectorAll(".picker-row")):[]}function A(){var C;(C=$()[0])==null||C.focus()}function F(C){var J,ie,z;if(C.key!=="ArrowDown"&&C.key!=="ArrowUp")return;const R=$();if(R.length===0)return;const P=R.indexOf(document.activeElement);C.preventDefault(),P===-1?(J=R[0])==null||J.focus():C.key==="ArrowDown"?(ie=R[(P+1)%R.length])==null||ie.focus():(z=R[(P-1+R.length)%R.length])==null||z.focus()}function Q(C){C!==n.currentThinking&&s("apply-thinking",C)}return(C,R)=>(y(),b("div",{ref_key:"rootRef",ref:_,class:"model-picker",role:"dialog","aria-label":"模型选择",onKeydown:R[1]||(R[1]=Os(At(P=>s("close"),["stop"]),["esc"]))},[Ye(f("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":R[0]||(R[0]=P=>i.value=P),class:"picker-search",type:"text",placeholder:"搜索模型…",id:"model-search-input",name:"model-search",autocomplete:"off",spellcheck:"false",onKeydown:Os(At(A,["prevent"]),["arrow-down"])},null,40,Sg),[[ut,i.value]]),f("div",{ref_key:"listRef",ref:x,class:"picker-list",onKeydown:F},[c.value.length===0?(y(),b("div",xg,"无匹配模型")):D("",!0),(y(!0),b(ee,null,Ve(c.value,P=>(y(),b("div",{key:P.provider,class:"picker-group"},[f("div",Cg,E(P.provider),1),(y(!0),b(ee,null,Ve(P.models,J=>(y(),b("button",{key:J.alias,class:de(["picker-row",{active:J.alias===e.currentModel}]),onClick:ie=>w(J.alias)},[f("span",Tg,[f("span",Ag,E(g(J)),1),f("span",Rg,E(J.alias),1)]),f("span",Ig,E(p(J.maxContextSize)),1),J.alias===e.currentModel?(y(),b("span",Eg,"✓")):D("",!0)],10,$g))),128))]))),128))],544),f("div",Pg,[R[2]||(R[2]=f("span",{class:"thinking-label"},"思考强度",-1)),f("div",Mg,[(y(!0),b(ee,null,Ve(d.value,P=>(y(),b("button",{key:P,class:de(["thinking-btn",{active:P===e.currentThinking}]),onClick:J=>Q(P)},E(h(P)),11,Lg))),128))])])],544))}}),Og=xe(Ng,[["__scopeId","data-v-438275ef"]]),Dg={class:"slash-menu",role:"listbox","aria-label":"斜杠命令"},Bg=["aria-selected","onMousedown","onMouseenter"],jg={class:"slash-name"},Ug={key:0,class:"slash-aliases"},Gg={class:"slash-desc"},Fg={key:0,class:"slash-badge slash-badge-input"},zg={key:1,class:"slash-badge"},Hg=Se({__name:"SlashMenu",props:{commands:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const n=t;return(s,o)=>(y(),b("div",Dg,[(y(!0),b(ee,null,Ve(e.commands,(r,i)=>{var l;return y(),b("button",{key:r.name,class:de(["slash-item",{active:i===e.activeIndex}]),role:"option","aria-selected":i===e.activeIndex,onMousedown:At(a=>n("select",r),["prevent"]),onMouseenter:a=>n("hover",i)},[f("span",jg,[Re("/"+E(r.name),1),(l=r.aliases)!=null&&l.length?(y(),b("span",Ug,E(r.aliases.map(a=>`/${a}`).join(" ")),1)):D("",!0)]),f("span",Gg,E(r.description),1),r.acceptsInput?(y(),b("span",Fg,"输入参数")):D("",!0),r.target==="backend"?(y(),b("span",zg,"服务端")):D("",!0)],42,Bg)}),128)),o[0]||(o[0]=f("div",{class:"slash-hint"},"↑↓ 选择 · Enter/Tab 执行 · Esc 关闭",-1))]))}}),qg=xe(Hg,[["__scopeId","data-v-6983799d"]]),Wg=["width","height"],Vg={key:0,d:"M4 7h16M4 12h16M4 17h16"},Kg={key:1,d:"M12 5v14M5 12h14"},Zg={key:5,d:"M4 6h16M7 12h10M10 18h4"},Jg={key:6,d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"},Yg={key:7,d:"M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5"},Xg={key:8,d:"M3 12h4l2-7 4 14 2-7h6"},Qg={key:10,d:"m15 18-6-6 6-6"},em={key:11,d:"m9 18 6-6-6-6"},tm={key:12,d:"m6 9 6 6 6-6"},nm={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"},sm={key:18,d:"M5 9a11 11 0 0 1 14 0M8.5 12.5a6 6 0 0 1 7 0M12 17h.01"},om={key:19,d:"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4Z"},rm={key:20,d:"M12 16V4m0 0-4 4m4-4 4 4M5 20h14"},im={key:21,d:"m15 4 5 5M17.5 6.5 10 14m-2-2 4 4-3 4H3l1-6Z"},lm={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"},am={key:24,d:"m22 2-7 20-4-9-9-4ZM22 2 11 13"},cm={key:25,x:"6",y:"6",width:"12",height:"12",rx:"2"},um={key:26,d:"m8 3 4 4 4-4M8 21l4-4 4 4M12 7v10"},fm={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"},dm={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"},hm={key:31,d:"M20 13 13 20l-9-9V4h7ZM8.5 8.5h.01"},pm={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"},gm={key:34,d:"M3 6h7l2 2h9v11H3Z"},mm={key:35,d:"m5 12 4 4L19 6"},vm={key:39,d:"M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6"},ym={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"},bm={key:47,d:"M12 19V5m0 0-6 6m6-6 6 6"},km={key:48,d:"M18 6 6 18M6 6l12 12"},wm=Se({__name:"SvgIcon",props:{name:{},size:{default:20}},setup(e){return(t,n)=>(y(),b("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"?(y(),b("path",Vg)):e.name==="plus"?(y(),b("path",Kg)):e.name==="panel-left"?(y(),b(ee,{key:2},[n[0]||(n[0]=f("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[1]||(n[1]=f("path",{d:"M9 4v16"},null,-1))],64)):e.name==="panel-right"?(y(),b(ee,{key:3},[n[2]||(n[2]=f("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[3]||(n[3]=f("path",{d:"M15 4v16"},null,-1))],64)):e.name==="search"?(y(),b(ee,{key:4},[n[4]||(n[4]=f("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[5]||(n[5]=f("path",{d:"m20 20-4-4"},null,-1))],64)):e.name==="filter"?(y(),b("path",Zg)):e.name==="download"?(y(),b("path",Jg)):e.name==="trash"?(y(),b("path",Yg)):e.name==="activity"?(y(),b("path",Xg)):e.name==="help"?(y(),b(ee,{key:9},[n[6]||(n[6]=f("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[7]||(n[7]=f("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"?(y(),b("path",Qg)):e.name==="chevron-right"?(y(),b("path",em)):e.name==="chevron-down"?(y(),b("path",tm)):e.name==="bot"?(y(),b(ee,{key:13},[n[8]||(n[8]=f("rect",{x:"4",y:"7",width:"16",height:"12",rx:"3"},null,-1)),n[9]||(n[9]=f("path",{d:"M12 3v4M8 12h.01M16 12h.01M9 16h6"},null,-1))],64)):e.name==="git-branch"?(y(),b(ee,{key:14},[n[10]||(n[10]=f("circle",{cx:"6",cy:"5",r:"2"},null,-1)),n[11]||(n[11]=f("circle",{cx:"18",cy:"7",r:"2"},null,-1)),n[12]||(n[12]=f("circle",{cx:"6",cy:"19",r:"2"},null,-1)),n[13]||(n[13]=f("path",{d:"M6 7v10M8 10c5 0 3-3 8-3"},null,-1))],64)):e.name==="sun"?(y(),b(ee,{key:15},[n[14]||(n[14]=f("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[15]||(n[15]=f("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"?(y(),b("path",nm)):e.name==="monitor"?(y(),b(ee,{key:17},[n[16]||(n[16]=f("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"},null,-1)),n[17]||(n[17]=f("path",{d:"M8 21h8M12 17v4"},null,-1))],64)):e.name==="wifi"?(y(),b("path",sm)):e.name==="edit"?(y(),b("path",om)):e.name==="upload"?(y(),b("path",rm)):e.name==="broom"?(y(),b("path",im)):e.name==="command"?(y(),b("path",lm)):e.name==="at"?(y(),b(ee,{key:23},[n[18]||(n[18]=f("circle",{cx:"12",cy:"12",r:"4"},null,-1)),n[19]||(n[19]=f("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"?(y(),b("path",am)):e.name==="stop"?(y(),b("rect",cm)):e.name==="compact"?(y(),b("path",um)):e.name==="brain"?(y(),b("path",fm)):e.name==="clipboard"?(y(),b(ee,{key:28},[n[20]||(n[20]=f("rect",{x:"5",y:"4",width:"14",height:"17",rx:"2"},null,-1)),n[21]||(n[21]=f("path",{d:"M9 4V2h6v2M9 10h6M9 14h6"},null,-1))],64)):e.name==="fork"?(y(),b(ee,{key:29},[n[22]||(n[22]=f("circle",{cx:"6",cy:"4",r:"2"},null,-1)),n[23]||(n[23]=f("circle",{cx:"18",cy:"6",r:"2"},null,-1)),n[24]||(n[24]=f("circle",{cx:"6",cy:"20",r:"2"},null,-1)),n[25]||(n[25]=f("path",{d:"M6 6v12M8 10c6 0 4-4 8-4"},null,-1))],64)):e.name==="message-circle"?(y(),b("path",dm)):e.name==="tag"?(y(),b("path",hm)):e.name==="sparkles"?(y(),b("path",pm)):e.name==="terminal"?(y(),b(ee,{key:33},[n[26]||(n[26]=f("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},null,-1)),n[27]||(n[27]=f("path",{d:"m7 9 3 3-3 3m5 0h5"},null,-1))],64)):e.name==="folder"?(y(),b("path",gm)):e.name==="check"?(y(),b("path",mm)):e.name==="speaker"?(y(),b(ee,{key:36},[n[28]||(n[28]=f("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[29]||(n[29]=f("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"},null,-1)),n[30]||(n[30]=f("path",{d:"M18 6a8.5 8.5 0 0 1 0 12"},null,-1))],64)):e.name==="speaker-off"?(y(),b(ee,{key:37},[n[31]||(n[31]=f("path",{d:"M11 5 6 9H3v6h3l5 4V5z"},null,-1)),n[32]||(n[32]=f("path",{d:"m16 9 5 6M21 9l-5 6"},null,-1))],64)):e.name==="copy"?(y(),b(ee,{key:38},[n[33]||(n[33]=f("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1)),n[34]||(n[34]=f("path",{d:"M16 8V4H4v12h4"},null,-1))],64)):e.name==="refresh"?(y(),b("path",vm)):e.name==="target"?(y(),b(ee,{key:40},[n[35]||(n[35]=f("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[36]||(n[36]=f("circle",{cx:"12",cy:"12",r:"5"},null,-1)),n[37]||(n[37]=f("circle",{cx:"12",cy:"12",r:"1"},null,-1))],64)):e.name==="settings"?(y(),b(ee,{key:41},[n[38]||(n[38]=f("circle",{cx:"12",cy:"12",r:"3"},null,-1)),n[39]||(n[39]=f("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"?(y(),b(ee,{key:42},[n[40]||(n[40]=f("path",{d:"M3 10.5 12 3l9 7.5"},null,-1)),n[41]||(n[41]=f("path",{d:"M5 9.5V21h14V9.5"},null,-1))],64)):e.name==="bell"?(y(),b(ee,{key:43},[n[42]||(n[42]=f("path",{d:"M6 9a6 6 0 1 1 12 0c0 5 2 6 2 6H4s2-1 2-6"},null,-1)),n[43]||(n[43]=f("path",{d:"M10 19a2 2 0 0 0 4 0"},null,-1))],64)):e.name==="book"?(y(),b(ee,{key:44},[n[44]||(n[44]=f("path",{d:"M4 5a2 2 0 0 1 2-2h13v18H6a2 2 0 0 0-2 2Z"},null,-1)),n[45]||(n[45]=f("path",{d:"M6 3v18"},null,-1))],64)):e.name==="layers"?(y(),b(ee,{key:45},[n[46]||(n[46]=f("path",{d:"m12 3 9 5-9 5-9-5Z"},null,-1)),n[47]||(n[47]=f("path",{d:"m3 13 9 5 9-5"},null,-1))],64)):e.name==="wrench"?(y(),b("path",ym)):e.name==="arrow-up"?(y(),b("path",bm)):e.name==="x"?(y(),b("path",km)):e.name==="file"?(y(),b(ee,{key:49},[n[48]||(n[48]=f("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]=f("path",{d:"M14 2v6h6"},null,-1))],64)):D("",!0)],8,Wg))}}),be=xe(wm,[["__scopeId","data-v-86a0768c"]]),_m=["placeholder"],Sm={class:"composer-footer"},xm={class:"composer-quick-actions"},Cm=["title"],$m={key:3,class:"queue-label",title:"运行结束后自动发送"},Tm={class:"composer-actions"},Am=["disabled","title"],Rm={key:1,class:"context-label",title:"上下文使用率"},Im=["disabled"],Em=Se({__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=N(""),i=N(null),l=N(0),a=N(!1),c=X(()=>{const m=r.value;return!m.startsWith("/")||m.includes(`
|
|
19
|
+
`)||/\s/.test(m.slice(1))?null:m.slice(1)}),u=X(()=>c.value===null?[]:ng(c.value)),d=X(()=>c.value!==null&&u.value.length>0&&!a.value);Oe(c,()=>{l.value=0,a.value=!1});function h(m){const S=m??u.value[l.value];if(S){if(S.acceptsInput){r.value=`/${S.name} `,a.value=!0,Ot(()=>{var I;(I=i.value)==null||I.focus(),C()});return}$(`/${S.name}`),J(),o("command",S.name)}}const p=N([]);Oe(()=>s.sessionId,()=>{p.value=[]}),Oe(()=>s.busy,m=>{if(!m&&p.value.length>0){const[S,...I]=p.value;p.value=I,S&&o("send",S)}});const g=N([]),_=N(-1),k=N("");function w(){return`scream-history:${s.sessionId??"default"}`}function x(){try{const m=localStorage.getItem(w());g.value=m?JSON.parse(m):[]}catch{g.value=[]}_.value=-1}function $(m){if(g.value.at(-1)!==m){g.value=[...g.value,m].slice(-50);try{localStorage.setItem(w(),JSON.stringify(g.value))}catch{}}_.value=-1,k.value=""}function A(m,S){const I=i.value;if(!I)return;const G=I.value.slice(0,I.selectionStart??0),B=I.value.slice(I.selectionEnd??0);if(!(m===-1&&G.includes(`
|
|
20
|
+
`))&&!(m===1&&B.includes(`
|
|
21
|
+
`))){if(m===-1){if(g.value.length===0)return;S.preventDefault(),_.value===-1?(k.value=r.value,_.value=g.value.length-1):_.value>0&&_.value--,r.value=g.value[_.value]??""}else{if(_.value===-1)return;S.preventDefault(),_.value<g.value.length-1?(_.value++,r.value=g.value[_.value]??""):(_.value=-1,r.value=k.value)}Ot(()=>{I.selectionStart=I.selectionEnd=I.value.length})}}function F(){return`scream-draft:${s.sessionId??"default"}`}let Q;Oe(r,()=>{C(),clearTimeout(Q),Q=setTimeout(()=>{try{r.value?localStorage.setItem(F(),r.value):localStorage.removeItem(F())}catch{}},300)}),Oe(()=>s.sessionId,()=>{clearTimeout(Q),x();let m="";try{m=localStorage.getItem(F())??""}catch{m=""}r.value=m,Ot(C)},{immediate:!0});function C(){const m=i.value;if(!m)return;m.style.height="auto";const S=Math.round(window.innerHeight*.25);m.style.height=`${Math.min(Math.max(m.scrollHeight,36),S)}px`}const R=N(0);function P(){const m=window.visualViewport;if(!m)return;const S=Math.round(window.innerHeight-m.height-m.offsetTop);R.value=S>120?S:0}"visualViewport"in window&&(Ut(()=>{var m;(m=window.visualViewport)==null||m.addEventListener("resize",P),P()}),Vt(()=>{var m;(m=window.visualViewport)==null||m.removeEventListener("resize",P),R.value=0}));function J(){r.value="",Ot(()=>{i.value&&(i.value.style.height="auto")})}function ie(){const m=r.value.trim();if(m){if(m.startsWith("/")){const S=m.indexOf(" "),I=(S===-1?m.slice(1):m.slice(1,S)).toLowerCase(),G=sg(I),B=S===-1?"":m.slice(S+1).trim();$(m),o("command",G,B),J();return}if(s.busy){z();return}$(m),o("send",m),J()}}function z(){const m=r.value.trim();m&&(p.value=[...p.value,m],J())}function ve(m){if(d.value){if(m.key==="ArrowUp"){m.preventDefault(),l.value=(l.value-1+u.value.length)%u.value.length;return}if(m.key==="ArrowDown"){m.preventDefault(),l.value=(l.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(),z();return}if(m.key==="Enter"&&!m.shiftKey){if(m.isComposing)return;m.preventDefault(),ie();return}m.key==="ArrowUp"?A(-1,m):m.key==="ArrowDown"&&A(1,m)}function O(){p.value=[],o("abort")}function L(m){r.value=m,Ot(()=>{var S;C(),(S=i.value)==null||S.focus()})}function te(m){r.value+=m,Ot(()=>{var S;C(),(S=i.value)==null||S.focus()})}t({insertText:L,openModelPicker:Ze});const q=X(()=>{var m;return(m=s.status)==null?void 0:m.model}),ge=X(()=>{var m;return(m=s.status)==null?void 0:m.permission}),Ae=X(()=>{var m;return(m=s.status)==null?void 0:m.contextUsage}),ke=X(()=>s.placeholder??(s.busy?"回合进行中:Enter/Ctrl+S 排队消息,随下一轮注入":"输入消息,@ 提及,/ 触发指令")),ae=N(!1),Ce={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},Te=X(()=>{var m;return(m=s.status)==null?void 0:m.thinkingLevel}),Rt=X(()=>{const m=Te.value;return!m||m==="none"?"":Ce[m]??m}),Ke=X(()=>s.models.length>0);function Ze(){return Ke.value?(ae.value=!0,!0):!1}function xt(){Ke.value&&(ae.value=!ae.value)}function mt(m){o("switch-model",m)}function Gt(m){o("switch-thinking",m)}const ne=X(()=>{switch(ge.value){case"auto":return"perm-auto";case"yolo":return"perm-yolo";default:return"perm-manual"}}),ce=X(()=>{switch(ge.value){case"auto":return"自动";case"yolo":return"YOLO";default:return"手动"}});return(m,S)=>(y(),b("div",{class:"composer",style:ln(R.value?{paddingBottom:R.value+"px"}:void 0)},[d.value?(y(),qe(qg,{key:0,commands:u.value,"active-index":l.value,onSelect:h,onHover:S[0]||(S[0]=I=>l.value=I)},null,8,["commands","active-index"])):D("",!0),Ye(f("textarea",{ref_key:"textareaRef",ref:i,"onUpdate:modelValue":S[1]||(S[1]=I=>r.value=I),id:"composer-input",name:"message",class:"composer-input",rows:"1",placeholder:ke.value,onKeydown:ve},null,40,_m),[[ut,r.value]]),f("div",Sm,[f("div",xm,[e.variant==="home"?(y(),b("button",{key:0,class:"quick-action",title:"插入 / 触发指令",onClick:S[2]||(S[2]=I=>te("/"))},[Z(be,{name:"command",size:15}),S[6]||(S[6]=f("span",null,"技能",-1))])):(y(),b(ee,{key:1},[f("button",{class:"quick-action",title:"插入 @ 提及",onClick:S[3]||(S[3]=I=>te("@"))},[Z(be,{name:"at",size:15}),S[7]||(S[7]=f("span",null,"提及",-1))]),f("button",{class:"quick-action",title:"插入 / 触发指令",onClick:S[4]||(S[4]=I=>te("/"))},[Z(be,{name:"command",size:15}),S[8]||(S[8]=f("span",null,"指令",-1))])],64)),ge.value?(y(),b("span",{key:2,class:de(["permission-label",ne.value]),title:`权限模式:${ge.value}`},E(ce.value),11,Cm)):D("",!0),p.value.length?(y(),b("span",$m,"已排队 "+E(p.value.length)+" 条",1)):D("",!0)]),f("div",Tm,[q.value?(y(),b("button",{key:0,class:de(["model-select",{clickable:Ke.value}]),disabled:!Ke.value,title:e.variant==="home"?`当前模型:${q.value}`:`当前模型:${q.value}`,onClick:xt},[Z(be,{name:"brain",size:15}),f("span",null,E(e.variant==="home"?"通用智能体":q.value),1),e.variant!=="home"&&Rt.value?(y(),b(ee,{key:0},[Re(" · "+E(Rt.value),1)],64)):D("",!0),Ke.value?(y(),qe(be,{key:1,name:"chevron-down",size:12})):D("",!0)],10,Am)):D("",!0),Z(ur,{name:"picker"},{default:$t(()=>[ae.value?(y(),qe(Og,{key:0,models:e.models,"current-model":q.value,"current-thinking":Te.value,onApplyModel:mt,onApplyThinking:Gt,onClose:S[5]||(S[5]=I=>ae.value=!1)},null,8,["models","current-model","current-thinking"])):D("",!0)]),_:1}),Ae.value!==void 0?(y(),b("span",Rm,[Z(au,{usage:Ae.value,size:15},null,8,["usage"])])):D("",!0),e.busy?(y(),b("button",{key:2,class:"stop-btn",title:"停止当前回合",onClick:O},[Z(be,{name:"stop",size:14}),S[9]||(S[9]=f("span",null,"停止",-1))])):(y(),b("button",{key:3,class:"send-btn",disabled:!r.value.trim(),title:"发送 (Enter)","aria-label":"发送",onClick:ie},[Z(be,{name:"arrow-up",size:16})],8,Im))])])],4))}}),cu=xe(Em,[["__scopeId","data-v-655218be"]]),Pm={class:"conv-bar"},Mm={class:"conv-bar-left"},Lm=["title"],Nm=["title"],Om={key:1,class:"title-text"},Dm={class:"conv-bar-right"},Bm=["title","aria-label"],jm=Se({__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=N(!1),r=N("");function i(){r.value=n.title??"",o.value=!0}function l(){const u=r.value.trim();o.value=!1,u&&u!==n.title&&s("rename",u)}function a(u){u.key==="Enter"?(u.preventDefault(),l()):u.key==="Escape"&&(u.preventDefault(),o.value=!1)}const c=X(()=>n.busy?"运行中":"就绪");return(u,d)=>(y(),b("header",Pm,[f("div",Mm,[f("button",{class:"ghost-btn back-btn",title:"返回工作台","aria-label":"返回工作台",onClick:d[0]||(d[0]=h=>s("home"))},[Z(be,{name:"chevron-left",size:20})]),f("span",{class:de(["status-dot",{busy:e.busy}]),title:c.value,"aria-hidden":"true"},null,10,Lm),f("button",{class:"title-btn",title:o.value?"":"点击重命名",onClick:i},[o.value?Ye((y(),b("input",{key:0,"onUpdate:modelValue":d[1]||(d[1]=h=>r.value=h),class:"title-input","aria-label":"会话标题",onKeydown:a,onBlur:l,onClick:d[2]||(d[2]=At(()=>{},["stop"]))},null,544)),[[ut,r.value]]):(y(),b("span",Om,E(e.title||"新会话"),1))],8,Nm)]),f("div",Dm,[f("button",{class:"ghost-btn",title:"导出 Markdown","aria-label":"导出 Markdown",onClick:d[3]||(d[3]=h=>s("export"))},[Z(be,{name:"download",size:18})]),f("button",{class:"ghost-btn",title:"清空本地消息","aria-label":"清空本地消息",onClick:d[4]||(d[4]=h=>s("clear"))},[Z(be,{name:"broom",size:18})]),f("button",{class:de(["ghost-btn",{active:e.drawerOpen}]),title:e.drawerOpen?"收起详情":"会话详情","aria-label":e.drawerOpen?"收起详情":"会话详情",onClick:d[5]||(d[5]=h=>s("toggle-drawer"))},[Z(be,{name:"panel-right",size:18})],10,Bm)])]))}}),Um=xe(jm,[["__scopeId","data-v-eccc6b36"]]),Gm={key:0,class:"ui-dialog-header"},Fm={class:"ui-dialog-title"},zm={class:"ui-dialog-body"},Hm={key:1,class:"ui-dialog-footer"},qm='a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Wm=Se({__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=N(null);let r=null;function i(){const a=o.value;return a?Array.from(a.querySelectorAll(qm)).filter(c=>c.offsetParent!==null||c===document.activeElement):[]}function l(a){var p,g,_;if(!n.open)return;if(a.key==="Escape"&&n.closable!==!1){a.stopPropagation(),s("close");return}if(a.key!=="Tab")return;const c=i();if(c.length===0){a.preventDefault(),(p=o.value)==null||p.focus();return}const u=c[0],d=c[c.length-1],h=document.activeElement;a.shiftKey?(h===u||!((g=o.value)!=null&&g.contains(h)))&&(a.preventDefault(),d.focus()):(h===d||!((_=o.value)!=null&&_.contains(h)))&&(a.preventDefault(),u.focus())}return Oe(()=>n.open,a=>{a?(r=document.activeElement instanceof HTMLElement?document.activeElement:null,Ot(()=>{const c=i()[0]??o.value;c==null||c.focus()})):r&&(r.focus(),r=null)},{immediate:!1}),Ut(()=>window.addEventListener("keydown",l,!0)),Vt(()=>window.removeEventListener("keydown",l,!0)),(a,c)=>(y(),qe(Mi,{to:"body"},[Z(ur,{name:"dialog"},{default:$t(()=>[e.open?(y(),b("div",{key:0,class:"ui-dialog-overlay",onClick:c[1]||(c[1]=At(u=>e.closable!==!1&&s("close"),["self"]))},[f("div",{ref_key:"dialogRef",ref:o,class:"ui-dialog",style:ln(e.maxWidth?{maxWidth:e.maxWidth}:void 0),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||a.$slots.header?(y(),b("div",Gm,[mo(a.$slots,"header",{},()=>[f("span",Fm,E(e.title),1)],!0),e.closable!==!1?(y(),b("button",{key:0,class:"ui-dialog-close","aria-label":"关闭",onClick:c[0]||(c[0]=u=>s("close"))},"✕")):D("",!0)])):D("",!0),f("div",zm,[mo(a.$slots,"default",{},void 0,!0)]),a.$slots.footer?(y(),b("div",Hm,[mo(a.$slots,"footer",{},void 0,!0)])):D("",!0)],4)])):D("",!0)]),_:3})]))}}),Vm=xe(Wm,[["__scopeId","data-v-396acebf"]]),Km={class:"info-row"},Zm={class:"info-val mono"},Jm={class:"info-row"},Ym={class:"info-val mono"},Xm={class:"info-row"},Qm={class:"info-val"},ev={class:"info-row"},tv={class:"info-val"},nv={class:"info-row"},sv={class:"info-val"},ov={class:"info-row"},rv={class:"info-val"},iv={class:"info-row"},lv={class:"info-val"},av={class:"info-row"},cv={class:"info-val"},uv={class:"info-row"},fv={class:"info-val"},dv={class:"info-row"},hv={class:"info-val"},pv={key:0,class:"info-row"},gv={class:"info-val"},mv={key:1,class:"info-row"},vv={class:"info-val"},yv={class:"info-val mono"},bv={class:"info-val"},kv={key:3,class:"info-empty"},wv=Se({__name:"InfoPanel",props:{mode:{},status:{},sessionId:{},workDir:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,o=X(()=>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 i(p){return p?"开启":"关闭"}function l(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 d(p){return p!=null&&p.byModel?Object.entries(p.byModel).map(([g,_])=>({model:g,tokens:u(_),output:_.output,cacheRead:_.inputCacheRead})):[]}const h=X(()=>l(n.status.usage)||l(n.status.contextTokens));return(p,g)=>(y(),qe(Vm,{open:!0,title:o.value,onClose:g[0]||(g[0]=_=>s("close"))},{default:$t(()=>{var _,k;return[e.mode==="status"?(y(),b(ee,{key:0},[f("div",Km,[g[1]||(g[1]=f("span",{class:"info-key"},"会话 ID",-1)),f("span",Zm,E(e.sessionId??"-"),1)]),f("div",Jm,[g[2]||(g[2]=f("span",{class:"info-key"},"工作目录",-1)),f("span",Ym,E(e.workDir??"-"),1)]),f("div",Xm,[g[3]||(g[3]=f("span",{class:"info-key"},"模型",-1)),f("span",Qm,E(e.status.model??"-"),1)]),f("div",ev,[g[4]||(g[4]=f("span",{class:"info-key"},"权限模式",-1)),f("span",tv,E(r(e.status.permission)),1)]),f("div",nv,[g[5]||(g[5]=f("span",{class:"info-key"},"思考级别",-1)),f("span",sv,E(e.status.thinkingLevel??"-"),1)]),f("div",ov,[g[6]||(g[6]=f("span",{class:"info-key"},"计划模式",-1)),f("span",rv,E(i(e.status.planMode)),1)]),f("div",iv,[g[7]||(g[7]=f("span",{class:"info-key"},"WolfPack 模式",-1)),f("span",lv,E(i(e.status.wolfpackMode)),1)]),f("div",av,[g[8]||(g[8]=f("span",{class:"info-key"},"上下文",-1)),f("span",cv,E(a(e.status.contextTokens))+" / "+E(a(e.status.maxContextTokens))+" ("+E(c(e.status.contextUsage))+")",1)])],64)):(y(),b(ee,{key:1},[f("div",uv,[g[9]||(g[9]=f("span",{class:"info-key"},"上下文 Token",-1)),f("span",fv,E(a(e.status.contextTokens))+" / "+E(a(e.status.maxContextTokens)),1)]),f("div",dv,[g[10]||(g[10]=f("span",{class:"info-key"},"上下文占比",-1)),f("span",hv,E(c(e.status.contextUsage)),1)]),(_=e.status.usage)!=null&&_.total?(y(),b("div",pv,[g[11]||(g[11]=f("span",{class:"info-key"},"累计 Token",-1)),f("span",gv,E(a(u(e.status.usage.total))),1)])):D("",!0),(k=e.status.usage)!=null&&k.currentTurn?(y(),b("div",mv,[g[12]||(g[12]=f("span",{class:"info-key"},"当前回合",-1)),f("span",vv,E(a(u(e.status.usage.currentTurn))),1)])):D("",!0),d(e.status.usage).length?(y(),b(ee,{key:2},[g[13]||(g[13]=f("div",{class:"info-subhead"},"按模型",-1)),(y(!0),b(ee,null,Ve(d(e.status.usage),w=>(y(),b("div",{key:w.model,class:"info-row info-row-model"},[f("span",yv,E(w.model),1),f("span",bv,E(a(w.tokens))+"(输出 "+E(a(w.output))+" · 缓存读 "+E(a(w.cacheRead))+")",1)]))),128))],64)):D("",!0),h.value?D("",!0):(y(),b("div",kv,"暂无用量数据"))],64))]}),_:1},8,["title"]))}}),_v=xe(wv,[["__scopeId","data-v-1555711d"]]);function Ui(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zn=Ui();function uu(e){zn=e}var Ts={exec:()=>null};function je(e,t=""){let n=typeof e=="string"?e:e.source;const s={replace:(o,r)=>{let i=typeof r=="string"?r:r.source;return i=i.replace(wt.caret,"$1"),n=n.replace(o,i),s},getRegex:()=>new RegExp(n,t)};return s}var wt={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")},Sv=/^(?:[ \t]*(?:\n|$))+/,xv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Cv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ws=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$v=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gi=/(?:[*+-]|\d{1,9}[.)])/,fu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,du=je(fu).replace(/bull/g,Gi).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(),Tv=je(fu).replace(/bull/g,Gi).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(),Fi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Av=/^[^\n]+/,zi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Rv=je(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Iv=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gi).getRegex(),dr="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",Hi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ev=je("^ {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",Hi).replace("tag",dr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hu=je(Fi).replace("hr",Ws).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",dr).getRegex(),Pv=je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hu).getRegex(),qi={blockquote:Pv,code:xv,def:Rv,fences:Cv,heading:$v,hr:Ws,html:Ev,lheading:du,list:Iv,newline:Sv,paragraph:hu,table:Ts,text:Av},na=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ws).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",dr).getRegex(),Mv={...qi,lheading:Tv,table:na,paragraph:je(Fi).replace("hr",Ws).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",na).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",dr).getRegex()},Lv={...qi,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hi).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:Ts,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(Fi).replace("hr",Ws).replace("heading",` *#{1,6} *[^
|
|
22
|
+
]`).replace("lheading",du).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ov=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pu=/^( {2,}|\\)\n(?!\s*$)/,Dv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hr=/[\p{P}\p{S}]/u,Wi=/[\s\p{P}\p{S}]/u,gu=/[^\s\p{P}\p{S}]/u,Bv=je(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Wi).getRegex(),mu=/(?!~)[\p{P}\p{S}]/u,jv=/(?!~)[\s\p{P}\p{S}]/u,Uv=/(?:[^\s\p{P}\p{S}]|~)/u,Gv=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,vu=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Fv=je(vu,"u").replace(/punct/g,hr).getRegex(),zv=je(vu,"u").replace(/punct/g,mu).getRegex(),yu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Hv=je(yu,"gu").replace(/notPunctSpace/g,gu).replace(/punctSpace/g,Wi).replace(/punct/g,hr).getRegex(),qv=je(yu,"gu").replace(/notPunctSpace/g,Uv).replace(/punctSpace/g,jv).replace(/punct/g,mu).getRegex(),Wv=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gu).replace(/punctSpace/g,Wi).replace(/punct/g,hr).getRegex(),Vv=je(/\\(punct)/,"gu").replace(/punct/g,hr).getRegex(),Kv=je(/^<(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(),Zv=je(Hi).replace("(?:-->|$)","-->").getRegex(),Jv=je("^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",Zv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),No=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Yv=je(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",No).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bu=je(/^!?\[(label)\]\[(ref)\]/).replace("label",No).replace("ref",zi).getRegex(),ku=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",zi).getRegex(),Xv=je("reflink|nolink(?!\\()","g").replace("reflink",bu).replace("nolink",ku).getRegex(),Vi={_backpedal:Ts,anyPunctuation:Vv,autolink:Kv,blockSkip:Gv,br:pu,code:Ov,del:Ts,emStrongLDelim:Fv,emStrongRDelimAst:Hv,emStrongRDelimUnd:Wv,escape:Nv,link:Yv,nolink:ku,punctuation:Bv,reflink:bu,reflinkSearch:Xv,tag:Jv,text:Dv,url:Ts},Qv={...Vi,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",No).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",No).getRegex()},ii={...Vi,emStrongRDelimAst:qv,emStrongLDelim:zv,url:je(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ey={...ii,br:je(pu).replace("{2,}","*").getRegex(),text:je(ii.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},oo={normal:qi,gfm:Mv,pedantic:Lv},gs={normal:Vi,gfm:ii,breaks:ey,pedantic:Qv},ty={"&":"&","<":"<",">":">",'"':""","'":"'"},sa=e=>ty[e];function Qt(e,t){if(t){if(wt.escapeTest.test(e))return e.replace(wt.escapeReplace,sa)}else if(wt.escapeTestNoEncode.test(e))return e.replace(wt.escapeReplaceNoEncode,sa);return e}function oa(e){try{e=encodeURI(e).replace(wt.percentDecode,"%")}catch{return null}return e}function ra(e,t){var r;const n=e.replace(wt.findPipe,(i,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(wt.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(wt.slashPipe,"|");return s}function ms(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 ny(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 ia(e,t,n,s,o){const r=t.href,i=t.title||null,l=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:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}function sy(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 i=r.match(n.other.beginningSpace);if(i===null)return r;const[l]=i;return l.length>=o.length?r.slice(o.length):r}).join(`
|
|
24
|
+
`)}var Oo=class{constructor(e){M(this,"options");M(this,"rules");M(this,"lexer");this.options=e||zn}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:ms(n,`
|
|
25
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=sy(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=ms(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:ms(t[0],`
|
|
26
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=ms(t[0],`
|
|
27
|
+
`).split(`
|
|
28
|
+
`),s="",o="";const r=[];for(;n.length>0;){let i=!1;const l=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),i=!0;else if(!i)l.push(n[a]);else break;n=n.slice(a);const c=l.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 d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=d,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
|
+
`),_=this.blockquote(g);r[r.length-1]=_,s=s.substring(0,s.length-p.raw.length)+_.raw,o=o.substring(0,o.length-p.text.length)+_.text;break}else if((h==null?void 0:h.type)==="list"){const p=h,g=p.raw+`
|
|
35
|
+
`+n.join(`
|
|
36
|
+
`),_=this.list(g);r[r.length-1]=_,s=s.substring(0,s.length-h.raw.length)+_.raw,o=o.substring(0,o.length-p.raw.length)+_.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 i=!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 d=t[2].split(`
|
|
38
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),h=e.split(`
|
|
39
|
+
`,1)[0],p=!d.trim(),g=0;if(this.options.pedantic?(g=2,u=d.trimStart()):p?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=d.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 w=this.rules.other.nextBulletRegex(g),x=this.rules.other.hrRegex(g),$=this.rules.other.fencesBeginRegex(g),A=this.rules.other.headingBeginRegex(g),F=this.rules.other.htmlBeginRegex(g);for(;e;){const Q=e.split(`
|
|
41
|
+
`,1)[0];let C;if(h=Q,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),C=h):C=h.replace(this.rules.other.tabCharGlobal," "),$.test(h)||A.test(h)||F.test(h)||w.test(h)||x.test(h))break;if(C.search(this.rules.other.nonSpaceChar)>=g||!h.trim())u+=`
|
|
42
|
+
`+C.slice(g);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(d)||A.test(d)||x.test(d))break;u+=`
|
|
43
|
+
`+h}!p&&!h.trim()&&(p=!0),c+=Q+`
|
|
44
|
+
`,e=e.substring(Q.length+1),d=C.slice(g)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let _=null,k;this.options.gfm&&(_=this.rules.other.listIsTask.exec(u),_&&(k=_[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!_,checked:k,loose:!1,text:u,tokens:[]}),o.raw+=c}const l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.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(d=>d.type==="space"),u=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.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 i;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=ra(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(i=t[3])!=null&&i.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 l of s)this.rules.other.tableAlignRight.test(l)?r.align.push("right"):this.rules.other.tableAlignCenter.test(l)?r.align.push("center"):this.rules.other.tableAlignLeft.test(l)?r.align.push("left"):r.align.push(null);for(let l=0;l<n.length;l++)r.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:r.align[l]});for(const l of o)r.rows.push(ra(l,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=ms(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=ny(t[2],"()");if(r===-2)return;if(r>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).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)),ia(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 ia(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 i,l,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(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){a+=l;continue}else if((s[5]||s[6])&&r%3&&!((r+l)%3)){c+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);const d=[...s[0]][0].length,h=e.slice(0,r+s.index+d+l);if(Math.min(r,l)%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}}}},pn=class li{constructor(t){M(this,"tokens");M(this,"options");M(this,"state");M(this,"tokenizer");M(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||zn,this.options.tokenizer=this.options.tokenizer||new Oo,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:wt,block:oo.normal,inline:gs.normal};this.options.pedantic?(n.block=oo.pedantic,n.inline=gs.pedantic):this.options.gfm&&(n.block=oo.gfm,this.options.breaks?n.inline=gs.breaks:n.inline=gs.gfm),this.tokenizer.rules=n}static get rules(){return{block:oo,inline:gs}}static lex(t,n){return new li(n).lex(t)}static lexInline(t,n){return new li(n).inlineTokens(t)}lex(t){t=t.replace(wt.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,i;for(this.options.pedantic&&(t=t.replace(wt.tabCharGlobal," ").replace(wt.spaceLine,""));t;){let l;if((r=(o=this.options.extensions)==null?void 0:o.block)!=null&&r.some(c=>(l=c.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const c=n.at(-1);l.raw.length===1&&c!==void 0?c.raw+=`
|
|
48
|
+
`:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
49
|
+
`+l.raw,c.text+=`
|
|
50
|
+
`+l.text,this.inlineQueue.at(-1).src=c.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
51
|
+
`+l.raw,c.text+=`
|
|
52
|
+
`+l.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let a=t;if((i=this.options.extensions)!=null&&i.startBlock){let c=1/0;const u=t.slice(1);let d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(a=t.substring(0,c+1))}if(this.state.top&&(l=this.tokenizer.paragraph(a))){const c=n.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
|
|
53
|
+
`+l.raw,c.text+=`
|
|
54
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(l),s=a.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
55
|
+
`+l.raw,c.text+=`
|
|
56
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(l);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 l,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,i="";for(;t;){r||(i=""),r=!1;let u;if((a=(l=this.options.extensions)==null?void 0:l.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,i)){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 d=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(_=>{g=_.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(d=t.substring(0,h+1))}if(u=this.tokenizer.inlineText(d)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(i=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}},Do=class{constructor(e){M(this,"options");M(this,"parser");this.options=e||zn}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const s=(r=(t||"").match(wt.notSpaceStart))==null?void 0:r[0],o=e.replace(wt.endingNewline,"")+`
|
|
57
|
+
`;return s?'<pre><code class="language-'+Qt(s)+'">'+(n?o:Qt(o,!0))+`</code></pre>
|
|
58
|
+
`:"<pre><code>"+(n?o:Qt(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 i=0;i<e.items.length;i++){const l=e.items[i];s+=this.listitem(l)}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+" "+Qt(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 i=0;i<r.length;i++)n+=this.tablecell(r[i]);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>${Qt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),o=oa(e);if(o===null)return s;e=o;let r='<a href="'+e+'"';return t&&(r+=' title="'+Qt(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=oa(e);if(o===null)return Qt(n);e=o;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${Qt(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Qt(e.text)}},Ki=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""}},gn=class ai{constructor(t){M(this,"options");M(this,"renderer");M(this,"textRenderer");this.options=t||zn,this.options.renderer=this.options.renderer||new Do,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ki}static parse(t,n){return new ai(n).parse(t)}static parseInline(t,n){return new ai(n).parseInline(t)}parse(t,n=!0){var o,r;let s="";for(let i=0;i<t.length;i++){const l=t[i];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[l.type]){const c=l,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=l;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(;i+1<t.length&&t[i+1].type==="text";)c=t[++i],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 i=0;i<t.length;i++){const l=t[i];if((r=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&r[l.type]){const c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=c||"";continue}}const a=l;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}},Hr,bo=(Hr=class{constructor(e){M(this,"options");M(this,"block");this.options=e||zn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?pn.lex:pn.lexInline}provideParser(){return this.block?gn.parse:gn.parseInline}},M(Hr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Hr),oy=class{constructor(...e){M(this,"defaults",Ui());M(this,"options",this.setOptions);M(this,"parse",this.parseMarkdown(!0));M(this,"parseInline",this.parseMarkdown(!1));M(this,"Parser",gn);M(this,"Renderer",Do);M(this,"TextRenderer",Ki);M(this,"Lexer",pn);M(this,"Tokenizer",Oo);M(this,"Hooks",bo);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 i=r;for(const l of i.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of i.rows)for(const a of l)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{const i=r;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[i.type]?this.defaults.extensions.childTokens[i.type].forEach(l=>{const a=i[l].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.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(...i){let l=o.renderer.apply(this,i);return l===!1&&(l=r.apply(this,i)),l}: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 Do(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 i=r,l=n.renderer[i],a=o[i];o[i]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=a.apply(o,c)),u||""}}s.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Oo(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 i=r,l=n.tokenizer[i],a=o[i];o[i]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=a.apply(o,c)),u}}s.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new bo;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 i=r,l=n.hooks[i],a=o[i];bo.passThroughHooks.has(r)?o[i]=c=>{if(this.defaults.async)return Promise.resolve(l.call(o,c)).then(d=>a.call(o,d));const u=l.call(o,c);return a.call(o,u)}:o[i]=(...c)=>{let u=l.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(i){let l=[];return l.push(r.call(this,i)),o&&(l=l.concat(o.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pn.lex(e,t??this.defaults)}parser(e,t){return gn.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const o={...s},r={...this.defaults,...o},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(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 l=r.hooks?r.hooks.provideLexer():e?pn.lex:pn.lexInline,a=r.hooks?r.hooks.provideParser():e?gn.parse:gn.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(c=>l(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(i);try{r.hooks&&(n=r.hooks.preprocess(n));let c=l(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 i(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>"+Qt(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Fn=new oy;function De(e,t){return Fn.parse(e,t)}De.options=De.setOptions=function(e){return Fn.setOptions(e),De.defaults=Fn.defaults,uu(De.defaults),De};De.getDefaults=Ui;De.defaults=zn;De.use=function(...e){return Fn.use(...e),De.defaults=Fn.defaults,uu(De.defaults),De};De.walkTokens=function(e,t){return Fn.walkTokens(e,t)};De.parseInline=Fn.parseInline;De.Parser=gn;De.parser=gn.parse;De.Renderer=Do;De.TextRenderer=Ki;De.Lexer=pn;De.lexer=pn.lex;De.Tokenizer=Oo;De.Hooks=bo;De.parse=De;De.options;De.setOptions;De.use;De.walkTokens;De.parseInline;gn.parse;pn.lex;const ry="modulepreload",iy=function(e,t){return new URL(e,t).href},la={},ro=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const l=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=i(n.map(u=>{if(u=iy(u,s),u in la)return;la[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!s)for(let _=l.length-1;_>=0;_--){const k=l[_];if(k.href===u&&(!d||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":ry,d||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),d)return new Promise((_,k)=>{g.addEventListener("load",_),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return o.then(i=>{for(const l of i||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};let ot=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function ly(e){return Zi(e)}function Zi(e){return Array.isArray(e)?ay(e):e instanceof RegExp?e:typeof e=="object"?cy(e):e}function ay(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=Zi(e[n]);return t}function cy(e){let t={};for(let n in e)t[n]=Zi(e[n]);return t}function wu(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function _u(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_u(e.substring(0,e.length-1)):e.substr(~t+1)}var Lr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,io=class{static hasCaptures(e){return e===null?!1:(Lr.lastIndex=0,Lr.test(e))}static replaceCaptures(e,t,n){return e.replace(Lr,(s,o,r,i)=>{let l=n[parseInt(o||r,10)];if(l){let a=t.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(i){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function Su(e,t){return e<t?-1:e>t?1:0}function xu(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=Su(e[o],t[o]);if(r!==0)return r}return 0}return n-s}function aa(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 Cu(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var $u=class{constructor(e){M(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}},Bo=class{constructor(e,t,n){M(this,"_cachedMatchRoot",new $u(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(dy(e),t)}static createFromParsedTheme(e,t){return py(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=>uy(e.parent,o.parentScopes));return s?new Tu(s.fontStyle,s.foreground,s.background):null}},Nr=class ko{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new ko(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new ko(n,t[s]);return n}push(t){return new ko(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 uy(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&&!fy(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function fy(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Tu=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function dy(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 i=t[o];if(!i.settings)continue;let l;if(typeof i.scope=="string"){let d=i.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),l=d.split(",")}else Array.isArray(i.scope)?l=i.scope:l=[""];let a=-1;if(typeof i.settings.fontStyle=="string"){a=0;let d=i.settings.fontStyle.split(" ");for(let h=0,p=d.length;h<p;h++)switch(d[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 i.settings.foreground=="string"&&aa(i.settings.foreground)&&(c=i.settings.foreground);let u=null;typeof i.settings.background=="string"&&aa(i.settings.background)&&(u=i.settings.background);for(let d=0,h=l.length;d<h;d++){let g=l[d].trim().split(" "),_=g[g.length-1],k=null;g.length>1&&(k=g.slice(0,g.length-1),k.reverse()),n[s++]=new hy(_,k,o,a,c,u)}}return n}var hy=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}},pt=(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))(pt||{});function py(e,t){e.sort((a,c)=>{let u=Su(a.scope,c.scope);return u!==0||(u=xu(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 gy(t),i=new Tu(n,r.getId(s),r.getId(o)),l=new vy(new ci(0,null,-1,0,0),[]);for(let a=0,c=e.length;a<c;a++){let u=e[a];l.insert(0,u.scope,u.parentScopes,u.fontStyle,r.getId(u.foreground),r.getId(u.background))}return new Bo(r,i,l)}var gy=class{constructor(e){M(this,"_isFrozen");M(this,"_lastColorId");M(this,"_id2color");M(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)}},my=Object.freeze([]),ci=class Au{constructor(t,n,s,o,r){M(this,"scopeDepth");M(this,"parentScopes");M(this,"fontStyle");M(this,"foreground");M(this,"background");this.scopeDepth=t,this.parentScopes=n||my,this.fontStyle=s,this.foreground=o,this.background=r}clone(){return new Au(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)}},vy=class ui{constructor(t,n=[],s={}){M(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(ui._cmpBySpecificity),n}insert(t,n,s,o,r,i){if(n===""){this._doInsertHere(t,s,o,r,i);return}let l=n.indexOf("."),a,c;l===-1?(a=n,c=""):(a=n.substring(0,l),c=n.substring(l+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new ui(this._mainRule.clone(),ci.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,c,s,o,r,i)}_doInsertHere(t,n,s,o,r){if(n===null){this._mainRule.acceptOverwrite(t,s,o,r);return}for(let i=0,l=this._rulesWithParentScopes.length;i<l;i++){let a=this._rulesWithParentScopes[i];if(xu(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 ci(t,n,s,o,r))}},ls=class Lt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Lt.getLanguageId(t),s=Lt.getTokenType(t),o=Lt.getFontStyle(t),r=Lt.getForeground(t),i=Lt.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:r,background:i})}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,i,l){let a=Lt.getLanguageId(t),c=Lt.getTokenType(t),u=Lt.containsBalancedBrackets(t)?1:0,d=Lt.getFontStyle(t),h=Lt.getForeground(t),p=Lt.getBackground(t);return n!==0&&(a=n),s!==8&&(c=s),o!==null&&(u=o?1:0),r!==-1&&(d=r),i!==0&&(h=i),l!==0&&(p=l),(a<<0|c<<8|u<<10|d<<11|h<<15|p<<24)>>>0}};function jo(e,t){const n=[],s=yy(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=i();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=l();return o===")"&&(o=s.next()),a}if(ca(o)){const a=[];do a.push(o),o=s.next();while(ca(o));return c=>t(a,c)}return null}function i(){const a=[];let c=r();for(;c;)a.push(c),c=r();return u=>a.every(d=>d(u))}function l(){const a=[];let c=i();for(;c&&(a.push(c),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");c=i()}return u=>a.some(d=>d(u))}}function ca(e){return!!e&&!!e.match(/[\w\.:]+/)}function yy(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 Ru(e){typeof e.dispose=="function"&&e.dispose()}var Bs=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},by=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ky=class{constructor(){M(this,"_references",[]);M(this,"_seenReferenceKeys",new Set);M(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))}},wy=class{constructor(e,t){M(this,"seenFullScopeRequests",new Set);M(this,"seenPartialScopeRequests",new Set);M(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Bs(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new ky;for(const n of e)_y(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Bs){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 _y(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 Bs?wo({baseGrammar:r,selfGrammar:o},s):fi(e.ruleName,{baseGrammar:r,selfGrammar:o,repository:o.repository},s);const i=n.injections(e.scopeName);if(i)for(const l of i)s.add(new Bs(l))}function fi(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];Uo([s],t,n)}}function wo(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Uo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Uo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Uo(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?wu({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&Uo(s.patterns,{...t,repository:o},n);const r=s.include;if(!r)continue;const i=Iu(r);switch(i.kind){case 0:wo({...t,selfGrammar:t.baseGrammar},n);break;case 1:wo(t,n);break;case 2:fi(i.ruleName,{...t,repository:o},n);break;case 3:case 4:const l=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){const a={baseGrammar:t.baseGrammar,selfGrammar:l,repository:o};i.kind===4?fi(i.ruleName,a,n):wo(a,n)}else i.kind===4?n.add(new by(i.scopeName,i.ruleName)):n.add(new Bs(i.scopeName));break}}}var Sy=class{constructor(){M(this,"kind",0)}},xy=class{constructor(){M(this,"kind",1)}},Cy=class{constructor(e){M(this,"kind",2);this.ruleName=e}},$y=class{constructor(e){M(this,"kind",3);this.scopeName=e}},Ty=class{constructor(e,t){M(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Iu(e){if(e==="$base")return new Sy;if(e==="$self")return new xy;const t=e.indexOf("#");if(t===-1)return new $y(e);if(t===0)return new Cy(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new Ty(n,s)}}var Ay=/\\(\d+)/,ua=/\\(\d+)/g,Ry=-1,Eu=-2;var Vs=class{constructor(e,t,n,s){M(this,"$location");M(this,"id");M(this,"_nameIsCapturing");M(this,"_name");M(this,"_contentNameIsCapturing");M(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=io.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=io.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${_u(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:io.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:io.replaceCaptures(this._contentName,e,t)}},Iy=class extends Vs{constructor(t,n,s,o,r){super(t,n,s,o);M(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!")}},Ey=class extends Vs{constructor(t,n,s,o,r){super(t,n,s,null);M(this,"_match");M(this,"captures");M(this,"_cachedCompiledPatterns");this._match=new js(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 Us,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},fa=class extends Vs{constructor(t,n,s,o,r){super(t,n,s,o);M(this,"hasMissingPatterns");M(this,"patterns");M(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 Us,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},di=class extends Vs{constructor(t,n,s,o,r,i,l,a,c,u){super(t,n,s,o);M(this,"_begin");M(this,"beginCaptures");M(this,"_end");M(this,"endHasBackReferences");M(this,"endCaptures");M(this,"applyEndPatternLast");M(this,"hasMissingPatterns");M(this,"patterns");M(this,"_cachedCompiledPatterns");this._begin=new js(r,this.id),this.beginCaptures=i,this._end=new js(l||"",-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 Us;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}},Go=class extends Vs{constructor(t,n,s,o,r,i,l,a,c){super(t,n,s,o);M(this,"_begin");M(this,"beginCaptures");M(this,"whileCaptures");M(this,"_while");M(this,"whileHasBackReferences");M(this,"hasMissingPatterns");M(this,"patterns");M(this,"_cachedCompiledPatterns");M(this,"_cachedCompiledWhilePatterns");this._begin=new js(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new js(l,Eu),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 Us;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 Us,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Pu=class ct{static createCaptureRule(t,n,s,o,r){return t.registerRule(i=>new Iy(n,i,s,o,r))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Ey(t.$vscodeTextmateLocation,t.id,t.name,t.match,ct._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=wu({},s,t.repository));let r=t.patterns;return typeof r>"u"&&t.include&&(r=[{include:t.include}]),new fa(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ct._compilePatterns(r,n,s))}return t.while?new Go(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ct._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,ct._compileCaptures(t.whileCaptures||t.captures,n,s),ct._compilePatterns(t.patterns,n,s)):new di(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ct._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,ct._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,ct._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let r=0;for(const i in t){if(i==="$vscodeTextmateLocation")continue;const l=parseInt(i,10);l>r&&(r=l)}for(let i=0;i<=r;i++)o[i]=null;for(const i in t){if(i==="$vscodeTextmateLocation")continue;const l=parseInt(i,10);let a=0;t[i].patterns&&(a=ct.getCompiledRuleId(t[i],n,s)),o[l]=ct.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,a)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let r=0,i=t.length;r<i;r++){const l=t[r];let a=-1;if(l.include){const c=Iu(l.include);switch(c.kind){case 0:case 1:a=ct.getCompiledRuleId(s[l.include],n,s);break;case 2:let u=s[c.ruleName];u&&(a=ct.getCompiledRuleId(u,n,s));break;case 3:case 4:const d=c.scopeName,h=c.kind===4?c.ruleName:null,p=n.getExternalGrammar(d,s);if(p)if(h){let g=p.repository[h];g&&(a=ct.getCompiledRuleId(g,n,p.repository))}else a=ct.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=ct.getCompiledRuleId(l,n,s);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof fa||c instanceof di||c instanceof Go)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(a)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},js=class Mu{constructor(t,n){M(this,"source");M(this,"ruleId");M(this,"hasAnchor");M(this,"hasBackReferences");M(this,"_anchorCache");if(t&&typeof t=="string"){const s=t.length;let o=0,r=[],i=!1;for(let l=0;l<s;l++)if(t.charAt(l)==="\\"&&l+1<s){const c=t.charAt(l+1);c==="z"?(r.push(t.substring(o,l)),r.push("$(?!\\n)(?<!\\n)"),o=l+2):(c==="A"||c==="G")&&(i=!0),l++}this.hasAnchor=i,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=Ay.test(this.source):this.hasBackReferences=!1}clone(){return new Mu(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 ua.lastIndex=0,this.source.replace(ua,(o,r)=>Cu(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,i,l,a;for(r=0,i=this.source.length;r<i;r++)l=this.source.charAt(r),t[r]=l,n[r]=l,s[r]=l,o[r]=l,l==="\\"&&r+1<i&&(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}},Us=class{constructor(){M(this,"_items");M(this,"_hasAnchors");M(this,"_cached");M(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 da(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 da(e,s,this._items.map(o=>o.ruleId))}},da=class{constructor(e,t,n){M(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}},Or=class{constructor(e,t){this.languageId=e,this.tokenType=t}},hn,Py=(hn=class{constructor(t,n){M(this,"_defaultAttributes");M(this,"_embeddedLanguagesMatcher");M(this,"_getBasicScopeAttributes",new $u(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Or(n,s)}));this._defaultAttributes=new Or(t,8),this._embeddedLanguagesMatcher=new My(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?hn._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(hn.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!")}},M(hn,"_NULL_SCOPE_METADATA",new Or(0,0)),M(hn,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),hn),My=class{constructor(e){M(this,"values");M(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,s])=>Cu(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])}},ha=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Lu(e,t,n,s,o,r,i,l){const a=t.content.length;let c=!1,u=-1;if(i){const p=Ly(e,t,n,s,o,r);o=p.stack,s=p.linePos,n=p.isFirstLine,u=p.anchorPosition}const d=Date.now();for(;!c;){if(l!==0&&Date.now()-d>l)return new ha(o,!0);h()}return new ha(o,!1);function h(){const p=Ny(e,t,n,s,o,u);if(!p){r.produce(o,a),c=!0;return}const g=p.captureIndices,_=p.matchedRuleId,k=g&&g.length>0?g[0].end>s:!1;if(_===Ry){const w=o.getRule(e);r.produce(o,g[0].start),o=o.withContentNameScopesList(o.nameScopesList),ws(e,t,n,o,r,w.endCaptures,g),r.produce(o,g[0].end);const x=o;if(o=o.parent,u=x.getAnchorPos(),!k&&x.getEnterPos()===s){o=x,r.produce(o,a),c=!0;return}}else{const w=e.getRule(_);r.produce(o,g[0].start);const x=o,$=w.getName(t.content,g),A=o.contentNameScopesList.pushAttributed($,e);if(o=o.push(_,s,u,g[0].end===a,null,A,A),w instanceof di){const F=w;ws(e,t,n,o,r,F.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const Q=F.getContentName(t.content,g),C=A.pushAttributed(Q,e);if(o=o.withContentNameScopesList(C),F.endHasBackReferences&&(o=o.withEndRule(F.getEndWithResolvedBackReferences(t.content,g))),!k&&x.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(w instanceof Go){const F=w;ws(e,t,n,o,r,F.beginCaptures,g),r.produce(o,g[0].end),u=g[0].end;const Q=F.getContentName(t.content,g),C=A.pushAttributed(Q,e);if(o=o.withContentNameScopesList(C),F.whileHasBackReferences&&(o=o.withEndRule(F.getWhileWithResolvedBackReferences(t.content,g))),!k&&x.hasSameRuleAs(o)){o=o.pop(),r.produce(o,a),c=!0;return}}else if(ws(e,t,n,o,r,w.captures,g),r.produce(o,g[0].end),o=o.pop(),!k){o=o.safePop(),r.produce(o,a),c=!0;return}}g[0].end>s&&(s=g[0].end,n=!1)}}function Ly(e,t,n,s,o,r){let i=o.beginRuleCapturedEOL?0:-1;const l=[];for(let a=o;a;a=a.pop()){const c=a.getRule(e);c instanceof Go&&l.push({rule:c,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:c,findOptions:u}=By(a.rule,e,a.stack.endRule,n,s===i),d=c.findNextMatchSync(t,s,u);if(d){if(d.ruleId!==Eu){o=a.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(r.produce(a.stack,d.captureIndices[0].start),ws(e,t,n,a.stack,r,a.rule.whileCaptures,d.captureIndices),r.produce(a.stack,d.captureIndices[0].end),i=d.captureIndices[0].end,d.captureIndices[0].end>s&&(s=d.captureIndices[0].end,n=!1))}else{o=a.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:i,isFirstLine:n}}function Ny(e,t,n,s,o,r){const i=Oy(e,t,n,s,o,r),l=e.getInjections();if(l.length===0)return i;const a=Dy(l,e,t,n,s,o,r);if(!a)return i;if(!i)return a;const c=i.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:i}function Oy(e,t,n,s,o,r){const i=o.getRule(e),{ruleScanner:l,findOptions:a}=Nu(i,e,o.endRule,n,s===r),c=l.findNextMatchSync(t,s,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Dy(e,t,n,s,o,r,i){let l=Number.MAX_VALUE,a=null,c,u=0;const d=r.contentNameScopesList.getScopeNames();for(let h=0,p=e.length;h<p;h++){const g=e[h];if(!g.matcher(d))continue;const _=t.getRule(g.ruleId),{ruleScanner:k,findOptions:w}=Nu(_,t,null,s,o===i),x=k.findNextMatchSync(n,o,w);if(!x)continue;const $=x.captureIndices[0].start;if(!($>=l)&&(l=$,a=x.captureIndices,c=x.ruleId,u=g.priority,l===o))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function Nu(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function By(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function ws(e,t,n,s,o,r,i){if(r.length===0)return;const l=t.content,a=Math.min(r.length,i.length),c=[],u=i[0].end;for(let d=0;d<a;d++){const h=r[d];if(h===null)continue;const p=i[d];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 _=h.getName(l,i),k=s.contentNameScopesList.pushAttributed(_,e),w=h.getContentName(l,i),x=k.pushAttributed(w,e),$=s.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,k,x),A=e.createOnigString(l.substring(0,p.end));Lu(e,A,n&&p.start===0,p.start,$,o,!1,0),Ru(A);continue}const g=h.getName(l,i);if(g!==null){const k=(c.length>0?c[c.length-1].scopes:s.contentNameScopesList).pushAttributed(g,e);c.push(new jy(k,p.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var jy=class{constructor(e,t){M(this,"scopes");M(this,"endPos");this.scopes=e,this.endPos=t}};function Uy(e,t,n,s,o,r,i,l){return new Fy(e,t,n,s,o,r,i,l)}function pa(e,t,n,s,o){const r=jo(t,Fo),i=Pu.getCompiledRuleId(n,s,o.repository);for(const l of r)e.push({debugSelector:t,matcher:l.matcher,ruleId:i,grammar:o,priority:l.priority})}function Fo(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(Gy(t[o],s))return n=o+1,!0;return!1})}function Gy(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 Fy=class{constructor(e,t,n,s,o,r,i,l){M(this,"_rootId");M(this,"_lastRuleId");M(this,"_ruleId2desc");M(this,"_includedGrammars");M(this,"_grammarRepository");M(this,"_grammar");M(this,"_injections");M(this,"_basicScopeAttributesProvider");M(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=r,this._onigLib=l,this._basicScopeAttributesProvider=new Py(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=ga(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const a of Object.keys(o)){const c=jo(a,Fo);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 i in o)pa(t,i,o[i],this,s);const r=this._grammarRepository.injections(n);r&&r.forEach(i=>{const l=this.getExternalGrammar(i);if(l){const a=l.injectionSelector;a&&pa(t,a,l,this,l)}})}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]=ga(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=Pu.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===hi.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=ls.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=As.createRootAndLookUpScopeName(h,d,this):p=As.createRoot("unknown",d),t=new hi(null,this._rootId,-1,-1,!1,null,p,p)}else o=!1,t.reset();e=e+`
|
|
78
|
+
`;const r=this.createOnigString(e),i=r.content.length,l=new Hy(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Lu(this,r,o,0,t,l,!0,s);return Ru(r),{lineLength:i,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function ga(e,t){return e=ly(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 As=class en{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=Nr.push(o,r.scopeNames),s=new en(s,o,r.encodedTokenAttributes);return s}static createRoot(t,n){return new en(null,new Nr(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),r=new Nr(null,t),i=s.themeProvider.themeMatch(r),l=en.mergeAttributes(n,o,i);return new en(null,r,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return en.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,i=0;return s!==null&&(o=s.fontStyle,r=s.foregroundId,i=s.backgroundId),ls.set(t,n.languageId,n.tokenType,null,o,r,i)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return en._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const r of s)o=en._pushAttributed(o,r,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),r=t.scopePath.push(n),i=s.themeProvider.themeMatch(r),l=en.mergeAttributes(t.tokenAttributes,o,i);return new en(t,r,l)}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}},Dt,hi=(Dt=class{constructor(t,n,s,o,r,i,l,a){M(this,"_stackElementBrand");M(this,"_enterPos");M(this,"_anchorPos");M(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=r,this.endRule=i,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(t){return t===null?!1:Dt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?As.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(){Dt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,r,i,l){return new Dt(this,t,n,s,o,r,i,l)}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 Dt(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=As.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Dt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,As.fromExtension(s,n.contentNameScopesList))}},M(Dt,"NULL",new Dt(null,0,0,0,!1,null,null,null)),Dt),zy=class{constructor(e,t){M(this,"balancedBracketScopes");M(this,"unbalancedBracketScopes");M(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):jo(n,Fo).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>jo(n,Fo).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}},Hy=class{constructor(e,t,n,s){M(this,"_emitBinaryTokens");M(this,"_lineText");M(this,"_tokens");M(this,"_binaryTokens");M(this,"_lastTokenEndIndex");M(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 i=(e==null?void 0:e.getScopeNames())??[];for(const l of this._tokenTypeOverrides)l.matcher(i)&&(o=ls.set(o,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(o=ls.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}},qy=class{constructor(e,t){M(this,"_grammars",new Map);M(this,"_rawGrammars",new Map);M(this,"_injectionGrammars",new Map);M(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,Uy(e,r,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},Wy=class{constructor(t){M(this,"_options");M(this,"_syncRegistry");M(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new qy(Bo.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Bo.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 zy(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,r){const i=new wy(this._syncRegistry,t);for(;i.Q.length>0;)i.Q.map(l=>this._loadSingleGrammar(l.scopeName)),i.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)}},pi=hi.NULL;const Vy=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ks{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}Ks.prototype.normal={};Ks.prototype.property={};Ks.prototype.space=void 0;function Ou(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new Ks(n,s,t)}function gi(e){return e.toLowerCase()}class St{constructor(t,n){this.attribute=n,this.property=t}}St.prototype.attribute="";St.prototype.booleanish=!1;St.prototype.boolean=!1;St.prototype.commaOrSpaceSeparated=!1;St.prototype.commaSeparated=!1;St.prototype.defined=!1;St.prototype.mustUseProperty=!1;St.prototype.number=!1;St.prototype.overloadedBoolean=!1;St.prototype.property="";St.prototype.spaceSeparated=!1;St.prototype.space=void 0;let Ky=0;const me=Hn(),Je=Hn(),mi=Hn(),H=Hn(),Ue=Hn(),Un=Hn(),Ct=Hn();function Hn(){return 2**++Ky}const vi=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:Je,commaOrSpaceSeparated:Ct,commaSeparated:Un,number:H,overloadedBoolean:mi,spaceSeparated:Ue},Symbol.toStringTag,{value:"Module"})),Dr=Object.keys(vi);class Ji extends St{constructor(t,n,s,o){let r=-1;if(super(t,n),ma(this,"space",o),typeof s=="number")for(;++r<Dr.length;){const i=Dr[r];ma(this,Dr[r],(s&vi[i])===vi[i])}}}Ji.prototype.defined=!0;function ma(e,t,n){n&&(e[t]=n)}function as(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const r=new Ji(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(r.mustUseProperty=!0),t[s]=r,n[gi(s)]=s,n[gi(r.attribute)]=s}return new Ks(t,n,e.space)}const Du=as({properties:{ariaActiveDescendant:null,ariaAtomic:Je,ariaAutoComplete:null,ariaBusy:Je,ariaChecked:Je,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Ue,ariaCurrent:null,ariaDescribedBy:Ue,ariaDetails:null,ariaDisabled:Je,ariaDropEffect:Ue,ariaErrorMessage:null,ariaExpanded:Je,ariaFlowTo:Ue,ariaGrabbed:Je,ariaHasPopup:null,ariaHidden:Je,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ue,ariaLevel:H,ariaLive:null,ariaModal:Je,ariaMultiLine:Je,ariaMultiSelectable:Je,ariaOrientation:null,ariaOwns:Ue,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Je,ariaReadOnly:Je,ariaRelevant:null,ariaRequired:Je,ariaRoleDescription:Ue,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Je,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Bu(e,t){return t in e?e[t]:t}function ju(e,t){return Bu(e,t.toLowerCase())}const Zy=as({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Un,acceptCharset:Ue,accessKey:Ue,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alpha:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Ue,autoFocus:me,autoPlay:me,blocking:Ue,capture:null,charSet:null,checked:me,cite:null,className:Ue,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Je,controls:me,controlsList:Ue,coords:H|Un,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:mi,draggable:Je,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Ue,height:H,hidden:mi,high:H,href:null,hrefLang:null,htmlFor:Ue,httpEquiv:Ue,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Ue,itemRef:Ue,itemScope:me,itemType:Ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,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:me,optimum:H,pattern:null,ping:Ue,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Ue,required:me,reversed:me,rows:H,rowSpan:H,sandbox:Ue,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootCustomElementRegistry:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shadowRootSerializable:me,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Je,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:Je,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ue,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Je,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:me,disablePictureInPicture:me,disableRemotePlayback:me,exportParts:Un,part:Ue,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:ju}),Jy=as({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:Ct,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Ue,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:Un,g2:Un,glyphName:Un,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Ct,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ct,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ct,rev:Ct,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ct,requiredFeatures:Ct,requiredFonts:Ct,requiredFormats:Ct,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Ct,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ct,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ct,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Bu}),Uu=as({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()}}),Gu=as({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ju}),Fu=as({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Yy=/[A-Z]/g,va=/-[a-z]/g,Xy=/^data[-\w.:]+$/i;function Qy(e,t){const n=gi(t);let s=t,o=St;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Xy.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(va,tb);s="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!va.test(r)){let i=r.replace(Yy,eb);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=Ji}return new o(s,t)}function eb(e){return"-"+e.toLowerCase()}function tb(e){return e.charAt(1).toUpperCase()}const nb=Ou([Du,Zy,Uu,Gu,Fu],"html"),zu=Ou([Du,Jy,Uu,Gu,Fu],"svg"),ya={}.hasOwnProperty;function sb(e,t){const n=t||{};function s(o,...r){let i=s.invalid;const l=s.handlers;if(o&&ya.call(o,e)){const a=String(o[e]);i=ya.call(l,a)?l[a]:s.unknown}if(i)return i.call(this,o,...r)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const ob=/["&'<>`]/g,rb=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ib=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,lb=/[|\\{}()[\]^$+*?.]/g,ba=new WeakMap;function ab(e,t){if(e=e.replace(t.subset?cb(t.subset):ob,s),t.subset||t.escapeOnly)return e;return e.replace(rb,n).replace(ib,s);function n(o,r,i){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,i.charCodeAt(r+2),t)}function s(o,r,i){return t.format(o.charCodeAt(0),i.charCodeAt(r+1),t)}}function cb(e){let t=ba.get(e);return t||(t=ub(e),ba.set(e,t)),t}function ub(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(lb,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const fb=/[\dA-Fa-f]/;function db(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!fb.test(String.fromCharCode(t))?s:s+";"}const hb=/\d/;function pb(e,t,n){const s="&#"+String(e);return n&&t&&!hb.test(String.fromCharCode(t))?s:s+";"}const gb=["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"],Br={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:"€"},mb=["cent","copy","divide","gt","lt","not","para","times"],Hu={}.hasOwnProperty,yi={};let lo;for(lo in Br)Hu.call(Br,lo)&&(yi[Br[lo]]=lo);const vb=/[^\dA-Za-z]/;function yb(e,t,n,s){const o=String.fromCharCode(e);if(Hu.call(yi,o)){const r=yi[o],i="&"+r;return n&&gb.includes(r)&&!mb.includes(r)&&(!s||t&&t!==61&&vb.test(String.fromCharCode(t)))?i:i+";"}return""}function bb(e,t,n){let s=db(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=yb(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const r=pb(e,t,n.omitOptionalSemicolons);r.length<s.length&&(s=r)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function os(e,t){return ab(e,Object.assign({format:bb},t))}const kb=/^>|^->|<!--|-->|--!>|<!-$/g,wb=[">"],_b=["<",">"];function Sb(e,t,n,s){return s.settings.bogusComments?"<?"+os(e.value,Object.assign({},s.settings.characterReferences,{subset:wb}))+">":"<!--"+e.value.replace(kb,o)+"-->";function o(r){return os(r,Object.assign({},s.settings.characterReferences,{subset:_b}))}}function xb(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function ka(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 Cb(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function $b(e){return e.join(" ").trim()}const Tb=/[ \t\n\f\r]/g;function Yi(e){return typeof e=="object"?e.type==="text"?wa(e.value):!1:wa(e)}function wa(e){return e.replace(Tb,"")===""}const nt=Wu(1),qu=Wu(-1),Ab=[];function Wu(e){return t;function t(n,s,o){const r=n?n.children:Ab;let i=(s||0)+e,l=r[i];if(!o)for(;l&&Yi(l);)i+=e,l=r[i];return l}}const Rb={}.hasOwnProperty;function Vu(e){return t;function t(n,s,o){return Rb.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const Xi=Vu({body:Eb,caption:jr,colgroup:jr,dd:Nb,dt:Lb,head:jr,html:Ib,li:Mb,optgroup:Ob,option:Db,p:Pb,rp:_a,rt:_a,tbody:jb,td:Sa,tfoot:Ub,th:Sa,thead:Bb,tr:Gb});function jr(e,t,n){const s=nt(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Yi(s.value.charAt(0)))}function Ib(e,t,n){const s=nt(n,t);return!s||s.type!=="comment"}function Eb(e,t,n){const s=nt(n,t);return!s||s.type!=="comment"}function Pb(e,t,n){const s=nt(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 Mb(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&s.tagName==="li"}function Lb(e,t,n){const s=nt(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Nb(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function _a(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function Ob(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function Db(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Bb(e,t,n){const s=nt(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function jb(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Ub(e,t,n){return!nt(n,t)}function Gb(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function Sa(e,t,n){const s=nt(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const Fb=Vu({body:qb,colgroup:Wb,head:Hb,html:zb,tbody:Vb});function zb(e){const t=nt(e,-1);return!t||t.type!=="comment"}function Hb(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 qb(e){const t=nt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Yi(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Wb(e,t,n){const s=qu(n,t),o=nt(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Xi(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Vb(e,t,n){const s=qu(n,t),o=nt(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Xi(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const ao={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 Kb(e,t,n,s){const o=s.schema,r=o.space==="svg"?!1:s.settings.omitOptionalTags;let i=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const l=[];let a;o.space==="html"&&e.tagName==="svg"&&(s.schema=zu);const c=Zb(s,e.properties),u=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,u&&(i=!1),(c||!r||!Fb(e,t,n))&&(l.push("<",e.tagName,c?" "+c:""),i&&(o.space==="svg"||s.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!s.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(u),!i&&(!r||!Xi(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function Zb(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const r=Jb(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 Jb(e,t,n){const s=Qy(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,r=e.settings.allowDangerousCharacters?0:1;let i=e.quote,l;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=os(s.attribute,Object.assign({},e.settings.characterReferences,{subset:ao.name[o][r]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?Cb:$b)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(l=os(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ao.unquoted[o][r]}))),l!==n&&(e.settings.quoteSmart&&ka(n,i)>ka(n,e.alternative)&&(i=e.alternative),l=i+os(n,Object.assign({},e.settings.characterReferences,{subset:(i==="'"?ao.single:ao.double)[o][r],attribute:!0}))+i),a+(l&&"="+l))}const Yb=["<","&"];function Ku(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:os(e.value,Object.assign({},s.settings.characterReferences,{subset:Yb}))}function Xb(e,t,n,s){return s.settings.allowDangerousHtml?e.value:Ku(e,t,n,s)}function Qb(e,t,n,s){return s.all(e)}const e1=sb("type",{invalid:t1,unknown:n1,handlers:{comment:Sb,doctype:xb,element:Kb,raw:Xb,root:Qb,text:Ku}});function t1(e){throw new Error("Expected node, not `"+e+"`")}function n1(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const s1={},o1={},r1=[];function i1(e,t){const n=t||s1,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:l1,all:a1,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||Vy,characterReferences:n.characterReferences||o1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?zu:nb,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function l1(e,t,n){return e1(e,t,n,this)}function a1(e){const t=[],n=e&&e.children||r1;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function zo(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 Tn(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function c1(e){return Array.isArray(e)?e:[e]}async function Zu(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Qi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function u1(e){return e==="ansi"||Qi(e)}function el(e){return e==="none"}function f1(e){return el(e)}function Ju(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 pr(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 i=0;i<n.length;i+=2){const l=t?n[i]+(n[i+1]||""):n[i];o.push([l,s]),s+=n[i].length,s+=((r=n[i+1])==null?void 0:r.length)||0}return o}function d1(e){const t=pr(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,i=0;for(const l of t){if(r<l.length)break;r-=l.length,i++}return{line:i,character:r}}function s(o,r){let i=0;for(let l=0;l<o;l++)i+=t[l].length;return i+=r,i}return{lines:t,indexToPos:n,posToIndex:s}}const tl="light-dark()",h1=["color","background-color"];function p1(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 g1(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(i=>o.offset<i&&i<o.offset+o.content.length).map(i=>i-o.offset).sort((i,l)=>i-l);return r.length?p1(o,r):o})):e}function m1(e,t,n,s,o="css-vars"){const r={content:e.content,explanation:e.explanation,offset:e.offset},i=t.map(u=>Ho(e.variants[u])),l=new Set(i.flatMap(u=>Object.keys(u))),a={},c=(u,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[u]+(d==="color"?"":h)};return i.forEach((u,d)=>{for(const h of l){const p=u[h]||"inherit";if(d===0&&s&&h1.includes(h))if(s===tl&&i.length>1){const g=t.findIndex(x=>x==="light"),_=t.findIndex(x=>x==="dark");if(g===-1||_===-1)throw new ot('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const k=i[g][h]||"inherit",w=i[_][h]||"inherit";a[h]=`light-dark(${k}, ${w})`,o==="css-vars"&&(a[c(d,h)]=p)}else a[h]=p;else o==="css-vars"&&(a[c(d,h)]=p)}}),r.htmlStyle=a,r}function Ho(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&pt.Italic&&(t["font-style"]="italic"),e.fontStyle&pt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&pt.Underline&&n.push("underline"),e.fontStyle&pt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function bi(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Yu=new WeakMap;function gr(e,t){Yu.set(e,t)}function Gs(e){return Yu.get(e)}class cs{constructor(...t){M(this,"_stacks",{});M(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 cs(Object.fromEntries(c1(n).map(s=>[s,pi])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return v1(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function v1(e){const t=[],n=new Set;function s(o){var i;if(n.has(o))return;n.add(o);const r=(i=o==null?void 0:o.nameScopesList)==null?void 0:i.scopeName;r&&t.push(r),o.parent&&s(o.parent)}return s(e),t}function y1(e,t){if(!(e instanceof cs))throw new ot("Invalid grammar state");return e.getInternalStack(t)}function b1(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new ot(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...o.indexToPos(i),offset:i}}else{const l=o.lines[i.line];if(l===void 0)throw new ot(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${o.lines.length}`);let a=i.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new ot(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${l.length}`);return{...i,character:a,offset:o.posToIndex(i.line,a)}}};const o=d1(n.source),r=(n.options.decorations||[]).map(i=>({...i,start:s(i.start),end:s(i.end)}));k1(r),e.set(n.meta,{decorations:r,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var i;if(!((i=this.options.decorations)!=null&&i.length))return;const o=t(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return g1(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(d=>d.type==="element"&&d.tagName==="span");if(o.length!==s.converter.lines.length)throw new ot(`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(d,h,p,g){const _=o[d];let k="",w=-1,x=-1;if(h===0&&(w=0),p===0&&(x=0),p===Number.POSITIVE_INFINITY&&(x=_.children.length),w===-1||x===-1)for(let A=0;A<_.children.length;A++)k+=Xu(_.children[A]),w===-1&&k.length===h&&(w=A+1),x===-1&&k.length===p&&(x=A+1);if(w===-1)throw new ot(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(x===-1)throw new ot(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);const $=_.children.slice(w,x);if(!g.alwaysWrap&&$.length===_.children.length)l(_,g,"line");else if(!g.alwaysWrap&&$.length===1&&$[0].type==="element")l($[0],g,"token");else{const A={type:"element",tagName:"span",properties:{},children:$};l(A,g,"wrapper"),_.children.splice(w,$.length,A)}}function i(d,h){o[d]=l(o[d],h,"line")}function l(d,h,p){var k;const g=h.properties||{},_=h.transform||(w=>w);return d.tagName=h.tagName||"span",d.properties={...d.properties,...g,class:d.properties.class},(k=h.properties)!=null&&k.class&&Ju(d,h.properties.class),d=_(d,p)||d,d}const a=[],c=s.decorations.sort((d,h)=>h.start.offset-d.start.offset||d.end.offset-h.end.offset);for(const d of c){const{start:h,end:p}=d;if(h.line===p.line)r(h.line,h.character,p.character,d);else if(h.line<p.line){r(h.line,h.character,Number.POSITIVE_INFINITY,d);for(let g=h.line+1;g<p.line;g++)a.unshift(()=>i(g,d));r(p.line,0,p.character,d)}}a.forEach(d=>d())}}}function k1(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ot(`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,i=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,l=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||i||l||a){if(r&&i||l&&a||l&&n.start.offset===n.end.offset||i&&o.start.offset===o.end.offset)continue;throw new ot(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Xu(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Xu).join(""):""}const w1=[b1()];function qo(e){const t=_1(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...w1]}function _1(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 Dn=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ur={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function S1(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 xa(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 x1(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)Ur[s]&&t.push({type:"setDecoration",value:Ur[s]});else if(s<=29){const o=Ur[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:Dn[s-30]}});else if(s===38){const o=xa(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:Dn[s-40]}});else if(s===48){const o=xa(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:Dn[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Dn[s-100+8]}})}return t}function C1(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let r=0;do{const i=S1(s,r),l=i.sequence?s.substring(r,i.startPosition):s.substring(r);if(l.length>0&&o.push({value:l,foreground:e,background:t,decorations:new Set(n)}),i.sequence){const a=x1(i.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=i.position}while(r<s.length);return o}}}var $1={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 T1(e=$1){function t(l){return e[l]}function n(l){return`#${l.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<Dn.length;c++)s.push(t(Dn[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)s.push(n([l[c],l[u],l[d]]));let a=8;for(let c=0;c<24;c++,a+=10)s.push(n([a,a,a]));return s}function r(l){return o()[l]}function i(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return r(l.index)}}return{value:i}}const A1={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 R1(e,t,n){const s=zo(e,n),o=pr(t),r=Object.fromEntries(Dn.map(a=>{var d;const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=(d=e.colors)==null?void 0:d[c];return[a,u||A1[a]]})),i=T1(r),l=C1();return o.map(a=>l.parse(a[0]).map(c=>{let u,d;c.decorations.has("reverse")?(u=c.background?i.value(c.background):e.bg,d=c.foreground?i.value(c.foreground):e.fg):(u=c.foreground?i.value(c.foreground):e.fg,d=c.background?i.value(c.background):void 0),u=Tn(u,s),d=Tn(d,s),c.decorations.has("dim")&&(u=I1(u));let h=pt.None;return c.decorations.has("bold")&&(h|=pt.Bold),c.decorations.has("italic")&&(h|=pt.Italic),c.decorations.has("underline")&&(h|=pt.Underline),c.decorations.has("strikethrough")&&(h|=pt.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:d,fontStyle:h}}))}function I1(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],i=s[2],l=s[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${r}${r}${i}${i}${a}`}else if(s.length===3){const o=s[0],r=s[1],i=s[2];return`#${o}${o}${r}${r}${i}${i}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function nl(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Qi(o)||el(s))return pr(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:i}=e.setTheme(s);if(o==="ansi")return R1(r,t,n);const l=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new ot(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(r.name))throw new ot(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return P1(t,l,r,i,n)}function E1(...e){if(e.length===2)return Gs(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:r=t.getLoadedThemes()[0]}=s;if(Qi(o)||el(r))throw new ot("Plain language does not have grammar state");if(o==="ansi")throw new ot("ANSI language does not have grammar state");const{theme:i,colorMap:l}=t.setTheme(r),a=t.getLanguage(o);return new cs(sl(n,a,i,l,s).stateStack,a.name,i.name)}function P1(e,t,n,s,o){const r=sl(e,t,n,s,o),i=new cs(r.stateStack,t.name,n.name);return gr(r.tokens,i),r.tokens}function sl(e,t,n,s,o){const r=zo(n,o),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:l=500}=o,a=pr(e);let c=o.grammarState?y1(o.grammarState,n.name)??pi:o.grammarContextCode!=null?sl(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:pi,u=[];const d=[];for(let h=0,p=a.length;h<p;h++){const[g,_]=a[h];if(g===""){u=[],d.push([]);continue}if(i>0&&g.length>=i){u=[],d.push([{content:g,offset:_,color:"",fontStyle:0}]);continue}let k,w,x;o.includeExplanation&&(k=t.tokenizeLine(g,c,l),w=k.tokens,x=0);const $=t.tokenizeLine2(g,c,l),A=$.tokens.length/2;for(let F=0;F<A;F++){const Q=$.tokens[2*F],C=F+1<A?$.tokens[2*F+2]:g.length;if(Q===C)continue;const R=$.tokens[2*F+1],P=Tn(s[ls.getForeground(R)],r),J=ls.getFontStyle(R),ie={content:g.substring(Q,C),offset:_+Q,color:P,fontStyle:J};if(o.includeExplanation){const z=[];if(o.includeExplanation!=="scopeName")for(const O of n.settings){let L;switch(typeof O.scope){case"string":L=O.scope.split(/,/).map(te=>te.trim());break;case"object":L=O.scope;break;default:continue}z.push({settings:O,selectors:L.map(te=>te.split(/ /))})}ie.explanation=[];let ve=0;for(;Q+ve<C;){const O=w[x],L=g.substring(O.startIndex,O.endIndex);ve+=L.length,ie.explanation.push({content:L,scopes:o.includeExplanation==="scopeName"?M1(O.scopes):L1(z,O.scopes)}),x+=1}}u.push(ie)}d.push(u),u=[],c=$.ruleStack}return{tokens:d,stateStack:c}}function M1(e){return e.map(t=>({scopeName:t}))}function L1(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const r=t[s];n[s]={scopeName:r,themeMatches:O1(e,r,t.slice(0,s))}}return n}function Ca(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function N1(e,t,n){if(!Ca(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Ca(e[s],n[o])&&(s-=1),o-=1;return s===-1}function O1(e,t,n){const s=[];for(const{selectors:o,settings:r}of e)for(const i of o)if(N1(i,t,n)){s.push(r);break}return s}function Qu(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=nl(e,t,{...n,theme:a.theme}),u=Gs(c),d=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:d}}),r=D1(...o.map(a=>a.tokens)),i=r[0].map((a,c)=>a.map((u,d)=>{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:_,explanation:k,offset:w,...x}=p[c][d];h.variants[s[g].color]=x}),h})),l=o[0].state?new cs(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 l&&gr(i,l),i}function D1(...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 i=o.map(()=>0),l=o.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(c=>c.content.length));for(let c=0;c<n;c++){const u=l[c];u.content.length===a?(r[c].push(u),i[c]+=1,l[c]=o[c][i[c]]):(r[c].push({...u,content:u.content.slice(0,a)}),l[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return t}function Wo(e,t,n){let s,o,r,i,l,a;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,h=Object.entries(n.themes).filter(w=>w[1]).map(w=>({color:w[0],theme:w[1]})).sort((w,x)=>w.color===c?-1:x.color===c?1:0);if(h.length===0)throw new ot("`themes` option must not be empty");const p=Qu(e,t,n);if(a=Gs(p),c&&tl!==c&&!h.find(w=>w.color===c))throw new ot(`\`themes\` option must contain the defaultColor key \`${c}\``);const g=h.map(w=>e.getTheme(w.theme)),_=h.map(w=>w.color);r=p.map(w=>w.map(x=>m1(x,_,u,c,d))),a&&gr(r,a);const k=h.map(w=>zo(w.theme,n));o=$a(h,g,k,u,c,"fg",d),s=$a(h,g,k,u,c,"bg",d),i=`shiki-themes ${g.map(w=>w.name).join(" ")}`,l=c?void 0:[o,s].join(";")}else if("theme"in n){const c=zo(n.theme,n);r=nl(e,t,n);const u=e.getTheme(n.theme);s=Tn(u.bg,c),o=Tn(u.fg,c),i=u.name,a=Gs(r)}else throw new ot("Invalid options, either `theme` or `themes` must be provided");return{tokens:r,fg:o,bg:s,themeName:i,rootStyle:l,grammarState:a}}function $a(e,t,n,s,o,r,i){return e.map((l,a)=>{const c=Tn(t[a][r],n[a])||"inherit",u=`${s+l.color}${r==="bg"?"-bg":""}:${c}`;if(a===0&&o){if(o===tl&&e.length>1){const d=e.findIndex(_=>_.color==="light"),h=e.findIndex(_=>_.color==="dark");if(d===-1||h===-1)throw new ot('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const p=Tn(t[d][r],n[d])||"inherit",g=Tn(t[h][r],n[h])||"inherit";return`light-dark(${p}, ${g});${u}`}return c}return i==="css-vars"?u:null}).filter(l=>!!l).join(";")}function Vo(e,t,n,s={meta:{},options:n,codeToHast:(o,r)=>Vo(e,o,r),codeToTokens:(o,r)=>Wo(e,o,r)}){var g,_;let o=t;for(const k of qo(n))o=((g=k.preprocess)==null?void 0:g.call(s,o,n))||o;let{tokens:r,fg:i,bg:l,themeName:a,rootStyle:c,grammarState:u}=Wo(e,o,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?r=j1(r):d==="never"&&(r=U1(r)),h&&(r=G1(r));const p={...s,get source(){return o}};for(const k of qo(n))r=((_=k.tokens)==null?void 0:_.call(p,r))||r;return B1(r,{...n,fg:i,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},p,u)}function B1(e,t,n,s=Gs(e)){var _,k,w,x;const o=qo(t),r=[],i={type:"root",children:[]},{structure:l="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[$,A]of Object.entries(t.meta||{}))$.startsWith("_")||(c[$]=A);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:r};const h=[],p={...n,structure:l,addClassToHast:Ju,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return i},get pre(){return u},get code(){return d},get lines(){return h}};if(e.forEach(($,A)=>{var C,R;A&&(l==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&r.push({type:"text",value:`
|
|
87
|
+
`}));let F={type:"element",tagName:"span",properties:{class:"line"},children:[]},Q=0;for(const P of $){let J={type:"element",tagName:"span",properties:{...P.htmlAttrs},children:[{type:"text",value:P.content}]};const ie=bi(P.htmlStyle||Ho(P));ie&&(J.properties.style=ie);for(const z of o)J=((C=z==null?void 0:z.span)==null?void 0:C.call(p,J,A+1,Q,F,P))||J;l==="inline"?i.children.push(J):l==="classic"&&F.children.push(J),Q+=P.content.length}if(l==="classic"){for(const P of o)F=((R=P==null?void 0:P.line)==null?void 0:R.call(p,F,A+1))||F;h.push(F),r.push(F)}else l==="inline"&&h.push(F)}),l==="classic"){for(const $ of o)d=((_=$==null?void 0:$.code)==null?void 0:_.call(p,d))||d;u.children.push(d);for(const $ of o)u=((k=$==null?void 0:$.pre)==null?void 0:k.call(p,u))||u;i.children.push(u)}else if(l==="inline"){const $=[];let A={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const C of i.children)C.type==="element"&&C.tagName==="br"?($.push(A),A={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(C.type==="element"||C.type==="text")&&A.children.push(C);$.push(A);let Q={type:"element",tagName:"code",properties:{},children:$};for(const C of o)Q=((w=C==null?void 0:C.code)==null?void 0:w.call(p,Q))||Q;i.children=[];for(let C=0;C<Q.children.length;C++){C>0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});const R=Q.children[C];R.type==="element"&&i.children.push(...R.children)}}let g=i;for(const $ of o)g=((x=$==null?void 0:$.root)==null?void 0:x.call(p,g))||g;return s&&gr(g,s),g}function j1(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((r,i)=>{const a=!(r.fontStyle&&(r.fontStyle&pt.Underline||r.fontStyle&pt.Strikethrough));a&&r.content.match(/^\s+$/)&&t[i+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 U1(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,i]=s;if(!o&&!i)return n;const l=[{...n,offset:n.offset+o.length,content:r}];return o&&l.unshift({content:o,offset:n.offset}),i&&l.push({content:i,offset:n.offset+o.length+r.length}),l}))}function G1(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=bi(o.htmlStyle||Ho(o)),i=bi(s.htmlStyle||Ho(s)),l=o.fontStyle&&(o.fontStyle&pt.Underline||o.fontStyle&pt.Strikethrough),a=s.fontStyle&&(s.fontStyle&pt.Underline||s.fontStyle&pt.Strikethrough);!l&&!a&&r===i?o.content+=s.content:n.push({...s})}return n})}const F1=i1;function z1(e,t,n){var r;const s={meta:{},options:n,codeToHast:(i,l)=>Vo(e,i,l),codeToTokens:(i,l)=>Wo(e,i,l)};let o=F1(Vo(e,t,n,s));for(const i of qo(n))o=((r=i.postprocess)==null?void 0:r.call(s,o,n))||o;return o}const Ta={light:"#333333",dark:"#bbbbbb"},Aa={light:"#fffffe",dark:"#1e1e1e"},Ra="__shiki_resolved";function ol(e){var l,a,c,u,d;if(e!=null&&e[Ra])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;(l=h==null?void 0:h.settings)!=null&&l.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"?Ta.light:Ta.dark),n||(n=t.type==="light"?Aa.light:Aa.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 i(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}`]?i(h):(r.set(h,p),p)}t.settings=t.settings.map(h=>{var k,w;const p=((k=h.settings)==null?void 0:k.foreground)&&!h.settings.foreground.startsWith("#"),g=((w=h.settings)==null?void 0:w.background)&&!h.settings.background.startsWith("#");if(!p&&!g)return h;const _={...h,settings:{...h.settings}};if(p){const x=i(h.settings.foreground);t.colorReplacements[x]=h.settings.foreground,_.settings.foreground=x}if(g){const x=i(h.settings.background);t.colorReplacements[x]=h.settings.background,_.settings.background=x}return _});for(const h of Object.keys(t.colors||{}))if((h==="editor.foreground"||h==="editor.background"||h.startsWith("terminal.ansi"))&&!((d=t.colors[h])!=null&&d.startsWith("#"))){const p=i(t.colors[h]);t.colorReplacements[p]=t.colors[h],t.colors[h]=p}return Object.defineProperty(t,Ra,{enumerable:!1,writable:!1,value:!0}),t}async function ef(e){return Array.from(new Set((await Promise.all(e.filter(t=>!u1(t)).map(async t=>await Zu(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function tf(e){return(await Promise.all(e.map(async n=>f1(n)?null:ol(await Zu(n))))).filter(n=>!!n)}let H1=3;function q1(e,t=3){t>H1||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Yn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function nf(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 Yn(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class W1 extends Wy{constructor(n,s,o,r={}){super(n);M(this,"_resolvedThemes",new Map);M(this,"_resolvedGrammars",new Map);M(this,"_langMap",new Map);M(this,"_langGraph",new Map);M(this,"_textmateThemeCache",new WeakMap);M(this,"_loadedThemesCache",null);M(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=s,this._langs=o,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=ol(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=Bo.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){return n=nf(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var i,l,a,c;if(this.getGrammar(n.name))return;const s=new Set([...this._langMap.values()].filter(u=>{var d;return(d=u.embeddedLangsLazy)==null?void 0:d.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,(l=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||l.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,i])=>!i);if(o.length){const r=s.filter(([i,l])=>{if(!l)return!1;const a=l.embeddedLanguages||l.embeddedLangs;return a==null?void 0:a.some(c=>o.map(([u])=>u).includes(c))}).filter(i=>!o.includes(i));throw new Yn(`Missing languages ${o.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of s)this._resolver.addLanguage(i);for(const[r,i]of s)this.loadLanguage(i)}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 V1{constructor(t,n){M(this,"_langs",new Map);M(this,"_scopeToLang",new Map);M(this,"_injections",new Map);M(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 vs=0;function K1(e){vs+=1,e.warnings!==!1&&vs>=10&&vs%10===0&&console.warn(`[Shiki] ${vs} 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 Yn("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(ol),o=new V1(e.engine,n),r=new W1(o,s,n,e.langAlias);let i;function l($){return nf($,e.langAlias)}function a($){w();const A=r.getGrammar(typeof $=="string"?$:$.name);if(!A)throw new Yn(`Language \`${$}\` not found, you may need to load it first`);return A}function c($){if($==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const A=r.getTheme($);if(!A)throw new Yn(`Theme \`${$}\` not found, you may need to load it first`);return A}function u($){w();const A=c($);i!==$&&(r.setTheme(A),i=$);const F=r.getColorMap();return{theme:A,colorMap:F}}function d(){return w(),r.getLoadedThemes()}function h(){return w(),r.getLoadedLanguages()}function p(...$){w(),r.loadLanguages($.flat(1))}async function g(...$){return p(await ef($))}function _(...$){w();for(const A of $.flat(1))r.loadTheme(A)}async function k(...$){return w(),_(await tf($))}function w(){if(t)throw new Yn("Shiki instance has been disposed")}function x(){t||(t=!0,r.dispose(),vs-=1)}return{setTheme:u,getTheme:c,getLanguage:a,getLoadedThemes:d,getLoadedLanguages:h,resolveLangAlias:l,loadLanguage:g,loadLanguageSync:p,loadTheme:k,loadThemeSync:_,dispose:x,[Symbol.dispose]:x}}async function Z1(e){e.engine||q1("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([tf(e.themes||[]),ef(e.langs||[]),e.engine]);return K1({...e,themes:t,langs:n,engine:s})}async function J1(e){const t=await Z1(e);return{getLastGrammarState:(...n)=>E1(t,...n),codeToTokensBase:(n,s)=>nl(t,n,s),codeToTokensWithThemes:(n,s)=>Qu(t,n,s),codeToTokens:(n,s)=>Wo(t,n,s),codeToHast:(n,s)=>Vo(t,n,s),codeToHtml:(n,s)=>z1(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}class rl extends Error{constructor(t){super(t),this.name="ShikiError"}}function Y1(){return 2147483648}function X1(){return typeof performance<"u"?performance.now():Date.now()}const Q1=(e,t)=>e+(t-e%t)%t;async function ek(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,_){s.HEAPU8.copyWithin(p,g,g+_)}function i(p){try{return t.grow(p-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function l(p){const g=s.HEAPU8.length;p=p>>>0;const _=Y1();if(p>_)return!1;for(let k=1;k<=4;k*=2){let w=g*(1+.2/k);w=Math.min(w,p+100663296);const x=Math.min(_,Q1(Math.max(p,w),65536));if(i(x))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(p,g,_=1024){const k=g+_;let w=g;for(;p[w]&&!(w>=k);)++w;if(w-g>16&&p.buffer&&a)return a.decode(p.subarray(g,w));let x="";for(;g<w;){let $=p[g++];if(!($&128)){x+=String.fromCharCode($);continue}const A=p[g++]&63;if(($&224)===192){x+=String.fromCharCode(($&31)<<6|A);continue}const F=p[g++]&63;if(($&240)===224?$=($&15)<<12|A<<6|F:$=($&7)<<18|A<<12|F<<6|p[g++]&63,$<65536)x+=String.fromCharCode($);else{const Q=$-65536;x+=String.fromCharCode(55296|Q>>10,56320|Q&1023)}}return x}function u(p,g){return p?c(s.HEAPU8,p,g):""}const d={emscripten_get_now:X1,emscripten_memcpy_big:r,emscripten_resize_heap:l,fd_write:()=>0};async function h(){const g=await e({env:d,wasi_snapshot_preview1:d});t=g.memory,o(t.buffer),Object.assign(s,g),s.UTF8ToString=u}return await h(),s}var tk=Object.defineProperty,nk=(e,t,n)=>t in e?tk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tt=(e,t,n)=>nk(e,typeof t!="symbol"?t+"":t,n);let st=null;function sk(e){throw new rl(e.UTF8ToString(e.getLastOnigError()))}class mr{constructor(t){tt(this,"utf16Length"),tt(this,"utf8Length"),tt(this,"utf16Value"),tt(this,"utf8Value"),tt(this,"utf16OffsetToUtf8"),tt(this,"utf8OffsetToUtf16");const n=t.length,s=mr._utf8ByteLength(t),o=s!==n,r=o?new Uint32Array(n+1):null;o&&(r[n]=s);const i=o?new Uint32Array(s+1):null;o&&(i[s]=n);const l=new Uint8Array(s);let a=0;for(let c=0;c<n;c++){const u=t.charCodeAt(c);let d=u,h=!1;if(u>=55296&&u<=56319&&c+1<n){const p=t.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+65536|p-56320,h=!0)}o&&(r[c]=a,h&&(r[c+1]=a),d<=127?i[a+0]=c:d<=2047?(i[a+0]=c,i[a+1]=c):d<=65535?(i[a+0]=c,i[a+1]=c,i[a+2]=c):(i[a+0]=c,i[a+1]=c,i[a+2]=c,i[a+3]=c)),d<=127?l[a++]=d:d<=2047?(l[a++]=192|(d&1984)>>>6,l[a++]=128|(d&63)>>>0):d<=65535?(l[a++]=224|(d&61440)>>>12,l[a++]=128|(d&4032)>>>6,l[a++]=128|(d&63)>>>0):(l[a++]=240|(d&1835008)>>>18,l[a++]=128|(d&258048)>>>12,l[a++]=128|(d&4032)>>>6,l[a++]=128|(d&63)>>>0),h&&c++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=i}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const r=t.charCodeAt(s);let i=r,l=!1;if(r>=55296&&r<=56319&&s+1<o){const a=t.charCodeAt(s+1);a>=56320&&a<=57343&&(i=(r-55296<<10)+65536|a-56320,l=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,l&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const vr=class tn{constructor(t){if(tt(this,"id",++tn.LAST_ID),tt(this,"_onigBinding"),tt(this,"content"),tt(this,"utf16Length"),tt(this,"utf8Length"),tt(this,"utf16OffsetToUtf8"),tt(this,"utf8OffsetToUtf16"),tt(this,"ptr"),!st)throw new rl("Must invoke loadWasm first.");this._onigBinding=st,this.content=t;const n=new mr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!tn._sharedPtrInUse?(tn._sharedPtr||(tn._sharedPtr=st.omalloc(1e4)),tn._sharedPtrInUse=!0,st.HEAPU8.set(n.utf8Value,tn._sharedPtr),this.ptr=tn._sharedPtr):this.ptr=n.createString(st)}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===tn._sharedPtr?tn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};tt(vr,"LAST_ID",0);tt(vr,"_sharedPtr",0);tt(vr,"_sharedPtrInUse",!1);let sf=vr;class ok{constructor(t){if(tt(this,"_onigBinding"),tt(this,"_ptr"),!st)throw new rl("Must invoke loadWasm first.");const n=[],s=[];for(let l=0,a=t.length;l<a;l++){const c=new mr(t[l]);n[l]=c.createString(st),s[l]=c.utf8Length}const o=st.omalloc(4*t.length);st.HEAPU32.set(n,o/4);const r=st.omalloc(4*t.length);st.HEAPU32.set(s,r/4);const i=st.createOnigScanner(o,r,t.length);for(let l=0,a=t.length;l<a;l++)st.ofree(n[l]);st.ofree(r),st.ofree(o),i===0&&sk(st),this._onigBinding=st,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new sf(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,i=r.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(i===0)return null;const l=r.HEAPU32;let a=i/4;const c=l[a++],u=l[a++],d=[];for(let h=0;h<u;h++){const p=t.convertUtf8OffsetToUtf16(l[a++]),g=t.convertUtf8OffsetToUtf16(l[a++]);d[h]={start:p,end:g,length:g-p}}return{index:c,captureIndices:d}}}function rk(e){return typeof e.instantiator=="function"}function ik(e){return typeof e.default=="function"}function lk(e){return typeof e.data<"u"}function ak(e){return typeof Response<"u"&&e instanceof Response}function ck(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 co;function uk(e){if(co)return co;async function t(){st=await ek(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),rk(s)?s=await s.instantiator(n):ik(s)?s=await s.default(n):(lk(s)&&(s=s.data),ak(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await fk(s)(n):s=await dk(s)(n):ck(s)?s=await Gr(s)(n):s instanceof WebAssembly.Module?s=await Gr(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Gr(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return co=t(),co}function Gr(e){return t=>WebAssembly.instantiate(e,t)}function fk(e){return t=>WebAssembly.instantiateStreaming(e,t)}function dk(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function hk(e){return e&&await uk(e),{createScanner(t){return new ok(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new sf(t)}}}const pk={class:"code-block"},gk={class:"code-header"},mk={class:"code-lang"},vk=["innerHTML"],yk=Se({__name:"CodeBlock",props:{code:{},lang:{},streaming:{type:Boolean}},setup(e){const t=e,n=vn("effectiveTheme",N(typeof document<"u"&&document.documentElement.dataset.theme==="dark"?"dark":"light")),s=N(""),o=N(""),r=N(!1);let i=null;const l=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(i)return i;const[k,w]=await Promise.all([ro(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),ro(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return i=await J1({themes:[k.default,w.default],langs:[],engine:hk(()=>ro(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),i}async function d(k){if(l.has(k))return!0;if(a.has(k))return await a.get(k),l.has(k);const w=(async()=>{try{const x=await u(),$=await ro(()=>import(`shiki/langs/${k}.mjs`),[],import.meta.url);await x.loadLanguage($.default),l.add(k)}catch{}})();return a.set(k,w),await w,a.delete(k),l.has(k)}function h(k){const w=k.toLowerCase();return c[w]??w}async function p(){var $;const k=(($=t.lang)==null?void 0:$.toLowerCase())??"text",w=h(k),x=n.value==="light"?"github-light":"github-dark";try{const A=await u();await d(w)?s.value=A.codeToHtml(t.code,{lang:w,theme:x}):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(k){return k.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function _(){navigator.clipboard.writeText(t.code).then(()=>{r.value=!0,setTimeout(()=>r.value=!1,1500)})}return Oe(()=>[t.code,t.lang,n.value],([k])=>{t.streaming?o.value=`<pre class="shiki-fallback"><code>${g(k)}</code></pre>`:p()},{immediate:!0}),Oe(()=>t.streaming,(k,w)=>{w&&!k&&p()}),(k,w)=>(y(),b("div",pk,[f("div",gk,[f("span",mk,E(e.lang||"text"),1),f("button",{class:de(["code-copy",{copied:r.value}]),onClick:_},E(r.value?"已复制":"复制"),3)]),f("div",{class:"code-content",innerHTML:t.streaming?o.value:s.value||o.value},null,8,vk)]))}}),bk=xe(yk,[["__scopeId","data-v-f94a1d0a"]]);De.setOptions({gfm:!0,breaks:!1});const kk=Se({props:{content:{type:String,required:!0},streaming:{type:Boolean,default:!1}},setup(e){const t=N(e.content);let n=null;Oe(()=>e.content,o=>{if(!e.streaming){t.value=o;return}n===null&&(n=requestAnimationFrame(()=>{n=null,t.value=e.content}))}),Oe(()=>e.streaming,(o,r)=>{r&&!o&&(n!==null&&(cancelAnimationFrame(n),n=null),t.value=e.content)});const s=X(()=>{const o=wk(t.value);return De.lexer(o).flatMap(i=>ki(i,e.streaming))});return()=>Ne("div",{class:"markdown-body"},s.value)}});function wk(e){const t=/^(`{3,})/gm;let n=null,s=-1,o=0,r;for(;(r=t.exec(e))!==null;){const i=r[1];n===null?(n=i,s=r.index,o=i.length):i.length>=o&&(n=null)}return n!==null?e.substring(0,s).trimEnd():e}function ki(e,t=!1){const n=e;switch(n.type){case"paragraph":return[Ne("p",{class:"md-p"},mn(n.tokens??[]))];case"heading":return[Ne(`h${n.depth??2}`,{class:`md-h${n.depth??2}`},mn(n.tokens??[]))];case"code":return[Ne(bk,{code:n.text??"",lang:n.lang??"text",streaming:t})];case"blockquote":return[Ne("blockquote",{class:"md-blockquote"},(n.tokens??[]).flatMap(s=>ki(s,t)))];case"list":{const s=(n.items??[]).map(o=>{const r=[];return o.task&&r.push(Ne("input",{type:"checkbox",checked:o.checked,disabled:!0,class:"md-checkbox"})),r.push(...o.tokens.flatMap(i=>ki(i,t))),Ne("li",{class:["md-li",o.task?"md-task":""]},r)});return[Ne(n.ordered?"ol":"ul",{class:n.ordered?"md-ol":"md-ul"},s)]}case"hr":return[Ne("hr",{class:"md-hr"})];case"space":return[];case"html":return[Ne("pre",{class:"md-raw-html"},n.text??"")];case"table":return[Ne("div",{class:"md-table-wrap",style:"overflow-x:auto"},[_k(n)])];case"br":return[Ne("br")];case"text":return[Ne("span",{class:"md-text"},n.tokens?mn(n.tokens):n.text??"")];case"def":return[];default:return[Ne("p",{class:"md-p"},n.raw??"")]}}function _k(e){const t=(e.header??[]).map((s,o)=>{var l;const r=(l=e.align)==null?void 0:l[o],i=s;return Ne("th",{class:"md-th",style:r?`text-align:${r}`:""},i.tokens?mn(i.tokens):String(i.text??""))}),n=(e.rows??[]).map(s=>Ne("tr",{},s.map((o,r)=>{var a;const i=(a=e.align)==null?void 0:a[r],l=o;return Ne("td",{class:"md-td",style:i?`text-align:${i}`:""},l.tokens?mn(l.tokens):String(l.text??""))})));return Ne("table",{class:"md-table"},[Ne("thead",{},[Ne("tr",{},t)]),Ne("tbody",{},n)])}function mn(e){return e.map(t=>{const n=t;switch(n.type){case"text":return n.text??"";case"codespan":return Ne("code",{class:"md-code"},n.text??"");case"strong":return Ne("strong",{class:"md-strong"},mn(n.tokens??[]));case"em":return Ne("em",{class:"md-em"},mn(n.tokens??[]));case"del":return Ne("del",{class:"md-del"},mn(n.tokens??[]));case"link":{const s=n.href;return s&&!/^(https?:|mailto:|#|\/)/i.test(s)?n.raw??"":Ne("a",{class:"md-a",href:s,target:"_blank",rel:"noopener"},mn(n.tokens??[]))}case"image":return Ne("img",{class:"md-img",src:n.href,alt:n.text??"",loading:"lazy"});case"br":return Ne("br");case"html":return Ne("code",{class:"md-raw-inline"},n.text??"");case"escape":return n.text??"";default:return n.raw??""}})}const Sk=xe(kk,[["__scopeId","data-v-98ce0f33"]]),xk=new Set(["edit","str_replace","replace","write","multi_edit","create_file","edit_file","apply_patch"]);function Ck(e){return xk.has(e.toLowerCase())}function il(e,t=!0){return e.suspended?"suspended":e.isError?"error":e.output===void 0?t?"running":"unknown":"ok"}function $k(e,t=!0){const n=new Set(e.map(s=>il(s,t)));return n.has("running")?"running":n.has("error")?"error":n.has("suspended")?"suspended":n.has("unknown")?"unknown":"ok"}const Tk=["onKeydown"],Ak={class:"tool-name"},Rk=["title"],Ik={class:"tool-collapse-inner"},Ek={class:"tool-body"},Pk={key:0,class:"tool-args"},Mk={key:1,class:"tool-result"},Lk={key:2,class:"tool-image-wrap"},Nk=["src"],Ok={key:3,class:"tool-output-actions"},Dk={key:4,class:"tool-running-hint"},Bk=Se({__name:"GenericToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=X(()=>il(t.tool,t.live)),s=X(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=N(!1);let r=!1;Oe(n,k=>{r||(o.value=k==="running")},{immediate:!0});function i(){r=!0,o.value=!o.value}const l=X(()=>{const k=t.tool.args;if(!k||typeof k!="object")return k===void 0?"":String(k);const w=[];for(const[x,$]of Object.entries(k)){let A;if(typeof $=="string")A=$.length>40?`${$.slice(0,40)}…`:$;else{try{A=JSON.stringify($)}catch{A=String($)}A.length>40&&(A=`${A.slice(0,40)}…`)}if(w.push(`${x}=${A}`),w.length>=3)break}return w.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(k){return k??""}const u=X(()=>c(t.tool.output)),d=X(()=>u.value.length>8192),h=N(!1),p=X(()=>d.value&&!h.value?u.value.slice(0,280):u.value);async function g(){var k;try{await((k=navigator.clipboard)==null?void 0:k.writeText(u.value))}catch{}}const _=X(()=>{const k=u.value.trim();return!/^[\w@./-]+\.(png|jpe?g|gif|webp|avif)$/i.test(k)||k.includes("..")||k.startsWith("/")||d.value?null:`/api/v1/files/raw?path=${encodeURIComponent(k)}`});return(k,w)=>(y(),b("div",{class:de(["tool-card",`is-${n.value}`])},[f("div",{class:"tool-header",role:"button",tabindex:"0",onClick:i,onKeydown:Os(At(i,["prevent"]),["enter"])},[f("span",{class:de(["status-dot",n.value])},[s.value?(y(),b(ee,{key:0},[Re(E(s.value),1)],64)):D("",!0)],2),f("span",Ak,E(e.tool.name),1),l.value?(y(),b("span",{key:0,class:"tool-params",title:l.value},E(l.value),9,Rk)):D("",!0),f("span",{class:de(["tool-chevron",{open:o.value}])},"▸",2)],40,Tk),f("div",{class:de(["tool-collapse",{open:o.value}])},[f("div",Ik,[f("div",Ek,[a()?(y(),b("pre",Pk,[f("code",null,E(a()),1)])):D("",!0),e.tool.output!==void 0&&!_.value?(y(),b("pre",Mk,[f("code",null,E(p.value||"(无输出)"),1)])):D("",!0),e.tool.output!==void 0&&_.value?(y(),b("div",Lk,[f("img",{class:"tool-image",src:_.value,alt:"",loading:"lazy",onError:w[0]||(w[0]=x=>x.currentTarget.style.display="none")},null,40,Nk)])):D("",!0),d.value?(y(),b("div",Ok,[f("button",{class:"tool-output-btn",onClick:w[1]||(w[1]=x=>h.value=!h.value)},E(h.value?"收起":"展开全文"),1),f("button",{class:"tool-output-btn",onClick:g},"复制")])):(y(),b("div",Dk,"执行中…"))])])],2)],2))}}),jk=xe(Bk,[["__scopeId","data-v-f8845a39"]]),Uk=500;function Gk(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 i=1;i<=s;i++)o[r][i]=e[r-1]===t[i-1]?o[r-1][i-1]+1:Math.max(o[r-1][i],o[r][i-1]);return o}function Fk(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 zk(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 i=/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(r);s=i?Number(i[1]):0,o=i?Number(i[2]):0;const l=r.startsWith("@@")?r.slice(r.indexOf("@@")+2,r.lastIndexOf("@@")||r.length):"";t.push({type:"context",text:l.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 Hk(e,t){const n=e.split(`
|
|
91
|
+
`),s=t.split(`
|
|
92
|
+
`);if(n.length+s.length>Uk){const r=[];return n.forEach((i,l)=>r.push({type:"del",text:i,oldNo:l+1})),s.forEach((i,l)=>r.push({type:"add",text:i,newNo:l+1})),r}const o=Gk(n,s);return Fk(o,n,s,n.length,s.length)}function qk(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 Wk=["old_string","oldString","old_str","old_text","oldText","old","search"],Vk=["new_string","newString","new_str","new_text","newText","new","replace","content"],Kk=["path","file_path","filePath","file","filename"];function Fr(e,t){for(const n of t){const s=e[n];if(typeof s=="string"&&s.length>0)return s}}function Zk(e){if(!e||typeof e!="object")return null;const t=e,n=Fr(t,Kk),s=Fr(t,Wk),o=Fr(t,Vk);if(!o&&!s)return null;const r=Hk(s??"",o??""),i=qk(r);return{path:n,diff:r,stats:i}}const Jk={class:"diff-lines"},Yk={class:"dl-gutter old"},Xk={class:"dl-gutter new"},Qk={class:"dl-sign"},e0={class:"dl-text"},t0=Se({__name:"DiffLines",props:{lines:{}},setup(e){return(t,n)=>(y(),b("div",Jk,[(y(!0),b(ee,null,Ve(e.lines,(s,o)=>(y(),b("div",{key:o,class:de(["dl",`dl-${s.type}`])},[f("span",Yk,E(s.oldNo??""),1),f("span",Xk,E(s.newNo??""),1),f("span",Qk,E(s.type==="add"?"+":s.type==="del"?"−":" "),1),f("span",e0,E(s.text),1)],2))),128))]))}}),of=xe(t0,[["__scopeId","data-v-e2e145aa"]]),n0=["onKeydown"],s0={class:"tool-name"},o0=["title"],r0={key:1,class:"diff-chip"},i0={class:"tool-collapse-inner"},l0={class:"tool-body"},a0={key:1,class:"tool-result"},c0={key:2,class:"tool-running-hint"},u0=Se({__name:"EditToolCard",props:{tool:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=X(()=>il(t.tool,t.live)),s=X(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=X(()=>Zk(t.tool.args)),r=X(()=>{const h=o.value;if(!h||n.value==="error")return"";const{added:p,removed:g}=h.stats;return!p&&!g?"":`+${p} −${g}`}),i=X(()=>{var h;return(h=o.value)==null?void 0:h.path}),l=N(!1);let a=!1;Oe(n,h=>{a||(l.value=h==="running")},{immediate:!0});function c(){a=!0,l.value=!l.value}const u=X(()=>{var h;return((h=o.value)==null?void 0:h.diff)??[]}),d=X(()=>u.value.length>0);return(h,p)=>(y(),b("div",{class:de(["tool-card",`is-${n.value}`,"edit-tool-card"])},[f("div",{class:"tool-header",role:"button",tabindex:"0",onClick:c,onKeydown:Os(At(c,["prevent"]),["enter"])},[f("span",{class:de(["status-dot",n.value])},[s.value?(y(),b(ee,{key:0},[Re(E(s.value),1)],64)):D("",!0)],2),f("span",s0,E(e.tool.name),1),i.value?(y(),b("span",{key:0,class:"tool-filepath",title:i.value},E(i.value),9,o0)):D("",!0),r.value?(y(),b("span",r0,E(r.value),1)):D("",!0),f("span",{class:de(["tool-chevron",{open:l.value}])},"▸",2)],40,n0),f("div",{class:de(["tool-collapse",{open:l.value}])},[f("div",i0,[f("div",l0,[d.value?(y(),qe(of,{key:0,lines:u.value},null,8,["lines"])):D("",!0),e.tool.output!==void 0?(y(),b("pre",a0,[f("code",null,E(e.tool.output||"(无输出)"),1)])):(y(),b("div",c0,"执行中…"))])])],2)],2))}}),f0=xe(u0,[["__scopeId","data-v-00b9973b"]]),d0=["aria-expanded"],h0={class:"process-label"},p0={class:"process-meta"},g0=["title"],m0={class:"process-collapse"},v0={class:"process-inner"},y0=Se({__name:"ToolGroup",props:{name:{},tools:{},live:{type:Boolean,default:!0}},setup(e){const t=e,n=N(!1),s=X(()=>$k(t.tools,t.live)),o=X(()=>t.tools.filter(l=>l.output!==void 0&&!l.isError).length),r=X(()=>s.value==="running"?"执行中":s.value==="error"?"含失败调用":s.value==="suspended"?"含挂起等待":s.value==="unknown"?"结果未持久化":`已完成 ${o.value} 项`);function i(){n.value=!n.value}return(l,a)=>(y(),b("section",{class:de(["tool-process",{open:n.value,running:s.value==="running",error:s.value==="error"}])},[f("button",{class:"process-head",type:"button","aria-expanded":n.value,onClick:i},[Z(be,{name:"chevron-down",size:12,class:"chevron"}),f("span",{class:de(["process-dot",s.value]),"aria-hidden":"true"},null,2),f("span",h0,E(e.name),1),f("span",p0,E(r.value)+" · "+E(e.tools.length)+" 步",1),f("span",{class:"process-names",title:e.tools.map(c=>c.name).join("、")},E(e.tools.map(c=>c.name).join(" · ")),9,g0)],8,d0),f("div",m0,[f("div",v0,[(y(!0),b(ee,null,Ve(t.tools,c=>(y(),qe(kh(re(Ck)(c.name)?f0:jk),{key:c.toolCallId,tool:c,live:e.live},null,8,["tool","live"]))),128))])])],2))}}),b0=xe(y0,[["__scopeId","data-v-e8ad7860"]]),k0={class:"thinking-block"},w0=["title"],_0={class:"teaser-text"},S0={class:"teaser-open"},x0={key:1,class:"thinking-stream"},C0={class:"thinking-panel",role:"dialog","aria-label":"思考过程"},$0={class:"panel-body"},T0=Se({__name:"ThinkingBlock",props:{tool:{},active:{type:Boolean,default:!1},sessionId:{default:""},msgSeq:{default:void 0}},setup(e){const t=e,n=N(!1),s=N(null),o=N(!1),r=N(!1),i=N(t.tool.output??"");Oe(()=>t.tool.output,h=>{h!==void 0&&!o.value&&!r.value&&(i.value=h)});const l=X(()=>!!t.tool.truncated);async function a(){if(!(!l.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&&(i.value=p.output,r.value=!0)}catch{}finally{o.value=!1}}}const c=X(()=>i.value.split(/\n+/).map(p=>p.trim()).filter(Boolean).at(-1)??"");Oe(i,()=>{t.active&&Ot(()=>{const h=s.value;h&&(h.scrollTop=h.scrollHeight)})});function u(){a(),n.value=!0}function d(){n.value=!1}return(h,p)=>(y(),b("div",k0,[e.active?(y(),b("div",x0,[p[1]||(p[1]=f("div",{class:"stream-header"},[f("span",{class:"stream-icon"},"💭"),f("span",{class:"stream-title"},"思考中…"),f("span",{class:"stream-dot"})],-1)),f("div",{ref_key:"streamRef",ref:s,class:"stream-body"},E(i.value),513)])):(y(),b("button",{key:0,class:"thinking-teaser",title:l.value?"思考较长,点击查看完整思考过程":"点击查看完整思考过程",onClick:u},[p[0]||(p[0]=f("span",{class:"teaser-icon"},"💭",-1)),f("span",_0,E(o.value?"加载完整思考…":c.value||"思考过程"),1),f("span",S0,E(l.value?"查看全文":"展开"),1)],8,w0)),(y(),qe(Mi,{to:"body"},[n.value?(y(),b("div",{key:0,class:"thinking-overlay",onClick:At(d,["self"])},[f("aside",C0,[f("header",{class:"panel-header"},[p[2]||(p[2]=f("span",null,"💭 思考过程",-1)),f("button",{class:"panel-close","aria-label":"关闭",onClick:d},"✕")]),f("div",$0,E(i.value||"(空)"),1)])])):D("",!0)]))]))}}),A0=xe(T0,[["__scopeId","data-v-436ab760"]]),R0={key:0,class:"clock"},I0={class:"stat"},E0={class:"stat"},P0={class:"stat"},M0={class:"stat"},L0={class:"stat"},N0={class:"stat"},O0=Se({__name:"TurnStats",props:{stats:{}},setup(e){const t=e,n=N(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)}Oe(()=>t.stats.status,a=>{a==="running"?r():o()},{immediate:!0}),Vt(o);function i(a){return a==null?"—":a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}function l(a){return a==null?"—":a>=1e3?`${(a/1e3).toFixed(1)}k`:`${a}`}return(a,c)=>(y(),b("div",{class:de(["turn-stats",`is-${e.stats.status}`]),"aria-live":"polite"},[e.stats.status==="running"?(y(),b(ee,{key:0},[c[0]||(c[0]=f("span",{class:"badge-gradient"},"正在思考",-1)),n.value!==null?(y(),b("span",R0,E(i(n.value)),1)):D("",!0)],64)):(y(),b(ee,{key:1},[f("span",I0,E(e.stats.turn)+" 轮 · "+E(e.stats.step)+" 步",1),c[10]||(c[10]=f("span",{class:"dot"},"·",-1)),f("span",E0,[c[1]||(c[1]=f("span",{class:"k"},"LLM",-1)),Re(" "+E(i(e.stats.llmMs)),1)]),e.stats.toolMs?(y(),b(ee,{key:0},[c[3]||(c[3]=f("span",{class:"dot"},"·",-1)),f("span",P0,[c[2]||(c[2]=f("span",{class:"k"},"工具",-1)),Re(" "+E(i(e.stats.toolMs)),1)])],64)):D("",!0),e.stats.firstTokenMs!==null&&e.stats.firstTokenMs!==void 0?(y(),b(ee,{key:1},[c[5]||(c[5]=f("span",{class:"dot"},"·",-1)),f("span",M0,[c[4]||(c[4]=f("span",{class:"k"},"首token",-1)),Re(" "+E(i(e.stats.firstTokenMs)),1)])],64)):D("",!0),e.stats.tokens!==null&&e.stats.tokens!==void 0?(y(),b(ee,{key:2},[c[7]||(c[7]=f("span",{class:"dot"},"·",-1)),f("span",L0,[c[6]||(c[6]=f("span",{class:"k"},"tokens",-1)),Re(" "+E(l(e.stats.tokens)),1)])],64)):D("",!0),e.stats.tokensPerSec!==null&&e.stats.tokensPerSec!==void 0?(y(),b(ee,{key:3},[c[9]||(c[9]=f("span",{class:"dot"},"·",-1)),f("span",N0,[c[8]||(c[8]=f("span",{class:"k"},"tok/s",-1)),Re(" "+E(e.stats.tokensPerSec),1)])],64)):D("",!0)],64))],2))}}),D0=xe(O0,[["__scopeId","data-v-95536a3e"]]),B0={key:0,class:"user-wrap"},j0={class:"user-bubble"},U0={key:0,class:"message-meta user-meta"},G0={key:1,class:"meta-time"},F0={key:1,class:"assistant-wrap"},z0={key:0,class:"assistant-brand"},H0={key:0,class:"brand-model"},q0={key:1,class:"brand-streaming"},W0={class:"assistant-body"},V0={key:0,class:"degraded-note"},K0={key:4,class:"streaming-cursor","aria-label":"正在生成"},Z0={key:6,class:"message-meta"},J0=["title"],Y0=["title"],X0={key:4,class:"meta-time"},Q0=Se({__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=N(!1);let r=null;const i=X(()=>n.message.role==="user"),l=X(()=>n.message.role==="assistant"),a=X(()=>n.message.tools.filter(x=>x.name==="thinking")),c=X(()=>n.message.tools.filter(x=>x.name!=="thinking")),u=X(()=>n.message.ts!==void 0?new Date(n.message.ts).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):""),d=X(()=>i.value&&n.isLatestUser&&n.idle),h=vn("showThinking",N(!0)),p=vn("showTools",N(!0)),g=N(!1);let _=null;function k(){if(typeof window>"u"||!("speechSynthesis"in window))return;if(g.value){window.speechSynthesis.cancel(),g.value=!1,_=null;return}const x=n.message.content;if(!x)return;const $=new SpeechSynthesisUtterance(x);$.lang="zh-CN";const A=()=>{_===A&&(g.value=!1,_=null)};_=A,$.addEventListener("end",A),$.addEventListener("error",A),window.speechSynthesis.cancel(),requestAnimationFrame(()=>{window.speechSynthesis.speak($)}),g.value=!0}Vt(()=>{g.value&&"speechSynthesis"in window&&window.speechSynthesis.cancel()});async function w(){try{await navigator.clipboard.writeText(n.message.content)}catch{const x=document.createElement("textarea");x.value=n.message.content,document.body.append(x),x.select(),document.execCommand("copy"),x.remove()}o.value=!0,r!==null&&clearTimeout(r),r=window.setTimeout(()=>{o.value=!1},1500)}return(x,$)=>(y(),b("article",{class:de(["message",e.message.role,{error:e.message.isError}])},[i.value?(y(),b("div",B0,[f("div",j0,E(e.message.content),1),u.value||d.value?(y(),b("div",U0,[d.value?(y(),b("button",{key:0,title:"编辑并重新发送",onClick:$[0]||($[0]=A=>s("edit",e.message.content))},[Z(be,{name:"edit",size:12}),$[3]||($[3]=Re("编辑重发",-1))])):D("",!0),u.value?(y(),b("span",G0,E(u.value),1)):D("",!0)])):D("",!0)])):(y(),b("div",F0,[l.value&&(e.message.model||e.streaming)?(y(),b("div",z0,[e.message.model?(y(),b("span",H0,E(e.message.model),1)):D("",!0),e.streaming?(y(),b("span",q0,[...$[4]||($[4]=[f("i",{"aria-hidden":"true"},null,-1),Re("生成中",-1)])])):D("",!0)])):D("",!0),f("div",W0,[e.message.degraded?(y(),b("p",V0,"该回合早于持久化快照:正文与思考在服务重启后无法恢复(工具记录与消息结构已保留)。")):D("",!0),re(h)?(y(!0),b(ee,{key:1},Ve(a.value,A=>(y(),qe(A0,{key:A.toolCallId,tool:A,active:e.streaming,"session-id":e.sessionId,"msg-seq":e.message.seq},null,8,["tool","active","session-id","msg-seq"]))),128)):D("",!0),c.value.length&&re(p)?(y(),qe(b0,{key:2,name:"工具调用过程",tools:c.value,live:e.streaming},null,8,["tools","live"])):D("",!0),e.message.content?(y(),qe(Sk,{key:3,class:"assistant-content",content:e.message.content,streaming:e.streaming},null,8,["content","streaming"])):e.streaming?(y(),b("span",K0)):D("",!0),e.message.turnStats?(y(),qe(D0,{key:5,stats:e.message.turnStats},null,8,["stats"])):D("",!0),e.message.content||e.message.isError&&!e.streaming||e.canFork||e.showTimestamp&&u.value?(y(),b("div",Z0,[e.message.content?(y(),b("button",{key:0,title:o.value?"已复制":"复制内容",onClick:w},[Z(be,{name:o.value?"check":"copy",size:12},null,8,["name"]),Re(E(o.value?"已复制":"复制"),1)],8,J0)):D("",!0),e.message.content?(y(),b("button",{key:1,title:g.value?"停止朗读":"朗读",onClick:k},[Z(be,{name:g.value?"speaker-off":"speaker",size:12},null,8,["name"]),Re(E(g.value?"停止":"朗读"),1)],8,Y0)):D("",!0),e.message.isError&&!e.streaming?(y(),b("button",{key:2,class:"retry-btn",title:"重发最后一条消息",onClick:$[1]||($[1]=A=>s("retry"))},[Z(be,{name:"refresh",size:12}),$[5]||($[5]=Re("重试",-1))])):D("",!0),l.value&&e.canFork&&!e.streaming?(y(),b("button",{key:3,title:"以当前对话为起点创建一个新会话",onClick:$[2]||($[2]=A=>s("fork"))},[Z(be,{name:"fork",size:12}),$[6]||($[6]=Re("Fork",-1))])):D("",!0),e.showTimestamp&&u.value?(y(),b("time",X0,E(u.value),1)):D("",!0)])):D("",!0)])]))],2))}}),ew=xe(Q0,[["__scopeId","data-v-7209f2f7"]]),tw=""+new URL("../icon.ico",import.meta.url).href,nw={class:"empty-state"},sw={class:"suggestions"},ow=["onClick"],rw={class:"suggestion-icon"},iw={class:"suggestion-title"},lw=["title"],aw={class:"workdir-path"},cw={class:"empty-status","aria-label":"连接与模型状态"},uw={class:"status-item"},fw={class:"status-item"},dw={class:"status-item"},hw=Se({__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 i=r<=1?Math.round(r*100):Math.round(r);return`${Math.min(i,100)}%`}return(r,i)=>(y(),b("div",nw,[i[3]||(i[3]=f("div",{class:"empty-logo"},[f("img",{src:tw,alt:"Scream",class:"logo-img"})],-1)),i[4]||(i[4]=f("h1",{class:"empty-title"},"Scream Web UI",-1)),i[5]||(i[5]=f("p",{class:"empty-subtitle"},"给 Scream 发消息,开始处理你的任务",-1)),f("div",sw,[(y(),b(ee,null,Ve(s,l=>f("button",{key:l.title,class:"suggestion-card",onClick:a=>n("pick",l.prompt)},[f("span",rw,[Z(be,{name:l.icon,size:22},null,8,["name"])]),f("span",iw,E(l.title),1)],8,ow)),64))]),e.workDir?(y(),b("div",{key:0,class:"empty-workdir",title:e.workDir},[i[0]||(i[0]=f("span",{class:"workdir-label"},"工作目录",-1)),f("span",aw,E(e.workDir),1)],8,lw)):D("",!0),f("div",cw,[f("span",{class:de(["status-dot",e.connected?"on":"off"])},null,2),f("span",uw,E(e.connected?"已连接":"未连接"),1),e.model?(y(),b(ee,{key:0},[i[1]||(i[1]=f("span",{class:"status-sep"},"·",-1)),f("span",fw,"模型 "+E(e.model),1)],64)):D("",!0),e.contextUsage!==null&&e.contextUsage!==void 0?(y(),b(ee,{key:1},[i[2]||(i[2]=f("span",{class:"status-sep"},"·",-1)),f("span",dw,"上下文 "+E(o(e.contextUsage)),1)],64)):D("",!0)]),i[6]||(i[6]=f("div",{class:"empty-shortcuts","aria-hidden":"true"},[f("span",null,[f("kbd",null,"⌘K"),Re(" 搜索会话")]),f("span",null,[f("kbd",null,"⌘N"),Re(" 新建会话")])],-1))]))}}),pw=xe(hw,[["__scopeId","data-v-cc2342f3"]]),gw={class:"message-list-wrapper"},mw={key:0,class:"conn-banner",role:"status"},vw={key:0,class:"load-older-row"},yw=["disabled"],bw={key:2,class:"message-skeleton","aria-hidden":"true"},kw=Se({__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=N(null),r=X(()=>{for(let C=n.messages.length-1;C>=0;C--)if(n.messages[C].role==="user")return n.messages[C].id;return null}),i=X(()=>{var C;return((C=n.messages.at(-1))==null?void 0:C.id)??null}),l=X(()=>{var C;return((C=[...n.messages].reverse().find(R=>R.role==="assistant"))==null?void 0:C.id)??null});function a(C){const R=n.messages[C];if(!R)return!1;if(R.role!=="assistant")return!0;const P=n.messages[C+1];return!P||P.role!=="assistant"||R.ts!==void 0&&P.ts!==void 0&&P.ts-R.ts>300*1e3}const c=X(()=>{var P;const C=n.messages.at(-1);if(!C)return 0;let R=C.content.length;for(const J of C.tools)R+=((P=J.output)==null?void 0:P.length)??0;return R});let u=!1;const d=N(!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 R=o.value;if(!R)return;const P=p()?"auto":C;R.scrollTo({top:R.scrollHeight,behavior:P})})}let _=null;function k(){const C=o.value,R=n.sessionId;!C||!R||_===null&&(_=requestAnimationFrame(()=>{_=null;try{localStorage.setItem(`scream-scroll:${R}`,String(C.scrollTop))}catch{}}))}function w(){const C=o.value,R=n.sessionId;if(!C||!R)return;let P=null;try{P=localStorage.getItem(`scream-scroll:${R}`)}catch{}P&&(C.scrollTop=Number(P))}let x=0;Oe(()=>n.olderLoading,C=>{const R=o.value;if(R){if(C)x=R.scrollHeight;else if(x>0){const P=R.scrollHeight-x;P>0&&(R.scrollTop=R.scrollTop+P),x=0}}});function $(){const C=o.value;if(!C)return;const R=C.scrollHeight-C.scrollTop-C.clientHeight>80;d.value=R,R&&u&&(u=!1),n.busy||k()}let A="";Oe(()=>n.sessionId,()=>{A=""}),Oe(()=>[n.messages.length,c.value],([C],[R])=>{if(C!==R){if(C>0&&A!==n.sessionId){A=n.sessionId,requestAnimationFrame(()=>requestAnimationFrame(w));return}u=!0,d.value=!1,g("smooth");return}!u&&!h()||g("auto")}),Oe(()=>n.busy,C=>{C||(u=!1)});function F(){u=!0,d.value=!1,g("smooth")}const Q=X(()=>!n.busy||n.messages.length===0?!1:n.messages.at(-1).role==="user");return Ut(()=>{var C;(C=o.value)==null||C.addEventListener("scroll",$,{passive:!0}),requestAnimationFrame(()=>requestAnimationFrame(w))}),rr(()=>{var C;(C=o.value)==null||C.removeEventListener("scroll",$),_!==null&&(cancelAnimationFrame(_),_=null)}),(C,R)=>(y(),b("div",gw,[!e.connected&&e.messages.length>0?(y(),b("div",mw,[R[6]||(R[6]=f("span",{class:"conn-dot","aria-hidden":"true"},null,-1)),R[7]||(R[7]=f("span",null,"连接中断,自动恢复中…",-1)),f("button",{class:"conn-retry",onClick:R[0]||(R[0]=P=>s("retry-connection"))},"立即重试")])):D("",!0),f("div",{ref_key:"listRef",ref:o,class:"message-list"},[e.olderAvailable?(y(),b("div",vw,[f("button",{class:"load-older-btn",disabled:e.olderLoading,onClick:R[1]||(R[1]=P=>s("load-older"))},E(e.olderLoading?"加载中…":"加载更早消息"),9,yw)])):D("",!0),e.messages.length===0?(y(),qe(pw,{key:1,"work-dir":e.workDir,model:e.model,"context-usage":e.contextUsage,connected:e.connected,onPick:R[2]||(R[2]=P=>s("pick",P))},null,8,["work-dir","model","context-usage","connected"])):D("",!0),(y(!0),b(ee,null,Ve(e.messages,(P,J)=>(y(),qe(ew,{key:P.id,message:P,"is-latest-user":P.id===r.value,idle:!e.busy,streaming:e.busy&&P.id===i.value&&P.role==="assistant","session-id":e.sessionId,"can-fork":!e.busy&&P.id===l.value,"show-timestamp":a(J),onEdit:R[3]||(R[3]=ie=>s("edit",ie)),onRetry:R[4]||(R[4]=ie=>s("retry-message")),onFork:R[5]||(R[5]=ie=>s("fork"))},null,8,["message","is-latest-user","idle","streaming","session-id","can-fork","show-timestamp"]))),128)),Q.value?(y(),b("div",bw,[...R[8]||(R[8]=[f("div",{class:"sk-body"},[f("div",{class:"sk-line sk-w-60"}),f("div",{class:"sk-line sk-w-90"}),f("div",{class:"sk-line sk-w-40"})],-1)])])):D("",!0)],512),Z(ur,{name:"scroll-btn"},{default:$t(()=>[d.value?(y(),b("button",{key:0,class:"scroll-to-bottom",title:"滚动到最新消息",onClick:F},[Z(be,{name:"chevron-down",size:18})])):D("",!0)]),_:1})]))}}),ww=xe(kw,[["__scopeId","data-v-0705d80e"]]),_w={class:"files-pane"},Sw={class:"files-path"},xw={class:"crumbs"},Cw=["onClick"],$w={key:0,class:"crumb-sep"},Tw={class:"crumb-name"},Aw={key:0,class:"files-error"},Rw={key:1,class:"files-loading"},Iw={class:"files-preview-head"},Ew=["title"],Pw={key:0,class:"files-preview-note"},Mw={class:"files-preview-body"},Lw={key:0,class:"files-pre"},Nw=["src"],Ow=["src"],Dw=["src"],Bw={key:4,class:"files-binary"},jw={key:3,class:"files-list"},Uw=["onClick"],Gw={class:"files-name"},Fw={class:"files-meta"},zw={key:0,class:"files-empty"},uo="/api/v1/files",Hw=Se({__name:"FilesBrowser",props:{initialPath:{default:""}},setup(e){const t=e,n=N(""),s=N([]),o=N(!1),r=N(""),i=N(null),l=N("");function a(k){return`${uo}/raw?path=${encodeURIComponent(k)}`}const c=X(()=>{if(!n.value)return[];const k=n.value.split("/"),w=[];for(let x=0;x<k.length;x++){if(k[x]==="")continue;let $=k[x];x>1&&$==="Users"&&k[x-1]===""&&($=$),w.push({label:$.slice(0,12),path:k.slice(0,x+1).join("/")||"/"})}return w.length>4?[{label:"…",path:"/"},...w.slice(w.length-3)]:w});async function u(k){o.value=!0,r.value="",i.value=null;try{const w=await fetch(`${uo}/list?path=${encodeURIComponent(k)}`);if(!w.ok)throw new Error(`HTTP ${w.status}`);const x=await w.json();n.value=x.path||await d(),s.value=x.entries,n.value||(r.value="没有可访问的目录(尚无会话)")}catch(w){r.value=w instanceof Error?w.message:String(w)}finally{o.value=!1}}async function d(){try{return(await(await fetch(`${uo}/root`)).json()).roots[0]??""}catch{return""}}async function h(k){if(k.type==="dir"){await u(k.path);return}if(p(k.name)==="binary"){i.value={path:k.path,content:"",truncated:!1},l.value="该文件类型暂不支持预览";return}l.value="";try{const x=await fetch(`${uo}/read?path=${encodeURIComponent(k.path)}`);if(!x.ok)throw new Error(`HTTP ${x.status}`);const $=await x.json();$.truncated&&(l.value="文件较大,仅显示前 256KB"),i.value=$}catch(x){l.value=x instanceof Error?x.message:String(x),i.value=null}}function p(k){var x;const w=((x=k.split(".").pop())==null?void 0:x.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","svg","ico","avif"].includes(w)?"image":["mp3","wav","ogg","m4a"].includes(w)?"audio":w==="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(w)?"text":"binary"}const g=X(()=>i.value?{name:i.value.path.split(/[\\/]/).pop()??"",path:i.value.path}:null);function _(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}return Ut(()=>{u(t.initialPath)}),Oe(()=>t.initialPath,k=>{k&&u(k)}),(k,w)=>{var x,$,A,F,Q,C;return y(),b("div",_w,[f("div",Sw,[f("button",{class:"files-up",title:"上一级","aria-label":"上一级",onClick:w[0]||(w[0]=R=>u(n.value.split("/").slice(0,-1).join("/")||"/"))},[Z(be,{name:"chevron-left",size:16})]),f("div",xw,[(y(!0),b(ee,null,Ve(c.value,(R,P)=>(y(),b("span",{key:P,class:"crumb",onClick:J=>u(R.path)},[P>0?(y(),b("b",$w,"/")):D("",!0),f("span",Tw,E(R.label),1)],8,Cw))),128))])]),r.value?(y(),b("p",Aw,E(r.value),1)):o.value?(y(),b("p",Rw,"加载中…")):D("",!0),i.value?(y(),b(ee,{key:2},[f("div",Iw,[f("span",{class:"files-preview-name",title:(x=i.value)==null?void 0:x.path},E(($=g.value)==null?void 0:$.name),9,Ew),f("button",{class:"files-preview-close",title:"关闭预览","aria-label":"关闭预览",onClick:w[1]||(w[1]=R=>i.value=null)},[Z(be,{name:"x",size:16})])]),l.value?(y(),b("p",Pw,E(l.value),1)):D("",!0),f("div",Mw,[p(((A=g.value)==null?void 0:A.name)??"")==="text"?(y(),b("pre",Lw,E(i.value.content),1)):p(((F=g.value)==null?void 0:F.name)??"")==="image"?(y(),b("img",{key:1,src:a(i.value.path),alt:"",class:"files-img"},null,8,Nw)):p(((Q=g.value)==null?void 0:Q.name)??"")==="audio"?(y(),b("audio",{key:2,src:a(i.value.path),controls:""},null,8,Ow)):p(((C=g.value)==null?void 0:C.name)??"")==="pdf"?(y(),b("iframe",{key:3,src:a(i.value.path),class:"files-pdf",title:"PDF 预览"},null,8,Dw)):(y(),b("p",Bw,"该文件类型暂不支持预览(可下载)。"))])],64)):(y(),b("ul",jw,[(y(!0),b(ee,null,Ve(s.value,R=>(y(),b("li",{key:R.path},[f("button",{class:de(["files-item",{dir:R.type==="dir"}]),onClick:P=>h(R)},[Z(be,{name:R.type==="dir"?"folder":"file",size:16},null,8,["name"]),f("span",Gw,E(R.name),1),f("span",Fw,E(R.type==="dir"?"目录":_(R.size)),1)],10,Uw)]))),128)),!o.value&&s.value.length===0?(y(),b("li",zw,"空目录")):D("",!0)]))])}}}),qw=xe(Hw,[["__scopeId","data-v-fa6c15e9"]]),Ww=34;function zr(e){const t=e.split("/"),n=t.at(-1)??e;return t.length<=2?{dir:t.length===2?`${t[0]}/`:"",base:n}:e.length<=Ww?{dir:`${t.slice(0,-1).join("/")}/`,base:n}:{dir:`…/${t.at(-2)}/`,base:n}}const Vw={class:"panel-head-row"},Kw=["aria-expanded"],Zw={class:"head-icon"},Jw=["title"],Yw={key:1,class:"head-hint"},Xw={class:"head-tail"},Qw={key:0,class:"head-count"},e_={class:"panel-body"},t_={key:0,class:"git-files"},n_=["title","onClick"],s_={class:"git-file-name"},o_={key:0,class:"git-file-dir"},r_={class:"git-file-base"},i_={key:0,class:"git-file-stat"},l_={key:0,class:"add"},a_={key:1,class:"del"},c_={key:2,class:"diff-body"},u_={key:3,class:"diff-empty"},f_={key:1,class:"diff-empty"},d_=8,Ia="scream-panel-git-open",h_=Se({__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"},i=N(!1),l=N(!0);try{l.value=localStorage.getItem(Ia)!=="0"}catch{}function a(){l.value=!l.value;try{localStorage.setItem(Ia,l.value?"1":"0")}catch{}}function c(){s("refresh")}const u=X(()=>{var g;const p=((g=n.gitStatus)==null?void 0:g.files)??[];return i.value?p:p.slice(0,d_)}),d=X(()=>{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=X(()=>{var k,w;const p=((k=n.gitStatus)==null?void 0:k.ahead)??0,g=((w=n.gitStatus)==null?void 0:w.behind)??0;if(!p&&!g)return"";const _=[];return p&&_.push(`↑${p}`),g&&_.push(`↓${g}`),` · ${_.join(" ")}`});return(p,g)=>{var _;return y(),b("section",{class:de(["panel-section","git-panel",{"is-open":l.value}])},[f("div",Vw,[f("button",{class:"panel-head","aria-expanded":l.value,onClick:a},[f("span",Zw,[Z(be,{name:"git-branch",size:14})]),g[1]||(g[1]=f("span",{class:"head-title"},"Git 变更",-1)),e.gitStatus?(y(),b("span",{key:0,class:"head-hint",title:`${e.gitStatus.branch??"detached"}${h.value}`},E(e.gitStatus.branch??"detached")+E(h.value),9,Jw)):(y(),b("span",Yw,"状态不可用")),f("span",Xw,[e.gitStatus?(y(),b("span",Qw,E(e.gitStatus.changed),1)):D("",!0),Z(be,{class:de(["chevron",{rotated:l.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,Kw),f("button",{class:"icon-btn",title:"刷新","aria-label":"刷新 Git 状态",onClick:c},[Z(be,{name:"refresh",size:14})])]),Ye(f("div",e_,[e.gitStatus?(y(),b(ee,{key:0},[u.value.length?(y(),b("ul",t_,[(y(!0),b(ee,null,Ve(u.value,k=>(y(),b("li",{key:k.path},[f("button",{class:"git-file",title:`查看 ${k.displayPath??k.path} 的 diff`,onClick:w=>s("diff",{path:k.path,display:k.displayPath??k.path,adds:k.adds,dels:k.dels})},[f("span",{class:de(["git-file-status",r[k.status]??""])},E(o[k.status]??k.status),3),f("span",s_,[re(zr)(k.displayPath??k.path).dir?(y(),b("span",o_,E(re(zr)(k.displayPath??k.path).dir),1)):D("",!0),f("span",r_,E(re(zr)(k.displayPath??k.path).base),1)]),k.adds!==void 0||k.dels!==void 0?(y(),b("span",i_,[k.adds?(y(),b("span",l_,"+"+E(k.adds),1)):D("",!0),k.dels?(y(),b("span",a_,"−"+E(k.dels),1)):D("",!0)])):D("",!0)],8,n_)]))),128))])):D("",!0),d.value?(y(),b("button",{key:1,class:"git-more",onClick:g[0]||(g[0]=k=>i.value=!i.value)},E(i.value?"收起列表":`显示全部 ${((_=e.gitStatus.files)==null?void 0:_.length)??0} 个文件`),1)):D("",!0),e.gitStatus.diffStat?(y(),b("pre",c_,E(e.gitStatus.diffStat),1)):u.value.length?D("",!0):(y(),b("div",u_,"工作区干净,没有变更。"))],64)):(y(),b("div",f_,"读取 Git 状态失败,点右上角刷新重试。"))],512),[[eu,l.value]])],2)}}}),p_=xe(h_,[["__scopeId","data-v-07e2afd4"]]),g_={class:"goal-panel panel-section"},m_={class:"section-heading"},v_={class:"head-icon"},y_=["title"],b_={key:0,class:"head-tail"},k_={class:"panel-body"},w_={key:0,class:"empty-state"},__=["disabled"],S_={class:"refine-row"},x_=["disabled"],C_={key:0},$_=["disabled"],T_={class:"budget-grid"},A_=["disabled"],R_=["disabled"],I_={class:"time-budget"},E_=["disabled"],P_=["disabled"],M_=["disabled"],L_={key:0,class:"goal-summary"},N_={class:"objective"},O_={class:"criterion"},D_={key:0,class:"reason"},B_={class:"goal-metrics"},j_={class:"goal-metric"},U_={key:0,class:"bar"},G_={class:"goal-metric"},F_={key:0,class:"bar"},z_={class:"goal-metric"},H_={key:0,class:"bar"},q_={key:1,class:"budget-warning"},W_={key:2,class:"notes"},V_={class:"panel-actions"},K_=["disabled"],Z_=["disabled"],J_=["disabled"],Y_=["disabled"],X_=["disabled"],Q_={class:"budget-grid"},eS=["disabled"],tS=["disabled"],nS={class:"time-budget"},sS=["disabled"],oS=["disabled"],rS={class:"edit-actions"},iS=["disabled"],lS=["disabled"],aS={key:3,class:"form-error"},cS={key:4,class:"pending-copy"},uS=Se({__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=N(""),s=N(""),o=N(""),r=N(""),i=N(""),l=N("minutes"),a=N(!1),c=N(null),u=N(!1),d=X(()=>t.connectionStatus==="connected"),h=X(()=>!t.sessionId||!d.value||t.archived||t.pending),p=X(()=>h.value),g=X(()=>{var O;return{active:"进行中",paused:"已暂停",blocked:"受阻",complete:"已完成"}[((O=t.goal)==null?void 0:O.status)??"active"]}),_=X(()=>t.sessionId?t.archived?"归档会话为只读状态":d.value?t.pending?"正在提交请求…":t.goal?"状态由核心事件实时同步":"创建后 Agent 将自动开始执行":"连接恢复后可继续管理":"选择或新建会话后即可配置");Oe(()=>t.sessionId,()=>{a.value=!1,k()}),Oe(()=>{var O;return(O=t.goal)==null?void 0:O.goalId},(O,L)=>{a.value=!1,O!==L&&k()});function k(){n.value="",s.value="",o.value="",r.value="",i.value="",l.value="minutes",u.value=!1,c.value=null}function w(O,L){const te=O.trim();if(!te)return null;const q=Number(te);if(!Number.isSafeInteger(q)||q<=0){c.value=`${L}必须是正整数。`;return}return q}function x(){c.value=null;const O=w(o.value,"轮次预算");if(O===void 0)return null;const L=w(r.value,"Token 预算");if(L===void 0)return null;const te=w(i.value,"时间预算");if(te===void 0)return null;const q=[];return O!==null&&q.push({value:O,unit:"turns"}),L!==null&&q.push({value:L,unit:"tokens"}),te!==null&&q.push({value:te,unit:l.value}),q}async function $(){const O=n.value.trim();if(!O){c.value="请先输入需要优化的目标描述。";return}c.value=null,u.value=!1;const L=await t.refineGoal(O);L!==null&&(n.value=L,u.value=!0)}async function A(){const O=n.value.trim();if(!O){c.value="目标内容不能为空。";return}const L=x();if(L===null)return;await t.createGoal({objective:O,completionCriterion:s.value.trim()||void 0,replace:!1,budgets:L})&&(u.value=!1)}function F(O){O===null?(i.value="",l.value="minutes"):O%36e5===0?(i.value=String(O/36e5),l.value="hours"):O%6e4===0?(i.value=String(O/6e4),l.value="minutes"):O%1e3===0?(i.value=String(O/1e3),l.value="seconds"):(i.value=String(O),l.value="milliseconds")}function Q(){const O=t.goal;O&&(n.value=O.objective,o.value=O.budget.turnBudget===null?"":String(O.budget.turnBudget),r.value=O.budget.tokenBudget===null?"":String(O.budget.tokenBudget),F(O.budget.wallClockBudgetMs),c.value=null,a.value=!0)}function C(O,L){return L==="hours"?O*36e5:L==="minutes"?O*6e4:L==="seconds"?O*1e3:O}async function R(){const O=t.goal;if(!O)return;const L=n.value.trim();if(!L){c.value="目标内容不能为空。";return}const te=x();if(te===null)return;const q=w(o.value,"轮次预算"),ge=w(r.value,"Token 预算"),Ae=w(i.value,"时间预算");if(q===void 0||ge===void 0||Ae===void 0)return;if(O.budget.turnBudget!==null&&q===null){c.value="当前协议不支持清除已有轮次预算,请填写新的正整数。";return}if(O.budget.tokenBudget!==null&&ge===null){c.value="当前协议不支持清除已有 Token 预算,请填写新的正整数。";return}if(O.budget.wallClockBudgetMs!==null&&Ae===null){c.value="当前协议不支持清除已有时间预算,请填写新的正整数。";return}const ke=te.filter(Te=>Te.unit==="turns"?Te.value!==O.budget.turnBudget:Te.unit==="tokens"?Te.value!==O.budget.tokenBudget:C(Te.value,Te.unit)!==O.budget.wallClockBudgetMs),ae=L===O.objective?void 0:L;if(ae===void 0&&ke.length===0){c.value="目标与预算没有变化。";return}await t.updateGoal({objective:ae,budgets:ke})&&(a.value=!1)}async function P(O){c.value=null,!(O==="cancel"&&!window.confirm("确定取消当前 Goal?当前 Goal 状态将被清除。"))&&(O==="pause"?await t.pauseGoal():O==="resume"?await t.resumeGoal():await t.cancelGoal())}function J(O){return O.toLocaleString("zh-CN")}function ie(O){if(O<1e3)return`${O} 毫秒`;const L=Math.floor(O/1e3);if(L<60)return`${L} 秒`;const te=Math.floor(L/3600),q=Math.floor(L%3600/60);return te>0?`${te} 小时 ${q} 分钟`:`${q} 分钟`}function z(O,L){return L===null||L<=0?0:Math.min(100,Math.round(O/L*100))}function ve(O){return new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}return(O,L)=>(y(),b("section",g_,[f("div",m_,[f("span",v_,[Z(be,{name:"target",size:14})]),L[15]||(L[15]=f("span",{class:"head-title"},"Goal 管理",-1)),f("span",{class:"head-hint",title:_.value},E(_.value),9,y_),e.goal?(y(),b("span",b_,[f("span",{class:de(["status-pill",`is-${e.goal.status}`])},E(g.value),3)])):D("",!0)]),f("div",k_,[e.sessionId?e.goal?(y(),b(ee,{key:2},[a.value?(y(),b("form",{key:1,class:"goal-form edit-form",onSubmit:At(R,["prevent"])},[f("label",null,[L[31]||(L[31]=f("span",null,"目标内容",-1)),Ye(f("textarea",{"onUpdate:modelValue":L[9]||(L[9]=te=>n.value=te),rows:"3",maxlength:"4000",disabled:h.value||e.busy},null,8,X_),[[ut,n.value]])]),L[36]||(L[36]=f("div",{class:"budget-title"},[Re("更新预算 "),f("small",null,"仅提交发生变化的预算")],-1)),f("div",Q_,[f("label",null,[L[32]||(L[32]=f("span",null,"轮次",-1)),Ye(f("input",{"onUpdate:modelValue":L[10]||(L[10]=te=>o.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,eS),[[ut,o.value]])]),f("label",null,[L[33]||(L[33]=f("span",null,"Token",-1)),Ye(f("input",{"onUpdate:modelValue":L[11]||(L[11]=te=>r.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,tS),[[ut,r.value]])])]),f("div",nS,[f("label",null,[L[34]||(L[34]=f("span",null,"时间",-1)),Ye(f("input",{"onUpdate:modelValue":L[12]||(L[12]=te=>i.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||e.busy},null,8,sS),[[ut,i.value]])]),Ye(f("select",{"onUpdate:modelValue":L[13]||(L[13]=te=>l.value=te),"aria-label":"时间预算单位",disabled:h.value||e.busy},[...L[35]||(L[35]=[f("option",{value:"minutes"},"分钟",-1),f("option",{value:"hours"},"小时",-1),f("option",{value:"seconds"},"秒",-1),f("option",{value:"milliseconds"},"毫秒",-1)])],8,oS),[[Ql,l.value]])]),f("div",rS,[f("button",{type:"button",class:"secondary",disabled:e.pending,onClick:L[14]||(L[14]=te=>a.value=!1)},"返回",8,iS),f("button",{class:"primary small",type:"submit",disabled:h.value||e.busy},"保存修改",8,lS)])],32)):(y(),b("div",L_,[f("div",N_,[L[24]||(L[24]=f("small",null,"目标",-1)),f("p",null,E(e.goal.objective),1)]),f("div",O_,[L[25]||(L[25]=f("small",null,"完成标准",-1)),f("p",null,E(e.goal.completionCriterion??"未设置,由 Agent 根据目标判断完成。"),1)]),e.goal.terminalReason?(y(),b("div",D_,[L[26]||(L[26]=f("strong",null,"状态原因",-1)),f("span",null,E(e.goal.terminalReason),1)])):D("",!0),f("dl",B_,[f("div",j_,[L[27]||(L[27]=f("dt",null,"轮次",-1)),f("dd",null,E(e.goal.turnsUsed)+" / "+E(e.goal.budget.turnBudget??"不限"),1),e.goal.budget.turnBudget!==null?(y(),b("i",U_,[f("i",{style:ln({width:`${z(e.goal.turnsUsed,e.goal.budget.turnBudget)}%`})},null,4)])):D("",!0)]),f("div",G_,[L[28]||(L[28]=f("dt",null,"Token",-1)),f("dd",null,E(J(e.goal.tokensUsed))+" / "+E(e.goal.budget.tokenBudget===null?"不限":J(e.goal.budget.tokenBudget)),1),e.goal.budget.tokenBudget!==null?(y(),b("i",F_,[f("i",{style:ln({width:`${z(e.goal.tokensUsed,e.goal.budget.tokenBudget)}%`})},null,4)])):D("",!0)]),f("div",z_,[L[29]||(L[29]=f("dt",null,"时间",-1)),f("dd",null,E(ie(e.goal.wallClockMs))+" / "+E(e.goal.budget.wallClockBudgetMs===null?"不限":ie(e.goal.budget.wallClockBudgetMs)),1),e.goal.budget.wallClockBudgetMs!==null?(y(),b("i",H_,[f("i",{style:ln({width:`${z(e.goal.wallClockMs,e.goal.budget.wallClockBudgetMs)}%`})},null,4)])):D("",!0)])]),e.goal.budget.overBudget?(y(),b("div",q_,"已达到或超过执行预算。")):D("",!0),e.goal.notes.length?(y(),b("details",W_,[f("summary",null,"工作记录("+E(e.goal.notes.length)+")",1),f("ol",null,[(y(!0),b(ee,null,Ve(e.goal.notes,te=>(y(),b("li",{key:`${te.time}-${te.content}`},[f("time",null,E(ve(te.time)),1),f("span",null,E(te.content),1)]))),128))])])):D("",!0),f("div",V_,[e.goal.status!=="complete"?(y(),b("button",{key:0,class:"secondary",disabled:h.value||e.busy,onClick:Q},[Z(be,{name:"edit",size:14}),L[30]||(L[30]=Re("编辑",-1))],8,K_)):D("",!0),e.goal.status==="active"?(y(),b("button",{key:1,class:"secondary",disabled:h.value,onClick:L[6]||(L[6]=te=>P("pause"))},"暂停",8,Z_)):D("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(y(),b("button",{key:2,class:"primary small",disabled:h.value||e.busy,onClick:L[7]||(L[7]=te=>P("resume"))},"继续",8,J_)):D("",!0),f("button",{class:"danger",disabled:h.value,onClick:L[8]||(L[8]=te=>P("cancel"))},"取消 Goal",8,Y_)])]))],64)):(y(),b("form",{key:1,class:"goal-form",onSubmit:At(A,["prevent"])},[f("label",null,[L[16]||(L[16]=f("span",null,"目标内容",-1)),Ye(f("textarea",{"onUpdate:modelValue":L[0]||(L[0]=te=>n.value=te),rows:"3",maxlength:"4000",placeholder:"描述希望 Agent 持续完成的目标",disabled:p.value},null,8,__),[[ut,n.value]])]),f("div",S_,[f("button",{type:"button",class:"secondary",disabled:p.value||!n.value.trim(),onClick:$},[Z(be,{name:"sparkles",size:15}),L[17]||(L[17]=Re(" AI 优化 ",-1))],8,x_),u.value?(y(),b("small",C_,"已优化,请确认或继续编辑后再创建。")):D("",!0)]),f("label",null,[L[18]||(L[18]=f("span",null,[Re("完成标准 "),f("small",null,"可选")],-1)),Ye(f("textarea",{"onUpdate:modelValue":L[1]||(L[1]=te=>s.value=te),rows:"2",placeholder:"例如:聚焦测试、类型检查与 Web 构建全部通过",disabled:p.value},null,8,$_),[[ut,s.value]])]),L[23]||(L[23]=f("div",{class:"budget-title"},[Re("执行预算 "),f("small",null,"留空表示不限制")],-1)),f("div",T_,[f("label",null,[L[19]||(L[19]=f("span",null,"轮次",-1)),Ye(f("input",{"onUpdate:modelValue":L[2]||(L[2]=te=>o.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,A_),[[ut,o.value]])]),f("label",null,[L[20]||(L[20]=f("span",null,"Token",-1)),Ye(f("input",{"onUpdate:modelValue":L[3]||(L[3]=te=>r.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,R_),[[ut,r.value]])])]),f("div",I_,[f("label",null,[L[21]||(L[21]=f("span",null,"时间",-1)),Ye(f("input",{"onUpdate:modelValue":L[4]||(L[4]=te=>i.value=te),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,E_),[[ut,i.value]])]),Ye(f("select",{"onUpdate:modelValue":L[5]||(L[5]=te=>l.value=te),"aria-label":"时间预算单位",disabled:p.value},[...L[22]||(L[22]=[f("option",{value:"minutes"},"分钟",-1),f("option",{value:"hours"},"小时",-1),f("option",{value:"seconds"},"秒",-1),f("option",{value:"milliseconds"},"毫秒",-1)])],8,P_),[[Ql,l.value]])]),f("button",{class:"primary",type:"submit",disabled:p.value||!n.value.trim()},E(e.pending?"正在创建…":"创建并开始执行"),9,M_)],32)):(y(),b("div",w_,"暂无会话,Goal 管理暂不可用。")),c.value||e.error?(y(),b("p",aS,E(c.value??e.error),1)):e.pending?(y(),b("p",cS,"请求处理中,状态将在核心事件到达后同步。")):D("",!0)])]))}}),fS=xe(uS,[["__scopeId","data-v-2e8dbdc6"]]),dS={class:"panel-section like-section"},hS={class:"section-heading"},pS={class:"head-icon"},gS={class:"panel-body"},mS={class:"kv-rows"},vS={class:"dialog"},yS=["onUpdate:modelValue","placeholder"],bS={key:0,class:"dialog-error"},kS={class:"dialog-actions"},wS=["disabled"],_S=Se({__name:"LikePanel",props:{like:{},updateLike:{type:Function}},setup(e){const t=e,n=N(!1),s=N(!1),o=N(""),r=N({}),i=[{key:"nickname",label:"昵称",placeholder:"用户称呼,如:老板"},{key:"tone",label:"语气",placeholder:"AI 风格,如:专业不拖沓"},{key:"other",label:"偏好",placeholder:"其他用户偏好"},{key:"doNot",label:"禁止",placeholder:"用户明确不让做的事"}];function l(){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)=>(y(),b("section",dS,[f("div",hS,[f("span",pS,[Z(be,{name:"settings",size:14})]),u[2]||(u[2]=f("span",{class:"head-title"},"偏好设置",-1)),u[3]||(u[3]=f("span",{class:"head-hint"},"/like 用户偏好",-1))]),f("div",gS,[f("dl",mS,[(y(),b(ee,null,Ve(i,d=>f("div",{key:d.key,class:"kv-row"},[f("dt",null,E(d.label),1),f("dd",null,E((e.like[d.key]??"").trim()||"未设置"),1)])),64))]),f("div",{class:"panel-actions"},[f("button",{class:"like-edit",onClick:l},"编辑偏好")])]),n.value?(y(),b("div",{key:0,class:"dialog-overlay",onClick:u[1]||(u[1]=At(d=>n.value=!1,["self"]))},[f("div",vS,[u[4]||(u[4]=f("div",{class:"dialog-title"},"编辑用户偏好",-1)),(y(),b(ee,null,Ve(i,d=>f("label",{key:d.key,class:"dialog-field"},[f("span",null,E(d.label),1),Ye(f("input",{"onUpdate:modelValue":h=>r.value[d.key]=h,placeholder:d.placeholder},null,8,yS),[[ut,r.value[d.key]]])])),64)),o.value?(y(),b("div",bS,E(o.value),1)):D("",!0),f("div",kS,[f("button",{onClick:u[0]||(u[0]=d=>n.value=!1)},"取消"),f("button",{disabled:s.value,onClick:a},E(s.value?"保存中…":"确认"),9,wS)])])])):D("",!0)]))}}),SS=xe(_S,[["__scopeId","data-v-a7906d58"]]),xS=["aria-expanded"],CS={class:"head-icon"},$S={class:"head-hint"},TS={class:"head-tail"},AS=["title"],RS={class:"panel-body"},IS={class:"stat-grid"},ES={class:"stat"},PS={class:"stat"},MS=["title"],LS={key:1,class:"faint"},NS={class:"stat wide"},OS={class:"mono"},Ea="scream-panel-runstatus-open",DS=Se({__name:"RunStatusPanel",props:{status:{},busy:{type:Boolean,default:!1},connectionStatus:{}},setup(e){const t=e,n=N(!0);try{n.value=localStorage.getItem(Ea)!=="0"}catch{}function s(){n.value=!n.value;try{localStorage.setItem(Ea,n.value?"1":"0")}catch{}}const o=X(()=>{const l=t.status.contextUsage;return l===void 0?null:Math.round((l>1?l/100:l)*100)}),r=X(()=>{var l,a;return`Tokens: ${((l=t.status.contextTokens)==null?void 0:l.toLocaleString())??"-"} / ${((a=t.status.maxContextTokens)==null?void 0:a.toLocaleString())??"-"}`}),i=X(()=>({connected:"已连接",connecting:"连接中",reconnecting:"重连中",disconnected:"已断开",idle:"空闲"})[t.connectionStatus]??"空闲");return Oe(()=>t.busy,()=>{t.busy&&!n.value&&(n.value=!0)}),(l,a)=>{var c,u;return y(),b("section",{class:de(["panel-section","run-status",{"is-open":n.value}])},[f("button",{class:"panel-head","aria-expanded":n.value,onClick:s},[f("span",CS,[Z(be,{name:"activity",size:14})]),a[0]||(a[0]=f("span",{class:"head-title"},"运行状态",-1)),f("span",$S,E(e.busy?"正在处理会话":"已就绪,等待任务"),1),f("span",TS,[f("span",{class:de(["head-dot",{busy:e.busy}]),title:e.busy?"Agent 正在处理":"空闲"},null,10,AS),Z(be,{class:de(["chevron",{rotated:n.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,xS),Ye(f("div",RS,[f("dl",IS,[f("div",ES,[a[1]||(a[1]=f("dt",null,"连接",-1)),f("dd",null,[f("span",{class:de(["conn-dot",e.connectionStatus]),"aria-hidden":"true"},null,2),f("span",{class:de(["conn",e.connectionStatus])},E(i.value),3)])]),f("div",PS,[a[2]||(a[2]=f("dt",null,"上下文占用",-1)),o.value!==null?(y(),b("dd",{key:0,title:r.value},[Z(au,{usage:e.status.contextUsage,size:14},null,8,["usage"]),Re(E(o.value)+"% ",1)],8,MS)):(y(),b("dd",LS,"未知"))]),f("div",NS,[a[3]||(a[3]=f("dt",null,"Token(输入 / 上限)",-1)),f("dd",OS,E(((c=e.status.contextTokens)==null?void 0:c.toLocaleString())??"-")+" / "+E(((u=e.status.maxContextTokens)==null?void 0:u.toLocaleString())??"-"),1)])])],512),[[eu,n.value]])],2)}}}),BS=xe(DS,[["__scopeId","data-v-59b0c4e7"]]),jS={class:"todo-panel panel-section"},US={class:"section-heading"},GS={class:"head-icon"},FS={class:"head-hint"},zS={class:"head-tail"},HS={class:"head-count"},qS={key:0,class:"panel-body"},WS={class:"empty-state"},VS={key:1,class:"panel-body"},KS={class:"progress-row"},ZS={class:"bar","aria-hidden":"true"},JS={class:"progress-value"},YS=["title"],XS={class:"todo-title"},QS=Se({__name:"TodoPanel",props:{todos:{}},setup(e){const t=e,n=X(()=>Jp(t.todos)),s=X(()=>t.todos.filter(c=>c.status==="done").length),o=X(()=>t.todos.filter(c=>c.status==="in_progress").length),r=X(()=>t.todos.filter(c=>c.status==="pending").length),i=X(()=>t.todos.length?Math.round(s.value/t.todos.length*100):0),l=X(()=>{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)=>(y(),b("section",jS,[f("div",US,[f("span",GS,[Z(be,{name:"clipboard",size:14})]),u[0]||(u[0]=f("span",{class:"head-title"},"核心 Todo",-1)),f("span",FS,E(l.value),1),f("span",zS,[f("span",HS,E(s.value)+"/"+E(e.todos.length),1)])]),e.todos.length===0?(y(),b("div",qS,[f("div",WS,[Z(be,{name:"check",size:18}),u[1]||(u[1]=f("span",null,"暂无 Todo",-1)),u[2]||(u[2]=f("small",null,"Agent 创建任务清单后会在这里实时显示。",-1))])])):(y(),b("div",VS,[f("div",KS,[f("i",ZS,[f("i",{style:ln({width:`${i.value}%`})},null,4)]),f("span",JS,E(i.value)+"%",1)]),(y(!0),b(ee,null,Ve(n.value,(d,h)=>(y(),b("section",{key:d.phase??`unphased-${h}`,class:"todo-group"},[f("h4",null,E(d.phase??"未分阶段"),1),f("ol",null,[(y(!0),b(ee,null,Ve(d.items,(p,g)=>(y(),b("li",{key:`${h}-${g}-${p.title}`,class:de(`is-${p.status}`)},[f("span",{class:"status-symbol",title:a[p.status].label},E(a[p.status].symbol),9,YS),f("span",XS,E(p.title),1),f("small",null,E(a[p.status].label),1)],2))),128))])]))),128))]))]))}}),ex=xe(QS,[["__scopeId","data-v-6a025f22"]]),tx={class:"drawer"},nx={class:"drawer-toolbar"},sx={class:"drawer-tabs",role:"tablist","aria-label":"抽屉面板"},ox=["aria-selected"],rx=["aria-selected"],ix={class:"drawer-body"},lx={class:"git-diff-head"},ax=["title"],cx={class:"git-diff-tools"},ux={key:0,class:"git-diff-stat"},fx={key:0,class:"add"},dx={key:1,class:"del"},hx={key:0,class:"git-diff-body"},px={key:1,class:"git-diff-empty"},gx=Se({__name:"SessionDrawer",props:{client:{}},emits:["refresh-git","close","insert"],setup(e){const t=e,n=N("detail"),s=N(null),o=N(null);async function r(C){var P,J,ie;s.value={...C,lines:[],loading:!0};try{const ve=await(await fetch(`/api/v1/git/diff?path=${encodeURIComponent(C.path)}`)).json(),O=zk(ve.patch??""),L=C.adds??(C.dels===void 0?O.filter(te=>te.type==="add").length:void 0);s.value={...C,adds:L,lines:O,loading:!1}}catch{s.value={...C,lines:[],loading:!1}}await Ot();const R=((J=(P=globalThis.window)==null?void 0:P.matchMedia)==null?void 0:J.call(P,"(prefers-reduced-motion: reduce)").matches)===!0;(ie=o.value)==null||ie.scrollIntoView({block:"start",behavior:R?"auto":"smooth"})}const{connectionStatus:i,status:l,sessionId:a,isBusy:c,isArchived:u,goal:d,todos:h,goalRequestPending:p,goalRequestError:g,like:_,gitStatus:k,refineGoal:w,createGoal:x,updateGoal:$,pauseGoal:A,resumeGoal:F,cancelGoal:Q}=t.client;return(C,R)=>{const P=bh("SvgIcon");return y(),b("aside",tx,[f("div",nx,[f("div",sx,[f("button",{role:"tab","aria-selected":n.value==="detail",class:de(["drawer-tab",{active:n.value==="detail"}]),onClick:R[0]||(R[0]=J=>n.value="detail")}," 详情 ",10,ox),f("button",{role:"tab","aria-selected":n.value==="files",class:de(["drawer-tab",{active:n.value==="files"}]),onClick:R[1]||(R[1]=J=>n.value="files")}," 文件 ",10,rx)]),f("button",{class:"drawer-close",title:"收起面板","aria-label":"收起详情",onClick:R[2]||(R[2]=J=>C.$emit("close"))},[Z(P,{name:"panel-right",size:16})])]),f("div",ix,[n.value==="detail"?(y(),b(ee,{key:0},[Z(BS,{status:re(l),busy:re(c),"connection-status":re(i)},null,8,["status","busy","connection-status"]),Z(p_,{"git-status":re(k),onRefresh:R[3]||(R[3]=J=>C.$emit("refresh-git")),onDiff:r},null,8,["git-status"]),s.value?(y(),b("div",{key:0,ref_key:"diffRef",ref:o,class:"git-diff-view"},[f("div",lx,[f("span",{class:"git-diff-title",title:s.value.path},E(s.value.loading?"加载中…":s.value.display),9,ax),f("span",cx,[!s.value.loading&&(s.value.adds||s.value.dels)?(y(),b("span",ux,[s.value.adds?(y(),b("span",fx,"+"+E(s.value.adds),1)):D("",!0),s.value.dels?(y(),b("span",dx,"−"+E(s.value.dels),1)):D("",!0)])):D("",!0),f("button",{class:"git-diff-close",title:"关闭 diff","aria-label":"关闭 diff",onClick:R[4]||(R[4]=J=>s.value=null)},"✕")])]),s.value.lines.length?(y(),b("div",hx,[Z(of,{lines:s.value.lines},null,8,["lines"])])):s.value.loading?D("",!0):(y(),b("p",px,"该文件无差异内容(可能是二进制文件或已被忽略)。"))],512)):D("",!0),Z(ex,{todos:re(h)},null,8,["todos"]),Z(SS,{like:re(_),"update-like":t.client.updateLike},null,8,["like","update-like"]),Z(fS,{goal:re(d),"session-id":re(a),"connection-status":re(i),busy:re(c),archived:re(u),pending:re(p),error:re(g),"refine-goal":re(w),"create-goal":re(x),"update-goal":re($),"pause-goal":re(A),"resume-goal":re(F),"cancel-goal":re(Q)},null,8,["goal","session-id","connection-status","busy","archived","pending","error","refine-goal","create-goal","update-goal","pause-goal","resume-goal","cancel-goal"])],64)):(y(),qe(qw,{key:t.client.workDir.value||"none","initial-path":t.client.workDir.value||""},null,8,["initial-path"]))])])}}}),mx=xe(gx,[["__scopeId","data-v-2d1f803d"]]),vx={class:"conversation"},yx={class:"chat-stage"},bx={class:"chat-column"},kx={class:"composer-dock"},wx=Se({__name:"ConversationView",props:{client:{}},emits:["home"],setup(e,{emit:t}){const n=e,s=t,{connectionStatus:o,messages:r,pendingApprovals:i,status:l,sessionId:a,workDir:c,isBusy:u,models:d,sendPrompt:h,sendCommand:p,clearMessages:g,appendSystemMessage:_,abort:k,resolveApproval:w,exportSession:x,fetchSnapshot:$,switchModel:A,switchThinking:F}=n.client,Q=N(null),C=N(!1),R=N(!1),P=N("status"),J=X(()=>{const ke=n.client.sessions.value.find(Te=>Te.sessionId===n.client.currentSessionId.value),ae=ke==null?void 0:ke.title;if(ae&&ae!=="新会话"&&ae!=="New Session")return ae;const Ce=r.value.find(Te=>Te.role==="user");if(Ce){const Te=Ce.content.replace(/\s+/g," ").trim();if(Te)return Te.length>24?`${Te.slice(0,24)}…`:Te}return ae??null});function ie(ke){var ae;(ae=Q.value)==null||ae.insertText(ke)}function z(ke){$(),P.value=ke,R.value=!0}function ve(){var ae;(((ae=Q.value)==null?void 0:ae.openModelPicker())??!1)||_(`当前模型:${l.value.model??"unknown"}`)}function O(ke,ae){switch(ke){case"compact":p("compact");break;case"model":ve();break;case"clear":g();break;case"new":s("home");break;case"help":_(lu());break;case"auto":case"yes":case"plan":case"fork":case"title":case"btw":p(ke,ae);break;case"status":z("status");break;case"usage":z("usage");break;default:_(`未知命令:/${ke}`)}}function L(ke){p("title",ke)}function te(){if(u.value||!o.value)return;const ke=[...r.value].reverse().find(ae=>ae.role==="user");ke&&h(ke.content)}const q=N(!1);async function ge(){q.value=!0,await n.client.loadOlderMessages(),q.value=!1}function Ae(){u.value||(p("fork"),setTimeout(()=>{n.client.fetchSessions()},1200))}return(ke,ae)=>(y(),b("div",vx,[Z(Um,{title:J.value,busy:re(u),"drawer-open":C.value,onHome:ae[0]||(ae[0]=Ce=>s("home")),onRename:L,onExport:ae[1]||(ae[1]=Ce=>re(a)&&re(x)(re(a))),onClear:re(g),onToggleDrawer:ae[2]||(ae[2]=Ce=>C.value=!C.value)},null,8,["title","busy","drawer-open","onClear"]),f("div",yx,[f("div",bx,[Z(ww,{messages:re(r),busy:re(u),"work-dir":re(c),"session-id":re(a)??"",model:re(l).model??null,"context-usage":re(l).contextUsage??null,connected:re(o)==="connected","older-available":n.client.olderAvailable.value,"older-loading":q.value,onEdit:ie,onPick:re(h),onRetryConnection:ae[3]||(ae[3]=Ce=>n.client.reconnectNow()),onRetryMessage:te,onLoadOlder:ge,onFork:Ae},null,8,["messages","busy","work-dir","session-id","model","context-usage","connected","older-available","older-loading","onPick"]),f("div",kx,[Z(vg,{approvals:re(i),onResolve:re(w)},null,8,["approvals","onResolve"]),Z(cu,{ref_key:"composerRef",ref:Q,busy:re(u),status:re(l),"session-id":re(a),models:re(d),onSend:re(h),onAbort:re(k),onCommand:O,onSwitchModel:re(A),onSwitchThinking:re(F)},null,8,["busy","status","session-id","models","onSend","onAbort","onSwitchModel","onSwitchThinking"])])]),Z(ur,{name:"drawer"},{default:$t(()=>[C.value?(y(),qe(mx,{key:0,client:n.client,onRefreshGit:ae[4]||(ae[4]=Ce=>n.client.fetchGitStatus()),onClose:ae[5]||(ae[5]=Ce=>C.value=!1)},null,8,["client"])):D("",!0)]),_:1})]),R.value?(y(),qe(_v,{key:0,mode:P.value,status:re(l),"session-id":re(a),"work-dir":re(c),onClose:ae[6]||(ae[6]=Ce=>R.value=!1)},null,8,["mode","status","session-id","work-dir"])):D("",!0)]))}}),_x=xe(wx,[["__scopeId","data-v-fc80feee"]]),Sx={class:"settings"},xx={class:"settings-inner"},Cx={class:"settings-section"},$x={class:"theme-grid",role:"radiogroup","aria-label":"主题"},Tx=["aria-checked","onClick"],Ax={class:"settings-section"},Rx={class:"like-fields"},Ix={class:"like-label"},Ex=["onUpdate:modelValue","placeholder","aria-label"],Px={class:"like-actions"},Mx={key:0,class:"saved-hint"},Lx=Se({__name:"SettingsView",props:{like:{default:()=>({})}},emits:["update-like"],setup(e,{emit:t}){const n=e,s=t,o=vn("theme",N("system")),r=vn("setTheme",()=>{}),i=[{id:"light",label:"浅色",icon:"sun"},{id:"dark",label:"深色",icon:"moon"},{id:"system",label:"跟随系统",icon:"monitor"}],l=N({...n.like}),a=N(!1);Oe(()=>n.like,h=>{l.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",d()),a.value=!0,setTimeout(()=>a.value=!1,1500)}function d(){const h={};for(const p of c){const g=l.value[p.key];typeof g=="string"&&g.trim()&&(h[p.key]=g.trim())}return h}return(h,p)=>(y(),b("div",Sx,[f("div",xx,[p[3]||(p[3]=f("h1",{class:"settings-title"},"设置",-1)),f("section",Cx,[p[0]||(p[0]=f("h2",{class:"section-title"},"外观",-1)),f("div",$x,[(y(),b(ee,null,Ve(i,g=>f("button",{key:g.id,role:"radio","aria-checked":re(o)===g.id,class:de(["theme-option",{active:re(o)===g.id}]),onClick:_=>re(r)(g.id)},[Z(be,{name:g.icon,size:20},null,8,["name"]),f("span",null,E(g.label),1)],10,Tx)),64))])]),f("section",Ax,[p[2]||(p[2]=f("h2",{class:"section-title"},"偏好设置",-1)),f("div",Rx,[(y(),b(ee,null,Ve(c,g=>f("label",{key:g.key,class:"like-field"},[f("span",Ix,E(g.label),1),Ye(f("input",{"onUpdate:modelValue":_=>l.value[g.key]=_,class:"like-input",placeholder:g.hint,"aria-label":g.label},null,8,Ex),[[ut,l.value[g.key]]])])),64)),f("div",Px,[Z(Jn,{variant:"primary",onClick:u},{default:$t(()=>[...p[1]||(p[1]=[Re("保存偏好",-1)])]),_:1}),a.value?(y(),b("span",Mx,"已保存")):D("",!0)])])])])]))}}),Nx=xe(Lx,[["__scopeId","data-v-701eb9cd"]]),rf=""+new URL("logo-v2-ChmPAIbI.svg",import.meta.url).href,Ox={class:"sidebar-head"},Dx=["src"],Bx=["title","aria-label","aria-expanded"],jx=["title"],Ux={key:0},Gx={key:0,class:"side-search"},Fx={class:"spaces"},zx=["title"],Hx=["title","onClick"],qx={class:"space-name"},Wx={class:"space-count"},Vx={key:0,class:"space-sessions"},Kx=["title","onClick"],Zx={key:0,class:"session-run","aria-hidden":"true"},Jx={class:"session-text"},Yx={class:"session-title"},Xx={class:"session-meta"},Qx=["title","onClick","onKeydown"],eC={key:0,class:"spaces-empty"},tC={class:"sidebar-foot","aria-label":"功能区"},nC=["title"],sC={key:0},oC=["title"],rC={key:0},iC={class:"sidebar-identity"},lC={key:0,class:"identity-text"},aC=Se({__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=N(null),i=N("");function l(){var k,w;(k=r.value)==null||k.focus(),(w=r.value)==null||w.select()}t({focusSearch:l});const a=X(()=>{const k=i.value.trim().toLowerCase();return k?s.sessions.filter(w=>_(w).toLowerCase().includes(k)||w.workDir.toLowerCase().includes(k)):s.sessions}),c=X(()=>{var x;const k=new Map;for(const $ of a.value){const A=$.workDir||"默认空间",F=A.split(/[\\/]/).filter(Boolean),Q=F.length>0?F[F.length-1]:A,C=k.get(Q);C?C.items.push($):k.set(Q,{name:Q,workDir:A,items:[$]})}const w=(x=s.sessions.find($=>$.sessionId===s.currentSessionId))==null?void 0:x.workDir;return[...k.values()].sort(($,A)=>{var F,Q;return $.workDir===w?-1:A.workDir===w?1:(((F=A.items[0])==null?void 0:F.createdAt)??0)-(((Q=$.items[0])==null?void 0:Q.createdAt)??0)})}),u=N(new Set);function d(k){const w=new Set(u.value);w.has(k)?w.delete(k):w.add(k),u.value=w}function h(k){o("switch-session",k)}function p(k,w){window.confirm(`删除会话「${w}」?此操作不可恢复。`)&&o("delete-session",k)}function g(k){if(!k)return"";const w=Date.now()-k;if(w<6e4)return"刚刚";if(w<36e5)return`${Math.floor(w/6e4)} 分钟前`;if(w<864e5)return`${Math.floor(w/36e5)} 小时前`;const x=new Date(k);return`${x.getMonth()+1}/${x.getDate()}`}function _(k){const w=(k.title||"").trim();return w&&w!=="新会话"&&w!=="New Session"?w:"未命名会话"}return(k,w)=>(y(),b("aside",{class:de(["sidebar",{"is-collapsed":e.collapsed}])},[f("div",Ox,[f("button",{class:"sidebar-brand",title:"回到新对话",onClick:w[0]||(w[0]=x=>o("navigate","home"))},[f("img",{class:"brand-logo",src:re(rf),alt:"scream"},null,8,Dx)]),e.showCollapseToggle?(y(),b("button",{key:0,class:de(["collapse-btn",{rotated:e.collapsed}]),title:e.collapsed?"展开侧栏":"折叠侧栏","aria-label":e.collapsed?"展开侧栏":"折叠侧栏","aria-expanded":!e.collapsed,onClick:w[1]||(w[1]=x=>o("toggle-collapse"))},[Z(be,{name:"panel-left",size:15})],10,Bx)):D("",!0)]),f("button",{class:"new-chat-btn",title:e.collapsed?"新建对话":void 0,onClick:w[2]||(w[2]=x=>o("create-session"))},[Z(be,{name:"plus",size:16}),e.collapsed?D("",!0):(y(),b("span",Ux,"新建对话"))],8,jx),e.collapsed?D("",!0):(y(),b("label",Gx,[Z(be,{name:"search",size:15}),Ye(f("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":w[3]||(w[3]=x=>i.value=x),type:"text",placeholder:"搜索会话… (⌘K)","aria-label":"搜索会话",spellcheck:"false"},null,512),[[ut,i.value]])])),f("div",Fx,[(y(!0),b(ee,null,Ve(c.value,x=>(y(),b("div",{key:x.name,class:"space-group"},[e.collapsed?(y(),b("button",{key:0,class:de(["space-dot",{active:x.items.some($=>$.sessionId===e.currentSessionId)}]),title:x.name,onClick:w[4]||(w[4]=$=>o("toggle-collapse"))},E(x.name.slice(0,1).toUpperCase()),11,zx)):(y(),b(ee,{key:1},[f("button",{class:"space-head",title:x.workDir,onClick:$=>d(x.name)},[Z(be,{name:u.value.has(x.name)?"chevron-right":"chevron-down",size:14},null,8,["name"]),f("span",qx,E(x.name),1),f("span",Wx,E(x.items.length),1)],8,Hx),u.value.has(x.name)?D("",!0):(y(),b("div",Vx,[(y(!0),b(ee,null,Ve(x.items,$=>(y(),b("button",{key:$.sessionId,class:de(["session-item",{active:$.sessionId===e.currentSessionId}]),title:_($),onClick:A=>h($.sessionId)},[$.active?(y(),b("span",Zx)):D("",!0),f("span",Jx,[f("span",Yx,E(_($)),1),f("span",Xx,[f("span",null,E(g($.createdAt)),1),w[7]||(w[7]=f("span",{class:"meta-sep","aria-hidden":"true"},"·",-1)),f("span",null,E($.messageCount)+" 条",1)])]),f("span",{class:"session-delete",role:"button",tabindex:"0",title:`删除会话 ${_($)}`,"aria-label":"删除会话",onClick:At(A=>p($.sessionId,_($)),["stop"]),onKeydown:Os(At(A=>p($.sessionId,_($)),["stop","prevent"]),["enter"])},[Z(be,{name:"trash",size:14})],40,Qx)],10,Kx))),128))]))],64))]))),128)),!e.collapsed&&c.value.length===0?(y(),b("p",eC,E(i.value?"没有匹配的会话":"还没有会话,点击上方「新建对话」开始"),1)):D("",!0)]),f("nav",tC,[f("button",{class:de(["foot-item",{active:e.view==="skills"}]),title:e.collapsed?"技能中心":void 0,onClick:w[5]||(w[5]=x=>o("navigate","skills"))},[Z(be,{name:"sparkles",size:17}),e.collapsed?D("",!0):(y(),b("span",sC,"技能中心"))],10,nC),f("button",{class:de(["foot-item",{active:e.view==="settings"}]),title:e.collapsed?"设置":void 0,onClick:w[6]||(w[6]=x=>o("navigate","settings"))},[Z(be,{name:"settings",size:17}),e.collapsed?D("",!0):(y(),b("span",rC,"设置"))],10,oC),f("div",iC,[w[8]||(w[8]=f("span",{class:"identity-dot","aria-hidden":"true"},null,-1)),e.collapsed?D("",!0):(y(),b("span",lC,"scream web"))])])],2))}}),Pa=xe(aC,[["__scopeId","data-v-953de751"]]),cC={class:"skills"},uC={class:"skills-head"},fC={class:"skills-grid"},dC={class:"skill-card-head"},hC={class:"skill-cmd"},pC={class:"skill-desc"},gC={key:0,class:"skill-aliases"},mC=Se({__name:"SkillsView",emits:["create"],setup(e,{emit:t}){const n=t,s={backend:"服务端",local:"本地"};return(o,r)=>(y(),b("div",cC,[f("div",uC,[r[2]||(r[2]=f("div",null,[f("h1",{class:"skills-title"},"技能中心"),f("p",{class:"skills-sub"},[Re("在输入框中输入 "),f("code",null,"/"),Re(" 即可触发以下命令")])],-1)),Z(Jn,{variant:"primary",onClick:r[0]||(r[0]=i=>n("create"))},{default:$t(()=>[Z(be,{name:"plus",size:16}),r[1]||(r[1]=Re(" 新建会话 ",-1))]),_:1})]),f("div",fC,[(y(!0),b(ee,null,Ve(re(fr),i=>{var l;return y(),b("article",{key:i.name,class:"skill-card"},[f("div",dC,[f("span",hC,"/"+E(i.name),1),f("span",{class:de(["skill-target",`target-${i.target}`])},E(s[i.target]),3)]),f("p",pC,E(i.description),1),(l=i.aliases)!=null&&l.length?(y(),b("p",gC," 别名:"+E(i.aliases.map(a=>`/${a}`).join(" ")),1)):D("",!0)])}),128))])]))}}),vC=xe(mC,[["__scopeId","data-v-35313e25"]]),yC={class:"mode-switch",role:"group","aria-label":"工作模式"},bC=["aria-pressed","onClick"],kC=Se({__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)=>(y(),b("div",yC,[(y(),b(ee,null,Ve(s,i=>f("button",{key:i.id,class:de(["mode-pill",`is-${i.id}`,{active:e.modelValue===i.id}]),"aria-pressed":e.modelValue===i.id,onClick:l=>n("update:modelValue",i.id)},E(i.label),11,bC)),64))]))}}),wC=xe(kC,[["__scopeId","data-v-c4ac7862"]]),_C={class:"workspace"},SC={class:"workspace-hero"},xC={class:"workspace-brand"},CC=["src"],$C={class:"mode-hint"},TC={class:"workspace-composer"},AC=Se({__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=X(()=>n.mode==="goal"),r=X(()=>o.value?"任务模式:提交后将创建执行目标(Goal),Agent 持续执行到完成或预算耗尽;抽屉「Goal 管理」可查看与暂停。":"直接对话:提问后 Agent 按需调用工具完成你的请求。");return(i,l)=>(y(),b("div",_C,[f("section",SC,[f("h1",xC,[f("img",{class:"brand-logo",src:re(rf),alt:"scream"},null,8,CC)]),l[5]||(l[5]=f("p",{class:"workspace-tagline"},"你的智能协作伙伴",-1)),Z(wC,{class:"workspace-mode","model-value":n.mode,"onUpdate:modelValue":l[0]||(l[0]=a=>s("update:mode",a))},null,8,["model-value"]),f("p",$C,[(y(),b("span",{key:String(o.value),class:"hint-fade"},E(r.value),1))])]),f("section",TC,[Z(cu,{busy:e.busy,status:e.status,models:e.models,variant:"home",placeholder:o.value?"描述你要完成的目标,Enter 创建并开始执行…":"输入 @ 引用知识库 / 使用技能 / 或者直接提问...",onSend:l[1]||(l[1]=a=>s("send",a,n.mode)),onCommand:l[2]||(l[2]=(a,c)=>s("command",a,c)),onSwitchModel:l[3]||(l[3]=a=>s("switch-model",a)),onSwitchThinking:l[4]||(l[4]=a=>s("switch-thinking",a))},null,8,["busy","status","models","placeholder"])])]))}}),RC=xe(AC,[["__scopeId","data-v-2f5f04ab"]]),IC=["aria-valuenow"],EC={key:2,class:"sidebar-mobile"},PC={class:"canvas"},MC={class:"topbar mobile-only"},LC={class:"topbar-left"},NC={key:0,class:"topbar-running",title:"Agent 运行中"},OC={class:"canvas-body"},Ma="scream-sidebar-collapsed",La="scream-sidebar-width",fo=180,ho=480,Na=288,Oa="scream-workspace-mode",DC=Se({__name:"WebShell",setup(e){const t=tg(),{connectionStatus:n,status:s,isBusy:o,sessions:r,currentSessionId:i,models:l,like:a,sendPrompt:c,sendCommand:u,appendSystemMessage:d,createSession:h,switchSession:p,deleteSession:g,switchModel:_,switchThinking:k,fetchLike:w,fetchGitStatus:x,abort:$}=t,A=N("home"),F=N(!1),Q=N(null);function C(ne=8e3){return n.value==="connected"?Promise.resolve(!0):new Promise(ce=>{const m=Date.now(),S=window.setInterval(()=>{n.value==="connected"?(window.clearInterval(S),ce(!0)):Date.now()-m>ne&&(window.clearInterval(S),ce(!1))},80)})}function R(ne){ne==="chat"?i.value?A.value="chat":P():A.value=ne,F.value=!1}function P(){F.value=!1,A.value="chat",h()}async function J(ne,ce){if(F.value=!1,i.value||await h(),!!await C())if(A.value="chat",ce==="goal")try{await t.createGoal({objective:ne,budgets:[]})}catch(S){d(`Goal 创建失败:${ie(S)}。已保留对话模式,可重新发送。`),c(ne);return}else c(ne)}function ie(ne){return ne instanceof Error?ne.message:String(ne)}function z(ne){F.value=!1,A.value="chat",p(ne)}function ve(ne,ce){switch(ne){case"compact":case"auto":case"yes":case"plan":case"fork":case"title":case"btw":if(!i.value){h().then(()=>u(ne,ce));return}u(ne,ce);break;case"clear":t.clearMessages();break;case"new":P();break;case"help":d(lu());break;case"model":d(`当前模型:${s.value.model??"unknown"}`);break;case"status":case"usage":d("请在对话页查看会话详情");break;default:d(`未知命令:/${ne}`)}}const O=N(!1);try{O.value=localStorage.getItem(Ma)==="1"}catch{}function L(){O.value=!O.value;try{localStorage.setItem(Ma,O.value?"1":"0")}catch{}}function te(){try{const ne=Number(localStorage.getItem(La));if(Number.isFinite(ne)&&ne>=fo&&ne<=ho)return Math.round(ne)}catch{}return Na}const q=N(te()),ge=N(!1);let Ae=null;function ke(){try{localStorage.setItem(La,String(q.value))}catch{}}function ae(ne){if(!O.value){ne.preventDefault(),ge.value=!0,Ae=ne.pointerId;try{ne.currentTarget.setPointerCapture(ne.pointerId)}catch{}}}function Ce(ne){!ge.value||ne.pointerId!==Ae||(q.value=Math.min(ho,Math.max(fo,Math.round(ne.clientX))))}function Te(ne){!ge.value||ne.pointerId!==Ae||(ge.value=!1,Ae=null,ke())}function Rt(){q.value=Na,ke()}function Ke(ne){const ce=ne.shiftKey?32:12;if(ne.key==="ArrowLeft")ne.preventDefault(),q.value=Math.max(fo,q.value-ce);else if(ne.key==="ArrowRight")ne.preventDefault(),q.value=Math.min(ho,q.value+ce);else if(ne.key==="Home")ne.preventDefault(),q.value=fo;else if(ne.key==="End")ne.preventDefault(),q.value=ho;else if(ne.key==="Enter")ne.preventDefault(),Rt();else return;ke()}function Ze(){try{return localStorage.getItem(Oa)==="goal"?"goal":"chat"}catch{return"chat"}}const xt=N(Ze());function mt(ne){xt.value=ne;try{localStorage.setItem(Oa,ne)}catch{}}function Gt(ne){if((ne.metaKey||ne.ctrlKey)&&ne.key==="k")ne.preventDefault(),O.value&&L(),Ot(()=>{var ce;return(ce=Q.value)==null?void 0:ce.focusSearch()});else if((ne.metaKey||ne.ctrlKey)&&ne.key==="n")ne.preventDefault(),P();else if(ne.key==="Escape"&&o.value){const ce=ne.target;ce&&(ce.tagName==="TEXTAREA"||ce.tagName==="INPUT")||(ne.preventDefault(),$())}}return Ut(()=>{window.addEventListener("keydown",Gt),w(),x()}),Vt(()=>window.removeEventListener("keydown",Gt)),(ne,ce)=>(y(),b("div",{class:de(["shell",{"sidebar-collapsed":O.value,resizing:ge.value}]),style:ln({"--sidebar-width":q.value+"px"})},[Z(Pa,{ref_key:"sidebarRef",ref:Q,view:A.value,sessions:re(r),"current-session-id":re(i),collapsed:O.value,onNavigate:R,onSwitchSession:z,onDeleteSession:re(g),onCreateSession:P,onToggleCollapse:L},null,8,["view","sessions","current-session-id","collapsed","onDeleteSession"]),O.value?D("",!0):(y(),b("div",{key:0,class:de(["sidebar-resize-handle",{resizing:ge.value}]),role:"separator","aria-orientation":"vertical","aria-label":"调整侧栏宽度","aria-valuenow":q.value,"aria-valuemin":"180","aria-valuemax":"480",tabindex:"0",title:"拖拽调整宽度 · 双击复位",onPointerdown:ae,onPointermove:Ce,onPointerup:Te,onPointercancel:Te,onDblclick:Rt,onKeydown:Ke},null,42,IC)),F.value?(y(),b("div",{key:1,class:"sidebar-backdrop","aria-hidden":"true",onClick:ce[0]||(ce[0]=m=>F.value=!1)})):D("",!0),F.value?(y(),b("div",EC,[Z(Pa,{view:A.value,sessions:re(r),"current-session-id":re(i),"show-collapse-toggle":!1,onNavigate:R,onSwitchSession:z,onDeleteSession:re(g),onCreateSession:P},null,8,["view","sessions","current-session-id","onDeleteSession"])])):D("",!0),f("main",PC,[f("header",MC,[f("div",LC,[f("button",{class:"topbar-icon mobile-menu",title:"菜单","aria-label":"打开菜单",onClick:ce[1]||(ce[1]=m=>F.value=!0)},[Z(be,{name:"menu",size:20})]),re(o)?(y(),b("span",NC,[...ce[3]||(ce[3]=[f("span",{class:"running-dot","aria-hidden":"true"},null,-1),f("span",{class:"running-text"},"运行中",-1)])])):D("",!0)])]),f("div",OC,[A.value==="home"?(y(),qe(RC,{key:0,models:re(l),status:re(s),busy:re(o),mode:xt.value,"onUpdate:mode":mt,onSend:J,onCommand:ve,onSwitchModel:re(_),onSwitchThinking:re(k)},null,8,["models","status","busy","mode","onSwitchModel","onSwitchThinking"])):A.value==="chat"?(y(),qe(_x,{key:1,client:re(t),onHome:ce[2]||(ce[2]=m=>A.value="home")},null,8,["client"])):A.value==="skills"?(y(),qe(vC,{key:2,onCreate:P})):A.value==="settings"?(y(),qe(Nx,{key:3,like:re(a),onUpdateLike:re(t).updateLike},null,8,["like","onUpdateLike"])):D("",!0)])])],6))}}),BC=xe(DC,[["__scopeId","data-v-200eabc6"]]),jC={class:"toast-container"},UC=["onClick"],GC={class:"toast-icon"},FC={class:"toast-msg"},zC=Se({__name:"Toast",setup(e){const{toasts:t,removeToast:n}=iu(),s={info:"ℹ",success:"✓",error:"✗",warning:"⚠"};return(o,r)=>(y(),qe(Mi,{to:"body"},[f("div",jC,[Z(Ep,{name:"toast"},{default:$t(()=>[(y(!0),b(ee,null,Ve(re(t),i=>(y(),b("div",{key:i.id,class:de(["toast",`toast--${i.type}`]),onClick:l=>re(n)(i.id)},[f("span",GC,E(s[i.type]),1),f("span",FC,E(i.message),1)],10,UC))),128))]),_:1})])]))}}),HC=xe(zC,[["__scopeId","data-v-a432e638"]]),qC={class:"app"},WC=Se({__name:"App",setup(e){const t=N("system"),n=N("dark");go("effectiveTheme",n),go("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 d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",s[u])}let r=null;function i(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)}go("setTheme",i),Ut(()=>{try{const a=localStorage.getItem("scream-theme");(a==="light"||a==="dark"||a==="system")&&(t.value=a)}catch{}o()}),Oe(t,o);const l=window.matchMedia("(prefers-color-scheme: dark)");return l.addEventListener("change",o),Vt(()=>{l.removeEventListener("change",o),r!==null&&clearTimeout(r),document.documentElement.classList.remove("theme-transition")}),(a,c)=>(y(),b("div",qC,[Z(BC),Z(HC)]))}}),VC=xe(WC,[["__scopeId","data-v-f4ac7b91"]]);Fp(VC).mount("#app");
|
|
93
|
+
//# sourceMappingURL=index-DDVdau1l.js.map
|